当前位置: 首页>>代码示例>>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;未经允许,请勿转载。