thinkphp3.2.3原始碼學習(1)

ZVan發表於2018-11-09
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 應用入口檔案

// 檢測PHP環境
if(version_compare(PHP_VERSION,'5.3.0','<'))  die('require PHP > 5.3.0 !');

// 開啟除錯模式 建議開發階段開啟 部署階段註釋或者設為false
define('APP_DEBUG',True);

// 定義應用目錄
define('APP_PATH','./Application/');

// 引入ThinkPHP入口檔案
require './ThinkPHP/ThinkPHP.php';

// 親^_^ 後面不需要任何程式碼了 就是如此簡單
複製程式碼

1.入口檔案比較簡單。就是規定了PHP的版本,要大於5.3. 2.開啟除錯模式。 3.定義應用的目錄。 4.引入ThinkPHP入口檔案

相關文章