aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-09-17 20:09:49 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-09-17 20:09:49 +0200
commit910cd5edbe1e7732dd3d19903f4131172f1a0a21 (patch)
tree0cc521b2a05a61b0585b26282abed6d1bd002aae /phpBB
parent676f453cbde62e49c31888aebc02219958c131e4 (diff)
parentc988b98ac65b726f02dd61de93c911064e0cfe66 (diff)
downloadforums-910cd5edbe1e7732dd3d19903f4131172f1a0a21.tar
forums-910cd5edbe1e7732dd3d19903f4131172f1a0a21.tar.gz
forums-910cd5edbe1e7732dd3d19903f4131172f1a0a21.tar.bz2
forums-910cd5edbe1e7732dd3d19903f4131172f1a0a21.tar.xz
forums-910cd5edbe1e7732dd3d19903f4131172f1a0a21.zip
Merge pull request #2948 from Nicofuma/ticket/13061
[ticket/13061] Replace the service event.subscriber_loader by a compiler pass * Nicofuma/ticket/13061: [ticket/13061] Replace the service event.subscriber_loader by a compiler pass
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/config/services.yml15
-rw-r--r--phpBB/download/file.php1
-rw-r--r--phpBB/includes/compatibility_globals.php1
-rw-r--r--phpBB/phpbb/di/container_builder.php5
-rw-r--r--phpBB/phpbb/event/extension_subscriber_loader.php39
5 files changed, 4 insertions, 57 deletions
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index 95a1210045..cca655263f 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -158,21 +158,6 @@ services:
arguments:
- @dbal.conn
- event.subscriber_loader:
- class: phpbb\event\extension_subscriber_loader
- arguments:
- - @dispatcher
- - @event.listener_collection
- calls:
- - [load, []]
-
- event.listener_collection:
- class: phpbb\di\service_collection
- arguments:
- - @service_container
- tags:
- - { name: service_collection, tag: event.listener }
-
ext.manager:
class: phpbb\extension\manager
arguments:
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index db657e95f0..77fb455bc1 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -83,7 +83,6 @@ if (isset($_GET['avatar']))
// load extensions
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
- $phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader');
// worst-case default
$browser = strtolower($request->header('User-Agent', 'msie 6.0'));
diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php
index 2a60f7fb8e..54c9287c96 100644
--- a/phpBB/includes/compatibility_globals.php
+++ b/phpBB/includes/compatibility_globals.php
@@ -43,6 +43,5 @@ $phpbb_path_helper = $phpbb_container->get('path_helper');
// load extensions
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
-$phpbb_subscriber_loader = $phpbb_container->get('event.subscriber_loader');
$template = $phpbb_container->get('template');
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
index 553b723cc8..638c13e86d 100644
--- a/phpBB/phpbb/di/container_builder.php
+++ b/phpBB/phpbb/di/container_builder.php
@@ -15,6 +15,7 @@ namespace phpbb\di;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
+use Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass;
class container_builder
{
@@ -160,11 +161,13 @@ class container_builder
if ($this->use_custom_pass)
{
+ // Symfony Kernel Listeners
$this->container->addCompilerPass(new \phpbb\di\pass\collection_pass());
+ $this->container->addCompilerPass(new RegisterListenersPass('dispatcher', 'event.listener_listener', 'event.listener'));
if ($this->use_kernel_pass)
{
- $this->container->addCompilerPass(new \phpbb\di\pass\kernel_pass());
+ $this->container->addCompilerPass(new RegisterListenersPass('dispatcher'));
}
}
diff --git a/phpBB/phpbb/event/extension_subscriber_loader.php b/phpBB/phpbb/event/extension_subscriber_loader.php
deleted file mode 100644
index fc01961e9f..0000000000
--- a/phpBB/phpbb/event/extension_subscriber_loader.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-namespace phpbb\event;
-
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-
-class extension_subscriber_loader
-{
- private $dispatcher;
- private $listener_collection;
-
- public function __construct(EventDispatcherInterface $dispatcher, \phpbb\di\service_collection $listener_collection)
- {
- $this->dispatcher = $dispatcher;
- $this->listener_collection = $listener_collection;
- }
-
- public function load()
- {
- if (!empty($this->listener_collection))
- {
- foreach ($this->listener_collection as $listener)
- {
- $this->dispatcher->addSubscriber($listener);
- }
- }
- }
-}