| 1 |
<?php |
<?php |
| 2 |
// $Id: autoload.module,v 1.1.2.1 2008/10/23 04:48:21 crell Exp $ |
// $Id: autoload.module,v 1.1.2.2 2008/12/02 05:13:51 crell Exp $ |
| 3 |
/** |
/** |
| 4 |
* Implementation of hook_init(). |
* Implementation of hook_init(). |
| 5 |
*/ |
*/ |
| 8 |
} |
} |
| 9 |
|
|
| 10 |
/** |
/** |
| 11 |
|
* Implementation of hook_flush_caches9). |
| 12 |
|
*/ |
| 13 |
|
function autoload_flush_caches() { |
| 14 |
|
// Force a rescan of the autload hook. |
| 15 |
|
autoload_get_lookup(TRUE); |
| 16 |
|
} |
| 17 |
|
|
| 18 |
|
/** |
| 19 |
* Autoload function for registered classes. |
* Autoload function for registered classes. |
| 20 |
*/ |
*/ |
| 21 |
function autoload_class($class) { |
function autoload_class($class) { |
| 25 |
$lookup = autoload_get_lookup(); |
$lookup = autoload_get_lookup(); |
| 26 |
} |
} |
| 27 |
|
|
| 28 |
// If we don't have a record for the class, bypass the cache and try again. |
if (!empty($lookup[$class])) { |
|
if (empty($lookup[$class])) { |
|
|
$lookup = autoload_get_lookup(TRUE); |
|
|
} |
|
|
|
|
|
if (!empty($lookup[$class])) { |
|
| 29 |
require_once dirname($_SERVER['SCRIPT_FILENAME']) .'/'. $lookup[$class]; |
require_once dirname($_SERVER['SCRIPT_FILENAME']) .'/'. $lookup[$class]; |
| 30 |
} |
} |
| 31 |
} |
} |