X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Fsrc%2FCommands%2Fcore%2FBrowseCommands.php;fp=vendor%2Fdrush%2Fdrush%2Fsrc%2FCommands%2Fcore%2FBrowseCommands.php;h=9531774ada4c6a408d641020c9a0fc2b2b29b810;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/drush/drush/src/Commands/core/BrowseCommands.php b/vendor/drush/drush/src/Commands/core/BrowseCommands.php new file mode 100644 index 000000000..9531774ad --- /dev/null +++ b/vendor/drush/drush/src/Commands/core/BrowseCommands.php @@ -0,0 +1,59 @@ + self::REQ, 'redirect-port' => self::REQ]) + { + $aliasRecord = $this->siteAliasManager()->getSelf(); + // Redispatch if called against a remote-host so a browser is started on the + // the *local* machine. + if ($aliasRecord->isRemote()) { + $return = drush_invoke_process($aliasRecord, 'browse', [$path], Drush::redispatchOptions(), ['integrate' => true]); + if ($return['error_status']) { + throw new \Exception('Unable to execute browse command on remote alias.'); + } else { + $link = $return['object']; + } + } else { + if (!Drush::bootstrapManager()->doBootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL)) { + // Fail gracefully if unable to bootstrap Drupal. drush_bootstrap() has + // already logged an error. + return false; + } + $link = Url::fromUserInput('/' . $path, ['absolute' => true])->toString(); + } + + $this->startBrowser($link, false, $options['redirect-port']); + return $link; + } +}