1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-03 21:15:42 +02:00

[ticket/12987] Cleanup the services.yml file

PHPBB3-12987
This commit is contained in:
Tristan Darricau 2014-09-29 12:13:17 +02:00
parent 240ff27707
commit ebaec047f2
15 changed files with 314 additions and 285 deletions

View File

@ -1,4 +1,9 @@
services:
# ----- Auth management -----
auth:
class: phpbb\auth\auth
# ----- Auth providers -----
auth.provider_collection:
class: phpbb\auth\provider_collection
arguments:
@ -6,6 +11,7 @@ services:
- @config
tags:
- { name: service_collection, tag: auth.provider }
auth.provider.db:
class: phpbb\auth\provider\db
arguments:
@ -19,6 +25,7 @@ services:
- %core.php_ext%
tags:
- { name: auth.provider }
auth.provider.apache:
class: phpbb\auth\provider\apache
arguments:
@ -31,6 +38,7 @@ services:
- %core.php_ext%
tags:
- { name: auth.provider }
auth.provider.ldap:
class: phpbb\auth\provider\ldap
arguments:
@ -40,6 +48,7 @@ services:
- @user
tags:
- { name: auth.provider }
auth.provider.oauth:
class: phpbb\auth\provider\oauth\oauth
arguments:
@ -57,12 +66,15 @@ services:
- %core.php_ext%
tags:
- { name: auth.provider }
# ----- OAuth services providers -----
auth.provider.oauth.service_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: auth.provider.oauth.service }
auth.provider.oauth.service.bitly:
class: phpbb\auth\provider\oauth\service\bitly
arguments:
@ -70,6 +82,7 @@ services:
- @request
tags:
- { name: auth.provider.oauth.service }
auth.provider.oauth.service.facebook:
class: phpbb\auth\provider\oauth\service\facebook
arguments:
@ -77,6 +90,7 @@ services:
- @request
tags:
- { name: auth.provider.oauth.service }
auth.provider.oauth.service.google:
class: phpbb\auth\provider\oauth\service\google
arguments:

View File

@ -1,4 +1,18 @@
services:
avatar.manager:
class: phpbb\avatar\manager
arguments:
- @config
- @avatar.driver_collection
# ----- Avatar drivers -----
avatar.driver_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: avatar.driver }
avatar.driver.gravatar:
class: phpbb\avatar\driver\gravatar
arguments:
@ -51,10 +65,3 @@ services:
- [set_name, [avatar.driver.upload]]
tags:
- { name: avatar.driver }
avatar.driver_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: avatar.driver }

View File

@ -1,8 +1,3 @@
parameters:
tables.captcha_qa_questions: %core.table_prefix%captcha_questions
tables.captcha_qa_answers: %core.table_prefix%captcha_answers
tables.captcha_qa_confirm: %core.table_prefix%qa_confirm
services:
captcha.factory:
class: phpbb\captcha\factory
@ -10,6 +5,8 @@ services:
- @service_container
- @captcha.plugins.service_collection
# ----- Captcha plugins -----
# Scope MUST be prototype for all the plugins to work.
captcha.plugins.service_collection:
class: phpbb\di\service_collection
arguments:
@ -19,7 +16,7 @@ services:
core.captcha.plugins.gd:
class: phpbb\captcha\plugins\gd
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
calls:
- [set_name, [core.captcha.plugins.gd]]
tags:
@ -27,7 +24,7 @@ services:
core.captcha.plugins.gd_wave:
class: phpbb\captcha\plugins\gd_wave
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
calls:
- [set_name, [core.captcha.plugins.gd_wave]]
tags:
@ -35,7 +32,7 @@ services:
core.captcha.plugins.nogd:
class: phpbb\captcha\plugins\nogd
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
calls:
- [set_name, [core.captcha.plugins.nogd]]
tags:
@ -43,7 +40,7 @@ services:
core.captcha.plugins.qa:
class: phpbb\captcha\plugins\qa
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- %tables.captcha_qa_questions%
- %tables.captcha_qa_answers%
@ -55,7 +52,7 @@ services:
core.captcha.plugins.recaptcha:
class: phpbb\captcha\plugins\recaptcha
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
calls:
- [set_name, [core.captcha.plugins.recaptcha]]
tags:

71
phpBB/config/content.yml Normal file
View File

@ -0,0 +1,71 @@
services:
content.visibility:
class: phpbb\content_visibility
arguments:
- @auth
- @config
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
- %tables.forums%
- %tables.posts%
- %tables.topics%
- %tables.users%
groupposition.legend:
class: phpbb\groupposition\legend
arguments:
- @dbal.conn
- @user
groupposition.teampage:
class: phpbb\groupposition\teampage
arguments:
- @dbal.conn
- @user
- @cache.driver
message.form.admin:
class: phpbb\message\admin_form
arguments:
- @auth
- @config
- @config_text
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
message.form.topic:
class: phpbb\message\topic_form
arguments:
- @auth
- @config
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
message.form.user:
class: phpbb\message\user_form
arguments:
- @auth
- @config
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
pagination:
class: phpbb\pagination
arguments:
- @template
- @user
- @controller.helper
- @dispatcher
viewonline_helper:
class: phpbb\viewonline_helper
arguments:
- @filesystem

View File

@ -1,4 +1,26 @@
services:
cron.manager:
class: phpbb\cron\manager
arguments:
- @cron.task_collection
- %core.root_path%
- %core.php_ext%
cron.lock_db:
class: phpbb\lock\db
arguments:
- cron_lock
- @config
- @dbal.conn
# ----- Cron tasks -----
cron.task_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: cron.task }
cron.task.core.prune_all_forums:
class: phpbb\cron\task\core\prune_all_forums
arguments:

View File

@ -1,4 +1,20 @@
services:
dbal.conn:
class: phpbb\db\driver\factory
arguments:
- @service_container
dbal.conn.driver:
class: %dbal.driver.class%
calls:
- [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]
dbal.tools:
class: phpbb\db\tools
arguments:
- @dbal.conn
# ----- Migrator -----
migrator:
class: phpbb\db\migrator
arguments:
@ -15,6 +31,7 @@ services:
migrator.helper:
class: phpbb\db\migration\helper
# ----- Migrator's tools -----
migrator.tool_collection:
class: phpbb\di\service_collection
arguments:

34
phpBB/config/event.yml Normal file
View File

@ -0,0 +1,34 @@
services:
dispatcher:
class: phpbb\event\dispatcher
arguments:
- @service_container
hook_finder:
class: phpbb\hook\finder
arguments:
- %core.root_path%
- %core.php_ext%
- @cache.driver
kernel_request_subscriber:
class: phpbb\event\kernel_request_subscriber
arguments:
- @ext.manager
- %core.root_path%
- %core.php_ext%
tags:
- { name: kernel.event_subscriber }
kernel_exception_subscriber:
class: phpbb\event\kernel_exception_subscriber
arguments:
- @template
- @user
tags:
- { name: kernel.event_subscriber }
kernel_terminate_subscriber:
class: phpbb\event\kernel_terminate_subscriber
tags:
- { name: kernel.event_subscriber }

View File

@ -1,11 +1,11 @@
parameters:
mimetype.guesser.priority.lowest: -2
mimetype.guesser.priority.low: -1
mimetype.guesser.priority.default: 0
mimetype.guesser.priority.high: 1
mimetype.guesser.priority.highest: 2
services:
mimetype.guesser_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: mimetype.guessers }
mimetype.fileinfo_mimetype_guesser:
class: Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser
tags:
@ -30,13 +30,6 @@ services:
tags:
- { name: mimetype.guessers }
mimetype.guesser_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: mimetype.guessers }
mimetype.guesser:
class: phpbb\mimetype\guesser
arguments:

View File

@ -1,4 +1,23 @@
services:
notification_manager:
class: phpbb\notification\manager
arguments:
- @notification.type_collection
- @notification.method_collection
- @service_container
- @user_loader
- @config
- @dbal.conn
- @cache
- @user
- %core.root_path%
- %core.php_ext%
- %tables.notification_types%
- %tables.notifications%
- %tables.user_notifications%
# ----- Notification's types -----
# Scope MUST be prototype for all the plugins to work.
notification.type_collection:
class: phpbb\di\service_collection
arguments:
@ -6,16 +25,9 @@ services:
tags:
- { name: service_collection, tag: notification.type }
notification.method_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: notification.method }
notification.type.approve_post:
class: phpbb\notification\type\approve_post
scope: prototype # scope MUST be prototype for this to work! # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -33,7 +45,7 @@ services:
notification.type.approve_topic:
class: phpbb\notification\type\approve_topic
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -51,7 +63,7 @@ services:
notification.type.bookmark:
class: phpbb\notification\type\bookmark
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -69,7 +81,7 @@ services:
notification.type.disapprove_post:
class: phpbb\notification\type\disapprove_post
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -87,7 +99,7 @@ services:
notification.type.disapprove_topic:
class: phpbb\notification\type\disapprove_topic
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -105,7 +117,7 @@ services:
notification.type.group_request:
class: phpbb\notification\type\group_request
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -123,7 +135,7 @@ services:
notification.type.group_request_approved:
class: phpbb\notification\type\group_request_approved
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -141,7 +153,7 @@ services:
notification.type.pm:
class: phpbb\notification\type\pm
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -159,7 +171,7 @@ services:
notification.type.post:
class: phpbb\notification\type\post
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -177,7 +189,7 @@ services:
notification.type.post_in_queue:
class: phpbb\notification\type\post_in_queue
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -195,7 +207,7 @@ services:
notification.type.quote:
class: phpbb\notification\type\quote
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -213,7 +225,7 @@ services:
notification.type.report_pm:
class: phpbb\notification\type\report_pm
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -231,7 +243,7 @@ services:
notification.type.report_pm_closed:
class: phpbb\notification\type\report_pm_closed
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -249,7 +261,7 @@ services:
notification.type.report_post:
class: phpbb\notification\type\report_post
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -267,7 +279,7 @@ services:
notification.type.report_post_closed:
class: phpbb\notification\type\report_post_closed
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -285,7 +297,7 @@ services:
notification.type.topic:
class: phpbb\notification\type\topic
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -303,7 +315,7 @@ services:
notification.type.topic_in_queue:
class: phpbb\notification\type\topic_in_queue
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -321,7 +333,7 @@ services:
notification.type.admin_activate_user:
class: phpbb\notification\type\admin_activate_user
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -336,10 +348,19 @@ services:
- %tables.user_notifications%
tags:
- { name: notification.type }
# ----- Notification's methods -----
# Scope MUST be prototype for all the plugins to work.
notification.method_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: notification.method }
notification.method.email:
class: phpbb\notification\method\email
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn
@ -354,7 +375,7 @@ services:
notification.method.jabber:
class: phpbb\notification\method\jabber
scope: prototype # scope MUST be prototype for this to work!
scope: prototype
arguments:
- @user_loader
- @dbal.conn

View File

@ -1,3 +1,20 @@
parameters:
# Disable the usage of the super globals (_GET, _POST, _SERVER...)
core.disable_super_globals: true
# Datetime class to use
datetime.class: \phpbb\datetime
# Mimetype guesser priorities
mimetype.guesser.priority.lowest: -2
mimetype.guesser.priority.low: -1
mimetype.guesser.priority.default: 0
mimetype.guesser.priority.high: 1
mimetype.guesser.priority.highest: 2
# List of default password driver types
passwords.algorithms:
- passwords.driver.bcrypt_2y
- passwords.driver.bcrypt
- passwords.driver.salted_md5
- passwords.driver.phpass

View File

@ -1,11 +1,29 @@
parameters:
passwords.algorithms:
- passwords.driver.bcrypt_2y
- passwords.driver.bcrypt
- passwords.driver.salted_md5
- passwords.driver.phpass
services:
# ----- Password management -----
passwords.manager:
class: phpbb\passwords\manager
arguments:
- @config
- @passwords.driver_collection
- @passwords.helper
- %passwords.algorithms%
passwords.helper:
class: phpbb\passwords\helper
passwords.driver_helper:
class: phpbb\passwords\driver\helper
arguments:
- @config
# ----- Password's drivers -----
passwords.driver_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: passwords.driver }
passwords.driver.bcrypt:
class: phpbb\passwords\driver\bcrypt
arguments:
@ -103,26 +121,3 @@ services:
- @passwords.driver_helper
tags:
- { name: passwords.driver }
passwords.driver_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: passwords.driver }
passwords.driver_helper:
class: phpbb\passwords\driver\helper
arguments:
- @config
passwords.manager:
class: phpbb\passwords\manager
arguments:
- @config
- @passwords.driver_collection
- @passwords.helper
- %passwords.algorithms%
passwords.helper:
class: phpbb\passwords\helper

View File

@ -19,6 +19,7 @@ services:
- @dbal.conn
- %tables.profile_fields_options_language%
# ----- Profile fields types -----
profilefields.type_collection:
class: phpbb\di\service_collection
arguments:

View File

@ -1,34 +1,23 @@
imports:
- { resource: tables.yml }
- { resource: cron_tasks.yml }
- { resource: notifications.yml }
- { resource: migrator.yml }
- { resource: avatars.yml }
- { resource: feed.yml }
- { resource: auth_providers.yml }
- { resource: console.yml }
- { resource: mimetype_guessers.yml }
- { resource: passwords.yml }
- { resource: profilefields.yml }
- { resource: auth.yml }
- { resource: avatar.yml }
- { resource: captcha.yml }
- { resource: console.yml }
- { resource: content.yml }
- { resource: cron.yml }
- { resource: db.yml }
- { resource: event.yml }
- { resource: feed.yml }
- { resource: mimetype_guesser.yml }
- { resource: notification.yml }
- { resource: password.yml }
- { resource: profilefield.yml }
- { resource: user.yml }
- { resource: tables.yml }
- { resource: parameters.yml }
services:
acl.permissions:
class: phpbb\permissions
arguments:
- @dispatcher
- @user
auth:
class: phpbb\auth\auth
avatar.manager:
class: phpbb\avatar\manager
arguments:
- @config
- @avatar.driver_collection
cache:
class: phpbb\cache\service
arguments:
@ -77,20 +66,6 @@ services:
- @dbal.conn
- %tables.config_text%
content.visibility:
class: phpbb\content_visibility
arguments:
- @auth
- @config
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
- %tables.forums%
- %tables.posts%
- %tables.topics%
- %tables.users%
controller.helper:
class: phpbb\controller\helper
arguments:
@ -117,47 +92,6 @@ services:
calls:
- [find, [%core.root_path%]]
cron.task_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: cron.task }
cron.manager:
class: phpbb\cron\manager
arguments:
- @cron.task_collection
- %core.root_path%
- %core.php_ext%
cron.lock_db:
class: phpbb\lock\db
arguments:
- cron_lock
- @config
- @dbal.conn
dispatcher:
class: phpbb\event\dispatcher
arguments:
- @service_container
dbal.conn:
class: phpbb\db\driver\factory
arguments:
- @service_container
dbal.conn.driver:
class: %dbal.driver.class%
calls:
- [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]
dbal.tools:
class: phpbb\db\tools
arguments:
- @dbal.conn
ext.manager:
class: phpbb\extension\manager
arguments:
@ -174,54 +108,12 @@ services:
filesystem:
class: phpbb\filesystem
groupposition.legend:
class: phpbb\groupposition\legend
arguments:
- @dbal.conn
- @user
groupposition.teampage:
class: phpbb\groupposition\teampage
arguments:
- @dbal.conn
- @user
- @cache.driver
http_kernel:
class: Symfony\Component\HttpKernel\HttpKernel
arguments:
- @dispatcher
- @controller.resolver
hook_finder:
class: phpbb\hook\finder
arguments:
- %core.root_path%
- %core.php_ext%
- @cache.driver
kernel_request_subscriber:
class: phpbb\event\kernel_request_subscriber
arguments:
- @ext.manager
- %core.root_path%
- %core.php_ext%
tags:
- { name: kernel.event_subscriber }
kernel_exception_subscriber:
class: phpbb\event\kernel_exception_subscriber
arguments:
- @template
- @user
tags:
- { name: kernel.event_subscriber }
kernel_terminate_subscriber:
class: phpbb\event\kernel_terminate_subscriber
tags:
- { name: kernel.event_subscriber }
log:
class: phpbb\log\log
arguments:
@ -234,62 +126,6 @@ services:
- %core.php_ext%
- %tables.log%
message.form.admin:
class: phpbb\message\admin_form
arguments:
- @auth
- @config
- @config_text
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
message.form.topic:
class: phpbb\message\topic_form
arguments:
- @auth
- @config
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
message.form.user:
class: phpbb\message\user_form
arguments:
- @auth
- @config
- @dbal.conn
- @user
- %core.root_path%
- %core.php_ext%
notification_manager:
class: phpbb\notification\manager
arguments:
- @notification.type_collection
- @notification.method_collection
- @service_container
- @user_loader
- @config
- @dbal.conn
- @cache
- @user
- %core.root_path%
- %core.php_ext%
- %tables.notification_types%
- %tables.notifications%
- %tables.user_notifications%
pagination:
class: phpbb\pagination
arguments:
- @template
- @user
- @controller.helper
- @dispatcher
path_helper:
class: phpbb\path_helper
arguments:
@ -336,19 +172,6 @@ services:
template_context:
class: phpbb\template\context
user:
class: phpbb\user
arguments:
- %datetime.class%
user_loader:
class: phpbb\user_loader
arguments:
- @dbal.conn
- %core.root_path%
- %core.php_ext%
- %tables.users%
version_helper:
class: phpbb\version_helper
scope: prototype
@ -356,8 +179,3 @@ services:
- @cache
- @config
- @user
viewonline_helper:
class: phpbb\viewonline_helper
arguments:
- @filesystem

View File

@ -1,6 +1,9 @@
parameters:
tables.auth_provider_oauth_token_storage: %core.table_prefix%oauth_tokens
tables.auth_provider_oauth_account_assoc: %core.table_prefix%oauth_accounts
tables.captcha_qa_questions: %core.table_prefix%captcha_questions
tables.captcha_qa_answers: %core.table_prefix%captcha_answers
tables.captcha_qa_confirm: %core.table_prefix%qa_confirm
tables.config: %core.table_prefix%config
tables.config_text: %core.table_prefix%config_text
tables.ext: %core.table_prefix%ext

19
phpBB/config/user.yml Normal file
View File

@ -0,0 +1,19 @@
services:
acl.permissions:
class: phpbb\permissions
arguments:
- @dispatcher
- @user
user:
class: phpbb\user
arguments:
- %datetime.class%
user_loader:
class: phpbb\user_loader
arguments:
- @dbal.conn
- %core.root_path%
- %core.php_ext%
- %tables.users%