mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6331 from silverstripe/bugfix-framework-core-manifest-manifest-cache-file-ds
Replace hard-coded directory separators constant
This commit is contained in:
commit
76f64efe14
@ -12,7 +12,7 @@ class ManifestCache_File implements ManifestCache
|
||||
|
||||
function __construct($name)
|
||||
{
|
||||
$this->folder = TEMP_FOLDER . '/' . $name;
|
||||
$this->folder = TEMP_FOLDER . DIRECTORY_SEPARATOR . $name;
|
||||
if (!is_dir($this->folder)) {
|
||||
mkdir($this->folder);
|
||||
}
|
||||
@ -20,18 +20,18 @@ class ManifestCache_File implements ManifestCache
|
||||
|
||||
function load($key)
|
||||
{
|
||||
$file = $this->folder . '/cache_' . $key;
|
||||
$file = $this->folder . DIRECTORY_SEPARATOR . 'cache_' . $key;
|
||||
return file_exists($file) ? unserialize(file_get_contents($file)) : null;
|
||||
}
|
||||
|
||||
function save($data, $key)
|
||||
{
|
||||
$file = $this->folder . '/cache_' . $key;
|
||||
$file = $this->folder . DIRECTORY_SEPARATOR . 'cache_' . $key;
|
||||
file_put_contents($file, serialize($data));
|
||||
}
|
||||
|
||||
function clear()
|
||||
{
|
||||
array_map('unlink', glob($this->folder . '/cache_*'));
|
||||
array_map('unlink', glob($this->folder . DIRECTORY_SEPARATOR . 'cache_*'));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user