1
0
mirror of https://github.com/til-schneider/slim-wiki.git synced 2025-08-12 19:44:14 +02:00

Moved index.php code in function in order to prevent pollution of the global namespace (because former global variables are local now)

This commit is contained in:
til-schneider
2015-12-22 22:28:34 +01:00
parent c0814d3445
commit 9597efe4dc

View File

@@ -1,5 +1,6 @@
<?php
function init() {
ini_set('display_errors', 1);
// Split URI example: 'http://localhost/slim-wiki/myfolder/mypage?action=bla'
@@ -33,8 +34,9 @@ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
}
$baseUrl = 'http' . ($https ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $basePath;
unset($uriPathArray, $scriptPathArray, $basePathArray, $isBasePath, $https);
require_once __DIR__ . '/server/logic/Main.php';
Main::get()->dispatch($baseUrl, $basePath, $requestPathArray);
}
init();