initial version

This commit is contained in:
Robin Appelman 2017-08-08 13:34:56 +02:00
commit 8b64b8c31c
8 changed files with 463 additions and 0 deletions

23
migrate.php Normal file
View file

@ -0,0 +1,23 @@
<?php declare(strict_types=1);
require 'vendor/autoload.php';
if (!getenv('STORAGE_ROOT')) {
$env = new \Dotenv\Dotenv(__DIR__);
$env->load();
}
$store = new \Demostf\Migrate\Store(getenv('STORAGE_ROOT'), getenv('BASE_URL'));
$api = new \Demostf\Migrate\Api(getenv('SOURCE'));
$migrate = new \Demostf\Migrate\Migrate($api, $store, getenv('BACKEND'), getenv('KEY'));
$statePath = getenv('STATE_FILE');
$fromDate = new DateTime('-2 month');
$list = $api->listDemos(1, 'ASC', 'static');
foreach ($list as $demo) {
if ($demo['time'] < $fromDate) {
echo "${demo['id']}\n";
$migrate->migrateDemo($demo);
}
}