From: <var...@us...> - 2019-04-17 17:32:22
|
Revision: 10101 http://sourceforge.net/p/phpwiki/code/10101 Author: vargenau Date: 2019-04-17 17:32:19 +0000 (Wed, 17 Apr 2019) Log Message: ----------- Add {} Modified Paths: -------------- trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PearDB_mysqli.php Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2019-04-17 17:31:09 UTC (rev 10100) +++ trunk/lib/WikiDB/backend/PDO.php 2019-04-17 17:32:19 UTC (rev 10101) @@ -84,7 +84,9 @@ ? $this->_parsedDSN['database'] : $this->_parsedDSN['dbname']; } - if (empty($this->_parsedDSN['password'])) $this->_parsedDSN['password'] = ''; + if (empty($this->_parsedDSN['password'])) { + $this->_parsedDSN['password'] = ''; + } try { // try to load it dynamically (unix only) @@ -106,7 +108,7 @@ or DATABASE_PERSISTENT )); } catch (PDOException $e) { - echo "<br>\nCan't connect to database: %s" . $e->getMessage(); + echo "<br>\nCan't connect to database: " . $e->getMessage(); if (DEBUG & _DEBUG_VERBOSE or DEBUG & _DEBUG_SQL) { echo "<br>\nDSN: '", $dbparams['dsn'], "'"; echo "<br>\n_parsedDSN: '", print_r($this->_parsedDSN), "'"; @@ -590,8 +592,11 @@ } $this->_update_recent_table($id); $this->_update_nonempty_table($id); - if ($rs) $this->commit(); - else $this->rollBack(); + if ($rs) { + $this->commit(); + } else { + $this->rollBack(); + } $this->unlock(array('page', 'recent', 'version', 'nonempty')); } @@ -837,7 +842,9 @@ $dbh = &$this->_dbh; extract($this->_table_names); $orderby = $this->sortby($sortby, 'db'); - if ($orderby) $orderby = ' ORDER BY ' . $orderby; + if ($orderby) { + $orderby = ' ORDER BY ' . $orderby; + } if ($exclude) { // array of pagenames $exclude = " AND $page_tbl.pagename NOT IN " . $this->_sql_set($exclude); } else { @@ -895,7 +902,9 @@ $dbh = &$this->_dbh; extract($this->_table_names); $orderby = $this->sortby($sortby, 'db'); - if ($orderby) $orderby = ' ORDER BY ' . $orderby; + if ($orderby) { + $orderby = ' ORDER BY ' . $orderby; + } $limit = $this->_limit_sql($limit); $table = "$nonempty_tbl, $page_tbl"; @@ -999,8 +1008,9 @@ extract($this->_table_names); $pick = array(); - if ($since) + if ($since) { $pick[] = "mtime >= $since"; + } if ($include_all_revisions) { // Include all revisions of each page. @@ -1037,8 +1047,9 @@ $limit = -$limit; } $where_clause = $join_clause; - if ($pick) + if ($pick) { $where_clause .= " AND " . join(" AND ", $pick); + } $sql = "SELECT " . $this->page_tbl_fields . ", " . $this->version_tbl_fields . " FROM $table" @@ -1065,10 +1076,12 @@ if ($orderby = $this->sortby($sortby, 'db', array('pagename', 'wantedfrom'))) $orderby = 'ORDER BY ' . $orderby; - if ($exclude_from) // array of pagenames + if ($exclude_from) { // array of pagenames $exclude_from = " AND linked.pagename NOT IN " . $this->_sql_set($exclude_from); - if ($exclude) // array of pagenames + } + if ($exclude) { // array of pagenames $exclude = " AND $page_tbl.pagename NOT IN " . $this->_sql_set($exclude); + } /* all empty pages, independent of linkstatus: @@ -1249,8 +1262,9 @@ */ function _serialize($data) { - if (empty($data)) + if (empty($data)) { return ''; + } assert(is_array($data)); return serialize($data); } Modified: trunk/lib/WikiDB/backend/PearDB_mysqli.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_mysqli.php 2019-04-17 17:31:09 UTC (rev 10100) +++ trunk/lib/WikiDB/backend/PearDB_mysqli.php 2019-04-17 17:32:19 UTC (rev 10101) @@ -29,7 +29,9 @@ function __construct($dbparams) { parent::__construct($dbparams); - if (DB::isError($this->_dbh)) return; + if (DB::isError($this->_dbh)) { + return; + } //$this->_serverinfo = $this->_dbh->ServerInfo(); $row = $this->_dbh->GetOne("SELECT version()"); if (!DB::isError($row) and !empty($row)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |