コード例 #1
0
ファイル: Flickr.php プロジェクト: rwebley/Beowulf---PAS
 public function getTokens()
 {
     $tokens = new OauthTokens();
     $where = array();
     $where[] = $tokens->getAdapter()->quoteInto('service = ?', 'yahooAccess');
     $validToken = $tokens->fetchRow($where);
     $this->_accessToken = unserialize($validToken->accessToken);
     $this->_accessSecret = unserialize($validToken->tokenSecret);
     $this->_accessExpiry = $validToken->expires;
     $this->_handle = unserialize($validToken->sessionHandle);
 }
コード例 #2
0
 /** Get the access keys for oauth
  * 
  */
 private function getAccessKeys()
 {
     $tokens = new OauthTokens();
     $where = array();
     $where[] = $tokens->getAdapter()->quoteInto('service = ?', 'yahooAccess');
     $validToken = $tokens->fetchRow($where);
     if (!is_null($validToken)) {
         $access = array('access_token' => unserialize($validToken->accessToken), 'access_token_secret' => unserialize($validToken->tokenSecret), 'access_token_expiry' => $validToken->expires, 'handle' => unserialize($validToken->sessionHandle));
         return $access;
     } else {
         return false;
     }
 }
コード例 #3
0
ファイル: Geoplanet.php プロジェクト: rwebley/Beowulf---PAS
 /** Set up the constructor
  * @param string $appid The Yahoo application ID
  */
 public function __construct($appid)
 {
     $this->_appID = $appid;
     $this->_cache = Zend_Registry::get('cache');
     $this->_oauth = new Pas_Yql_Oauth();
     $tokens = new OauthTokens();
     $where = array();
     $where[] = $tokens->getAdapter()->quoteInto('service = ?', 'yahooAccess');
     $validToken = $tokens->fetchRow($where);
     $this->_accessToken = unserialize($validToken->accessToken);
     $this->_accessSecret = unserialize($validToken->tokenSecret);
     $this->_accessExpiry = $validToken->expires;
     $this->_handle = unserialize($validToken->sessionHandle);
     $this->_parser = new Pas_Service_Geo_Parser();
 }
コード例 #4
0
 /** Construct the objects
  * 
  */
 public function __construct()
 {
     $this->_cache = Zend_Registry::get('rulercache');
     $this->_oauth = new Pas_Yql_Oauth();
     $tokens = new OauthTokens();
     $where = array();
     $where[] = $tokens->getAdapter()->quoteInto('service = ?', 'yahooAccess');
     $validToken = $tokens->fetchRow($where);
     $this->_accessToken = unserialize($validToken->accessToken);
     $this->_accessSecret = unserialize($validToken->tokenSecret);
     $this->_accessExpiry = $validToken->expires;
     $this->_handle = unserialize($validToken->sessionHandle);
     $this->_config = Zend_Registry::get('config');
     $this->_flickrKey = $this->_config->webservice->flickr->apikey;
     $this->_flickrSecret = $this->_config->webservice->flickr->secret;
     $this->_flickrAuth = $this->_config->webservice->flickr->auth;
 }
コード例 #5
0
ファイル: Oauth.php プロジェクト: lesleyauk/findsorguk
 /** Delete all the expired tokens
  *
  */
 private function cleanUp()
 {
     $tokens = new OauthTokens();
     $where = array();
     $where[] = $tokens->getAdapter()->quoteInto('service = ?', 'yahooAccess');
     $where[] = $tokens->getAdapter()->quoteInto('expires <= ?', $this->_now);
     $tokens->delete($where);
 }
コード例 #6
0
 /** Get access tokens
  * @access public
  * @return object
  */
 public function getTokens()
 {
     $tokens = new OauthTokens();
     $where = array();
     $where[] = $tokens->getAdapter()->quoteInto('service = ?', 'yahooAccess');
     return $tokens->fetchRow($where);
 }
コード例 #7
0
ファイル: FlickrFront.php プロジェクト: lesleyauk/findsorguk
 /** Get the access keys for oauth
  * @access public
  * @return array The keys to use
  */
 public function getAccessKeys()
 {
     $tokens = new OauthTokens();
     $where = array();
     $where[] = $tokens->getAdapter()->quoteInto('service = ?', 'yahooAccess');
     $validToken = $tokens->fetchRow($where);
     Zend_Debug::dump($validToken);
     exit;
     $access = array();
     if (!is_null($validToken)) {
         $access['access_token'] = unserialize($validToken->accessToken);
         $access['access_token_secret'] = unserialize($validToken->tokenSecret);
         $access['access_token_expiry'] = $validToken->expires;
         $access['handle'] = unserialize($validToken->sessionHandle);
     } else {
         throw new Pas_Exception('No oauth token available', 500);
     }
     return $access;
 }