Bluz\Config\Config::init PHP Метод

init() публичный Метод

Load configuration
public init ( ) : void
Результат void
    public function init()
    {
        if (!$this->path) {
            throw new ConfigException('Configuration directory is not setup');
        }
        $this->config = $this->loadFiles($this->path . '/configs/default');
        if ($this->environment) {
            $customConfig = $this->loadFiles($this->path . '/configs/' . $this->environment);
            $this->config = array_replace_recursive($this->config, $customConfig);
        }
    }

Usage Example

Пример #1
0
 /**
  * @covers Bluz\Config\Config::getData
  */
 public function testGetDataBySubSection()
 {
     $this->config->setPath($this->path);
     $this->config->setEnvironment('testing');
     $this->config->init();
     $this->assertEquals(1, $this->config->getData('application', 'section1'));
 }
All Usage Examples Of Bluz\Config\Config::init