mirror of https://gitee.com/karson/fastadmin.git
优化配置目录
parent
cf4949db77
commit
36dfe45715
|
|
@ -197,7 +197,7 @@ class Install extends Command
|
||||||
$adminFile = ROOT_PATH . 'public' . DS . 'admin.php';
|
$adminFile = ROOT_PATH . 'public' . DS . 'admin.php';
|
||||||
|
|
||||||
// 数据库配置文件
|
// 数据库配置文件
|
||||||
$dbConfigFile = APP_PATH . 'database.php';
|
$dbConfigFile = CONF_PATH . 'database.php';
|
||||||
$config = @file_get_contents($dbConfigFile);
|
$config = @file_get_contents($dbConfigFile);
|
||||||
$callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) {
|
$callback = function ($matches) use ($mysqlHostname, $mysqlHostport, $mysqlUsername, $mysqlPassword, $mysqlDatabase, $mysqlPrefix) {
|
||||||
$field = "mysql" . ucfirst($matches[1]);
|
$field = "mysql" . ucfirst($matches[1]);
|
||||||
|
|
@ -232,7 +232,7 @@ class Install extends Command
|
||||||
//修改站点名称
|
//修改站点名称
|
||||||
if ($siteName != __('My Website')) {
|
if ($siteName != __('My Website')) {
|
||||||
$instance->name('config')->where('name', 'name')->update(['value' => $siteName]);
|
$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;
|
$config = include $configFile;
|
||||||
$configList = $instance->name("config")->select();
|
$configList = $instance->name("config")->select();
|
||||||
foreach ($configList as $k => $value) {
|
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', '<')) {
|
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));
|
throw new Exception(__("The current version %s is too low, please use PHP 5.5 or higher", PHP_VERSION));
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ class Config extends Backend
|
||||||
$config[$value['name']] = $value['value'];
|
$config[$value['name']] = $value['value'];
|
||||||
}
|
}
|
||||||
file_put_contents(
|
file_put_contents(
|
||||||
APP_PATH . 'extra' . DS . 'site.php',
|
CONF_PATH . 'extra' . DS . 'site.php',
|
||||||
'<?php' . "\n\nreturn " . var_export($config, true) . ";"
|
'<?php' . "\n\nreturn " . var_export($config, true) . ";"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue