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!");
66 mkdir(
$path, 0700,
true);
74 return fopen(
$path . $filename, $rw);
163 if (file_exists($dir .
$key)) {
164 return unlink($dir . $key);
177 $exclude = array(
".",
"..");
185 if (!in_array($f, $exclude)) {
206 $exclude = array(
".",
"..");
210 throw new \IOException($dir .
" is not a directory.");
215 if (!in_array($f, $exclude)) {
216 $stat = stat($dir . $f);
219 $size .= $stat[
'size'];
create_file($filename, $rw="rb")
Create and return a handle to a file.
createFile($filename, $rw="rb")
Create and return a handle to a file.
sanitise_filename($filename)
Create a sanitised filename for the file.
__destruct()
Preform cleanup and invalidates cache upon object destruction.
load($key, $offset=0, $limit=null)
Load a key.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
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.
sanitizeFilename($filename)
Create a sanitised filename for the file.
setVariable($variable, $value)
Set a cache variable.
getVariable($variable)
Get variables for this cache.