From: <var...@us...> - 2014-07-18 13:14:06
|
Revision: 8990 http://sourceforge.net/p/phpwiki/code/8990 Author: vargenau Date: 2014-07-18 13:13:58 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Revert: __construct --> _PageList_Column Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/plugin/UserRatings.php trunk/lib/wikilens/PageListColumns.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-07-18 12:48:51 UTC (rev 8989) +++ trunk/lib/PageList.php 2014-07-18 13:13:58 UTC (rev 8990) @@ -171,7 +171,7 @@ class _PageList_Column extends _PageList_Column_base { - function __construct($field, $default_heading, $align = false) + function _PageList_Column($field, $default_heading, $align = false) { parent::__construct($default_heading, $align); Modified: trunk/lib/plugin/UserRatings.php =================================================================== --- trunk/lib/plugin/UserRatings.php 2014-07-18 12:48:51 UTC (rev 8989) +++ trunk/lib/plugin/UserRatings.php 2014-07-18 13:13:58 UTC (rev 8990) @@ -195,11 +195,11 @@ // augment columns //$preds = new _PageList_Column_prediction('prediction', _("Pred"), 'right', $dimension, $allowed_users); - $preds = array('_PageList_column_prediction', 'custom:prediction', _("Pred"), 'right', ' ', $allowed_users); + $preds = array('_PageList_Column_prediction', 'custom:prediction', _("Pred"), 'right', ' ', $allowed_users); $pagelist->addColumnObject($preds); //$widget = new _PageList_Column_ratingwidget('ratingwidget', _("Rate"), 'left', $dimension); - $widget = array('_PageList_column_ratingwidget', 'custom:ratingwidget', _("Rate"), 'center'); + $widget = array('_PageList_Column_ratingwidget', 'custom:ratingwidget', _("Rate"), 'center'); $pagelist->addColumnObject($widget); $noRatingUsers = array(); Modified: trunk/lib/wikilens/PageListColumns.php =================================================================== --- trunk/lib/wikilens/PageListColumns.php 2014-07-18 12:48:51 UTC (rev 8989) +++ trunk/lib/wikilens/PageListColumns.php 2014-07-18 13:13:58 UTC (rev 8990) @@ -217,7 +217,7 @@ */ class _PageList_Column_ratingwidget extends _PageList_Column_custom { - function _PageList_Column_ratingwidget($params) + function __construct($params) { $this->_pagelist =& $params[3]; $this->_PageList_Column($params[0], $params[1], $params[2]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-18 14:07:50
|
Revision: 8992 http://sourceforge.net/p/phpwiki/code/8992 Author: vargenau Date: 2014-07-18 14:07:42 +0000 (Fri, 18 Jul 2014) Log Message: ----------- Constructor is void Modified Paths: -------------- trunk/lib/DbSession/SQL.php trunk/lib/DbSession.php Modified: trunk/lib/DbSession/SQL.php =================================================================== --- trunk/lib/DbSession/SQL.php 2014-07-18 13:36:46 UTC (rev 8991) +++ trunk/lib/DbSession/SQL.php 2014-07-18 14:07:42 UTC (rev 8992) @@ -29,7 +29,6 @@ array(&$this, 'write'), array(&$this, 'destroy'), array(&$this, 'gc')); - return $this; } function & _connect() Modified: trunk/lib/DbSession.php =================================================================== --- trunk/lib/DbSession.php 2014-07-18 13:36:46 UTC (rev 8991) +++ trunk/lib/DbSession.php 2014-07-18 14:07:42 UTC (rev 8992) @@ -34,14 +34,13 @@ if (class_exists($class)) { // dba has no ->_dbh, so this is used for the session link $this->_backend = new $class($dbh->_backend->_dbh, $table); - return $this; + return; } } //Fixme: E_USER_WARNING ignored! trigger_error(sprintf(_("Your WikiDB DB backend “%s” cannot be used for DbSession.") . " " . _("Set USE_DB_SESSION to false."), $db_type), E_USER_WARNING); - return false; } function currentSessions() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-28 14:01:02
|
Revision: 9018 http://sourceforge.net/p/phpwiki/code/9018 Author: vargenau Date: 2014-07-28 14:00:58 +0000 (Mon, 28 Jul 2014) Log Message: ----------- No \n in error message Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/Request.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2014-07-28 13:51:56 UTC (rev 9017) +++ trunk/lib/AccessLog.php 2014-07-28 14:00:58 UTC (rev 9018) @@ -58,7 +58,7 @@ if ($do_sql) { if (!$request->_dbi->isSQL()) { - trigger_error("Unsupported database backend for ACCESS_LOG_SQL.\nNeed DATABASE_TYPE=SQL or ADODB or PDO"); + trigger_error("Unsupported database backend for ACCESS_LOG_SQL. Need DATABASE_TYPE=SQL or ADODB or PDO."); } else { global $DBParams; //$this->_dbi =& $request->_dbi; Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-07-28 13:51:56 UTC (rev 9017) +++ trunk/lib/Request.php 2014-07-28 14:00:58 UTC (rev 9018) @@ -889,7 +889,7 @@ if ($do_sql) { global $DBParams; if (!in_array($DBParams['dbtype'], array('SQL', 'ADODB'))) { - trigger_error("Unsupported database backend for ACCESS_LOG_SQL.\nNeed DATABASE_TYPE=SQL or ADODB"); + trigger_error("Unsupported database backend for ACCESS_LOG_SQL. Need DATABASE_TYPE=SQL or ADODB."); } else { //$this->_dbi =& $request->_dbi; $this->logtable = (!empty($DBParams['prefix']) ? $DBParams['prefix'] : '') . "accesslog"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-08-27 08:28:23
|
Revision: 9053 http://sourceforge.net/p/phpwiki/code/9053 Author: vargenau Date: 2014-08-27 08:28:20 +0000 (Wed, 27 Aug 2014) Log Message: ----------- protected function embedMap Modified Paths: -------------- trunk/lib/PageType.php trunk/lib/WikiPluginCached.php trunk/lib/editpage.php trunk/lib/plugin/AppendText.php trunk/lib/plugin/DynamicIncludePage.php trunk/lib/plugin/GoTo.php trunk/lib/plugin/PageHistory.php trunk/lib/plugin/PhotoAlbum.php trunk/lib/plugin/RandomPage.php trunk/lib/plugin/RateIt.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/TitleSearch.php trunk/lib/plugin/WatchPage.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiPoll.php trunk/lib/plugin/WikiTranslation.php Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/PageType.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -561,7 +561,7 @@ $pdf = new PDF(); $pdf->SetTitle($pagename); $pdf->SetAuthor($this->_page->get('author')); - $pdf->SetCreator(WikiURL($pagename, false, 1)); + $pdf->SetCreator(WikiURL($pagename, array(), 1)); $pdf->AliasNbPages(); $pdf->AddPage(); //TODO: define fonts Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/WikiPluginCached.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -411,7 +411,7 @@ * @param $request Request * @return string html output */ - private function embedMap($id, $url, $map, &$dbi, $argarray, &$request) + protected function embedMap($id, $url, $map, &$dbi, $argarray, &$request) { // id is not unique if the same map is produced twice $key = substr($id, 0, 8) . substr(microtime(), 0, 6); Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/editpage.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -718,7 +718,7 @@ private function _redirectToBrowsePage() { - $this->request->redirect(WikiURL($this->page, false, 'absolute_url')); + $this->request->redirect(WikiURL($this->page, array(), 'absolute_url')); } function _restoreState() Modified: trunk/lib/plugin/AppendText.php =================================================================== --- trunk/lib/plugin/AppendText.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/AppendText.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -78,7 +78,7 @@ if (empty($args['s'])) { if ($request->isPost()) { if ($pagename != _("AppendText")) - return HTML($request->redirect(WikiURL($pagename, false, 'absurl'), false)); + return HTML($request->redirect(WikiURL($pagename, array(), 'absurl'), false)); } return HTML(); } @@ -133,11 +133,11 @@ // TODO: Just invalidate the cache, if AppendText didn't // change anything before. // - return $request->redirect(WikiURL($pagename, false, 'absurl'), false); + return $request->redirect(WikiURL($pagename, array(), 'absurl'), false); // The user asked to be redirected to the modified page } elseif ($args['redirect']) { - return $request->redirect(WikiURL($pagename, false, 'absurl'), false); + return $request->redirect(WikiURL($pagename, array(), 'absurl'), false); } else { $link = HTML::em(WikiLink($pagename)); Modified: trunk/lib/plugin/DynamicIncludePage.php =================================================================== --- trunk/lib/plugin/DynamicIncludePage.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/DynamicIncludePage.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -48,7 +48,7 @@ function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; - $args = $this->getArgs($argstr, $request, false); + $args = $this->getArgs($argstr, $request, array()); $page =& $args['page']; if (ENABLE_AJAX) { if ($args['state']) Modified: trunk/lib/plugin/GoTo.php =================================================================== --- trunk/lib/plugin/GoTo.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/GoTo.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -54,7 +54,7 @@ $request->setArg('goto', false); $target = $goto['target']; if ($dbi->isWikiPage($target)) - $url = WikiURL($target, 0, 1); + $url = WikiURL($target, array(), 1); else $url = WikiURL($target, array('action' => 'edit'), 1); Modified: trunk/lib/plugin/PageHistory.php =================================================================== --- trunk/lib/plugin/PageHistory.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/PageHistory.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -241,7 +241,7 @@ { global $request; - $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); + $rc_url = WikiURL($request->getArg('pagename'), array(), 'absurl'); $title = sprintf(_("%s: %s"), WIKI_NAME, Modified: trunk/lib/plugin/PhotoAlbum.php =================================================================== --- trunk/lib/plugin/PhotoAlbum.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/PhotoAlbum.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -181,7 +181,7 @@ $align = 'center'; } if (count($photos) == 0) { - return HTML::raw(); + return HTML::raw(''); } if (in_array("sort", $attributes)) Modified: trunk/lib/plugin/RandomPage.php =================================================================== --- trunk/lib/plugin/RandomPage.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/RandomPage.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -76,7 +76,7 @@ $page = $pagearray[array_rand($pagearray)]; $pagename = $page->getName(); if ($redirect) - $request->redirect(WikiURL($pagename, false, 'absurl')); // noreturn + $request->redirect(WikiURL($pagename, array(), 'absurl')); // noreturn if ($hidename) return WikiLink($pagename, false, _("RandomPage")); else Modified: trunk/lib/plugin/RateIt.php =================================================================== --- trunk/lib/plugin/RateIt.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/RateIt.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -283,7 +283,7 @@ } return $html; } - return HTML::raw(); + return HTML::raw(''); } // box is used to display a fixed-width, narrow version with common header @@ -291,7 +291,7 @@ { if (!$request) $request =& $GLOBALS['request']; if (!$request->_user->isSignedIn()) { - return HTML::raw(); + return HTML::raw(''); } if (!isset($args)) $args = array(); $args['small'] = 1; Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/RecentChanges.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -829,7 +829,7 @@ function pageURI($rev) { - return WikiURL($rev, '', 'absurl'); + return WikiURL($rev, array(), 'absurl'); } function format($changes) @@ -878,7 +878,7 @@ return false; return array('title' => WIKI_NAME, - 'link' => WikiURL(HOME_PAGE, false, 'absurl'), + 'link' => WikiURL(HOME_PAGE, array(), 'absurl'), 'url' => $img_url); } @@ -887,14 +887,14 @@ return array('title' => _("Search"), 'description' => _("Title Search"), 'name' => 's', - 'link' => WikiURL(_("TitleSearch"), false, 'absurl')); + 'link' => WikiURL(_("TitleSearch"), array(), 'absurl')); } function channel_properties() { global $request; - $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); + $rc_url = WikiURL($request->getArg('pagename'), array(), 'absurl'); extract($this->_args); $title = WIKI_NAME; $description = $this->title(); @@ -1029,7 +1029,7 @@ $rss = new AtomFeed; // "channel" is called "feed" in atom - $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); + $rc_url = WikiURL($request->getArg('pagename'), array(), 'absurl'); extract($this->_args); $description = $this->title(); $feed_props = array('title' => $description, @@ -1089,9 +1089,8 @@ class NonDeletedRevisionIterator extends WikiDB_PageRevisionIterator { /** - * @param $revisions object a WikiDB_PageRevisionIterator. + * @param WikiDB_PageRevisionIterator $revisions * @param bool $check_current_revision - * @return void */ function __construct($revisions, $check_current_revision = true) { @@ -1301,7 +1300,7 @@ ); } - function getArgs($argstr, $request, $defaults = false) + function getArgs($argstr, $request = false, $defaults = array()) { if (!$defaults) $defaults = $this->getDefaultArguments(); $args = WikiPlugin::getArgs($argstr, $request, $defaults); Modified: trunk/lib/plugin/TitleSearch.php =================================================================== --- trunk/lib/plugin/TitleSearch.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/TitleSearch.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -103,7 +103,7 @@ if ($args['auto_redirect'] && ($pagelist->getTotal() == 1)) { $page = $pagelist->first(); - $request->redirect(WikiURL($page->getName(), false, 'absurl'), false); + $request->redirect(WikiURL($page->getName(), array(), 'absurl'), false); } return $pagelist; Modified: trunk/lib/plugin/WatchPage.php =================================================================== --- trunk/lib/plugin/WatchPage.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/WatchPage.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -143,8 +143,7 @@ return ''; } if ($request->getArg('edit')) { - $request->redirect(WikiURL(_("UserPreferences"), - false, 'absolute_url')); // noreturn + $request->redirect(WikiURL(_("UserPreferences"), array(), 'absolute_url')); // noreturn return ''; } $add = $request->getArg('add'); Modified: trunk/lib/plugin/WikiAdminUtils.php =================================================================== --- trunk/lib/plugin/WikiAdminUtils.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/WikiAdminUtils.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -295,7 +295,7 @@ Button('cancel', _("Cancel"))) ); } - return HTML::raw(); + return HTML::raw(''); } } Modified: trunk/lib/plugin/WikiPoll.php =================================================================== --- trunk/lib/plugin/WikiPoll.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/WikiPoll.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -70,7 +70,7 @@ ); } - function getArgs($argstr, $request = false, $defaults = false) + function getArgs($argstr, $request = false, $defaults = array()) { if ($defaults === false) $defaults = $this->getDefaultArguments(); Modified: trunk/lib/plugin/WikiTranslation.php =================================================================== --- trunk/lib/plugin/WikiTranslation.php 2014-08-26 13:17:13 UTC (rev 9052) +++ trunk/lib/plugin/WikiTranslation.php 2014-08-27 08:28:20 UTC (rev 9053) @@ -393,14 +393,14 @@ if (in_array($from_lang, array('en', 'fr'))) { $url = "http://translate.google.com/translate"; $url .= "?langpair=" . urlencode($from_lang . "|" . $to_lang); - $url .= "&u=" . urlencode(WikiURL($pagename, false, true)); + $url .= "&u=" . urlencode(WikiURL($pagename, array(), true)); } // redirect or transclude? if ($url) { return $request->redirect($url); } return HTML(fmt("TODO: Google can only translate from english and french. Find a translation service for %s to language %s", - WikiURL($pagename, false, true), + WikiURL($pagename, array(), true), $to_lang)); } else { return $this->error(fmt("%s is empty.", $pagename)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-08-27 16:18:19
|
Revision: 9058 http://sourceforge.net/p/phpwiki/code/9058 Author: vargenau Date: 2014-08-27 16:18:17 +0000 (Wed, 27 Aug 2014) Log Message: ----------- Use parent::__construct Modified Paths: -------------- trunk/lib/RssWriter.php trunk/lib/RssWriter2.php Modified: trunk/lib/RssWriter.php =================================================================== --- trunk/lib/RssWriter.php 2014-08-27 14:34:23 UTC (rev 9057) +++ trunk/lib/RssWriter.php 2014-08-27 16:18:17 UTC (rev 9058) @@ -13,7 +13,7 @@ { function __construct() { - $this->XmlElement('rdf:RDF', + parent::__construct('rdf:RDF', array('xmlns' => "http://purl.org/rss/1.0/", 'xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')); Modified: trunk/lib/RssWriter2.php =================================================================== --- trunk/lib/RssWriter2.php 2014-08-27 14:34:23 UTC (rev 9057) +++ trunk/lib/RssWriter2.php 2014-08-27 16:18:17 UTC (rev 9058) @@ -19,8 +19,7 @@ { function __construct() { - $this->XmlElement('rss', - array('version' => "2.0")); + parent::__construct('rss', array('version' => "2.0")); // not used. no namespaces should be used. $this->_modules = array( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-01 10:14:58
|
Revision: 9060 http://sourceforge.net/p/phpwiki/code/9060 Author: vargenau Date: 2014-09-01 10:14:55 +0000 (Mon, 01 Sep 2014) Log Message: ----------- Cosmetic Modified Paths: -------------- trunk/lib/main.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RedirectTo.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-09-01 09:25:35 UTC (rev 9059) +++ trunk/lib/main.php 2014-09-01 10:14:55 UTC (rev 9060) @@ -387,7 +387,8 @@ if (!empty($HTTP_GET_VARS['start_debug'])) // zend ide support return WikiURL($pagename, array('action' => $action, 'start_debug' => 1)); elseif ($action == 'edit') - return WikiURL($pagename); else + return WikiURL($pagename); + else return WikiURL($pagename, array('action' => $action)); } Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2014-09-01 09:25:35 UTC (rev 9059) +++ trunk/lib/plugin/RecentChanges.php 2014-09-01 10:14:55 UTC (rev 9060) @@ -1302,7 +1302,9 @@ function getArgs($argstr, $request = false, $defaults = array()) { - if (!$defaults) $defaults = $this->getDefaultArguments(); + if (empty($defaults)) { + $defaults = $this->getDefaultArguments(); + } $args = WikiPlugin::getArgs($argstr, $request, $defaults); $action = $request->getArg('action'); Modified: trunk/lib/plugin/RedirectTo.php =================================================================== --- trunk/lib/plugin/RedirectTo.php 2014-09-01 09:25:35 UTC (rev 9059) +++ trunk/lib/plugin/RedirectTo.php 2014-09-01 10:14:55 UTC (rev 9060) @@ -53,7 +53,7 @@ function run($dbi, $argstr, &$request, $basepage) { - $args = ($this->getArgs($argstr, $request)); + $args = $this->getArgs($argstr, $request); $href = $args['href']; $page = $args['page']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-24 15:49:28
|
Revision: 9109 http://sourceforge.net/p/phpwiki/code/9109 Author: vargenau Date: 2014-09-24 15:49:21 +0000 (Wed, 24 Sep 2014) Log Message: ----------- Less strings Modified Paths: -------------- trunk/lib/FileFinder.php trunk/lib/loadsave.php Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2014-09-24 15:39:05 UTC (rev 9108) +++ trunk/lib/FileFinder.php 2014-09-24 15:49:21 UTC (rev 9109) @@ -190,7 +190,7 @@ */ private function _not_found($file) { - trigger_error(sprintf(_("%s: file not found"), $file), E_USER_ERROR); + trigger_error(sprintf(_("File “%s” not found."), $file), E_USER_ERROR); return false; } Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2014-09-24 15:39:05 UTC (rev 9108) +++ trunk/lib/loadsave.php 2014-09-24 15:49:21 UTC (rev 9109) @@ -1151,7 +1151,7 @@ } $mapfile = FindFile(INTERWIKI_MAP_FILE, 1); if (!$goback && !file_exists($mapfile)) { - $error_html = sprintf(" " . _("%s: file not found"), INTERWIKI_MAP_FILE); + $error_html = sprintf(" " . _("File “%s” not found."), INTERWIKI_MAP_FILE); $goback = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-29 15:24:23
|
Revision: 9134 http://sourceforge.net/p/phpwiki/code/9134 Author: vargenau Date: 2014-09-29 15:24:11 +0000 (Mon, 29 Sep 2014) Log Message: ----------- Improve type compatibility Modified Paths: -------------- trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/ziplib.php Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2014-09-29 15:22:36 UTC (rev 9133) +++ trunk/lib/loadsave.php 2014-09-29 15:24:11 UTC (rev 9134) @@ -25,6 +25,8 @@ /** * ignore fatal errors during dump + * @param PhpError $error + * @return bool */ function _dump_error_handler($error) { @@ -33,12 +35,6 @@ return true; } return true; // Ignore error - /* - if (preg_match('/Plugin/', $error->errstr)) - return true; - */ - // let the message come through: call the remaining handlers: - // return false; } function StartLoadDump(&$request, $title, $html = '') @@ -306,8 +302,7 @@ else $content = MailifyPage($page); - $zip->addRegularFile(FilenameForPage($pagename), - $content, $attrib); + $zip->addRegularFile(FilenameForPage($pagename), $content, $attrib); } $zip->finish(); @@ -441,15 +436,13 @@ * chown httpd HTML_DUMP_DIR; chmod u+rwx HTML_DUMP_DIR * should be enough. * - * @param string directory (optional) path to dump to. Default: HTML_DUMP_DIR - * @param string pages (optional) Comma-separated of glob-style pagenames to dump. - * Also array of pagenames allowed. - * @param string exclude (optional) Comma-separated of glob-style pagenames to exclude + * @param WikiRequest $request + * */ function DumpHtmlToDir(&$request) { global $WikiTheme; - $directory = $request->getArg('directory'); + $directory = $request->getArg('directory'); // Path to dump to. Default: HTML_DUMP_DIR if (empty($directory)) $directory = HTML_DUMP_DIR; // See lib/plugin/WikiForm.php:87 if (empty($directory)) @@ -468,12 +461,16 @@ StartLoadDump($request, _("Dumping Pages"), $html); $thispage = $request->getArg('pagename'); // for "Return to ..." + // Comma-separated of glob-style pagenames to exclude $dbi =& $request->_dbi; if ($exclude = $request->getArg('exclude')) { // exclude which pagenames $excludeList = explodePageList($exclude); } else { $excludeList = array('DebugAuthInfo', 'DebugGroupInfo', 'AuthInfo'); } + + // Comma-separated of glob-style pagenames to dump. + // Also array of pagenames allowed. if ($pages = $request->getArg('pages')) { // which pagenames if ($pages == '[]') // current page $pages = $thispage; @@ -1141,7 +1138,7 @@ function _tryinsertInterWikiMap($content) { $goback = false; - if (strpos($content, "<verbatim>")) { + if (strpos($content, '<'.'verbatim'.'>')) { // Avoid warning about unknown HTML tag //$error_html = " The newly loaded pgsrc already contains a verbatim block."; $goback = true; } @@ -1313,7 +1310,7 @@ } } -function LoadZip(&$request, $zipfile, $files = false, $exclude = false) +function LoadZip(&$request, $zipfile, $files = array(), $exclude = array()) { $zip = new ZipReader($zipfile); $timeout = (!$request->getArg('start_debug')) ? 20 : 120; @@ -1334,7 +1331,7 @@ } } -function LoadDir(&$request, $dirname, $files = false, $exclude = false) +function LoadDir(&$request, $dirname, $files = array(), $exclude = array()) { $fileset = new LimitedFileSet($dirname, $files, $exclude); @@ -1408,7 +1405,7 @@ return $magic == ZIP_LOCHEAD_MAGIC || $magic == ZIP_CENTHEAD_MAGIC; } -function LoadAny(&$request, $file_or_dir, $files = false, $exclude = false) +function LoadAny(&$request, $file_or_dir, $files = array(), $exclude = array()) { // Try urlencoded filename for accented characters. if (!file_exists($file_or_dir)) { @@ -1556,7 +1553,7 @@ $fd = $upload->open(); if (IsZipFile($fd)) - LoadZip($request, $fd, false, array(_("RecentChanges"))); + LoadZip($request, $fd, array(), array(_("RecentChanges"))); else LoadFile($request, $upload->getName(), $upload->getContents()); Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-09-29 15:22:36 UTC (rev 9133) +++ trunk/lib/main.php 2014-09-29 15:24:11 UTC (rev 9134) @@ -832,7 +832,7 @@ } } - function finish($errormsg = false) + function finish($errormsg = '') { static $in_exit = 0; Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2014-09-29 15:22:36 UTC (rev 9133) +++ trunk/lib/ziplib.php 2014-09-29 15:24:11 UTC (rev 9134) @@ -271,18 +271,15 @@ header("Content-Disposition: attachment; filename=\"$zipname\""); } - function addSrcFile($target, $src, $attrib = false) + function addSrcFile($target, $src, $attrib = array()) { if (empty($attrib['mtime'])) $attrib = array('mtime' => filemtime($src), 'is_ascii' => 0); $this->addRegularFile($target, file_get_contents($src), $attrib); } - function addRegularFile($filename, $content, $attrib = false) + function addRegularFile($filename, $content, $attrib = array()) { - if (!$attrib) - $attrib = array(); - $size = strlen($content); if (function_exists('gzopen')) { list ($data, $crc32, $os_type) = zip_deflate($content); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <var...@us...> - 2014-10-01 15:28:43
|
Revision: 9149 http://sourceforge.net/p/phpwiki/code/9149 Author: vargenau Date: 2014-10-01 15:28:36 +0000 (Wed, 01 Oct 2014) Log Message: ----------- PHP Doc update Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/WikiPlugin.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-10-01 15:25:56 UTC (rev 9148) +++ trunk/lib/PageList.php 2014-10-01 15:28:36 UTC (rev 9149) @@ -184,6 +184,11 @@ $this->_field = $field; } + /** + * @param WikiDB_Page $page_handle + * @param WikiDB_PageRevision $revision_handle + * @return mixed + */ function _getValue($page_handle, &$revision_handle) { if ($this->_need_rev) { @@ -196,6 +201,11 @@ } } + /** + * @param WikiDB_Page $page_handle + * @param WikiDB_PageRevision $revision_handle + * @return int|string + */ function _getSortableValue($page_handle, &$revision_handle) { $val = $this->_getValue($page_handle, $revision_handle); Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2014-10-01 15:25:56 UTC (rev 9148) +++ trunk/lib/WikiPlugin.php 2014-10-01 15:28:36 UTC (rev 9149) @@ -101,6 +101,12 @@ return _('This plugin has no description.'); } + /** + * @param string $argstr + * @param WikiRequest $request + * @param array $defaults + * @return array + */ function getArgs($argstr, $request = false, $defaults = array()) { if (empty($defaults)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 14:11:28
|
Revision: 9171 http://sourceforge.net/p/phpwiki/code/9171 Author: vargenau Date: 2014-10-03 14:11:26 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function gzencode exists Modified Paths: -------------- trunk/lib/stdlib.php trunk/lib/ziplib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-03 13:59:53 UTC (rev 9170) +++ trunk/lib/stdlib.php 2014-10-03 14:11:26 UTC (rev 9171) @@ -1792,8 +1792,7 @@ function phpwiki_gzhandler($ob) { - if (function_exists('gzencode')) - $ob = gzencode($ob); + $ob = gzencode($ob); $GLOBALS['request']->_ob_get_length = strlen($ob); if (!headers_sent()) { header(sprintf("Content-Length: %d", $GLOBALS['request']->_ob_get_length)); Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2014-10-03 13:59:53 UTC (rev 9170) +++ trunk/lib/ziplib.php 2014-10-03 14:11:26 UTC (rev 9171) @@ -157,10 +157,7 @@ function zip_deflate($content) { // Compress content, and suck information from gzip header. - if (function_exists('gzencode')) - $z = gzencode($content); - else - $z = gzip_compress($content); + $z = gzencode($content); // Suck OS type byte from gzip header. FIXME: this smells bad. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 14:38:57
|
Revision: 9175 http://sourceforge.net/p/phpwiki/code/9175 Author: vargenau Date: 2014-10-03 14:38:55 +0000 (Fri, 03 Oct 2014) Log Message: ----------- gzcompress, gzuncompress, gzinflate and gzopen exist Modified Paths: -------------- trunk/lib/CachedMarkup.php trunk/lib/ziplib.php Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2014-10-03 14:26:30 UTC (rev 9174) +++ trunk/lib/CachedMarkup.php 2014-10-03 14:38:55 UTC (rev 9175) @@ -49,12 +49,7 @@ return serialize($this); } - if (function_exists('gzcompress')) - return gzcompress(serialize($this), 9); - return serialize($this); - - // FIXME: probably should implement some sort of "compression" - // when no gzcompress is available. + return gzcompress(serialize($this), 9); } function unpack($packed) @@ -69,17 +64,9 @@ or (substr($packed, 0, 2) == "x\332") ) // 120, 218 { - if (function_exists('gzuncompress')) { - // Looks like ZLIB. - $data = gzuncompress($packed); - return unserialize($data); - } else { - // user our php lib. TESTME - include_once 'ziplib.php'; - $zip = new ZipReader($packed); - list(, $data, $attrib) = $zip->readFile(); - return unserialize($data); - } + // Looks like ZLIB. + $data = gzuncompress($packed); + return unserialize($data); } if (substr($packed, 0, 2) == "O:") { // Looks like a serialized object Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2014-10-03 14:26:30 UTC (rev 9174) +++ trunk/lib/ziplib.php 2014-10-03 14:38:55 UTC (rev 9175) @@ -186,33 +186,19 @@ function zip_inflate($data, $crc32, $uncomp_size) { - if (function_exists('gzinflate')) { - $data = gzinflate($data); - if (strlen($data) != $uncomp_size) - trigger_error("not enough output from gzinflate", E_USER_ERROR); - $zcrc32 = zip_crc32($data); - if ($zcrc32 < 0) { // force unsigned - $zcrc32 += 4294967296; - } - if ($crc32 < 0) { // force unsigned - $crc32 += 4294967296; - } - if ($zcrc32 != $crc32) - trigger_error("CRC32 mismatch: calculated=$zcrc32, expected=$crc32", E_USER_ERROR); - return $data; + $data = gzinflate($data); + if (strlen($data) != $uncomp_size) + trigger_error("not enough output from gzinflate", E_USER_ERROR); + $zcrc32 = zip_crc32($data); + if ($zcrc32 < 0) { // force unsigned + $zcrc32 += 4294967296; } - - if (!function_exists('gzopen')) { - global $request; - $request->finish(_("Can't inflate data: zlib support not enabled in this PHP")); + if ($crc32 < 0) { // force unsigned + $crc32 += 4294967296; } - - // Reconstruct gzip header and ungzip the data. - $mtime = time(); //(Bogus mtime) - - return gzip_uncompress(pack("a2CxV@10", GZIP_MAGIC, GZIP_DEFLATE, $mtime) - . $data - . pack("VV", $crc32, $uncomp_size)); + if ($zcrc32 != $crc32) + trigger_error("CRC32 mismatch: calculated=$zcrc32, expected=$crc32", E_USER_ERROR); + return $data; } function unixtime2dostime($unix_time) @@ -278,18 +264,12 @@ function addRegularFile($filename, $content, $attrib = array()) { $size = strlen($content); - if (function_exists('gzopen')) { - list ($data, $crc32, $os_type) = zip_deflate($content); - if (strlen($data) < $size) { - $content = $data; // Use compressed data. - $comp_type = ZIP_DEFLATE; - } else - unset($crc32); // force plain store. - } else { - // Punt: - $os_type = 3; // 0 = FAT --- hopefully this is good enough. - /* (Another choice might be 3 = Unix) */ - } + list ($data, $crc32, $os_type) = zip_deflate($content); + if (strlen($data) < $size) { + $content = $data; // Use compressed data. + $comp_type = ZIP_DEFLATE; + } else + unset($crc32); // force plain store. if (!isset($crc32)) { $comp_type = ZIP_STORE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 14:54:37
|
Revision: 9179 http://sourceforge.net/p/phpwiki/code/9179 Author: vargenau Date: 2014-10-03 14:54:29 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function ImageTypes exists Modified Paths: -------------- trunk/lib/WikiPluginCached.php trunk/lib/plugin/TeX2png.php Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-10-03 14:47:32 UTC (rev 9178) +++ trunk/lib/WikiPluginCached.php 2014-10-03 14:54:29 UTC (rev 9179) @@ -539,16 +539,10 @@ 'xbm' => IMG_XBM, */ ); - if (function_exists('ImageTypes')) { - $presenttypes = ImageTypes(); - foreach ($imagetypes as $imgtype => $bitmask) - if ($presenttypes && $bitmask) - array_push($supportedtypes, $imgtype); - } else { - foreach ($imagetypes as $imgtype => $bitmask) - if (function_exists("Image" . $imgtype)) - array_push($supportedtypes, $imgtype); - } + $presenttypes = ImageTypes(); + foreach ($imagetypes as $imgtype => $bitmask) + if ($presenttypes && $bitmask) + array_push($supportedtypes, $imgtype); if (in_array($wish, $supportedtypes)) return $wish; elseif (!empty($supportedtypes)) Modified: trunk/lib/plugin/TeX2png.php =================================================================== --- trunk/lib/plugin/TeX2png.php 2014-10-03 14:47:32 UTC (rev 9178) +++ trunk/lib/plugin/TeX2png.php 2014-10-03 14:54:29 UTC (rev 9179) @@ -221,9 +221,7 @@ function run($dbi, $argstr, &$request, $basepage) { // from text2png.php - if ((function_exists('ImageTypes') and (ImageTypes() & IMG_PNG)) - or function_exists("ImagePNG") - ) { + if (ImageTypes() & IMG_PNG) { // we have gd & png so go ahead. extract($this->getArgs($argstr, $request)); return $this->tex2png($text); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-06 09:25:38
|
Revision: 9190 http://sourceforge.net/p/phpwiki/code/9190 Author: vargenau Date: 2014-10-06 09:25:36 +0000 (Mon, 06 Oct 2014) Log Message: ----------- Update PHP Doc Modified Paths: -------------- trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2014-10-06 08:55:30 UTC (rev 9189) +++ trunk/lib/WikiPlugin.php 2014-10-06 09:25:36 UTC (rev 9190) @@ -32,7 +32,13 @@ return false; } - // FIXME: args? + /** + * @param WikiDB $dbi + * @param string $argstr + * @param WikiRequest $request + * @param string $basepage + * @return mixed + */ function run($dbi, $argstr, &$request, $basepage) { trigger_error("WikiPlugin::run: pure virtual function", E_USER_ERROR); @@ -371,16 +377,25 @@ } // box is used to display a fixed-width, narrow version with common header - function box($args = false, $request = false, $basepage = false) + /** + * @param string $args + * @param WikiRequest $request + * @param string $basepage + * @return $this|HtmlElement + */ + function box($args = '', $request = null, $basepage = '') { - if (!$request) $request =& $GLOBALS['request']; - $dbi = $request->getDbh(); + if (!$request) { + $request =& $GLOBALS['request']; + } $dbi = $request->getDbh(); return $this->makeBox('', $this->run($dbi, $args, $request, $basepage)); } function makeBox($title, $body) { - if (!$title) $title = $this->getName(); + if (!$title) { + $title = $this->getName(); + } return HTML::div(array('class' => 'box'), HTML::div(array('class' => 'box-title'), $title), HTML::div(array('class' => 'box-data'), $body)); @@ -538,7 +553,6 @@ $ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_plugin_error_filter')); $plugin_class = "WikiPlugin_$plugin_name"; if (!class_exists($plugin_class)) { - // $include_failed = !@include_once("lib/plugin/$plugin_name.php"); $include_failed = !include_once($plugin_source); $ErrorManager->popErrorHandler(); Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-10-06 08:55:30 UTC (rev 9189) +++ trunk/lib/WikiPluginCached.php 2014-10-06 09:25:36 UTC (rev 9190) @@ -126,7 +126,7 @@ * * @param WikiDB $dbi database abstraction class * @param string $argstr plugin arguments in the call from PhpWiki - * @param Request $request + * @param WikiRequest $request * @param string $basepage Pagename to use to interpret links [/relative] page names. * @return string HTML output to be printed to browser * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-06 10:19:38
|
Revision: 9195 http://sourceforge.net/p/phpwiki/code/9195 Author: vargenau Date: 2014-10-06 10:19:30 +0000 (Mon, 06 Oct 2014) Log Message: ----------- Update PHP Doc; type compatibility Modified Paths: -------------- trunk/lib/plugin/GraphViz.php trunk/lib/plugin/RecentChangesCached.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/VisualWiki.php trunk/lib/wikilens/RatingsDb.php Modified: trunk/lib/plugin/GraphViz.php =================================================================== --- trunk/lib/plugin/GraphViz.php 2014-10-06 10:04:20 UTC (rev 9194) +++ trunk/lib/plugin/GraphViz.php 2014-10-06 10:19:30 UTC (rev 9195) @@ -205,7 +205,7 @@ array(255, 255, 255)); } - function processSource($argarray = false) + function processSource($argarray = array()) { if (empty($this->source)) { // create digraph from pages @@ -240,7 +240,12 @@ return $source; } - function createDotFile($tempfile = '', $argarray = false) + /** + * @param string $tempfile + * @param array $argarray + * @return mixed + */ + function createDotFile($tempfile = '', $argarray = array()) { $this->source = $this->processSource($argarray); if (!$this->source) Modified: trunk/lib/plugin/RecentChangesCached.php =================================================================== --- trunk/lib/plugin/RecentChangesCached.php 2014-10-06 10:04:20 UTC (rev 9194) +++ trunk/lib/plugin/RecentChangesCached.php 2014-10-06 10:19:30 UTC (rev 9195) @@ -79,7 +79,7 @@ // ->box is used to display a fixed-width, narrow version with common header. // Just a limited list of pagenames, without date. // This does not use ->run, to avoid pi construction and deconstruction - function box($args = false, $request = false, $basepage = false, $do_save = false) + function box($args = '', $request = null, $basepage = '', $do_save = false) { if (!$request) $request =& $GLOBALS['request']; if (!isset($args['limit'])) $args['limit'] = 12; Modified: trunk/lib/plugin/SiteMap.php =================================================================== --- trunk/lib/plugin/SiteMap.php 2014-10-06 10:04:20 UTC (rev 9194) +++ trunk/lib/plugin/SiteMap.php 2014-10-06 10:19:30 UTC (rev 9195) @@ -144,7 +144,7 @@ { include_once 'lib/BlockParser.php'; - $args = $this->getArgs($argstr, $request, false); + $args = $this->getArgs($argstr, $request, array()); extract($args); if (!$page) return ''; Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2014-10-06 10:04:20 UTC (rev 9194) +++ trunk/lib/plugin/VisualWiki.php 2014-10-06 10:19:30 UTC (rev 9195) @@ -397,7 +397,7 @@ * <code>dot</code>. * * @param string $filename - * @param bool $argarray + * @param array $argarray * @internal param string $filename name of the dot file to be created * @internal param float $width width of the output graph in inches * @internal param float $height height of the graph in inches Modified: trunk/lib/wikilens/RatingsDb.php =================================================================== --- trunk/lib/wikilens/RatingsDb.php 2014-10-06 10:04:20 UTC (rev 9194) +++ trunk/lib/wikilens/RatingsDb.php 2014-10-06 10:19:30 UTC (rev 9195) @@ -417,7 +417,7 @@ * If this is null (or left off), the search for ratings * is not restricted by dimension. * - * @param rater The page id of the rater, i.e. page doing the rating. + * @param int $rater The page id of the rater, i.e. page doing the rating. * This is a Wiki page id, often of a user page. * Example: "DanFr" * [optional] @@ -425,21 +425,21 @@ * is not restricted by rater. * TODO: Support an array * - * @param ratee The page id of the ratee, i.e. page being rated. + * @param int $ratee The page id of the ratee, i.e. page being rated. * Example: "DudeWheresMyCar" * [optional] * If this is null (or left off), the search for ratings * is not restricted by ratee. * TODO: Support an array * - * @param orderby An order-by clause with fields and (optionally) ASC + * @param string $orderby An order-by clause with fields and (optionally) ASC * or DESC. * Example: "ratingvalue DESC" * [optional] * If this is null (or left off), the search for ratings * has no guaranteed order * - * @param pageinfo The type of page that has its info returned (i.e., + * @param string $pageinfo The type of page that has its info returned (i.e., * 'pagename', 'hits', and 'pagedata') in the rows. * Example: "rater" * [optional] @@ -448,6 +448,7 @@ * * @return DB iterator with results */ + function sql_get_rating($dimension = null, $rater = null, $ratee = null, $orderby = null, $pageinfo = "ratee") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-06 14:39:49
|
Revision: 9199 http://sourceforge.net/p/phpwiki/code/9199 Author: vargenau Date: 2014-10-06 14:39:41 +0000 (Mon, 06 Oct 2014) Log Message: ----------- protected function pngArg Modified Paths: -------------- trunk/lib/WikiPluginCached.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/Ploticus.php Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-10-06 12:49:21 UTC (rev 9198) +++ trunk/lib/WikiPluginCached.php 2014-10-06 14:39:41 UTC (rev 9199) @@ -421,6 +421,19 @@ } /** + * Which argument must be set to 'png', for the fallback image when svg + * will fail on the client. + * type: SVG_PNG + * + * @return string + */ + protected function pngArg() + { + trigger_error('WikiPluginCached::pngArg: pure virtual function in file ' + . __FILE__ . ' line ' . __LINE__, E_USER_ERROR); + } + + /** * Creates an HTML <img> tag hyperlinking to the specified * url and produces an alternative text for non-graphical * browsers. Modified: trunk/lib/plugin/GraphViz.php =================================================================== --- trunk/lib/plugin/GraphViz.php 2014-10-06 12:49:21 UTC (rev 9198) +++ trunk/lib/plugin/GraphViz.php 2014-10-06 14:39:41 UTC (rev 9199) @@ -319,9 +319,14 @@ return $outfile; } - // which argument must be set to 'png', for the fallback image when svg will fail on the client. - // type: SVG_PNG - function pngArg() + /** + * Which argument must be set to 'png', for the fallback image when svg + * will fail on the client. + * type: SVG_PNG + * + * @return string + */ + protected function pngArg() { return 'imgtype'; } Modified: trunk/lib/plugin/Ploticus.php =================================================================== --- trunk/lib/plugin/Ploticus.php 2014-10-06 12:49:21 UTC (rev 9198) +++ trunk/lib/plugin/Ploticus.php 2014-10-06 14:39:41 UTC (rev 9199) @@ -277,9 +277,14 @@ return "$tempfile.$gif"; } - // which argument must be set to 'png', for the fallback image when svg will fail on the client. - // type: SVG_PNG - function pngArg() + /** + * Which argument must be set to 'png', for the fallback image when svg + * will fail on the client. + * type: SVG_PNG + * + * @return string + */ + protected function pngArg() { return 'device'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-06 17:17:27
|
Revision: 9204 http://sourceforge.net/p/phpwiki/code/9204 Author: vargenau Date: 2014-10-06 17:17:24 +0000 (Mon, 06 Oct 2014) Log Message: ----------- Let us put some abstraction Modified Paths: -------------- trunk/lib/BlockParser.php trunk/lib/CachedMarkup.php trunk/lib/InlineParser.php trunk/lib/PageType.php trunk/lib/WikiCallback.php trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php trunk/lib/WysiwygEdit.php trunk/lib/difflib.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/Ploticus.php trunk/lib/plugin/RecentChangesCached.php trunk/lib/plugin/SystemInfo.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/VisualWiki.php Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/BlockParser.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -501,14 +501,11 @@ } } -class BlockMarkup +abstract class BlockMarkup { public $_re; - function _match(&$input, $match) - { - trigger_error('pure virtual', E_USER_ERROR); - } + abstract function _match(&$input, $match); function _setTightness($top, $bot) { Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/CachedMarkup.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -243,7 +243,7 @@ * Dynamic content is anything that can change even when the original * wiki-text from which it was parsed is unchanged. */ -class Cached_DynamicContent +abstract class Cached_DynamicContent { function cache(&$cache) @@ -251,10 +251,7 @@ $cache[] = $this; } - function expand($basepage, &$obj) - { - trigger_error("Pure virtual", E_USER_ERROR); - } + abstract protected function expand($basepage, &$obj); function getWikiPageLinks($basepage) { @@ -274,7 +271,7 @@ } } -class Cached_Link extends Cached_DynamicContent +abstract class Cached_Link extends Cached_DynamicContent { function isInlineElement() Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/InlineParser.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -234,7 +234,7 @@ * When a match is found for the regexp, the matching text is replaced. * The replacement content is obtained by calling the SimpleMarkup::markup method. */ -class SimpleMarkup +abstract class SimpleMarkup { public $_match_regexp; @@ -254,10 +254,7 @@ * * @return mixed The expansion of the matched text. */ - function markup($match /*, $body */) - { - trigger_error("pure virtual", E_USER_ERROR); - } + abstract function markup($match /*, $body */); } /** @@ -265,7 +262,7 @@ * * These are defined by a start regexp, and an end regexp. */ -class BalancedMarkup +abstract class BalancedMarkup { public $_start_regexp; @@ -298,10 +295,7 @@ * * @return mixed The expansion of the matched text. */ - function markup($match, $body) - { - trigger_error("pure virtual", E_USER_ERROR); - } + abstract function markup($match, $body); } class Markup_escape extends SimpleMarkup Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/PageType.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -359,7 +359,7 @@ /** How to transform text. */ -class PageFormatter +abstract class PageFormatter { /** * @param WikiDB_Page $page @@ -382,10 +382,7 @@ * @param string $text The raw page content (e.g. wiki-text). * @return XmlContent Transformed content. */ - function format($text) - { - trigger_error("pure virtual", E_USER_ERROR); - } + abstract function format($text); } class PageFormatter_wikitext extends PageFormatter Modified: trunk/lib/WikiCallback.php =================================================================== --- trunk/lib/WikiCallback.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/WikiCallback.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -10,7 +10,7 @@ * * @see WikiFunctionCb, WikiMethodCb. */ -class WikiCallback +abstract class WikiCallback { /** * Convert from Pear-style callback specification to a WikiCallback. @@ -55,10 +55,7 @@ * @return mixed The return value of the callback. * @see call_user_func_array. */ - public function call_array($args) - { - trigger_error('pure virtual', E_USER_ERROR); - } + abstract public function call_array($args); /** * Convert to Pear callback. @@ -67,10 +64,7 @@ * (This value is suitable for passing as the callback parameter * to a number of different Pear functions and methods.) */ - public function toPearCb() - { - trigger_error('pure virtual', E_USER_ERROR); - } + abstract public function toPearCb(); } /** Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/WikiPlugin.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -1,6 +1,6 @@ <?php -class WikiPlugin +abstract class WikiPlugin { public $_pi; @@ -39,11 +39,7 @@ * @param string $basepage * @return mixed */ - function run($dbi, $argstr, &$request, $basepage) - { - trigger_error("WikiPlugin::run: pure virtual function", E_USER_ERROR); - return false; - } + abstract public function run($dbi, $argstr, &$request, $basepage); /** Get wiki-pages linked to by plugin invocation. * @@ -102,10 +98,7 @@ * @return string plugin description */ - function getDescription() - { - return _('This plugin has no description.'); - } + abstract protected function getDescription(); /** * @param string $argstr Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/WikiPluginCached.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -55,7 +55,7 @@ * * @author Johannes Große, Reini Urban */ -class WikiPluginCached extends WikiPlugin +abstract class WikiPluginCached extends WikiPlugin { public $_static; @@ -251,7 +251,7 @@ return HTML(); } // run - /* --------------------- virtual or abstract functions ----------- */ + /* --------------------- abstract functions ----------- */ /** * Sets the type of the plugin to html, image or map @@ -267,10 +267,7 @@ * <li>PLUGIN_CACHED_MAP</li> * </ul> */ - protected function getPluginType() - { - return PLUGIN_CACHED_IMG_ONDEMAND; - } + abstract protected function getPluginType(); /** * Creates an image handle from the given user arguments. @@ -286,12 +283,7 @@ * @return mixed imagehandle image handle if successful * false if an error occured */ - protected function getImage($dbi, $argarray, $request) - { - trigger_error('WikiPluginCached::getImage: pure virtual function in file ' - . __FILE__ . ' line ' . __LINE__, E_USER_ERROR); - return false; - } + abstract protected function getImage($dbi, $argarray, $request); /** * Sets the life time of a cache entry in seconds. @@ -363,11 +355,7 @@ * @return string html to be printed in place of the plugin command * false if an error occured */ - protected function getHtml($dbi, $argarray, $request, $basepage) - { - trigger_error('WikiPluginCached::getHtml: pure virtual function in file ' - . __FILE__ . ' line ' . __LINE__, E_USER_ERROR); - } + abstract protected function getHtml($dbi, $argarray, $request, $basepage); /** * Creates HTML output to be cached. @@ -385,11 +373,7 @@ * image. * array(false,false) if an error occured */ - protected function getMap($dbi, $argarray, $request) - { - trigger_error('WikiPluginCached::getHtml: pure virtual function in file ' - . __FILE__ . ' line ' . __LINE__, E_USER_ERROR); - } + abstract protected function getMap($dbi, $argarray, $request); /* --------------------- produce Html ----------------------------- */ Modified: trunk/lib/WysiwygEdit.php =================================================================== --- trunk/lib/WysiwygEdit.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/WysiwygEdit.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -23,7 +23,7 @@ require_once 'lib/InlineParser.php'; -class WysiwygEdit +abstract class WysiwygEdit { function WysiwygEdit() @@ -31,16 +31,10 @@ $this->_transformer_tags = false; } - function Head($name = 'edit[content]') - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function Head($name = 'edit[content]'); // to be called after </textarea> - function Textarea($textarea, $wikitext, $name = 'edit[content]') - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function Textarea($textarea, $wikitext, $name = 'edit[content]'); /** * Handler to convert the Wiki Markup to HTML before editing. Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/difflib.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -8,16 +8,13 @@ // You may copy this code freely under the conditions of the GPL. // -class _DiffOp +abstract class _DiffOp { public $type; public $orig; public $final; - function reverse() - { - trigger_error("pure virtual", E_USER_ERROR); - } + abstract function reverse(); function norig() { Modified: trunk/lib/plugin/CacheTest.php =================================================================== --- trunk/lib/plugin/CacheTest.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/CacheTest.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -54,7 +54,7 @@ class WikiPlugin_CacheTest extends WikiPluginCached { - /* --------- overwrite virtual or abstract methods ---------------- */ + /* --------- overwrite abstract methods ---------------- */ function getPluginType() { @@ -80,7 +80,7 @@ // image handle to an error image if you do not, // WikiPluginImageCache will do so. - function getImage($dbi, $argarray, $request) + protected function getImage($dbi, $argarray, $request) { extract($argarray); return $this->produceGraphics($text, $font); Modified: trunk/lib/plugin/GraphViz.php =================================================================== --- trunk/lib/plugin/GraphViz.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/GraphViz.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -261,7 +261,7 @@ return $ok ? $tempfile : false; } - function getImage($dbi, $argarray, $request) + protected function getImage($dbi, $argarray, $request) { $dotbin = GRAPHVIZ_EXE; $tempfiles = $this->tempnam($this->getName()); @@ -331,7 +331,7 @@ return 'imgtype'; } - function getMap($dbi, $argarray, $request) + protected function getMap($dbi, $argarray, $request) { $result = $this->invokeDot($argarray); if (isa($result, 'HtmlElement')) Modified: trunk/lib/plugin/LinkDatabase.php =================================================================== --- trunk/lib/plugin/LinkDatabase.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/LinkDatabase.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -74,11 +74,21 @@ * @param string $basepage * @return mixed */ - function getHtml($dbi, $argarray, $request, $basepage) + protected function getHtml($dbi, $argarray, $request, $basepage) { $this->run($dbi, WikiPluginCached::glueArgs($argarray), $request, $basepage); } + protected function getImage($dbi, $argarray, $request) + { + trigger_error('pure virtual', E_USER_ERROR); + } + + protected function getMap($dbi, $argarray, $request) + { + trigger_error('pure virtual', E_USER_ERROR); + } + /** * @param WikiDB $dbi * @param string $argstr Modified: trunk/lib/plugin/Ploticus.php =================================================================== --- trunk/lib/plugin/Ploticus.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/Ploticus.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -202,7 +202,7 @@ return 1; } - function getImage($dbi, $argarray, $request) + protected function getImage($dbi, $argarray, $request) { $source =& $this->source; if (empty($source)) { @@ -289,7 +289,7 @@ return 'device'; } - function getMap($dbi, $argarray, $request) + protected function getMap($dbi, $argarray, $request) { $img = $this->getImage($dbi, $argarray, $request); return array($this->_mapfile, $img); Modified: trunk/lib/plugin/RecentChangesCached.php =================================================================== --- trunk/lib/plugin/RecentChangesCached.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/RecentChangesCached.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -63,7 +63,7 @@ * @param string $basepage * @return mixed */ - function getHtml($dbi, $args, $request, $basepage) + protected function getHtml($dbi, $args, $request, $basepage) { $plugin = new WikiPlugin_RecentChanges(); $changes = $plugin->getChanges($dbi, $args); @@ -76,6 +76,16 @@ */ } + protected function getImage($dbi, $argarray, $request) + { + trigger_error('pure virtual', E_USER_ERROR); + } + + protected function getMap($dbi, $argarray, $request) + { + trigger_error('pure virtual', E_USER_ERROR); + } + // ->box is used to display a fixed-width, narrow version with common header. // Just a limited list of pagenames, without date. // This does not use ->run, to avoid pi construction and deconstruction Modified: trunk/lib/plugin/SystemInfo.php =================================================================== --- trunk/lib/plugin/SystemInfo.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/SystemInfo.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -78,7 +78,7 @@ * @param string $basepage * @return mixed */ - function getHtml($dbi, $argarray, $request, $basepage) + protected function getHtml($dbi, $argarray, $request, $basepage) { $loader = new WikiPluginLoader(); return $loader->expandPI('<<SystemInfo ' @@ -86,6 +86,16 @@ . ' ?>', $request, $this, $basepage); } + protected function getImage($dbi, $argarray, $request) + { + trigger_error('pure virtual', E_USER_ERROR); + } + + protected function getMap($dbi, $argarray, $request) + { + trigger_error('pure virtual', E_USER_ERROR); + } + function getDefaultArguments() { return array( // 'seperator' => ' ', // on multiple args Modified: trunk/lib/plugin/TexToPng.php =================================================================== --- trunk/lib/plugin/TexToPng.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/TexToPng.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -115,13 +115,17 @@ 'center' => 'off'); } - function getImage($dbi, $argarray, $request) + protected function getImage($dbi, $argarray, $request) { extract($argarray); $this->checkParams($tex, $magstep, $subslash, $antialias, $transparent); return $this->TexToImg($tex, $magstep, $antialias, $transparent); - } // run + } + protected function getMap($dbi, $argarray, $request) + { + } + function getExpire($dbi, $argarray, $request) { return '0'; Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2014-10-06 17:15:30 UTC (rev 9203) +++ trunk/lib/plugin/VisualWiki.php 2014-10-06 17:17:24 UTC (rev 9204) @@ -134,7 +134,7 @@ * @param Request $request * @return array($map,$html) */ - function getMap($dbi, $argarray, $request) + protected function getMap($dbi, $argarray, $request) { if (!VISUALWIKI_ALLOWOPTIONS) $argarray = $this->defaultarguments(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-07 08:06:04
|
Revision: 9206 http://sourceforge.net/p/phpwiki/code/9206 Author: vargenau Date: 2014-10-07 08:05:55 +0000 (Tue, 07 Oct 2014) Log Message: ----------- Remove unused function explodeList Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/stdlib.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2014-10-07 07:54:52 UTC (rev 9205) +++ trunk/lib/PageList.php 2014-10-07 08:05:55 UTC (rev 9206) @@ -1112,8 +1112,6 @@ * Test* or Test1,Test2 * Limitation: Doesn't split into comma-sep and then expand wildcards. * "Test1*,Test2*" is expanded into TextSearch "Test1* Test2*" - * - * echo implode(":",explodeList("Test*",array("xx","Test1","Test2"))); */ function explodePageList($input, $include_empty = false, $sortby = '', $limit = '', $exclude = '') Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-07 07:54:52 UTC (rev 9205) +++ trunk/lib/stdlib.php 2014-10-07 08:05:55 UTC (rev 9206) @@ -61,7 +61,6 @@ glob_to_pcre ($glob) glob_match ($glob, $against, $case_sensitive = true) - explodeList ($input, $allnames, $glob_style = true, $case_sensitive = true) explodePageList ($input, $perm = false) isa ($object, $class) can ($object, $method) @@ -1512,27 +1511,6 @@ $against); } -function explodeList($input, $allnames, $glob_style = true, $case_sensitive = true) -{ - $list = explode(',', $input); - // expand wildcards from list of $allnames - if (preg_match('/[\?\*]/', $input)) { - // Optimizing loop invariants: - // http://phplens.com/lens/php-book/optimizing-debugging-php.php - for ($i = 0, $max = sizeof($list); $i < $max; $i++) { - $f = $list[$i]; - if (preg_match('/[\?\*]/', $f)) { - reset($allnames); - $expand = new ListRegexExpand($list, - $glob_style ? glob_to_pcre($f) : $f, $case_sensitive); - $expand->expandRegex($i, $allnames); - } - } - } - return $list; -} - -// echo implode(":",explodeList("Test*",array("xx","Test1","Test2"))); function explodePageList($input, $include_empty = false, $sortby = 'pagename', $limit = '', $exclude = '') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-07 08:31:59
|
Revision: 9208 http://sourceforge.net/p/phpwiki/code/9208 Author: vargenau Date: 2014-10-07 08:31:56 +0000 (Tue, 07 Oct 2014) Log Message: ----------- Remove useless function fixTitleEncoding Modified Paths: -------------- trunk/lib/main.php trunk/lib/stdlib.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-10-07 08:27:17 UTC (rev 9207) +++ trunk/lib/main.php 2014-10-07 08:31:56 UTC (rev 9208) @@ -865,8 +865,6 @@ /** * Generally pagename is rawurlencoded for older browsers or mozilla. - * Typing a pagename into the IE bar will utf-8 encode it, so we have to - * fix that with fixTitleEncoding(). * If USE_PATH_INFO = true, the pagename is stripped from the "/DATA_PATH/PageName&arg=value" line. * If false, we support either "/index.php?pagename=PageName&arg=value", * or the first arg (1.2.x style): "/index.php?PageName&arg=value" @@ -874,7 +872,7 @@ function _deducePagename() { if (trim(rawurldecode($this->getArg('pagename')))) - return fixTitleEncoding(rawurldecode($this->getArg('pagename'))); + return rawurldecode($this->getArg('pagename')); if (USE_PATH_INFO) { $pathinfo = $this->get('PATH_INFO'); @@ -887,7 +885,7 @@ $tail = substr($pathinfo, strlen(PATH_INFO_PREFIX)); if (trim($tail) != '' and $pathinfo == PATH_INFO_PREFIX . $tail) { - return fixTitleEncoding($tail); + return $tail; } } elseif ($this->isPost()) { /* @@ -904,7 +902,7 @@ */ global $HTTP_GET_VARS; if (isset($HTTP_GET_VARS['pagename']) and trim($HTTP_GET_VARS['pagename'])) { - return fixTitleEncoding(rawurldecode($HTTP_GET_VARS['pagename'])); + return rawurldecode($HTTP_GET_VARS['pagename']); } } @@ -914,10 +912,10 @@ */ $query_string = $this->get('QUERY_STRING'); if (trim(rawurldecode($query_string)) and preg_match('/^([^&=]+)(&.+)?$/', $query_string, $m)) { - return fixTitleEncoding(rawurldecode($m[1])); + return rawurldecode($m[1]); } - return fixTitleEncoding(HOME_PAGE); + return HOME_PAGE; } function _deduceAction() Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-07 08:27:17 UTC (rev 9207) +++ trunk/lib/stdlib.php 2014-10-07 08:31:56 UTC (rev 9208) @@ -73,7 +73,6 @@ phpwiki_version () isWikiWord ($word) obj2hash ($obj, $exclude = false, $fields = false) - fixTitleEncoding ($s) url_get_contents ($uri) GenerateId ($name) firstNWordsOfContent ($n, $content) @@ -1776,19 +1775,6 @@ } /** - * Check for UTF-8 URLs; Internet Explorer produces these if you - * type non-ASCII chars in the URL bar or follow unescaped links. - * Requires urldecoded pagename. - * Fixes sf.net bug #953949 - * - * src: languages/Language.php:checkTitleEncoding() from mediawiki - */ -function fixTitleEncoding($s) -{ - return $s; -} - -/** * Workaround for allow_url_fopen, to get the content of an external URI. * It returns the contents in one slurp. Parsers might want to check for allow_url_fopen * and use fopen, fread chunkwise. (see lib/XmlParser.php) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-07 16:56:37
|
Revision: 9219 http://sourceforge.net/p/phpwiki/code/9219 Author: vargenau Date: 2014-10-07 16:56:35 +0000 (Tue, 07 Oct 2014) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/plugin/RateIt.php trunk/lib/wikilens/PageListColumns.php Modified: trunk/lib/plugin/RateIt.php =================================================================== --- trunk/lib/plugin/RateIt.php 2014-10-07 15:48:30 UTC (rev 9218) +++ trunk/lib/plugin/RateIt.php 2014-10-07 16:56:35 UTC (rev 9219) @@ -263,7 +263,7 @@ if ($page->get('public')) $html->setAttr('class', "public"); } - $html->setAttr('id', "rateit-widget-top"); + $html->setAttr('id', 'rateit-widget-top'); $html->pushContent(HTML::br(), $this->RatingWidgetHtml($args['pagename'], $args['version'], $args['imgPrefix'], Modified: trunk/lib/wikilens/PageListColumns.php =================================================================== --- trunk/lib/wikilens/PageListColumns.php 2014-10-07 15:48:30 UTC (rev 9218) +++ trunk/lib/wikilens/PageListColumns.php 2014-10-07 16:56:35 UTC (rev 9219) @@ -57,7 +57,7 @@ class _PageList_Column_coagreement extends _PageList_Column_custom { - function _PageList_Column_coagreement($params) + function __construct($params) { $this->_pagelist =& $params[3]; $this->_PageList_Column($params[0], $params[1], $params[2]); @@ -90,7 +90,7 @@ class _PageList_Column_minmisery extends _PageList_Column_custom { - function _PageList_Column_minmisery($params) + function __construct($params) { $this->_pagelist =& $params[3]; $this->_PageList_Column($params[0], $params[1], $params[2]); @@ -114,7 +114,7 @@ class _PageList_Column_averagerating extends _PageList_Column_custom { - function _PageList_Column_averagerating($params) + function __construct($params) { $this->_pagelist =& $params[3]; $this->_PageList_Column($params[0], $params[1], $params[2]); @@ -150,7 +150,7 @@ public $_user; public $_dimension; - function _PageList_Column_ratingvalue($params) + function __construct($params) { $this->_pagelist =& $params[3]; $this->_user =& $params[4]; //$this->_pagelist->getOption('user'); @@ -258,7 +258,7 @@ public $_active_ratings_user; public $_users; - function _PageList_Column_prediction($params) + function __construct($params) { global $request; $active_user = $request->getUser(); @@ -310,7 +310,7 @@ public $_active_ratings_user; public $_users; - function _PageList_Column_top3recs($params) + function __construct($params) { global $request; $active_user = $request->getUser(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-09 18:38:02
|
Revision: 9238 http://sourceforge.net/p/phpwiki/code/9238 Author: vargenau Date: 2014-10-09 18:37:59 +0000 (Thu, 09 Oct 2014) Log Message: ----------- Update PHP Doc Modified Paths: -------------- trunk/lib/Request.php trunk/lib/WikiDB.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-10-09 18:36:52 UTC (rev 9237) +++ trunk/lib/Request.php 2014-10-09 18:37:59 UTC (rev 9238) @@ -79,6 +79,10 @@ } } + /** + * @param $key + * @return string|bool + */ function getArg($key) { if (isset($this->args[$key])) Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-10-09 18:36:52 UTC (rev 9237) +++ trunk/lib/WikiDB.php 2014-10-09 18:37:59 UTC (rev 9238) @@ -1133,7 +1133,7 @@ * * @param bool $need_content * - * @return WikiDB_PageRevision The requested WikiDB_PageRevision object, or false if the + * @return WikiDB_PageRevision|bool The requested WikiDB_PageRevision object, or false if the * requested revision does not exist in the {@link WikiDB}. Note that * unless $version is greater than zero, a revision (perhaps version zero, * the default revision) will always be found. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-09 18:39:18
|
Revision: 9239 http://sourceforge.net/p/phpwiki/code/9239 Author: vargenau Date: 2014-10-09 18:39:11 +0000 (Thu, 09 Oct 2014) Log Message: ----------- Add class variables Modified Paths: -------------- trunk/lib/diff.php trunk/lib/diff3.php trunk/lib/difflib.php Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2014-10-09 18:37:59 UTC (rev 9238) +++ trunk/lib/diff.php 2014-10-09 18:39:11 UTC (rev 9239) @@ -12,7 +12,7 @@ class _HWLDF_WordAccumulator { - function _HWLDF_WordAccumulator() + function __construct() { $this->_lines = array(); $this->_line = false; @@ -129,6 +129,15 @@ */ class HtmlUnifiedDiffFormatter extends UnifiedDiffFormatter { + /** + * @var HtmlElement + */ + public $_top; + /** + * @var HtmlElement + */ + public $_block; + function __construct($context_lines = 4) { parent::__construct($context_lines); @@ -199,6 +208,13 @@ ///////////////////////////////////////////////////////////////// +/** + * @param string $label + * @param WikiDB_PageRevision $rev + * @param WikiRequest $request + * @param bool $is_current + * @return $this|HtmlElement + */ function PageInfoRow($label, $rev, &$request, $is_current = false) { global $WikiTheme; @@ -230,6 +246,9 @@ return $row; } +/** + * @param WikiRequest $request + */ function showDiff(&$request) { $pagename = $request->getArg('pagename'); @@ -243,7 +262,6 @@ } // abort if page doesn't exist - $dbi = $request->getDbh(); $page = $request->getPage(); $current = $page->getCurrentRevision(false); if ($current->getVersion() < 1) { @@ -280,12 +298,10 @@ $others = array('major', 'minor'); break; case 'minor': - $previous = 'minor'; $old = $page->getRevisionBefore($new); $old_version = _("previous revision"); $others = array('major', 'author'); break; - case 'major': default: $old = $new; while ($old && $old->get('is_minor_edit')) Modified: trunk/lib/diff3.php =================================================================== --- trunk/lib/diff3.php 2014-10-09 18:37:59 UTC (rev 9238) +++ trunk/lib/diff3.php 2014-10-09 18:39:11 UTC (rev 9239) @@ -44,7 +44,7 @@ { public $type = 'copy'; - function __construct($lines = false) + function __construct($lines = array()) { $this->orig = $lines ? $lines : array(); $this->final1 = &$this->orig; @@ -64,6 +64,10 @@ class _Diff3_BlockBuilder { + public $orig; + public $final1; + public $final2; + function __construct() { $this->_init(); Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2014-10-09 18:37:59 UTC (rev 9238) +++ trunk/lib/difflib.php 2014-10-09 18:39:11 UTC (rev 9239) @@ -115,6 +115,16 @@ */ class _DiffEngine { + public $xchanged; + public $ychanged; + public $xv; + public $yv; + public $xind; + public $yind; + public $lcs; + public $seq; + public $in_seq; + function diff($from_lines, $to_lines) { $n_from = sizeof($from_lines); @@ -612,6 +622,8 @@ * Check a Diff for validity. * * This is here only for debugging purposes. + * @param string $from_lines + * @param string $to_lines */ function _check($from_lines, $to_lines) { @@ -863,7 +875,7 @@ */ class UnifiedDiffFormatter extends DiffFormatter { - function UnifiedDiffFormatter($context_lines = 4) + function __construct($context_lines = 4) { $this->leading_context_lines = $context_lines; $this->trailing_context_lines = $context_lines; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-15 09:10:57
|
Revision: 9262 http://sourceforge.net/p/phpwiki/code/9262 Author: vargenau Date: 2014-10-15 09:10:49 +0000 (Wed, 15 Oct 2014) Log Message: ----------- Better test uploads directory Modified Paths: -------------- trunk/lib/config.php trunk/lib/plugin/UpLoad.php Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2014-10-14 16:44:38 UTC (rev 9261) +++ trunk/lib/config.php 2014-10-15 09:10:49 UTC (rev 9262) @@ -60,8 +60,10 @@ if (strstr($agent, "Mozilla/4.0 (compatible; MSIE")) return (float)substr($agent, 30); elseif (strstr($agent, "Mozilla/5.0 (compatible; Konqueror/")) - return (float)substr($agent, 36); elseif (strstr($agent, "AppleWebKit/")) - return (float)substr($agent, strpos($agent, "AppleWebKit/") + 12); else + return (float)substr($agent, 36); + elseif (strstr($agent, "AppleWebKit/")) + return (float)substr($agent, strpos($agent, "AppleWebKit/") + 12); + else return (float)substr($agent, 8); } @@ -75,7 +77,8 @@ // http://sourceforge.net/tracker/index.php?func=detail&aid=945154&group_id=6121&atid=106121 function isBrowserKonqueror($version = false) { - if ($version) return browserDetect('Konqueror/') and browserVersion() >= $version; + if ($version) + return browserDetect('Konqueror/') and browserVersion() >= $version; return browserDetect('Konqueror/'); } @@ -85,13 +88,15 @@ { $found = browserDetect('Spoofer/'); $found = browserDetect('AppleWebKit/') or $found; - if ($version) return $found and browserVersion() >= $version; + if ($version) + return $found and browserVersion() >= $version; return $found; } function isBrowserOpera($version = false) { - if ($version) return browserDetect('Opera/') and browserVersion() >= $version; + if ($version) + return browserDetect('Opera/') and browserVersion() >= $version; return browserDetect('Opera/'); } @@ -188,8 +193,10 @@ // do the reverse: return the detected locale collapsed to our LANG $locale = setlocale($category, ''); if ($locale) { - if (strstr($locale, '_')) list ($lang) = explode('_', $locale); - else $lang = $locale; + if (strstr($locale, '_')) + list ($lang) = explode('_', $locale); + else + $lang = $locale; if (strlen($lang) > 2) { foreach ($alt as $try => $locs) { if (in_array($locale, $locs) or in_array($lang, $locs)) { @@ -314,10 +321,6 @@ { if (defined('UPLOAD_FILE_PATH')) { - // Force creation of the returned directory if it does not exist. - if (!file_exists(UPLOAD_FILE_PATH)) { - mkdir(UPLOAD_FILE_PATH, 0775, true); - } if (string_ends_with(UPLOAD_FILE_PATH, "/") or string_ends_with(UPLOAD_FILE_PATH, "\\") ) { Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2014-10-14 16:44:38 UTC (rev 9261) +++ trunk/lib/plugin/UpLoad.php 2014-10-15 09:10:49 UTC (rev 9262) @@ -52,7 +52,6 @@ // end of the page (or current page) 'autolink' => true, 'page' => '[pagename]', - 'size' => 50, 'mode' => 'actionpage', // or edit ); } @@ -81,7 +80,7 @@ extract($args); $file_dir = getUploadFilePath(); - $file_dir .= "/"; + $form = HTML::form(array('action' => $request->getPostURL(), 'enctype' => 'multipart/form-data', 'method' => 'post')); @@ -90,8 +89,8 @@ 'name' => 'MAX_FILE_SIZE', 'value' => MAX_UPLOAD_SIZE))); $contents->pushContent(HTML::input(array('name' => 'userfile', - 'type' => 'file', - 'size' => $size))); + 'required' => 'required', + 'type' => 'file'))); if ($mode == 'edit') { $contents->pushContent(HTML::input(array('name' => 'action', 'type' => 'hidden', @@ -122,13 +121,10 @@ ) )); } else { - $message->pushContent(HTML::div(array('class' => 'error'), - HTML::p(_("ACCESS DENIED: You must log in to upload files.")))); + $message->pushContent(HTML::p(array('class' => 'error'), + _("ACCESS DENIED: You must log in to upload files."))); } - $result = HTML(); - $result->pushContent($form); - $result->pushContent($message); - return $result; + return HTML($message, $form); } } @@ -138,20 +134,30 @@ $userfile_name = trim(basename($userfile_name)); if (UPLOAD_USERDIR) { $file_dir .= $request->_user->_userid; - if (!file_exists($file_dir)) - mkdir($file_dir, 0775); $file_dir .= "/"; $u_userfile = $request->_user->_userid . "/" . $userfile_name; } else { $u_userfile = $userfile_name; } + $trimmed_file_dir = rtrim($file_dir, '/'); + + if (file_exists($trimmed_file_dir) && !is_dir($trimmed_file_dir)) { + $message->pushContent(HTML::p(array('class' => 'error'), fmt("Cannot upload, “%s” is not a directory.", $trimmed_file_dir))); + return HTML($message, $form); + } + if (!file_exists($trimmed_file_dir) && !@mkdir($file_dir, 0775)) { + $message->pushContent(HTML::p(array('class' => 'error'), fmt("Cannot create upload directory “%s”.", $file_dir))); + return HTML($message, $form); + } + if (!is_writable($trimmed_file_dir)) { + $message->pushContent(HTML::p(array('class' => 'error'), fmt("Cannot upload, “%s” is not writable.", $file_dir))); + return HTML($message, $form); + } + $u_userfile = preg_replace("/ /", "%20", $u_userfile); $userfile_tmpname = $userfile->getTmpName(); - $err_header = HTML::div(array('class' => 'error'), - HTML::p(fmt("Error uploading “%s”", $userfile_name))); - if (preg_match("/(\." . join("|\.", $this->disallowed_extensions) . ")(\.|\$)/i", - $userfile_name) - ) { + $err_header = HTML::div(array('class' => 'error'), HTML::p(fmt("Error uploading “%s”", $userfile_name))); + if (preg_match("/(\." . join("|\.", $this->disallowed_extensions) . ")(\.|\$)/i", $userfile_name)) { $err_header->pushContent(HTML::p(fmt("Files with extension %s are not allowed.", join(", ", $this->disallowed_extensions)))); $message->pushContent($err_header); @@ -202,15 +208,9 @@ $err_header->pushContent(HTML::p(_("Uploading failed."))); $message->pushContent($err_header); } - } else { - $message->pushContent(HTML::br(), _("No file selected. Please select one."), HTML::br()); } - //$result = HTML::div( array( 'class' => 'wikiaction' ) ); - $result = HTML(); - $result->pushContent($form); - $result->pushContent($message); - return $result; + return HTML($message, $form); } function log($userfile, $upload_log, &$message) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-09 17:21:13
|
Revision: 9290 http://sourceforge.net/p/phpwiki/code/9290 Author: vargenau Date: 2014-11-09 17:21:10 +0000 (Sun, 09 Nov 2014) Log Message: ----------- Type compatibility Modified Paths: -------------- trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php Modified: trunk/lib/WikiPlugin.php =================================================================== --- trunk/lib/WikiPlugin.php 2014-11-08 16:21:41 UTC (rev 9289) +++ trunk/lib/WikiPlugin.php 2014-11-09 17:21:10 UTC (rev 9290) @@ -106,7 +106,7 @@ * @param array $defaults * @return array */ - function getArgs($argstr, $request = false, $defaults = array()) + function getArgs($argstr, $request = null, $defaults = array()) { if (empty($defaults)) { $defaults = $this->getDefaultArguments(); Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-11-08 16:21:41 UTC (rev 9289) +++ trunk/lib/WikiPluginCached.php 2014-11-09 17:21:10 UTC (rev 9290) @@ -454,9 +454,10 @@ </object> */ // how to handle alternate images? always provide alternate static images? - function embedObject($url, $type, $args = false, $params = false) + function embedObject($url, $type, $args = array(), $params = false) { - if (!$args) $args = array(); + if (empty($args)) + $args = array(); $object = HTML::object(array_merge($args, array('src' => $url, 'type' => $type))); if ($params) $object->pushContent($params); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-09 20:00:55
|
Revision: 9300 http://sourceforge.net/p/phpwiki/code/9300 Author: vargenau Date: 2014-11-09 20:00:47 +0000 (Sun, 09 Nov 2014) Log Message: ----------- PHP Doc Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/FileFinder.php trunk/lib/HtmlElement.php trunk/lib/IniConfig.php trunk/lib/Template.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2014-11-09 19:54:52 UTC (rev 9299) +++ trunk/lib/AccessLog.php 2014-11-09 20:00:47 UTC (rev 9300) @@ -107,7 +107,11 @@ } /** - * Return iterator of referer items reverse sorted (latest first). + * Return iterator of referrer items reverse sorted (latest first). + * + * @param int $limit + * @param bool $external_only + * @return WikiDB_Array_generic_iter */ function get_referer($limit = 15, $external_only = false) { Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2014-11-09 19:54:52 UTC (rev 9299) +++ trunk/lib/FileFinder.php 2014-11-09 20:00:47 UTC (rev 9300) @@ -48,6 +48,9 @@ * Unify used pathsep character. * Accepts array of paths also. * This might not work on Windows95 or FAT volumes. (not tested) + * + * @param string $path + * @return mixed|string */ function slashifyPath($path) { @@ -56,6 +59,10 @@ /** * Force using '/' as path seperator. + * + * @param string $path + * @param string $sep + * @return mixed|string */ function forcePathSlashes($path, $sep = '/') { @@ -89,7 +96,7 @@ * to PHP's include_path (if it's not already there.) Then the * file is include_once()'d. * - * @param $file string File to include. + * @param string $file File to include. * @return bool True if file was successfully included. */ function includeOnce($file) Modified: trunk/lib/HtmlElement.php =================================================================== --- trunk/lib/HtmlElement.php 2014-11-09 19:54:52 UTC (rev 9299) +++ trunk/lib/HtmlElement.php 2014-11-09 20:00:47 UTC (rev 9300) @@ -48,6 +48,9 @@ /** * This is used by the static factory methods is class HTML. + * + * @param array $args + * @return $this */ protected function _init2($args) { Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2014-11-09 19:54:52 UTC (rev 9299) +++ trunk/lib/IniConfig.php 2014-11-09 20:00:47 UTC (rev 9300) @@ -68,6 +68,8 @@ * Dump the static parts of the parsed config/config.ini settings to a fast-loadable config.php file. * The dynamic parts are then evaluated as before. * Requires write-permissions to config/config.php + * + * @param string $file */ function save_dump($file) { Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2014-11-09 19:54:52 UTC (rev 9299) +++ trunk/lib/Template.php 2014-11-09 20:00:47 UTC (rev 9300) @@ -8,6 +8,10 @@ { /** * name optionally of form "theme/template" to include parent templates in children + * + * @param string $name + * @param WikiRequest $request + * @param array $args */ function Template($name, &$request, $args = array()) { @@ -247,8 +251,6 @@ * @param string $title page title * @param object|bool $page_revision A WikiDB_PageRevision object or false * @param array $args hash Extract args for top-level template - * - * @return string HTML expansion of template. */ function GeneratePage($content, $title, $page_revision = false, $args = array()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |