mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-40642 use this->cfg in local file store when fixing permissions
This commit is contained in:
parent
eb459f7192
commit
eb1ee665f6
4
cache/stores/file/lib.php
vendored
4
cache/stores/file/lib.php
vendored
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user