You are here

function hacked_project_hashes_are_cached in Hacked! 5

Same name and namespace in other branches
  1. 6 hacked.module \hacked_project_hashes_are_cached()
1 call to hacked_project_hashes_are_cached()
hacked_hash_project in ./hacked.module

File

./hacked.module, line 404
The Hacked! module, shows which project have been changed since download.

Code

function hacked_project_hashes_are_cached($type, $short_name, $version) {
  static $cached = array();

  // Return from the static cache if we can:
  if (!isset($cached[$type][$short_name][$version])) {

    // Return form the cache system if we can:
    $key = "hacked:clean:hashes:{$type}:{$short_name}:{$version}";
    $cache = cache_get($key, HACKED_CACHE_TABLE);
    if ($cache && isset($cache->data)) {
      $cached[$type][$short_name][$version] = TRUE;
    }
    else {
      $cached[$type][$short_name][$version] = FALSE;
    }
  }
  return $cached[$type][$short_name][$version];
}