當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。