Skip to content

Commit 5498c60

Browse files
Remove debug
1 parent ef119e3 commit 5498c60

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

web/includes/session.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ function zm_session_regenerate_id() {
6666

6767
// Set deleted timestamp. Session data must not be deleted immediately for reasons.
6868
$_SESSION['last_time'] = time();
69-
// Finish session
7069
session_write_close();
7170

7271
session_start();
@@ -127,17 +126,14 @@ public function __construct() {
127126
*/
128127
}
129128
public function open($path, $name): bool {
130-
ZM\Debug("Session::open ".($this->db?true:false));
131129
return $this->db ? true : false;
132130
}
133131
public function close() : bool {
134-
ZM\Debug("Session::close ");
135132
// The example code closed the db connection.. I don't think we care to.
136133
return true;
137134
}
138135
#[\ReturnTypeWillChange]
139136
public function read($id){
140-
ZM\Debug("Session::read ");
141137
$sth = $this->db->prepare('SELECT data FROM Sessions WHERE id = :id');
142138
if (!$sth->bindParam(':id', $id, PDO::PARAM_STR, 32)) {
143139
ZM\Error("Failed to bind param");
@@ -150,14 +146,11 @@ public function read($id){
150146
if (( $row = $sth->fetch(PDO::FETCH_ASSOC) ) ) {
151147
return $row['data'];
152148
}
153-
ZM\Debug("Exeuted but no row for $id");
154149
}
155-
ZM\Error("No session for id $id?");
156150
// Return an empty string
157151
return '';
158152
}
159153
public function write($id, $data) : bool {
160-
ZM\Debug("Session::write $id $data");
161154
// Create time stamp
162155
$access = time();
163156

@@ -167,17 +160,9 @@ public function write($id, $data) : bool {
167160
$sth->bindParam(':access', $access, PDO::PARAM_INT);
168161
$sth->bindParam(':data', $data);
169162

170-
if ($sth->execute()) {
171-
ZM\Debug("sucess");
172-
return true;
173-
} else {
174-
ZM\Debug("failss");
175-
return false;
176-
}
177-
#return $sth->execute() ? true : false;
163+
return $sth->execute() ? true : false;
178164
}
179165
public function destroy($id) : bool {
180-
ZM\Debug("Session::destroy $id");
181166
$sth = $this->db->prepare('DELETE FROM Sessions WHERE Id = :id');
182167
$sth->bindParam(':id', $id, PDO::PARAM_STR, 32);
183168
return $sth->execute() ? true : false;

0 commit comments

Comments
 (0)