X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FBookmark%2Fimportbookmarks.php;h=c47a042973724f9b70ab008e87aee61757b4fe4a;hb=59043dca7fb6f974b11797c4d0f20e5b78b0611d;hp=991329dd6d37d724e248a084a276aa234c0d022f;hpb=907f1ad63304b775d857195eb35b46fdb4a9066a;p=quix0rs-gnu-social.git diff --git a/plugins/Bookmark/importbookmarks.php b/plugins/Bookmark/importbookmarks.php index 991329dd6d..c47a042973 100644 --- a/plugins/Bookmark/importbookmarks.php +++ b/plugins/Bookmark/importbookmarks.php @@ -4,7 +4,7 @@ * Copyright (C) 2010 StatusNet, Inc. * * Import a bookmarks file as notices - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -46,7 +46,7 @@ require_once INSTALLDIR.'/scripts/commandline.inc'; /** * Get the bookmarks file as a string - * + * * Uses the -f or --file parameter to open and read a * a bookmarks file * @@ -63,19 +63,25 @@ function getBookmarksFile() } if (!file_exists($filename)) { - throw new Exception("No such file '$filename'."); + // TRANS: Exception thrown when a file upload cannot be found. + // TRANS: %s is the file that could not be found. + throw new Exception(sprintf(_m('No such file "%s".'),$filename)); } if (!is_file($filename)) { - throw new Exception("Not a regular file: '$filename'."); + // TRANS: Exception thrown when a file upload is incorrect. + // TRANS: %s is the irregular file. + throw new Exception(sprintf(_m('Not a regular file: "%s".'),$filename)); } if (!is_readable($filename)) { - throw new Exception("File '$filename' not readable."); + // TRANS: Exception thrown when a file upload is not readable. + // TRANS: %s is the file that could not be read. + throw new Exception(sprintf(_m('File "%s" not readable.'),$filename)); } // TRANS: %s is the filename that contains a backup for a user. - printfv(_("Getting backup from file '%s'.")."\n", $filename); + printfv(_m('Getting backup from file "%s".')."\n", $filename); $html = file_get_contents($filename); @@ -83,13 +89,12 @@ function getBookmarksFile() } try { - $dbi = new DeliciousBackupImporter(); - $user = getUser(); - $html = getBookmarksFile(); - $dbi->importBookmarks($user, $html); + $qm = QueueManager::get(); + + $qm->enqueue(array($user, $html), 'dlcsback'); } catch (Exception $e) { print $e->getMessage()."\n";