当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Feed_Pubsubhubbub类代码示例

本文整理汇总了PHP中Zend_Feed_Pubsubhubbub的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Feed_Pubsubhubbub类的具体用法?PHP Zend_Feed_Pubsubhubbub怎么用?PHP Zend_Feed_Pubsubhubbub使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Zend_Feed_Pubsubhubbub类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     $client = new Zend_Http_Client();
     Zend_Feed_Pubsubhubbub::setHttpClient($client);
     $this->_subscriber = new Zend_Feed_Pubsubhubbub_Subscriber();
     $this->_adapter = $this->_getCleanMock('Zend_Db_Adapter_Abstract');
     $this->_tableGateway = $this->_getCleanMock('Zend_Db_Table_Abstract');
     $this->_tableGateway->expects($this->any())->method('getAdapter')->will($this->returnValue($this->_adapter));
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:9,代码来源:SubscriberTest.php

示例2: setUp

 public function setUp()
 {
     $this->_adapter = new Zend_Http_Client_Adapter_Test();
     $this->_storage = new Zend_Feed_Pubsubhubbub_Storage_Filesystem();
     $this->_skey = sha1('http://www.example.com/callback' . 'http://www.example.com/topic' . 'subscription');
     $this->_tkey = sha1('http://www.example.com/callback' . 'http://www.example.com/topic' . 'challenge');
     $client = new Zend_Http_Client();
     $client->setAdapter($this->_adapter);
     Zend_Feed_Pubsubhubbub::setHttpClient($client);
     $this->_callback = new Zend_Feed_Pubsubhubbub_HubServer_Callback();
     $this->_callback->setStorage($this->_storage);
     $this->_originalServer = $_SERVER;
     $_SERVER['REQUEST_METHOD'] = 'POST';
 }
开发者ID:padraic,项目名称:zfhubbub,代码行数:14,代码来源:CallbackTest.php

示例3: setUp

 public function setUp()
 {
     if (defined('TESTS_Zend_Feed_Pubsubhubbub_BASEURI') && Zend_Uri_Http::check(TESTS_Zend_Feed_Pubsubhubbub_BASEURI)) {
         $this->_baseuri = TESTS_Zend_Feed_Pubsubhubbub_BASEURI;
         if (substr($this->_baseuri, -1) != '/') {
             $this->_baseuri .= '/';
         }
         $name = $this->getName();
         if (($pos = strpos($name, ' ')) !== false) {
             $name = substr($name, 0, $pos);
         }
         $uri = $this->_baseuri . $name . '.php';
         $this->_adapter = new $this->_config['adapter']();
         $this->_client = new Zend_Http_Client($uri, $this->_config);
         $this->_client->setAdapter($this->_adapter);
         Zend_Feed_Pubsubhubbub::setHttpClient($this->_client);
         $this->_subscriber = new Zend_Feed_Pubsubhubbub_Subscriber();
         $this->_subscriber->setStorage(new Zend_Feed_Pubsubhubbub_Storage_Filesystem());
     } else {
         // Skip tests
         $this->markTestSkipped("Zend_Feed_Pubsubhubbub_Subscriber dynamic tests'\n            . ' are not enabled in TestConfiguration.php");
     }
 }
开发者ID:padraic,项目名称:zfhubbub,代码行数:23,代码来源:SubscriberHttpTest.php

示例4: _urlEncode

 /**
  * URL Encode an array of parameters
  *
  * @param  array $params
  * @return array
  */
 protected function _urlEncode(array $params)
 {
     $encoded = array();
     foreach ($params as $key => $value) {
         if (is_array($value)) {
             $ekey = Zend_Feed_Pubsubhubbub::urlencode($key);
             $encoded[$ekey] = array();
             foreach ($value as $duplicateKey) {
                 $encoded[$ekey][] = Zend_Feed_Pubsubhubbub::urlencode($duplicateKey);
             }
         } else {
             $encoded[Zend_Feed_Pubsubhubbub::urlencode($key)] = Zend_Feed_Pubsubhubbub::urlencode($value);
         }
     }
     return $encoded;
 }
开发者ID:conectapb,项目名称:sysagroweb,代码行数:22,代码来源:Subscriber.php

示例5: testCanDetectHubs

 public function testCanDetectHubs()
 {
     $feed = Zend_Feed_Reader::importFile(dirname(__FILE__) . '/_files/rss20.xml');
     $this->assertEquals(array('http://www.example.com/hub', 'http://www.example.com/hub2'), Zend_Feed_Pubsubhubbub::detectHubs($feed));
 }
开发者ID:travisj,项目名称:zf,代码行数:5,代码来源:PubsubhubbubTest.php

示例6: _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

示例7: 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

示例8: setUp

 public function setUp()
 {
     $client = new Zend_Http_Client();
     Zend_Feed_Pubsubhubbub::setHttpClient($client);
     $this->_hub = new Zend_Feed_Pubsubhubbub_HubServer();
 }
开发者ID:padraic,项目名称:zfhubbub,代码行数:6,代码来源:HubServerTest.php

示例9: _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::GET);
     $client->setConfig(array('useragent' => 'Zend_Feed_Pubsubhubbub_HubServer/' . Zend_Version::VERSION));
     return $client;
 }
开发者ID:vijo,项目名称:rss2twi.php,代码行数:13,代码来源:Callback.php

示例10: setUp

 public function setUp()
 {
     $client = new Zend_Http_Client();
     Zend_Feed_Pubsubhubbub::setHttpClient($client);
     $this->_subscriber = new Zend_Feed_Pubsubhubbub_Subscriber();
 }
开发者ID:padraic,项目名称:zfhubbub,代码行数:6,代码来源:SubscriberTest.php

示例11: clearHttpClient

 /**
  * Simple mechanism to delete the entire singleton HTTP Client instance
  * which forces an new instantiation for subsequent requests.
  *
  * @return void
  */
 public static function clearHttpClient()
 {
     self::$httpClient = null;
 }
开发者ID:nhp,项目名称:shopware-4,代码行数:10,代码来源:Pubsubhubbub.php


注:本文中的Zend_Feed_Pubsubhubbub类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。