* @copyright 2013 FireGento Team (http://firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) */ require_once 'app/Mage.php'; umask(0); Mage::app('admin'); $fileName = 'config.xml'; $modules = Mage::getConfig()->getNode('modules')->children(); $return = array(); foreach ($modules as $modName => $module) { if ($module->is('active')) { $configFile = Mage::getConfig()->getModuleDir('etc', $modName) . DS . $fileName; if (file_exists($configFile)) { $xml = file_get_contents($configFile); $xml = simplexml_load_string($xml); if ($xml instanceof SimpleXMLElement) { $return[$modName] = $xml->xpath('//rewrite'); } } } } $collection = new Varien_Data_Collection(); foreach ($return as $rewriteNodes) { foreach ($rewriteNodes as $n) { $nParent = $n->xpath('..'); $module = (string)$nParent[0]->getName(); $nParent2 = $nParent[0]->xpath('..'); $component = (string)$nParent2[0]->getName(); if (!in_array($component, array('blocks', 'helpers', 'models'))) { continue; } $pathNodes = $n->children(); foreach ($pathNodes as $pathNode) { $path = (string)$pathNode->getName(); $completePath = $module . '/' . $path; $rewriteClassName = (string)$pathNode; $instance = Mage::getConfig()->getGroupedClassName( substr($component, 0, -1), $completePath ); $collection->addItem( new Varien_Object( array( 'path' => $completePath, 'rewrite_class' => $rewriteClassName, 'active_class' => $instance, 'status' => ($instance == $rewriteClassName) ) ) ); } } } echo '
# | Path | Rewrite Class | Active Class | Status |
---|---|---|---|---|
' . $i . ' | ' . $item->getData('path') . ' | ' . $item->getData('rewrite_class') . ' | ' . $item->getData('active_class') . ' | ' . $status . ' |