diff options
author | Marcus Boerger <helly@php.net> | 2004-07-28 22:52:11 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-07-28 22:52:11 +0000 |
commit | 171d01dfcfacfa1e5dce74509dc3ac3fe9d4be22 (patch) | |
tree | 69bfaf27df0513cef8376ae6feb144f1cd4f6681 /ext/spl/examples/autoload.inc | |
parent | 7d80f82e704ad33075b17701975f027a5c934af9 (diff) | |
download | php-git-171d01dfcfacfa1e5dce74509dc3ac3fe9d4be22.tar.gz |
- Update examples
Diffstat (limited to 'ext/spl/examples/autoload.inc')
-rwxr-xr-x | ext/spl/examples/autoload.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/spl/examples/autoload.inc b/ext/spl/examples/autoload.inc index af4b931ff4..7fecfa5758 100755 --- a/ext/spl/examples/autoload.inc +++ b/ext/spl/examples/autoload.inc @@ -33,7 +33,10 @@ function __load_class($classname, $dir) */ function __autoload($classname) { $classname = strtolower($classname); - foreach(split(':', ini_get('include_path')) as $dir) + $inc = split(':', ini_get('include_path')); + $inc[] = '.'; + $inc[] = dirname($_SERVER['PATH_TRANSLATED']); + foreach($inc as $dir) { if (__load_class($classname, $dir)) { @@ -41,10 +44,7 @@ function __autoload($classname) { return; } } - if (!__load_class($classname, '.')) - if (!__load_class($classname, dirname($_SERVER['PATH_TRANSLATED']))) fprintf(STDERR, 'Class not found ('.$classname.")\n"); - return; } ?>
\ No newline at end of file |