pantheon-systems / quicksilver-examples

Example scripts for using Pantheon's Quicksilver Platform Hooks
https://docs.pantheon.io/guides/quicksilver
MIT License
128 stars 114 forks source link

shell_exec("drush pm-list --format=json") doesn't seem to work. #90

Closed jmickela closed 1 year ago

jmickela commented 8 years ago

If I change it to: shell_exec("drush pm-list --format=json 2>&1");

I get: Unknown option: --format. See drush help pm-list for available [error] options. To suppress this error, add the option --strict=0.

If I use terminus to execute the command it works correctly, but using quicksilver it doesn't seem to work.

jmickela commented 8 years ago

I changed the code to this and it's working now:

 $module_list = shell_exec("drush pm-list --status=disabled --pipe 2>&1");
 //Drush 5.x docs claim that --pipe results in space delimited output, it's actually newline delimited.
 $modules = explode("\n", $module_list);
 if (in_array('devel', $modules)) {
      passthru('drush pm-enable -y devel');
 }