init
This commit is contained in:
28
app/admin/behavior/SystemConfig.php
Executable file
28
app/admin/behavior/SystemConfig.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\behavior;
|
||||
|
||||
use think\Config;
|
||||
use think\Cache;
|
||||
use think\Loader;
|
||||
use think\App;
|
||||
use think\Log;
|
||||
|
||||
class SystemConfig {
|
||||
|
||||
/**
|
||||
* 系统配置读取并缓存
|
||||
*/
|
||||
public function run() {
|
||||
$config = Cache::get('admin_config_data');
|
||||
if (empty($config)) {
|
||||
$config = Loader::model('Sysconfig')->configLists();
|
||||
Cache::tag('sysconfig')->set('admin_config_data', $config);
|
||||
App::$debug && Log::record("[ 系统配置 ]:初始化成功");
|
||||
}
|
||||
//header('content-type:text/html;charset=utf-8;');
|
||||
//var_export($config);exit;
|
||||
Config::set($config);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user