1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 22:58:10 +01:00

[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
- %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:

View File

@ -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;
}

View File

@ -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();

View File

@ -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;