1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

Merge pull request #3514 from CHItA/ticket/13740

[ticket/13740] Refactoring installer

* CHItA/ticket/13740: (75 commits)
  [ticket/13740] Reduce number of references in nav provider
  [ticket/13740] Move handle_language_select calls to the controllers
  [ticket/13740] Fix infinite config.php check loop
  [ticket/13740] Move default data settings out of constructors
  [ticket/13740] Deduplicate container builder's checks
  [ticket/13740] Use JSON for installer config
  [ticket/13740] Fix comment
  [ticket/13740] Use language service in console application
  [ticket/13740] Fix CS in compatibilty_globals.php
  [ticket/13740] Fix message element creation in JS
  [ticket/13740] Replace more spaces with tabs
  [ticket/13740] Fix CS
  [ticket/13740] Filter basic directory change attempts in lang change
  [ticket/13740] Use tabs instead of spaces in JS file
  [ticket/13740] Add success message when install finished
  [ticket/13740] Fix $script_path in obtain_data
  [ticket/13740] Fix is_phpbb_installed() method
  [ticket/13740] Login admin when install finished
  [ticket/13740] Enhance server output buffer bypass
  [ticket/13740] Secure installer config against corrupted config data
  ...
This commit is contained in:
Tristan Darricau
2015-07-27 11:24:43 +02:00
105 changed files with 11399 additions and 80 deletions

View File

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

View File

@@ -0,0 +1,3 @@
services:
filesystem:
class: phpbb\filesystem\filesystem

View File

@@ -0,0 +1,23 @@
services:
http_kernel:
class: Symfony\Component\HttpKernel\HttpKernel
arguments:
- @dispatcher
- @controller.resolver
- @request_stack
# 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%

View File

@@ -0,0 +1,3 @@
services:
php_ini:
class: phpbb\php\ini

View File

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

View File

@@ -0,0 +1,2 @@
imports:
- { resource: ../default/config.yml }

View File

@@ -0,0 +1,3 @@
imports:
- { resource: services.yml }
- { resource: parameters.yml }

View File

@@ -0,0 +1,2 @@
imports:
- { resource: ../../default/container/parameters.yml }

View File

@@ -0,0 +1,70 @@
imports:
- { resource: services_installer.yml }
- { resource: ../../default/container/services_files.yml }
- { resource: ../../default/container/services_http.yml }
- { resource: ../../default/container/services_language.yml }
- { resource: ../../default/container/services_php.yml }
- { resource: ../../default/container/services_routing.yml }
- { resource: ../../default/container/services_twig.yml }
services:
config:
class: phpbb\config\config
arguments:
- []
controller.resolver:
class: phpbb\controller\resolver
arguments:
- @service_container
- %core.root_path%
- @template
dispatcher:
class: phpbb\event\dispatcher
arguments:
- @service_container
language.loader:
parent: language.loader_abstract
path_helper:
class: phpbb\path_helper
arguments:
- @symfony_request
- @filesystem
- @request
- %core.root_path%
- %core.php_ext%
router:
class: phpbb\routing\router
arguments:
- @service_container
- @filesystem
- %core.root_path%
- %core.php_ext%
- %core.environment%
template:
class: phpbb\template\twig\twig
arguments:
- @path_helper
- @config
- @template_context
- @template.twig.environment
- %core.template.cache_path%
- null
- @template.twig.extensions.collection
template.twig.environment:
class: phpbb\template\twig\environment
arguments:
- @config
- @filesystem
- @path_helper
- @service_container
- %core.template.cache_path%
- null
- @template.twig.loader
- []

View File

@@ -0,0 +1,35 @@
services:
console.installer.command_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: console.installer.command }
console.installer.command.install:
class: phpbb\install\console\command\install\install
arguments:
- @language
- @installer.helper.iohandler_factory
- @installer.installer.install
tags:
- { name: console.installer.command }
console.installer.command.config.show:
class: phpbb\install\console\command\install\config\show
arguments:
- @language
- @installer.helper.iohandler_factory
- @installer.installer.install
tags:
- { name: console.installer.command }
console.installer.command.config.validate:
class: phpbb\install\console\command\install\config\validate
arguments:
- @language
- @installer.helper.iohandler_factory
- @installer.installer.install
tags:
- { name: console.installer.command }

View File

@@ -0,0 +1,34 @@
services:
phpbb.installer.controller.welcome:
class: phpbb\install\controller\installer_index
arguments:
- @phpbb.installer.controller.helper
- @language
- @template
- %core.root_path%
phpbb.installer.controller.helper:
class: phpbb\install\controller\helper
arguments:
- @language
- @language.helper.language_file
- @installer.navigation.provider
- @template
- @path_helper
- @request
- @symfony_request
- @router
- %core.root_path%
phpbb.installer.controller.install:
class: phpbb\install\controller\install
arguments:
- @phpbb.installer.controller.helper
- @installer.helper.config
- @installer.helper.iohandler_factory
- @installer.navigation.provider
- @language
- @template
- @request
- @installer.installer.install
- @installer.helper.install_helper

View File

@@ -0,0 +1,44 @@
services:
installer.install_data.add_bots:
class: phpbb\install\module\install_data\task\add_bots
arguments:
- @installer.helper.config
- @installer.helper.iohandler
- @installer.helper.container_factory
- @language
- %core.root_path%
- %core.php_ext%
tags:
- { name: install_data_install, order: 20 }
installer.install_data.add_languages:
class: phpbb\install\module\install_data\task\add_languages
arguments:
- @installer.helper.iohandler
- @installer.helper.container_factory
- @language.helper.language_file
tags:
- { name: install_data_install, order: 10 }
installer.install_data.add_modules:
class: phpbb\install\module\install_data\task\add_modules
arguments:
- @installer.helper.iohandler
- @installer.helper.container_factory
tags:
- { name: install_data_install, order: 30 }
installer.module.data_install_collection:
class: phpbb\di\ordered_service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: install_data_install, class_name_aware: true }
installer.module.data_install:
class: phpbb\install\module\install_data\module
parent: installer.module_base
arguments:
- @installer.module.data_install_collection
tags:
- { name: installer_install_module, order: 50 }

View File

@@ -0,0 +1,51 @@
services:
installer.install_database.create_schema:
class: phpbb\install\module\install_database\task\create_schema
arguments:
- @installer.helper.config
- @installer.helper.database
- @filesystem
- @installer.helper.iohandler
- %core.root_path%
- %core.php_ext%
tags:
- { name: install_database_install, order: 10 }
installer.install_database.add_default_data:
class: phpbb\install\module\install_database\task\add_default_data
arguments:
- @installer.helper.database
- @installer.helper.config
- @installer.helper.iohandler
- @installer.helper.container_factory
- @language
- %core.root_path%
tags:
- { name: install_database_install, order: 20 }
installer.install_database.add_config_settings:
class: phpbb\install\module\install_database\task\add_config_settings
arguments:
- @filesystem
- @installer.helper.config
- @installer.helper.iohandler
- @installer.helper.container_factory
- @language
- %core.root_path%
tags:
- { name: install_database_install, order: 30 }
installer.module.install_database_collection:
class: phpbb\di\ordered_service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: install_database_install, class_name_aware: true }
installer.module.database_install:
class: phpbb\install\module\install_database\module
parent: installer.module_base
arguments:
- @installer.module.install_database_collection
tags:
- { name: installer_install_module, order: 40 }

View File

@@ -0,0 +1,27 @@
services:
installer.install_filesystem.create_config_file:
class: phpbb\install\module\install_filesystem\task\create_config_file
arguments:
- @filesystem
- @installer.helper.config
- @installer.helper.database
- @installer.helper.iohandler
- %core.root_path%
- %core.php_ext%
tags:
- { name: install_filesystem_install, order: 10 }
installer.module.install_filesystem_collection:
class: phpbb\di\ordered_service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: install_filesystem_install, class_name_aware: true }
installer.module.filesystem_install:
class: phpbb\install\module\install_filesystem\module
parent: installer.module_base
arguments:
- @installer.module.install_filesystem_collection
tags:
- { name: installer_install_module, order: 30 }

View File

@@ -0,0 +1,33 @@
services:
installer.install_finish.populate_migrations:
class: phpbb\install\module\install_finish\task\populate_migrations
arguments:
- @installer.helper.container_factory
tags:
- { name: install_finish, order: 10 }
installer.install_finish.notify_user:
class: phpbb\install\module\install_finish\task\notify_user
arguments:
- @installer.helper.container_factory
- @installer.helper.config
- @installer.helper.iohandler
- %core.root_path%
- %core.php_ext%
tags:
- { name: install_finish, order: 20 }
installer.module.install_finish_collection:
class: phpbb\di\ordered_service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: install_finish, class_name_aware: true }
installer.module.finish_install:
class: phpbb\install\module\install_filesystem\module
parent: installer.module_base
arguments:
- @installer.module.install_finish_collection
tags:
- { name: installer_install_module, order: 60 }

View File

@@ -0,0 +1,27 @@
services:
installer.navigation.provider:
class: phpbb\install\helper\navigation\navigation_provider
arguments:
- @installer.navigation.service_collection
installer.navigation.service_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: installer.navigation }
installer.navigation.main_navigation:
class: phpbb\install\helper\navigation\main_navigation
scope: prototype
tags:
- { name: installer.navigation }
installer.navigation.install_navigation:
class: phpbb\install\helper\navigation\install_navigation
arguments:
- @installer.helper.install_helper
scope: prototype
tags:
- { name: installer.navigation }

View File

@@ -0,0 +1,66 @@
services:
installer.obtain_data.obtain_admin_data:
class: phpbb\install\module\obtain_data\task\obtain_admin_data
arguments:
- @installer.helper.config
- @installer.helper.iohandler
tags:
- { name: install_obtain_data, order: 10 }
installer.obtain_data.obtain_board_data:
class: phpbb\install\module\obtain_data\task\obtain_board_data
arguments:
- @installer.helper.config
- @installer.helper.iohandler
- @language.helper.language_file
tags:
- { name: install_obtain_data, order: 50 }
installer.obtain_data.obtain_database_data:
class: phpbb\install\module\obtain_data\task\obtain_database_data
arguments:
- @installer.helper.database
- @installer.helper.config
- @installer.helper.iohandler
tags:
- { name: install_obtain_data, order: 20 }
installer.obtain_data.obtain_email_data:
class: phpbb\install\module\obtain_data\task\obtain_email_data
arguments:
- @installer.helper.config
- @installer.helper.iohandler
tags:
- { name: install_obtain_data, order: 40 }
installer.obtain_data.obtain_imagick_path:
class: phpbb\install\module\obtain_data\task\obtain_imagick_path
arguments:
- @installer.helper.config
tags:
- { name: install_obtain_data, order: 60 }
installer.obtain_data.obtain_server_data:
class: phpbb\install\module\obtain_data\task\obtain_server_data
arguments:
- @installer.helper.config
- @installer.helper.iohandler
tags:
- { name: install_obtain_data, order: 30 }
installer.module.install_obtain_data_collection:
class: phpbb\di\ordered_service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: install_obtain_data, class_name_aware: true }
installer.module.obtain_data_install:
class: phpbb\install\module\obtain_data\module
parent: installer.module_base
arguments:
- @installer.module.install_obtain_data_collection
- true
- false
tags:
- { name: installer_install_module, order: 20 }

View File

@@ -0,0 +1,36 @@
services:
installer.requirements.check_filesystem:
class: phpbb\install\module\requirements\task\check_filesystem
arguments:
- @filesystem
- @installer.helper.iohandler
- %core.root_path%
- %core.php_ext%
tags:
- { name: installer_requirements, order: 10 }
installer.requirements.check_server_environment:
class: phpbb\install\module\requirements\task\check_server_environment
arguments:
- @installer.helper.database
- @installer.helper.iohandler
tags:
- { name: installer_requirements, order: 20 }
installer.module.install_requirements_collection:
class: phpbb\di\ordered_service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: installer_requirements, class_name_aware: true }
# Please note, that the name of this module is hard coded in the installer service
installer.module.requirements_install:
class: phpbb\install\module\requirements\module
parent: installer.module_base
arguments:
- @installer.module.install_requirements_collection
- true
- false
tags:
- { name: installer_install_module, order: 10 }

View File

@@ -0,0 +1,87 @@
imports:
- { resource: services_install_console.yml }
- { resource: services_install_controller.yml }
- { resource: services_install_data.yml }
- { resource: services_install_database.yml }
- { resource: services_install_filesystem.yml }
- { resource: services_install_finish.yml }
- { resource: services_install_navigation.yml }
- { resource: services_install_obtain_data.yml }
- { resource: services_install_requirements.yml }
services:
# -------- Installer helpers ------------------------
installer.helper.config:
class: phpbb\install\helper\config
arguments:
- @filesystem
- @php_ini
- %core.root_path%
installer.helper.database:
class: phpbb\install\helper\database
arguments:
- @filesystem
- %core.root_path%
installer.helper.iohandler_factory:
class: phpbb\install\helper\iohandler\factory
arguments:
- @service_container
installer.helper.iohandler_abstract:
abstract: true
calls:
- [set_language, ["@language"]]
installer.helper.iohandler_ajax:
class: phpbb\install\helper\iohandler\ajax_iohandler
parent: installer.helper.iohandler_abstract
arguments:
- @request
- @template
installer.helper.iohandler_cli:
class: phpbb\install\helper\iohandler\cli_iohandler
parent: installer.helper.iohandler_abstract
installer.helper.iohandler:
class: phpbb\install\helper\iohandler\iohandler_interface
factory: ["@installer.helper.iohandler_factory", get]
installer.helper.container_factory:
class: phpbb\install\helper\container_factory
arguments:
- @request
- %core.root_path%
- %core.php_ext%
installer.helper.install_helper:
class: phpbb\install\helper\install_helper
arguments:
- %core.root_path%
- %core.php_ext%
# -------- Installer --------------------------------
installer.module_base:
abstract: true
calls:
- [setup, [@installer.helper.config, @installer.helper.iohandler]]
installer.installer.abstract:
class: phpbb\install\installer
abstract: true
arguments:
- @installer.helper.config
installer.install.module_collection:
class: phpbb\di\ordered_service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: installer_install_module }
installer.installer.install:
parent: installer.installer.abstract
calls:
- [set_modules, [@installer.install.module_collection]]

View File

@@ -0,0 +1,2 @@
core.default:
resource: "installer.yml"

View File

@@ -0,0 +1,22 @@
phpbb_installer_index:
path: /
defaults:
_controller: phpbb.installer.controller.welcome:handle
mode: "intro"
phpbb_installer_license:
path: /license
defaults:
_controller: phpbb.installer.controller.welcome:handle
mode: "license"
phpbb_installer_support:
path: /support
defaults:
_controller: phpbb.installer.controller.welcome:handle
mode: "support"
phpbb_installer_install:
path: /install
defaults:
_controller: phpbb.installer.controller.install:handle