生活随笔
收集整理的這篇文章主要介紹了
自己写了个phpMVC框架,用框架写了一个小的项目
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
|
原創(chuàng)php MVC框架 CGFramework,寫的一個項目
百度云盤下載地址:http://pan.baidu.com/s/1o6r1Ney git:https://github.com/Naruone/CGFramework/ oschina git:https://git.oschina.net/naurone/CGFramework 作者:Corey QQ: 675608549
歡迎聯(lián)系交流
- <?php
- /**
- * 入口文件
- * @author CG;
- */
- error_reporting(E_ALL);
- header('Content-type: text/html; charset=utf-8');
- date_default_timezone_set('Asia/Shanghai');
-
- define('__ROOT__', dirname(__DIR__)); //定義網(wǎng)站根目錄
- define('SITE_URL', dirname($_SERVER['SCRIPT_NAME'])); //定義訪問地址
-
- chdir(dirname(__DIR__));
-
- require 'init_autoloader.php';
-
- /* 調(diào)試階段請注釋以下三行 */
- if(file_exists(__ROOT__ . '/cache/complie.php')){
- require __ROOT__ . '/cache/complie.php';
- }
- /* ------↑------*/
-
- try {
- vendor\Application::init(require_once './config/config.ini.php')->run();
- } catch (Exception $e) {
- echo "
程序異常信息:" . $e->getMessage() . ' ';
- echo '出錯文件:', $e->getFile(), '
';
- echo '錯誤行數(shù):', $e->getLine(), '
';
- echo '
出錯代碼: ' . $e->getTraceAsString();
- die;
- }
-
-
- /* 調(diào)試階段請注釋以下四行 */
- if(!file_exists(__ROOT__ . '/cache/complie.php')){
- /*生成合并庫文件*/
- vendor\cache\GenerateVendor::get_creater()->complie();
- }
- /* ------↑------*/
復制代碼 |
總結(jié)
以上是生活随笔為你收集整理的自己写了个phpMVC框架,用框架写了一个小的项目的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。