api.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use think\Db;
  3. use think\Log;
  4. // +----------------------------------------------------------------------
  5. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  6. // +----------------------------------------------------------------------
  7. // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
  8. // +----------------------------------------------------------------------
  9. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  10. // +----------------------------------------------------------------------
  11. // | Author: liu21st <liu21st@gmail.com>
  12. // +----------------------------------------------------------------------
  13. // [ 应用入口文件 ]
  14. // 定义应用目录
  15. define('APP_PATH', __DIR__ . '/../application/');
  16. // 判断是否安装
  17. //if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
  18. // header("location:./install.php");
  19. // exit;
  20. //}
  21. // 加载框架引导文件
  22. require __DIR__ . '/../thinkphp/start.php';
  23. // Log::init([
  24. // 'type' => '\org\Log\File',
  25. // 'path' => APP_PATH.'logs/'
  26. // ]);
  27. // Db::listen(function($sql,$time,$explain){
  28. // Log::record($sql. ' ['.$time.'s]');
  29. // });
  30. // Log::record("系统启动");