Beispiel #1
0
try {
    $DB = new PDO("mysql:host=" . config::get("host", "db") . ";dbname=" . config::get("name", "db"), config::get("user", "db"), config::get("passw", "db"));
    $DB->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $DB->query("SET character_set_connection = " . config::get("encoding"));
    $DB->query("SET character_set_client = " . config::get("encoding"));
    $DB->query("SET character_set_results = " . config::get("encoding"));
    config::set("instance", $DB, "db");
} catch (PDOException $e) {
    echo $e->getMessage();
    die;
}
try {
    // Parse the URL string passed from the browser. This step is necessary now,
    // because the first parameter, passed in the URL, specifies the locale and
    // other language options, which will be used by all modules of the script.
    uriparser::init($_SERVER["REQUEST_URI"]);
} catch (Exception $e) {
    echo $e->getMessage();
    die;
}
// Connection of localization file, that contains basic information about
// locale and language settings.
if (is_file(KERNEL_PATH . "localization.php")) {
    require_once KERNEL_PATH . "localization.php";
} else {
    die("IM-CMS can not load language packs.");
}
// Searching the template file.
if (!config::get("template_name", "gui")) {
    die(_("Default template is not set."));
}