-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfiguration_parameters.yaml
360 lines (360 loc) · 18.9 KB
/
configuration_parameters.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
questions:
-
uuid: 1eebf878-8b97-61c4-b7c2-99d84c92580c
question: 'What are the correct ways to parse the 1983-07-01 date into an DateTime object?'
answers:
- { value: "Yaml::parse('1983-07-01', 32)", correct: false }
- { value: "Yaml::parse('1983-07-01', Yaml::PARSE_DATETIME)", correct: true }
- { value: "Yaml::parse('1983-07-01', true)", correct: false }
- { value: "Yaml::parse('1983-07-01', false)", correct: false }
- { value: "Yaml::parse('1983-07-01')", correct: true }
- { value: "Yaml::parse('1983-07-01', Yaml::DATETIME)", correct: false }
help: 'https://symfony.com/doc/current/components/yaml.html#date-handling'
-
uuid: 1eebf878-8b98-6c4a-af97-99d84c92580c
question: 'Which methods don''t belong to Symfony\Component\Config\Definition\Builder\ExprBuilder?'
answers:
- { value: else, correct: true }
- { value: ifInteger, correct: true }
- { value: thenSet, correct: true }
- { value: thenValid, correct: true }
- { value: ifEmpty, correct: true }
- { value: ifArray, correct: false }
- { value: then, correct: false }
- { value: ifString, correct: false }
help: 'https://symfony.com/doc/current/components/config/definition.html#validation-rules'
-
uuid: 1eebf878-8b9d-6556-bb01-99d84c92580c
question: 'Which of the following are validation rules provided by Symfony\Component\Config\Definition\Builder\ExprBuilder?'
answers:
- { value: ifInArray(), correct: true }
- { value: ifString(), correct: true }
- { value: ifNull(), correct: true }
- { value: ifArray(), correct: true }
- { value: always(), correct: true }
- { value: ifTrue(), correct: true }
- { value: never(), correct: false }
- { value: ifNotNull(), correct: false }
- { value: ifNotInArray(), correct: true }
help: 'https://symfony.com/doc/current/components/config/definition.html#validation-rules'
-
uuid: 1eebf878-8b9e-6e60-b63b-99d84c92580c
question: 'Which of these configuration node types are available?'
answers:
- { value: scalar, correct: true }
- { value: array, correct: true }
- { value: enum, correct: true }
- { value: string, correct: false }
help: 'https://symfony.com/doc/current/components/config/definition.html#node-type'
-
uuid: 1eebf878-8b9e-6eb0-9f6e-99d84c92580c
question: 'Which of these methods are existing?'
answers:
- { value: useAttributeAsKey(), correct: true }
- { value: isRequired(), correct: true }
- { value: cannotBeEmpty(), correct: true }
- { value: setDefaultValue(), correct: false }
- { value: setValidation(), correct: false }
help: 'https://symfony.com/doc/current/components/config/definition.html'
-
uuid: 1eebf878-8b9e-6f00-8f11-99d84c92580c
question: 'Which class is used to define hierarchy of configuration values?'
answers:
- { value: Symfony\Component\Config\Definition\Builder\TreeBuilder, correct: true }
- { value: Symfony\Component\Config\Definition\Builder\HierarchyBuilder, correct: false }
- { value: Symfony\Component\Config\Definition\Builder\NodeBuilder, correct: false }
- { value: Symfony\Component\Config\Definition\Builder\Builder, correct: false }
help: 'https://symfony.com/doc/current/components/config/definition.html#defining-a-hierarchy-of-configuration-values-using-the-treebuilder'
-
uuid: 1eebf878-8ba1-6a98-afae-99d84c92580c
question: 'Which of the following values are available to define a null element in YAML ?'
answers:
- { value: '-', correct: false }
- { value: 'null', correct: true }
- { value: '~', correct: true }
- { value: 'false', correct: false }
help: 'https://symfony.com/doc/current/components/yaml/yaml_format.html#nulls'
-
uuid: 1eebf878-8ba2-634e-8082-99d84c92580c
question: "Is the following code valid?$value = Yaml::parse(file_get_contents('/path/to/file.yml'));"
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/current/components/yaml/introduction.html#reading-yaml-files'
-
uuid: 1eebf878-8ba2-6b14-854d-99d84c92580c
question: 'Given a deprecated service, does using the %service_id% placeholder required in the deprecation message?'
answers:
- { value: 'No', correct: false }
- { value: 'Yes', correct: true }
help: 'https://symfony.com/doc/current/service_container/alias_private.html#deprecating-services'
-
uuid: 1eebf878-8ba3-610e-89e4-99d84c92580c
question: 'What is the purpose of the logging: true option in the translator config?'
answers:
- { value: 'Log a message when the given local is not configured.', correct: false }
- { value: 'Log a message when Symfony translate a string in the given locale.', correct: false }
- { value: 'Translate all log messages in the default locale.', correct: false }
- { value: "Log a message when Symfony doesn't find a translation for the given locale.", correct: true }
help: 'https://symfony.com/doc/current/reference/configuration/framework.html#logging'
-
uuid: 1eebf878-8ba3-6406-a1e6-99d84c92580c
question: 'What is the 2nd argument of Symfony\Component\Config\ConfigCacheFactory::cache method ?'
answers:
- { value: 'A boolean to set the debug mode', correct: false }
- { value: 'An array of options', correct: false }
- { value: 'A callback executed if the cache has to be refreshed', correct: true }
- { value: 'The resource filename', correct: false }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/Config/ConfigCacheFactory.php'
-
uuid: 1ef80078-f45b-64da-8d99-253d4466d548
question: 'In which file is the APP_ENV variable defined to choose the active environment for the application in Symfony?'
answers:
- { value: config/packages/framework.yaml, correct: false }
- { value: .env, correct: true }
- { value: services.yaml, correct: false }
- { value: composer.json, correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef8007c-6a77-6666-acda-f97fd898b2ef
question: 'What is the command to run a Symfony task in a specific environment without modifying the .env file?'
answers:
- { value: 'php bin/console --env=prod <command>', correct: false }
- { value: 'APP_ENV=prod php bin/console <command>', correct: true }
- { value: 'php bin/console env:prod <command>', correct: false }
- { value: 'php bin/console set-env prod', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef8007f-1f7a-6606-9139-fd4c956a4883
question: 'What syntax is used to reference an environment variable in a YAML configuration file?'
answers:
- { value: '%env(VAR_NAME)%', correct: true }
- { value: '${VAR_NAME}', correct: false }
- { value: '{{ env(VAR_NAME) }}', correct: false }
- { value: '#env(VAR_NAME)#', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef80081-4f13-63a2-98e6-8390f97f5219
question: 'If an environment variable is not defined, how can you specify a default value in a YAML file?'
answers:
- { value: 'Use env_default(VAR_NAME)', correct: true }
- { value: 'Add a comment in the YAML file', correct: false }
- { value: "Use the syntax env(VAR_NAME): 'default_value", correct: false }
- { value: "it's impossible", correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef80083-fdc1-6582-9335-8bef89e3c7cf
question: 'Where should you store environment variables that are specific to the local machine?'
answers:
- { value: .env, correct: false }
- { value: .env.local, correct: true }
- { value: .env.test, correct: false }
- { value: services.yaml, correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef800ab-a2bc-6128-be2b-511459a79806
question: 'Which command improves performance in production by generating a .env.local.php file for environment variables?'
answers:
- { value: 'composer dump-env prod', correct: true }
- { value: 'php bin/console env:dump', correct: false }
- { value: 'php bin/console cache:clear', correct: false }
- { value: 'php bin/console debug:dotenv', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuring-environment-variables-in-production'
-
uuid: 1ef800b1-26f6-6af6-9606-5f6d32804220
question: 'How do you define a boolean parameter in Symfony?'
answers:
- { value: "app.enable_feature: 'true'", correct: false }
- { value: 'app.enable_feature: true', correct: true }
- { value: "app.enable_feature: '1'", correct: false }
- { value: 'app.enable_feature: 1', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800b3-83c5-66cc-9f57-0dd23eb3ffa6
question: 'Which of the following is a correct way to define an array parameter?'
answers:
- { value: "app.supported_locales: 'en, es, fr'", correct: false }
- { value: "app.supported_locales: ['en', 'es', 'fr']", correct: true }
- { value: 'app.supported_locales: en, es, fr', correct: false }
- { value: 'app.supported_locales: {en, es, fr}', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800b7-4d9d-6e06-8aa3-e1c5a7eff6e4
question: 'How do you define a binary content parameter in Symfony?'
answers:
- { value: "app.binary_data: 'VGhpcyBpcyBhIEJlbGwgY2hhciAH'", correct: false }
- { value: 'app.binary_data: !!binary VGhpcyBpcyBhIEJlbGwgY2hhciAH', correct: false }
- { value: 'app.binary_data: !binary VGhpcyBpcyBhIEJlbGwgY2hhciAH', correct: true }
- { value: 'app.binary_data: binary:VGhpcyBpcyBhIEJlbGwgY2hhciAH', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800ba-c8df-6d82-a0bb-353743b6c517
question: 'What syntax is used to reference a parameter in configuration files?'
answers:
- { value: '${app.admin_email}', correct: false }
- { value: app.admin_email, correct: false }
- { value: '%app.admin_email%', correct: true }
- { value: '@app.admin_email@', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800be-d38d-6744-9d0d-7339978c8ff1
question: 'Which of the following is true about parameters starting with a dot (.)?'
answers:
- { value: 'They are available at runtime', correct: false }
- { value: 'They are available only during container compilation', correct: true }
- { value: 'They are ignored by Symfony', correct: false }
- { value: 'They are used for database connections', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800c4-0054-6f66-bfd3-779efb0c4390
question: 'Which symbol indicates that a parameter is a PHP constant in symfony parameters ?'
answers:
- { value: '!php/const', correct: true }
- { value: php/const, correct: false }
- { value: '@php/const', correct: false }
- { value: '#php/const', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800c6-fad9-6264-a183-47b81c8e8cc0
question: 'How can you access configuration parameters in Symfony controllers?'
answers:
- { value: 'By using the ParameterBagInterface', correct: true }
- { value: 'By using the Configurator class', correct: false }
- { value: 'By importing the parameters directly', correct: false }
- { value: 'By using the Service Locator pattern', correct: false }
help: 'https://symfony.com/blog/new-in-symfony-4-1-getting-container-parameters-as-a-service'
-
uuid: 1ef800d7-2fdf-6c5a-9de8-af45c8f65cf4
question: 'If a parameter value includes the % character, how should it be written to escape it?'
answers:
- { value: '%%', correct: true }
- { value: '%%%', correct: false }
- { value: '%', correct: false }
- { value: $%, correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef80078-f45b-64da-8d99-253d4466d548
question: 'In which file is the APP_ENV variable defined to choose the active environment for the application in Symfony?'
answers:
- { value: config/packages/framework.yaml, correct: false }
- { value: .env, correct: true }
- { value: services.yaml, correct: false }
- { value: composer.json, correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef8007c-6a77-6666-acda-f97fd898b2ef
question: 'What is the command to run a Symfony task in a specific environment without modifying the .env file?'
answers:
- { value: 'php bin/console --env=prod <command>', correct: false }
- { value: 'APP_ENV=prod php bin/console <command>', correct: true }
- { value: 'php bin/console env:prod <command>', correct: false }
- { value: 'php bin/console set-env prod', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef8007f-1f7a-6606-9139-fd4c956a4883
question: 'What syntax is used to reference an environment variable in a YAML configuration file?'
answers:
- { value: '%env(VAR_NAME)%', correct: true }
- { value: '${VAR_NAME}', correct: false }
- { value: '{{ env(VAR_NAME) }}', correct: false }
- { value: '#env(VAR_NAME)#', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef80081-4f13-63a2-98e6-8390f97f5219
question: 'If an environment variable is not defined, how can you specify a default value in a YAML file?'
answers:
- { value: 'Use env_default(VAR_NAME)', correct: true }
- { value: 'Add a comment in the YAML file', correct: false }
- { value: "Use the syntax env(VAR_NAME): 'default_value", correct: false }
- { value: "it's impossible", correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef80083-fdc1-6582-9335-8bef89e3c7cf
question: 'Where should you store environment variables that are specific to the local machine?'
answers:
- { value: '.env', correct: false }
- { value: '.env.local', correct: true }
- { value: '.env.test', correct: false }
- { value: 'services.yaml', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html'
-
uuid: 1ef800ab-a2bc-6128-be2b-511459a79806
question: 'Which command improves performance in production by generating a .env.local.php file for environment variables?'
answers:
- { value: 'composer dump-env prod', correct: true }
- { value: 'php bin/console env:dump', correct: false }
- { value: 'php bin/console cache:clear', correct: false }
- { value: 'php bin/console debug:dotenv', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuring-environment-variables-in-production'
-
uuid: 1ef800b1-26f6-6af6-9606-5f6d32804220
question: 'How do you define a boolean parameter in Symfony?'
answers:
- { value: "app.enable_feature: 'true'", correct: false }
- { value: 'app.enable_feature: true', correct: true }
- { value: "app.enable_feature: '1'", correct: false }
- { value: 'app.enable_feature: 1', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800b3-83c5-66cc-9f57-0dd23eb3ffa6
question: 'Which of the following is a correct way to define an array parameter?'
answers:
- { value: "app.supported_locales: 'en, es, fr'", correct: false }
- { value: "app.supported_locales: ['en', 'es', 'fr']", correct: true }
- { value: 'app.supported_locales: en, es, fr', correct: false }
- { value: 'app.supported_locales: {en, es, fr}', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800b7-4d9d-6e06-8aa3-e1c5a7eff6e4
question: 'How do you define a binary content parameter in Symfony?'
answers:
- { value: "app.binary_data: 'VGhpcyBpcyBhIEJlbGwgY2hhciAH'", correct: false }
- { value: 'app.binary_data: !!binary VGhpcyBpcyBhIEJlbGwgY2hhciAH', correct: false }
- { value: 'app.binary_data: !binary VGhpcyBpcyBhIEJlbGwgY2hhciAH', correct: true }
- { value: 'app.binary_data: binary:VGhpcyBpcyBhIEJlbGwgY2hhciAH', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800ba-c8df-6d82-a0bb-353743b6c517
question: 'What syntax is used to reference a parameter in configuration files?'
answers:
- { value: '${app.admin_email}', correct: false }
- { value: '&app.admin_email', correct: false }
- { value: '%app.admin_email%', correct: true }
- { value: '@app.admin_email@', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800be-d38d-6744-9d0d-7339978c8ff1
question: 'Which of the following is true about parameters starting with a dot (.)?'
answers:
- { value: 'They are available at runtime', correct: false }
- { value: 'They are available only during container compilation', correct: true }
- { value: 'They are ignored by Symfony', correct: false }
- { value: 'They are used for database connections', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800c4-0054-6f66-bfd3-779efb0c4390
question: 'Which symbol indicates that a parameter is a PHP constant in symfony parameters ?'
answers:
- { value: '!php/const', correct: true }
- { value: '&php/const', correct: false }
- { value: '@php/const', correct: false }
- { value: '#php/const', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'
-
uuid: 1ef800c6-fad9-6264-a183-47b81c8e8cc0
question: 'How can you access configuration parameters in Symfony controllers?'
answers:
- { value: 'By using the ParameterBagInterface', correct: true }
- { value: 'By using the Configurator class', correct: false }
- { value: 'By importing the parameters directly', correct: false }
- { value: 'By using the Service Locator pattern', correct: false }
help: 'https://symfony.com/blog/new-in-symfony-4-1-getting-container-parameters-as-a-service'
-
uuid: 1ef800d7-2fdf-6c5a-9de8-af45c8f65cf4
question: 'If a parameter value includes the % character, how should it be written to escape it?'
answers:
- { value: '%%', correct: true }
- { value: '%%%', correct: false }
- { value: '%', correct: false }
- { value: '$%', correct: false }
help: 'https://symfony.com/doc/7.0/configuration.html#configuration-parameters'