Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 113
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
installer_configuration
0.00% covered (danger)
0.00%
0 / 113
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getConfigTreeBuilder
0.00% covered (danger)
0.00%
0 / 113
0.00% covered (danger)
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
14namespace phpbb\install;
15
16use Symfony\Component\Config\Definition\Builder\TreeBuilder;
17use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19class 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_user')
101                            ->defaultValue(null)
102                            ->end()
103                        ->scalarNode('smtp_pass')
104                            ->defaultValue(null)
105                            ->end()
106                    ->end()
107                ->end()
108                ->arrayNode('server')
109                    ->children()
110                        ->booleanNode('cookie_secure')
111                            ->defaultValue(false)
112                            ->treatNullLike(false)
113                            ->end()
114                        ->scalarNode('server_protocol')
115                            ->defaultValue('http://')
116                            ->cannotBeEmpty()
117                            ->end()
118                        ->booleanNode('force_server_vars')
119                            ->defaultValue(false)
120                            ->treatNullLike(false)
121                            ->end()
122                        ->scalarNode('server_name')
123                            ->defaultValue('localhost')
124                            ->cannotBeEmpty()
125                            ->end()
126                        ->integerNode('server_port')
127                            ->defaultValue(80)
128                            ->min(1)
129                            ->end()
130                        ->scalarNode('script_path')
131                            ->defaultValue('/')
132                            ->cannotBeEmpty()
133                            ->end()
134                    ->end()
135                ->end()
136                ->arrayNode('extensions')
137                    ->prototype('scalar')->end()
138                    ->defaultValue([])
139                ->end()
140            ->end()
141        ;
142        return $treeBuilder;
143    }
144}