-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathdbdiff
More file actions
executable file
·48 lines (41 loc) · 1.61 KB
/
dbdiff
File metadata and controls
executable file
·48 lines (41 loc) · 1.61 KB
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
45
46
47
48
#!/usr/bin/env php
<?php
// Set a generous default memory limit for the CLI. Diffing large databases can
// pull substantial result sets into memory. PHP's default of 128M is often too
// low. This value is intentionally applied here (in the CLI entry point) rather
// than inside the library, so library consumers are never surprised.
// Override per-run via --memory-limit=<value> or memory_limit: <value> in your
// .dbdiff / dbdiff.yml config file.
ini_set('memory_limit', '1G');
if (file_exists(__DIR__ . '/../../autoload.php')) {
require __DIR__ . '/../../autoload.php';
} else {
require __DIR__ . '/vendor/autoload.php';
}
use DBDiff\Migration\Command\DiffCommand;
use DBDiff\Migration\Command\MigrationNewCommand;
use DBDiff\Migration\Command\MigrationUpCommand;
use DBDiff\Migration\Command\MigrationDownCommand;
use DBDiff\Migration\Command\MigrationStatusCommand;
use DBDiff\Migration\Command\MigrationValidateCommand;
use DBDiff\Migration\Command\MigrationRepairCommand;
use DBDiff\Migration\Command\MigrationBaselineCommand;
use DBDiff\Migration\Command\UrlEncodeCommand;
use Symfony\Component\Console\Application;
$app = new Application('DBDiff', '2.0.0');
$app->addCommands([
new DiffCommand,
new MigrationNewCommand,
new MigrationUpCommand,
new MigrationDownCommand,
new MigrationStatusCommand,
new MigrationValidateCommand,
new MigrationRepairCommand,
new MigrationBaselineCommand,
new UrlEncodeCommand,
]);
// `diff` is the default so that the legacy invocation
// dbdiff server1.db1:server2.db2
// continues to work unchanged.
$app->setDefaultCommand('diff');
$app->run();