Implement download entity and related stuff. Will build things like user quota on...
[rock.divinelegy.git] / public_html / index.php
1 <?php
2
3 //TODO: Config this
4 header("Access-Control-Allow-Origin: http://172.17.12.110:8000");
5 header("Access-Control-Allow-Origin: http://roll.divinelegy.meeples:8000");
6 //header("Access-Control-Allow-Origin: http://roll.divinelegy.dev:8000");
7
8 require_once('../vendor/autoload.php');
9
10 // Everything time related should be UTC+0 based
11 date_default_timezone_set('UTC');
12
13 // Set up the DI container
14 $containerBuilder = new DI\ContainerBuilder();
15 $containerBuilder->addDefinitions('../config/DI.php');
16 $containerBuilder->useAutowiring(true);
17
18 $container = $containerBuilder->build();
19
20 /* @var $router Services\Routing\IRouter */
21 $router = $container->get('Services\Routing\IRouter');
22
23 $controllerName= $router->getControllerName();
24 $controllerAction = $router->getActionName();
25 $controllerActionArgs = $router->getActionArgs();
26
27 $controller = $container->get('Controllers\\' . ucfirst($controllerName) . 'Controller' );
28
29 // Last thing to do, call the action on the specified controller.
30 call_user_func_array(array($controller, $controllerAction . 'Action'), $controllerActionArgs);