<?php defined('INSIDE') or exit('Direct access is not permitted'); /** * Init script for all used classes. * This version of the script is intended for online shop. * * @author efoft */ /* Locator ------------------------------------------------------------------------ */ $loc = new Locator(); /* Config ------------------------------------------------------------------------ */ $cfg = new Cfg(); if ($cfg->val('SECFILE')) { if (!file_exists($loc->path($cfg->val('SECFILE')))) { throw new Exception('SECFILE defined but the file not found'); } $cfg->loadSecrets($loc->path($cfg->val('SECFILE'))); } /* Logging ------------------------------------------------------------------------ */ $log = new Logger($loc->path('log'), $cfg->val('DEBUG')); /* Database ------------------------------------------------------------------------ */ if ($cfg->val('DBdriver')) { $dbdrv = $cfg->val('DBdriver'); switch ($dbdrv) { case 'mysql': $dbhost = $cfg->val('DBhost', true);