forked from acquia/blt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetupWizard.php
60 lines (55 loc) · 1.61 KB
/
SetupWizard.php
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
<?php
namespace Acquia\Blt\Robo\Wizards;
/**
* Class SetupWizard.
*
* @package Acquia\Blt\Robo\Wizards
*/
class SetupWizard extends Wizard {
/**
* Wizard for generating setup files.
*
* Executes blt setup:settings command.
*/
public function wizardGenerateSettingsFiles() {
$missing = FALSE;
if (!$this->getInspector()->isDrupalLocalSettingsFilePresent()) {
$this->logger->warning("<comment>{$this->getConfigValue('drupal.local_settings_file')}</comment> is missing.");
$missing = TRUE;
}
elseif (!$this->getInspector()->isHashSaltPresent()) {
$this->logger->warning("<comment>salt.txt</comment> is missing.");
$missing = TRUE;
}
if ($missing) {
$confirm = $this->confirm("Do you want to generate this required settings file(s)?");
if ($confirm) {
$bin = $this->getConfigValue('composer.bin');
$this->executor
->execute("$bin/blt setup:settings")->printOutput(TRUE)->run();
}
}
}
/**
* Wizard for installing Drupal.
*
* Executes blt setup:drupal:install.
*/
public function wizardInstallDrupal() {
if (!$this->getInspector()->isMySqlAvailable()) {
return FALSE;
}
if (!$this->getInspector()->isDrupalInstalled()) {
$this->logger->warning('Drupal is not installed.');
$confirm = $this->confirm("Do you want to install Drupal?");
if ($confirm) {
$bin = $this->getConfigValue('composer.bin');
$this->executor
->execute("$bin/blt setup")
->detectInteractive()
->run();
$this->getInspector()->clearState();
}
}
}
}