mirror of
https://github.com/Sysbot-org/tgscraper.git
synced 2024-12-04 17:22:53 +01:00
33 lines
753 B
PHP
33 lines
753 B
PHP
#!/usr/bin/env php
|
|
<?php
|
|
|
|
use Composer\InstalledVersions;
|
|
use Symfony\Component\Console\Application;
|
|
use TgScraper\Commands\CreateStubsCommand;
|
|
use TgScraper\Commands\ExportSchemaCommand;
|
|
|
|
$autoloadFiles = [
|
|
__DIR__ . '/../vendor/autoload.php',
|
|
__DIR__ . '/../../../autoload.php'
|
|
];
|
|
|
|
foreach ($autoloadFiles as $autoloadFile) {
|
|
if (file_exists($autoloadFile)) {
|
|
require_once $autoloadFile;
|
|
break;
|
|
}
|
|
}
|
|
|
|
$application = new Application('TGScraper', InstalledVersions::getVersion('sysbot/tgscraper'));
|
|
|
|
$application->add(new CreateStubsCommand());
|
|
$application->add(new ExportSchemaCommand());
|
|
|
|
try {
|
|
$exitCode = $application->run();
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage() . PHP_EOL;
|
|
}
|
|
|
|
exit($exitCode ?? 1);
|