GetSessionInstance() public static méthode

Returns a CampSession instance.
public static GetSessionInstance ( ) : object
Résultat object A CampSession instance
Exemple #1
0
$res = camp_detect_database_version($Campsite['DATABASE_NAME'], $dbVersion, $dbRoll);
if ($res !== 0) {
    $dbVersion = '[unknown]';
}
$dbInfo = $dbVersion;
if (!in_array($dbRoll, array('', '.'))) {
    $dbInfo .= ', roll ' . $dbRoll;
}
echo "Upgrading the database from version {$dbInfo}...";
// initiates the campsite site
$campsite = new CampSite();
// loads site configuration settings
$campsite->loadConfiguration(CS_PATH_CONFIG . DIR_SEP . 'configuration.php');
// starts the session
$campsite->initSession();
$session = CampSite::GetSessionInstance();
$configDb = array('hostname' => $Campsite['db']['host'], 'hostport' => $Campsite['db']['port'], 'username' => $Campsite['db']['user'], 'userpass' => $Campsite['db']['pass'], 'database' => $Campsite['db']['name']);
$session->setData('config.db', $configDb, 'installation');
// upgrading the database
$res = camp_upgrade_database($Campsite['DATABASE_NAME'], true, true);
if ($res !== 0) {
    display_upgrade_error("While upgrading the database: {$res}");
}
CampCache::singleton()->clear('user');
CampCache::singleton()->clear();
SystemPref::DeleteSystemPrefsFromCache();
// replace $campsite by $gimme
require_once $g_documentRoot . '/classes/TemplateConverterNewscoop.php';
$template_files = camp_read_files($g_documentRoot . '/templates');
$converter = new TemplateConverterNewscoop();
if (!empty($template_files)) {