Yoast_Google_WPCache

This class implements the caching mechanism for WordPress.

Defined (1)

The class is defined in the following location(s).

/vendor/yoast/api-libs/google/cache/Google_WPCache.php  
  1. class Yoast_Google_WPCache extends Yoast_Google_Cache { 
  2.  
  3. /** 
  4. * If wp_cache_get doesn't exists, include the file 
  5. */ 
  6. public function __construct() { 
  7.  
  8. if( ! function_exists('wp_cache_get') ) { 
  9. require_once( ABSPATH . 'wp-includes/cache.php' ); 
  10.  
  11. /** 
  12. * Retrieves the data for the given key, or false if they 
  13. * key is unknown or expired 
  14. * @param String $key The key who's data to retrieve 
  15. * @param boolean|int $expiration - Expiration time in seconds 
  16. * @return mixed 
  17. */ 
  18. public function get($key, $expiration = false) { 
  19. return wp_cache_get( $key ); 
  20.  
  21. /** 
  22. * Store the key => $value set. The $value is serialized 
  23. * by this function so can be of any type 
  24. * @param string $key Key of the data 
  25. * @param string $value data 
  26. */ 
  27. public function set($key, $value) { 
  28. wp_cache_set( $key, $value ) ; 
  29.  
  30. /** 
  31. * Removes the key/data pair for the given $key 
  32. * @param String $key 
  33. */ 
  34. public function delete($key) { 
  35. wp_cache_delete( $key ); 
  36.  
  37.