/** * Load configuration for this module. * * @param ConfigManager $config */ public function loadConfig(ConfigManager $config) { $file = $this->getDirectory() . 'config.yml'; if (file_exists($file)) { $config->load($file); } }
public function testVariablesCanBeUsedForReferences() { $manager = new ConfigManager(); $manager->loadValues(['log_path' => '%ROOT%/logs/%ENV%.log']); $manager->addProcessor(new ReferenceProcessor()); $manager->addProcessor($this->processor); $this->neptune->expects($this->once())->method('getRootDirectory')->will($this->returnValue('/path/to/app')); $this->neptune->expects($this->once())->method('getEnv')->will($this->returnValue('dev')); $this->assertSame('/path/to/app/logs/dev.log', $manager->getConfig()->get('log_path')); }
/** * Load configuration specific to this application. * * @param ConfigManager $config */ public function loadConfig(ConfigManager $config) { $config->load($this->root_directory . 'config/neptune.yml'); if ($this->env) { $config->load(sprintf('%sconfig/env/%s.yml', $this->root_directory, $this->env)); } }