commit f1f068e72d32c6df8c5d8f045b31611d632763f7
Author: karog
Date: Fri Jun 1 17:31:26 2012 -0400
modified: class_autoload.php
Moved search of include_path down since on OS X it prematurely found
case indpendent matching files.
diff --git a/includes/class_autoload.php b/includes/class_autoload.php
index 8ae760c..36b70d9 100644
|
a
|
b
|
|
| 14 | 14 | function autoload($className) { |
| 15 | 15 | global $Path; |
| 16 | 16 | $className = str_replace('_', '/', $className); |
| 17 | | if (file_exists("classes/$className.php")) { |
| | 17 | if (file_exists("classes/$className.php")) |
| 18 | 18 | include_once "classes/$className.php"; |
| 19 | | return true; |
| 20 | | } |
| 21 | | foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) { |
| 22 | | if (!file_exists("$path/$className.php")) |
| 23 | | continue; |
| 24 | | include_once "$path/$className.php"; |
| 25 | | return true; |
| 26 | | } |
| 27 | | if (file_exists(modules_path.'/'.module."/classes/$className.php")) |
| | 19 | elseif (file_exists(modules_path.'/'.module."/classes/$className.php")) |
| 28 | 20 | include_once modules_path.'/'.module."/classes/$className.php"; |
| 29 | 21 | elseif (file_exists(modules_path.'/'.$Path[1]."/classes/$className.php")) |
| 30 | 22 | include_once modules_path.'/'.$Path[1]."/classes/$className.php"; |
| 31 | 23 | elseif (file_exists(modules_path.'/'.$Path[0]."/classes/$className.php")) |
| 32 | 24 | include_once modules_path.'/'.$Path[0]."/classes/$className.php"; |
| 33 | | else |
| | 25 | else { |
| | 26 | foreach (explode(PATH_SEPARATOR, ini_get('include_path')) as $path) { |
| | 27 | if (!file_exists("$path/$className.php")) |
| | 28 | continue; |
| | 29 | include_once "$path/$className.php"; |
| | 30 | return true; |
| | 31 | } |
| 34 | 32 | return false; |
| | 33 | } |
| | 34 | return true; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | spl_autoload_register('autoload'); |