Пример #1
0
 public function onComponentConfigRegistration(Kernel $kernel, ConfigInterface $config, $sourceComponentName, $targetComponentName, array $registeredConfig)
 {
     // Makes no sense to register commands on a SAPI different than the CLI
     if (php_sapi_name() !== 'cli') {
         return;
     }
     if (isset($registeredConfig['commands'])) {
         if (!is_array($registeredConfig['commands'])) {
             throw InvalidConfigException::create('commands', 'an array of commands configurations.');
         }
         $config->merge('components.ironedge/cli.commands', $registeredConfig['commands'], []);
     }
 }