<?php 

	require_once("__system__/autoloader.php");

	try{
		$file = "scripts/{$argv[1]}";

		if (preg_match("/[.php]$/", $file) == 0) {
			$file .= ".php";
		}

		if (file_exists(__DIR__."/".$file)) {
			require_once($file);
		}
		else{
			echo "The '{$file}' file does not exist. \n";
		}
	}
	catch (Throwable $e) {
		if (LOGS == true) {
			create_log($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
		}

		if (DEBUG == true) {
			echo "\n
				ERROR IN FILE: '{$file}'\n
				--\n
				CODE: {$e->getCode()}\n
				MESSAGE: {$e->getMessage()}\n
				FILE: {$e->getFile()}\n
				LINE: {$e->getLine()}\n
			";
		}
	}

?>