#!/usr/bin/env php
<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2004-2026 The Cacti Group                                 |
 |                                                                         |
 | 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 2          |
 | of the License, or (at your option) any later version.                  |
 +-------------------------------------------------------------------------+
 | Cacti: The Complete RRDtool-based Graphing Solution                     |
 +-------------------------------------------------------------------------+
*/

declare(strict_types = 1);

use Cacti\Console\CactiApplication;
use Cacti\Console\Input\RawArgvInput;

$root     = dirname(__DIR__);
$autoload = $root . '/include/vendor/autoload.php';

require_once $root . '/include/cli_only.php';

if (!is_file($autoload)) {
	fwrite(STDERR, "Cacti dependencies are not installed. Run composer install.\n");

	exit(1);
}

require $autoload;

$application = new CactiApplication($root);

exit($application->run(new RawArgvInput()));
