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


PHP Zend_Feed_Reader::detectType方法代码示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  * @param  DOMElement $entry
  * @param  int $entryKey
  * @param  string $type
  * @return void
  */
 public function __construct(DOMElement $entry, $entryKey, $type = null)
 {
     $this->_entry = $entry;
     $this->_entryKey = $entryKey;
     $this->_domDocument = $entry->ownerDocument;
     if ($type !== null) {
         $this->_data['type'] = $type;
     } else {
         $this->_data['type'] = Zend_Feed_Reader::detectType($feed);
     }
     $this->_loadExtensions();
 }
开发者ID:c12g,项目名称:stratos-php,代码行数:20,代码来源:EntryAbstract.php

示例2: __construct

 /**
  * Constructor
  *
  * @param  Zend_Feed_Abstract $feed The source Zend_Feed object
  * @param  string $type Feed type
  * @return void
  */
 public function __construct(DomDocument $dom, $type = null, DOMXPath $xpath = null)
 {
     $this->_domDocument = $dom;
     if ($type !== null) {
         $this->_data['type'] = $type;
     } else {
         $this->_data['type'] = Zend_Feed_Reader::detectType($dom);
     }
     if ($xpath !== null) {
         $this->_xpath = $xpath;
     } else {
         $this->_xpath = new DOMXPath($this->_domDocument);
     }
     $this->_registerNamespaces();
 }
开发者ID:bartolomeu,项目名称:estoque_gusella,代码行数:22,代码来源:FeedAbstract.php

示例3: __construct

 /**
  * Constructor
  *
  * @param  Zend_Feed_Entry_Abstract $entry
  * @param  int $entryKey
  * @param  string $type
  * @return void
  */
 public function __construct(DOMElement $entry, $entryKey, $type = null)
 {
     $this->_entry = $entry;
     $this->_entryKey = $entryKey;
     $this->_domDocument = $entry->ownerDocument;
     if ($type !== null) {
         $this->_data['type'] = $type;
     } else {
         $this->_data['type'] = Zend_Feed_Reader::detectType($entry->ownerDocument, true);
     }
     // set the XPath query prefix for the entry being queried
     if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_10 || $this->getType() == Zend_Feed_Reader::TYPE_RSS_090) {
         $this->setXpathPrefix('//rss:item[' . ($this->_entryKey + 1) . ']');
     } elseif ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10 || $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03) {
         $this->setXpathPrefix('//atom:entry[' . ($this->_entryKey + 1) . ']');
     } else {
         $this->setXpathPrefix('//item[' . ($this->_entryKey + 1) . ']');
     }
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:27,代码来源:EntryAbstract.php

示例4:

 /**
  * @group ZF-9723
  */
 public function testDetectsTypeFromStringOrToRemindPaddyAboutForgettingATestWhichLetsAStupidTypoSurviveUnnoticedForMonths()
 {
     $feed = '<?xml version="1.0" encoding="utf-8" ?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/"><channel></channel></rdf:RDF>';
     $type = Zend_Feed_Reader::detectType($feed);
     $this->assertEquals(Zend_Feed_Reader::TYPE_RSS_10, $type);
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:9,代码来源:ReaderTest.php

示例5: __construct

 /**
  * Constructor
  *
  * @param DomDocument The DOM object for the feed's XML
  * @param string $type Feed type
  */
 public function __construct(DomDocument $domDocument, $type = null)
 {
     $this->_domDocument = $domDocument;
     $this->_xpath = new DOMXPath($this->_domDocument);
     if ($type !== null) {
         $this->_data['type'] = $type;
     } else {
         $this->_data['type'] = Zend_Feed_Reader::detectType($this->_domDocument);
     }
     $this->_registerNamespaces();
     $this->_indexEntries();
     $this->_loadExtensions();
 }
开发者ID:c12g,项目名称:stratos-php,代码行数:19,代码来源:FeedAbstract.php

示例6: testDetectsFeedIsAtom03

 public function testDetectsFeedIsAtom03()
 {
     $feed = Zend_Feed_Reader::importString(file_get_contents($this->_feedSamplePath . '/Reader/atom03.xml'));
     $type = Zend_Feed_Reader::detectType($feed);
     $this->assertEquals(Zend_Feed_Reader::TYPE_ATOM_03, $type);
 }
开发者ID:vicfryzel,项目名称:zf,代码行数:6,代码来源:ReaderTest.php


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