parent
bd2060739e
commit
74642d1cf7
|
@ -154,6 +154,27 @@ class FileCache
|
|||
return $this->basedir . '/' . $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare a sub directory with the given name and return its path
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string|false Returns FALSE in case the cache is not enabled or an error occurred
|
||||
*/
|
||||
public function directory($name)
|
||||
{
|
||||
if (! $this->enabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$path = $this->filename($name);
|
||||
if (! is_dir($path) && ! @mkdir($path, octdec('1750'), true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the given ETag matches a cached file
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue