Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console-core / src / Command / Site / DebugCommand.php
index c91af67b07886d06eaadd00e200e2d5dbab5fad9..74ecad33b0824368de21eda7a866a845c2438a14 100644 (file)
@@ -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));