#!/usr/bin/env php
<?php

declare(strict_types=1);

/*
 * This file is part of the Composer package "eliashaeussler/cpanel-requests".
 *
 * Copyright (C) 2022 Elias Häußler <elias@haeussler.dev>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 */

foreach ([__DIR__.'/../../../autoload.php', __DIR__.'/../../vendor/autoload.php', __DIR__.'/../vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require_once $file;
        break;
    }
}
if (!class_exists('Composer\\Autoload\\ClassLoader')) {
    throw new \RuntimeException('Could not locate Composer autoloader.', 1593550498);
}

use EliasHaeussler\CpanelRequests\Command\CleanupCookiesCommand;
use EliasHaeussler\CpanelRequests\Command\CleanupLogsCommand;
use Symfony\Component\Console\Application;

// Create application
$app = new Application('cPanel Requests console');

// Register commands
$app->add(new CleanupCookiesCommand());
$app->add(new CleanupLogsCommand());

// Run application
$exitCode = $app->run();

exit($exitCode);
