Commit 958b9401 authored by Aaron Wells's avatar Aaron Wells

Bug 1428918: Don't bother with opening & closing session, in CLI

Repeated calls to session_write_close() during CLI, are causing
problems for Behat (for some reason). Since the CLI doesn't actually
do anything with these session calls anyway, let's just skip it.

Change-Id: I0c6142d2fd3df203b7635fb9c0bae13fd4ec854a
parent e7a35da7
......@@ -283,6 +283,10 @@ class Session {
* Create a session, by initialising the $_SESSION array.
*/
private function ensure_session() {
if (defined('CLI')) {
return;
}
if (empty($_SESSION)) {
@session_start();
$_SESSION = array(
......@@ -301,6 +305,10 @@ class Session {
*/
private function ro_session() {
if (defined('CLI')) {
return;
}
session_write_close();
}
......@@ -308,6 +316,10 @@ class Session {
* Destroy a session
*/
public function destroy_session() {
if (defined('CLI')) {
return;
}
if ($this->is_live()) {
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment