Commit a6d51ff1 by xmy

fix:配置中心修改

parent fda342ae
<?php <?php
namespace Hdll\Services\Common\Config; namespace Hdll\Services\Common\Config;
use Swoft\Redis\Redis; use Swoft\Redis\Redis;
use Swoft\App; use Swoft\App;
class config const CACHE_PREFIX = 'CONFIG_CACHE';
{ $redis = App::getBean(Redis::class);
$data = $redis->get(CACHE_PREFIX . 'all');
const CACHE_PREFIX = 'CONFIG_CACHE';
public static function configAll() if (!empty($data)) {
{ $db = CfgCenter::dbConnect();
$redis = App::getBean(Redis::class); $data = $db->select('config', ['name', 'value']);
$data = $redis->get(CACHE_PREFIX . 'all'); $redis->set(CACHE_PREFIX . 'all', $data);
if (!empty($data)) {
$db = CfgCenter::dbConnect();
$data = $db->select('config', ['name', 'value']);
$redis->set(CACHE_PREFIX . 'all', $data);
}
}
} }
$data = config::configAll();
return $data; return $data;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment