diff --git a/build/lightdb/core/lightdb.php b/build/lightdb/core/lightdb.php index 434a86a..758ad85 100644 --- a/build/lightdb/core/lightdb.php +++ b/build/lightdb/core/lightdb.php @@ -125,7 +125,8 @@ /* (2) On ajoute les données aux fichier */ $json_data = json_encode($data); $this->driver->seek($already_line); - $this->line++; + if( $already_line == $this->line ) + $this->line++; $written = $this->driver->fwrite( $json_data.PHP_EOL ); // Si erreur d'écriture, on retourne FALSE @@ -134,7 +135,7 @@ /* (3) On enregistre l'index */ $this->index[$key] = [ - 'line' => $this->line - 1, + 'line' => $already_line - 1, 'hash' => sha1($json_data) ];