configure() public method

Configure and register Logger(s) according to the options passed in
public configure ( )
Esempio n. 1
0
 public function testLoggersConfigured()
 {
     $options = Fixtures::getPhpArrayConfig();
     // Mocking the ConfigLoader with the load method
     $configLoader = $this->getMockBuilder('Cascade\\Config\\ConfigLoader')->disableOriginalConstructor()->setMethods(array('load'))->getMock();
     $configLoader->method('load')->willReturn($options);
     $config = new Config($options, $configLoader);
     $config->load();
     $config->configure();
     $this->assertTrue(Registry::hasLogger('my_logger'));
 }
Esempio n. 2
0
 /**
  * Load configuration options from a file or a string
  *
  * @param string $resource path to config file or string or array
  */
 public static function fileConfig($resource)
 {
     self::$config = new Config($resource, new ConfigLoader());
     self::$config->load();
     self::$config->configure();
 }