示例#1
0
文件: Broker.php 项目: covex-nn/joos
 /**
  * Private contructor
  */
 private function __construct()
 {
     $this->clearPrefixes();
     $this->appendPrefix("JooS");
     $prefixes = Config::Helper_Broker()->prefixes();
     if (is_array($prefixes)) {
         foreach ($prefixes as $prefix) {
             $this->appendPrefix($prefix);
         }
     }
 }
示例#2
0
 public function testSave()
 {
     $event1 = PHPUnit_Testing::getInstance();
     $config1 = Config::getInstance("JooS_Event_PHPUnit_Testing");
     $this->assertEquals(array(), $config1->valueOf());
     $event1->attach(array(__CLASS__, "observerPHPUnitTestingEvent"));
     $config2 = Config::getInstance("JooS_Event_PHPUnit_Testing");
     $this->assertEquals(array(), $config2->valueOf());
     $event1->save();
     $config3 = Config::getInstance("JooS_Event_PHPUnit_Testing");
     $this->assertEquals(array(array(__CLASS__, "observerPHPUnitTestingEvent")), $config3->valueOf());
     Event::clearInstance("JooS\\Event\\PHPUnit_Testing");
 }
示例#3
0
文件: Log.php 项目: covex-nn/joos
 /**
  * Return log writers
  * 
  * @return array
  */
 public static function getWriters()
 {
     if (is_null(self::$_writers)) {
         $writers = Config::getInstance("JooS_Log")->writers;
         /* @var $writers JooS_Config */
         if (!is_null($writers)) {
             foreach ($writers->valueOf() as $name) {
                 $name = ucfirst(strtolower($name));
                 $className = Loader::getClassName(__NAMESPACE__ . "\\", $name);
                 if (Loader::loadClass($className)) {
                     $writer = new $className();
                     if ($writer instanceof Log_Interface) {
                         self::addWriter($writer);
                     }
                 }
             }
         } else {
             self::$_writers = array();
         }
     }
     return self::$_writers;
 }
示例#4
0
 protected function tearDown()
 {
     $this->_broker = null;
     if (is_null($this->_prefixes)) {
         unset(Config::Helper_Broker()->prefixes);
     } else {
         Config::Helper_Broker()->prefixes = $this->_prefixes;
     }
 }
示例#5
0
文件: LogTest.php 项目: covex-nn/joos
 protected function tearDown()
 {
     Config::clearInstance("JooS_Log");
     Log::clearWriters();
 }
示例#6
0
 protected function tearDown()
 {
     Config::clearDataAdapter();
 }
示例#7
0
文件: Event.php 项目: covex-nn/joos
 /**
  * Load observers.
  * 
  * @return null
  */
 private function _loadObservers()
 {
     $class = $this->name();
     $name = self::_configName($class);
     $config = Config::getInstance($name);
     $this->_observers = $config->valueOf();
 }