N°2793 Log rotation : fix no rotation :/

Was caused by erroneous file exists test
This commit is contained in:
Pierre Goiffon
2020-03-03 10:18:09 +01:00
parent 33f3f2810e
commit 29d24faf52

View File

@@ -130,7 +130,7 @@ abstract class RotatingLogFileNameBuilder implements iLogFileNameBuilder
{
if ($this->GetLastModifiedDateForFile() === null)
{
if ($this->IsLogFileExists())
if (!$this->IsLogFileExists())
{
return;
}
@@ -216,11 +216,21 @@ abstract class RotatingLogFileNameBuilder implements iLogFileNameBuilder
}
/**
* @return bool
* @return bool true if file exists and is readable
*/
public function IsLogFileExists()
{
return !file_exists($this->sLogFileFullPath) || !is_readable($this->sLogFileFullPath);
if (!file_exists($this->sLogFileFullPath))
{
return false;
}
if (!is_readable($this->sLogFileFullPath))
{
return false;
}
return true;
}
/**