log(dt('Redispatch to site-local Drush: !cmd.', ['!cmd' => $command])); array_shift($argv); $args = array_map( function ($item) { return escapeshellarg($item); }, $argv ); $command .= ' ' . implode(' ', $args); passthru($command, $status); return $status; } /** * Find a site-local Drush, if there is one in the selected site's * vendor directory. * * @param string $root The selected site root */ protected static function findSiteLocalDrush($root) { $candidates = [ "$root/vendor/drush/drush/drush", dirname($root) . '/vendor/drush/drush/drush', ]; foreach ($candidates as $candidate) { if (file_exists($candidate)) { return $candidate; } } } }