mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
autoload 함수 단순화
This commit is contained in:
parent
56a19374c6
commit
cc572122b2
1 changed files with 4 additions and 10 deletions
|
|
@ -294,7 +294,7 @@ if(!defined('__XE_LOADED_CLASS__'))
|
||||||
if(__DEBUG__)
|
if(__DEBUG__)
|
||||||
define('__ClassLoadStartTime__', getMicroTime());
|
define('__ClassLoadStartTime__', getMicroTime());
|
||||||
|
|
||||||
$__xe_autoload_file_map = array(
|
$__xe_autoload_file_map = array_change_key_case(array(
|
||||||
'CacheHandler' => 'classes/cache/CacheHandler.class.php',
|
'CacheHandler' => 'classes/cache/CacheHandler.class.php',
|
||||||
'Context' => 'classes/context/Context.class.php',
|
'Context' => 'classes/context/Context.class.php',
|
||||||
'DB' => 'classes/db/DB.class.php',
|
'DB' => 'classes/db/DB.class.php',
|
||||||
|
|
@ -323,22 +323,16 @@ if(!defined('__XE_LOADED_CLASS__'))
|
||||||
'XmlParser' => 'classes/xml/XmlParser.class.php',
|
'XmlParser' => 'classes/xml/XmlParser.class.php',
|
||||||
'XmlLangParser' => 'classes/xml/XmlLangParser.class.php',
|
'XmlLangParser' => 'classes/xml/XmlLangParser.class.php',
|
||||||
'XmlQueryParser' => 'classes/xml/XmlQueryParser.class.php',
|
'XmlQueryParser' => 'classes/xml/XmlQueryParser.class.php',
|
||||||
);
|
), CASE_LOWER);
|
||||||
|
|
||||||
function __xe_autoload($class_name)
|
function __xe_autoload($class_name)
|
||||||
{
|
{
|
||||||
static $file_map = null;
|
|
||||||
if($file_map === null)
|
|
||||||
{
|
|
||||||
$file_map = array_change_key_case($GLOBALS['__xe_autoload_file_map'], CASE_LOWER);
|
|
||||||
}
|
|
||||||
$class_name = strtolower($class_name);
|
$class_name = strtolower($class_name);
|
||||||
if(isset($file_map[$class_name]))
|
if(isset($GLOBALS['__xe_autoload_file_map'][$class_name]))
|
||||||
{
|
{
|
||||||
require $file_map[$class_name];
|
require _XE_PATH_ . $GLOBALS['__xe_autoload_file_map'][$class_name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
__xe_autoload('Context');
|
|
||||||
spl_autoload_register('__xe_autoload');
|
spl_autoload_register('__xe_autoload');
|
||||||
|
|
||||||
if(__DEBUG__)
|
if(__DEBUG__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue