admin.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. // [ 后台入口文件 ]
  12. // 使用此文件可以达到隐藏admin模块的效果
  13. // 为了你的安全,强烈不建议将此文件名修改成admin.php
  14. // 定义应用目录
  15. define('APP_PATH', __DIR__ . '/../application/');
  16. // 判断是否安装
  17. if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) {
  18. $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
  19. header("Location: {$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$uri}/install.php");
  20. exit;
  21. }
  22. // 加载框架引导文件
  23. require __DIR__ . '/../thinkphp/base.php';
  24. // 绑定到admin模块
  25. \think\Route::bind('admin');
  26. // 关闭路由
  27. \think\App::route(false);
  28. // 设置根url
  29. \think\Url::root('');
  30. // 执行应用
  31. \think\App::run()->send();