From: <var...@us...> - 2014-09-29 15:54:12
|
Revision: 9135 http://sourceforge.net/p/phpwiki/code/9135 Author: vargenau Date: 2014-09-29 15:54:08 +0000 (Mon, 29 Sep 2014) Log Message: ----------- Improve type compatibility Modified Paths: -------------- trunk/lib/WikiTheme.php trunk/lib/display.php trunk/lib/purgepage.php trunk/lib/removepage.php trunk/lib/stdlib.php Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2014-09-29 15:24:11 UTC (rev 9134) +++ trunk/lib/WikiTheme.php 2014-09-29 15:54:08 UTC (rev 9135) @@ -595,8 +595,6 @@ function linkExistingWikiWord($wikiword, $linktext = '', $version = false) { - global $request; - if ($version !== false and !$this->HTML_DUMP_SUFFIX) $url = WikiURL($wikiword, array('version' => $version)); else @@ -880,7 +878,7 @@ // //////////////////////////////////////////////////////////////// - function makeButton($text, $url, $class = false, $options = false) + function makeButton($text, $url, $class = false, $options = array()) { // FIXME: don't always try for image button? @@ -902,7 +900,7 @@ $class, $options); } - function makeSubmitButton($text, $name, $class = false, $options = false) + function makeSubmitButton($text, $name, $class = false, $options = array()) { $imgurl = $this->getButtonURL($text); @@ -1853,7 +1851,7 @@ $this->_basepage = $basepage; } - function format($args = false) + function format($args = array()) { return $this->_plugin->box($args ? array_merge($this->_args, $args) : $this->_args, $GLOBALS['request'], Modified: trunk/lib/display.php =================================================================== --- trunk/lib/display.php 2014-09-29 15:24:11 UTC (rev 9134) +++ trunk/lib/display.php 2014-09-29 15:54:08 UTC (rev 9135) @@ -217,6 +217,11 @@ return ''; } +/** + * @param WikiRequest $request + * @param bool $template + * @return string + */ function displayPage(&$request, $template = false) { global $WikiTheme; Modified: trunk/lib/purgepage.php =================================================================== --- trunk/lib/purgepage.php 2014-09-29 15:24:11 UTC (rev 9134) +++ trunk/lib/purgepage.php 2014-09-29 15:54:08 UTC (rev 9135) @@ -2,6 +2,9 @@ require_once 'lib/Template.php'; +/** + * @param WikiRequest $request + */ function PurgePage(&$request) { global $WikiTheme; Modified: trunk/lib/removepage.php =================================================================== --- trunk/lib/removepage.php 2014-09-29 15:24:11 UTC (rev 9134) +++ trunk/lib/removepage.php 2014-09-29 15:54:08 UTC (rev 9135) @@ -2,6 +2,9 @@ require_once 'lib/Template.php'; +/** + * @param WikiRequest $request + */ function RemovePage(&$request) { global $WikiTheme; Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-09-29 15:24:11 UTC (rev 9134) +++ trunk/lib/stdlib.php 2014-09-29 15:54:08 UTC (rev 9135) @@ -283,6 +283,7 @@ function IconForLink($protocol_or_url) { global $WikiTheme; +/* if (0 and $filename_suffix == false) { // display apache style icon for file type instead of protocol icon // - archive: unix:gz,bz2,tgz,tar,z; mac:dmg,dmgz,bin,img,cpt,sit; pc:zip; @@ -291,13 +292,14 @@ // - audio: mp3,mp2,aiff,aif,au // - multimedia: mpeg,mpg,mov,qt } else { +*/ list ($proto) = explode(':', $protocol_or_url, 2); $src = $WikiTheme->getLinkIconURL($proto); if ($src) return HTML::img(array('src' => $src, 'alt' => "", 'class' => 'linkicon')); else return false; - } +/* } */ } /** @@ -906,7 +908,8 @@ if (isa($page, 'WikiDB_Page')) return $page->getName(); elseif (isa($page, 'WikiDB_PageRevision')) - return $page->getPageName(); elseif (isa($page, 'WikiPageName')) + return $page->getPageName(); + elseif (isa($page, 'WikiPageName')) return $page->name; // '0' or e.g. '1984' should be allowed though if (!is_string($page) and !is_integer($page)) { @@ -1610,6 +1613,7 @@ return $x->hash(); } trigger_error("Can't hash $x", E_USER_ERROR); + return false; } /** @@ -1686,6 +1690,7 @@ $count += count_all($val); return $count; } + return 0; } function isSubPage($pagename) @@ -2000,6 +2005,7 @@ } } } + return ''; } // use this faster version: only load ExternalReferrer if we came from an external referrer @@ -2108,7 +2114,7 @@ if (function_exists('memory_get_usage') and memory_get_usage()) { return memory_get_usage(); } elseif (function_exists('getrusage') and ($u = @getrusage()) and !empty($u['ru_maxrss'])) { - $mem = $u['ru_maxrss']; + return $u['ru_maxrss']; } elseif (substr(PHP_OS, 0, 3) == 'WIN') { // may require a newer cygwin // what we want is the process memory only: apache or php (if CGI) $pid = getmypid(); @@ -2127,7 +2133,7 @@ //$memstr = exec("pslist $pid|grep -A1 Mem|sed 1d|perl -ane\"print \$"."F[5]\""); } return (integer)trim($memstr); - } elseif (1) { + } else { $pid = getmypid(); //%MEM: Percentage of total memory in use by this process //VSZ: Total virtual memory size, in 1K blocks. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |