Created
March 27, 2012 16:05
-
-
Save Schrank/2217520 to your computer and use it in GitHub Desktop.
Stop Indexing in Magento
This file contains 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
<?php | |
class Klasse { | |
public static function switchIndexingOff() { | |
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); | |
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_MANUAL)); | |
$processes->walk('save'); | |
} | |
public static function rebuildIndices() { | |
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); | |
$processes->walk('reindexAll'); | |
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_REAL_TIME)); | |
$processes->walk('save'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you tell me how can i implement this in my project.