forked from brtriver/dbup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbup
More file actions
31 lines (26 loc) · 970 Bytes
/
Copy pathdbup
File metadata and controls
31 lines (26 loc) · 970 Bytes
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
#!/usr/bin/env php
<?php
// bin/dbup
$candidateAutoloaders = [
__DIR__ . '/vendor/autoload.php', // This file is placed on the Dbup root
__DIR__ . '/../../autoload.php', // This file is placed on the vendor/brtriver/dbup by Composer (symlinked)
__DIR__ . '/../autoload.php', // This file is placed on the vendor/bin by Composer (hard-copied)
];
$autoloaderPath = '';
foreach ($candidateAutoloaders as $candidate) {
if (is_file($candidate)) {
$autoloaderPath = $candidate;
break;
}
}
if (!$autoloaderPath) {
trigger_error('Any autoloaders cannot be detected', E_USER_ERROR);
}
require_once $autoloaderPath;
$application = new \Dbup\Application();
$application->add(new \Dbup\Command\InitCommand);
$application->add(new \Dbup\Command\StatusCommand);
$application->add(new \Dbup\Command\UpCommand);
$application->add(new \Dbup\Command\CompileCommand);
$application->add(new \Dbup\Command\CreateCommand);
$application->run();