优化配置目录

pull/197/head
alias 2020-05-20 14:18:43 +08:00
parent cf4949db77
commit 36dfe45715
2 changed files with 241 additions and 241 deletions

View File

@ -197,7 +197,7 @@ class Install extends Command
$adminFile = ROOT_PATH . 'public' . DS . 'admin.php';
// 数据库配置文件
$dbConfigFile = APP_PATH . 'database.php';
$dbConfigFile = CONF_PATH . 'database.php';
$config = @file_get_contents($dbConfigFile);
$callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) {
$field = "mysql" . ucfirst($matches[1]);
@ -232,7 +232,7 @@ class Install extends Command
//修改站点名称
if ($siteName != __('My Website')) {
$instance->name('config')->where('name', 'name')->update(['value' => $siteName]);
$configFile = APP_PATH . 'extra' . DS . 'site.php';
$configFile = CONF_PATH . 'extra' . DS . 'site.php';
$config = include $configFile;
$configList = $instance->name("config")->select();
foreach ($configList as $k => $value) {
@ -271,7 +271,7 @@ class Install extends Command
];
//数据库配置文件
$dbConfigFile = APP_PATH . 'database.php';
$dbConfigFile = CONF_PATH . 'database.php';
if (version_compare(PHP_VERSION, '5.5.0', '<')) {
throw new Exception(__("The current version %s is too low, please use PHP 5.5 or higher", PHP_VERSION));

View File

@ -187,7 +187,7 @@ class Config extends Backend
$config[$value['name']] = $value['value'];
}
file_put_contents(
APP_PATH . 'extra' . DS . 'site.php',
CONF_PATH . 'extra' . DS . 'site.php',
'<?php' . "\n\nreturn " . var_export($config, true) . ";"
);
}