<?php
declare(strict_types=1); define('FS_DIR_PUBLIC', rtrim(str_replace('\\', '/', realpath(__DIR__)), '/') . '/'); define('FS_DIR_ROOT', rtrim(str_replace('\\', '/', realpath(__DIR__ . '/..')), '/') . '/'); define('FS_DIR_CORE', FS_DIR_ROOT . 'core/'); define('FS_DIR_REGISTRY', FS_DIR_ROOT . 'registry/'); define('FS_DIR_STORAGE', FS_DIR_ROOT . 'storage/'); require_once FS_DIR_CORE . 'includes/app_header.inc.php'; if (settings::get('development_mode')) { if (empty(user::$data['id']) && !preg_match('#^' . preg_quote(WS_DIR_ADMIN, '#') . '#', strtok($_SERVER['REQUEST_URI'], '?'))) { if (!in_array(strtok($_SERVER['REQUEST_URI'], '?'), [WS_DIR_APP . 'manifest.json'])) { http_response_code(403); include vmod::check(FS_DIR_APP . 'pages/development_mode.inc.php'); require_once vmod::check(FS_DIR_APP . 'includes/app_footer.inc.php'); exit; } } } if (settings::get('maintenance_mode')) { if (!empty(user::$data['id'])) { notices::add('notices', strtr('%message [<a href="%link">%preview</a>]', [ '%message' => language::translate('reminder_store_in_maintenance_mode', 'The store is in maintenance mode.'), '%preview' => language::translate('title_preview', 'Preview'), '%link' => document::href_ilink('maintenance_mode'), ]), 'maintenance_mode'); } else { if (!in_array(strtok($_SERVER['REQUEST_URI'], '?'), [WS_DIR_APP . 'manifest.json'])) { http_response_code(503); include vmod::check(FS_DIR_APP . 'pages/maintenance_mode.inc.php'); require_once vmod::check(FS_DIR_APP . 'includes/app_footer.inc.php'); exit; } } } route::load(FS_DIR_APP . 'includes/routes/url_*.inc.php'); route::add('#^([0-9a-zA-Z_\-/\.]+?)(?:\.php)?/?$#', '$1'); route::process(); require_once vmod::check(FS_DIR_APP . 'includes/app_footer.inc.php'); 