X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal%2Fconsole-core%2Fsrc%2FCommand%2FSite%2FDebugCommand.php;h=74ecad33b0824368de21eda7a866a845c2438a14;hp=c91af67b07886d06eaadd00e200e2d5dbab5fad9;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/drupal/console-core/src/Command/Site/DebugCommand.php b/vendor/drupal/console-core/src/Command/Site/DebugCommand.php index c91af67b0..74ecad33b 100644 --- a/vendor/drupal/console-core/src/Command/Site/DebugCommand.php +++ b/vendor/drupal/console-core/src/Command/Site/DebugCommand.php @@ -56,6 +56,12 @@ class DebugCommand extends Command $this->trans('commands.site.debug.options.target'), null ) + ->addArgument( + 'property', + InputArgument::OPTIONAL, + $this->trans('commands.site.debug.options.property'), + null + ) ->setHelp($this->trans('commands.site.debug.help')); } @@ -74,6 +80,7 @@ class DebugCommand extends Command return 1; } + // --target argument $target = $input->getArgument('target'); if (!$target) { @@ -93,6 +100,20 @@ class DebugCommand extends Command return 1; } + // --property argument, allows the user to fetch specific properties of the selected site + $property = $input->getArgument('property'); + if ($property) { + $property_keys = explode('.', $property); + + $val = $targetConfig; + foreach ($property_keys as $property_key) { + $val = &$val[$property_key]; + } + + $io->writeln($val); + return 0; + } + $io->info($target); $dumper = new Dumper(); $io->writeln($dumper->dump($targetConfig, 2));