Browse Source

no commit message

齐博 6 years ago
parent
commit
baf6ae67e1
6 changed files with 133 additions and 0 deletions
  1. 9 0
      .htaccess
  2. 23 0
      admin.php
  3. 25 0
      build.php
  4. 29 0
      index.php
  5. 27 0
      member.php
  6. 20 0
      router.php

+ 9 - 0
.htaccess

@@ -0,0 +1,9 @@
+<IfModule mod_rewrite.c>
+  Options +FollowSymlinks -Multiviews
+  RewriteEngine On
+
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteCond %{REQUEST_FILENAME} !-f
+# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
+  RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
+</IfModule>

+ 23 - 0
admin.php

@@ -0,0 +1,23 @@
+<?php
+//define('SUPER_ADMIN',true); /*如忘记密码或权限丢失,请把开头的双斜杠“//”去掉,就能强制进后台.后台设置好权限后,记得再加上双斜杠*/
+ 
+
+// [ 后台入口文件 ]
+
+header('Content-Type:text/html;charset=utf-8');
+// 检测PHP环境
+if(version_compare(PHP_VERSION,'5.5.0','<'))  die('PHP版本过低,最少需要PHP5.5,请升级PHP版本!');
+
+// 定义应用目录
+define('APP_PATH', __DIR__ . '/application/');
+
+// 定义入口为admin
+define('ENTRANCE', 'admin');
+
+//验证码用到
+define('ADMIN_FILE', ENTRANCE.'.php');
+
+
+
+// 加载框架引导文件
+require __DIR__ . '/thinkphp/start.php';

+ 25 - 0
build.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+return [
+    // 生成应用公共文件
+    '__file__' => ['common.php', 'config.php', 'database.php'],
+
+    // 定义demo模块的自动生成 (按照实际定义的文件名生成)
+    'demo'     => [
+        '__file__'   => ['common.php'],
+        '__dir__'    => ['behavior', 'controller', 'model', 'view'],
+        'controller' => ['Index', 'Test', 'UserType'],
+        'model'      => ['User', 'UserType'],
+        'view'       => ['index/index'],
+    ],
+    // 其他更多的模块定义
+];

+ 29 - 0
index.php

@@ -0,0 +1,29 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+// [ 应用入口文件 ]
+header('Content-Type:text/html;charset=utf-8');
+// 检测PHP环境
+if(version_compare(PHP_VERSION,'5.5.0','<'))  die('PHP版本过低,最少需要PHP5.5,请升级PHP版本!');
+
+// 定义应用目录
+define('APP_PATH', __DIR__ . '/application/');
+
+// 定义入口为admin
+define('ENTRANCE', 'index');
+
+// 检查是否安装
+if(!is_file(APP_PATH.'install/install.lock')) {
+    define('BIND_MODULE', 'install');
+}
+
+// 加载框架引导文件
+require __DIR__ . '/thinkphp/start.php';

+ 27 - 0
member.php

@@ -0,0 +1,27 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+
+// [ 应用入口文件 ]
+
+header('Content-Type:text/html;charset=utf-8');
+// 检测PHP环境
+if(version_compare(PHP_VERSION,'5.5.0','<'))  die('PHP版本过低,最少需要PHP5.5,请升级PHP版本!');
+
+// 定义应用目录
+define('APP_PATH', __DIR__ . '/application/');
+
+// 定义入口为会员中心
+define('ENTRANCE', 'member');
+
+
+
+// 加载框架引导文件
+require __DIR__ . '/thinkphp/start.php';

+ 20 - 0
router.php

@@ -0,0 +1,20 @@
+<?php
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+// $Id$
+
+if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
+    return false;
+} else {
+    if (!isset($_SERVER['PATH_INFO'])) {
+        $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
+    }
+    require __DIR__ . "/index.php";
+}