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


PHP Zend_Feed_Pubsubhubbub::getHttpClient方法代碼示例

本文整理匯總了PHP中Zend_Feed_Pubsubhubbub::getHttpClient方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Feed_Pubsubhubbub::getHttpClient方法的具體用法?PHP Zend_Feed_Pubsubhubbub::getHttpClient怎麽用?PHP Zend_Feed_Pubsubhubbub::getHttpClient使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Feed_Pubsubhubbub的用法示例。


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

示例1: _getHttpClient

 /**
  * Get a basic prepared HTTP client for use
  *
  * @param  string $mode Must be "subscribe" or "unsubscribe"
  * @return Zend_Http_Client
  */
 protected function _getHttpClient()
 {
     $client = Zend_Feed_Pubsubhubbub::getHttpClient();
     $client->setMethod(Zend_Http_Client::POST);
     $client->setConfig(array('useragent' => 'Zend_Feed_Pubsubhubbub_Subscriber/' . Zend_Version::VERSION));
     return $client;
 }
開發者ID:conectapb,項目名稱:sysagroweb,代碼行數:13,代碼來源:Subscriber.php

示例2: testCanSetCustomHttpClient

 public function testCanSetCustomHttpClient()
 {
     Zend_Feed_Pubsubhubbub::setHttpClient(new Test_Http_Client_Pubsub());
     $this->assertType('Test_Http_Client_Pubsub', Zend_Feed_Pubsubhubbub::getHttpClient());
 }
開發者ID:travisj,項目名稱:zf,代碼行數:5,代碼來源:PubsubhubbubTest.php

示例3: testNotifiesHubAndReportsFail

 public function testNotifiesHubAndReportsFail()
 {
     Zend_Feed_Pubsubhubbub::setHttpClient(new Zend_Feed_Pubsubhubbub_PublisherTest_ClientFail());
     $client = Zend_Feed_Pubsubhubbub::getHttpClient();
     $this->_publisher->addHubUrl('http://www.example.com/hub');
     $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic');
     $this->_publisher->setParameter('foo', 'bar');
     $this->_publisher->notifyAll();
     $this->assertFalse($this->_publisher->isSuccess());
 }
開發者ID:omusico,項目名稱:logica,代碼行數:10,代碼來源:PublisherTest.php

示例4: _getHttpClient

 /**
  * Get a basic prepared HTTP client for use
  *
  * @return Zend_Http_Client
  */
 protected function _getHttpClient()
 {
     $client = Zend_Feed_Pubsubhubbub::getHttpClient();
     $client->setMethod(Zend_Http_Client::POST);
     $client->setConfig(array('useragent' => 'Zend_Feed_Pubsubhubbub_Publisher/' . Zend_Version::VERSION));
     $params = array();
     $params[] = 'hub.mode=publish';
     $topics = $this->getUpdatedTopicUrls();
     if (empty($topics)) {
         require_once 'Zend/Feed/Pubsubhubbub/Exception.php';
         throw new Zend_Feed_Pubsubhubbub_Exception('No updated topic URLs' . ' have been set');
     }
     foreach ($topics as $topicUrl) {
         $params[] = 'hub.url=' . urlencode($topicUrl);
     }
     $optParams = $this->getParameters();
     foreach ($optParams as $name => $value) {
         $params[] = urlencode($name) . '=' . urlencode($value);
     }
     $paramString = implode('&', $params);
     $client->setRawData($paramString, 'application/x-www-form-urlencoded');
     return $client;
 }
開發者ID:madberry,項目名稱:WhiteLabelTransfer,代碼行數:28,代碼來源:Publisher.php

示例5: testCanSetCustomHttpClient

 public function testCanSetCustomHttpClient()
 {
     Zend_Feed_Pubsubhubbub::setHttpClient(new Test_Http_Client_Pubsub());
     $this->assertTrue(Zend_Feed_Pubsubhubbub::getHttpClient() instanceof Test_Http_Client_Pubsub);
 }
開發者ID:sasezaki,項目名稱:mirror-zf1-tests,代碼行數:5,代碼來源:PubsubhubbubTest.php


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