mirror of
https://github.com/til-schneider/slim-wiki.git
synced 2025-08-13 12:04:10 +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:
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
function init() {
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
|
|
||||||
// Split URI example: 'http://localhost/slim-wiki/myfolder/mypage?action=bla'
|
// 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;
|
$baseUrl = 'http' . ($https ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $basePath;
|
||||||
|
|
||||||
unset($uriPathArray, $scriptPathArray, $basePathArray, $isBasePath, $https);
|
|
||||||
|
|
||||||
require_once __DIR__ . '/server/logic/Main.php';
|
require_once __DIR__ . '/server/logic/Main.php';
|
||||||
|
|
||||||
Main::get()->dispatch($baseUrl, $basePath, $requestPathArray);
|
Main::get()->dispatch($baseUrl, $basePath, $requestPathArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
init();
|
||||||
|
Reference in New Issue
Block a user