aboutsummaryrefslogtreecommitdiff
path: root/phpBB
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-11-23 14:40:27 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-11-23 14:40:27 +0100
commit6c5fa362dd102db0da51df70cacfd3368fc29b34 (patch)
treec327beb4c6611eccde01c09b857a751246c28f23 /phpBB
parent[ticket/16204] Remove hooks system (diff)
downloadphpbb-6c5fa362dd102db0da51df70cacfd3368fc29b34.tar.gz
phpbb-6c5fa362dd102db0da51df70cacfd3368fc29b34.tar.bz2
phpbb-6c5fa362dd102db0da51df70cacfd3368fc29b34.zip
[ticket/16204] Remove hook finder and services file
PHPBB3-16204
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/common.php8
-rw-r--r--phpBB/config/default/container/services.yml1
-rw-r--r--phpBB/config/default/container/services_hook.yml7
-rw-r--r--phpBB/phpbb/hook/finder.php91
4 files changed, 0 insertions, 107 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index bfdc2c4fd4..1c07628351 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -143,14 +143,6 @@ if (@is_file($phpbb_root_path . $config['exts_composer_vendor_dir'] . '/autoload
require_once($phpbb_root_path . $config['exts_composer_vendor_dir'] . '/autoload.php');
}
-/* @var $phpbb_hook_finder \phpbb\hook\finder */
-$phpbb_hook_finder = $phpbb_container->get('hook_finder');
-
-foreach ($phpbb_hook_finder->find() as $hook)
-{
- @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx);
-}
-
/**
* Main event which is triggered on every page
*
diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml
index 0e9a037290..657af5465a 100644
--- a/phpBB/config/default/container/services.yml
+++ b/phpBB/config/default/container/services.yml
@@ -13,7 +13,6 @@ imports:
- { resource: services_files.yml }
- { resource: services_filesystem.yml }
- { resource: services_help.yml }
- - { resource: services_hook.yml }
- { resource: services_http.yml }
- { resource: services_language.yml }
- { resource: services_migrator.yml }
diff --git a/phpBB/config/default/container/services_hook.yml b/phpBB/config/default/container/services_hook.yml
deleted file mode 100644
index 10a84184a0..0000000000
--- a/phpBB/config/default/container/services_hook.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-services:
- hook_finder:
- class: phpbb\hook\finder
- arguments:
- - '%core.root_path%'
- - '%core.php_ext%'
- - '@cache.driver'
diff --git a/phpBB/phpbb/hook/finder.php b/phpBB/phpbb/hook/finder.php
deleted file mode 100644
index f5a68a1370..0000000000
--- a/phpBB/phpbb/hook/finder.php
+++ /dev/null
@@ -1,91 +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\hook;
-
-/**
-* The hook finder locates installed hooks.
-*/
-class finder
-{
- /**
- * @var \phpbb\cache\driver\driver_interface
- */
- protected $cache;
-
- /**
- * @var string
- */
- protected $phpbb_root_path;
-
- /**
- * @var string
- */
- protected $php_ext;
-
- /**
- * Creates a new finder instance.
- *
- * @param string $phpbb_root_path Path to the phpbb root directory
- * @param string $php_ext php file extension
- * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
- */
- public function __construct($phpbb_root_path, $php_ext, \phpbb\cache\driver\driver_interface $cache = null)
- {
- $this->phpbb_root_path = $phpbb_root_path;
- $this->cache = $cache;
- $this->php_ext = $php_ext;
- }
-
- /**
- * Finds all hook files.
- *
- * @param bool $cache Whether the result should be cached
- * @return array An array of paths to found hook files
- */
- public function find($cache = true)
- {
- if (!defined('DEBUG') && $cache && $this->cache)
- {
- $hook_files = $this->cache->get('_hooks');
- if ($hook_files !== false)
- {
- return $hook_files;
- }
- }
-
- $hook_files = array();
-
- // Now search for hooks...
- $dh = @opendir($this->phpbb_root_path . 'includes/hooks/');
-
- if ($dh)
- {
- while (($file = readdir($dh)) !== false)
- {
- if (strpos($file, 'hook_') === 0 && substr($file, -strlen('.' . $this->php_ext)) === '.' . $this->php_ext)
- {
- $hook_files[] = substr($file, 0, -(strlen($this->php_ext) + 1));
- }
- }
- closedir($dh);
- }
-
- if ($cache && $this->cache)
- {
- $this->cache->put('_hooks', $hook_files);
- }
-
- return $hook_files;
- }
-}