Created
October 10, 2009 13:02
-
-
Save kriswallsmith/206830 to your computer and use it in GitHub Desktop.
This file contains 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 | |
static protected function removeIncludePath($file) | |
{ | |
$includePaths = explode(PATH_SEPARATOR, get_include_path()); | |
foreach ($includePaths as $includePath) | |
{ | |
// ignore relative or invalid include paths | |
if (0 === strpos($includePath, '.') || false === $includePath = realpath($includePath)) | |
{ | |
continue; | |
} | |
if (0 === strpos($file, $includePath.DIRECTORY_SEPARATOR)) | |
{ | |
return substr($file, strlen($includePath.DIRECTORY_SEPARATOR)); | |
} | |
} | |
return $file; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment