Home  >  Article  >  Backend Development  >  I wrote a phpMVC framework myself and used the framework to write a small project.

I wrote a phpMVC framework myself and used the framework to write a small project.

WBOY
WBOYOriginal
2016-07-25 08:47:351108browse
Original php MVC framework CGFramework, a project written



Baidu cloud disk download address: http://pan.baidu.com/s/1o6r1Ney
git: https://github.com/Naruone/CGFramework/
oschina git: https://git.oschina.net/naurone/CGFramework
Author: Corey
QQ: 675608549

Welcome to contact us for communication
  1. /**
  2. * Entry file
  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__)); //Define the website root directory
  9. define('SITE_URL', dirname($_SERVER['SCRIPT_NAME'])); //Define the access address
  10. chdir (dirname(__DIR__));
  11. require 'init_autoloader.php';
  12. /* Please comment the following three lines during the debugging phase*/
  13. if(file_exists(__ROOT__ . '/cache/complie.php')){
  14. require __ROOT__ . '/cache/complie.php';
  15. }
  16. /* ------↑------*/
  17. try {
  18. vendorApplication::init(require_once './config/config.ini. php')->run();
  19. } catch (Exception $e) {
  20. echo "


    Program exception information: " . $e->getMessage() . '
    ';
  21. echo 'Error file:', $e->getFile(), '< br/>';
  22. echo 'Error line number:', $e->getLine(), '
    ';
  23. echo '
    Error code:
    ' . $e->getTraceAsString();
  24. die;
  25. }
  26. /* Please comment the following four lines during the debugging phase*/
  27. if(!file_exists(__ROOT__ . '/cache/complie.php')){
  28. / *Generate merge library file*/
  29. vendorcacheGenerateVendor::get_creater()->complie();
  30. }
  31. /* ------↑------*/
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn