[ticket/347] Rename services and controllers to be prefix with vendor & ext

B3P-347
This commit is contained in:
Marc Alexander
2014-08-24 01:16:09 +02:00
parent fab235065f
commit c3366f746a
8 changed files with 78 additions and 78 deletions

View File

@@ -39,12 +39,12 @@ class portal_module
$this->phpbb_admin_path = $phpbb_admin_path; $this->phpbb_admin_path = $phpbb_admin_path;
$this->php_ext = $phpEx; $this->php_ext = $phpEx;
$this->phpbb_container = $phpbb_container; $this->phpbb_container = $phpbb_container;
$this->version_check = $this->phpbb_container->get('board3.version.check'); $this->version_check = $this->phpbb_container->get('board3.portal.version.check');
$this->portal_helper = $this->phpbb_container->get('board3.portal.helper'); $this->portal_helper = $this->phpbb_container->get('board3.portal.helper');
$this->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper'); $this->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper');
$this->log = $phpbb_log; $this->log = $phpbb_log;
define('PORTAL_MODULES_TABLE', $this->phpbb_container->getParameter('board3.modules.table')); define('PORTAL_MODULES_TABLE', $this->phpbb_container->getParameter('board3.portal.modules.table'));
define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.config.table')); define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.portal.config.table'));
if (!function_exists('column_string_const')) if (!function_exists('column_string_const'))
{ {

View File

@@ -1,5 +1,5 @@
services: services:
board3.module.announcements: board3.portal.module.announcements:
class: board3\portal\modules\announcements class: board3\portal\modules\announcements
arguments: arguments:
- @auth - @auth
@@ -15,9 +15,9 @@ services:
- @user - @user
- @board3.portal.fetch_posts - @board3.portal.fetch_posts
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.attachments: board3.portal.module.attachments:
class: board3\portal\modules\attachments class: board3\portal\modules\attachments
arguments: arguments:
- @auth - @auth
@@ -30,9 +30,9 @@ services:
- %core.root_path% - %core.root_path%
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.birthday_list: board3.portal.module.birthday_list:
class: board3\portal\modules\birthday_list class: board3\portal\modules\birthday_list
arguments: arguments:
- @config - @config
@@ -40,9 +40,9 @@ services:
- @dbal.conn - @dbal.conn
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.calendar: board3.portal.module.calendar:
class: board3\portal\modules\calendar class: board3\portal\modules\calendar
arguments: arguments:
- @config - @config
@@ -55,14 +55,14 @@ services:
- @path_helper - @path_helper
- @log - @log
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.clock: board3.portal.module.clock:
class: board3\portal\modules\clock class: board3\portal\modules\clock
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.custom: board3.portal.module.custom:
class: board3\portal\modules\custom class: board3\portal\modules\custom
arguments: arguments:
- @config - @config
@@ -74,18 +74,18 @@ services:
- @user - @user
- @log - @log
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.donation: board3.portal.module.donation:
class: board3\portal\modules\donation class: board3\portal\modules\donation
arguments: arguments:
- @config - @config
- @template - @template
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.forumlist: board3.portal.module.forumlist:
class: board3\portal\modules\forumlist class: board3\portal\modules\forumlist
arguments: arguments:
- @auth - @auth
@@ -95,9 +95,9 @@ services:
- %core.php_ext% - %core.php_ext%
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.friends: board3.portal.module.friends:
class: board3\portal\modules\friends class: board3\portal\modules\friends
arguments: arguments:
- @auth - @auth
@@ -106,9 +106,9 @@ services:
- @template - @template
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.latest_bots: board3.portal.module.latest_bots:
class: board3\portal\modules\latest_bots class: board3\portal\modules\latest_bots
arguments: arguments:
- @config - @config
@@ -116,9 +116,9 @@ services:
- @template - @template
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.latest_members: board3.portal.module.latest_members:
class: board3\portal\modules\latest_members class: board3\portal\modules\latest_members
arguments: arguments:
- @config - @config
@@ -126,9 +126,9 @@ services:
- @template - @template
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.leaders: board3.portal.module.leaders:
class: board3\portal\modules\leaders class: board3\portal\modules\leaders
arguments: arguments:
- @auth - @auth
@@ -139,18 +139,18 @@ services:
- %core.php_ext% - %core.php_ext%
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.link_us: board3.portal.module.link_us:
class: board3\portal\modules\link_us class: board3\portal\modules\link_us
arguments: arguments:
- @config - @config
- @template - @template
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.links: board3.portal.module.links:
class: board3\portal\modules\links class: board3\portal\modules\links
arguments: arguments:
- @config - @config
@@ -162,9 +162,9 @@ services:
- @user - @user
- @log - @log
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.main_menu: board3.portal.module.main_menu:
class: board3\portal\modules\main_menu class: board3\portal\modules\main_menu
arguments: arguments:
- @config - @config
@@ -176,9 +176,9 @@ services:
- @user - @user
- @log - @log
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.news: board3.portal.module.news:
class: board3\portal\modules\news class: board3\portal\modules\news
arguments: arguments:
- @auth - @auth
@@ -194,9 +194,9 @@ services:
- @user - @user
- @board3.portal.fetch_posts - @board3.portal.fetch_posts
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.poll: board3.portal.module.poll:
class: board3\portal\modules\poll class: board3\portal\modules\poll
arguments: arguments:
- @auth - @auth
@@ -208,18 +208,18 @@ services:
- %core.php_ext% - %core.php_ext%
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.random_member: board3.portal.module.random_member:
class: board3\portal\modules\random_member class: board3\portal\modules\random_member
arguments: arguments:
- @dbal.conn - @dbal.conn
- @template - @template
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.recent: board3.portal.module.recent:
class: board3\portal\modules\recent class: board3\portal\modules\recent
arguments: arguments:
- @auth - @auth
@@ -230,18 +230,18 @@ services:
- %core.root_path% - %core.root_path%
- %core.php_ext% - %core.php_ext%
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.search: board3.portal.module.search:
class: board3\portal\modules\search class: board3\portal\modules\search
arguments: arguments:
- @template - @template
- %core.php_ext% - %core.php_ext%
- %core.root_path% - %core.root_path%
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.statistics: board3.portal.module.statistics:
class: board3\portal\modules\statistics class: board3\portal\modules\statistics
arguments: arguments:
- @cache - @cache
@@ -250,9 +250,9 @@ services:
- @template - @template
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.stylechanger: board3.portal.module.stylechanger:
class: board3\portal\modules\stylechanger class: board3\portal\modules\stylechanger
arguments: arguments:
- @config - @config
@@ -263,9 +263,9 @@ services:
- %core.root_path% - %core.root_path%
- @user - @user
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.topposters: board3.portal.module.topposters:
class: board3\portal\modules\topposters class: board3\portal\modules\topposters
arguments: arguments:
- @config - @config
@@ -274,9 +274,9 @@ services:
- %core.root_path% - %core.root_path%
- %core.php_ext% - %core.php_ext%
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.user_menu: board3.portal.module.user_menu:
class: board3\portal\modules\user_menu class: board3\portal\modules\user_menu
arguments: arguments:
- @auth - @auth
@@ -289,9 +289,9 @@ services:
- %core.root_path% - %core.root_path%
- %core.php_ext% - %core.php_ext%
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.welcome: board3.portal.module.welcome:
class: board3\portal\modules\welcome class: board3\portal\modules\welcome
arguments: arguments:
- @config - @config
@@ -301,9 +301,9 @@ services:
- %core.root_path% - %core.root_path%
- %core.php_ext% - %core.php_ext%
tags: tags:
- { name: board3.module } - { name: board3.portal.module }
board3.module.whois_online: board3.portal.module.whois_online:
class: board3\portal\modules\whois_online class: board3\portal\modules\whois_online
arguments: arguments:
- @auth - @auth
@@ -313,4 +313,4 @@ services:
- %core.root_path% - %core.root_path%
- %core.php_ext% - %core.php_ext%
tags: tags:
- { name: board3.module } - { name: board3.portal.module }

View File

@@ -1,13 +1,13 @@
board3_controller: board3_portal_controller:
pattern: /portal pattern: /portal
defaults: { _controller: board3.portal.main:handle } defaults: { _controller: board3.portal.main:handle }
# This is currently not supported yet # This is currently not supported yet
board3_pages_controller: # board3_portal_pages_controller:
pattern: /portal/{page} # pattern: /portal/{page}
defaults: { _controller: board3.portal.main:handle_page, page: "portal" } # defaults: { _controller: board3.portal.main:handle_page, page: "portal" }
# Redirect to portal by default # Redirect to portal by default
board3_redirect_controller: board3_portal_redirect_controller:
pattern: / pattern: /
defaults: { _controller: board3.portal.main:handle } defaults: { _controller: board3.portal.main:handle }

View File

@@ -11,8 +11,8 @@ parameters:
- board3.de - board3.de
- updatecheck - updatecheck
- board3_portal.xml - board3_portal.xml
board3.config.table: %core.table_prefix%portal_config board3.portal.config.table: %core.table_prefix%portal_config
board3.modules.table: %core.table_prefix%portal_modules board3.portal.modules.table: %core.table_prefix%portal_modules
services: services:
board3.portal.main: board3.portal.main:
@@ -25,8 +25,8 @@ services:
- @path_helper - @path_helper
- %core.root_path% - %core.root_path%
- .%core.php_ext% - .%core.php_ext%
- %board3.config.table% - %board3.portal.config.table%
- %board3.modules.table% - %board3.portal.modules.table%
board3.portal.controller_helper: board3.portal.controller_helper:
class: board3\portal\controller\helper class: board3\portal\controller\helper
@@ -40,7 +40,7 @@ services:
- %core.root_path% - %core.root_path%
- .%core.php_ext% - .%core.php_ext%
board3.version.check: board3.portal.version.check:
class: board3\portal\includes\version_check class: board3\portal\includes\version_check
arguments: arguments:
- %board3.version_data% - %board3.version_data%
@@ -50,17 +50,17 @@ services:
- @template - @template
- @user - @user
board3.module_collection: board3.portal.module_collection:
class: phpbb\di\service_collection class: phpbb\di\service_collection
arguments: arguments:
- @service_container - @service_container
tags: tags:
- { name: service_collection, tag: board3.module } - { name: service_collection, tag: board3.portal.module }
board3.portal.helper: board3.portal.helper:
class: board3\portal\includes\helper class: board3\portal\includes\helper
arguments: arguments:
- @board3.module_collection - @board3.portal.module_collection
board3.portal.modules_helper: board3.portal.modules_helper:
class: board3\portal\includes\modules_helper class: board3\portal\includes\modules_helper

View File

@@ -87,7 +87,7 @@ class listener implements EventSubscriberInterface
if ($event['on_page'][1] == 'app' && strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/portal') === 0) if ($event['on_page'][1] == 'app' && strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/portal') === 0)
{ {
$event['location'] = $this->user->lang('VIEWING_PORTAL'); $event['location'] = $this->user->lang('VIEWING_PORTAL');
$event['location_url'] = $this->controller_helper->route('board3_controller'); $event['location_url'] = $this->controller_helper->route('board3_portal_controller');
} }
} }
@@ -100,11 +100,11 @@ class listener implements EventSubscriberInterface
{ {
if (strpos($this->user->data['session_page'], '/portal') === false) if (strpos($this->user->data['session_page'], '/portal') === false)
{ {
$portal_link = $this->controller_helper->route('board3_controller'); $portal_link = $this->controller_helper->route('board3_portal_controller');
} }
else else
{ {
$portal_link = $this->path_helper->remove_web_root_path($this->controller_helper->route('board3_controller')); $portal_link = $this->path_helper->remove_web_root_path($this->controller_helper->route('board3_portal_controller'));
} }
$this->template->assign_vars(array( $this->template->assign_vars(array(

View File

@@ -186,7 +186,7 @@ class user_menu extends module_base
* redirect * redirect
*/ */
$this->template->assign_vars(array( $this->template->assign_vars(array(
'U_PORTAL_REDIRECT' => $this->path_helper->remove_web_root_path($this->controller_helper->route('board3_controller')), 'U_PORTAL_REDIRECT' => $this->path_helper->remove_web_root_path($this->controller_helper->route('board3_portal_controller')),
'S_DISPLAY_FULL_LOGIN' => true, 'S_DISPLAY_FULL_LOGIN' => true,
'S_AUTOLOGIN_ENABLED' => ($this->config['allow_autologin']) ? true : false, 'S_AUTOLOGIN_ENABLED' => ($this->config['allow_autologin']) ? true : false,
'S_LOGIN_ACTION' => append_sid("{$this->phpbb_root_path}ucp.{$this->php_ext}", 'mode=login'), 'S_LOGIN_ACTION' => append_sid("{$this->phpbb_root_path}ucp.{$this->php_ext}", 'mode=login'),

View File

@@ -26,23 +26,23 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
$request = new \phpbb_mock_request; $request = new \phpbb_mock_request;
$phpbb_container = new \phpbb_mock_container_builder(); $phpbb_container = new \phpbb_mock_container_builder();
// Mock version check // Mock version check
$phpbb_container->set('board3.version.check', $phpbb_container->set('board3.portal.version.check',
$this->getMockBuilder('\board3\portal\includes\version_check') $this->getMockBuilder('\board3\portal\includes\version_check')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock()); ->getMock());
// Mock module service collection // Mock module service collection
$config = new \phpbb\config\config(array()); $config = new \phpbb\config\config(array());
$phpbb_container->set('board3.module_collection', $phpbb_container->set('board3.portal.module_collection',
array( array(
new \board3\portal\modules\clock(), new \board3\portal\modules\clock(),
new \board3\portal\modules\birthday_list($config, $template, $this->db, $user), new \board3\portal\modules\birthday_list($config, $template, $this->db, $user),
new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $phpbb_root_path, $phpEx), new \board3\portal\modules\welcome($config, new \phpbb_mock_request, $this->db, $user, $phpbb_root_path, $phpEx),
new \board3\portal\modules\donation($config, $template, $user), new \board3\portal\modules\donation($config, $template, $user),
)); ));
$phpbb_container->set('board3.portal.helper', new \board3\portal\includes\helper($phpbb_container->get('board3.module_collection'))); $phpbb_container->set('board3.portal.helper', new \board3\portal\includes\helper($phpbb_container->get('board3.portal.module_collection')));
$phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), $config, $request)); $phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), $config, $request));
$phpbb_container->setParameter('board3.modules.table', $table_prefix . 'portal_modules'); $phpbb_container->setParameter('board3.portal.modules.table', $table_prefix . 'portal_modules');
$phpbb_container->setParameter('board3.config.table', $table_prefix . 'portal_config'); $phpbb_container->setParameter('board3.portal.config.table', $table_prefix . 'portal_config');
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put')); $cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put'));
$cache->expects($this->any()) $cache->expects($this->any())
->method('destroy') ->method('destroy')

View File

@@ -1,3 +1,3 @@
board3_controller: board3_portal_controller:
pattern: /portal pattern: /portal
defaults: { _controller: board3.portal.main:handle } defaults: { _controller: board3.portal.main:handle }