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


PHP Zend_Feed::setHttpClient方法代码示例

本文整理汇总了PHP中Zend_Feed::setHttpClient方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Feed::setHttpClient方法的具体用法?PHP Zend_Feed::setHttpClient怎么用?PHP Zend_Feed::setHttpClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Feed的用法示例。


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

示例1: setUp

 public function setUp()
 {
 	$this->_adapter = new Zend_Http_Client_Adapter_Test();
     Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('adapter' => $this->_adapter)));
     $this->_client = Zend_Feed::getHttpClient();
     $this->_feedDir = dirname(__FILE__) . '/_files';
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:7,代码来源:ImportTest.php

示例2: setUp

 public function setUp()
 {
     if (!defined('TESTS_ZEND_FEED_IMPORT_ONLINE_BASEURI') || !constant('TESTS_ZEND_FEED_IMPORT_ONLINE_BASEURI')) {
         $this->markTestSkipped('ONLINE feed tests are not enabled');
     }
     $this->baseUri = rtrim(constant('TESTS_ZEND_FEED_IMPORT_ONLINE_BASEURI'), '/');
     Zend_Feed::setHttpClient(new Zend_Http_Client());
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:8,代码来源:AbstractFeedTest.php

示例3: testEdit

 public function testEdit()
 {
     Zend_Feed::setHttpClient(new TestClient());
     /* The base feed URI is the same as the POST URI, so just supply the
      * Zend_Feed_EntryAtom object with that. */
     $entry = new Zend_Feed_EntryAtom($this->uri, file_get_contents(dirname(__FILE__) . '/_files/AtomPublishingTest-before-update.xml'));
     /* Initial state. */
     $this->assertEquals('2005-05-23T16:26:00-08:00', $entry->updated(), 'Initial state of updated timestamp does not match');
     $this->assertEquals('http://fubar.com/myFeed/1/1/', $entry->link('edit'), 'Initial state of edit link does not match');
     /* Just change the entry's properties directly. */
     $entry->content = '1.2';
     /* Then save the changes. */
     $entry->save();
     /* New state. */
     $this->assertEquals('1.2', $entry->content(), 'Content change did not stick');
     $this->assertEquals('2005-05-23T16:27:00-08:00', $entry->updated(), 'New updated link is not correct');
     $this->assertEquals('http://fubar.com/myFeed/1/2/', $entry->link('edit'), 'New edit link is not correct');
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:18,代码来源:AtomPublishingTest.php

示例4: getNews

 /**
  * Get News
  * 
  * @return array
  */
 public function getNews()
 {
     if ($this->_news === null) {
         // Get News configuration options from the application.ini file
         $newsConfig = $this->getOptions();
         Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('timeout' => $newsConfig['poll_timeout'])));
         foreach ($newsConfig['channels'] as $name => $cconf) {
             try {
                 $class = 'Zend_Feed_' . ucfirst($cconf['type']);
                 $channel[$name]['channel'] = new $class($cconf['source']);
                 $channel[$name]['key'] = $cconf['key'];
             } catch (Exception $e) {
                 $channel[$name]['channel'] = array();
                 $channel[$name]['key'] = $cconf['key'];
             }
         }
         $this->_news = $channel;
     }
     return $this->_news;
 }
开发者ID:opensolutions,项目名称:oss-framework,代码行数:25,代码来源:News.php

示例5: setUp

 public function setUp()
 {
     Zend_Feed::setHttpClient(new Zend_Http_Client_File());
     $this->_client = Zend_Feed::getHttpClient();
     $this->_feedDir = dirname(__FILE__) . '/_files';
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:6,代码来源:ImportTest.php

示例6: testFindFeedsIncludesUriAsArrayKey

 /**
  * @issue ZF-5903
  */
 public function testFindFeedsIncludesUriAsArrayKey()
 {
     if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED') || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED')) {
         $this->markTestSkipped('testFindFeedsIncludesUriAsArrayKey() requires a network connection');
         return;
     }
     Zend_Feed::setHttpClient(new Zend_Http_Client());
     $feeds = Zend_Feed::findFeeds('http://www.planet-php.net');
     $this->assertEquals(array('http://www.planet-php.org:80/rss/', 'http://www.planet-php.org:80/rdf/'), array_keys($feeds));
 }
开发者ID:travisj,项目名称:zf,代码行数:13,代码来源:ImportTest.php

示例7: setUp

 public function setUp()
 {
     Zend_Feed::setHttpClient(new Zend_HttpClient_File());
     $this->_client = Zend_Feed::getHttpClient();
     $this->_feedDir = 'Zend/Feed/_files';
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:6,代码来源:RssTest.php

示例8: getFeed

 /**
  * Retreive feed object
  *
  * @param string $uri
  * @return Zend_Feed
  */
 public function getFeed($uri)
 {
     $feed = new Zend_Feed();
     $this->_httpClient->resetParameters();
     $feed->setHttpClient($this->_httpClient);
     return $feed->import($uri);
 }
开发者ID:josephholsten,项目名称:swaplady,代码行数:13,代码来源:Gdata.php

示例9: testNewsshortActionFail

 public function testNewsshortActionFail()
 {
     $adapter = new Zend_Http_Client_Adapter_Test();
     $adapter->setNextRequestWillFail(true);
     Zend_Feed::setHttpClient(new Zend_Http_Client(null, array('adapter' => $adapter)));
     $this->dispatch('/index/newsshort');
     $this->assertController('index');
     $this->assertAction('newsshort');
     $this->assertQuery('p.messagebox.warning');
 }
开发者ID:dmj,项目名称:uni-helmstedt.hab.de,代码行数:10,代码来源:IndexControllerTest.php


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