From 50bc453aa6c91ae9c9df5cb633615825c9df7b6d Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 21 Jul 2012 21:02:55 +0200 Subject: [feature/dic] Load services from extensions PHPBB3-10739 --- phpBB/includes/di/processor/ext.php | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 phpBB/includes/di/processor/ext.php (limited to 'phpBB/includes/di/processor/ext.php') diff --git a/phpBB/includes/di/processor/ext.php b/phpBB/includes/di/processor/ext.php new file mode 100644 index 0000000000..b39ba5e686 --- /dev/null +++ b/phpBB/includes/di/processor/ext.php @@ -0,0 +1,41 @@ +extension_manager = $extension_manager; + } + + public function process(ContainerBuilder $container) + { + $enabled_exts = $this->extension_manager->all_enabled(); + foreach ($enabled_exts as $name => $path) { + if (file_exists($path . '/config/services.yml')) { + $loader = new YamlFileLoader($container, new FileLocator($path . '/config')); + $loader->load('services.yml'); + } + } + } +} -- cgit v1.2.1 From 4feb9aa8d7bda303b62acec924008f75042eb757 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 25 Aug 2012 16:43:41 +0200 Subject: [feature/dic] Coding style: Braces PHPBB3-10739 --- phpBB/includes/di/processor/ext.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/di/processor/ext.php') diff --git a/phpBB/includes/di/processor/ext.php b/phpBB/includes/di/processor/ext.php index b39ba5e686..04a586a086 100644 --- a/phpBB/includes/di/processor/ext.php +++ b/phpBB/includes/di/processor/ext.php @@ -31,8 +31,10 @@ class phpbb_di_processor_ext implements phpbb_di_processor_interface public function process(ContainerBuilder $container) { $enabled_exts = $this->extension_manager->all_enabled(); - foreach ($enabled_exts as $name => $path) { - if (file_exists($path . '/config/services.yml')) { + foreach ($enabled_exts as $name => $path) + { + if (file_exists($path . '/config/services.yml')) + { $loader = new YamlFileLoader($container, new FileLocator($path . '/config')); $loader->load('services.yml'); } -- cgit v1.2.1 From 282a80077d4630ba59043fffe59e8a7ce8619ecb Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 1 Sep 2012 19:17:01 +0200 Subject: [feature/dic] Spaces to tabs, add useless docblocks Fully documents the constructors of the processors and the cron tasks. PHPBB3-10739 --- phpBB/includes/di/processor/ext.php | 47 +++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 18 deletions(-) (limited to 'phpBB/includes/di/processor/ext.php') diff --git a/phpBB/includes/di/processor/ext.php b/phpBB/includes/di/processor/ext.php index 04a586a086..e69a3d73b3 100644 --- a/phpBB/includes/di/processor/ext.php +++ b/phpBB/includes/di/processor/ext.php @@ -12,32 +12,43 @@ */ if (!defined('IN_PHPBB')) { - exit; + exit; } use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +/** +* Load the service configurations from all extensions into the container. +*/ class phpbb_di_processor_ext implements phpbb_di_processor_interface { - private $extension_manager; + private $extension_manager; - public function __construct($extension_manager) - { - $this->extension_manager = $extension_manager; - } + /** + * Constructor. + * + * @param string $extension_manager The extension manager + */ + public function __construct($extension_manager) + { + $this->extension_manager = $extension_manager; + } - public function process(ContainerBuilder $container) - { - $enabled_exts = $this->extension_manager->all_enabled(); - foreach ($enabled_exts as $name => $path) - { - if (file_exists($path . '/config/services.yml')) - { - $loader = new YamlFileLoader($container, new FileLocator($path . '/config')); - $loader->load('services.yml'); - } - } - } + /** + * @inheritdoc + */ + public function process(ContainerBuilder $container) + { + $enabled_exts = $this->extension_manager->all_enabled(); + foreach ($enabled_exts as $name => $path) + { + if (file_exists($path . '/config/services.yml')) + { + $loader = new YamlFileLoader($container, new FileLocator($path . '/config')); + $loader->load('services.yml'); + } + } + } } -- cgit v1.2.1