diff --git a/README.md b/README.md index 87cdf97..3768198 100644 --- a/README.md +++ b/README.md @@ -65,12 +65,16 @@ ``` 2、Windows环境下启动开发服务 ``` -1、执行php windows.php start 进行基础开发,例如APP/CONFIG/ROUTE等 -2、执行Windows.bat 进行完整开发,例如APP/PLUGIN/extend +1、执行init.bat进行基础开发,在安装插件助手之前请执行init.bat +2、执行Windows.bat 进行完整开发,例如APP/PLUGIN/extend/其他扩展开发 -因为我们在项目中使用了fileboy热更新工具,那么在加载插件的时候会导致问题,因为要加载的文件过多; +因为我们在项目中使用了fileboy热更新工具,如果在安装插件的时候,使用fileboy热更新,因插件文件过多会导致不停重启卡机。 -所以我们建议,首先把项目clone到本地后,先执行 php windows.php start,安装完毕插件助手后,再进行完整开发,这样就不会出现问题了; +所以我们建议,首先把项目clone到本地后,先执行init.bat,安装完毕插件助手/或其他插件后,再进行完整开发,这样就不会出现问题了; + +通俗一点将,init.bat只监听app/config文件夹下的文件修改,但是我们要开发插件,会需要监听app/config/extend/plugin这些文件夹PHP的修改 + +所以在安装第三方插件的时候,使用init.bat,等到安装完毕,切换到Windows.bat,进行完整开发; ``` 3、Linux环境下启动开发服务 diff --git a/app/BaseController.php b/app/BaseController.php index ed6b8be..22ae487 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -90,12 +90,6 @@ class BaseController public function __construct() { $this->referer = \request()->header('referer'); - $siteArr = saenv('site', true); - if ($siteArr && is_array($siteArr)) { - foreach ($siteArr as $key => $value) { - \support\View::assign($key,$value); - } - } } /** diff --git a/app/index/middleware/system/IndexInitialize.php b/app/index/middleware/system/IndexInitialize.php index 2936f47..2a11691 100644 --- a/app/index/middleware/system/IndexInitialize.php +++ b/app/index/middleware/system/IndexInitialize.php @@ -42,6 +42,13 @@ class IndexInitialize implements MiddlewareInterface return redirect('/install/index'); } + $siteInfo = saenv('site', true); + if ($siteInfo && is_array($siteInfo)) { + foreach ($siteInfo as $key => $value) { + \support\View::assign($key,$value); + } + } + return $handler($request); } } \ No newline at end of file diff --git a/init.bat b/init.bat new file mode 100644 index 0000000..bb72505 --- /dev/null +++ b/init.bat @@ -0,0 +1 @@ +php windows.php start \ No newline at end of file