mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Added __autoload function. Currently only supports loading of plugin classes.
This commit is contained in:
25
class2.php
25
class2.php
@@ -9,9 +9,9 @@
|
|||||||
* General purpose file
|
* General purpose file
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
||||||
* $Revision: 1.137 $
|
* $Revision: 1.138 $
|
||||||
* $Date: 2009-09-04 14:35:00 $
|
* $Date: 2009-09-06 04:27:34 $
|
||||||
* $Author: e107coders $
|
* $Author: mcfly_e107 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//
|
//
|
||||||
@@ -2084,7 +2084,18 @@ function plugInstalled($plugname)
|
|||||||
return isset($pref['plug_installed'][$plugname]);*/
|
return isset($pref['plug_installed'][$plugname]);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __autoload($className) {
|
||||||
|
$tmp = explode('_', $className);
|
||||||
|
//TODO: Make it support core classes in e107_handlers
|
||||||
?>
|
if('plugin' !== $tmp[0]) { return; }
|
||||||
|
if('plugin' == $tmp[0])
|
||||||
|
{
|
||||||
|
array_shift($tmp);
|
||||||
|
$filename = e_PLUGIN.implode('/', $tmp).'.php';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$filename = e_HANDLER.implode('/', $tmp).'.php';
|
||||||
|
}
|
||||||
|
require_once($filename);
|
||||||
|
} // end __autoload
|
||||||
|
Reference in New Issue
Block a user