forked from dbsteward/dbsteward
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbsteward
executable file
·44 lines (40 loc) · 1.28 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
39
40
41
42
43
44
#!/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';
}
if (isset($argv[1]) && strcasecmp($argv[1], '--help') == 0) {
echo dbsteward::usage_extended();
exit(0);
}
if (!isset($argv[1]) || strlen($argv[1]) == 0) {
echo dbsteward::usage();
exit(0);
}
$dbg = new dbsteward();
$dbg->arg_parse();
}
catch (exception $e) {
echo "Unhandled exception:\n\n" . $e->getMessage() . "\n\n";
echo $e->getTraceAsString() . "\n\n";
exit(254);
}