From ce230f8dea4afb585e7aca5a1763c547b2c39e81 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Wed, 24 Apr 2013 17:15:28 -0500 Subject: [PATCH] [ticket/11335] (extension manager/finder) Make php_ext 'php' not '.php' PHPBB3-11335 --- phpBB/config/services.yml | 4 ++-- phpBB/includes/extension/finder.php | 8 ++++---- phpBB/includes/extension/manager.php | 4 ++-- phpBB/includes/extension/metadata_manager.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index 949f89b946..8f58d23fd9 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -134,7 +134,7 @@ services: - @filesystem - %tables.ext% - %core.root_path% - - .%core.php_ext% + - %core.php_ext% - @cache.driver ext.finder: @@ -144,7 +144,7 @@ services: - @filesystem - %core.root_path% - @cache.driver - - .%core.php_ext% + - %core.php_ext% - _ext_finder filesystem: diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index 02a9ebb8c3..766b9e9b63 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -62,7 +62,7 @@ class phpbb_extension_finder * @param string $cache_name The name of the cache variable, defaults to * _ext_finder */ - public function __construct(phpbb_extension_manager $extension_manager, phpbb_filesystem $filesystem, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = '.php', $cache_name = '_ext_finder') + public function __construct(phpbb_extension_manager $extension_manager, phpbb_filesystem $filesystem, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder') { $this->extension_manager = $extension_manager; $this->filesystem = $filesystem; @@ -256,8 +256,8 @@ class phpbb_extension_finder */ public function get_classes($cache = true, $use_all_available = false) { - $this->query['extension_suffix'] .= $this->php_ext; - $this->query['core_suffix'] .= $this->php_ext; + $this->query['extension_suffix'] .= '.' . $this->php_ext; + $this->query['core_suffix'] .= '.' . $this->php_ext; $files = $this->find($cache, false, $use_all_available); @@ -277,7 +277,7 @@ class phpbb_extension_finder { $file = preg_replace('#^includes/#', '', $file); - $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->php_ext))); + $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen('.' . $this->php_ext))); } return $classes; } diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index de9a3937c3..a1022762b8 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -51,7 +51,7 @@ class phpbb_extension_manager * @param phpbb_cache_driver_interface $cache A cache instance or null * @param string $cache_name The name of the cache variable, defaults to _ext */ - public function __construct(ContainerInterface $container, phpbb_db_driver $db, phpbb_config $config, phpbb_db_migrator $migrator, phpbb_filesystem $filesystem, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext') + public function __construct(ContainerInterface $container, phpbb_db_driver $db, phpbb_config $config, phpbb_db_migrator $migrator, phpbb_filesystem $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext') { $this->container = $container; $this->phpbb_root_path = $phpbb_root_path; @@ -412,7 +412,7 @@ class phpbb_extension_manager RecursiveIteratorIterator::SELF_FIRST); foreach ($iterator as $file_info) { - if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->php_ext) + if ($file_info->isFile() && $file_info->getFilename() == 'ext.' . $this->php_ext) { $ext_name = $iterator->getInnerIterator()->getSubPath(); diff --git a/phpBB/includes/extension/metadata_manager.php b/phpBB/includes/extension/metadata_manager.php index 36b0f8b184..1637abd340 100644 --- a/phpBB/includes/extension/metadata_manager.php +++ b/phpBB/includes/extension/metadata_manager.php @@ -39,7 +39,7 @@ class phpbb_extension_metadata_manager * @param string $phpbb_root_path Path to the phpbb includes directory. * @param string $phpEx php file extension */ - public function __construct($ext_name, phpbb_db_driver $db, phpbb_extension_manager $extension_manager, $phpbb_root_path, $phpEx = '.php', phpbb_template $template, phpbb_config $config) + public function __construct($ext_name, phpbb_db_driver $db, phpbb_extension_manager $extension_manager, $phpbb_root_path, $phpEx = 'php', phpbb_template $template, phpbb_config $config) { $this->phpbb_root_path = $phpbb_root_path; $this->db = $db;