_fileIsBlacklisted($file)) { continue; } // ensure that the same named file from separate include_paths is not loaded $relativeItem = preg_replace('#^' . preg_quote($realIncludePath . DIRECTORY_SEPARATOR, '#') . '#', '', $item->getRealPath()); // no links allowed here for now if ($item->isLink()) { continue; } // no items that are relavitely the same are allowed if (in_array($relativeItem, $relativeItems)) { continue; } $relativeItems[] = $relativeItem; $files[] = $item->getRealPath(); } } return $files; } /** * * @param string $file * @return bool */ protected function _fileIsBlacklisted($file) { $blacklist = array( "PHPUnit".DIRECTORY_SEPARATOR."Framework", "Zend".DIRECTORY_SEPARATOR."OpenId".DIRECTORY_SEPARATOR."Provider" ); foreach($blacklist AS $blacklitedPattern) { if(strpos($file, $blacklitedPattern) !== false) { return true; } } return false; } }