[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->php_ext = $phpEx;
$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->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper');
$this->log = $phpbb_log;
define('PORTAL_MODULES_TABLE', $this->phpbb_container->getParameter('board3.modules.table'));
define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.config.table'));
define('PORTAL_MODULES_TABLE', $this->phpbb_container->getParameter('board3.portal.modules.table'));
define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.portal.config.table'));
if (!function_exists('column_string_const'))
{

View File

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

View File

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

View File

@@ -11,8 +11,8 @@ parameters:
- board3.de
- updatecheck
- board3_portal.xml
board3.config.table: %core.table_prefix%portal_config
board3.modules.table: %core.table_prefix%portal_modules
board3.portal.config.table: %core.table_prefix%portal_config
board3.portal.modules.table: %core.table_prefix%portal_modules
services:
board3.portal.main:
@@ -25,8 +25,8 @@ services:
- @path_helper
- %core.root_path%
- .%core.php_ext%
- %board3.config.table%
- %board3.modules.table%
- %board3.portal.config.table%
- %board3.portal.modules.table%
board3.portal.controller_helper:
class: board3\portal\controller\helper
@@ -40,7 +40,7 @@ services:
- %core.root_path%
- .%core.php_ext%
board3.version.check:
board3.portal.version.check:
class: board3\portal\includes\version_check
arguments:
- %board3.version_data%
@@ -50,17 +50,17 @@ services:
- @template
- @user
board3.module_collection:
board3.portal.module_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: board3.module }
- { name: service_collection, tag: board3.portal.module }
board3.portal.helper:
class: board3\portal\includes\helper
arguments:
- @board3.module_collection
- @board3.portal.module_collection
board3.portal.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)
{
$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)
{
$portal_link = $this->controller_helper->route('board3_controller');
$portal_link = $this->controller_helper->route('board3_portal_controller');
}
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(

View File

@@ -186,7 +186,7 @@ class user_menu extends module_base
* redirect
*/
$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_AUTOLOGIN_ENABLED' => ($this->config['allow_autologin']) ? true : false,
'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;
$phpbb_container = new \phpbb_mock_container_builder();
// Mock version check
$phpbb_container->set('board3.version.check',
$phpbb_container->set('board3.portal.version.check',
$this->getMockBuilder('\board3\portal\includes\version_check')
->disableOriginalConstructor()
->getMock());
// Mock module service collection
$config = new \phpbb\config\config(array());
$phpbb_container->set('board3.module_collection',
$phpbb_container->set('board3.portal.module_collection',
array(
new \board3\portal\modules\clock(),
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\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->setParameter('board3.modules.table', $table_prefix . 'portal_modules');
$phpbb_container->setParameter('board3.config.table', $table_prefix . 'portal_config');
$phpbb_container->setParameter('board3.portal.modules.table', $table_prefix . 'portal_modules');
$phpbb_container->setParameter('board3.portal.config.table', $table_prefix . 'portal_config');
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put'));
$cache->expects($this->any())
->method('destroy')

View File

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