forked from dbsteward/dbsteward
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbsteward
executable file
·38 lines (36 loc) · 1.16 KB
/
dbsteward
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
#!/usr/bin/env php
<?php
/**
* DBSteward
* Database SQL compiler and differencing via XML definition
*
* @package DBSteward
* @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD License
* @author Nicholas J Kiraly <[email protected]>
*/
try {
// if a local relative /../lib/DBSteward is available, use that instead of the include-based path
// this is for the working copy development scenario
if ( is_readable(dirname(__FILE__) . '/../lib/DBSteward/dbsteward.php') ) {
require_once dirname(__FILE__) . '/../lib/DBSteward/dbsteward.php';
}
// build directory scenario
else if ( is_readable(dirname(__FILE__) . '/../DBSteward/dbsteward.php') ) {
require_once dirname(__FILE__) . '/../DBSteward/dbsteward.php';
}
else {
// this should be available if we are running as the PEAR installation
require_once 'DBSteward/dbsteward.php';
}
$dbg = new dbsteward();
$dbg->arg_parse($argv);
}
catch (exception $e) {
if (dbsteward::$DEBUG) {
dbsteward::error("Unhandled exception: " . $e->getMessage());
dbsteward::info($e->getTraceAsString());
} else {
dbsteward::error($e->getMessage());
}
exit(254);
}