/**
  * 各个对象初始化 
  *
  * @access public static
  * @return void
  */
 public static function init($ini)
 {
     self::setAutoLoad();
     /**
      * @配置文件
      */
     \Myfox\Lib\Config::register('default', $ini);
     $config = \Myfox\Lib\Config::instance('default');
     /**
      * @数据库
      */
     foreach ((array) $config->get('mysql') as $name => $file) {
         \Myfox\Lib\Mysql::register($name, $file);
     }
     /**
      * @日志对象
      */
     foreach ((array) $config->get('log') as $name => $url) {
         \Myfox\Lib\Factory::registerLog($name, $url);
     }
     /**
      * @告警提醒
      */
     \Myfox\Lib\Alert::init(__DIR__ . '/../etc/alert.ini');
 }
Exemplo n.º 2
0
 public function test_should_alert_works_fine()
 {
     Alert::init(__DIR__ . '/ini/alert.ini');
     ob_start();
     Alert::push('test', Alert::URGENCE);
     $this->assertContains(' [dev] test', ob_get_contents());
     @ob_end_clean();
 }