Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能够缓存化就更完美了。 #9

Open
One2r opened this issue Jan 30, 2018 · 2 comments
Open

能够缓存化就更完美了。 #9

One2r opened this issue Jan 30, 2018 · 2 comments

Comments

@One2r
Copy link

One2r commented Jan 30, 2018

No description provided.

@zhouaini528
Copy link

正有这个需求,建议作者 做一个 redis什么一类的缓存,就完美了。我都想自己扩展了

@ZealousLyon
Copy link

其实只要自己修改一部分就好了
For example:

public function boot()
    {
        if (class_exists(\Encore\Admin\Config\ConfigModel::class)) {
            if ($json = Redis::get('configs')) {
                $configs = json_decode($json, true);
            } else {
                $configs = \Encore\Admin\Config\ConfigModel::all(['name', 'value']);
                Redis::set('configs', json_encode($configs));
            }
            foreach ($configs as $config) {
                config([$config['name'] => $config['value']]);
            }
        }
        Redis::enableEvents();
    }

然后做个定时任务 自动更新redis中的configs就好了;
如果想强制更新删除该项即可~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants