FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[ticket/12685] Add --safe-mode · Gregory-R/phpbb@2ec50c0 · GitHub

forked from phpbb/phpbb

Commit 2ec50c0

Browse files
committed
[ticket/12685] Add --safe-mode
PHPBB3-12685
1 parent 6082b5e commit 2ec50c0

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎phpBB/bin/phpbbcli.php‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*
1313
*/
1414

15+
use Symfony\Component\Console\Input\ArgvInput;
16+
1517
if (php_sapi_name() != 'cli')
1618
{
1719
echo 'This program must be run from the command line.' . PHP_EOL;
@@ -39,7 +41,15 @@
3941
$phpbb_class_loader_ext->register();
4042

4143
$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
42-
$phpbb_container_builder->set_dump_container(false);
44+
$phpbb_container_builder->set_dump_container(true);
45+
46+
$input = new ArgvInput();
47+
48+
if ($input->hasParameterOption(array('--safe-mode')))
49+
{
50+
$phpbb_container_builder->set_use_extensions(false);
51+
$phpbb_container_builder->set_dump_container(false);
52+
}
4353

4454
$phpbb_container = $phpbb_container_builder->get_container();
4555
$phpbb_container->get('request')->enable_super_globals();
@@ -50,4 +60,4 @@
5060

5161
$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user);
5262
$application->register_container_commands($phpbb_container);
53-
$application->run();
63+
$application->run($input);

‎phpBB/language/en/acp/common.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
'CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1' => 'Name of the task to be run',
231231

232232
'CLI_DESCRIPTION_OPTION_SHELL' => 'Launch the shell.',
233+
'CLI_DESCRIPTION_OPTION_SAFE_MODE' => 'Run in Safe Mode (without extensions).',
233234

234235
'COLOUR_SWATCH' => 'Web-safe colour swatch',
235236
'CONFIG_UPDATED' => 'Configuration updated successfully.',

‎phpBB/phpbb/console/application.php‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ public function getHelp()
6767
$this->user->lang('CLI_DESCRIPTION_OPTION_SHELL')
6868
));
6969

70+
$this->getDefinition()->addOption(new InputOption(
71+
'--safe-mode',
72+
null,
73+
InputOption::VALUE_NONE,
74+
$this->user->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
75+
));
76+
7077
return parent::getHelp();
7178
}
7279

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL