mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 14:48:53 +00:00
[ticket/11335] (class loader) Make php_ext 'php' not '.php'
PHPBB3-11335
This commit is contained in:
parent
f8ffe84969
commit
e870c04067
2 changed files with 6 additions and 6 deletions
|
@ -36,7 +36,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- phpbb_
|
- phpbb_
|
||||||
- %core.root_path%includes/
|
- %core.root_path%includes/
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
calls:
|
calls:
|
||||||
- [register, []]
|
- [register, []]
|
||||||
- [set_cache, [@cache.driver]]
|
- [set_cache, [@cache.driver]]
|
||||||
|
@ -46,7 +46,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- phpbb_ext_
|
- phpbb_ext_
|
||||||
- %core.root_path%ext/
|
- %core.root_path%ext/
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
calls:
|
calls:
|
||||||
- [register, []]
|
- [register, []]
|
||||||
- [set_cache, [@cache.driver]]
|
- [set_cache, [@cache.driver]]
|
||||||
|
|
|
@ -52,7 +52,7 @@ class phpbb_class_loader
|
||||||
* @param string $php_ext The file extension for PHP files
|
* @param string $php_ext The file extension for PHP files
|
||||||
* @param phpbb_cache_driver_interface $cache An implementation of the phpBB cache interface.
|
* @param phpbb_cache_driver_interface $cache An implementation of the phpBB cache interface.
|
||||||
*/
|
*/
|
||||||
public function __construct($prefix, $path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null)
|
public function __construct($prefix, $path, $php_ext = 'php', phpbb_cache_driver_interface $cache = null)
|
||||||
{
|
{
|
||||||
$this->prefix = $prefix;
|
$this->prefix = $prefix;
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
|
@ -111,7 +111,7 @@ class phpbb_class_loader
|
||||||
{
|
{
|
||||||
if (isset($this->cached_paths[$class]))
|
if (isset($this->cached_paths[$class]))
|
||||||
{
|
{
|
||||||
return $this->path . $this->cached_paths[$class] . $this->php_ext;
|
return $this->path . $this->cached_paths[$class] . '.' . $this->php_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^' . $this->prefix . '[a-zA-Z0-9_]+$/', $class))
|
if (!preg_match('/^' . $this->prefix . '[a-zA-Z0-9_]+$/', $class))
|
||||||
|
@ -136,7 +136,7 @@ class phpbb_class_loader
|
||||||
|
|
||||||
$relative_path = $dirs . implode(array_slice($parts, $i, sizeof($parts) - $i), '_');
|
$relative_path = $dirs . implode(array_slice($parts, $i, sizeof($parts) - $i), '_');
|
||||||
|
|
||||||
if (!file_exists($this->path . $relative_path . $this->php_ext))
|
if (!file_exists($this->path . $relative_path . '.' . $this->php_ext))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ class phpbb_class_loader
|
||||||
$this->cache->put('class_loader_' . $this->prefix, $this->cached_paths);
|
$this->cache->put('class_loader_' . $this->prefix, $this->cached_paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->path . $relative_path . $this->php_ext;
|
return $this->path . $relative_path . '.' . $this->php_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue