/**
  * getModelGlobals
  * @param array $arrArgs
  * @return Model_Globals
  * @author Cornelius Hansjakob <*****@*****.**>
  * @version 1.0
  */
 protected function getModelGlobals($arrArgs)
 {
     if (null === $this->objModelGlobals) {
         /**
          * autoload only handles "library" compoennts.
          * Since this is an application model, we need to require it
          * from its modules path location.
          */
         require_once GLOBAL_ROOT_PATH . $this->core->sysConfig->path->zoolu_modules . 'global/models/Globals.php';
         $this->objModelGlobals = new Model_Globals();
         $this->objModelGlobals->setLanguageId($arrArgs['LanguageId']);
     }
     return $this->objModelGlobals;
 }
示例#2
0
 /**
  * indexAllPublicGlobals
  * @param integer $intRootLevelId
  * @param integer $intLanguageId
  * @return void
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 public function indexAllPublicGlobals($intRootLevelId = null, $intLanguageId = null)
 {
     try {
         $this->getModelGlobals();
         $strIndexGlobalFilePath = GLOBAL_ROOT_PATH . 'cli/IndexGlobal.php';
         $objGlobalsData = $this->objModelGlobals->loadAllPublicGlobals($intRootLevelId, $intLanguageId);
         $intTotal = count($objGlobalsData);
         $intCounter = 0;
         foreach ($objGlobalsData as $objGlobalData) {
             $intCounter++;
             echo $intCounter . "/" . $intTotal . " - mem usage is: " . memory_get_usage() . "\n";
             //$this->indexGlobal($objGlobalData->globalId, $objGlobalData->idLink, $objGlobalData->version, $objGlobalData->idLanguages, ((int) $objGlobalData->idRootLevels > 0) ? $objGlobalData->idRootLevels : $objGlobalData->idParent);
             exec("php {$strIndexGlobalFilePath} --globalId='" . $objGlobalData->globalId . "' --linkId='" . $objGlobalData->idLink . "' --version=" . $objGlobalData->version . " --languageId=" . $objGlobalData->idLanguages . " --rootLevelId=" . ((int) $objGlobalData->idRootLevels > 0 ? $objGlobalData->idRootLevels : $objGlobalData->idParent));
         }
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
     }
 }