Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Replace getopt()
- *
- * @category PHP
- * @package PHP_Compat
- * @license LGPL - http://www.gnu.org/licenses/lgpl.html
- * @copyright 2004-2007 Aidan Lister <[email protected]>, Arpad Ray <[email protected]>
- * @link http://php.net/function.stream-resolve-include-path
- * @version $Revision$
- * @since PHP 5.2.0
- */
- function php_compat_stream_resolve_include_path($filename)
- {
- $paths = PATH_SEPARATOR == ':' ?
- preg_split('#(?<!phar):#', get_include_path()) :
- explode(PATH_SEPARATOR, get_include_path());
- foreach ($paths as $prefix) {
- $ds = substr($prefix, -1) == DIRECTORY_SEPARATOR ? '' : DIRECTORY_SEPARATOR;
- $file = $prefix . $ds . $filename;
- if (file_exists($file)) {
- return $file;
- }
- }
- return false;
- }
- // Define
- if (!function_exists('getopt')) {
- function stream_resolve_include_path($filename) {
- return php_compat_stream_resolve_include_path($filename);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment