<?php
	require("vendor/autoload.php");

	define("ROOT_SERVER", __DIR__ . "/");

	require_once(ROOT_SERVER . "library/config.php");

	set_error_handler(array("Bolt\\Handler", "error"), E_ALL & ~E_NOTICE);
	set_exception_handler(array("Bolt\\Handler", "exception"));

	#$dbo = new Cube\Dbo($connection);
	$api = new Bolt\Api();

	$controllerName = "App\\Controllers\\" . $api->route->controller;

	if (class_exists($controllerName))
	{
		$controller = new $controllerName($dbo);

		if (method_exists($controller, $api->route->method))
		{
			$api->response->data = $controller->{$api->route->method}($api);
		}
	}
	elseif ($api->route->controller == "")
	{
		$config = new App\Config();
		$versioning = $config->versionInfo();

		$api->response->data = array(
			"name" => API_NAME,
			"deployment" => DEPLOYMENT,
			"versioning" => $versioning['version']
		);
	}

	$api->response->output();
?>


<?php
	require("vendor/autoload.php");

	define("ROOT_SERVER", __DIR__ . "/");

	require_once(ROOT_SERVER . "library/config.php");

	set_error_handler(array("Bolt\\Handler", "error"), E_ALL & ~E_NOTICE);
	set_exception_handler(array("Bolt\\Handler", "exception"));

	#$dbo = new Cube\Dbo($connection);
	$api = new Bolt\Api();

	// Add connections to api object here

	$api->activate();

	$controllerName = "App\\Controllers\\" . $api->route->controller;

	if (class_exists($controllerName))
	{
		$controller = new $controllerName();

		if (method_exists($controller, $api->route->method))
		{
			$api->response->data = $controller->{$api->route->method}($api);
		}
	}
	elseif ($api->route->controller == "")
	{
		$config = new App\Config();
		$versioning = $config->versionInfo();

		$api->response->data = array(
			"name" => API_NAME,
			"deployment" => DEPLOYMENT,
			"versioning" => $versioning['version']
		);
	}

	$api->response->output();
?>


Update controller instantiation system to match Bolt updates
Update controller instantiation system to match Bolt updates
