diff options
Diffstat (limited to 'index.php')
| -rw-r--r-- | index.php | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -19,12 +19,29 @@ use Fisharebest\Webtrees\Controller\AjaxController; use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\Functions; use Fisharebest\Webtrees\Functions\FunctionsDb; +use Symfony\Component\HttpFoundation\Request; + +require 'includes/session.php'; + +// Extract the route from the the HTTP request. +$request = Request::createFromGlobals(); +$route = $request->get('route', ''); + +if ($route === '') { + // Legacy URLs: + // index.php?ctype=gedcom + // index.php?ctype=user +} else { + // Route the request to its controller action. + $response = require 'routes/web.php'; + + // Send the response back to the browser. + return $response->prepare($request)->send(); +} /** @global Tree $WT_TREE */ global $WT_TREE; -require 'includes/session.php'; - // The only option for action is "ajax" $ajax = (bool) Filter::get('ajax'); |
