Commit c31de879 authored by totten's avatar totten

(#174) CRM_Utils_Cache_Interface::clear() is an alias for flush()

flush() is specified by Civi's traditional interface, and clear() is
specified by PSR-16. The semantics should be the same (i.e. remove
any records managed by this cache-object).

This treats flush() and clear() as aliases.
parent eec321a4
......@@ -127,4 +127,8 @@ class CRM_Utils_Cache_APCcache implements CRM_Utils_Cache_Interface {
return TRUE;
}
public function clear() {
return $this->flush();
}
}
......@@ -94,4 +94,8 @@ class CRM_Utils_Cache_Arraycache implements CRM_Utils_Cache_Interface {
return TRUE;
}
public function clear() {
return $this->flush();
}
}
......@@ -88,8 +88,24 @@ interface CRM_Utils_Cache_Interface {
/**
* Delete all values from the cache.
*
* NOTE: flush() and clear() should be aliases. flush() is specified by
* Civi's traditional interface, and clear() is specified by PSR-16.
*
* @return bool
* @see clear
* @deprecated
*/
public function flush();
/**
* Delete all values from the cache.
*
* NOTE: flush() and clear() should be aliases. flush() is specified by
* Civi's traditional interface, and clear() is specified by PSR-16.
*
* @return bool
* @see flush
*/
public function clear();
}
......@@ -157,4 +157,8 @@ class CRM_Utils_Cache_Memcache implements CRM_Utils_Cache_Interface {
return $this->_cache->flush();
}
public function clear() {
return $this->flush();
}
}
......@@ -179,4 +179,8 @@ class CRM_Utils_Cache_Memcached implements CRM_Utils_Cache_Interface {
return $this->_cache->flush();
}
public function clear() {
return $this->flush();
}
}
......@@ -90,4 +90,8 @@ class CRM_Utils_Cache_NoCache implements CRM_Utils_Cache_Interface {
return FALSE;
}
public function clear() {
return $this->flush();
}
}
......@@ -172,4 +172,8 @@ class CRM_Utils_Cache_Redis implements CRM_Utils_Cache_Interface {
return TRUE;
}
public function clear() {
return $this->flush();
}
}
......@@ -139,4 +139,8 @@ class CRM_Utils_Cache_SerializeCache implements CRM_Utils_Cache_Interface {
return TRUE;
}
public function clear() {
return $this->flush();
}
}
......@@ -149,6 +149,10 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface {
return TRUE;
}
public function clear() {
return $this->flush();
}
public function prefetch() {
$this->frontCache = CRM_Core_BAO_Cache::getItems($this->group, $this->componentID);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment