You are here

class OAuthHTTPBatch in Feeds OAuth 6

Definition of the import batch object created on the fetching stage by OAuthHTTPFetcher.

Hierarchy

Expanded class hierarchy of OAuthHTTPBatch

File

./OAuthHTTPFetcher.inc, line 7

View source
class OAuthHTTPBatch 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() {
    $access_token = call_user_func($this->authenticator, $this->uid, $this->site_id);
    $oauth = new OAuth($this->consumer_key, $this->consumer_secret, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
    $oauth
      ->setToken($access_token['oauth_token'], $access_token['oauth_token_secret']);
    if ($oauth
      ->fetch($this->url)) {
      return $oauth
        ->getLastResponse();
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsBatch::$progress protected property
FeedsBatch::$total protected property
FeedsBatch::getProgress public function Report progress.
FeedsBatch::getTotal public function Get the total for a stage.
FeedsBatch::setProgress public function Set progress for a stage.
FeedsBatch::setTotal public function Set the total for a stage.
FeedsImportBatch::$created public property
FeedsImportBatch::$current_item protected property
FeedsImportBatch::$description public property
FeedsImportBatch::$feed_nid public property
FeedsImportBatch::$items public property
FeedsImportBatch::$link public property
FeedsImportBatch::$raw protected property
FeedsImportBatch::$title public property
FeedsImportBatch::$updated public property
FeedsImportBatch::addItem Deprecated public function Add an item.
FeedsImportBatch::currentItem public function
FeedsImportBatch::feedNode Deprecated public function
FeedsImportBatch::getDescription Deprecated public function
FeedsImportBatch::getFilePath public function 1
FeedsImportBatch::getItemCount Deprecated public function Get number of items.
FeedsImportBatch::getLink Deprecated public function
FeedsImportBatch::getTitle Deprecated public function
FeedsImportBatch::setDescription Deprecated public function Set description.
FeedsImportBatch::setItems Deprecated public function Set items.
FeedsImportBatch::setLink Deprecated public function Set link.
FeedsImportBatch::setTitle Deprecated public function Set title.
FeedsImportBatch::shiftItem 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.
OAuthHTTPBatch::$authenticator protected property
OAuthHTTPBatch::$consumer_key protected property
OAuthHTTPBatch::$consumer_secret protected property
OAuthHTTPBatch::$site_id protected property
OAuthHTTPBatch::$uid protected property
OAuthHTTPBatch::$url protected property
OAuthHTTPBatch::getRaw public function Implementation of FeedsImportBatch::getRaw(); Overrides FeedsImportBatch::getRaw
OAuthHTTPBatch::__construct public function Constructor. Overrides FeedsImportBatch::__construct