当前位置: 首页>>代码示例>>PHP>>正文


PHP moodle_database::release_session_lock方法代码示例

本文整理汇总了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;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:29,代码来源:database.php

示例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();
     }
 }
开发者ID:rushi963,项目名称:moodle,代码行数:15,代码来源:mysqli_native_moodle_database.php

示例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;
 }
开发者ID:neogic,项目名称:moodle,代码行数:22,代码来源:sessionlib.php

示例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);
 }
开发者ID:grigory-catalyst,项目名称:moodle,代码行数:16,代码来源:mssql_native_moodle_database.php

示例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);
 }
开发者ID:nmicha,项目名称:moodle,代码行数:16,代码来源:oci_native_moodle_database.php

示例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);
     }
 }
开发者ID:kevin-bruton,项目名称:moodle,代码行数:17,代码来源:pgsql_native_moodle_database.php

示例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);
     }
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:22,代码来源:pgsql_native_moodle_database.php


注:本文中的moodle_database::release_session_lock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。