Bleh
[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 // Set up the DI container
11 $containerBuilder = new DI\ContainerBuilder();
12 $containerBuilder->addDefinitions('../config/DI.php');
13 $containerBuilder->useAutowiring(true);
14
15 $container = $containerBuilder->build();
16
17 /* @var $router Services\Routing\IRouter */
18 $router = $container->get('Services\Routing\IRouter');
19
20 $controllerName= $router->getControllerName();
21 $controllerAction = $router->getActionName();
22 $controllerActionArgs = $router->getActionArgs();
23
24 $controller = $container->get('Controllers\\' . ucfirst($controllerName) . 'Controller' );
25
26 // Last thing to do, call the action on the specified controller.
27 call_user_func_array(array($controller, $controllerAction . 'Action'), $controllerActionArgs);