@@ -422,18 +422,7 @@ public function installDeploymentConfig($data)
422
422
$ userData = is_array ($ data ) ? $ data : $ data ->getArrayCopy ();
423
423
424
424
// TODO: remove this when moving install command to symfony
425
- if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_SESSION_SAVE ])) {
426
- $ userData [ConfigOptionsList::INPUT_KEY_SESSION_SAVE ] = ConfigOptionsList::SESSION_SAVE_FILES ;
427
- }
428
- if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_DB_PASS ])) {
429
- $ userData [ConfigOptionsList::INPUT_KEY_DB_PASS ] = '' ;
430
- }
431
- if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_DB_MODEL ])) {
432
- $ userData [ConfigOptionsList::INPUT_KEY_DB_MODEL ] = 'mysql4 ' ;
433
- }
434
- if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_DB_INIT_STATEMENTS ])) {
435
- $ userData [ConfigOptionsList::INPUT_KEY_DB_INIT_STATEMENTS ] = 'SET NAMES utf8; ' ;
436
- }
425
+ $ userData = $ this ->setDefaultValues ($ userData );
437
426
438
427
$ this ->setupConfigModel ->process ($ userData );
439
428
@@ -447,6 +436,29 @@ public function installDeploymentConfig($data)
447
436
$ this ->objectManagerProvider ->reset ();
448
437
}
449
438
439
+
440
+ /**
441
+ * Sets defaults if user input is missing
442
+ *
443
+ * @param array $userData
444
+ * @return array
445
+ */
446
+ private function setDefaultValues (array $ userData )
447
+ {
448
+ if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_SESSION_SAVE ])) {
449
+ $ userData [ConfigOptionsList::INPUT_KEY_SESSION_SAVE ] = ConfigOptionsList::SESSION_SAVE_FILES ;
450
+ }
451
+ if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_DB_PASS ])) {
452
+ $ userData [ConfigOptionsList::INPUT_KEY_DB_PASS ] = '' ;
453
+ }
454
+ if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_DB_MODEL ])) {
455
+ $ userData [ConfigOptionsList::INPUT_KEY_DB_MODEL ] = 'mysql4 ' ;
456
+ }
457
+ if (!isset ($ userData [ConfigOptionsList::INPUT_KEY_DB_INIT_STATEMENTS ])) {
458
+ $ userData [ConfigOptionsList::INPUT_KEY_DB_INIT_STATEMENTS ] = 'SET NAMES utf8; ' ;
459
+ }
460
+ return $ userData ;
461
+ }
450
462
/**
451
463
* Set up setup_module table to register modules' versions, skip this process if it already exists
452
464
*
0 commit comments