<?php
use BitSensor\Core\BitSensor;
use BitSensor\Core\Config;
use BitSensor\Core\SessionContext;

require_once __DIR__ . '/../target/bitsensor.phar';

global $debug;
$debug = true;

$config = new Config();
$config->setUri('http://localhost:8080/');
$config->setUser('example_user');
$config->setApiKey('abcdefghijklmnopqrstuvwxyz');
$config->setMode(Config::MODE_DETECTION);
$config->setConnectionFail(Config::ACTION_ALLOW);
$config->setIpAddressSrc(Config::IP_ADDRESS_REMOTE_ADDR);
$config->setHostSrc(Config::HOST_SERVER_NAME);
$config->setLogLevel(Config::LOG_LEVEL_ALL);

$bitSensor = new BitSensor($config);

session_start();

$_SESSION['user'] = 'le moi';

$bitSensor->addContext(new SessionContext(SessionContext::USERNAME, $_SESSION['user']));

$bitSensor->addError(new \BitSensor\Core\CodeError(1, "a", "b.php", 2, null, "Custom"));
$bitSensor->addError(new \BitSensor\Core\CodeError(1, "a", "b.php", 2, null, "Custom"));


