當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Oauth_Config類代碼示例

本文整理匯總了PHP中Zend_Oauth_Config的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Oauth_Config類的具體用法?PHP Zend_Oauth_Config怎麽用?PHP Zend_Oauth_Config使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Zend_Oauth_Config類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor; create a new object with an optional array|Zend_Config
  * instance containing initialising options.
  *
  * @param  array|Zend_Config $options
  * @return void
  */
 public function __construct($options = null)
 {
     $this->_config = new Zend_Oauth_Config();
     if ($options !== null) {
         if ($options instanceof Zend_Config) {
             $options = $options->toArray();
         }
         $this->_config->setOptions($options);
     }
 }
開發者ID:GerDner,項目名稱:luck-docker,代碼行數:17,代碼來源:Consumer.php

示例2: __construct

 /**
  * Constructor; creates a new HTTP Client instance which itself is
  * just a typical Zend_Http_Client subclass with some OAuth icing to
  * assist in automating OAuth parameter generation, addition and
  * cryptographioc signing of requests.
  *
  * @param array $oauthOptions
  * @param string $uri
  * @param array|Zend_Config $config
  * @return void
  */
 public function __construct(array $oauthOptions, $uri = null, $config = null)
 {
     parent::__construct($uri, $config);
     $this->_config = new Zend_Oauth_Config();
     if (!is_null($oauthOptions)) {
         if ($oauthOptions instanceof Zend_Config) {
             $oauthOptions = $oauthOptions->toArray();
         }
         $this->_config->setOptions($oauthOptions);
     }
 }
開發者ID:jacquesbagui,項目名稱:ofuz,代碼行數:22,代碼來源:Client.php

示例3: __construct

 /**
  * Constructor; creates a new HTTP Client instance which itself is
  * just a typical Zend_Http_Client subclass with some OAuth icing to
  * assist in automating OAuth parameter generation, addition and
  * cryptographioc signing of requests.
  *
  * @param  array $oauthOptions
  * @param  string $uri
  * @param  array|Zend_Config $config
  * @return void
  */
 public function __construct($oauthOptions, $uri = null, $config = null)
 {
     if (!isset($config['rfc3986_strict'])) {
         $config['rfc3986_strict'] = true;
     }
     parent::__construct($uri, $config);
     $this->_config = new Zend_Oauth_Config();
     if ($oauthOptions !== null) {
         if ($oauthOptions instanceof Zend_Config) {
             $oauthOptions = $oauthOptions->toArray();
         }
         $this->_config->setOptions($oauthOptions);
     }
 }
開發者ID:mrwalruss,項目名稱:thegioistatus,代碼行數:25,代碼來源:Client.php

示例4: __construct

 /**
  * Constructor; creates a new HTTP Client instance which itself is
  * just a typical Zend_Http_Client subclass with some OAuth icing to
  * assist in automating OAuth parameter generation, addition and
  * cryptographioc signing of requests.
  *
  * @param  array|Zend_Config $oauthOptions
  * @param  string            $uri
  * @param  array|Zend_Config $config
  * @return void
  */
 public function __construct($oauthOptions, $uri = null, $config = null)
 {
     if ($config instanceof Zend_Config && !isset($config->rfc3986_strict)) {
         $config                   = $config->toArray();
         $config['rfc3986_strict'] = true;
     } else if (null === $config ||
                (is_array($config) && !isset($config['rfc3986_strict']))) {
         $config['rfc3986_strict'] = true;
     }
     parent::__construct($uri, $config);
     $this->_config = new Zend_Oauth_Config;
     if ($oauthOptions !== null) {
         if ($oauthOptions instanceof Zend_Config) {
             $oauthOptions = $oauthOptions->toArray();
         }
         $this->_config->setOptions($oauthOptions);
     }
 }
開發者ID:nhp,項目名稱:shopware-4,代碼行數:29,代碼來源:Client.php

示例5: array

 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require_once 'common.php';
require_once 'Zend/Oauth.php';
require_once 'Zend/Oauth/Config.php';
require_once 'Zend/Oauth/Token/Access.php';
require_once 'Zend/Mail/Protocol/Imap.php';
require_once 'Zend/Mail/Storage/Imap.php';
/**
 * Setup OAuth
 */
$options = array('requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER, 'version' => '1.0', 'signatureMethod' => 'HMAC-SHA1', 'consumerKey' => $TWO_LEGGED_CONSUMER_KEY, 'consumerSecret' => $TWO_LEGGED_CONSUMER_SECRET_HMAC);
$config = new Zend_Oauth_Config();
$config->setOptions($options);
$config->setToken(new Zend_Oauth_Token_Access());
$config->setRequestMethod('GET');
$url = 'https://mail.google.com/mail/b/' . $TWO_LEGGED_EMAIL_ADDRESS . '/imap/';
$urlWithXoauth = $url . '?xoauth_requestor_id=' . urlencode($TWO_LEGGED_EMAIL_ADDRESS);
$httpUtility = new Zend_Oauth_Http_Utility();
/**
 * Get an unsorted array of oauth params,
 * including the signature based off those params.
 */
$params = $httpUtility->assembleParams($url, $config, array('xoauth_requestor_id' => $TWO_LEGGED_EMAIL_ADDRESS));
/**
 * Sort parameters based on their names, as required
 * by OAuth.
 */
開發者ID:manasaShivanna,項目名稱:gmail-oauth2-tools,代碼行數:31,代碼來源:two-legged.php

示例6: setOptions

 /**
  * Parse option array or Zend_Config instance and setup options using their
  * relevant mutators.
  *
  * @param  array|Zend_Config $options
  * @return Zend_Oauth_Config
  */
 public function setOptions(array $options)
 {
     parent::setOptions($options);
     foreach ($options as $key => $value) {
         switch ($key) {
             case 'realm':
                 $this->setRealm($value);
                 break;
         }
     }
     return $this;
 }
開發者ID:felipedmz,項目名稱:OX3-PHP-API-Client,代碼行數:19,代碼來源:OX3_Api_Client.php

示例7: serialize

 */
if (!isset($_SESSION['ACCESS_TOKEN'])) {
    if (!isset($_SESSION['REQUEST_TOKEN'])) {
        // Get Request Token and redirect to Google
        $_SESSION['REQUEST_TOKEN'] = serialize($consumer->getRequestToken(array('scope' => implode(' ', $THREE_LEGGED_SCOPES))));
        $consumer->redirect();
    } else {
        // Have Request Token already, Get Access Token
        $_SESSION['ACCESS_TOKEN'] = serialize($consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN'])));
        header('Location: ' . getCurrentUrl(false));
        exit;
    }
} else {
    // Retrieve mail using Access Token
    $accessToken = unserialize($_SESSION['ACCESS_TOKEN']);
    $config = new Zend_Oauth_Config();
    $config->setOptions($options);
    $config->setToken($accessToken);
    $config->setRequestMethod('GET');
    $url = 'https://mail.google.com/mail/b/' . $email_address . '/imap/';
    $httpUtility = new Zend_Oauth_Http_Utility();
    /**
     * Get an unsorted array of oauth params,
     * including the signature based off those params.
     */
    $params = $httpUtility->assembleParams($url, $config);
    /**
     * Sort parameters based on their names, as required
     * by OAuth.
     */
    ksort($params);
開發者ID:manasaShivanna,項目名稱:gmail-oauth2-tools,代碼行數:31,代碼來源:three-legged.php


注:本文中的Zend_Oauth_Config類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。