Last active
March 20, 2022 02:28
-
-
Save jfitzsimmons2/f87ad85222e57721c8d180d54acefbb7 to your computer and use it in GitHub Desktop.
Drush 9 @sites workaround for Drupal 8
This file contains 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
#!/usr/bin/php | |
<?php | |
/* | |
* Usage: | |
* ./drall.php [local/dev8/stage8/ww1] drushcommand | |
* ex: ./drall.php local cim | |
* | |
*/ | |
// Path to sites.php file. | |
include('docroot/sites/sites.php'); | |
$done = []; | |
$argv = $_SERVER['argv']; | |
array_shift($argv); | |
$env = array_shift($argv); | |
$parameters = implode(' ', $argv); | |
$commandPattern = "drush --uri=:key $parameters"; | |
foreach ($sites as $key => $site) { | |
if (count($argv) >= 1 && strpos($key, $env) !== false) { | |
$command = str_replace(':key', $key, $commandPattern); | |
echo "Executing command `$command` on $site\n"; | |
`$command`; | |
$done[] = $site; | |
} | |
} |
This file contains 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
$sites['local.oswego.edu.accessibility']='accessibility'; | |
$sites['dev8.oswego.edu.accessibility']='accessibility'; | |
$sites['stage8.oswego.edu.accessibility']='accessibility'; | |
$sites['ww1.oswego.edu.accessibility']='accessibility'; | |
$sites['local.oswego.edu.orientation']='orientation'; | |
$sites['dev8.oswego.edu.orientation']='orientation'; | |
$sites['stage8.oswego.edu.orientation']='orientation'; | |
$sites['ww1.oswego.edu.orientation']='orientation'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool! Came across this gist while looking for jigarius/drall on Google to see if my package was searchable. The package
jigarius/drall
brings this functionality out of the box and you might find it useful 👨💻