mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/11305] Define hook finder as a service on the container.
PHPBB3-11305
This commit is contained in:
parent
3360d4cfce
commit
bc317c49a7
4 changed files with 10 additions and 3 deletions
|
@ -120,7 +120,7 @@ $phpbb_style = $phpbb_container->get('style');
|
||||||
// Add own hook handler
|
// Add own hook handler
|
||||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('phpbb_template', 'display')));
|
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('phpbb_template', 'display')));
|
||||||
$phpbb_hook_finder = new phpbb_hook_finder($phpbb_root_path, $phpEx, $phpbb_container->get('cache.driver'));
|
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
|
||||||
|
|
||||||
foreach ($phpbb_hook_finder->find() as $hook)
|
foreach ($phpbb_hook_finder->find() as $hook)
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,6 +127,13 @@ services:
|
||||||
- @dispatcher
|
- @dispatcher
|
||||||
- @controller.resolver
|
- @controller.resolver
|
||||||
|
|
||||||
|
hook_finder:
|
||||||
|
class: phpbb_hook_finder
|
||||||
|
arguments:
|
||||||
|
- %core.root_path%
|
||||||
|
- .%core.php_ext%
|
||||||
|
- @cache.driver
|
||||||
|
|
||||||
kernel_request_subscriber:
|
kernel_request_subscriber:
|
||||||
class: phpbb_event_kernel_request_subscriber
|
class: phpbb_event_kernel_request_subscriber
|
||||||
arguments:
|
arguments:
|
||||||
|
|
|
@ -133,7 +133,7 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
|
||||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
||||||
|
|
||||||
$phpbb_hook_finder = new phpbb_hook_finder($phpbb_root_path, $phpEx, $phpbb_container->get('cache.driver'));
|
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
|
||||||
foreach ($phpbb_hook_finder->find() as $hook)
|
foreach ($phpbb_hook_finder->find() as $hook)
|
||||||
{
|
{
|
||||||
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
|
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
|
||||||
|
|
|
@ -196,7 +196,7 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
|
||||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
||||||
|
|
||||||
$phpbb_hook_finder = new phpbb_hook_finder($phpbb_root_path, $phpEx, $phpbb_container->get('cache.driver'));
|
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
|
||||||
foreach ($phpbb_hook_finder->find() as $hook)
|
foreach ($phpbb_hook_finder->find() as $hook)
|
||||||
{
|
{
|
||||||
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
|
@include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue