X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FHistory.php;h=a58466528050e2efb4aee4dbccb59f3629e42041;hb=a0c4dbd91c41b9ecdd5176c1ac33b55e240d2392;hp=35ec016a9be27c374dec0e96cbcd0d27e20a119a;hpb=12266213d098a53c5f005b9afcbbe62771fd580c;p=github%2Fshaarli%2FShaarli.git diff --git a/application/History.php b/application/History.php index 35ec016a..a5846652 100644 --- a/application/History.php +++ b/application/History.php @@ -1,4 +1,8 @@ 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 +195,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]);