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


PHP Reader::getExtensionManager方法代码示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  * @param  DOMElement $entry
  * @param  int $entryKey
  * @param  string $type
  */
 public function __construct(DOMElement $entry, $entryKey, $type = null)
 {
     parent::__construct($entry, $entryKey, $type);
     // Everyone by now should know XPath indices start from 1 not 0
     $this->xpathQuery = '//atom:entry[' . ($this->entryKey + 1) . ']';
     $manager = Reader\Reader::getExtensionManager();
     $extensions = array('Atom\\Entry', 'Thread\\Entry', 'DublinCore\\Entry');
     foreach ($extensions as $name) {
         $extension = $manager->get($name);
         $extension->setEntryElement($entry);
         $extension->setEntryKey($entryKey);
         $extension->setType($type);
         $this->extensions[$name] = $extension;
     }
 }
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:22,代码来源:Atom.php

示例2: __construct

 /**
  * Constructor
  *
  * @param  DOMElement $entry
  * @param  string $entryKey
  * @param  string $type
  */
 public function __construct(DOMElement $entry, $entryKey, $type = null)
 {
     parent::__construct($entry, $entryKey, $type);
     $this->xpathQueryRss = '//item[' . ($this->entryKey + 1) . ']';
     $this->xpathQueryRdf = '//rss:item[' . ($this->entryKey + 1) . ']';
     $manager = Reader\Reader::getExtensionManager();
     $extensions = array('DublinCore\\Entry', 'Content\\Entry', 'Atom\\Entry', 'WellFormedWeb\\Entry', 'Slash\\Entry', 'Thread\\Entry');
     foreach ($extensions as $name) {
         $extension = $manager->get($name);
         $extension->setEntryElement($entry);
         $extension->setEntryKey($entryKey);
         $extension->setType($type);
         $this->extensions[$name] = $extension;
     }
 }
开发者ID:yakamoz-fang,项目名称:concrete,代码行数:22,代码来源:Rss.php

示例3: __construct

 /**
  * Constructor
  *
  * @param  DOMDocument $dom
  * @param  string $type
  */
 public function __construct(DOMDocument $dom, $type = null)
 {
     parent::__construct($dom, $type);
     $manager = Reader\Reader::getExtensionManager();
     $atomFeed = $manager->get('Atom\\Feed');
     $atomFeed->setDomDocument($dom);
     $atomFeed->setType($this->data['type']);
     $atomFeed->setXpath($this->xpath);
     $this->extensions['Atom\\Feed'] = $atomFeed;
     $atomFeed = $manager->get('DublinCore\\Feed');
     $atomFeed->setDomDocument($dom);
     $atomFeed->setType($this->data['type']);
     $atomFeed->setXpath($this->xpath);
     $this->extensions['DublinCore\\Feed'] = $atomFeed;
     foreach ($this->extensions as $extension) {
         $extension->setXpathPrefix('/atom:feed');
     }
 }
开发者ID:eltondias,项目名称:Relogio,代码行数:24,代码来源:Atom.php

示例4: __construct

 /**
  * Constructor: Create a Source object which is largely just a normal
  * Zend\Feed\Reader\AbstractFeed object only designed to retrieve feed level
  * metadata from an Atom entry's source element.
  *
  * @param DOMElement $source
  * @param string $xpathPrefix Passed from parent Entry object
  * @param string $type Nearly always Atom 1.0
  */
 public function __construct(DOMElement $source, $xpathPrefix, $type = Reader\Reader::TYPE_ATOM_10)
 {
     $this->domDocument = $source->ownerDocument;
     $this->xpath = new DOMXPath($this->domDocument);
     $this->data['type'] = $type;
     $this->registerNamespaces();
     $this->loadExtensions();
     $manager = Reader\Reader::getExtensionManager();
     $extensions = array('Atom\\Feed', 'DublinCore\\Feed');
     foreach ($extensions as $name) {
         $extension = $manager->get($name);
         $extension->setDomDocument($this->domDocument);
         $extension->setType($this->data['type']);
         $extension->setXpath($this->xpath);
         $this->extensions[$name] = $extension;
     }
     foreach ($this->extensions as $extension) {
         $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source');
     }
 }
开发者ID:ErR163,项目名称:torrentpier,代码行数:29,代码来源:Source.php

示例5: __construct

 /**
  * Constructor
  *
  * @param  DOMDocument $dom
  * @param  string $type
  */
 public function __construct(DOMDocument $dom, $type = null)
 {
     parent::__construct($dom, $type);
     $manager = Reader\Reader::getExtensionManager();
     $feed = $manager->get('DublinCore\\Feed');
     $feed->setDomDocument($dom);
     $feed->setType($this->data['type']);
     $feed->setXpath($this->xpath);
     $this->extensions['DublinCore\\Feed'] = $feed;
     $feed = $manager->get('Atom\\Feed');
     $feed->setDomDocument($dom);
     $feed->setType($this->data['type']);
     $feed->setXpath($this->xpath);
     $this->extensions['Atom\\Feed'] = $feed;
     if ($this->getType() !== Reader\Reader::TYPE_RSS_10 && $this->getType() !== Reader\Reader::TYPE_RSS_090) {
         $xpathPrefix = '/rss/channel';
     } else {
         $xpathPrefix = '/rdf:RDF/rss:channel';
     }
     foreach ($this->extensions as $extension) {
         $extension->setXpathPrefix($xpathPrefix);
     }
 }
开发者ID:tillk,项目名称:vufind,代码行数:29,代码来源:Rss.php

示例6: loadExtensions

 protected function loadExtensions()
 {
     $all = Reader::getExtensions();
     $manager = Reader::getExtensionManager();
     $feed = $all['feed'];
     foreach ($feed as $extension) {
         if (in_array($extension, $all['core'])) {
             continue;
         }
         $plugin = $manager->get($extension);
         $plugin->setDomDocument($this->getDomDocument());
         $plugin->setType($this->data['type']);
         $plugin->setXpath($this->xpath);
         $this->extensions[$extension] = $plugin;
     }
 }
开发者ID:tillk,项目名称:vufind,代码行数:16,代码来源:AbstractFeed.php

示例7: testRegistersUserExtension

 public function testRegistersUserExtension()
 {
     require_once __DIR__ . '/_files/My/Extension/JungleBooks/Entry.php';
     require_once __DIR__ . '/_files/My/Extension/JungleBooks/Feed.php';
     $manager = Reader\Reader::getExtensionManager();
     $manager->setInvokableClass('JungleBooks\\Entry', 'My\\Extension\\JungleBooks\\Entry');
     $manager->setInvokableClass('JungleBooks\\Feed', 'My\\Extension\\JungleBooks\\Feed');
     Reader\Reader::registerExtension('JungleBooks');
     $this->assertTrue(Reader\Reader::isRegistered('JungleBooks'));
 }
开发者ID:nieldm,项目名称:zf2,代码行数:10,代码来源:ReaderTest.php

示例8: loadExtensions

 protected function loadExtensions()
 {
     $all = Reader\Reader::getExtensions();
     $manager = Reader\Reader::getExtensionManager();
     $feed = $all['feed'];
     foreach ($feed as $extension) {
         if (in_array($extension, $all['core'])) {
             continue;
         }
         if (!$manager->has($extension)) {
             throw new Exception\RuntimeException(sprintf('Unable to load extension "%s"; cannot find class', $extension));
         }
         $plugin = $manager->get($extension);
         $plugin->setDomDocument($this->getDomDocument());
         $plugin->setType($this->data['type']);
         $plugin->setXpath($this->xpath);
         $this->extensions[$extension] = $plugin;
     }
 }
开发者ID:haoyanfei,项目名称:zf2,代码行数:19,代码来源:AbstractFeed.php


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