<?php
/*
    Condorcet PHP - Election manager and results calculator.
    Designed for the Condorcet method. Integrating a large number of algorithms extending Condorcet. Expandable for all types of voting systems.

    By Julien Boudry and contributors - MIT LICENSE (Please read LICENSE.txt)
    https://github.com/julien-boudry/Condorcet
*/
declare(strict_types=1);

use CondorcetPHP\Condorcet\Console\CondorcetApplication;

$composer_autoload_path = __DIR__ . '/../vendor/autoload.php';

$loaded = false;
foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require $file;
        $loaded = true;
        break;
    }
}

if (!$loaded) {
    exit(
        'You need to set up the project dependencies using the following commands:' . \PHP_EOL .
        'wget http://getcomposer.org/composer.phar' . \PHP_EOL .
        'php composer.phar install' . \PHP_EOL
    );
}

CondorcetApplication::run();
