本文整理汇总了PHP中Zend\Feed\Reader\Reader::getPluginLoader方法的典型用法代码示例。如果您正苦于以下问题:PHP Reader::getPluginLoader方法的具体用法?PHP Reader::getPluginLoader怎么用?PHP Reader::getPluginLoader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Feed\Reader\Reader
的用法示例。
在下文中一共展示了Reader::getPluginLoader方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param DOMElement $entry
* @param string $entryKey
* @param string $type
* @return void
*/
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) . ']';
$pluginLoader = Reader\Reader::getPluginLoader();
$dublinCoreClass = $pluginLoader->getClassName('DublinCore\\Entry');
$this->_extensions['DublinCore\\Entry'] = new $dublinCoreClass($entry, $entryKey, $type);
$contentClass = $pluginLoader->getClassName('Content\\Entry');
$this->_extensions['Content\\Entry'] = new $contentClass($entry, $entryKey, $type);
$atomClass = $pluginLoader->getClassName('Atom\\Entry');
$this->_extensions['Atom\\Entry'] = new $atomClass($entry, $entryKey, $type);
$wfwClass = $pluginLoader->getClassName('WellFormedWeb\\Entry');
$this->_extensions['WellFormedWeb\\Entry'] = new $wfwClass($entry, $entryKey, $type);
$slashClass = $pluginLoader->getClassName('Slash\\Entry');
$this->_extensions['Slash\\Entry'] = new $slashClass($entry, $entryKey, $type);
$threadClass = $pluginLoader->getClassName('Thread\\Entry');
$this->_extensions['Thread\\Entry'] = new $threadClass($entry, $entryKey, $type);
}
示例2: __construct
/**
* Constructor
*
* @param DOMDocument $dom
* @param string $type
*/
public function __construct(DOMDocument $dom, $type = null)
{
parent::__construct($dom, $type);
$atomClass = Reader\Reader::getPluginLoader()->getClassName('Atom\\Feed');
$this->_extensions['Atom\\Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath);
$atomClass = Reader\Reader::getPluginLoader()->getClassName('DublinCore\\Feed');
$this->_extensions['DublinCore\\Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath);
foreach ($this->_extensions as $extension) {
$extension->setXpathPrefix('/atom:feed');
}
}
示例3: __construct
/**
* Constructor
*
* @param DOMElement $entry
* @param int $entryKey
* @param string $type
* @return void
*/
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) . ']';
$atomClass = Reader\Reader::getPluginLoader()->getClassName('Atom\\Entry');
$this->_extensions['Atom\\Entry'] = new $atomClass($entry, $entryKey, $type);
$threadClass = Reader\Reader::getPluginLoader()->getClassName('Thread\\Entry');
$this->_extensions['Thread\\Entry'] = new $threadClass($entry, $entryKey, $type);
$threadClass = Reader\Reader::getPluginLoader()->getClassName('DublinCore\\Entry');
$this->_extensions['DublinCore\\Entry'] = new $threadClass($entry, $entryKey, $type);
}
示例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();
$atomClass = Reader\Reader::getPluginLoader()->getClassName('Atom\\Feed');
$this->_extensions['Atom\\Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath);
$atomClass = Reader\Reader::getPluginLoader()->getClassName('DublinCore\\Feed');
$this->_extensions['DublinCore\\Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath);
foreach ($this->_extensions as $extension) {
$extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source');
}
}
示例5: __construct
/**
* Constructor
*
* @param DOMDocument $dom
* @param string $type
*/
public function __construct(\DomDocument $dom, $type = null)
{
parent::__construct($dom, $type);
$dublinCoreClass = Reader\Reader::getPluginLoader()->getClassName('DublinCore\\Feed');
$this->_extensions['DublinCore\\Feed'] = new $dublinCoreClass($dom, $this->_data['type'], $this->_xpath);
$atomClass = Reader\Reader::getPluginLoader()->getClassName('Atom\\Feed');
$this->_extensions['Atom\\Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath);
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);
}
}
示例6: testAddsPrefixPath
public function testAddsPrefixPath()
{
Reader\Reader::addPrefixPath('A\\B\\C', '/A/B/C');
$prefixPaths = Reader\Reader::getPluginLoader()->getPaths();
$this->assertEquals('/A/B/C/', $prefixPaths['A\\B\\C\\'][0]);
}
示例7: _loadExtensions
protected function _loadExtensions()
{
$all = Reader\Reader::getExtensions();
$feed = $all['feed'];
foreach ($feed as $extension) {
if (in_array($extension, $all['core'])) {
continue;
}
$className = Reader\Reader::getPluginLoader()->getClassName($extension);
$this->_extensions[$extension] = new $className($this->getDomDocument(), $this->_data['type'], $this->_xpath);
}
}
示例8: _loadExtensions
/**
* Load extensions from Zend\Feed\Reader\Reader
*
* @return void
*/
protected function _loadExtensions()
{
$all = Reader::getExtensions();
$feed = $all['entry'];
foreach ($feed as $extension) {
if (in_array($extension, $all['core'])) {
continue;
}
$className = Reader::getPluginLoader()->getClassName($extension);
$this->extensions[$extension] = new $className($this->getElement(), $this->entryKey, $this->data['type']);
}
}
示例9: _loadExtensions
protected function _loadExtensions()
{
$all = Reader\Reader::getExtensions();
$feed = $all['feed'];
foreach ($feed as $extension) {
if (in_array($extension, $all['core'])) {
continue;
}
if (!($className = Reader\Reader::getPluginLoader()->getClassName($extension))) {
continue;
}
if (!class_exists($className)) {
throw new Exception\RuntimeException(sprintf('Unable to load extension "%s"; cannot find class', $extension));
}
$this->_extensions[$extension] = new $className($this->getDomDocument(), $this->_data['type'], $this->_xpath);
}
}
示例10: testAddsPrefixPath
public function testAddsPrefixPath()
{
$path = str_replace('#', DIRECTORY_SEPARATOR, '#A#B#C');
Reader\Reader::addPrefixPath('A\\B\\C', $path);
$prefixPaths = Reader\Reader::getPluginLoader()->getPaths();
$this->assertEquals($path . DIRECTORY_SEPARATOR, $prefixPaths['A\\B\\C\\'][0]);
}