-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmigrate
40 lines (33 loc) · 911 Bytes
/
migrate
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
#!/usr/bin/env php
<?php
/**
* @author jan huang <[email protected]>
* @copyright 2016
*
* @see https://www.github.com/janhuang
* @see http://www.fast-d.cn/
*/
use FastD\Migration\Migrator;
set_time_limit(0);
date_default_timezone_set('PRC');
// autoload composer
foreach ([
__DIR__ . '/../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/vendor/autoload.php'
] as $value) {
if (file_exists($value)) {
define('COMPOSER_INSTALL', $value);
break;
}
}
if (!defined('COMPOSER_INSTALL')) {
fwrite(STDERR,
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'wget http://getcomposer.org/composer.phar' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
}
include COMPOSER_INSTALL;
$migrator = new Migrator();
$migrator->run();