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 @@ -134,27 +134,8 @@ public function remove($key) {
134134 }
135135
136136 public function clear ($ prefix = '' ) {
137- $ prefix = $ this ->getNameSpace () . $ prefix ;
138- $ allKeys = self ::$ cache ->getAllKeys ();
139- if ($ allKeys === false ) {
140- // newer Memcached doesn't like getAllKeys(), flush everything
141- self ::$ cache ->flush ();
142- return true ;
143- }
144- $ keys = [];
145- $ prefixLength = strlen ($ prefix );
146- foreach ($ allKeys as $ key ) {
147- if (substr ($ key , 0 , $ prefixLength ) === $ prefix ) {
148- $ keys [] = $ key ;
149- }
150- }
151- if (method_exists (self ::$ cache , 'deleteMulti ' )) {
152- self ::$ cache ->deleteMulti ($ keys );
153- } else {
154- foreach ($ keys as $ key ) {
155- self ::$ cache ->delete ($ key );
156- }
157- }
137+ // Newer Memcached doesn't like getAllKeys(), flush everything
138+ self ::$ cache ->flush ();
158139 return true ;
159140 }
160141
You can’t perform that action at this time.
0 commit comments