Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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 |
get.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 get extends command
22 {
23 /**
24 * {@inheritdoc}
25 */
26 protected function configure()
27 {
28 $this
29 ->setName('config:get')
30 ->setDescription($this->user->lang('CLI_DESCRIPTION_GET_CONFIG'))
31 ->addArgument(
32 'key',
33 InputArgument::REQUIRED,
34 $this->user->lang('CLI_CONFIG_OPTION_NAME')
35 )
36 ->addOption(
37 'no-newline',
38 null,
39 InputOption::VALUE_NONE,
40 $this->user->lang('CLI_CONFIG_PRINT_WITHOUT_NEWLINE')
41 )
42 ;
43 }
44
45 /**
46 * Executes the command config:get.
47 *
48 * Retrieves a configuration value.
49 *
50 * @param InputInterface $input An InputInterface instance
51 * @param OutputInterface $output An OutputInterface instance
52 *
53 * @return void
54 * @see \phpbb\config\config::offsetGet()
55 */
56 protected function execute(InputInterface $input, OutputInterface $output)
57 {
58 $io = new SymfonyStyle($input, $output);
59
60 $key = $input->getArgument('key');
61
62 if (isset($this->config[$key]) && $input->getOption('no-newline'))
63 {
64 $output->write($this->config[$key]);
65 }
66 else if (isset($this->config[$key]))
67 {
68 $output->writeln($this->config[$key]);
69 }
70 else
71 {
72 $io->error($this->user->lang('CLI_CONFIG_NOT_EXISTS', $key));
73 }
74 }
75 }
76