note 85289 deleted from language.oop5.autoload by peehaa
| From: | peehaa@php.net | Date: | Mon, 08 Jul 2013 20:58:58 +0000 |
| Subject: | note 85289 deleted from language.oop5.autoload by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195534@lists.php.net to get a copy of this message | ||
Note Submitter: sebasg37 at gmail dot com
----
When __autoload doesn't seem to work or if you are in PHP 4:
<?php
$include_paths = explode( PATH_SEPARATOR , get_include_path() );
foreach( $include_paths as $path ) {
if( is_dir( $path ) ) {
$d = opendir( $path );
while (false !== ($f = readdir($d))) {
if( ereg( "^.*\.php$" , $f ) && strstr( $path , ABS_PATH ) ) { ## avoid PEAR
and other files for automatic requirement
require_once $f;
}
}
closedir($d);
}
}
// replace ABS_PATH with your app root
?>