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

/* Copyright (C) 2022 Manticore Software Ltd
 * You may use, distribute and modify this code under the
 * terms of the AGPLv3 license.
 *
 * You can find a copy of the AGPLv3 license here
 * https://www.gnu.org/licenses/agpl-3.0.txt
 */

$cwd = getcwd();

require_once('core/helpers.php');
require_once('core/engine.php');
require_once('core/EsCompatible.php');
$files = glob(__DIR__ . '/plugins/*.php');
foreach ($files as $file) require($file);

engine::init($cwd);
engine::parseCommandLineArguments();
engine::sanitize();

if (engine::$mode == 'save') {
    $results = engine::saveResultsFromPath(engine::$commandLineArguments['save']);
} else if (engine::$mode == 'test') engine::test($cwd);
