mirror of
https://github.com/demostf/migrate.git
synced 2026-06-03 17:24:10 +02:00
initial version
This commit is contained in:
commit
8b64b8c31c
8 changed files with 463 additions and 0 deletions
23
migrate.php
Normal file
23
migrate.php
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue