本文整理汇总了PHP中moodle_database::release_session_lock方法的典型用法代码示例。如果您正苦于以下问题:PHP moodle_database::release_session_lock方法的具体用法?PHP moodle_database::release_session_lock怎么用?PHP moodle_database::release_session_lock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moodle_database
的用法示例。
在下文中一共展示了moodle_database::release_session_lock方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handler_destroy
/**
* Destroy session handler.
*
* {@see http://php.net/manual/en/function.session-set-save-handler.php}
*
* @param string $sid
* @return bool success
*/
public function handler_destroy($sid)
{
if (!($session = $this->database->get_record('sessions', array('sid' => $sid), 'id, sid'))) {
if ($sid == session_id()) {
$this->recordid = null;
$this->lasthash = null;
}
return true;
}
if ($this->recordid and $session->id == $this->recordid) {
try {
$this->database->release_session_lock($this->recordid);
} catch (\Exception $ex) {
// Ignore problems.
}
$this->recordid = null;
$this->lasthash = null;
}
$this->database->delete_records('sessions', array('id' => $session->id));
return true;
}
示例2: release_session_lock
public function release_session_lock($rowid)
{
if (!$this->used_for_db_sessions) {
return;
}
parent::release_session_lock($rowid);
$fullname = $this->dbname . '-' . $this->prefix . '-session-' . $rowid;
$sql = "SELECT RELEASE_LOCK('{$fullname}')";
$this->query_start($sql, null, SQL_QUERY_AUX);
$result = $this->mysqli->query($sql);
$this->query_end($result);
if ($result) {
$result->close();
}
}
示例3: handler_destroy
/**
* Destroy session handler
*
* {@see http://php.net/manual/en/function.session-set-save-handler.php}
*
* @param string $sid
* @return bool success
*/
public function handler_destroy($sid)
{
session_kill($sid);
if (isset($this->record->id) and $this->record->sid === $sid) {
try {
$this->database->release_session_lock($this->record->id);
} catch (Exception $ex) {
// ignore problems
}
$this->record = null;
}
$this->lasthash = null;
return true;
}
示例4: release_session_lock
public function release_session_lock($rowid)
{
if (!$this->session_lock_supported()) {
return;
}
if (!$this->used_for_db_sessions) {
return;
}
parent::release_session_lock($rowid);
$fullname = $this->dbname . '-' . $this->prefix . '-session-' . $rowid;
$sql = "sp_releaseapplock '{$fullname}', 'Session'";
$this->query_start($sql, null, SQL_QUERY_AUX);
$result = mssql_query($sql, $this->mssql);
$this->query_end($result);
$this->free_result($result);
}
示例5: release_session_lock
public function release_session_lock($rowid)
{
if (!$this->session_lock_supported()) {
return;
}
parent::release_session_lock($rowid);
$fullname = $this->dbname . '-' . $this->prefix . '-session-' . $rowid;
$params = array('lockname' => $fullname);
$sql = 'SELECT MOODLE_LOCKS.RELEASE_LOCK(:lockname) FROM DUAL';
$this->query_start($sql, $params, SQL_QUERY_AUX);
$stmt = $this->parse_query($sql);
$this->bind_params($stmt, $params);
$result = oci_execute($stmt, $this->commit_status);
$this->query_end($result, $stmt);
oci_free_statement($stmt);
}
示例6: release_session_lock
public function release_session_lock($rowid)
{
if (!$this->session_lock_supported()) {
return;
}
if (!$this->used_for_db_sessions) {
return;
}
parent::release_session_lock($rowid);
$sql = "SELECT pg_advisory_unlock({$rowid})";
$this->query_start($sql, null, SQL_QUERY_AUX);
$result = pg_query($this->pgsql, $sql);
$this->query_end($result);
if ($result) {
pg_free_result($result);
}
}
示例7: release_session_lock
public function release_session_lock($rowid)
{
if (!$this->session_lock_supported()) {
return;
}
if (!$this->used_for_db_sessions) {
return;
}
parent::release_session_lock($rowid);
// OVERWRITE 2: replacement, changed from:
//$sql = "SELECT pg_advisory_unlock($rowid)";
// TO:
global $CFG;
$sql = "SELECT pg_advisory_unlock({$rowid}, {$CFG->current_app->getId()})";
// END OVERWRITE 2
$this->query_start($sql, null, SQL_QUERY_AUX);
$result = pg_query($this->pgsql, $sql);
$this->query_end($result);
if ($result) {
pg_free_result($result);
}
}