Open kaiyulee opened 9 years ago
首先,Api是一个mode,只有在定义mode是api时,Api/functions才会被调用,默认使用的是common mode,也就是引入Common底下的functions。
if(function_exists('saeAutoLoader')){// 自动识别SAE环境
defined('APP_MODE') or define('APP_MODE', 'sae');
defined('STORAGE_TYPE') or define('STORAGE_TYPE', 'Sae');
}else{
defined('APP_MODE') or define('APP_MODE', 'common'); // 应用模式 默认为普通模式
defined('STORAGE_TYPE') or define('STORAGE_TYPE', 'File'); // 存储类型 默认为File
}
// 读取应用模式
$mode = include is_file(CONF_PATH.'core.php')?CONF_PATH.'core.php':MODE_PATH.APP_MODE.'.php';
// 加载核心文件
foreach ($mode['core'] as $file){
if(is_file($file)) {
include $file;
if(!APP_DEBUG) $content .= compile($file);
}
}
如果你在index.php define('APP_MODE', 'api')然后在这里打印$file变量 就能看到你的thinkphp/ThinkPHP/Mode/Api/functions.php
嗯, 已经解决了。谢谢你的回答! @pysnow530
thinkphp/ThinkPHP/Mode/Api/functions.php,这里面的方法,看代码没看出来,求指点。