企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ <?php require __DIR__ . '/zqphp/AutoLoad.php'; $Obj = new \zqphp\AutoLoad(__DIR__ . '/application'); //路由绑定域名 $Obj->SetRouting(function () { return ['user','www.xxx.com',['id'=>1]]; }); //路由别名 $Obj->SetAlias('index/qq', 'index/main', 'GET,POST'); //禁止访问 $Obj->SetStop('index/test', 'GET,POST'); //访问路由 $Obj->Access('index/demo', function () { echo "当通过GET或者POST可以访问到此路由"; }, 'GET,POST'); //设置错误接收 $Obj->SetError(function ($data,$error){ dump('==============处理后的错误内容=============='); dump($data); dump('==============处理前的错误内容=============='); dump($error); }); //设置Worker $Obj->SetWorker(['count'=>5,'name'=>'zqphp']); //类指向文件 $Obj->SetClassFile('user\test','/www/wwwroot/user/test.php'); //命名空间指向文件夹 $Obj->SetClassDir([ 'think' =>['@Events/topthink/think-helper/src/','@Events/topthink/think-orm/src/'] ]); //项目启动 $Obj->Run('8080'); ~~~