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