-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.php
49 lines (40 loc) · 1.92 KB
/
cli.php
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
49
<?php
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Console\Application;
const HPDB_CRAWLER_NAME = 'hpdb-bot-m/0.1 (+https://hpdb.ru/crawler)';
$container = require __DIR__ . '/config/container.php';
$commands = [];
$command = new \App\Cli\Commands\MigrateSqliteToMongo();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
$command->setSqlite($container->get(SQLite3::class));
$commands[] = $command;
$command = new \App\Cli\Commands\ReindexHompages();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
$command->setCrawlersBus($container->get(CONTAINER_CONFIG_REDIS_STREAM_CRAWLERS));
$commands[] = $command;
$command = new \App\Cli\Commands\ExtractIndexedContent();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
$command->setProcessorBus($container->get(CONTAINER_CONFIG_REDIS_STREAM_PROCESSORS));
$commands[] = $command;
$command = new \App\Cli\Commands\AddWebsite();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
$command->setPersistorsBus($container->get(CONTAINER_CONFIG_REDIS_STREAM_PERSISTORS));
$command->setCrawlersBus($container->get(CONTAINER_CONFIG_REDIS_STREAM_CRAWLERS));
$commands[] = $command;
$command = new \App\Cli\Commands\GithubUserParser();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
$command->setPersistorsBus($container->get(CONTAINER_CONFIG_REDIS_STREAM_PERSISTORS));
$commands[] = $command;
$command = new \App\Cli\Commands\MoveWebsiteIndexDataToWebsite();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
/* remove reindexer */
$commands[] = $command;
$command = new \App\Cli\Commands\NormalizeWebsites();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
$commands[] = $command;
$command = new \App\Cli\Commands\RecalculateWebsiteReactions();
$command->setMongo($container->get(CONTAINER_CONFIG_MONGO));
$commands[] = $command;
$application = new Application();
$application->addCommands($commands);
$application->run();