<?php

// DATABASE connection script  
// database Connection variables
define('HOST', 'localhost'); // Database host name ex. localhost
define('USER', 'devknestlms_dbuser'); 
define('PASSWORD', 'Narahari1!'); // Database user password  (if password is not set for user then keep it empty )
define('DATABASE', 'devknestlms_multi'); // Database name
define('CHARSET', 'utf8');
define('ROOT_PATH', dirname(__DIR__) . '/');
define('CONFIG_PROP', 'config.properties');
define('ADMIN_PATH', 'https://dev.knestlms.com/admin_multi/');
define('CLIENT_PATH', 'https://dev.knestlms.com/client_multi/');
define('ADMIN_HTTP_PATH', 'https://dev.knestlms.com/admin_multi/');
define('CLIENT_HTTP_PATH', 'https://dev.knestlms.com/client_multi/');
define('DEFAULT_COURSE_IMAGE', 'assets/images/course/course.jpg');
define('DEFAULT_USER_IMAGE', 'assets/images/user/user1.png');
define('LOGOUT_URL', '/client_multi/logout.php?timeout=1');
date_default_timezone_set('Asia/Kolkata');
$date_time = date("Y-m-d H:i:s");
$date = date("Y-m-d");
$timeout = 600; //10 min

//LTI Specific
define('LMS_NAME', 'K-nest LMS');
define('LMS_VERSION', '1.0.4');
define('LMS_CODE', 'knest_lms');
define('LTI_VERSION_1P3', '1.3.0');
define('LTI_SETTING_NEVER', 0);
define('LTI_SETTING_ALWAYS', 1);
define('LTI_SETTING_DELEGATE', 2);
define('LTI_LAUNCH_CONTAINER_DEFAULT', 1);
define('LTI_LAUNCH_CONTAINER_EMBED', 2);
define('LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS', 3);
define('LTI_LAUNCH_CONTAINER_WINDOW', 4);
define('LTI_LAUNCH_CONTAINER_REPLACE_WINDOW', 5);
define('LTI_JWT_CLAIM_PREFIX', 'https://purl.imsglobal.org/spec/lti');
define('FORMAT_PLAIN', '2');

define('CSRF_HEARTBEAT_INTERVAL', 300000); //2.5 min
define('CSRF_EXPIRY_SECONDS', 600); // 5 min
define('SESSION_TIMEOUT', 900); // 15 min
global $SESSION;
$SESSION = new stdClass();


//ini_set('display_errors', 1);
//error_reporting(E_ALL);


require_once 'i18n.php';

function DBConnection() {
    static $instance;
    if ($instance === null) {
        $opt = array(
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES => FALSE,
        );
        $dsn = 'mysql:host=' . HOST . ';dbname=' . DATABASE . ';charset=' . CHARSET;
        $instance = new PDO($dsn, USER, PASSWORD, $opt);
    }
    return $instance;
}
//$api_key="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";
// $api_key="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";
$api_key="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";
?>