File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed
Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -133,27 +133,8 @@ public function remove($key) {
133133 }
134134
135135 public function clear ($ prefix = '' ) {
136- $ prefix = $ this ->getNameSpace () . $ prefix ;
137- $ allKeys = self ::$ cache ->getAllKeys ();
138- if ($ allKeys === false ) {
139- // newer Memcached doesn't like getAllKeys(), flush everything
140- self ::$ cache ->flush ();
141- return true ;
142- }
143- $ keys = [];
144- $ prefixLength = strlen ($ prefix );
145- foreach ($ allKeys as $ key ) {
146- if (substr ($ key , 0 , $ prefixLength ) === $ prefix ) {
147- $ keys [] = $ key ;
148- }
149- }
150- if (method_exists (self ::$ cache , 'deleteMulti ' )) {
151- self ::$ cache ->deleteMulti ($ keys );
152- } else {
153- foreach ($ keys as $ key ) {
154- self ::$ cache ->delete ($ key );
155- }
156- }
136+ // Newer Memcached doesn't like getAllKeys(), flush everything
137+ self ::$ cache ->flush ();
157138 return true ;
158139 }
159140
You can’t perform that action at this time.
0 commit comments