From 252ebd60719d32ec954d0519c9edf2b52b03310c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 30 Dec 2015 12:23:51 +0100 Subject: Rewrote Pocket Import For the moment, we won't do a queue system, just a plain synchronous import. We also use ContentProxy to grab content for each article from Pocket. Error from Pocket are now logged using the logger. The ImportInterface need to be simple and not related to oAuth (not all import will use that method). --- .../ImportBundle/Import/ImportInterface.php | 29 ++++++++-------------- 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'src/Wallabag/ImportBundle/Import/ImportInterface.php') diff --git a/src/Wallabag/ImportBundle/Import/ImportInterface.php b/src/Wallabag/ImportBundle/Import/ImportInterface.php index 0f9b3256..8cf238aa 100644 --- a/src/Wallabag/ImportBundle/Import/ImportInterface.php +++ b/src/Wallabag/ImportBundle/Import/ImportInterface.php @@ -2,7 +2,9 @@ namespace Wallabag\ImportBundle\Import; -interface ImportInterface +use Psr\Log\LoggerAwareInterface; + +interface ImportInterface extends LoggerAwareInterface { /** * Name of the import. @@ -19,27 +21,18 @@ interface ImportInterface public function getDescription(); /** - * Return the oauth url to authenticate the client. - * - * @param string $redirectUri Redirect url in case of error - * @param string $callbackUri Url when the authentication is complete - * - * @return string - */ - public function oAuthRequest($redirectUri, $callbackUri); - - /** - * Usually called by the previous callback to authorize the client. - * Then it return a token that can be used for next requests. + * Import content using the user token. * - * @return string + * @return bool */ - public function oAuthAuthorize(); + public function import(); /** - * Import content using the user token. + * Return an array with summary info about the import, with keys: + * - skipped + * - imported. * - * @param string $accessToken User access token + * @return array */ - public function import($accessToken); + public function getSummary(); } -- cgit v1.2.3