#!/usr/bin/php
<?php declare(strict_types=1);
/**
 * This file is part of the PHP_CompatInfoDB package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author Laurent Laville
 */

// @link https://www.tomasvotruba.cz/blog/2018/08/02/5-gotchas-of-the-bin-file-in-php-cli-applications/

gc_disable(); // performance boost

require_once dirname(__DIR__) . '/autoload.php';

use Bartlett\CompatInfoDb\Application\Kernel\ConsoleKernel;

$environment = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'prod';

$kernel = new ConsoleKernel(
    $environment,
    (bool)($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $environment))
);
exit($kernel->handle());
