首页核心服务模型ApiCoreModel
ApiCoreModel
Kuoqi\Core\Model\ApiCoreModel(23 行):API 模块基类
类定义
namespace Kuoqi\Core\Model;

class ApiCoreModel extends \Kuoqi\Core\Model {
    protected $__client = null;   // 当前绑定的客户端信息

    protected function includeOnce($file){
        $file = str_replace("{@API}", "{@ROOT}/Api", $file);
        if(!is_file(\Kuoqi::toPath($file))){
            $this->setError("引入扩展失败 : " . $file);
            return;
        }
        require_once(\Kuoqi::toPath($file));
    }
}

要点

  • includeOnce 支持 {@API} 占位符(→ {@ROOT}/Api)
  • 文件不存在时 setError 而非抛异常
  • 所有第三方 API 类的基类(\Kuoqi\Api 继承它)
KuoqiPHP v1.05 · 离线静态文档 · 界面基于 KuoqiUI · 返回首页