From: <var...@us...> - 2014-07-17 08:39:01
|
Revision: 8968 http://sourceforge.net/p/phpwiki/code/8968 Author: vargenau Date: 2014-07-17 08:38:53 +0000 (Thu, 17 Jul 2014) Log Message: ----------- PDO_FETCH_NUM --> PDO::FETCH_NUM; PDO uses class constants since PHP 5.1. Prior releases use global constants in the form PDO_PARAM_BOOL Modified Paths: -------------- trunk/lib/DbSession/PDO.php Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2014-07-17 08:33:04 UTC (rev 8967) +++ trunk/lib/DbSession/PDO.php 2014-07-17 08:38:53 UTC (rev 8968) @@ -99,7 +99,7 @@ $dbh = $this->_connect(); $table = $this->_table; $sth = $dbh->prepare("SELECT sess_data FROM $table WHERE sess_id=?"); - $sth->bindParam(1, $id, PDO_PARAM_STR, 32); + $sth->bindParam(1, $id, PDO::PARAM_STR, 32); if ($sth->execute()) $res = $sth->fetchColumn(); else $res = ''; $this->_disconnect(); @@ -153,10 +153,10 @@ $sth = $dbh->prepare("INSERT INTO $table" . " (sess_id, sess_data, sess_date, sess_ip)" . " VALUES (?, ?, ?, ?)"); - $sth->bindParam(1, $id, PDO_PARAM_STR, 32); - $sth->bindParam(2, $sess_data, PDO_PARAM_LOB); - $sth->bindParam(3, $time, PDO_PARAM_INT); - $sth->bindParam(4, $GLOBALS['request']->get('REMOTE_ADDR'), PDO_PARAM_STR, 15); + $sth->bindParam(1, $id, PDO::PARAM_STR, 32); + $sth->bindParam(2, $sess_data, PDO::PARAM_LOB); + $sth->bindParam(3, $time, PDO::PARAM_INT); + $sth->bindParam(4, $GLOBALS['request']->get('REMOTE_ADDR'), PDO::PARAM_STR, 15); if ($result = $sth->execute()) { $this->_backend->commit(); } else { @@ -166,19 +166,19 @@ $sth = $dbh->prepare("UPDATE $table" . " SET sess_data=?, sess_date=?, sess_ip=?" . " WHERE sess_id=?"); - $sth->bindParam(1, $sess_data, PDO_PARAM_LOB); - $sth->bindParam(2, $time, PDO_PARAM_INT); - $sth->bindParam(3, $GLOBALS['request']->get('REMOTE_ADDR'), PDO_PARAM_STR, 15); - $sth->bindParam(4, $id, PDO_PARAM_STR, 32); + $sth->bindParam(1, $sess_data, PDO::PARAM_LOB); + $sth->bindParam(2, $time, PDO::PARAM_INT); + $sth->bindParam(3, $GLOBALS['request']->get('REMOTE_ADDR'), PDO::PARAM_STR, 15); + $sth->bindParam(4, $id, PDO::PARAM_STR, 32); $result = $sth->execute(); // implicit affected rows if ($result === false or $result < 1) { // false or int > 0 $sth = $dbh->prepare("INSERT INTO $table" . " (sess_id, sess_data, sess_date, sess_ip)" . " VALUES (?, ?, ?, ?)"); - $sth->bindParam(1, $id, PDO_PARAM_STR, 32); - $sth->bindParam(2, $sess_data, PDO_PARAM_LOB); - $sth->bindParam(3, $time, PDO_PARAM_INT); - $sth->bindParam(4, $GLOBALS['request']->get('REMOTE_ADDR'), PDO_PARAM_STR, 15); + $sth->bindParam(1, $id, PDO::PARAM_STR, 32); + $sth->bindParam(2, $sess_data, PDO::PARAM_LOB); + $sth->bindParam(3, $time, PDO::PARAM_INT); + $sth->bindParam(4, $GLOBALS['request']->get('REMOTE_ADDR'), PDO::PARAM_STR, 15); $result = $sth->execute(); } } @@ -200,7 +200,7 @@ $table = $this->_table; $dbh = $this->_connect(); $sth = $dbh->prepare("DELETE FROM $table WHERE sess_id=?"); - $sth->bindParam(1, $id, PDO_PARAM_STR, 32); + $sth->bindParam(1, $id, PDO::PARAM_STR, 32); $sth->execute(); $this->_disconnect(); return true; @@ -219,7 +219,7 @@ $threshold = time() - $maxlifetime; $dbh = $this->_connect(); $sth = $dbh->prepare("DELETE FROM $table WHERE sess_date < ?"); - $sth->bindParam(1, $threshold, PDO_PARAM_INT); + $sth->bindParam(1, $threshold, PDO::PARAM_INT); $sth->execute(); $this->_disconnect(); return true; @@ -236,7 +236,7 @@ if (!$sth->execute()) { return $sessions; } - while ($row = $sth->fetch(PDO_FETCH_NUM)) { + while ($row = $sth->fetch(PDO::FETCH_NUM)) { $data = $row[0]; $date = $row[1]; $ip = $row[2]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |