From 02336f0a40f7eba169adbd6081636bbd2d9bc8de Mon Sep 17 00:00:00 2001 From: vargenau Date: Wed, 20 Mar 2013 20:53:15 +0000 Subject: [PATCH] Remove unused variables git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@8734 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/WikiDB/backend/PDO_mysql.php | 1 - lib/WikiDB/backend/PDO_oci8.php | 1 - lib/plugin/BlogArchives.php | 1 - lib/plugin/BlogJournal.php | 1 - lib/plugin/Calendar.php | 1 - lib/plugin/CalendarList.php | 3 --- lib/plugin/Diff.php | 2 +- lib/plugin/DynamicIncludePage.php | 1 - lib/plugin/FullTextSearch.php | 2 -- lib/plugin/GraphViz.php | 1 - lib/plugin/HtmlConverter.php | 1 - lib/plugin/LinkSearch.php | 1 - lib/plugin/PhpWeather.php | 1 - lib/plugin/RandomPage.php | 1 - lib/plugin/RecentChanges.php | 11 +---------- lib/plugin/SearchHighlight.php | 1 - lib/plugin/SemanticSearch.php | 3 --- lib/plugin/SyncWiki.php | 3 --- lib/plugin/VisualWiki.php | 1 - themes/MacOSX/themeinfo.php | 2 -- themes/Portland/themeinfo.php | 1 - themes/Wordpress/themeinfo.php | 1 - themes/alphatest.php | 1 - themes/blog/themeinfo.php | 1 - 24 files changed, 2 insertions(+), 41 deletions(-) diff --git a/lib/WikiDB/backend/PDO_mysql.php b/lib/WikiDB/backend/PDO_mysql.php index 613782741..3cd8e7958 100644 --- a/lib/WikiDB/backend/PDO_mysql.php +++ b/lib/WikiDB/backend/PDO_mysql.php @@ -87,7 +87,6 @@ class WikiDB_backend_PDO_mysql */ function optimize() { - $dbh = &$this->_dbh; $this->_timeout(); foreach ($this->_table_names as $table) { $this->query("OPTIMIZE TABLE $table"); diff --git a/lib/WikiDB/backend/PDO_oci8.php b/lib/WikiDB/backend/PDO_oci8.php index a310b6b9a..6ef59a014 100644 --- a/lib/WikiDB/backend/PDO_oci8.php +++ b/lib/WikiDB/backend/PDO_oci8.php @@ -65,7 +65,6 @@ class WikiDB_backend_PDO_oci8 function write_accesslog(&$entry) { - global $request; $dbh = &$this->_dbh; $log_tbl = $entry->_accesslog->logtable; $sth = $dbh->prepare("INSERT INTO $log_tbl" diff --git a/lib/plugin/BlogArchives.php b/lib/plugin/BlogArchives.php index 13acf6725..03c2bf270 100644 --- a/lib/plugin/BlogArchives.php +++ b/lib/plugin/BlogArchives.php @@ -87,7 +87,6 @@ class WikiPlugin_BlogArchives //if (!is_array('pagename'), explode(',', $info)) // unset($pagelist->_columns['pagename']); - $sp = HTML::Raw('· '); if (!empty($args['month'])) { $prefix = $parent . $this->_blogPrefix('wikiblog') . SUBPAGE_SEPARATOR . $args['month']; $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix, true, 'posix')); diff --git a/lib/plugin/BlogJournal.php b/lib/plugin/BlogJournal.php index e7535d058..6ef45dca5 100644 --- a/lib/plugin/BlogJournal.php +++ b/lib/plugin/BlogJournal.php @@ -79,7 +79,6 @@ class WikiPlugin_BlogJournal } $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR); - $sp = HTML::Raw('· '); $prefix = $base = $parent . $this->_blogPrefix('wikiblog'); if ($args['month']) $prefix .= (SUBPAGE_SEPARATOR . $args['month']); diff --git a/lib/plugin/Calendar.php b/lib/plugin/Calendar.php index 549eaae36..417454e36 100644 --- a/lib/plugin/Calendar.php +++ b/lib/plugin/Calendar.php @@ -194,7 +194,6 @@ class WikiPlugin_Calendar 1, // mday (1-31) $args['year']); - $colnum = $args['display_weeknum'] ? 8 : 7; $cal = HTML::table(array('cellspacing' => 0, 'cellpadding' => 2, 'class' => 'cal'), diff --git a/lib/plugin/CalendarList.php b/lib/plugin/CalendarList.php index fdfe84bbf..0b12709ae 100644 --- a/lib/plugin/CalendarList.php +++ b/lib/plugin/CalendarList.php @@ -126,9 +126,6 @@ class WikiPlugin_CalendarList $date_string = strftime($args['date_format'], $time); $page_for_date = $args['prefix'] . SUBPAGE_SEPARATOR . $date_string; - $t = localtime($time, 1); - - $td = HTML::td(array('align' => 'center')); if ($dbi->isWikiPage($page_for_date)) { // Extract the page contents for this date diff --git a/lib/plugin/Diff.php b/lib/plugin/Diff.php index 3cbd9eed9..9f008f275 100644 --- a/lib/plugin/Diff.php +++ b/lib/plugin/Diff.php @@ -57,7 +57,7 @@ class WikiPlugin_Diff function PageInfoRow($label, $rev, &$request) { - global $WikiTheme, $WikiNameRegexp; + global $WikiTheme; $row = HTML::tr(HTML::td(array('align' => 'right'), $label)); if ($rev) { diff --git a/lib/plugin/DynamicIncludePage.php b/lib/plugin/DynamicIncludePage.php index 2cb3d98e9..cfe9d4c7a 100644 --- a/lib/plugin/DynamicIncludePage.php +++ b/lib/plugin/DynamicIncludePage.php @@ -66,7 +66,6 @@ class WikiPlugin_DynamicIncludePage } else { $html = WikiPlugin_IncludePage::run($dbi, $argstr, $request, $basepage); } - $header = $html->_content[0]; $body = $html->_content[1]; $id = 'DynInc-' . MangleXmlIdentifier($page); $body->setAttr('id', $id . '-body'); diff --git a/lib/plugin/FullTextSearch.php b/lib/plugin/FullTextSearch.php index b6a78a1ce..05eaa29a0 100644 --- a/lib/plugin/FullTextSearch.php +++ b/lib/plugin/FullTextSearch.php @@ -79,7 +79,6 @@ class WikiPlugin_FullTextSearch $query = new TextSearchQuery($s, $case_exact, $regex); $pages = $dbi->fullSearch($query, $sortby, $limit, $exclude); - $lines = array(); $hilight_re = $hilight ? $query->getHighlightRegexp() : false; $count = 0; @@ -166,7 +165,6 @@ class _PageList_Column_hilight extends _PageList_Column function _getValue(&$page, $revision_handle) { - $html = false; $pagename = $page->getName(); $count = count($this->parentobj->_wpagelist[$pagename]); return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false), diff --git a/lib/plugin/GraphViz.php b/lib/plugin/GraphViz.php index d625f6cb1..81be6df7c 100644 --- a/lib/plugin/GraphViz.php +++ b/lib/plugin/GraphViz.php @@ -283,7 +283,6 @@ class WikiPlugin_GraphViz if (empty($source)) return $this->error(fmt("No dot graph given")); if (isWindows()) { - $ok = $tempfiles; $dotfile = $this->createDotFile($tempfiles . '.dot', $argarray); $args = "-T$gif $dotfile -o $outfile"; $cmdline = "$dotbin $args"; diff --git a/lib/plugin/HtmlConverter.php b/lib/plugin/HtmlConverter.php index cc7614ac9..ff791fdfa 100644 --- a/lib/plugin/HtmlConverter.php +++ b/lib/plugin/HtmlConverter.php @@ -140,7 +140,6 @@ class WikiPlugin_HtmlConverter extends WikiPlugin $ascii = '[\x00-\x7F]'; $euc = '[\xA1-\xFE][\xA1-\xFE]'; - $character = "$ascii|$euc"; $this->_processA($file); $this->_processIMG($file); diff --git a/lib/plugin/LinkSearch.php b/lib/plugin/LinkSearch.php index 3d7cb6886..a1e893c1b 100644 --- a/lib/plugin/LinkSearch.php +++ b/lib/plugin/LinkSearch.php @@ -130,7 +130,6 @@ function dirsign_switch() { function run($dbi, $argstr, &$request, $basepage) { - global $WikiTheme; $args = $this->getArgs($argstr, $request); if (empty($args['page'])) diff --git a/lib/plugin/PhpWeather.php b/lib/plugin/PhpWeather.php index bc32131b8..00a838d14 100644 --- a/lib/plugin/PhpWeather.php +++ b/lib/plugin/PhpWeather.php @@ -71,7 +71,6 @@ class WikiPlugin_PhpWeather function getDefaultArguments() { - global $LANG; return array('icao' => 'EKAH', 'cc' => 'DK', 'language' => 'en', diff --git a/lib/plugin/RandomPage.php b/lib/plugin/RandomPage.php index 2d3de9340..4d9685546 100644 --- a/lib/plugin/RandomPage.php +++ b/lib/plugin/RandomPage.php @@ -66,7 +66,6 @@ class WikiPlugin_RandomPage // fix deprecated arg if (is_integer($pages)) { $numpages = $pages; - $pages = false; // fix new pages handling in arg preprozessor. } elseif (is_array($pages)) { $numpages = (int)$pages[0]; diff --git a/lib/plugin/RecentChanges.php b/lib/plugin/RecentChanges.php index f8154e642..2c3502e5f 100644 --- a/lib/plugin/RecentChanges.php +++ b/lib/plugin/RecentChanges.php @@ -111,7 +111,7 @@ class _RecentChanges_Formatter function authorHasPage($author) { - global $WikiNameRegexp, $request; + global $request; $dbi = $request->getDbh(); return isWikiWord($author) && $dbi->isWikiPage($author); } @@ -438,7 +438,6 @@ class _RecentChanges_HtmlFormatter extract($this->_args); $pagetitle = $show_minor ? _("RecentEdits") : _("RecentChanges"); - global $request; $sidebarurl = WikiURL($pagetitle, array('format' => 'sidebar'), 'absurl'); $addsidebarjsfunc = @@ -801,10 +800,7 @@ class _RecentChanges_BoxFormatter function format($changes) { include_once 'lib/InlineParser.php'; - $last_date = ''; $first = true; - $html = HTML::ul(); - $counter = 1; while ($rev = $changes->next()) { // enforce view permission if (mayAccessPage('view', $rev->_pagename)) { @@ -1039,12 +1035,7 @@ class _RecentChanges_AtomFormatter // "channel" is called "feed" in atom $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); extract($this->_args); - $title = WIKI_NAME; $description = $this->title(); - if ($category) - $title = $category; - elseif ($pagematch) - $title = $pagematch; $feed_props = array('title' => $description, 'link' => array('rel' => "alternate", 'type' => "text/html", diff --git a/lib/plugin/SearchHighlight.php b/lib/plugin/SearchHighlight.php index 320b1ad7c..a6cdcacf6 100644 --- a/lib/plugin/SearchHighlight.php +++ b/lib/plugin/SearchHighlight.php @@ -77,7 +77,6 @@ class WikiPlugin_SearchHighlight } if ($hits) { $query = new TextSearchQuery($s, $case_exact, $regex); - $lines = array(); $hilight_re = $query->getHighlightRegexp(); $page = $request->getPage(); $html->pushContent($this->showhits($page, $hilight_re)); diff --git a/lib/plugin/SemanticSearch.php b/lib/plugin/SemanticSearch.php index 76d67300b..61c581c19 100644 --- a/lib/plugin/SemanticSearch.php +++ b/lib/plugin/SemanticSearch.php @@ -88,7 +88,6 @@ class WikiPlugin_SemanticSearch function showForm(&$dbi, &$request, $args) { - global $WikiTheme; $action = $request->getPostURL(); $hiddenfield = HiddenInputs($request->getArgs(), '', array('action', 'page', 's', 'semsearch', @@ -275,8 +274,6 @@ class WikiPlugin_SemanticSearch function run($dbi, $argstr, &$request, $basepage) { - global $WikiTheme; - $this->_supported_operators = array(':=', '<', '<=', '>', '>=', '!=', '==', '=~'); $this->_text_operators = array(':=', '==', '=~', '!='); $args = $this->getArgs($argstr, $request); diff --git a/lib/plugin/SyncWiki.php b/lib/plugin/SyncWiki.php index c0c500181..293dcc1cd 100644 --- a/lib/plugin/SyncWiki.php +++ b/lib/plugin/SyncWiki.php @@ -89,7 +89,6 @@ class WikiPlugin_SyncWiki function _do_syncwiki(&$request, $args) { - global $charset; longer_timeout(240); if (!function_exists('wiki_xmlrpc_post')) { @@ -289,7 +288,6 @@ class WikiPlugin_SyncWiki // TODO: store log or checkpoint for restauration? function _import($args, $our, $extdate = null) { - global $request; $reaction = 'import '; if ($args['noimport']) return ($reaction . _("skipped")); //$userid = $request->_user->_userid; @@ -343,7 +341,6 @@ class WikiPlugin_SyncWiki // TODO: store log or checkpoint for restauration? function _upload($args, $path, $timeout) { - global $request; $reaction = 'upload '; if ($args['noupload']) return ($reaction . _("skipped")); diff --git a/lib/plugin/VisualWiki.php b/lib/plugin/VisualWiki.php index 3f4326135..a9468da4c 100644 --- a/lib/plugin/VisualWiki.php +++ b/lib/plugin/VisualWiki.php @@ -463,7 +463,6 @@ class WikiPlugin_VisualWiki $dot .= "node [fontname=$fontname,shape=$shape,fontsize=$fontsize];\n"; } $dot .= "\n"; - $i = 0; foreach ($names as $name) { $url = rawurlencode($name); diff --git a/themes/MacOSX/themeinfo.php b/themes/MacOSX/themeinfo.php index ff6529ef9..1cf4e787b 100644 --- a/themes/MacOSX/themeinfo.php +++ b/themes/MacOSX/themeinfo.php @@ -64,8 +64,6 @@ class WikiTheme_MacOSX extends WikiTheme function linkUnknownWikiWord($wikiword, $linktext = '') { - global $request; - // Get rid of anchors on unknown wikiwords if (isa($wikiword, 'WikiPageName')) { $default_text = $wikiword->shortName; diff --git a/themes/Portland/themeinfo.php b/themes/Portland/themeinfo.php index c1ab2a185..2843c1974 100644 --- a/themes/Portland/themeinfo.php +++ b/themes/Portland/themeinfo.php @@ -17,7 +17,6 @@ class WikiTheme_Portland extends WikiTheme function linkUnknownWikiWord($wikiword, $linktext = '') { - global $request; if (isa($wikiword, 'WikiPageName')) { $default_text = $wikiword->shortName; $wikiword = $wikiword->name; diff --git a/themes/Wordpress/themeinfo.php b/themes/Wordpress/themeinfo.php index 0058e3436..ac8443aa0 100644 --- a/themes/Wordpress/themeinfo.php +++ b/themes/Wordpress/themeinfo.php @@ -19,7 +19,6 @@ class WikiTheme_Wordpress extends WikiTheme function linkUnknownWikiWord($wikiword, $linktext = '') { - global $request; if (isa($wikiword, 'WikiPageName')) { $default_text = $wikiword->shortName; $wikiword = $wikiword->name; diff --git a/themes/alphatest.php b/themes/alphatest.php index 3190a0e81..a95d62ed1 100644 --- a/themes/alphatest.php +++ b/themes/alphatest.php @@ -29,7 +29,6 @@ for (var n = 0; n < backgroundcolor.length; n++) { function find_pngs($dir) { - $file_list = ''; $stack[] = $dir; while ($stack) { $current_dir = array_pop($stack); diff --git a/themes/blog/themeinfo.php b/themes/blog/themeinfo.php index ace866274..f5afea7b5 100644 --- a/themes/blog/themeinfo.php +++ b/themes/blog/themeinfo.php @@ -97,7 +97,6 @@ class WikiTheme_blog extends WikiTheme /* TODO: use the blog summary as label instead of the pagename */ function linkExistingWikiWord($wikiword, $linktext = '', $version = false) { - global $request; if ($version !== false and !$this->HTML_DUMP_SUFFIX) $url = WikiURL($wikiword, array('version' => $version)); else -- 2.45.0