Ejemplo n.º 1
0
 public function onAfterCache(Kernel $kernel, ConfigInterface $config)
 {
     self::$onAfterCache = true;
     if ($this->_targetComponent) {
         $config->set('components.' . $this->_targetComponent . '.on_after_cache.source_component', $this->_sourceComponent);
     }
 }
Ejemplo n.º 2
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'], []);
     }
 }
Ejemplo n.º 3
0
 /**
  * Loads configuration files from the installed components.
  *
  * @return void
  */
 protected function loadComponentsConfigFiles()
 {
     // First we load the component's config files
     $installedComponents = $this->getInstalledComponents();
     foreach ($installedComponents as $componentName => $componentPath) {
         $file = $componentPath . '/frenzy/config.yml';
         if (!is_file($file)) {
             $this->_config->set('components.' . $componentName, []);
             continue;
         }
         $this->_config->load(['file' => $file, 'loadInKey' => 'components.' . $componentName, 'processImports' => true]);
     }
 }