+----------------------------------------------------------------------// | thinkphp [ we can do it just think ]// +---------------------------------------- ------------------------------// | copyright (c) 2006~2016 http://thinkphp.cn all rights reserved.// +----------------------------------------------------------------------/ / | licensed ( http://www.apache.org/licenses/LICENSE-2.0 )// +----------------- -----------------------------------------------------// | author: liu21st <[email protected]>// +----------------------------------------------------------------------namespace think;// in the same big package under use think\config;// Use the configuration class use think\env;// use the Environment class think\Exception;// using Exception Pack use think\exception\httpexception;// to use Exception Pack http package use Think\exception\httpresponseexception;// using exception packs http response packages use think\hook;// using hooks class use think\Lang;// use language class use think\loader;// use load class use think\log;// Using Logging class use think\request;// using request class use think\response;// return class use think\route;// using routing Class// This class should be considered The Emperor class can schedule basically all the resources/ ** * app Application Management * @author liu21st <[email protected]> * /class app{ /** * @var bool whether initialized */ protected static $init = false;// initialization Flag bits /** * @var string Current module path */ public static $modulePath;// Initialization Current modules paths /** * @var bool Application debug Mode */ public static $debug = true;// application debugging mode /** * @var string Application class library namespaces */ public static $namespace = ' apps ';// applications class libraries Namespaces /** * @var bool Application class library suffixes */ public static $suffix = false;// Applications Libraries suffixes /** * @var bool apply route detection */ protected static $routeCheck;// Applications Routing detection /** * @var bool Strict route detection */ protected static $routeMust; // Strict route detection protected static $dispatch;// Routing scheduling protected static $file = []; // file Load /** * Execute application * @access public * @param request $request request objects * @return Response * @throws Exception */ public Static function run (request $request = null) {// thinkphp after automatic loading, error takeover, configuration file presets, and finally began to execute. // First step: Get request Parameters is_null ($request) && $request = request::instance (); &nbSp; // self:: $instance = new static ($options); executed this instance // default does not pass in any numeric,is_null so execute Back $request = request::instance (); // this notation really Very classic, I like you, Lao Liu, haha // finally acquired a request Objects $config = self::initcommon ();// loading Initialization Configuration file options
This article is from the "Focus on PHP Group number: 414194301" blog, please be sure to keep this source http://jingshanls.blog.51cto.com/3357095/1859690
[Li Jingshan php] every day tp5-20161211| App.php-1