@@ -250,18 +250,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int
250
250
}
251
251
252
252
$ output ->writeln ('' );
253
- $ output ->writeln (' > Enabling <info>maintenance mode</info> ' );
253
+ $ output ->writeln ('> Enabling <info>maintenance mode</info> ' );
254
254
$ this ->configService ->maintenanceMode (true );
255
255
$ this ->restorePointComplete ($ point );
256
256
257
257
$ this ->output ->writeln ('' );
258
258
$ this ->updateConfig ($ point );
259
259
260
260
$ output ->writeln ('> Finalization of the restoring process ' );
261
+ $ output ->writeln ('> <info>maintenance mode</info> disabled ' );
261
262
$ this ->restoreService ->finalizeFullRestore ();
262
263
263
- $ output ->writeln ('> Disabling <info>maintenance mode</info> ' );
264
- $ this ->configService ->maintenanceMode (false );
264
+ // $this->configService->maintenanceMode(false);
265
265
266
266
$ this ->activityService ->newActivity (
267
267
ActivityService::RESTORE ,
@@ -502,28 +502,25 @@ private function updateConfig(RestoringPoint $point): void {
502
502
$ configFile = rtrim ($ configRoot , '/ ' ) . '/config.php ' ;
503
503
include $ configFile ;
504
504
505
- $ updated = false ;
506
- $ this ->compareConfigDataRoot ($ CONFIG , $ dataRoot , $ updated );
507
- $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_HOST , $ updated );
508
- $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_PORT , $ updated );
509
- $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_NAME , $ updated );
510
- $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_USER , $ updated );
511
- $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_PASS , $ updated );
505
+ $ this ->compareConfigDataRoot ($ CONFIG , $ dataRoot );
506
+ $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_HOST );
507
+ $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_PORT );
508
+ $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_NAME );
509
+ $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_USER );
510
+ $ this ->compareConfigSqlParams ($ sqlParams , $ CONFIG , ISqlDump::DB_PASS );
512
511
513
- if ($ updated ) {
514
- $ this ->output ->writeln (' > Updating <info>config.php</info> ' );
515
- $ this ->output ->writeln ('' );
516
- file_put_contents ($ configFile , '<?php ' . "\n" . '$CONFIG = ' . var_export ($ CONFIG , true ) . '; ' );
517
- }
512
+ $ CONFIG ['maintenance ' ] = false ;
513
+ $ this ->output ->writeln (' > Updating <info>config.php</info> ' );
514
+ $ this ->output ->writeln ('' );
515
+ file_put_contents ($ configFile , '<?php ' . "\n" . '$CONFIG = ' . var_export ($ CONFIG , true ) . '; ' );
518
516
}
519
517
520
518
521
519
/**
522
520
* @param array $CONFIG
523
521
* @param string $used
524
- * @param bool $updated
525
522
*/
526
- private function compareConfigDataRoot (array &$ CONFIG , string $ used, bool & $ updated ): void {
523
+ private function compareConfigDataRoot (array &$ CONFIG , string $ used ): void {
527
524
$ fromConfig = rtrim ($ this ->get (ConfigService::DATA_DIRECTORY , $ CONFIG ), '/ ' ) . '/ ' ;
528
525
529
526
if ($ fromConfig !== $ used ) {
@@ -544,7 +541,6 @@ private function compareConfigDataRoot(array &$CONFIG, string $used, bool &$upda
544
541
$ helper = $ this ->getHelper ('question ' );
545
542
if ($ helper ->ask ($ this ->input , $ this ->output , $ question )) {
546
543
$ CONFIG [ConfigService::DATA_DIRECTORY ] = $ used ;
547
- $ updated = true ;
548
544
}
549
545
}
550
546
}
@@ -554,14 +550,8 @@ private function compareConfigDataRoot(array &$CONFIG, string $used, bool &$upda
554
550
* @param array $sqlParams
555
551
* @param array $CONFIG
556
552
* @param string $key
557
- * @param bool $updated
558
553
*/
559
- private function compareConfigSqlParams (
560
- array $ sqlParams ,
561
- array &$ CONFIG ,
562
- string $ key ,
563
- bool &$ updated
564
- ): void {
554
+ private function compareConfigSqlParams (array $ sqlParams , array &$ CONFIG , string $ key ): void {
565
555
$ fromConfig = $ this ->get ($ key , $ CONFIG );
566
556
$ used = $ this ->get ($ key , $ sqlParams );
567
557
if ($ used !== $ fromConfig ) {
@@ -591,7 +581,6 @@ private function compareConfigSqlParams(
591
581
$ helper = $ this ->getHelper ('question ' );
592
582
if ($ helper ->ask ($ this ->input , $ this ->output , $ question )) {
593
583
$ CONFIG [$ key ] = $ used ;
594
- $ updated = true ;
595
584
}
596
585
}
597
586
}
0 commit comments