%PDF- %PDF-
| Direktori : /data/www_bck/varak.net_bck/verify.varak.net/ |
| Current File : //data/www_bck/varak.net_bck/verify.varak.net/bootstrap.php |
<?php
/**
* Created by PhpStorm.
* User: waritko
* Date: 3.5.16
* Time: 20:36
*/
date_default_timezone_set('Europe/Prague');
require_once "islocal.php";
require_once "lib/dibi.phar";
require_once "lib/smarty/Smarty.class.php";
//require_once "lib/nette.phar";
// Get site from HTTP host
$site = "default";
if(trim($_SERVER['HTTP_HOST']) == "verify.alsaproteam.cz")
$site = "alsaproteam";
$smarty = new Smarty();
$smarty->setTemplateDir( __DIR__ . '/templates/');
$smarty->setCompileDir( __DIR__ . '/templates_c/');
$smarty->setConfigDir( __DIR__ . '/configs/');
$smarty->setCacheDir( __DIR__ . '/cache/');
$smarty->debugging = false;
//$smarty->compile_check = false;
$smarty->caching = Smarty::CACHING_OFF;
$smarty->assign('baseUrl', 'https://' . $_SERVER['SERVER_NAME']);
//$smarty->assign('baseUrl', 'https://' . $_SERVER['HTTP_HOST'] . "/verify/www");
$smarty->assign('site', $site);
//ini_set('session.gc_maxlifetime', 14*24*3600);
//session_set_cookie_params(14*24*3600);
//session_start();
// Select database according to $site
$dbname = "verify";
if($site == "alsaproteam")
$dbname = "verify_alsa";
if(!IS_LOCAL)
{
dibi::connect(array(
'driver' => 'mysqli',
'host' => 'localhost',
'username' => 'practiscore',
'password' => 'Cepice321',
'database' => $dbname,
'charset' => 'utf8',
'profiler' => [
'run' => TRUE,
'file' => __DIR__ . '/log/log-' . date('Y-m-d') . '.txt',
],
));
}
else
{
dibi::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'root',
'password' => 'blade666',
'database' => $dbname,
'charset' => 'utf8',
'profiler' => [
'run' => TRUE,
'file' => __DIR__ . '/log/log-' . date('Y-m-d') . '.txt',
],
));
$smarty->compile_check = true;
$smarty->caching = 0;
}