forked from Metadrop/drupal-maintenance-reporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drupal-maintenance-reporter
executable file
·33 lines (28 loc) · 1.21 KB
/
drupal-maintenance-reporter
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
#!/usr/bin/env php
<?php
// We use PWD if available because getcwd() resolves symlinks, which could take
// us outside of the Drupal root, making it impossible to find. In addition,
// is_dir() is used as the provided path may not be recognizable by PHP. For
// instance, Cygwin adds a '/cygdrive' prefix to the path which is a virtual
// directory.
$cwd = isset($_SERVER['PWD']) && is_dir($_SERVER['PWD']) ? $_SERVER['PWD'] : getcwd();
// Set up autoloader
$loader = false;
if (file_exists($autoloadFile = __DIR__ . '/vendor/autoload.php')
|| file_exists($autoloadFile = __DIR__ . '/../autoload.php')
|| file_exists($autoloadFile = __DIR__ . '/../../autoload.php')
) {
include_once($autoloadFile);
} else {
throw new \Exception("Could not locate autoload.php. cwd is $cwd; __DIR__ is " . __DIR__);
}
use Symfony\Component\Console\Application;
use DrupalMaintenanceReporter\ComposerDiffPeriodCommand;
use DrupalMaintenanceReporter\SecuritiesFixedCommand;
use DrupalMaintenanceReporter\DrupalMaintenanceReporter;
$app = new Application();
$app->add(new ComposerDiffPeriodCommand());
$app->add(new SecuritiesFixedCommand());
$app->add(new DrupalMaintenanceReporter());
$app->setDefaultCommand('report');
$app->run();