X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=application%2FHistory.php;h=8074a0172c634912adf507bcd2236d8419cffe81;hb=bdc5152d486ca75372c271f94623b248bc127800;hp=35ec016a9be27c374dec0e96cbcd0d27e20a119a;hpb=1826e383ecf501302974132fd443cf1ca06e10f6;p=github%2Fshaarli%2FShaarli.git diff --git a/application/History.php b/application/History.php index 35ec016a..8074a017 100644 --- a/application/History.php +++ b/application/History.php @@ -1,4 +1,9 @@ historyFilePath)) { + if (!is_file($this->historyFilePath)) { FileUtils::writeFlatDB($this->historyFilePath, []); } - if (! is_writable($this->historyFilePath)) { + if (!is_writable($this->historyFilePath)) { throw new Exception(t('History file isn\'t readable or writable')); } } @@ -191,7 +196,7 @@ class History */ protected function write() { - $comparaison = new DateTime('-'. $this->retentionTime . ' seconds'); + $comparaison = new DateTime('-' . $this->retentionTime . ' seconds'); foreach ($this->history as $key => $value) { if ($value['datetime'] < $comparaison) { unset($this->history[$key]);