You are here

public static function ShareaholicCache::set in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 cache.php \ShareaholicCache::set()

Updates the cache value given a key and expire time

Parameters

string $key the key for the cached data:

mixed $data the data to cache:

integer $expire the number of seconds to cache the data for:

2 calls to ShareaholicCache::set()
ShareaholicPublic::share_counts_api in ./public.php
Function to handle the share count API requests
ShareaholicUtilities::share_counts_api_connectivity_check in ./utilities.php
Share Counts API Connectivity check

File

./cache.php, line 44

Class

ShareaholicCache
A simple wrapper around the Drupal caching library because it is incapable of respecting the expire time

Code

public static function set($key, $data, $expire) {
  $expire_time = REQUEST_TIME + $expire;
  cache_set($key, $data, 'cache', $expire_time);
}