Last active
December 31, 2015 08:08
-
-
Save molotovbliss/a79ad0d99ca936047e75 to your computer and use it in GitHub Desktop.
Disable indexers/Enable Indexers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function _getIndexers() | |
{ | |
return Mage::getSingleton('index/indexer')->getProcessesCollection(); | |
} | |
protected function _stopReindex() | |
{ | |
$this->_getIndexers()->walk('setMode', array(Mage_Index_Model_Process::MODE_MANUAL)); | |
$this->_getIndexers()->walk('save'); | |
} | |
protected function _startReindex() | |
{ | |
$this->_getIndexers()->walk('reindexAll'); | |
$this->_getIndexers()->walk('setMode', array(Mage_Index_Model_Process::MODE_REAL_TIME)); | |
$this->_getIndexers()->walk('save'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment