Пример #1
0
 public function getAction()
 {
     $console = $this->getServiceLocator()->get('console');
     $sm = $this->getServiceLocator();
     $name = $this->params()->fromRoute('arg1');
     if (!$name) {
         $console->writeLine('config get <name> was not provided', Color::RED);
         return;
     }
     $isLocal = $this->params()->fromRoute('local');
     if ($isLocal) {
         $appdir = getcwd();
         $configFile = new Config($appdir . '/config/autoload/local.php');
         $configFile->read($name);
     } else {
         $config = $sm->get('Configuration');
         echo $name;
         $value = Config::findValueInArray($name, $config);
         if (is_scalar($value)) {
             echo ' = ' . $value;
         } else {
             echo ':' . PHP_EOL;
             var_export($value);
         }
         echo PHP_EOL;
     }
 }