Last active
April 26, 2016 13:54
-
-
Save mcjwsk/ce4d6336c27136828d7c to your computer and use it in GitHub Desktop.
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 | |
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__)); | |
$invalidFiles = array(); | |
foreach ($files as $file) { | |
if ($file->isLink() || $file->isDir()) { | |
continue; | |
} | |
$fileName = $file->getFilename(); | |
if ($fileName == 'config.xml') { | |
if (strpos($file->getPathname(), DIRECTORY_SEPARATOR . '.idea' . DIRECTORY_SEPARATOR) !== false) { | |
continue; | |
} | |
$filePath = str_replace(__DIR__, '.', $file->getPathname()); | |
$xml = simplexml_load_file($filePath); | |
foreach ($xml->xpath('//events') as $areaEvents) { | |
foreach ($areaEvents->children() as $event) { | |
$eventName = $event->getName(); | |
if ($eventName != strtolower($eventName)) { | |
$invalidFiles[$filePath][] = $eventName; | |
} | |
} | |
} | |
} | |
} | |
echo '<pre>'; | |
var_export($invalidFiles); | |
echo '</pre>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment