-
Notifications
You must be signed in to change notification settings - Fork 3
/
drupal-updater
executable file
·28 lines (24 loc) · 1006 Bytes
/
drupal-updater
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
#!/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 DrupalUpdater\UpdaterCommand;
$app = new Application();
$app->add(new UpdaterCommand());
$app->setDefaultCommand('update');
$app->run();