新建comoser.json
{ "name": "brady_frmwork", "description":"php framwork", "type":"Framwork", "keywords":[ "php","PHP Framwork" ], "require":{ "php":">=7.1.0", "filp/whoops":"*" } }
composer install
入口文件引入 打开debug时候
<?php define("ROOT",__DIR__."/"); define('ROOT_PATH',"./"); define('CORE_PATH',ROOT_PATH."Core/"); define('APP_PATH',ROOT_PATH."App/"); define("MODULE","app"); define('APP_BUGE',true); include "vendor/autoload.php"; if("APP_DEBUG"){ ini_set("display_errors","on"); $whoops = new WhoopsRun; $whoops->pushHandler(new WhoopsHandlerPrettyPageHandler); $whoops->register(); } else { ini_set("display_errors","off"); } ewrwer(); include CORE_PATH."Common/base_helper.php"; include CORE_PATH."Frmwork/App.php"; // 类不存在的时候回自动找到下面的类方法下面 spl_autoload_register("CoreApp::load"); // 启动框架 CoreApp::run();
错误就显示为下面
https://github.com/filp/whoops
https://github.com/brady-wang/myFrm