<?php
//$fastEvents=array('monitor','add_inout','add_group','add_queue','add_device','add_segment');
$fastEvents= explode(PHP_EOL,file_get_contents('fast_events.conf'));
$class=isset($_GET['class']) ?$_GET['class']:(isset($_POST['class'])?$_POST['class']:null);
if (array_search($class, $fastEvents)!==false) {
require_once(__DIR__.'/../src/FastEvents/FastEvents.php');
$dispatcher=new App\FastEvents\FastEvents();
$dispatcher->dispatch($class);
} else {
//Desviem tots els altres class a symfony
$_SERVER['SCRIPT_FILENAME']= str_replace('fast_events.php', 'index.php', $_SERVER['SCRIPT_FILENAME']);
require_once('index.php');
}