class OAuth2HTTPSBatch in Feeds OAuth 6
Definition of the import batch object created on the fetching stage by OAuth2HTTPSFetcher.
Hierarchy
- class \FeedsBatch
- class \FeedsImportBatch
- class \OAuth2HTTPSBatch
- class \FeedsImportBatch
Expanded class hierarchy of OAuth2HTTPSBatch
File
- ./
OAuth2HTTPSFetcher.inc, line 7
View source
class OAuth2HTTPSBatch extends FeedsImportBatch {
protected $url;
protected $authenticator;
protected $consumer_key;
protected $consumer_secret;
protected $site_id;
protected $uid;
/**
* Constructor.
*/
public function __construct($url, $authenticator, $consumer_key, $consumer_secret, $site_id, $uid) {
$this->url = $url;
$this->authenticator = $authenticator;
$this->consumer_key = $consumer_key;
$this->consumer_secret = $consumer_secret;
$this->site_id = $site_id;
$this->uid = $uid;
parent::__construct();
}
/**
* Implementation of FeedsImportBatch::getRaw();
*/
public function getRaw() {
require_once drupal_get_path('module', 'feeds_oauth') . '/php-proauth-read-only/lib/oauth/OAuth2Client.php';
$access_token = call_user_func($this->authenticator, $this->uid, $this->site_id);
$oauth = new OAuth2CurlClient();
$oauth
->_setAccessToken(new OAuth2AccessToken($access_token['oauth_token']));
$request = $oauth
->createGetRequest($this->url, array(
'access_token' => $oauth
->getAccessToken()
->getToken(),
));
$response = $oauth
->executeRequest($request);
if ($response
->getStatusCode() == 200) {
return $response
->getBody();
}
else {
watchdog('feeds_oauth', print_r($response
->getBody(), TRUE), array());
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FeedsBatch:: |
protected | property | ||
FeedsBatch:: |
protected | property | ||
FeedsBatch:: |
public | function | Report progress. | |
FeedsBatch:: |
public | function | Get the total for a stage. | |
FeedsBatch:: |
public | function | Set progress for a stage. | |
FeedsBatch:: |
public | function | Set the total for a stage. | |
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
protected | property | ||
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
public | property | ||
FeedsImportBatch:: |
public | function | Add an item. | |
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | 1 | |
FeedsImportBatch:: |
public | function | Get number of items. | |
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | ||
FeedsImportBatch:: |
public | function | Set description. | |
FeedsImportBatch:: |
public | function | Set items. | |
FeedsImportBatch:: |
public | function | Set link. | |
FeedsImportBatch:: |
public | function | Set title. | |
FeedsImportBatch:: |
public | function | @todo Move to a nextItem() based approach, not consuming the item array. Can only be done once we don't cache the entire batch object between page loads for batching anymore. | |
OAuth2HTTPSBatch:: |
protected | property | ||
OAuth2HTTPSBatch:: |
protected | property | ||
OAuth2HTTPSBatch:: |
protected | property | ||
OAuth2HTTPSBatch:: |
protected | property | ||
OAuth2HTTPSBatch:: |
protected | property | ||
OAuth2HTTPSBatch:: |
protected | property | ||
OAuth2HTTPSBatch:: |
public | function |
Implementation of FeedsImportBatch::getRaw(); Overrides FeedsImportBatch:: |
|
OAuth2HTTPSBatch:: |
public | function |
Constructor. Overrides FeedsImportBatch:: |