MDL-14992 pg session locking (8.2 and later only), refactoring and db session not default yet in new installs

This commit is contained in:
skodak
2009-01-17 14:31:29 +00:00
parent a644e212df
commit 5e9dd01778
4 changed files with 58 additions and 28 deletions
+3 -4
View File
@@ -5,7 +5,7 @@
* @return moodle_session
*/
function session_get_instance() {
global $CFG;
global $CFG, $DB;
static $session = null;
@@ -18,7 +18,8 @@ function session_get_instance() {
$session_class = SESSION_CUSTOM;
$session = new $session_class();
} else if (!isset($CFG->dbsessions) or $CFG->dbsessions) {
//} else if ((!isset($CFG->dbsessions) or $CFG->dbsessions) and $DB->session_lock_supported()) {
} else if (!empty($CFG->dbsessions) and $DB->session_lock_supported()) {
// default recommended session type
$session = new database_session();
@@ -299,8 +300,6 @@ class database_session extends session_stub {
global $DB;
$this->database = $DB;
$this->database->used_for_db_sessions();
return true;
}