欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

自己写了个phpMVC框架,用框架写了一个小的项目

程序员文章站 2022-05-10 12:25:37
...
原创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

欢迎联系交流
  1. /**
  2. * 入口文件
  3. * @author CG;
  4. */
  5. error_reporting(E_ALL);
  6. header('Content-type: text/html; charset=utf-8');
  7. date_default_timezone_set('Asia/Shanghai');
  8. define('__ROOT__', dirname(__DIR__)); //定义网站根目录
  9. define('SITE_URL', dirname($_SERVER['SCRIPT_NAME'])); //定义访问地址
  10. chdir(dirname(__DIR__));
  11. require 'init_autoloader.php';
  12. /* 调试阶段请注释以下三行 */
  13. if(file_exists(__ROOT__ . '/cache/complie.php')){
  14. require __ROOT__ . '/cache/complie.php';
  15. }
  16. /* ------↑------*/
  17. try {
  18. vendor\Application::init(require_once './config/config.ini.php')->run();
  19. } catch (Exception $e) {
  20. echo "


    程序异常信息:" . $e->getMessage() . '
    ';
  21. echo '出错文件:', $e->getFile(), '
    ';
  22. echo '错误行数:', $e->getLine(), '
    ';
  23. echo '
    出错代码:
    ' . $e->getTraceAsString();
  24. die;
  25. }
  26. /* 调试阶段请注释以下四行 */
  27. if(!file_exists(__ROOT__ . '/cache/complie.php')){
  28. /*生成合并库文件*/
  29. vendor\cache\GenerateVendor::get_creater()->complie();
  30. }
  31. /* ------↑------*/
复制代码