X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Fexamples%2Fhelloworld.script;h=fcb1e9ff34d9816e1e74bc4ac0d9756a57f53fd8;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=07d079c98b9f923add6fb9999a15f55f1c555016;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/drush/drush/examples/helloworld.script b/vendor/drush/drush/examples/helloworld.script index 07d079c98..fcb1e9ff3 100755 --- a/vendor/drush/drush/examples/helloworld.script +++ b/vendor/drush/drush/examples/helloworld.script @@ -1,50 +1,27 @@ -#!/usr/bin/env drush +output()->writeln("Hello world!"); +$this->output()->writeln("The extra options/arguments to this command were:"); +$this->output()->writeln(print_r($extra, true)); -// -// If called with --everything, use drush_get_arguments -// to print the commandline arguments. Note that this -// call will include 'php-script' (the drush command) -// and the path to this script. -// -if (drush_get_option('everything')) { - drush_print(" " . implode("\n ", drush_get_arguments())); -} -// -// If --everything is not included, then use -// drush_shift to pull off the arguments one at -// a time. drush_shift only returns the user -// commandline arguments, and does not include -// the drush command or the path to this script. -// -else { - while ($arg = drush_shift()) { - drush_print(' ' . $arg); - } -} -drush_print(); // // We can check which site was bootstrapped via // the '@self' alias, which is defined only if // there is a bootstrapped site. // -$self_record = drush_sitealias_get_record('@self'); -if (empty($self_record)) { - drush_print('No bootstrapped site.'); +$self = Drush::aliasManager()->getSelf();; +if (empty($self->root())) { + $this->output()->writeln('No bootstrapped site.'); } else { - drush_print('The following site is bootstrapped:'); - _drush_sitealias_print_record($self_record); + $this->output()->writeln('The following site is bootstrapped:'); + $this->output()->writeln(print_r($self->legacyRecord(), true)); }