private static function newInstance($store)
 {
     if (!class_exists($store)) {
         throw new RuntimeException("Expected a {$store} class");
     }
     $instance = new $store();
     if (!$instance instanceof Store) {
         throw new InvalidStoreException("{$store} can not be used as a store instance");
     }
     $mediaWikiLogger = new MediaWikiLogger();
     $mediaWikiLogger->registerLoggableEventTypes($GLOBALS['smwgLogEventTypes']);
     $instance->setLogger($mediaWikiLogger);
     return $instance;
 }
示例#2
0
 public function testLogToTableForNonLoggableEvent()
 {
     $instance = new Logger();
     $this->assertNull($instance->logToTable('Foo', 'Bar', 'Baz', 'Yui'));
 }