first commit
This commit is contained in:
77
web/common.php
Normal file
77
web/common.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
|
||||
$cfg['Path']['web_root'] = '';
|
||||
|
||||
// ################################################################
|
||||
// ERROR REPORTING
|
||||
// ################################################################
|
||||
|
||||
set_error_handler('error_handler');
|
||||
|
||||
// klicovy string tohoto uzivatele
|
||||
$session = ServiceContainer::getService('session');
|
||||
$session->start();
|
||||
Cart::getCartID();
|
||||
|
||||
// ################################################################
|
||||
// VOLBA JAZYKA
|
||||
// ################################################################
|
||||
|
||||
$txt_str = [];
|
||||
|
||||
// ################################################################
|
||||
//
|
||||
// ################################################################
|
||||
|
||||
$ctrl = [];
|
||||
$ctrl['admin'] = false;
|
||||
$ctrl['logged'] = false;
|
||||
$ctrl['ip'] = getIP();
|
||||
$ctrl['id'] = 0;
|
||||
$ctrl['currUrl'] = [];
|
||||
$ctrl['currUrl']['Abs'] = '';
|
||||
$ctrl['currUrl']['Rel'] = '';
|
||||
|
||||
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') {
|
||||
$ctrl['currUrl']['Abs'] = 'http';
|
||||
} else {
|
||||
$ctrl['currUrl']['Abs'] = 'https';
|
||||
}
|
||||
|
||||
$ctrl['currUrl']['Abs'] .= '://';
|
||||
|
||||
$ctrl['currUrl']['Abs'] .= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
$ctrl['currUrl']['Rel'] .= $_SERVER['REQUEST_URI'];
|
||||
$ctrl['currUrl']['Entity'] = urlencode($ctrl['currUrl']['Abs']);
|
||||
|
||||
$ctrl['dealer'] = 'N';
|
||||
|
||||
// ################################################################
|
||||
// ZISKANI NASTAVENI Z DATABAZE
|
||||
// ################################################################
|
||||
|
||||
$dbcfg = Settings::getFromCache(ServiceContainer::getService(\KupShop\KupShopBundle\Context\LanguageContext::class)->getDefaultId());
|
||||
|
||||
// prevedeni aktivnich modulu pro SMARTY
|
||||
$cfg['module'] = [];
|
||||
foreach ($cfg['Modules'] as $index => $module) {
|
||||
if (is_numeric($index)) {
|
||||
$cfg['module'][$module] = true;
|
||||
} else {
|
||||
$cfg['module'][$index] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// ################################################################
|
||||
//
|
||||
// ################################################################
|
||||
|
||||
$ctrlTmp = ServiceContainer::getService(\KupShop\KupShopBundle\Util\Compat\CtrlLoader::class);
|
||||
$ctrlTmp->setContainer($ctrl);
|
||||
$ctrl = $ctrlTmp;
|
||||
|
||||
// ################################################################
|
||||
//
|
||||
// ################################################################
|
||||
Reference in New Issue
Block a user