mirror of
https://github.com/zeropingheroes/lancache-autofill
synced 2024-11-21 15:13:04 +00:00
1a8ceb1ad5
Old: Illuminate\Console\Application New: Illuminate\Foundation\Application To allow for loading of service providers
49 lines
1.3 KiB
PHP
Executable file
49 lines
1.3 KiB
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
|
|
use Dotenv\Dotenv;
|
|
use Illuminate\Database\Capsule\Manager as Capsule;
|
|
use Symfony\Component\Console\Input\ArgvInput;
|
|
use Symfony\Component\Console\Output\ConsoleOutput;
|
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
|
|
// Load environment variables
|
|
$dotenv = new Dotenv(__DIR__);
|
|
$dotenv->load();
|
|
$dotenv->required(['DOWNLOADS_DIRECTORY', 'STEAMCMD_PATH']);
|
|
|
|
// Create the application
|
|
$app = new Illuminate\Foundation\Application(realpath(__DIR__));
|
|
|
|
// Register the console kernel
|
|
$app->singleton(
|
|
Illuminate\Contracts\Console\Kernel::class,
|
|
Zeropingheroes\LancacheAutofill\Console\Kernel::class
|
|
);
|
|
|
|
// Register the exception handler
|
|
$app->singleton(
|
|
Illuminate\Contracts\Debug\ExceptionHandler::class,
|
|
Zeropingheroes\LancacheAutofill\Exceptions\Handler::class
|
|
);
|
|
|
|
// Set up the SQLite database connection
|
|
$capsule = new Capsule;
|
|
$capsule->addConnection([
|
|
'driver' => 'sqlite',
|
|
'database' => 'database.sqlite',
|
|
]);
|
|
$capsule->setAsGlobal();
|
|
$capsule->bootEloquent();
|
|
|
|
// Run the console application
|
|
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
|
$status = $kernel->handle(
|
|
$input = new ArgvInput,
|
|
new ConsoleOutput
|
|
);
|
|
|
|
// Send output to the console once finished
|
|
$kernel->terminate($input, $status);
|
|
exit($status);
|