diff --git a/phpBB/common.php b/phpBB/common.php index 8a8e8fd2f5..f502d37c8f 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -120,7 +120,7 @@ $phpbb_style = $phpbb_container->get('style'); // Add own hook handler 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_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) { diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index 991f6d1214..5c450a5cf6 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -127,6 +127,13 @@ services: - @dispatcher - @controller.resolver + hook_finder: + class: phpbb_hook_finder + arguments: + - %core.root_path% + - .%core.php_ext% + - @cache.driver + kernel_request_subscriber: class: phpbb_event_kernel_request_subscriber arguments: diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index f31682c784..8950d677ae 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -133,7 +133,7 @@ if (file_exists($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_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) { @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 64c9ef9155..a03fda6395 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -196,7 +196,7 @@ if (file_exists($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_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) { @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);