X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FNetscapeBookmarkUtils.php;h=31a14537d101054149c97a6b2b72053ea21020e1;hb=12266213d098a53c5f005b9afcbbe62771fd580c;hp=e7148d005776c7c41df62e72e5cba237a6a6f753;hpb=9cf93bcfc53c36e0dd59fcfc717ac483ee74b35a;p=github%2Fshaarli%2FShaarli.git diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index e7148d00..31a14537 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,6 +184,7 @@ class NetscapeBookmarkUtils $newLink['id'] = $existingLink['id']; $newLink['created'] = $existingLink['created']; $newLink['updated'] = new DateTime(); + $newLink['shorturl'] = $existingLink['shorturl']; $linkDb[$existingLink['id']] = $newLink; $importCount++; $overwriteCount++; @@ -179,13 +201,17 @@ class NetscapeBookmarkUtils $importCount++; } - $linkDb->save($pagecache); + $linkDb->save($conf->get('resource.page_cache')); + $history->importLinks(); + + $duration = time() - $start; return self::importStatus( $filename, $filesize, $importCount, $overwriteCount, - $skipCount + $skipCount, + $duration ); } }