コード例 #1
0
ファイル: header.php プロジェクト: Tapac/hotscot
require_once CORE_PATH . 'client/wib/whereivebeen_wrapper.php';
// ------------------------------------------------------
// system configuration
require_once CORE_PATH . 'config.php';
// ------------------------------------------------------
// make cookies work in IE iframes
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
// if we're in dev, enable all query logs
if (ENV == 'dev' || array_val($_REQUEST, 'mongoose7')) {
    Log::enableAll();
}
// all users get a php session. we have our own session handler which uses the database
session_set_save_handler(array('Session', 'open'), array('Session', 'close'), array('Session', 'read'), array('Session', 'write'), array('Session', 'destroy'), array('Session', 'gc'));
session_start();
// are we overriding the test with a request variable
if ($current_test = array_val($_REQUEST, 'AB_USER_TEST')) {
    // save this for the duration of the users session
    $_SESSION['AB_USER_TEST'] = $current_test;
} else {
    // try and pull it from the session
    if (!($current_test = array_val($_SESSION, 'AB_USER_TEST'))) {
        // we dont have one in the session then assign a new one
        $current_test = ABTest::getRandomTest();
        $_SESSION['AB_USER_TEST'] = $current_test;
    }
}
// pass this to the AB framework, the framework will show content for this test only
ABTest::assignTest($current_test);
// load the configuration for simpledb
SimpleDB::loadConfiguration();