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); } }
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'], []); } }
/** * 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]); } }