From 6082b5e3d3942b330d7bb2aa822d97b9038babe5 Mon Sep 17 00:00:00 2001 From: Carlo Date: Sat, 12 Jul 2014 17:48:53 +0200 Subject: [ticket/12685] We need extensions enabled PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index c8098094a2..4c4367b31c 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -39,7 +39,6 @@ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/" $phpbb_class_loader_ext->register(); $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); -$phpbb_container_builder->set_use_extensions(false); $phpbb_container_builder->set_dump_container(false); $phpbb_container = $phpbb_container_builder->get_container(); -- cgit v1.2.1 From 2ec50c0ff15837489f36b014a2e36470b1672508 Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 15 Jul 2014 00:38:07 +0200 Subject: [ticket/12685] Add --safe-mode PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 4c4367b31c..21940d8a51 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -12,6 +12,8 @@ * */ +use Symfony\Component\Console\Input\ArgvInput; + if (php_sapi_name() != 'cli') { echo 'This program must be run from the command line.' . PHP_EOL; @@ -39,7 +41,15 @@ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/" $phpbb_class_loader_ext->register(); $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->set_dump_container(true); + +$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 = $phpbb_container_builder->get_container(); $phpbb_container->get('request')->enable_super_globals(); @@ -50,4 +60,4 @@ $user->add_lang('acp/common'); $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user); $application->register_container_commands($phpbb_container); -$application->run(); +$application->run($input); -- cgit v1.2.1 From 7e6215fb7f01eeaa4798d45a1f366685693bfdcc Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 15 Jul 2014 10:22:39 +0200 Subject: [ticket/12685] Container is dumped by default PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 21940d8a51..5fac2cf8b3 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -41,7 +41,6 @@ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/" $phpbb_class_loader_ext->register(); $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); -$phpbb_container_builder->set_dump_container(true); $input = new ArgvInput(); -- cgit v1.2.1 From 15136e4f8e36ca972f6b1b0bb7a4867967698335 Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 15 Jul 2014 11:36:51 +0200 Subject: [ticket/12685] Inject console.command_collection instead of the container PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 5fac2cf8b3..d181a63f68 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -58,5 +58,5 @@ $user = $phpbb_container->get('user'); $user->add_lang('acp/common'); $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user); -$application->register_container_commands($phpbb_container); +$application->register_container_commands($phpbb_container->get('console.command_collection')); $application->run($input); -- cgit v1.2.1 From 7cffedf5e310e0cde9bfd541ca835a4fedf26ef3 Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 15 Jul 2014 16:07:52 +0200 Subject: [ticket/12685] Override getDefaultInputDefinition() PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index d181a63f68..baaa22e67b 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -44,7 +44,7 @@ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_fil $input = new ArgvInput(); -if ($input->hasParameterOption(array('--safe-mode'))) +if ($input->getParameterOption(array('--safe-mode'))) { $phpbb_container_builder->set_use_extensions(false); $phpbb_container_builder->set_dump_container(false); -- cgit v1.2.1 From d95d6720bca4591208d34aeed3787db387ec7ebb Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 15 Jul 2014 17:51:23 +0200 Subject: [ticket/12685] Do not dump container PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index baaa22e67b..511eca9082 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -41,6 +41,7 @@ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/" $phpbb_class_loader_ext->register(); $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +$phpbb_container_builder->set_dump_container(false); $input = new ArgvInput(); -- cgit v1.2.1 From a4972bb338f06c6b7fbeea22869b3c3b106becf7 Mon Sep 17 00:00:00 2001 From: Carlo Date: Tue, 15 Jul 2014 19:21:41 +0200 Subject: [ticket/12685] Replace getParameterOption with hasParameterOption PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index 511eca9082..d86ec6d8f8 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -45,7 +45,7 @@ $phpbb_container_builder->set_dump_container(false); $input = new ArgvInput(); -if ($input->getParameterOption(array('--safe-mode'))) +if ($input->hasParameterOption(array('--safe-mode'))) { $phpbb_container_builder->set_use_extensions(false); $phpbb_container_builder->set_dump_container(false); -- cgit v1.2.1 From 7f4d4250066eadb6badd43c4ce1b8f2f84e083cf Mon Sep 17 00:00:00 2001 From: Carlo Date: Thu, 17 Jul 2014 00:05:33 +0200 Subject: [ticket/12685] Setup class loader for extensions only if not in safe mode PHPBB3-12685 --- phpBB/bin/phpbbcli.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'phpBB/bin') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index d86ec6d8f8..89bad94184 100755 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -37,9 +37,6 @@ 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_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); -$phpbb_class_loader_ext->register(); - $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); $phpbb_container_builder->set_dump_container(false); @@ -50,6 +47,12 @@ if ($input->hasParameterOption(array('--safe-mode'))) $phpbb_container_builder->set_use_extensions(false); $phpbb_container_builder->set_dump_container(false); } +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(); $phpbb_container->get('request')->enable_super_globals(); -- cgit v1.2.1