当前位置:Gxlcms > PHP教程 > 第一次分享点什么呢,从zf的入口文件开始吧

第一次分享点什么呢,从zf的入口文件开始吧

时间:2021-07-01 10:21:17 帮助过:32人阅读

入口文件,public下的index.php文件,向手动创建的就直接粘过去就得了
  1. header("Content-Type: text/html; charset=UTF-8");
  2. error_reporting(E_ALL|E_STRICT);
  3. date_default_timezone_set('Asia/Shanghai');
  4. // Define path to application directory
  5. defined('APPLICATION_PATH')
  6. || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
  7. // Define application environment
  8. defined('APPLICATION_ENV')
  9. || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
  10. // Ensure library/ is on include_path
  11. set_include_path(implode(PATH_SEPARATOR, array(
  12. realpath(APPLICATION_PATH . '/../library'),
  13. get_include_path(),
  14. )));
  15. /** Zend_Application */
  16. require_once 'Zend/Application.php';
  17. // Create application, bootstrap, and run
  18. $application = new Zend_Application(
  19. APPLICATION_ENV,
  20. APPLICATION_PATH . '/configs/application.ini'
  21. );
  22. $application->bootstrap()
  23. ->run();

人气教程排行