Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 116 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
installer_configuration | |
0.00% |
0 / 116 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
getConfigTreeBuilder | |
0.00% |
0 / 116 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\install; |
15 | |
16 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
17 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
18 | |
19 | class installer_configuration implements ConfigurationInterface |
20 | { |
21 | |
22 | /** |
23 | * Generates the configuration tree builder. |
24 | * |
25 | * @return TreeBuilder The tree builder |
26 | */ |
27 | public function getConfigTreeBuilder() |
28 | { |
29 | $treeBuilder = new TreeBuilder('installer'); |
30 | $rootNode = $treeBuilder->getRootNode(); |
31 | /** @psalm-suppress UndefinedMethod */ |
32 | $rootNode |
33 | ->children() |
34 | ->arrayNode('admin') |
35 | ->children() |
36 | ->scalarNode('name')->defaultValue('admin')->cannotBeEmpty()->end() |
37 | ->scalarNode('password')->defaultValue('adminadmin')->cannotBeEmpty()->end() |
38 | ->scalarNode('email')->defaultValue('admin@example.org')->cannotBeEmpty()->end() |
39 | ->end() |
40 | ->end() |
41 | ->arrayNode('board') |
42 | ->children() |
43 | ->scalarNode('lang') |
44 | ->defaultValue('en') |
45 | ->cannotBeEmpty() |
46 | ->end() |
47 | ->scalarNode('name') |
48 | ->defaultValue('My Board') |
49 | ->cannotBeEmpty() |
50 | ->end() |
51 | ->scalarNode('description') |
52 | ->defaultValue('My amazing new phpBB board') |
53 | ->cannotBeEmpty() |
54 | ->end() |
55 | ->end() |
56 | ->end() |
57 | ->arrayNode('database') |
58 | ->children() |
59 | ->scalarNode('dbms') |
60 | ->defaultValue('sqlite3') |
61 | ->cannotBeEmpty() |
62 | ->isRequired() |
63 | ->end() |
64 | ->scalarNode('dbhost') |
65 | ->defaultValue(null) |
66 | ->end() |
67 | ->scalarNode('dbport') |
68 | ->defaultValue(null) |
69 | ->end() |
70 | ->scalarNode('dbuser') |
71 | ->defaultValue(null) |
72 | ->end() |
73 | ->scalarNode('dbpasswd') |
74 | ->defaultValue(null) |
75 | ->end() |
76 | ->scalarNode('dbname') |
77 | ->defaultValue(null) |
78 | ->end() |
79 | ->scalarNode('table_prefix') |
80 | ->defaultValue('phpbb_') |
81 | ->cannotBeEmpty() |
82 | ->isRequired() |
83 | ->end() |
84 | ->end() |
85 | ->end() |
86 | ->arrayNode('email') |
87 | ->canBeEnabled() |
88 | ->addDefaultsIfNotSet() |
89 | ->children() |
90 | ->booleanNode('smtp_delivery') |
91 | ->defaultValue(false) |
92 | ->treatNullLike(false) |
93 | ->end() |
94 | ->scalarNode('smtp_host') |
95 | ->defaultValue(null) |
96 | ->end() |
97 | ->scalarNode('smtp_port') |
98 | ->defaultValue(null) |
99 | ->end() |
100 | ->scalarNode('smtp_auth') |
101 | ->defaultValue(null) |
102 | ->end() |
103 | ->scalarNode('smtp_user') |
104 | ->defaultValue(null) |
105 | ->end() |
106 | ->scalarNode('smtp_pass') |
107 | ->defaultValue(null) |
108 | ->end() |
109 | ->end() |
110 | ->end() |
111 | ->arrayNode('server') |
112 | ->children() |
113 | ->booleanNode('cookie_secure') |
114 | ->defaultValue(false) |
115 | ->treatNullLike(false) |
116 | ->end() |
117 | ->scalarNode('server_protocol') |
118 | ->defaultValue('http://') |
119 | ->cannotBeEmpty() |
120 | ->end() |
121 | ->booleanNode('force_server_vars') |
122 | ->defaultValue(false) |
123 | ->treatNullLike(false) |
124 | ->end() |
125 | ->scalarNode('server_name') |
126 | ->defaultValue('localhost') |
127 | ->cannotBeEmpty() |
128 | ->end() |
129 | ->integerNode('server_port') |
130 | ->defaultValue(80) |
131 | ->min(1) |
132 | ->end() |
133 | ->scalarNode('script_path') |
134 | ->defaultValue('/') |
135 | ->cannotBeEmpty() |
136 | ->end() |
137 | ->end() |
138 | ->end() |
139 | ->arrayNode('extensions') |
140 | ->prototype('scalar')->end() |
141 | ->defaultValue([]) |
142 | ->end() |
143 | ->end() |
144 | ; |
145 | return $treeBuilder; |
146 | } |
147 | } |