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).
This commit is contained in:
Jeremy Benoist
2015-12-30 12:23:51 +01:00
parent b4b592a0c0
commit 252ebd6071
9 changed files with 362 additions and 215 deletions

View File

@ -2,7 +2,9 @@
namespace Wallabag\ImportBundle\Import;
interface ImportInterface
use Psr\Log\LoggerAwareInterface;
interface ImportInterface extends LoggerAwareInterface
{
/**
* Name of the import.
@ -18,28 +20,19 @@ 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.
*
* @return string
*/
public function oAuthAuthorize();
/**
* Import content using the user token.
*
* @param string $accessToken User access token
* @return bool
*/
public function import($accessToken);
public function import();
/**
* Return an array with summary info about the import, with keys:
* - skipped
* - imported.
*
* @return array
*/
public function getSummary();
}