Ejemplo n.º 1
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);
     }
 }