log(" ---------------- START REINDEX ---------------- ", true); $this->log("Indexes list:"); $processes = Mage::getModel('index/process')->getCollection(); foreach ($processes as $process) { $this->log($process->getIndexer()->getName() . ' (' . $process->getIndexerCode() . ')'); } $this->log("\n"); foreach ($processes as $process) { Mage::helper('orange35_productImport/timer')->addTimer($process->getIndexer()->getName()); $this->log('start ' . $process->getIndexer()->getName(), true); /** @var Mage_Index_Model_Process $process */ $process->reindexAll(); $this->log('end ' . $process->getIndexer()->getName(), true); } unlink(Orange35_ProductImport_Helper_Data::DAY_FLAG_FILE); $this->log("---------------- END REINDEX ---------------- ", true); } catch (Exception $e) { $this->log("Error while reindex: {$e->getMessage()}", true); } return $this; } private function log($message, $showTime = false) { /** @var Orange35_ProductImport_Helper_Data $helper */ $helper = Mage::app()->getHelper('orange35_productImport'); $helper->log($message, $showTime); return $this; } }