本文整理匯總了PHP中Doo::_autoloadClassMap方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doo::_autoloadClassMap方法的具體用法?PHP Doo::_autoloadClassMap怎麽用?PHP Doo::_autoloadClassMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doo
的用法示例。
在下文中一共展示了Doo::_autoloadClassMap方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: autoload
/**
* Provides auto loading feature. To be used with the Magic method __autoload
* @param string $classname Class name to be loaded.
*/
public static function autoload($classname)
{
// if( class_exists($classname, false) === true )
// return;
//app
$class['DooConfig'] = 'app/DooConfig';
$class['DooSiteMagic'] = 'app/DooSiteMagic';
$class['DooWebApp'] = 'app/DooWebApp';
//auth
$class['DooAcl'] = 'auth/DooAcl';
$class['DooAuth'] = 'auth/DooAuth';
$class['DooDigestAuth'] = 'auth/DooDigestAuth';
$class['DooRbAcl'] = 'auth/DooRbAcl';
//cache
$class['DooApcCache'] = 'cache/DooApcCache';
$class['DooEAcceleratorCache'] = 'cache/DooEAcceleratorCache';
$class['DooFileCache'] = 'cache/DooFileCache';
$class['DooFrontCache'] = 'cache/DooFrontCache';
$class['DooMemCache'] = 'cache/DooMemCache';
$class['DooPhpCache'] = 'cache/DooPhpCache';
$class['DooXCache'] = 'cache/DooXCache';
//controller
$class['DooController'] = 'controller/DooController';
//db
$class['DooDbExpression'] = 'db/DooDbExpression';
$class['DooMasterSlave'] = 'db/DooMasterSlave';
$class['DooModel'] = 'db/DooModel';
$class['DooModelGen'] = 'db/DooModelGen';
$class['DooSmartModel'] = 'db/DooSmartModel';
$class['DooSqlMagic'] = 'db/DooSqlMagic';
//db/manage
$class['DooDbUpdater'] = 'db/manage/DooDbUpdater';
$class['DooManageDb'] = 'db/manage/DooManageDb';
$class['DooManageMySqlDb'] = 'db/manage/adapters/DooManageMySqlDb';
$class['DooManagePgSqlDb'] = 'db/manage/adapters/DooManagePgSqlDb';
$class['DooManageSqliteDb'] = 'db/manage/adapters/DooManageSqliteDb';
//helper
$class['DooBenchmark'] = 'helper/DooBenchmark';
$class['DooFile'] = 'helper/DooFile';
$class['DooFlashMessenger'] = 'helper/DooFlashMessenger';
$class['DooForm'] = 'helper/DooForm';
$class['DooGdImage'] = 'helper/DooGdImage';
$class['DooMailer'] = 'helper/DooMailer';
$class['DooPager'] = 'helper/DooPager';
$class['DooRestClient'] = 'helper/DooRestClient';
$class['DooTextHelper'] = 'helper/DooTextHelper';
$class['DooTimezone'] = 'helper/DooTimezone';
$class['DooUrlBuilder'] = 'helper/DooUrlBuilder';
$class['DooValidator'] = 'helper/DooValidator';
//logging
$class['DooLog'] = 'logging/DooLog';
//session
$class['DooCacheSession'] = 'session/DooCacheSession';
$class['DooSession'] = 'session/DooSession';
//translate
$class['DooTranslator'] = 'translate/DooTranslator';
//uri
$class['DooLoader'] = 'uri/DooLoader';
$class['DooUriRouter'] = 'uri/DooUriRouter';
//view
$class['DooView'] = 'uri/DooView';
$class['DooViewBasic'] = 'uri/DooViewBasic';
if (isset($class[$classname])) {
self::loadCore($class[$classname]);
} else {
if (isset(Doo::conf()->PROTECTED_FOLDER_ORI) === true) {
$path = Doo::conf()->SITE_PATH . Doo::conf()->PROTECTED_FOLDER_ORI;
} else {
$path = Doo::conf()->SITE_PATH . Doo::conf()->PROTECTED_FOLDER;
}
if (empty(Doo::conf()->AUTOLOAD) === false) {
if (Doo::conf()->APP_MODE == 'dev') {
$includeSub = Doo::conf()->AUTOLOAD;
$rs = array();
foreach ($includeSub as $sub) {
if (file_exists($sub) === false) {
if (file_exists($path . $sub) === true) {
$rs = array_merge($rs, DooFile::getFilePathList($path . $sub . '/'));
}
} else {
$rs = array_merge($rs, DooFile::getFilePathList($sub . '/'));
}
}
$autoloadConfigFolder = $path . 'config/autoload/';
$rsExisting = null;
if (file_exists($autoloadConfigFolder . 'autoload.php') === true) {
$rsExisting = (include $autoloadConfigFolder . 'autoload.php');
}
if ($rs != $rsExisting) {
if (!file_exists($autoloadConfigFolder)) {
mkdir($autoloadConfigFolder);
}
file_put_contents($autoloadConfigFolder . 'autoload.php', '<?php return ' . var_export($rs, true) . ';');
}
} else {
if (isset(self::$_autoloadClassMap) === false) {
//.........這裏部分代碼省略.........