public static function setup() { if (defined('DURA_LOADED')) { return; } define('DURA_VERSION', '1.0.3'); spl_autoload_register(array(__CLASS__, 'autoload')); session_name(DURA_SESSION_NAME); session_start(); self::user()->loadSession(); mb_internal_encoding('UTF-8'); $langFile = DURA_TRUST_PATH . '/language/' . self::user()->getLanguage() . '.php'; self::$language = self::user()->getLanguage(); if (!file_exists($langFile)) { $langFile = DURA_TRUST_PATH . '/language/' . DURA_LANGUAGE . '.php'; self::$language = DURA_LANGUAGE; } self::$catalog = (require $langFile); define('DURA_LOADED', true); }