4 // This example demonstrates how to write a drush
5 // script. These scripts are run with the php-script command.
9 $this->output()->writeln("Hello world!");
10 $this->output()->writeln("The extra options/arguments to this command were:");
11 $this->output()->writeln(print_r($extra, true));
16 // We can check which site was bootstrapped via
17 // the '@self' alias, which is defined only if
18 // there is a bootstrapped site.
20 $self = Drush::aliasManager()->getSelf();;
21 if (empty($self->root())) {
22 $this->output()->writeln('No bootstrapped site.');
25 $this->output()->writeln('The following site is bootstrapped:');
26 $this->output()->writeln(print_r($self->legacyRecord(), true));