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); }
/** 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; } }
/** 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(); }
/** 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; }
/** 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); }
/** 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); }
/** 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; }