Created
November 28, 2015 14:55
-
-
Save vpietri/8756409613a2b129cf22 to your computer and use it in GitHub Desktop.
Get all rewrite from Magento config class
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
<?php | |
$mageConfig = Mage::getConfig(); | |
$rewriteResume=array(); | |
foreach($mageConfig->getNode('global') as $type) { | |
foreach($type as $groupTypeName=>$groupType ) { | |
foreach($groupType as $aliasGroupName=>$group) { | |
if($group->rewrite) { | |
$rewriteClasses = $group->rewrite->children(); | |
foreach($rewriteClasses as $scrClass=>$rewriteClass) { | |
if (preg_match('/([^_]+_[^_]+)_(.*)/', $rewriteClass,$match)) { | |
$rewriteResume[$match[1]][$groupTypeName.'::'.$aliasGroupName][$scrClass]=$rewriteClass->asArray(); | |
} else { | |
//var_dump($rewriteClass); | |
} | |
} | |
} | |
} | |
} | |
} | |
foreach($rewriteResume as $module=>$moduleRewrites) { | |
var_dump($module, $moduleRewrites); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment