* [perf] rename methods to fetch cache from redis.
This commit is contained in:
Vendored
+2
-2
@@ -481,7 +481,7 @@ class baseCache
|
||||
*/
|
||||
public function fetch($field = '')
|
||||
{
|
||||
$rawResult = $this->app->redis->getObjects($this->table);
|
||||
$rawResult = $this->app->redis->fetchAll($this->table);
|
||||
if(empty($rawResult)) return '';
|
||||
|
||||
foreach($rawResult as $row)
|
||||
@@ -505,7 +505,7 @@ class baseCache
|
||||
*/
|
||||
public function fetchAll($keyField = 0)
|
||||
{
|
||||
$rawResult = $this->app->redis->getObjects($this->table);
|
||||
$rawResult = $this->app->redis->fetchAll($this->table);
|
||||
if(empty($rawResult)) return [];
|
||||
|
||||
$result = [];
|
||||
|
||||
@@ -264,7 +264,7 @@ class zredis
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getObject(string $table, int|string $key)
|
||||
public function fetch(string $table, int|string $key)
|
||||
{
|
||||
if(empty($this->redis)) return $this->log('Redis is not initialized.');
|
||||
if(empty($table)) return $this->log('Table name is required.');
|
||||
@@ -287,7 +287,7 @@ class zredis
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getObjects(string $table, array $keyList = [])
|
||||
public function fetchAll(string $table, array $keyList = [])
|
||||
{
|
||||
if(empty($this->redis)) return $this->log('Redis is not initialized.');
|
||||
if(empty($table)) return $this->log('Table name is required.');
|
||||
@@ -318,7 +318,7 @@ class zredis
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairs(string $table, string $key, string $value, array $keyList = [])
|
||||
public function fetchPairs(string $table, string $key, string $value, array $keyList = [])
|
||||
{
|
||||
if(empty($this->redis)) return $this->log('Redis is not initialized.');
|
||||
if(empty($table)) return $this->log('Table name is required.');
|
||||
@@ -326,7 +326,7 @@ class zredis
|
||||
if(empty($value)) return $this->log('Value is required.');
|
||||
if(empty($this->config->redis->caches[$table])) return $this->log('No cache settings for table ' . $table);
|
||||
|
||||
$objects = $this->getObjects($table, $keyList);
|
||||
$objects = $this->fetchAll($table, $keyList);
|
||||
if(!$objects) return [];
|
||||
|
||||
$paris = [];
|
||||
|
||||
Reference in New Issue
Block a user