Created
January 10, 2018 10:02
-
-
Save renepenner/aa169370d6df21333c13aa4d22b4bcc5 to your computer and use it in GitHub Desktop.
check all magento xml
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 | |
require_once('./app/Mage.php'); | |
umask(0); | |
Mage::app(); | |
// enable user error handling | |
libxml_use_internal_errors(true); | |
$root = './app'; | |
$iterator = new RecursiveIteratorIterator( | |
new RecursiveDirectoryIterator($root, RecursiveDirectoryIterator::SKIP_DOTS), | |
RecursiveIteratorIterator::SELF_FIRST, | |
RecursiveIteratorIterator::CATCH_GET_CHILD | |
); | |
foreach ($iterator as $path => $item) { | |
if ($item->isFile() && $item->getExtension() == 'xml') { | |
$xml = simplexml_load_file($path); | |
foreach (libxml_get_errors() as $error) { | |
Mage::log($error); | |
echo '<pre>'; | |
print_r($error); | |
echo '</pre>'; | |
} | |
libxml_clear_errors(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment