Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
set.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13 namespace phpbb\console\command\config;
14
15 use Symfony\Component\Console\Input\InputArgument;
16 use Symfony\Component\Console\Input\InputInterface;
17 use Symfony\Component\Console\Input\InputOption;
18 use Symfony\Component\Console\Output\OutputInterface;
19 use Symfony\Component\Console\Style\SymfonyStyle;
20
21 class set extends command
22 {
23 /**
24 * {@inheritdoc}
25 */
26 protected function configure()
27 {
28 $this
29 ->setName('config:set')
30 ->setDescription($this->user->lang('CLI_DESCRIPTION_SET_CONFIG'))
31 ->addArgument(
32 'key',
33 InputArgument::REQUIRED,
34 $this->user->lang('CLI_CONFIG_OPTION_NAME')
35 )
36 ->addArgument(
37 'value',
38 InputArgument::REQUIRED,
39 $this->user->lang('CLI_CONFIG_NEW')
40 )
41 ->addOption(
42 'dynamic',
43 'd',
44 InputOption::VALUE_NONE,
45 $this->user->lang('CLI_CONFIG_CANNOT_CACHED')
46 )
47 ;
48 }
49
50 /**
51 * Executes the command config:set.
52 *
53 * Sets a configuration option's value.
54 *
55 * @param InputInterface $input An InputInterface instance
56 * @param OutputInterface $output An OutputInterface instance
57 *
58 * @return void
59 * @see \phpbb\config\config::set()
60 */
61 protected function execute(InputInterface $input, OutputInterface $output)
62 {
63 $io = new SymfonyStyle($input, $output);
64
65 $key = $input->getArgument('key');
66 $value = $input->getArgument('value');
67 $use_cache = !$input->getOption('dynamic');
68
69 $this->config->set($key, $value, $use_cache);
70
71 $io->success($this->user->lang('CLI_CONFIG_SET_SUCCESS', $key));
72 }
73 }
74