X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FNetscapeBookmarkUtils.php;h=2a10ff22149f8c89f30458d9e5c907e19847438a;hb=206c45bd05a79b5e6d0c51452a6ac69e85cca0b2;hp=e7148d005776c7c41df62e72e5cba237a6a6f753;hpb=d592daea8343bb4dfecff5d97e93699581ccc58c;p=github%2Fshaarli%2FShaarli.git diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index e7148d00..2a10ff22 100644 --- a/application/NetscapeBookmarkUtils.php +++ b/application/NetscapeBookmarkUtils.php @@ -1,7 +1,13 @@ get('resource.data_dir') // log path, will be overridden + ); + $logger = new Logger( + $conf->get('resource.data_dir'), + ! $conf->get('dev.debug') ? LogLevel::INFO : LogLevel::DEBUG, + [ + 'prefix' => 'import.', + 'extension' => 'log', + ] ); + $parser->setLogger($logger); $bookmarks = $parser->parseString($data); $importCount = 0; @@ -163,9 +180,11 @@ class NetscapeBookmarkUtils $newLink['id'] = $existingLink['id']; $newLink['created'] = $existingLink['created']; $newLink['updated'] = new DateTime(); + $newLink['shorturl'] = $existingLink['shorturl']; $linkDb[$existingLink['id']] = $newLink; $importCount++; $overwriteCount++; + $history->updateLink($newLink); continue; } @@ -177,9 +196,10 @@ class NetscapeBookmarkUtils $newLink['shorturl'] = link_small_hash($newLink['created'], $newLink['id']); $linkDb[$newLink['id']] = $newLink; $importCount++; + $history->addLink($newLink); } - $linkDb->save($pagecache); + $linkDb->save($conf->get('resource.page_cache')); return self::importStatus( $filename, $filesize,