Esempio n. 1
0
 /**
  * @param $config
  */
 public function __construct(array $config)
 {
     $dsn = $this->getDsn($config);
     $options = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
     $pdo = new PDO($dsn, $config['username'], $config['password'], $options);
     if (Eventum\DebugBar::hasDebugBar()) {
         $pdo = Eventum\DebugBar::getTraceablePDO($pdo);
     }
     $this->db = $pdo;
     $this->tablePrefix = $config['table_prefix'];
 }
Esempio n. 2
0
Misc::stripInput($_POST);
// set default timezone
date_default_timezone_set(APP_DEFAULT_TIMEZONE);
Logger::initialize();
Language::setup();
// set charset
header('Content-Type: text/html; charset=' . APP_CHARSET);
// display maintenance message if requested.
if (APP_MAINTENANCE) {
    $is_manage = strpos($_SERVER['PHP_SELF'], '/manage/') !== false;
    if (APP_MAINTENANCE && !$is_manage) {
        $tpl = new Template_Helper();
        $tpl->setTemplate("maintenance.tpl.html");
        $tpl->displayTemplate();
        exit(0);
    }
}
// Default IRC category
$define("APP_EVENTUM_IRC_CATEGORY_DEFAULT", "default");
$define("APP_EVENTUM_IRC_CATEGORY_REMINDER", APP_EVENTUM_IRC_CATEGORY_DEFAULT);
// legacy constants, enable this block if you need time to migrate custom workflow, custom_field, customer, etc classes
/*
if (!defined('APP_DEFAULT_DB') || !defined('APP_TABLE_PREFIX')) {
    $dbconfig = DB_Helper::getConfig();
    $define('APP_DEFAULT_DB', $dbconfig['database']);
    $define('APP_TABLE_PREFIX', $dbconfig['table_prefix']);
    unset($dbconfig);
}
*/
Eventum\DebugBar::initialize();