Created
October 6, 2011 15:09
-
-
Save dbarbar/1267636 to your computer and use it in GitHub Desktop.
Sets getclicky variables in a drush script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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