mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
commit
7b144bbff2
27 changed files with 55 additions and 55 deletions
|
@ -85,9 +85,9 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||||
|
|
||||||
// Setup class loader first
|
// Setup class loader first
|
||||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx");
|
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", $phpEx);
|
||||||
$phpbb_class_loader->register();
|
$phpbb_class_loader->register();
|
||||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx");
|
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||||
$phpbb_class_loader_ext->register();
|
$phpbb_class_loader_ext->register();
|
||||||
|
|
||||||
// Set up container
|
// Set up container
|
||||||
|
|
|
@ -4,7 +4,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- @config
|
- @config
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
- @cache.driver
|
- @cache.driver
|
||||||
calls:
|
calls:
|
||||||
- [set_name, [avatar.driver.gravatar]]
|
- [set_name, [avatar.driver.gravatar]]
|
||||||
|
@ -16,7 +16,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- @config
|
- @config
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
- @cache.driver
|
- @cache.driver
|
||||||
calls:
|
calls:
|
||||||
- [set_name, [avatar.driver.local]]
|
- [set_name, [avatar.driver.local]]
|
||||||
|
@ -28,7 +28,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- @config
|
- @config
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
- @cache.driver
|
- @cache.driver
|
||||||
calls:
|
calls:
|
||||||
- [set_name, [avatar.driver.remote]]
|
- [set_name, [avatar.driver.remote]]
|
||||||
|
@ -40,7 +40,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- @config
|
- @config
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
- @cache.driver
|
- @cache.driver
|
||||||
calls:
|
calls:
|
||||||
- [set_name, [avatar.driver.upload]]
|
- [set_name, [avatar.driver.upload]]
|
||||||
|
|
|
@ -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]]
|
||||||
|
@ -70,7 +70,7 @@ services:
|
||||||
- @template
|
- @template
|
||||||
- @user
|
- @user
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
|
|
||||||
controller.resolver:
|
controller.resolver:
|
||||||
class: phpbb_controller_resolver
|
class: phpbb_controller_resolver
|
||||||
|
@ -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:
|
||||||
|
@ -173,7 +173,7 @@ services:
|
||||||
class: phpbb_hook_finder
|
class: phpbb_hook_finder
|
||||||
arguments:
|
arguments:
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
- @cache.driver
|
- @cache.driver
|
||||||
|
|
||||||
kernel_request_subscriber:
|
kernel_request_subscriber:
|
||||||
|
@ -181,7 +181,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- @ext.finder
|
- @ext.finder
|
||||||
- %core.root_path%
|
- %core.root_path%
|
||||||
- .%core.php_ext%
|
- %core.php_ext%
|
||||||
tags:
|
tags:
|
||||||
- { name: kernel.event_subscriber }
|
- { name: kernel.event_subscriber }
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ if (isset($_GET['avatar']))
|
||||||
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||||
|
|
||||||
// Setup class loader first
|
// Setup class loader first
|
||||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx");
|
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", $phpEx);
|
||||||
$phpbb_class_loader->register();
|
$phpbb_class_loader->register();
|
||||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx");
|
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||||
$phpbb_class_loader_ext->register();
|
$phpbb_class_loader_ext->register();
|
||||||
|
|
||||||
// Set up container
|
// Set up container
|
||||||
|
|
|
@ -54,7 +54,7 @@ class acp_extensions
|
||||||
// If they've specified an extension, let's load the metadata manager and validate it.
|
// If they've specified an extension, let's load the metadata manager and validate it.
|
||||||
if ($ext_name)
|
if ($ext_name)
|
||||||
{
|
{
|
||||||
$md_manager = new phpbb_extension_metadata_manager($ext_name, $db, $phpbb_extension_manager, $phpbb_root_path, ".$phpEx", $template, $config);
|
$md_manager = new phpbb_extension_metadata_manager($ext_name, $db, $phpbb_extension_manager, $phpbb_root_path, $phpEx, $template, $config);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,7 +74,7 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
|
||||||
|
|
||||||
if (!function_exists('validate_data'))
|
if (!function_exists('validate_data'))
|
||||||
{
|
{
|
||||||
require($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
|
require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
$validate_array = validate_data(
|
$validate_array = validate_data(
|
||||||
|
|
|
@ -63,7 +63,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
||||||
|
|
||||||
if (!function_exists('validate_data'))
|
if (!function_exists('validate_data'))
|
||||||
{
|
{
|
||||||
require($this->phpbb_root_path . 'includes/functions_user' . $this->php_ext);
|
require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
$validate_array = validate_data(
|
$validate_array = validate_data(
|
||||||
|
@ -117,7 +117,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
||||||
|
|
||||||
if (!class_exists('fileupload'))
|
if (!class_exists('fileupload'))
|
||||||
{
|
{
|
||||||
include($this->phpbb_root_path . 'includes/functions_upload' . $this->php_ext);
|
include($this->phpbb_root_path . 'includes/functions_upload.' . $this->php_ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
$types = fileupload::image_types();
|
$types = fileupload::image_types();
|
||||||
|
|
|
@ -27,7 +27,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||||
public function get_data($row, $ignore_config = false)
|
public function get_data($row, $ignore_config = false)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'src' => $this->phpbb_root_path . 'download/file' . $this->php_ext . '?avatar=' . $row['avatar'],
|
'src' => $this->phpbb_root_path . 'download/file.' . $this->php_ext . '?avatar=' . $row['avatar'],
|
||||||
'width' => $row['avatar_width'],
|
'width' => $row['avatar_width'],
|
||||||
'height' => $row['avatar_height'],
|
'height' => $row['avatar_height'],
|
||||||
);
|
);
|
||||||
|
@ -63,7 +63,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||||
|
|
||||||
if (!class_exists('fileupload'))
|
if (!class_exists('fileupload'))
|
||||||
{
|
{
|
||||||
include($this->phpbb_root_path . 'includes/functions_upload' . $this->php_ext);
|
include($this->phpbb_root_path . 'includes/functions_upload.' . $this->php_ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
$upload = new fileupload('AVATAR_', $this->allowed_extensions, $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
|
$upload = new fileupload('AVATAR_', $this->allowed_extensions, $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -117,7 +117,7 @@ class phpbb_controller_helper
|
||||||
$params = array('controller' => $route);
|
$params = array('controller' => $route);
|
||||||
}
|
}
|
||||||
|
|
||||||
return append_sid($this->phpbb_root_path . 'app' . $this->php_ext . $route_params, $params, $is_amp, $session_id);
|
return append_sid($this->phpbb_root_path . 'app.' . $this->php_ext . $route_params, $params, $is_amp, $session_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -60,7 +60,7 @@ function phpbb_create_dumped_url_matcher(phpbb_extension_finder $finder, $root_p
|
||||||
'class' => 'phpbb_url_matcher',
|
'class' => 'phpbb_url_matcher',
|
||||||
));
|
));
|
||||||
|
|
||||||
file_put_contents($root_path . 'cache/url_matcher' . $php_ext, $cached_url_matcher_dump);
|
file_put_contents($root_path . 'cache/url_matcher.' . $php_ext, $cached_url_matcher_dump);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,7 +87,7 @@ function phpbb_create_url_matcher(phpbb_extension_finder $finder, RequestContext
|
||||||
*/
|
*/
|
||||||
function phpbb_load_url_matcher(RequestContext $context, $root_path, $php_ext)
|
function phpbb_load_url_matcher(RequestContext $context, $root_path, $php_ext)
|
||||||
{
|
{
|
||||||
require($root_path . 'cache/url_matcher' . $php_ext);
|
require($root_path . 'cache/url_matcher.' . $php_ext);
|
||||||
return new phpbb_url_matcher($context);
|
return new phpbb_url_matcher($context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,5 +102,5 @@ function phpbb_load_url_matcher(RequestContext $context, $root_path, $php_ext)
|
||||||
*/
|
*/
|
||||||
function phpbb_url_matcher_dumped($root_path, $php_ext)
|
function phpbb_url_matcher_dumped($root_path, $php_ext)
|
||||||
{
|
{
|
||||||
return file_exists($root_path . 'cache/url_matcher' . $php_ext);
|
return file_exists($root_path . 'cache/url_matcher.' . $php_ext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ class phpbb_hook_finder
|
||||||
{
|
{
|
||||||
while (($file = readdir($dh)) !== false)
|
while (($file = readdir($dh)) !== false)
|
||||||
{
|
{
|
||||||
if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($this->php_ext) + 1)) === '.' . $this->php_ext)
|
if (strpos($file, 'hook_') === 0 && substr($file, -strlen('.' . $this->php_ext)) === '.' . $this->php_ext)
|
||||||
{
|
{
|
||||||
$hook_files[] = substr($file, 0, -(strlen($this->php_ext) + 1));
|
$hook_files[] = substr($file, 0, -(strlen($this->php_ext) + 1));
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||||
|
|
||||||
// Setup class loader first
|
// Setup class loader first
|
||||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx");
|
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", $phpEx);
|
||||||
$phpbb_class_loader->register();
|
$phpbb_class_loader->register();
|
||||||
|
|
||||||
// Set up container (must be done here because extensions table may not exist)
|
// Set up container (must be done here because extensions table may not exist)
|
||||||
|
|
|
@ -90,9 +90,9 @@ include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||||
require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
||||||
|
|
||||||
// Setup class loader first
|
// Setup class loader first
|
||||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx");
|
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", $phpEx);
|
||||||
$phpbb_class_loader->register();
|
$phpbb_class_loader->register();
|
||||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx");
|
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||||
$phpbb_class_loader_ext->register();
|
$phpbb_class_loader_ext->register();
|
||||||
|
|
||||||
// Set up container
|
// Set up container
|
||||||
|
|
|
@ -16,11 +16,11 @@ $table_prefix = 'phpbb_';
|
||||||
require_once $phpbb_root_path . 'includes/constants.php';
|
require_once $phpbb_root_path . 'includes/constants.php';
|
||||||
require_once $phpbb_root_path . 'includes/class_loader.' . $phpEx;
|
require_once $phpbb_root_path . 'includes/class_loader.' . $phpEx;
|
||||||
|
|
||||||
$phpbb_class_loader_mock = new phpbb_class_loader('phpbb_mock_', $phpbb_root_path . '../tests/mock/', ".php");
|
$phpbb_class_loader_mock = new phpbb_class_loader('phpbb_mock_', $phpbb_root_path . '../tests/mock/', "php");
|
||||||
$phpbb_class_loader_mock->register();
|
$phpbb_class_loader_mock->register();
|
||||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', ".php");
|
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', $phpbb_root_path . 'ext/', "php");
|
||||||
$phpbb_class_loader_ext->register();
|
$phpbb_class_loader_ext->register();
|
||||||
$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', ".php");
|
$phpbb_class_loader = new phpbb_class_loader('phpbb_', $phpbb_root_path . 'includes/', "php");
|
||||||
$phpbb_class_loader->register();
|
$phpbb_class_loader->register();
|
||||||
|
|
||||||
require_once 'test_framework/phpbb_test_case_helpers.php';
|
require_once 'test_framework/phpbb_test_case_helpers.php';
|
||||||
|
|
|
@ -71,8 +71,8 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
|
||||||
$cache = new phpbb_mock_cache($cache_map);
|
$cache = new phpbb_mock_cache($cache_map);
|
||||||
|
|
||||||
$prefix = dirname(__FILE__) . '/';
|
$prefix = dirname(__FILE__) . '/';
|
||||||
$class_loader = new phpbb_class_loader('phpbb_', $prefix . 'includes/', '.php', $cache);
|
$class_loader = new phpbb_class_loader('phpbb_', $prefix . 'includes/', 'php', $cache);
|
||||||
$class_loader_ext = new phpbb_class_loader('phpbb_ext_', $prefix . 'includes/', '.php', $cache);
|
$class_loader_ext = new phpbb_class_loader('phpbb_ext_', $prefix . 'includes/', 'php', $cache);
|
||||||
|
|
||||||
$prefix .= 'includes/';
|
$prefix .= 'includes/';
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
|
||||||
$this->user = $this->getMock('phpbb_user');
|
$this->user = $this->getMock('phpbb_user');
|
||||||
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, new phpbb_template_context());
|
$this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, new phpbb_template_context());
|
||||||
|
|
||||||
$helper = new phpbb_controller_helper($this->template, $this->user, '', '.php');
|
$helper = new phpbb_controller_helper($this->template, $this->user, '', 'php');
|
||||||
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||||
new phpbb_filesystem(),
|
new phpbb_filesystem(),
|
||||||
'phpbb_ext',
|
'phpbb_ext',
|
||||||
dirname(__FILE__) . '/../../phpBB/',
|
dirname(__FILE__) . '/../../phpBB/',
|
||||||
'.php',
|
'php',
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
|
||||||
public function test_get_classes_create_cache()
|
public function test_get_classes_create_cache()
|
||||||
{
|
{
|
||||||
$cache = new phpbb_mock_cache;
|
$cache = new phpbb_mock_cache;
|
||||||
$finder = new phpbb_extension_finder($this->extension_manager, new phpbb_filesystem(), dirname(__FILE__) . '/', $cache, '.php', '_custom_cache_name');
|
$finder = new phpbb_extension_finder($this->extension_manager, new phpbb_filesystem(), dirname(__FILE__) . '/', $cache, 'php', '_custom_cache_name');
|
||||||
$files = $finder->suffix('_class.php')->get_files();
|
$files = $finder->suffix('_class.php')->get_files();
|
||||||
|
|
||||||
$expected_files = array(
|
$expected_files = array(
|
||||||
|
|
|
@ -115,7 +115,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
|
||||||
new phpbb_filesystem(),
|
new phpbb_filesystem(),
|
||||||
'phpbb_ext',
|
'phpbb_ext',
|
||||||
dirname(__FILE__) . '/',
|
dirname(__FILE__) . '/',
|
||||||
'.' . $php_ext,
|
$php_ext,
|
||||||
($with_cache) ? new phpbb_mock_cache() : null
|
($with_cache) ? new phpbb_mock_cache() : null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class metadata_manager_test extends phpbb_database_test_case
|
||||||
$this->db = $this->new_dbal();
|
$this->db = $this->new_dbal();
|
||||||
$this->db_tools = new phpbb_db_tools($this->db);
|
$this->db_tools = new phpbb_db_tools($this->db);
|
||||||
$this->phpbb_root_path = dirname(__FILE__) . '/';
|
$this->phpbb_root_path = dirname(__FILE__) . '/';
|
||||||
$this->phpEx = '.php';
|
$this->phpEx = 'php';
|
||||||
$this->user = new phpbb_user();
|
$this->user = new phpbb_user();
|
||||||
$this->table_prefix = 'phpbb_';
|
$this->table_prefix = 'phpbb_';
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ class phpbb_mock_extension_manager extends phpbb_extension_manager
|
||||||
public function __construct($phpbb_root_path, $extensions = array())
|
public function __construct($phpbb_root_path, $extensions = array())
|
||||||
{
|
{
|
||||||
$this->phpbb_root_path = $phpbb_root_path;
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = '.php';
|
$this->php_ext = 'php';
|
||||||
$this->extensions = $extensions;
|
$this->extensions = $extensions;
|
||||||
$this->filesystem = new phpbb_filesystem();
|
$this->filesystem = new phpbb_filesystem();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,12 +92,12 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
|
||||||
// Container
|
// Container
|
||||||
$phpbb_container = new phpbb_mock_container_builder();
|
$phpbb_container = new phpbb_mock_container_builder();
|
||||||
|
|
||||||
$user_loader = new phpbb_user_loader($db, $phpbb_root_path, '.' . $phpEx, USERS_TABLE);
|
$user_loader = new phpbb_user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
|
||||||
|
|
||||||
// Notification Manager
|
// Notification Manager
|
||||||
$phpbb_notifications = new phpbb_notification_manager(array(), array(),
|
$phpbb_notifications = new phpbb_notification_manager(array(), array(),
|
||||||
$phpbb_container, $user_loader, $db, $user,
|
$phpbb_container, $user_loader, $db, $user,
|
||||||
$phpbb_root_path, '.' . $phpEx,
|
$phpbb_root_path, $phpEx,
|
||||||
NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE);
|
NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE);
|
||||||
$phpbb_container->set('notification_manager', $phpbb_notifications);
|
$phpbb_container->set('notification_manager', $phpbb_notifications);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
|
||||||
$class_name = 'phpbb_notification_type_' . $type;
|
$class_name = 'phpbb_notification_type_' . $type;
|
||||||
$phpbb_container->set('notification.type.' . $type, new $class_name(
|
$phpbb_container->set('notification.type.' . $type, new $class_name(
|
||||||
$user_loader, $db, $cache, $user, $auth, $config,
|
$user_loader, $db, $cache, $user, $auth, $config,
|
||||||
$phpbb_root_path, '.' . $phpEx,
|
$phpbb_root_path, $phpEx,
|
||||||
NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE));
|
NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
new phpbb_filesystem(),
|
new phpbb_filesystem(),
|
||||||
self::$config['table_prefix'] . 'ext',
|
self::$config['table_prefix'] . 'ext',
|
||||||
dirname(__FILE__) . '/',
|
dirname(__FILE__) . '/',
|
||||||
'.' . $php_ext,
|
$php_ext,
|
||||||
$this->get_cache_driver()
|
$this->get_cache_driver()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue