[ticket/11335] (extension manager/finder) Make php_ext 'php' not '.php'

PHPBB3-11335
This commit is contained in:
Nathan Guse 2013-04-24 17:15:28 -05:00
parent 6ef363547a
commit ce230f8dea
4 changed files with 9 additions and 9 deletions

View file

@ -134,7 +134,7 @@ services:
- @filesystem - @filesystem
- %tables.ext% - %tables.ext%
- %core.root_path% - %core.root_path%
- .%core.php_ext% - %core.php_ext%
- @cache.driver - @cache.driver
ext.finder: ext.finder:
@ -144,7 +144,7 @@ services:
- @filesystem - @filesystem
- %core.root_path% - %core.root_path%
- @cache.driver - @cache.driver
- .%core.php_ext% - %core.php_ext%
- _ext_finder - _ext_finder
filesystem: filesystem:

View file

@ -62,7 +62,7 @@ class phpbb_extension_finder
* @param string $cache_name The name of the cache variable, defaults to * @param string $cache_name The name of the cache variable, defaults to
* _ext_finder * _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->extension_manager = $extension_manager;
$this->filesystem = $filesystem; $this->filesystem = $filesystem;
@ -256,8 +256,8 @@ class phpbb_extension_finder
*/ */
public function get_classes($cache = true, $use_all_available = false) public function get_classes($cache = true, $use_all_available = false)
{ {
$this->query['extension_suffix'] .= $this->php_ext; $this->query['extension_suffix'] .= '.' . $this->php_ext;
$this->query['core_suffix'] .= $this->php_ext; $this->query['core_suffix'] .= '.' . $this->php_ext;
$files = $this->find($cache, false, $use_all_available); $files = $this->find($cache, false, $use_all_available);
@ -277,7 +277,7 @@ class phpbb_extension_finder
{ {
$file = preg_replace('#^includes/#', '', $file); $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; return $classes;
} }

View file

@ -51,7 +51,7 @@ class phpbb_extension_manager
* @param phpbb_cache_driver_interface $cache A cache instance or null * @param phpbb_cache_driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext * @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->container = $container;
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
@ -412,7 +412,7 @@ class phpbb_extension_manager
RecursiveIteratorIterator::SELF_FIRST); RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file_info) 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(); $ext_name = $iterator->getInnerIterator()->getSubPath();

View file

@ -39,7 +39,7 @@ class phpbb_extension_metadata_manager
* @param string $phpbb_root_path Path to the phpbb includes directory. * @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $phpEx php file extension * @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->phpbb_root_path = $phpbb_root_path;
$this->db = $db; $this->db = $db;