MDL-40642 use this->cfg in local file store when fixing permissions

This commit is contained in:
Petr Škoda 2013-07-15 08:04:11 +02:00
parent eb459f7192
commit eb1ee665f6

View File

@ -689,8 +689,6 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @return bool
*/
protected function write_file($file, $content) {
global $CFG;
// Generate a temp file that is going to be unique. We'll rename it at the end to the desired file name.
// in this way we avoid partial writes.
$path = dirname($file);
@ -722,7 +720,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
// Finally rename the temp file to the desired file, returning the true|false result.
$result = rename($tempfile, $file);
@chmod($file, $CFG->filepermissions);
@chmod($file, $this->cfg->filepermissions);
if (!$result) {
// Failed to rename, don't leave files lying around.
@unlink($tempfile);