File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,8 +360,9 @@ public function getAllKeys(): array {
360360 $ filter = Http::get ('s ' , '* ' );
361361 $ this ->template ->addGlobal ('search_value ' , $ filter );
362362
363- if (isset ($ this ->servers [$ this ->current_server ]['scansize ' ])) {
364- $ keys_array = $ this ->redis ->scanKeys ($ filter , (int ) $ this ->servers [$ this ->current_server ]['scansize ' ]);
363+ if (isset ($ this ->servers [$ this ->current_server ]['scansize ' ]) || !$ this ->isCommandSupported ('KEYS ' )) {
364+ $ scansize = (int ) ($ this ->servers [$ this ->current_server ]['scansize ' ] ?? 1000 );
365+ $ keys_array = $ this ->redis ->scanKeys ($ filter , $ scansize );
365366 } else {
366367 $ keys_array = $ this ->redis ->keys ($ filter );
367368 }
@@ -375,6 +376,18 @@ public function getAllKeys(): array {
375376 return $ this ->keysTableView ($ keys );
376377 }
377378
379+ private function isCommandSupported (string $ command ): bool {
380+ try {
381+ $ commands = $ this ->redis ->rawCommand ('COMMAND ' );
382+ $ command_names = array_column ($ commands , 0 );
383+ $ is_supported = in_array (strtolower ($ command ), $ command_names , true );
384+ } catch (Exception ) {
385+ $ is_supported = false ;
386+ }
387+
388+ return $ is_supported ;
389+ }
390+
378391 /**
379392 * @param array<int|string, mixed> $keys
380393 *
You can’t perform that action at this time.
0 commit comments