瀏覽代碼

移动安装目录,支持根目录index.php访问,也可以像tp5一样只对外开放public一个目录

xurongyao 7 年之前
父節點
當前提交
094454117c
共有 3 個文件被更改,包括 9 次插入9 次删除
  1. 7 7
      application/config.php
  2. 1 1
      index.php
  3. 1 1
      public/index.php

+ 7 - 7
application/config.php

@@ -144,13 +144,13 @@ return [
 
     // 视图输出字符串内容替换
     'view_replace_str'       => [
-        '{__ADMIN_PATH}'=>DS.PUBILC_PATH.'system/',
-        '{__FRAME_PATH}'=>DS.PUBILC_PATH.'system/frame/',
-        '{__PLUG_PATH}'=>DS.PUBILC_PATH.'static/plug/',
-        '{__MODULE_PATH}'=>DS.PUBILC_PATH.'system/module/',
-        '{__STATIC_PATH}'=>DS.PUBILC_PATH.'static/',
-        '{__PUBLIC_PATH}'=>DS.PUBILC_PATH,
-        '{__WAP_PATH}'=>DS.PUBILC_PATH.'wap/first/static/'
+        '{__ADMIN_PATH}'=>PUBILC_PATH.'system/',
+        '{__FRAME_PATH}'=>PUBILC_PATH.'system/frame/',
+        '{__PLUG_PATH}'=>PUBILC_PATH.'static/plug/',
+        '{__MODULE_PATH}'=>PUBILC_PATH.'system/module/',
+        '{__STATIC_PATH}'=>PUBILC_PATH.'static/',
+        '{__PUBLIC_PATH}'=>PUBILC_PATH,
+        '{__WAP_PATH}'=>PUBILC_PATH.'wap/first/static/'
     ],
     // 默认跳转页面对应的模板文件
     'dispatch_success_tmpl'  => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',

+ 1 - 1
index.php

@@ -24,6 +24,6 @@ if(file_exists("./public/install/") && !file_exists("./public/install/install.lo
 // 定义应用目录
 define('APP_PATH', __DIR__ . '/application/');
 //静态文件目录
-define('PUBILC_PATH', 'public/');
+define('PUBILC_PATH', '/public/');
 // 加载框架引导文件
 require __DIR__ . '/thinkphp/start.php';

+ 1 - 1
public/index.php

@@ -24,6 +24,6 @@ if(file_exists("./install/") && !file_exists("./install/install.lock")){
 // 定义应用目录
 define('APP_PATH', __DIR__ . '/../application/');
 //静态文件目录
-define('PUBILC_PATH', '');
+define('PUBILC_PATH', '/');
 // 加载框架引导文件
 require __DIR__ . '/../thinkphp/start.php';