From: <var...@us...> - 2014-12-01 14:46:43
|
Revision: 9396 http://sourceforge.net/p/phpwiki/code/9396 Author: vargenau Date: 2014-12-01 14:46:35 +0000 (Mon, 01 Dec 2014) Log Message: ----------- Add @var WikiRequest $request Modified Paths: -------------- trunk/lib/WikiDB/ADODB.php trunk/lib/WikiDB/PDO.php trunk/lib/WikiDB/SQL.php trunk/lib/WikiTheme.php Modified: trunk/lib/WikiDB/ADODB.php =================================================================== --- trunk/lib/WikiDB/ADODB.php 2014-12-01 14:02:03 UTC (rev 9395) +++ trunk/lib/WikiDB/ADODB.php 2014-12-01 14:46:35 UTC (rev 9396) @@ -45,7 +45,9 @@ function isWikiPage($pagename) { $pagename = (string)$pagename; - if ($pagename === '') return false; + if ($pagename === '') { + return false; + } if (!array_key_exists($pagename, $this->_cache->_id_cache)) { $this->_cache->_id_cache[$pagename] = $this->_backend->is_wiki_page($pagename); } @@ -75,8 +77,14 @@ function isOpen() { + /** + * @var WikiRequest $request + */ global $request; - if (!$request->_dbi) return false; + + if (!$request->_dbi) { + return false; + } return is_resource($this->_backend->connection()); } Modified: trunk/lib/WikiDB/PDO.php =================================================================== --- trunk/lib/WikiDB/PDO.php 2014-12-01 14:02:03 UTC (rev 9395) +++ trunk/lib/WikiDB/PDO.php 2014-12-01 14:46:35 UTC (rev 9396) @@ -43,7 +43,9 @@ function isWikiPage($pagename) { $pagename = (string)$pagename; - if ($pagename === '') return false; + if ($pagename === '') { + return false; + } if (!array_key_exists($pagename, $this->_cache->_id_cache)) { $this->_cache->_id_cache[$pagename] = $this->_backend->is_wiki_page($pagename); } @@ -51,7 +53,6 @@ } // With PDO we should really use native quoting using prepared statements with ? - // Supported since PDO-0.3 (?) // Add surrounding quotes '' if string function quote($in) { @@ -76,8 +77,14 @@ function isOpen() { + /** + * @var WikiRequest $request + */ global $request; - if (!$request->_dbi) return false; + + if (!$request->_dbi) { + return false; + } return is_object($this->_backend->_dbh); } Modified: trunk/lib/WikiDB/SQL.php =================================================================== --- trunk/lib/WikiDB/SQL.php 2014-12-01 14:02:03 UTC (rev 9395) +++ trunk/lib/WikiDB/SQL.php 2014-12-01 14:46:35 UTC (rev 9396) @@ -11,7 +11,7 @@ $backend = $dbparams['dsn']['phptype']; elseif (preg_match('/^(\w+):/', $dbparams['dsn'], $m)) $backend = $m[1]; - if ($backend == 'postgres7') { // ADODB cross-compatiblity hack (for unit testing) + if ($backend == 'postgres7') { // ADODB cross-compatibility hack (for unit testing) $backend = 'pgsql'; if (is_string($dbparams['dsn'])) $dbparams['dsn'] = $backend . ':' . substr($dbparams['dsn'], 10); @@ -44,8 +44,9 @@ function isWikiPage($pagename) { $pagename = (string)$pagename; - if ($pagename === '') return false; - //if (empty($this->_iwpcache)) { $this->_iwpcache = array(); } + if ($pagename === '') { + return false; + } if (empty($this->_cache->id_cache[$pagename])) { $this->_cache->_id_cache[$pagename] = $this->_backend->is_wiki_page($pagename); } @@ -66,8 +67,14 @@ function isOpen() { + /** + * @var WikiRequest $request + */ global $request; - if (!$request->_dbi) return false; + + if (!$request->_dbi) { + return false; + } return is_resource($this->_backend->connection()); } Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2014-12-01 14:02:03 UTC (rev 9395) +++ trunk/lib/WikiTheme.php 2014-12-01 14:46:35 UTC (rev 9396) @@ -1365,6 +1365,9 @@ // new arg: named elements to be able to remove them. such as DoubleClickEdit for htmldumps function addMoreAttr($tag, $name, $element) { + /** + * @var WikiRequest $request + */ global $request; // protect from duplicate attr (body jscript: themes, prefs, ...) static $_attr_cache = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |