Commit 1b68fb8f authored by catch's avatar catch

Issue #3104015 by alexpott, TravisCarden, xjm, longwave, Spokje, catch, fgm,...

Issue #3104015 by alexpott, TravisCarden, xjm, longwave, Spokje, catch, fgm, Berdir, tedbow, Bruno Vincent: Replace ZendFramework/* dependencies with their Laminas equivalents
parent 6f339f28
This diff is collapsed.
......@@ -22,6 +22,11 @@
"guzzlehttp/guzzle": "6.3.3",
"guzzlehttp/promises": "v1.3.1",
"guzzlehttp/psr7": "1.6.1",
"laminas/laminas-diactoros": "1.8.7",
"laminas/laminas-escaper": "2.6.1",
"laminas/laminas-feed": "2.12.0",
"laminas/laminas-stdlib": "3.2.1",
"laminas/laminas-zendframework-bridge": "1.0.1",
"masterminds/html5": "2.3.0",
"paragonie/random_compat": "v9.99.99",
"pear/archive_tar": "1.4.9",
......@@ -55,10 +60,6 @@
"symfony/validator": "v3.4.35",
"symfony/yaml": "v3.4.35",
"twig/twig": "v1.42.3",
"typo3/phar-stream-wrapper": "v3.1.3",
"zendframework/zend-diactoros": "1.8.7",
"zendframework/zend-escaper": "2.6.1",
"zendframework/zend-feed": "2.12.0",
"zendframework/zend-stdlib": "3.2.1"
"typo3/phar-stream-wrapper": "v3.1.3"
}
}
......@@ -96,9 +96,6 @@ class Config {
'symfony-cmf/routing' => ['Test', 'Tests'],
'theseer/tokenizer' => ['tests'],
'twig/twig' => ['doc', 'ext', 'test', 'tests'],
'zendframework/zend-escaper' => ['doc'],
'zendframework/zend-feed' => ['doc'],
'zendframework/zend-stdlib' => ['doc'],
];
/**
......
......@@ -38,12 +38,12 @@
"guzzlehttp/guzzle": "^6.3",
"symfony-cmf/routing": "^1.4",
"easyrdf/easyrdf": "^0.9",
"zendframework/zend-feed": "^2.12",
"laminas/laminas-feed": "^2.12",
"stack/builder": "^1.0",
"egulias/email-validator": "^2.0",
"masterminds/html5": "^2.1",
"symfony/psr-http-message-bridge": "^1.1.2",
"zendframework/zend-diactoros": "^1.8",
"laminas/laminas-diactoros": "^1.8",
"composer/semver": "^1.0",
"asm89/stack-cors": "^1.1",
"pear/archive_tar": "^1.4.9",
......
......@@ -1446,78 +1446,78 @@ services:
class: Drupal\Component\Bridge\ZfExtensionManagerSfContainer
calls:
- [setContainer, ['@service_container']]
- [setStandalone, ['\Zend\Feed\Reader\StandaloneExtensionManager']]
- [setStandalone, ['\Laminas\Feed\Reader\StandaloneExtensionManager']]
arguments: ['feed.reader.']
feed.bridge.writer:
class: Drupal\Component\Bridge\ZfExtensionManagerSfContainer
calls:
- [setContainer, ['@service_container']]
- [setStandalone, ['\Zend\Feed\Writer\StandaloneExtensionManager']]
- [setStandalone, ['\Laminas\Feed\Writer\StandaloneExtensionManager']]
arguments: ['feed.writer.']
# Zend Feed reader plugins. Plugin instances should not be shared.
# Laminas Feed reader plugins. Plugin instances should not be shared.
feed.reader.dublincoreentry:
class: Zend\Feed\Reader\Extension\DublinCore\Entry
class: Laminas\Feed\Reader\Extension\DublinCore\Entry
shared: false
feed.reader.dublincorefeed:
class: Zend\Feed\Reader\Extension\DublinCore\Feed
class: Laminas\Feed\Reader\Extension\DublinCore\Feed
shared: false
feed.reader.contententry:
class: Zend\Feed\Reader\Extension\Content\Entry
class: Laminas\Feed\Reader\Extension\Content\Entry
shared: false
feed.reader.atomentry:
class: Zend\Feed\Reader\Extension\Atom\Entry
class: Laminas\Feed\Reader\Extension\Atom\Entry
shared: false
feed.reader.atomfeed:
class: Zend\Feed\Reader\Extension\Atom\Feed
class: Laminas\Feed\Reader\Extension\Atom\Feed
shared: false
feed.reader.slashentry:
class: Zend\Feed\Reader\Extension\Slash\Entry
class: Laminas\Feed\Reader\Extension\Slash\Entry
shared: false
feed.reader.wellformedwebentry:
class: Zend\Feed\Reader\Extension\WellFormedWeb\Entry
class: Laminas\Feed\Reader\Extension\WellFormedWeb\Entry
shared: false
feed.reader.threadentry:
class: Zend\Feed\Reader\Extension\Thread\Entry
class: Laminas\Feed\Reader\Extension\Thread\Entry
shared: false
feed.reader.podcastentry:
class: Zend\Feed\Reader\Extension\Podcast\Entry
class: Laminas\Feed\Reader\Extension\Podcast\Entry
shared: false
feed.reader.podcastfeed:
class: Zend\Feed\Reader\Extension\Podcast\Feed
class: Laminas\Feed\Reader\Extension\Podcast\Feed
shared: false
# Zend Feed writer plugins. Plugins should be set as prototype scope.
# Laminas Feed writer plugins. Plugins should be set as prototype scope.
feed.writer.atomrendererfeed:
class: Zend\Feed\Writer\Extension\Atom\Renderer\Feed
class: Laminas\Feed\Writer\Extension\Atom\Renderer\Feed
shared: false
feed.writer.contentrendererentry:
class: Zend\Feed\Writer\Extension\Content\Renderer\Entry
class: Laminas\Feed\Writer\Extension\Content\Renderer\Entry
shared: false
feed.writer.dublincorerendererentry:
class: Zend\Feed\Writer\Extension\DublinCore\Renderer\Entry
class: Laminas\Feed\Writer\Extension\DublinCore\Renderer\Entry
shared: false
feed.writer.dublincorerendererfeed:
class: Zend\Feed\Writer\Extension\DublinCore\Renderer\Feed
class: Laminas\Feed\Writer\Extension\DublinCore\Renderer\Feed
shared: false
feed.writer.itunesentry:
class: Zend\Feed\Writer\Extension\ITunes\Entry
class: Laminas\Feed\Writer\Extension\ITunes\Entry
shared: false
feed.writer.itunesfeed:
class: Zend\Feed\Writer\Extension\ITunes\Feed
class: Laminas\Feed\Writer\Extension\ITunes\Feed
shared: false
feed.writer.itunesrendererentry:
class: Zend\Feed\Writer\Extension\ITunes\Renderer\Entry
class: Laminas\Feed\Writer\Extension\ITunes\Renderer\Entry
shared: false
feed.writer.itunesrendererfeed:
class: Zend\Feed\Writer\Extension\ITunes\Renderer\Feed
class: Laminas\Feed\Writer\Extension\ITunes\Renderer\Feed
shared: false
feed.writer.slashrendererentry:
class: Zend\Feed\Writer\Extension\Slash\Renderer\Entry
class: Laminas\Feed\Writer\Extension\Slash\Renderer\Entry
shared: false
feed.writer.threadingrendererentry:
class: Zend\Feed\Writer\Extension\Threading\Renderer\Entry
class: Laminas\Feed\Writer\Extension\Threading\Renderer\Entry
shared: false
feed.writer.wellformedwebrendererentry:
class: Zend\Feed\Writer\Extension\WellFormedWeb\Renderer\Entry
class: Laminas\Feed\Writer\Extension\WellFormedWeb\Renderer\Entry
shared: false
theme.manager:
class: Drupal\Core\Theme\ThemeManager
......
......@@ -5,26 +5,27 @@
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Zend\Feed\Reader\ExtensionManagerInterface as ReaderManagerInterface;
use Zend\Feed\Writer\ExtensionManagerInterface as WriterManagerInterface;
use Laminas\Feed\Reader\ExtensionManagerInterface as ReaderManagerInterface;
use Laminas\Feed\Writer\ExtensionManagerInterface as WriterManagerInterface;
/**
* Defines a bridge between the ZF2 service manager to Symfony container.
* Defines a bridge between the Laminas service manager to Symfony container.
*/
class ZfExtensionManagerSfContainer implements ReaderManagerInterface, WriterManagerInterface, ContainerAwareInterface {
/**
* This property was based from Zend Framework (http://framework.zend.com/)
* A map of characters to be replaced through strtr.
*
* @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
* This property is based on Laminas service manager.
*
* A map of characters to be replaced through strtr.
* @link https://github.com/laminas/laminas-servicemanager for the canonical source repository
* @copyright Copyright (c) 2019, Laminas Foundation. (https://getlaminas.org/)
* @license https://github.com/laminas/laminas-servicemanager/blob/master/LICENSE.md
*
* @var array
*
* @see \Drupal\Component\Bridge\ZfExtensionManagerSfContainer::canonicalizeName().
* @see https://github.com/laminas/laminas-servicemanager/blob/2.7.11/src/ServiceManager.php#L114
*/
protected $canonicalNamesReplacements = ['-' => '', '_' => '', ' ' => '', '\\' => '', '/' => ''];
......@@ -50,7 +51,7 @@ class ZfExtensionManagerSfContainer implements ReaderManagerInterface, WriterMan
protected $canonicalNames;
/**
* @var \Zend\Feed\Reader\ExtensionManagerInterface|\Zend\Feed\Writer\ExtensionManagerInterface
* @var \Laminas\Feed\Reader\ExtensionManagerInterface|\Laminas\Feed\Writer\ExtensionManagerInterface
*/
protected $standalone;
......@@ -90,19 +91,21 @@ public function has($extension) {
}
/**
* This method was based from Zend Framework (http://framework.zend.com/)
* Canonicalize the extension name to a service name.
*
* @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
* This method is based on Laminas service manager.
*
* Canonicalize the extension name to a service name.
* @link https://github.com/laminas/laminas-servicemanager for the canonical source repository
* @copyright Copyright (c) 2019, Laminas Foundation. (https://getlaminas.org/)
* @license https://github.com/laminas/laminas-servicemanager/blob/master/LICENSE.md
*
* @param string $name
* The extension name.
*
* @return string
* The service name, without the prefix.
*
* @see https://github.com/laminas/laminas-servicemanager/blob/2.7.11/src/ServiceManager.php#L900
*/
protected function canonicalizeName($name) {
if (isset($this->canonicalNames[$name])) {
......@@ -124,7 +127,7 @@ public function setContainer(ContainerInterface $container = NULL) {
*/
public function setStandalone($class) {
if (!is_subclass_of($class, ReaderManagerInterface::class) && !is_subclass_of($class, WriterManagerInterface::class)) {
throw new \RuntimeException("$class must implement Zend\Feed\Reader\ExtensionManagerInterface or Zend\Feed\Writer\ExtensionManagerInterface");
throw new \RuntimeException("$class must implement Laminas\Feed\Reader\ExtensionManagerInterface or Laminas\Feed\Writer\ExtensionManagerInterface");
}
$this->standalone = new $class();
}
......
......@@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0.8",
"zendframework/zend-feed": "^2.12"
"laminas/laminas-feed": "^2.12"
},
"autoload": {
"psr-4": {
......
......@@ -37,6 +37,9 @@ class Composer {
'jcalderonzumba/gastonjs' => ['docs', 'examples', 'tests'],
'jcalderonzumba/mink-phantomjs-driver' => ['tests'],
'justinrainbow/json-schema' => ['demo'],
'laminas/laminas-escaper' => ['doc'],
'laminas/laminas-feed' => ['doc'],
'laminas/laminas-stdlib' => ['doc'],
'masterminds/html5' => ['bin', 'test'],
'mikey179/vfsStream' => ['src/test'],
'myclabs/deep-copy' => ['doc'],
......@@ -89,9 +92,6 @@ class Composer {
'symfony-cmf/routing' => ['Test', 'Tests'],
'theseer/tokenizer' => ['tests'],
'twig/twig' => ['doc', 'ext', 'test', 'tests'],
'zendframework/zend-escaper' => ['doc'],
'zendframework/zend-feed' => ['doc'],
'zendframework/zend-stdlib' => ['doc'],
];
/**
......
......@@ -5,8 +5,8 @@
use Drupal\aggregator\Plugin\ParserInterface;
use Drupal\aggregator\FeedInterface;
use Drupal\Core\Messenger\MessengerTrait;
use Zend\Feed\Reader\Reader;
use Zend\Feed\Reader\Exception\ExceptionInterface;
use Laminas\Feed\Reader\Reader;
use Laminas\Feed\Reader\Exception\ExceptionInterface;
/**
* Defines a default parser implementation.
......@@ -27,7 +27,7 @@ class DefaultParser implements ParserInterface {
* {@inheritdoc}
*/
public function parse(FeedInterface $feed) {
// Set our bridge extension manager to Zend Feed.
// Set our bridge extension manager to Laminas Feed.
Reader::setExtensionManager(\Drupal::service('feed.bridge.reader'));
try {
$channel = Reader::importString($feed->source_string);
......
......@@ -4,7 +4,7 @@
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
use Zend\Stdlib\ArrayUtils;
use Laminas\Stdlib\ArrayUtils;
/**
* Tests toggling of content preview.
......
......@@ -27,7 +27,7 @@
use Drupal\Tests\TestFileCreationTrait;
use Drupal\Tests\user\Traits\UserCreationTrait as BaseUserCreationTrait;
use Drupal\Tests\XdebugRequestTrait;
use Zend\Diactoros\Uri;
use Laminas\Diactoros\Uri;
/**
* Test case for typical Drupal tests.
......
......@@ -8,7 +8,7 @@
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Zend\Diactoros\Response\HtmlResponse;
use Laminas\Diactoros\Response\HtmlResponse;
/**
* Controller routines for testing the routing system.
......
......@@ -6,8 +6,8 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Zend\Feed\Reader\Extension\Atom\Entry;
use Zend\Feed\Reader\StandaloneExtensionManager;
use Laminas\Feed\Reader\Extension\Atom\Entry;
use Laminas\Feed\Reader\StandaloneExtensionManager;
/**
* @coversDefaultClass \Drupal\Component\Bridge\ZfExtensionManagerSfContainer
......@@ -59,7 +59,7 @@ public function testHas() {
*/
public function testSetStandaloneException() {
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Drupal\Tests\Component\Bridge\ZfExtensionManagerSfContainerTest must implement Zend\Feed\Reader\ExtensionManagerInterface or Zend\Feed\Writer\ExtensionManagerInterface');
$this->expectExceptionMessage('Drupal\Tests\Component\Bridge\ZfExtensionManagerSfContainerTest must implement Laminas\Feed\Reader\ExtensionManagerInterface or Laminas\Feed\Writer\ExtensionManagerInterface');
$bridge = new ZfExtensionManagerSfContainer();
$bridge->setStandalone(static::class);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment