19 public function __construct($cache_path, $max_age = 0, $max_size = 0) {
24 if ($cache_path ==
"") {
25 throw new \ConfigurationException(
"Cache path set to nothing!");
48 mkdir(
$path, 0700,
true);
56 return fopen(
$path . $filename, $rw);
82 if (preg_match(
'~^[a-zA-Z0-9\-_\.]{1,250}$~',
$key)) {
150 if (file_exists($dir .
$key)) {
151 return unlink($dir . $key);
164 $exclude = array(
".",
"..");
172 if (!in_array($f, $exclude)) {
193 $exclude = array(
".",
"..");
197 throw new \IOException($dir .
" is not a directory.");
202 if (!in_array($f, $exclude)) {
203 $stat = stat($dir . $f);
206 $size .= $stat[
'size'];
createFile($filename, $rw="rb")
Create and return a handle to a file.
__destruct()
Preform cleanup and invalidates cache upon object destruction.
load($key, $offset=0, $limit=null)
Load a key.
sanitizeFilename($key)
Create a sanitised filename for the file.
save($key, $data)
Save a key.
__construct($cache_path, $max_age=0, $max_size=0)
Set the Elgg cache.
clear()
Delete all files in the directory of this file cache.
setVariable($variable, $value)
Set a cache variable.
sanitise_filename($key)
Create a sanitised filename for the file.
foreach($resources as $id=> $href) if(!empty($resources_html)) $files
getVariable($variable)
Get variables for this cache.