The caches can be read or write by anybody to be usable in CLI in plus of Apache
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1557 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -24,7 +24,7 @@ class cachefile
|
|||||||
if (!mkdir ($this->directory))
|
if (!mkdir ($this->directory))
|
||||||
throw new Exception (sprintf (_("Can not create cache directory %s"),
|
throw new Exception (sprintf (_("Can not create cache directory %s"),
|
||||||
$this->directory), 500);
|
$this->directory), 500);
|
||||||
file_put_contents ($this->directory."/.htaccess", "deny from all\n");
|
chmod (0777, $this->directory);
|
||||||
}
|
}
|
||||||
if (! is_writable ($this->directory))
|
if (! is_writable ($this->directory))
|
||||||
throw new Exception (sprintf (_("Cache directory %s is not writable"),
|
throw new Exception (sprintf (_("Cache directory %s is not writable"),
|
||||||
@@ -32,6 +32,8 @@ class cachefile
|
|||||||
if (! is_readable ($this->directory))
|
if (! is_readable ($this->directory))
|
||||||
throw new Exception (sprintf (_("Cache directory %s is not readable"),
|
throw new Exception (sprintf (_("Cache directory %s is not readable"),
|
||||||
$this->directory), 500);
|
$this->directory), 500);
|
||||||
|
if (!file_exists ($this->directory."/.htaccess"))
|
||||||
|
file_put_contents ($this->directory."/.htaccess", "deny from all\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +65,7 @@ class cachefile
|
|||||||
"data"=>$data);
|
"data"=>$data);
|
||||||
file_put_contents ($fileCache, serialize ($datas));
|
file_put_contents ($fileCache, serialize ($datas));
|
||||||
unlink ($fileCache.".lock");
|
unlink ($fileCache.".lock");
|
||||||
|
chmod (0666, $fileCache);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user