Esempio n. 1
0
    // Build a player gateway object to handle the SQL calls
    $online = $players_gateway->selectPlayersLoggedIn($since_stamp, $stamp);
    // Online is the (int) count of the numbers of players currently logged in via SQL select
}
$elapsed = (int) 999;
// Default value for elapsed, overridden with an actual value if its available
if ($tkireg !== null) {
    if (property_exists($tkireg, 'tkitimer')) {
        $tkireg->tkitimer->stop();
        $elapsed = $tkireg->tkitimer->elapsed();
    }
}
// Suppress the news ticker on the IBANK and index pages
$news_ticker_active = !(preg_match("/index.php/i", $request->server->get('SCRIPT_NAME')) || preg_match("/ibank.php/i", $request->server->get('SCRIPT_NAME')) || preg_match("/new.php/i", $request->server->get('SCRIPT_NAME')));
// Suppress the news ticker if the database is not active
if (!Tki\Db::isActive($pdo_db)) {
    $news_ticker_active = false;
}
// Update counter
$scheduler_gateway = new \Tki\Scheduler\SchedulerGateway($pdo_db);
// Build a scheduler gateway object to handle the SQL calls
$last_run = $scheduler_gateway->selectSchedulerLastRun();
// Last run is the (int) count of the numbers of players currently logged in via SQL select or false if DB is not active
if ($last_run !== false) {
    $seconds_left = $tkireg->sched_ticks * 60 - (time() - $last_run);
    $display_update_ticker = true;
} else {
    $seconds_left = (int) 0;
    $display_update_ticker = false;
}
// End update counter
Esempio n. 2
0
header('X-Content-Type-Options: nosniff');
// Prevents MIME-sniffing away from the declared content-type.
ob_start(array('Tki\\Compress', 'compress'));
// Start a buffer, and when it closes (at the end of a request),
// call the callback function 'Tki\Compress' to properly handle
// detection of compression.
$pdo_db = new Tki\Db();
$pdo_db = $pdo_db->initDb('pdo');
// Connect to db using pdo
$db = new Tki\Db();
$db = $db->initDb('adodb');
// Connect to db using adodb also - for now - to be eliminated!
if ($pdo_db !== null) {
    $tkireg = new Tki\Reg($pdo_db);
    // TKI Registry object -  passing config variables via classes
    $tkireg->tkitimer = new Tki\Timer();
    // Create a benchmark timer to get benchmarking data for everything
    $tkireg->tkitimer->start();
    // Start benchmarking immediately
}
$langvars = null;
// Language variables in every page, set them to a null value first
$template = new \Tki\Smarty();
$template->setTheme($tkireg->default_template);
if ($pdo_db !== null && Tki\Db::isActive($pdo_db)) {
    $tki_session = new Tki\Sessions($pdo_db);
    session_start();
}
$lang = $tkireg->default_lang;
use Symfony\Component\HttpFoundation\Request;
$request = Request::createFromGlobals();