Commit 0eaa35d5 authored by Dries's avatar Dries

Issue #1839468 by ParisLiakos, damiankloip, dawehner, jibran: Replace...

Issue #1839468 by ParisLiakos, damiankloip, dawehner, jibran: Replace aggregator rss parsing with Zend Feed.
parent e4c24df2
......@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "e2836b171e18ace7a3f758875041815a",
"hash": "9cad5a32fc0b4c0fac16fbda1b8ead16",
"packages": [
{
"name": "doctrine/common",
......@@ -791,27 +791,27 @@
},
{
"name": "symfony-cmf/routing",
"version": "1.1.0-alpha2",
"version": "1.1.0-beta1",
"target-dir": "Symfony/Cmf/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony-cmf/Routing.git",
"reference": "1.1.0-alpha2"
"reference": "1.1.0-beta1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/1.1.0-alpha2",
"reference": "1.1.0-alpha2",
"url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/1.1.0-beta1",
"reference": "1.1.0-beta1",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"php": ">=5.3.3",
"psr/log": ">=1.0,<2.0",
"symfony/http-kernel": ">=2.2,<2.4-dev",
"symfony/routing": ">=2.2,<2.4-dev"
"symfony/http-kernel": ">=2.2,<3.0",
"symfony/routing": ">=2.2,<3.0"
},
"suggest": {
"symfony/http-foundation": "ChainRouter/DynamicRouter have optional support for Request instances, several enhancers require a Request instances, >=2.2,<2.3-dev"
"symfony/http-foundation": "ChainRouter/DynamicRouter have optional support for Request instances, several enhancers require a Request instances, ~2.2"
},
"type": "library",
"extra": {
......@@ -840,7 +840,7 @@
"database",
"routing"
],
"time": "2013-05-28 19:50:20"
"time": "2013-06-03 17:23:01"
},
{
"name": "symfony/class-loader",
......@@ -1448,17 +1448,17 @@
},
{
"name": "symfony/yaml",
"version": "v2.3.0",
"version": "v2.3.1",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "v2.3.0-RC1"
"reference": "v2.3.1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.3.0-RC1",
"reference": "v2.3.0-RC1",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.3.1",
"reference": "v2.3.1",
"shasum": ""
},
"require": {
......@@ -1541,6 +1541,138 @@
"templating"
],
"time": "2013-04-08 12:40:11"
},
{
"name": "zendframework/zend-escaper",
"version": "2.2.1",
"target-dir": "Zend/Escaper",
"source": {
"type": "git",
"url": "https://github.com/zendframework/Component_ZendEscaper.git",
"reference": "release-2.2.1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/Component_ZendEscaper/zipball/release-2.2.1",
"reference": "release-2.2.1",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
}
},
"autoload": {
"psr-0": {
"Zend\\Escaper\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"keywords": [
"escaper",
"zf2"
],
"time": "2013-05-01 21:53:03"
},
{
"name": "zendframework/zend-feed",
"version": "2.2.1",
"target-dir": "Zend/Feed",
"source": {
"type": "git",
"url": "https://github.com/zendframework/Component_ZendFeed.git",
"reference": "release-2.2.1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/Component_ZendFeed/zipball/release-2.2.1",
"reference": "release-2.2.1",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"zendframework/zend-escaper": "self.version",
"zendframework/zend-stdlib": "self.version"
},
"suggest": {
"zendframework/zend-http": "Zend\\Http for PubSubHubbub, and optionally for use with Zend\\Feed\\Reader",
"zendframework/zend-servicemanager": "Zend\\ServiceManager component, for default/recommended ExtensionManager implementations",
"zendframework/zend-validator": "Zend\\Validator component"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
}
},
"autoload": {
"psr-0": {
"Zend\\Feed\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "provides functionality for consuming RSS and Atom feeds",
"keywords": [
"feed",
"zf2"
],
"time": "2013-06-12 19:45:31"
},
{
"name": "zendframework/zend-stdlib",
"version": "2.2.1",
"target-dir": "Zend/Stdlib",
"source": {
"type": "git",
"url": "https://github.com/zendframework/Component_ZendStdlib.git",
"reference": "release-2.2.1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/release-2.2.1",
"reference": "release-2.2.1",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"zendframework/zend-eventmanager": "To support aggregate hydrator usage",
"zendframework/zend-servicemanager": "To support hydrator plugin manager usage"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
}
},
"autoload": {
"psr-0": {
"Zend\\Stdlib\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"keywords": [
"stdlib",
"zf2"
],
"time": "2013-06-12 19:46:58"
}
],
"packages-dev": [
......
......@@ -465,3 +465,57 @@ services:
date:
class: Drupal\Core\Datetime\Date
arguments: ['@config.factory', '@language_manager']
feed.bridge.reader:
class: Drupal\Component\Bridge\ZfExtensionManagerSfContainer
calls:
- [setContainer, ['@service_container']]
arguments: ['feed.reader.']
feed.bridge.writer:
class: Drupal\Component\Bridge\ZfExtensionManagerSfContainer
calls:
- [setContainer, ['@service_container']]
arguments: ['feed.writer.']
# Zend Feed reader plugins
feed.reader.dublincoreentry:
class: Zend\Feed\Reader\Extension\DublinCore\Entry
feed.reader.dublincorefeed:
class: Zend\Feed\Reader\Extension\DublinCore\Feed
feed.reader.contententry:
class: Zend\Feed\Reader\Extension\Content\Entry
feed.reader.atomentry:
class: Zend\Feed\Reader\Extension\Atom\Entry
feed.reader.atomfeed:
class: Zend\Feed\Reader\Extension\Atom\Feed
feed.reader.slashentry:
class: Zend\Feed\Reader\Extension\Slash\Entry
feed.reader.wellformedwebentry:
class: Zend\Feed\Reader\Extension\WellFormedWeb\Entry
feed.reader.threadentry:
class: Zend\Feed\Reader\Extension\Thread\Entry
feed.reader.podcastentry:
class: Zend\Feed\Reader\Extension\Podcast\Entry
feed.reader.podcastfeed:
class: Zend\Feed\Reader\Extension\Podcast\Feed
# Zend Feed writer plugins
feed.writer.atomrendererfeed:
class: Zend\Feed\Writer\Extension\Atom\Renderer\Feed
feed.writer.contentrendererentry:
class: Zend\Feed\Writer\Extension\Content\Renderer\Entry
feed.writer.dublincorerendererentry:
class: Zend\Feed\Writer\Extension\DublinCore\Renderer\Entry
feed.writer.dublincorerendererfeed:
class: Zend\Feed\Writer\Extension\DublinCore\Renderer\Feed
feed.writer.itunesentry:
class: Zend\Feed\Writer\Extension\ITunes\Entry
feed.writer.itunesfeed:
class: Zend\Feed\Writer\Extension\ITunes\Feed
feed.writer.itunesrendererentry:
class: Zend\Feed\Writer\Extension\ITunes\Renderer\Entry
feed.writer.itunesrendererfeed:
class: Zend\Feed\Writer\Extension\ITunes\Renderer\Feed
feed.writer.slashrendererentry:
class: Zend\Feed\Writer\Extension\Slash\Renderer\Entry
feed.writer.threadingrendererentry:
class: Zend\Feed\Writer\Extension\Threading\Renderer\Entry
feed.writer.wellformedwebrendererentry:
class: Zend\Feed\Writer\Extension\WellFormedWeb\Renderer\Entry
......@@ -22,6 +22,8 @@
use Drupal\Core\Routing\GeneratorNotInitializedException;
use Drupal\Core\SystemListingInfo;
use Drupal\Core\Template\Attribute;
use Zend\Feed\Writer\Writer;
use Zend\Feed\Reader\Reader;
/**
* @file
......@@ -3988,6 +3990,10 @@ function _drupal_bootstrap_code() {
// Load all enabled modules
Drupal::moduleHandler()->loadAll();
// Set our bridge extension manager to Zend Feed.
Reader::setExtensionManager(Drupal::service('feed.bridge.reader'));
Writer::setExtensionManager(Drupal::service('feed.bridge.writer'));
// Make sure all stream wrappers are registered.
file_get_stream_wrappers();
......
<?php
/**
* @file
* Contains \Drupal\Component\Bridge\ZfExtensionManagerSfContainer
*/
namespace Drupal\Component\Bridge;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Zend\Feed\Reader\ExtensionManagerInterface as ReaderManagerInterface;
use Zend\Feed\Writer\ExtensionManagerInterface as WriterManagerInterface;
/**
* Defines a bridge between the ZF2 service manager to Symfony container.
*/
class ZfExtensionManagerSfContainer implements ReaderManagerInterface, WriterManagerInterface, ContainerAwareInterface {
/**
* This property was based from Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*
* A map of characters to be replaced through strtr.
*
* @var array
*
* @see \Drupal\Component\Bridge\ZfExtensionManagerSfContainer::canonicalizeName().
*/
protected $canonicalNamesReplacements = array('-' => '', '_' => '', ' ' => '', '\\' => '', '/' => '');
/**
* The prefix to be used when retrieving plugins from the container.
*
* @var string
*/
protected $prefix = '';
/**
* Constructs a ZfExtensionManagerSfContainer object.
*
* @param string $prefix
* The prefix to be used when retrieving plugins from the container.
*/
public function __construct($prefix = '') {
return $this->prefix = $prefix;
}
/**
* {@inheritdoc}
*/
public function get($extension) {
return $this->container->get($this->prefix . $this->canonicalizeName($extension));
}
/**
* {@inheritdoc}
*/
public function has($extension) {
return $this->container->has($this->prefix . $this->canonicalizeName($extension));
}
/**
* This method was based from Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*
* Canonicalize the extension name to a service name.
*
* @param string $name
* The extension name.
*
* @return string
* The service name, without the prefix.
*/
protected function canonicalizeName($name) {
if (isset($this->canonicalNames[$name])) {
return $this->canonicalNames[$name];
}
// This is just for performance instead of using str_replace().
return $this->canonicalNames[$name] = strtolower(strtr($name, $this->canonicalNamesReplacements));
}
/**
* {@inheritdoc}
*/
public function setContainer(ContainerInterface $container = NULL) {
$this->container = $container;
}
}
......@@ -7,6 +7,8 @@
namespace Drupal\aggregator\Tests;
use Zend\Feed\Reader\Reader;
/**
* Tests feed parsing in the Aggregator module.
*/
......@@ -25,6 +27,11 @@ function setUp() {
// feeds have hardcoded dates in them (which may be expired when this test
// is run).
config('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save();
// Reset any reader cache between tests.
Reader::reset();
// Set our bridge extension manager to Zend Feed.
$bridge = $this->container->get('feed.bridge.reader');
Reader::setExtensionManager($bridge);
}
/**
......
......@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInitc269e792cec97d4c278bb968546f51b4::getLoader();
return ComposerAutoloaderInit4ae4005bb4ec82f3372265feb7e84f37::getLoader();
......@@ -121,8 +121,8 @@ public function add($prefix, $paths, $prepend = false)
/**
* Registers a set of classes, replacing any others previously set.
*
* @param string $prefix The classes prefix
* @param array|string $paths The location(s) of the classes
* @param string $prefix The classes prefix
* @param array|string $paths The location(s) of the classes
*/
public function set($prefix, $paths)
{
......
......@@ -6,6 +6,9 @@
$baseDir = dirname(dirname($vendorDir));
return array(
'Zend\\Stdlib\\' => array($vendorDir . '/zendframework/zend-stdlib'),
'Zend\\Feed\\' => array($vendorDir . '/zendframework/zend-feed'),
'Zend\\Escaper\\' => array($vendorDir . '/zendframework/zend-escaper'),
'Twig_' => array($vendorDir . '/twig/twig/lib'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'),
......
......@@ -2,7 +2,7 @@
// autoload_real.php generated by Composer
class ComposerAutoloaderInitc269e792cec97d4c278bb968546f51b4
class ComposerAutoloaderInit4ae4005bb4ec82f3372265feb7e84f37
{
private static $loader;
......@@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitc269e792cec97d4c278bb968546f51b4', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit4ae4005bb4ec82f3372265feb7e84f37', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitc269e792cec97d4c278bb968546f51b4', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit4ae4005bb4ec82f3372265feb7e84f37', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
......
This diff is collapsed.
......@@ -6,6 +6,7 @@ php:
env:
- SYMFONY_VERSION=2.2.*
- SYMFONY_VERSION=2.3.*
- SYMFONY_VERSION=dev-master
before_script:
......
# Changelog
Changelog
=========
## 1.1
1.1
---
* Dropped Symfony 2.1 support and got rid of ConfigurableUrlMatcher class
* Fix locale handling to always respect locale but never have unnecessary ?locale=
\ No newline at end of file
* **2013-04-30**: Dropped Symfony 2.1 support and got rid of ConfigurableUrlMatcher class
* **2013-04-05**: [ContentAwareGenerator] Fix locale handling to always respect locale but never have unnecessary ?locale=
......@@ -13,13 +13,13 @@
],
"minimum-stability": "dev",
"require": {
"php": ">=5.3.2",
"symfony/routing": ">=2.2,<2.4-dev",
"symfony/http-kernel": ">=2.2,<2.4-dev",
"php": ">=5.3.3",
"symfony/routing": "~2.2",
"symfony/http-kernel": "~2.2",
"psr/log": "~1.0"
},
"suggest": {
"symfony/http-foundation": "ChainRouter/DynamicRouter have optional support for Request instances, several enhancers require a Request instances, >=2.2,<2.3-dev"
"symfony/http-foundation": "ChainRouter/DynamicRouter have optional support for Request instances, several enhancers require a Request instances, ~2.2"
},
"autoload": {
"psr-0": { "Symfony\\Cmf\\Component\\Routing": "" }
......
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Escaper\Exception;
interface ExceptionInterface
{}
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Escaper\Exception;
/**
* Invalid argument exception
*/
class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
{
}
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Escaper\Exception;
/**
* Invalid argument exception
*/
class RuntimeException extends \RuntimeException implements
ExceptionInterface
{
}
Escaper Component from ZF2
==========================
This is the Escaper component for ZF2.
- File issues at https://github.com/zendframework/zf2/issues
- Create pull requests against https://github.com/zendframework/zf2
- Documentation is at http://framework.zend.com/docs
LICENSE
-------
The files in this archive are released under the [Zend Framework
license](http://framework.zend.com/license), which is a 3-clause BSD license.
{
"name": "zendframework/zend-escaper",
"description": " ",
"license": "BSD-3-Clause",
"keywords": [
"zf2",
"escaper"
],
"autoload": {
"psr-0": {
"Zend\\Escaper\\": ""
}
},
"target-dir": "Zend/Escaper",
"require": {
"php": ">=5.3.3"
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
}
}
}
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Feed\Exception;
class BadMethodCallException
extends \BadMethodCallException
implements ExceptionInterface
{}
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Feed\Exception;
interface ExceptionInterface
{}