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

error_reporting(~0);
gc_disable();

$found = false;
for ($i = 4; $i >= 0; $i--) {
	$file = __DIR__ . str_repeat('/..', $i) . "/vendor/autoload.php";
	if (file_exists($file)) {
		$found = true;
		require_once $file;
		break;
	}
}

if (!$found) {
	fwrite(STDERR, 'You need to setup the project dependencies using Composer' . PHP_EOL);
	die(1);
}

$app = new \Cilex\Application("SecurityScanner");
$app->command(new \PHPSecurityScanner\Command\Scan);
$app->run();

