-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSiteStatusCommands.php
62 lines (53 loc) · 1.43 KB
/
SiteStatusCommands.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
61
62
<?php
namespace Drupal\va_gov_build_trigger\Commands;
use Drupal\va_gov_build_trigger\SiteStatus\SiteStatusInterface;
use Drush\Commands\DrushCommands;
/**
* A Drush interface to the Site Status service.
*/
class SiteStatusCommands extends DrushCommands {
/**
* The Site Status service.
*
* @var \Drupal\va_gov_build_trigger\SiteStatus\SiteStatusInterface
*/
protected $siteStatus;
/**
* Constructor.
*
* @param \Drupal\va_gov_build_trigger\SiteStatus\SiteStatusInterface $siteStatus
* The site status service.
*/
public function __construct(SiteStatusInterface $siteStatus) {
$this->siteStatus = $siteStatus;
}
/**
* Get the deploy mode.
*
* @command va-gov:get-deploy-mode
* @aliases va-gov-get-deploy-mode
*/
public function getDeployMode() {
echo ($this->siteStatus->inDeployMode() ? 'ENABLED' : 'DISABLED') . PHP_EOL;
}
/**
* Enable the deploy mode.
*
* @command va-gov:enable-deploy-mode
* @aliases va-gov-enable-deploy-mode
*/
public function enableDeployMode() {
$this->siteStatus->enableDeployMode();
$this->logger->success(dt('Deploy mode has been enabled.'));
}
/**
* Disable the deploy mode.
*
* @command va-gov:disable-deploy-mode
* @aliases va-gov-disable-deploy-mode
*/
public function disableDeployMode() {
$this->siteStatus->disableDeployMode();
$this->logger->success(dt('Deploy mode has been disabled.'));
}
}