Skip to content
Snippets Groups Projects
Commit 0b83f6d1 authored by Stein Magne Bjorklund's avatar Stein Magne Bjorklund
Browse files

Remove all hard require and includes from index.php

Full autoload the application boostrap process.
parent 1ffefcbc
No related branches found
No related tags found
1 merge request!16Resolve "Introduce PSR-4 autoloading"
......@@ -28,24 +28,15 @@ if ($conf['debug']) {
if (isset($_GET['q']) && $_GET['q'] === 'logs') {
Logging::init();
exit(0);
} else {
$conf['logfile'] = Logging::createLogFile($_GET['q']);
//error_reporting(E_ALL);
}
} else {
error_reporting(E_ERROR);
$conf['logfile'] = Logging::createLogFile($_GET['q']);
}
include_once('classes/HTTPStatus.php');
include_once('classes/Utils.php');
include_once('classes/Queries.php');
include_once('classes/Endpoint.php');
include_once('classes/Convert.php');
$results = array();
$firstResults = array();
$endpoints = array();
$endpoints['local'] = new Endpoint($conf['endpoint']['local'], $conf['endpointParams']['config']);
$acceptContentType = Utils::getBestContentType($_SERVER['HTTP_ACCEPT'], $conf['http_accept']);
$extension = Utils::getExtension($acceptContentType, $conf['http_accept']);
$uri = $conf['basedir'] . $_GET['q'];
......@@ -57,7 +48,6 @@ if ($acceptContentType === null) {
if ($conf['export'] && $_GET['q'] === 'export') {
include_once('settings.inc.php');
include_once('classes/Exporter.php');
$exp = new Exporter();
header('Content-Type: text/plain');
$exp->run();
......@@ -74,7 +64,7 @@ if ($uri === $conf['basedir']) {
// Configure external URIs if necessary.
$localUri = $conf['basedir'] . $_GET['q'];
$foo = $_SERVER['HTTP_HOST'];
$uri = Utils::getMirroredUri($localUri);
// Load Loadspeakr modules.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment