protected function init()
 {
     global $wgAutoloadClasses;
     if (is_array($this->groups)) {
         return;
     }
     $key = wfMemcKey('translate-groups');
     $value = DependencyWrapper::getValueFromCache($this->getCache(), $key);
     if ($value === null) {
         wfDebug(__METHOD__ . "-nocache\n");
         $groups = $this->loadGroupDefinitions();
     } else {
         wfDebug(__METHOD__ . "-withcache\n");
         $groups = $value['cc'];
         self::appendAutoloader($value['autoload'], $wgAutoloadClasses);
     }
     $this->postInit($groups);
 }
Exemplo n.º 2
0
 public static function init()
 {
     static $loaded = false;
     if ($loaded) {
         return;
     }
     $loaded = true;
     global $wgTranslateCC, $wgTranslateEC, $wgTranslateAC;
     global $wgAutoloadClasses;
     $key = wfMemcKey('translate-groups');
     $value = DependencyWrapper::getValueFromCache(self::getCache(), $key);
     if ($value === null) {
         wfDebug(__METHOD__ . "-nocache\n");
         self::loadGroupDefinitions();
     } else {
         wfDebug(__METHOD__ . "-withcache\n");
         $wgTranslateCC = $value['cc'];
         $wgTranslateAC = $value['ac'];
         $wgTranslateEC = $value['ec'];
         foreach ($value['autoload'] as $class => $file) {
             $wgAutoloadClasses[$class] = $file;
         }
     }
 }