You are here

function filecache_directory in File Cache 7

Get base File Cache directory.

3 calls to filecache_directory()
DrupalFileCache::__construct in ./filecache.inc
Construct DrupalFileCache for specified cache bin.
filecache_registry_pathname in ./filecache.inc
filecache_requirements in ./filecache.module
Implements hook_requirements().

File

./filecache.inc, line 48
DrupalFileCache class that implements DrupalCacheInterface.

Code

function filecache_directory($bin = FALSE) {
  $filecache_directory = variable_get('filecache_directory', FALSE);
  if (is_array($filecache_directory)) {
    if (is_string($bin) && array_key_exists($bin, $filecache_directory)) {
      $filecache_directory = $filecache_directory[$bin];
    }
    else {
      if (array_key_exists('default', $filecache_directory)) {
        $filecache_directory = $filecache_directory['default'];
      }
    }
  }
  if (!is_string($filecache_directory)) {
    $filecache_directory = filecache_default_directory();
  }
  return $filecache_directory;
}