Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/php
- <?php
- define('STR_BOM', "\xEF\xBB\xBF");
- $file = null;
- $directory = getcwd();
- $rit = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::CHILD_FIRST);
- try {
- foreach ($rit as $file) {
- if ($file->isFile()) {
- $path_parts = pathinfo($file->getRealPath());
- if ('php' == $path_parts['extension']) {
- $object = new SplFileObject($file->getRealPath());
- if (false !== strpos($object->getCurrentLine(), STR_BOM)) {
- print $file->getRealPath()."\n";
- }
- }
- }
- }
- } catch (Exception $e) {
- die ('Exception caught: '. $e->getMessage());
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement