From 014eed385bf761d9e3f0992835f44f58bf055afd Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 5 Sep 2014 16:33:57 +0200 Subject: [ticket/12620] Add support of the environments for the ext routing files PHPBB3-12620 --- phpBB/bin/phpbbcli.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index ca425ad0c4..14681e25ee 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -21,6 +21,12 @@ if (php_sapi_name() != 'cli') } define('IN_PHPBB', true); + +if (!defined('PHPBB_ENVIRONMENT')) +{ + @define('PHPBB_ENVIRONMENT', 'production'); +} + $phpbb_root_path = __DIR__ . '/../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require($phpbb_root_path . 'includes/startup.' . $phpEx); -- cgit v1.2.1 From b5544b2f471ce4c93b08d19919ab062725545ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gae=CC=88tan=20Muller?= Date: Sat, 3 Jan 2015 11:39:29 +0100 Subject: [ticket/13450] Type-hint return value of $phpbb_container->get() PHPBB3-13450 --- phpBB/bin/phpbbcli.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 14681e25ee..fc78e5d04a 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -64,6 +64,7 @@ $phpbb_container = $phpbb_container_builder->get_container(); $phpbb_container->get('request')->enable_super_globals(); require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); +/* @var $user \phpbb\user */ $user = $phpbb_container->get('user'); $user->add_lang('acp/common'); $user->add_lang('cli'); -- cgit v1.2.1 From c96e7ef1711932c2236620903bc256b346514dfc Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 26 Apr 2015 19:41:07 +0200 Subject: [ticket/13770] Wither interface for container_builder PHPBB3-13770 --- phpBB/bin/phpbbcli.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index fc78e5d04a..d72ca760c8 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -43,21 +43,21 @@ require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); -$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); -$phpbb_container_builder->set_dump_container(false); +$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx); +$phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file); + +$phpbb_container_builder->without_cache(); $input = new ArgvInput(); if ($input->hasParameterOption(array('--safe-mode'))) { - $phpbb_container_builder->set_use_extensions(false); - $phpbb_container_builder->set_dump_container(false); + $phpbb_container_builder->without_extensions(); } else { $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); $phpbb_class_loader_ext->register(); - phpbb_load_extensions_autoloaders($phpbb_root_path); } $phpbb_container = $phpbb_container_builder->get_container(); -- cgit v1.2.1 From 06d31abda948abd6f18bc43a3b31c1e4db9425ae Mon Sep 17 00:00:00 2001 From: David King Date: Sat, 23 May 2015 17:26:45 -0400 Subject: [ticket/13769] Move environment check lower in phpbbcli.php PHPBB3-13769 --- phpBB/bin/phpbbcli.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index fc78e5d04a..4d40c6aba7 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -22,11 +22,6 @@ if (php_sapi_name() != 'cli') define('IN_PHPBB', true); -if (!defined('PHPBB_ENVIRONMENT')) -{ - @define('PHPBB_ENVIRONMENT', 'production'); -} - $phpbb_root_path = __DIR__ . '/../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require($phpbb_root_path . 'includes/startup.' . $phpEx); @@ -38,6 +33,11 @@ $phpbb_class_loader->register(); $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); extract($phpbb_config_php_file->get_all()); +if (!defined('PHPBB_ENVIRONMENT')) +{ + @define('PHPBB_ENVIRONMENT', 'production'); +} + require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); -- cgit v1.2.1 From be7e1ba7a0d35a86c4b41ab037e82a3a114108cb Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Fri, 24 Jul 2015 18:05:10 +0200 Subject: [ticket/13740] Use language service in console application PHPBB3-13740 --- phpBB/bin/phpbbcli.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index c847b884e0..18657aed0a 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -68,7 +68,8 @@ require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); $user = $phpbb_container->get('user'); $user->add_lang('acp/common'); $user->add_lang('cli'); +$lang = $phpbb_container->get('language'); -$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user); +$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang); $application->register_container_commands($phpbb_container->get('console.command_collection')); $application->run($input); -- cgit v1.2.1 From c868582e4412d482853e7975b1cff1965f51ce25 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 24 Aug 2015 17:45:24 +0200 Subject: [ticket/14125] Add --env option to all CLI commands PHPBB3-14125 --- phpBB/bin/phpbbcli.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 18657aed0a..e5992f7536 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -46,13 +46,17 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx); $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file); -$phpbb_container_builder->without_cache(); - $input = new ArgvInput(); +if ($input->hasParameterOption(array('--env'))) +{ + $phpbb_container_builder->with_environment($input->getParameterOption('--env')); +} + if ($input->hasParameterOption(array('--safe-mode'))) { $phpbb_container_builder->without_extensions(); + $phpbb_container_builder->without_cache(); } else { @@ -68,6 +72,8 @@ require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); $user = $phpbb_container->get('user'); $user->add_lang('acp/common'); $user->add_lang('cli'); + +/* @var $lang \phpbb\language\language */ $lang = $phpbb_container->get('language'); $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang); -- cgit v1.2.1 From 17e7a89a60f700efc8a0b082b7a82005e6288e80 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 24 Aug 2015 12:04:22 +0200 Subject: [ticket/14124] Automatically translate exceptions in CLI PHPBB3-14124 --- phpBB/bin/phpbbcli.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 18657aed0a..d85b9a8d46 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -71,5 +71,6 @@ $user->add_lang('cli'); $lang = $phpbb_container->get('language'); $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang); +$application->setDispatcher($phpbb_container->get('dispatcher')); $application->register_container_commands($phpbb_container->get('console.command_collection')); $application->run($input); -- cgit v1.2.1 From 6d2acb5ba3fbd22b345b312e704021eab1375941 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 24 Mar 2016 13:01:52 +0100 Subject: [ticket/13616] Fix UI tests PHPBB3-13616 --- phpBB/bin/phpbbcli.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 72f1785931..804a7e09a0 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -68,6 +68,8 @@ $phpbb_container = $phpbb_container_builder->get_container(); $phpbb_container->get('request')->enable_super_globals(); require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); +register_compatibility_globals(); + /* @var $user \phpbb\user */ $user = $phpbb_container->get('user'); $user->data['user_id'] = ANONYMOUS; -- cgit v1.2.1 From 4d4d3824f30119b18cfab0939d14b74d18b76283 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 9 Oct 2016 10:47:56 +0200 Subject: [ticket/14813] Add missing functions_compatibiity in phpbbcli PHPBB3-14813 --- phpBB/bin/phpbbcli.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 804a7e09a0..2bca6e7b89 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -42,6 +42,7 @@ require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); +require($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx); $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx); $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file); -- cgit v1.2.1 From 45dda53310bb618dce0813d61a85948cb334e4a9 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 26 Aug 2015 12:06:56 +0200 Subject: [ticket/12610] Improve output PHPBB3-12610 --- phpBB/bin/phpbbcli.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 2bca6e7b89..2c3675bbf1 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -71,16 +71,16 @@ require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx); register_compatibility_globals(); +/** @var \phpbb\language\language $language */ +$language = $phpbb_container->get('language'); +$language->add_lang(array('common', 'acp/common', 'cli')); + /* @var $user \phpbb\user */ $user = $phpbb_container->get('user'); $user->data['user_id'] = ANONYMOUS; $user->ip = '127.0.0.1'; -$user->add_lang('acp/common'); -$user->add_lang('cli'); - -/* @var $lang \phpbb\language\language */ -$lang = $phpbb_container->get('language'); +$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $language); $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang); $application->setDispatcher($phpbb_container->get('dispatcher')); $application->register_container_commands($phpbb_container->get('console.command_collection')); -- cgit v1.2.1 From 0256c69191db7b2102d5fb338401ab3f58b118c6 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 26 Aug 2015 13:33:38 +0200 Subject: [ticket/12610] CS PHPBB3-12610 --- phpBB/bin/phpbbcli.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 2c3675bbf1..6bd217ec07 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -81,7 +81,6 @@ $user->data['user_id'] = ANONYMOUS; $user->ip = '127.0.0.1'; $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $language); -$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang); $application->setDispatcher($phpbb_container->get('dispatcher')); $application->register_container_commands($phpbb_container->get('console.command_collection')); $application->run($input); -- cgit v1.2.1 From ce17a5d892b24c8a8d3c2b1f9e36ab8d498920f6 Mon Sep 17 00:00:00 2001 From: hubaishan Date: Thu, 17 Aug 2017 21:24:39 +0300 Subject: [ticket/15317] Fix phpbbcli language Fix language by adding set_default_language PHPBB3-15317 --- phpBB/bin/phpbbcli.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 6bd217ec07..9d52305c5b 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -73,6 +73,7 @@ register_compatibility_globals(); /** @var \phpbb\language\language $language */ $language = $phpbb_container->get('language'); +$language->set_default_language($config['default_lang']); $language->add_lang(array('common', 'acp/common', 'cli')); /* @var $user \phpbb\user */ -- cgit v1.2.1 From b5e850b6df703a97f654f92cea9143754c3086b8 Mon Sep 17 00:00:00 2001 From: hubaishan Date: Fri, 18 Aug 2017 20:13:42 +0300 Subject: [ticket/15317] Fix phpbbcli language Updated as Nicofuma said PHPBB3-15317 --- phpBB/bin/phpbbcli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 9d52305c5b..3061fee817 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -73,7 +73,7 @@ register_compatibility_globals(); /** @var \phpbb\language\language $language */ $language = $phpbb_container->get('language'); -$language->set_default_language($config['default_lang']); +$language->set_default_language($phpbb_container->get('config')['default_lang']); $language->add_lang(array('common', 'acp/common', 'cli')); /* @var $user \phpbb\user */ -- cgit v1.2.1