mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/13740] Core file workarounds
[ci skip] PHPBB3-13740
This commit is contained in:
parent
14e8f712ae
commit
5afc632bca
7 changed files with 92 additions and 71 deletions
|
@ -52,7 +52,7 @@ if (!defined('PHPBB_INSTALLED'))
|
|||
}
|
||||
|
||||
// $phpbb_root_path accounts for redirects from e.g. /adm
|
||||
$script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/index.' . $phpEx;
|
||||
$script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/app.' . $phpEx;
|
||||
// Replace any number of consecutive backslashes and/or slashes with a single slash
|
||||
// (could happen on some proxy setups and/or Windows servers)
|
||||
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
|
||||
|
|
|
@ -8,13 +8,16 @@ imports:
|
|||
- { resource: services_db.yml }
|
||||
- { resource: services_event.yml }
|
||||
- { resource: services_feed.yml }
|
||||
- { resource: services_files.yml }
|
||||
- { resource: services_help.yml }
|
||||
- { resource: services_http.yml }
|
||||
- { resource: services_language.yml }
|
||||
- { resource: services_migrator.yml }
|
||||
- { resource: services_mimetype_guesser.yml }
|
||||
- { resource: services_module.yml }
|
||||
- { resource: services_notification.yml }
|
||||
- { resource: services_password.yml }
|
||||
- { resource: services_php.yml }
|
||||
- { resource: services_profilefield.yml }
|
||||
- { resource: services_report.yml }
|
||||
- { resource: services_routing.yml }
|
||||
|
@ -107,19 +110,9 @@ services:
|
|||
- %core.php_ext%
|
||||
- @cache.driver
|
||||
|
||||
filesystem:
|
||||
class: phpbb\filesystem\filesystem
|
||||
|
||||
file_downloader:
|
||||
class: phpbb\file_downloader
|
||||
|
||||
http_kernel:
|
||||
class: Symfony\Component\HttpKernel\HttpKernel
|
||||
arguments:
|
||||
- @dispatcher
|
||||
- @controller.resolver
|
||||
- @request_stack
|
||||
|
||||
log:
|
||||
class: phpbb\log\log
|
||||
arguments:
|
||||
|
@ -142,9 +135,6 @@ services:
|
|||
- %core.php_ext%
|
||||
- %core.adm_relative_path%
|
||||
|
||||
php_ini:
|
||||
class: phpbb\php\ini
|
||||
|
||||
plupload:
|
||||
class: phpbb\plupload\plupload
|
||||
arguments:
|
||||
|
@ -155,22 +145,6 @@ services:
|
|||
- @php_ini
|
||||
- @mimetype.guesser
|
||||
|
||||
request:
|
||||
class: phpbb\request\request
|
||||
arguments:
|
||||
- null
|
||||
- %core.disable_super_globals%
|
||||
|
||||
# WARNING: The Symfony request does not escape the input and should be used very carefully
|
||||
# prefer the phpbb request (service @request) as possible
|
||||
symfony_request:
|
||||
class: phpbb\symfony_request
|
||||
arguments:
|
||||
- @request
|
||||
|
||||
request_stack:
|
||||
class: Symfony\Component\HttpFoundation\RequestStack
|
||||
|
||||
upload_imagesize:
|
||||
class: fastImageSize\fastImageSize
|
||||
|
||||
|
|
3
phpBB/config/default/container/services_files.yml
Normal file
3
phpBB/config/default/container/services_files.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
services:
|
||||
filesystem:
|
||||
class: phpbb\filesystem\filesystem
|
23
phpBB/config/default/container/services_http.yml
Normal file
23
phpBB/config/default/container/services_http.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
services:
|
||||
# WARNING: The Symfony request does not escape the input and should be used very carefully
|
||||
# prefer the phpbb request (service @request) as possible
|
||||
symfony_request:
|
||||
class: phpbb\symfony_request
|
||||
arguments:
|
||||
- @request
|
||||
|
||||
request_stack:
|
||||
class: Symfony\Component\HttpFoundation\RequestStack
|
||||
|
||||
request:
|
||||
class: phpbb\request\request
|
||||
arguments:
|
||||
- null
|
||||
- %core.disable_super_globals%
|
||||
|
||||
http_kernel:
|
||||
class: Symfony\Component\HttpKernel\HttpKernel
|
||||
arguments:
|
||||
- @dispatcher
|
||||
- @controller.resolver
|
||||
- @request_stack
|
3
phpBB/config/default/container/services_php.yml
Normal file
3
phpBB/config/default/container/services_php.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
services:
|
||||
php_ini:
|
||||
class: phpbb\php\ini
|
|
@ -11,6 +11,7 @@ parameters:
|
|||
tables.forums: %core.table_prefix%forums
|
||||
tables.log: %core.table_prefix%log
|
||||
tables.migrations: %core.table_prefix%migrations
|
||||
tables.moderator_cache: %core.table_prefix%moderator_cache
|
||||
tables.modules: %core.table_prefix%modules
|
||||
tables.notification_types: %core.table_prefix%notification_types
|
||||
tables.notifications: %core.table_prefix%notifications
|
||||
|
|
|
@ -1,62 +1,79 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
// set up caching
|
||||
/* @var $cache \phpbb\cache\service */
|
||||
$cache = $phpbb_container->get('cache');
|
||||
/**
|
||||
* Sets compatibility globals in the global scope
|
||||
*
|
||||
* This function registers compatibility variables to the global
|
||||
* variable scope. This is required to make it possible to include this file
|
||||
* in a service.
|
||||
*/
|
||||
function register_compatibility_globals()
|
||||
{
|
||||
global $phpbb_container;
|
||||
|
||||
// Instantiate some basic classes
|
||||
/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
|
||||
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
|
||||
global $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log;
|
||||
global $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
|
||||
|
||||
/* @var $request \phpbb\request\request_interface */
|
||||
$request = $phpbb_container->get('request');
|
||||
// set up caching
|
||||
/* @var $cache \phpbb\cache\service */
|
||||
$cache = $phpbb_container->get('cache');
|
||||
|
||||
/* @var $user \phpbb\user */
|
||||
$user = $phpbb_container->get('user');
|
||||
// Instantiate some basic classes
|
||||
/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
|
||||
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
|
||||
|
||||
/* @var $auth \phpbb\auth\auth */
|
||||
$auth = $phpbb_container->get('auth');
|
||||
/* @var $request \phpbb\request\request_interface */
|
||||
$request = $phpbb_container->get('request');
|
||||
|
||||
/* @var $db \phpbb\db\driver\driver_interface */
|
||||
$db = $phpbb_container->get('dbal.conn');
|
||||
/* @var $user \phpbb\user */
|
||||
$user = $phpbb_container->get('user');
|
||||
|
||||
// Grab global variables, re-cache if necessary
|
||||
/* @var $config phpbb\config\db */
|
||||
$config = $phpbb_container->get('config');
|
||||
/* @var $auth \phpbb\auth\auth */
|
||||
$auth = $phpbb_container->get('auth');
|
||||
|
||||
/* @var $phpbb_log \phpbb\log\log_interface */
|
||||
$phpbb_log = $phpbb_container->get('log');
|
||||
/* @var $db \phpbb\db\driver\driver_interface */
|
||||
$db = $phpbb_container->get('dbal.conn');
|
||||
|
||||
/* @var $symfony_request \phpbb\symfony_request */
|
||||
$symfony_request = $phpbb_container->get('symfony_request');
|
||||
// Grab global variables, re-cache if necessary
|
||||
/* @var $config phpbb\config\db */
|
||||
$config = $phpbb_container->get('config');
|
||||
|
||||
/* @var $phpbb_filesystem \phpbb\filesystem\filesystem_interface */
|
||||
$phpbb_filesystem = $phpbb_container->get('filesystem');
|
||||
/* @var $phpbb_log \phpbb\log\log_interface */
|
||||
$phpbb_log = $phpbb_container->get('log');
|
||||
|
||||
/* @var $phpbb_path_helper \phpbb\path_helper */
|
||||
$phpbb_path_helper = $phpbb_container->get('path_helper');
|
||||
/* @var $symfony_request \phpbb\symfony_request */
|
||||
$symfony_request = $phpbb_container->get('symfony_request');
|
||||
|
||||
// load extensions
|
||||
/* @var $phpbb_extension_manager \phpbb\extension\manager */
|
||||
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
|
||||
/* @var $phpbb_filesystem \phpbb\filesystem\filesystem_interface */
|
||||
$phpbb_filesystem = $phpbb_container->get('filesystem');
|
||||
|
||||
/* @var $template \phpbb\template\template */
|
||||
$template = $phpbb_container->get('template');
|
||||
/* @var $phpbb_path_helper \phpbb\path_helper */
|
||||
$phpbb_path_helper = $phpbb_container->get('path_helper');
|
||||
|
||||
// load extensions
|
||||
/* @var $phpbb_extension_manager \phpbb\extension\manager */
|
||||
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
|
||||
|
||||
/* @var $template \phpbb\template\template */
|
||||
$template = $phpbb_container->get('template');
|
||||
}
|
||||
|
||||
register_compatibility_globals();
|
||||
|
|
Loading…
Add table
Reference in a new issue