file permissions fixing, #8
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@98 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -69,7 +69,14 @@ final class Cache
|
||||
{
|
||||
if ($this->cache_time != 0 && is_writable($this->cache_folder)) {
|
||||
$this->clearOld(); //очистка старых файлов.
|
||||
return (bool) file_put_contents($this->cache_file, $data);
|
||||
// а был-ли кеш?
|
||||
$exists = file_exists($this->cache_file);
|
||||
$result = file_put_contents($this->cache_file, $data);
|
||||
// если не существовал кеш - выставляем корректные права на него.
|
||||
if ($result && !$exists) {
|
||||
chmod($this->cache_file, 0664);
|
||||
}
|
||||
return (bool)$result;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user