{ //prevent error when mailer classes are loaded if (!preg_match('/swift_(.*)/i', $className)) { if (preg_match('/[^DB][Ss]torage/i', $className)) { $classFileName = INCLUDES_DIR . 'storages' . DS . ucfirst(str_replace('Storage', null, $className)) . '.php'; } else { $classFileName = CLASSES_DIR . 'class.' . strtolower(str_replace('WoW_', null, $className)) . '.php'; } if (!file_exists($classFileName)) { die('<strong>Autoload Fatal Error:</strong> unable to autoload class ' . $className . ' (path: ' . $classFileName . ')!'); } include $classFileName; } } // Initialize debug log WoW_Log::Initialize(WoWConfig::$UseLog, WoWConfig::$LogLevel); // Load databases configs // Do not create DB connections here - it will be created automatically at first query request! DB::LoadConfigs(); // Core self testing WoW::SelfTests(); // Try to catch some operations (login, logout, etc.) $locale_loaded = false; WoW::CatchOperations($locale_loaded); // locale from page controller $wow_locale_cms = isset($_COOKIE['wow_locale']) ? $_COOKIE['wow_locale'] : WoWConfig::$DefaultLocale; if (!isset($_COOKIE['wow_locale'])) { setcookie('wow_locale', $wow_locale_cms, strtotime('NEXT YEAR'), '/'); $_COOKIE['wow_locale'] = $wow_locale_cms; } $pController = new PageController();