Skip to content

Instantly share code, notes, and snippets.

@dbarbar
Created October 6, 2011 15:09
Show Gist options
  • Save dbarbar/1267636 to your computer and use it in GitHub Desktop.
Save dbarbar/1267636 to your computer and use it in GitHub Desktop.
Sets getclicky variables in a drush script
<?php
/**
* To run this with drush against all sites, on the command line
* drush @all -u 1 scr thisscript.php
* all says do this to every site.
* u 1 says run this as user one
* scr is shorthand for php-script and says to run the script in this file.
*/
/**
* This is the site name variable in the admin site information page
*/
$sitename = variable_get('site_name', '');
$siteid = '';
$sitekey = '';
switch ($sitename) {
case 'FierceWireless':
$siteid = 1234;
$sitekey = abcd;
break;
case 'FierceWireless:Europe':
/* ... */
break;
/* 37 more cases... */
default:
/**
* drush_print outputs a string to the screen.
*/
drush_print('No site matched.');
break;
}
variable_set('getclicky_account', $siteid);
variable_set('fierce_getlicky_sitekey', $sitekey);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment