mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 10:14:04 +00:00
Fix Redis scan for 5.8
This commit is contained in:
parent
5d5417cf11
commit
e9786cbfc0
2 changed files with 8 additions and 3 deletions
|
|
@ -71,9 +71,14 @@ class RedisStorageDriver implements StorageDriver
|
||||||
return "tenants:{$hash}";
|
return "tenants:{$hash}";
|
||||||
}, $uuids);
|
}, $uuids);
|
||||||
|
|
||||||
$hashes = $hashes ?: $this->redis->scan(null, 'tenants:*');
|
$redis_prefix = $this->redis->getOption($this->redis->client()::OPT_PREFIX);
|
||||||
|
$hashes = $hashes ?: $this->redis->scan(null, $redis_prefix.'tenants:*');
|
||||||
|
|
||||||
|
return array_map(function ($tenant) use ($redis_prefix) {
|
||||||
|
if (substr($tenant, 0, strlen($redis_prefix)) == $redis_prefix) {
|
||||||
|
$tenant = substr($tenant, strlen($redis_prefix));
|
||||||
|
}
|
||||||
|
|
||||||
return array_map(function ($tenant) {
|
|
||||||
return $this->redis->hgetall($tenant);
|
return $this->redis->hgetall($tenant);
|
||||||
}, $hashes);
|
}, $hashes);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ class TenantManager
|
||||||
*/
|
*/
|
||||||
public function all($uuids = [])
|
public function all($uuids = [])
|
||||||
{
|
{
|
||||||
$uuid = (array) $uuids;
|
$uuids = (array) $uuids;
|
||||||
|
|
||||||
return collect(array_map(function ($tenant_array) {
|
return collect(array_map(function ($tenant_array) {
|
||||||
return $this->jsonDecodeArrayValues($tenant_array);
|
return $this->jsonDecodeArrayValues($tenant_array);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue