1
0
Fork 0

fix file load errors

pull/8529/head
Жаков Виталий 2020-01-15 18:09:42 +05:00
parent 8429a48dac
commit a4dc076dc8
2 changed files with 3 additions and 3 deletions

View File

@ -318,7 +318,7 @@ EOF;
private function filePutContentsIfModified($path, $content)
{
$currentContent = file_get_contents($path);
$currentContent = @file_get_contents($path);
if (!$currentContent || ($currentContent != $content)) {
return file_put_contents($path, $content);
}
@ -1014,7 +1014,7 @@ INITIALIZER;
*/
protected function safeCopy($source, $target)
{
if (!$this->filesAreEqual($source, $target)) {
if (!file_exists($target) OR !file_exists($source) OR !$this->filesAreEqual($source, $target)) {
$source = fopen($source, 'r');
$target = fopen($target, 'w+');

View File

@ -147,7 +147,7 @@ class JsonFile
*/
private function filePutContentsIfModified($path, $content)
{
$currentContent = file_get_contents($path);
$currentContent = @file_get_contents($path);
if (!$currentContent || ($currentContent != $content)) {
return file_put_contents($path, $content);
}