| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,8 @@ | |||
| 12 | 12 | * | |
| 13 | 13 | */ | |
| 14 | 14 | ||
| 15 | + use Symfony\Component\Console\Input\ArgvInput; | ||
| 16 | + | ||
| 15 | 17 | if (php_sapi_name() != 'cli') | |
| 16 | 18 | { | |
| 17 | 19 | echo 'This program must be run from the command line.' . PHP_EOL; | |
@@ -39,7 +41,15 @@ | |||
| 39 | 41 | $phpbb_class_loader_ext->register(); | |
| 40 | 42 | ||
| 41 | 43 | $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 | + } | ||
| 43 | 53 | ||
| 44 | 54 | $phpbb_container = $phpbb_container_builder->get_container(); | |
| 45 | 55 | $phpbb_container->get('request')->enable_super_globals(); | |
@@ -50,4 +60,4 @@ | |||
| 50 | 60 | ||
| 51 | 61 | $application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user); | |
| 52 | 62 | $application->register_container_commands($phpbb_container); | |
| 53 | - $application->run(); | ||
| 63 | + $application->run($input); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -230,6 +230,7 @@ | |||
| 230 | 230 | 'CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1' => 'Name of the task to be run', | |
| 231 | 231 | ||
| 232 | 232 | 'CLI_DESCRIPTION_OPTION_SHELL' => 'Launch the shell.', | |
| 233 | + 'CLI_DESCRIPTION_OPTION_SAFE_MODE' => 'Run in Safe Mode (without extensions).', | ||
| 233 | 234 | ||
| 234 | 235 | 'COLOUR_SWATCH' => 'Web-safe colour swatch', | |
| 235 | 236 | 'CONFIG_UPDATED' => 'Configuration updated successfully.', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,6 +67,13 @@ public function getHelp() | |||
| 67 | 67 | $this->user->lang('CLI_DESCRIPTION_OPTION_SHELL') | |
| 68 | 68 | )); | |
| 69 | 69 | ||
| 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 | + | ||
| 70 | 77 | return parent::getHelp(); | |
| 71 | 78 | } | |
| 72 | 79 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments