From 10a8dab7a5bf880688a29609e34306a018f6a258 Mon Sep 17 00:00:00 2001 From: vargenau Date: Wed, 9 Jul 2014 08:39:11 +0000 Subject: [PATCH] fetchSingle was renamed to fetchColumn git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@8959 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/DbSession/PDO.php | 2 +- lib/WikiDB/backend/PDO.php | 22 +++++++++++----------- lib/WikiUser/PdoDb.php | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/DbSession/PDO.php b/lib/DbSession/PDO.php index be0083ef4..26a682fe2 100644 --- a/lib/DbSession/PDO.php +++ b/lib/DbSession/PDO.php @@ -100,7 +100,7 @@ class DbSession_PDO $table = $this->_table; $sth = $dbh->prepare("SELECT sess_data FROM $table WHERE sess_id=?"); $sth->bindParam(1, $id, PDO_PARAM_STR, 32); - if ($sth->execute()) $res = $sth->fetchSingle(); + if ($sth->execute()) $res = $sth->fetchColumn(); else $res = ''; $this->_disconnect(); if (!empty($res) and isa($dbh, 'ADODB_postgres64')) diff --git a/lib/WikiDB/backend/PDO.php b/lib/WikiDB/backend/PDO.php index 245b09c66..92c0265de 100644 --- a/lib/WikiDB/backend/PDO.php +++ b/lib/WikiDB/backend/PDO.php @@ -129,7 +129,7 @@ class WikiDB_backend_PDO } $sth = $this->_dbh->prepare("SELECT version()"); $sth->execute(); - $this->_serverinfo['version'] = $sth->fetchSingle(); + $this->_serverinfo['version'] = $sth->fetchColumn(); $this->commit(); // required to match the try catch block above! $prefix = isset($dbparams['prefix']) ? $dbparams['prefix'] : ''; @@ -225,7 +225,7 @@ class WikiDB_backend_PDO . " AND pagename=?"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); if ($sth->execute()) - return $sth->fetchSingle(); + return $sth->fetchColumn(); else return false; } @@ -248,7 +248,7 @@ class WikiDB_backend_PDO $sth = $dbh->exec("SELECT count(*)" . " FROM $nonempty_tbl, $page_tbl" . " WHERE $nonempty_tbl.id=$page_tbl.id"); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } function increaseHitCount($pagename) @@ -342,7 +342,7 @@ class WikiDB_backend_PDO $sth = $dbh->prepare("SELECT cached_html FROM $page_tbl WHERE pagename=? LIMIT 1"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->execute(); - return $sth->fetchSingle(PDO_FETCH_NUM); + return $sth->fetchColumn(PDO_FETCH_NUM); } function set_cached_html($pagename, $data) @@ -377,7 +377,7 @@ class WikiDB_backend_PDO $page_tbl = $this->_table_names['page_tbl']; $sth = $dbh->prepare("SELECT id FROM $page_tbl WHERE pagename=? LIMIT 1"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); - $id = $sth->fetchSingle(); + $id = $sth->fetchColumn(); if (!$create_if_missing) { return $id; } @@ -395,7 +395,7 @@ class WikiDB_backend_PDO $this->beginTransaction(); $sth = $dbh->prepare("SELECT MAX(id) FROM $page_tbl"); $sth->execute(); - $id = $sth->fetchSingle(); + $id = $sth->fetchColumn(); $sth = $dbh->prepare("INSERT INTO $page_tbl" . " (id,pagename,hits)" . " VALUES (?,?,0)"); @@ -423,7 +423,7 @@ class WikiDB_backend_PDO . " LIMIT 1"); $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->execute(); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } function get_previous_version($pagename, $version) @@ -440,7 +440,7 @@ class WikiDB_backend_PDO $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->bindParam(2, $version, PDO_PARAM_INT); $sth->execute(); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } /** @@ -674,7 +674,7 @@ class WikiDB_backend_PDO $this->set_links($pagename, false); $sth = $dbh->prepare("SELECT COUNT(*) FROM $link_tbl WHERE linkto=$id"); $sth->execute(); - if ($sth->fetchSingle()) { + if ($sth->fetchColumn()) { // We're still in the link table (dangling link) so we can't delete this // altogether. $dbh->query("UPDATE $page_tbl SET hits=0, pagedata='' WHERE id=$id"); @@ -732,7 +732,7 @@ class WikiDB_backend_PDO . " WHERE ISNULL($nonempty_tbl.id) AND" . " ISNULL($version_tbl.id) AND $page_tbl.id=$id"); $sth1->execute(); - if ($sth1->fetchSingle()) { + if ($sth1->fetchColumn()) { $dbh->query("DELETE FROM $page_tbl WHERE id=$id"); // this purges the link $dbh->query("DELETE FROM $recent_tbl WHERE id=$id"); // may fail } @@ -805,7 +805,7 @@ class WikiDB_backend_PDO $sth->bindParam(1, $pagename, PDO_PARAM_STR, 100); $sth->bindParam(2, $link, PDO_PARAM_STR, 100); $sth->execute(); - return $sth->fetchSingle(); + return $sth->fetchColumn(); } function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') diff --git a/lib/WikiUser/PdoDb.php b/lib/WikiUser/PdoDb.php index 30a0e366a..d3038ce13 100644 --- a/lib/WikiUser/PdoDb.php +++ b/lib/WikiUser/PdoDb.php @@ -144,7 +144,7 @@ class _PdoDbPassUser trigger_error("SQL Error: " . $e->getMessage(), E_USER_WARNING); return false; } - if ($this->_authselect->fetchSingle()) + if ($this->_authselect->fetchColumn()) return true; } else { if (!$dbi->getAuthParam('auth_user_exists')) @@ -153,7 +153,7 @@ class _PdoDbPassUser $this->_authcheck = $dbh->prepare($dbi->getAuthParam('auth_check')); $this->_authcheck->bindParam("userid", $this->_userid, PDO_PARAM_STR, 48); $this->_authcheck->execute(); - if ($this->_authcheck->fetchSingle()) + if ($this->_authcheck->fetchColumn()) return true; } // User does not exist yet. -- 2.45.0