32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
|
|
|
require_once './include/config.php';
|
|
|
|
// Avoid "remember me" cookie if request for data files
|
|
// TODO: Remove all cookies to prevent any other side effect?
|
|
if (str_starts_with($_SERVER['REQUEST_URI'], '/data/')) {
|
|
unset($_COOKIE['remember']);
|
|
}
|
|
|
|
require_once $cfg['Path']['web_root'].'app/autoload.php';
|
|
|
|
if (strpos(trim($_SERVER['REQUEST_URI'], '/'), trim($cfg['Menu']['wpj_toolbar']['admin_url'], '/')) === 0) {
|
|
require_once './engine/admin/functions.php';
|
|
} else {
|
|
require_once './include/functions.php';
|
|
require_once __DIR__.'/common.php';
|
|
}
|
|
|
|
use KupShop\KupShopBundle\Util\Compat\SymfonyBridge;
|
|
use Symfony\Component\ErrorHandler\ErrorHandler;
|
|
use Symfony\Component\Runtime\SymfonyRuntime;
|
|
|
|
// only non-components shops are using app.php
|
|
// when SymfonyRuntime exists then error handler is not being registered until SymfonyRuntime is used
|
|
// so hotfix by registering error handler when SymfonyRuntime class exists
|
|
if (class_exists(SymfonyRuntime::class)) {
|
|
ErrorHandler::register(null, false);
|
|
}
|
|
|
|
SymfonyBridge::handleGlobalRequest();
|