public function __construct()
{
if (!defined('FILE_CACHE_LOCATION')) {
define('FILE_CACHE_LOCATION', HABARI_PATH . '/user/cache/');
}
$this->cache_location = FILE_CACHE_LOCATION;
$this->index_file = $this->cache_location . md5('index' . Options::get('private-GUID')) . '.data';
$this->enabled = is_writeable($this->cache_location);
if ($this->enabled) {
if (file_exists($this->index_file)) {
$this->cache_files = unserialize(file_get_contents($this->index_file));
}
} else {
Session::error(_t("The cache directory '%s' is not writable - the cache is disabled. The user, or group, which your web server is running as, needs to have read, write, and execute permissions on this directory.", array($this->cache_location)), 'filecache');
EventLog::log(_t("The cache directory '%s' is not writable - the cache is disabled.", array($this->cache_location)), 'notice', 'cache', 'habari');
}
}