From: <var...@us...> - 2010-08-11 11:58:51
|
Revision: 7638 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7638&view=rev Author: vargenau Date: 2010-08-11 11:58:40 +0000 (Wed, 11 Aug 2010) Log Message: ----------- Harmonize file footer Modified Paths: -------------- trunk/RPC2.php trunk/SOAP.php trunk/index.php trunk/lib/AccessLog.php trunk/lib/BlockParser.php trunk/lib/CachedMarkup.php trunk/lib/DbaDatabase.php trunk/lib/DbaListSet.php trunk/lib/ErrorManager.php trunk/lib/ExternalReferrer.php trunk/lib/HtmlElement.php trunk/lib/HtmlElement5.php trunk/lib/HtmlParser.php trunk/lib/HttpClient.php trunk/lib/IniConfig.php trunk/lib/InlineParser.php trunk/lib/PageList.php trunk/lib/RSSWriter091.php trunk/lib/RssParser.php trunk/lib/RssWriter.php trunk/lib/RssWriter2.php trunk/lib/SemanticWeb.php trunk/lib/WikiCallback.php trunk/lib/WikiDB/ADODB.php trunk/lib/WikiDB/PDO.php trunk/lib/WikiDB/SQL.php trunk/lib/WikiDB/adodb/adodb.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysql.inc.php trunk/lib/WikiDB/backend/ADODB.php trunk/lib/WikiDB/backend/ADODB_mssql.php trunk/lib/WikiDB/backend/ADODB_mssqlnative.php trunk/lib/WikiDB/backend/ADODB_mysql.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/ADODB_postgres7.php trunk/lib/WikiDB/backend/ADODB_sqlite.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PDO_mysql.php trunk/lib/WikiDB/backend/PDO_oci8.php trunk/lib/WikiDB/backend/PDO_pgsql.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/PearDB_ffpgsql.php trunk/lib/WikiDB/backend/PearDB_mysql.php trunk/lib/WikiDB/backend/PearDB_oci8.php trunk/lib/WikiDB/backend/PearDB_pgsql.php trunk/lib/WikiDB/backend/PearDB_sqlite.php trunk/lib/WikiDB/backend/cvs.php trunk/lib/WikiDB/backend/dba.php trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php trunk/lib/WikiDB/backend/dumb/BackLinkIter.php trunk/lib/WikiDB/backend/dumb/LinkSearchIter.php trunk/lib/WikiDB/backend/dumb/MostPopularIter.php trunk/lib/WikiDB/backend/dumb/MostRecentIter.php trunk/lib/WikiDB/backend/dumb/TextSearchIter.php trunk/lib/WikiDB/backend/dumb/WantedPagesIter.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend/flatfile.php trunk/lib/WikiDB/backend.php trunk/lib/WikiDB/dba.php trunk/lib/WikiDB/file.php trunk/lib/WikiDB/flatfile.php trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php trunk/lib/WikiTheme.php trunk/lib/XmlElement.php trunk/lib/XmlParser.php trunk/lib/XmlRpcClient.php trunk/lib/XmlRpcServer.php trunk/lib/config.php trunk/lib/display.php trunk/lib/gif.php trunk/lib/imdb.php trunk/lib/install.php trunk/lib/loadsave.php trunk/lib/plugin/AddComment.php trunk/lib/plugin/AnalyseAccessLogSql.php trunk/lib/plugin/AuthorHistory.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/BoxRight.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/Calendar.php trunk/lib/plugin/CalendarList.php trunk/lib/plugin/Comment.php trunk/lib/plugin/CreateBib.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/CurrentTime.php trunk/lib/plugin/Diff.php trunk/lib/plugin/DynamicIncludePage.php trunk/lib/plugin/EditMetaData.php trunk/lib/plugin/FileInfo.php trunk/lib/plugin/FoafViewer.php trunk/lib/plugin/FrameInclude.php trunk/lib/plugin/GoogleMaps.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/HelloWorld.php trunk/lib/plugin/Imdb.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/IncludePages.php trunk/lib/plugin/IncludeSiteMap.php trunk/lib/plugin/IncludeTree.php trunk/lib/plugin/InterWikiSearch.php trunk/lib/plugin/JabberPresence.php trunk/lib/plugin/LdapSearch.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/MediawikiTable.php trunk/lib/plugin/ModeratedPage.php trunk/lib/plugin/NoCache.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/PageDump.php trunk/lib/plugin/PageHistory.php trunk/lib/plugin/PageInfo.php trunk/lib/plugin/PageTrail.php trunk/lib/plugin/PasswordReset.php trunk/lib/plugin/PhotoAlbum.php trunk/lib/plugin/PhpHighlight.php trunk/lib/plugin/PhpWeather.php trunk/lib/plugin/Ploticus.php trunk/lib/plugin/PopUp.php trunk/lib/plugin/RateIt.php trunk/lib/plugin/RawHtml.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RecentChangesCached.php trunk/lib/plugin/RecentComments.php trunk/lib/plugin/RecentEdits.php trunk/lib/plugin/RecentReferrers.php trunk/lib/plugin/RedirectTo.php trunk/lib/plugin/RelatedChanges.php trunk/lib/plugin/RichTable.php trunk/lib/plugin/RssFeed.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/SpellCheck.php trunk/lib/plugin/SqlResult.php trunk/lib/plugin/SyncWiki.php trunk/lib/plugin/SyntaxHighlighter.php trunk/lib/plugin/TeX2png.php trunk/lib/plugin/Template.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/Transclude.php trunk/lib/plugin/TranslateText.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/UpLoad.php trunk/lib/plugin/UriResolver.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/WatchPage.php trunk/lib/plugin/WhoIsOnline.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiBlog.php trunk/lib/plugin/WikiForm.php trunk/lib/plugin/WikiFormRich.php trunk/lib/plugin/WikiForum.php trunk/lib/plugin/WikiPoll.php trunk/lib/plugin/WikicreoleTable.php trunk/lib/plugin/YouTube.php trunk/lib/plugin/_AuthInfo.php trunk/lib/plugin/_BackendInfo.php trunk/lib/plugin/_PreferencesInfo.php trunk/lib/plugin/_Retransform.php trunk/lib/plugin/_WikiTranslation.php trunk/lib/plugin/text2png.php trunk/lib/prepend.php trunk/lib/purgepage.php trunk/lib/removepage.php trunk/lib/stdlib.php trunk/lib/upgrade.php trunk/tests/CompatInfo.php trunk/tests/unit/lib/HtmlParserTest.php trunk/tests/unit/lib/InlineParserTest.php trunk/tests/unit/lib/XmlRpcTest.php trunk/tests/unit/test.php trunk/themes/Crao/themeinfo.php trunk/themes/Hawaiian/lib/random.php trunk/themes/Hawaiian/themeinfo.php trunk/themes/MacOSX/lib/RecentChanges.php trunk/themes/MacOSX/themeinfo.php trunk/themes/MonoBook/themeinfo.php trunk/themes/Portland/lib/RecentChanges.php trunk/themes/Portland/themeinfo.php trunk/themes/Sidebar/themeinfo.php trunk/themes/SpaceWiki/lib/RecentChanges.php trunk/themes/SpaceWiki/themeinfo.php trunk/themes/Wordpress/lib/RecentChanges.php trunk/themes/Wordpress/themeinfo.php trunk/themes/blog/lib/RecentChanges.php trunk/themes/blog/themeinfo.php trunk/themes/default/themeinfo.php trunk/themes/gforge/themeinfo.php trunk/themes/shamino_com/themeinfo.php trunk/themes/wikilens/themeinfo.php Modified: trunk/RPC2.php =================================================================== --- trunk/RPC2.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/RPC2.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -1,4 +1,4 @@ -<?php +<?php // $Id$ /* * The guts of this code have been moved to lib/XmlRpcServer.php. @@ -12,7 +12,7 @@ // Intercept GET requests from confused users. Only POST is allowed here! if (empty($GLOBALS['HTTP_SERVER_VARS'])) $GLOBALS['HTTP_SERVER_VARS'] =& $_SERVER; -if ($HTTP_SERVER_VARS['REQUEST_METHOD'] != "POST") +if ($HTTP_SERVER_VARS['REQUEST_METHOD'] != "POST") { die('This is the address of the XML-RPC interface.' . ' You must use XML-RPC calls to access information here.'); @@ -30,12 +30,11 @@ $server = new XmlRpcServer; $server->service(); -// (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: -?> \ No newline at end of file +// End: +?> Modified: trunk/SOAP.php =================================================================== --- trunk/SOAP.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/SOAP.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -5,11 +5,11 @@ * Please see http://phpwiki.sourceforge.net/phpwiki/PhpWiki.wdsl * for the wdsl discussion. * - * Todo: - * checkCredentials: set the $GLOBALS['request']->_user object for + * Todo: + * checkCredentials: set the $GLOBALS['request']->_user object for * mayAccessPage * enable native pecl extension (xml-rpc or soap) - * serverurl: + * serverurl: * Installer helper which changes server url of the default PhpWiki.wdsl * Or do it dynamically in the soap class? No, the client must connect to us. * @@ -51,7 +51,7 @@ $credentials['username'] = $_SERVER['REMOTE_ADDR']; elseif (isset($GLOBALS['REMOTE_ADDR'])) $credentials['username'] = $GLOBALS['REMOTE_ADDR']; - else + else $credentials['username'] = $server->host; } } @@ -63,7 +63,7 @@ } else { $request->_user = new WikiUser($request, $credentials['username']); } - $request->_user->AuthCheck(array('userid' => $credentials['username'], + $request->_user->AuthCheck(array('userid' => $credentials['username'], 'passwd' => $credentials['password'])); if (! mayAccessPage ($access, $pagename)) $server->fault(401,'',"no permission"); @@ -73,8 +73,8 @@ $GLOBALS['SCRIPT_NAME'] = DATA_PATH . "/SOAP.php"; $url = SERVER_URL . DATA_PATH . "/SOAP.php"; -// Local or external wdsl support is experimental. -// It works without also. Just the client has to +// Local or external wdsl support is experimental. +// It works without also. Just the client has to // know the wdsl definitions. $server = new soap_server(/* 'PhpWiki.wdsl' */); // Now change the server url to ours, because in the wdsl is the original PhpWiki address @@ -213,7 +213,7 @@ global $server; checkCredentials($server,$credentials,'view',_("RecentChanges")); $dbi = WikiDB::open($GLOBALS['DBParams']); - $params = array('limit' => $limit, 'since' => $since, + $params = array('limit' => $limit, 'since' => $since, 'include_minor_revisions' => $include_minor); $page_iter = $dbi->mostRecent($params); $pages = array(); @@ -303,13 +303,13 @@ } return $pages; } -/** +/** * array listRelations([ Integer option = 1 ]) * * Returns an array of all available relation names. * option: 1 relations only ( with 0 also ) * option: 2 attributes only - * option: 3 both, all names of relations and attributes + * option: 3 both, all names of relations and attributes * option: 4 unsorted, this might be added as bitvalue: 7 = 4+3. default: sorted * For some semanticweb autofill methods. * @@ -318,8 +318,8 @@ function listRelations($option = 1, $credentials=false) { global $server; checkCredentials($server,$credentials,'view',_("HomePage")); - $also_attributes = $option & 2; - $only_attributes = $option & 2 and !($option & 1); + $also_attributes = $option & 2; + $only_attributes = $option & 2 and !($option & 1); $sorted = !($option & 4); return $dbh->listRelations($also_attributes, $only_attributes, @@ -351,12 +351,11 @@ $server->service($GLOBALS['HTTP_RAW_POST_DATA']); -// (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/index.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -1,15 +1,15 @@ <?php // -*-php-*- /* -Copyright 1999,2000,2001,2002,2003,2004,2009 $ThePhpWikiProgrammingTeam +Copyright 1999,2000,2001,2002,2003,2004,2009 $ThePhpWikiProgrammingTeam = array( -"Steve Wainstead", "Clifford A. Adams", "Lawrence Akka", +"Steve Wainstead", "Clifford A. Adams", "Lawrence Akka", "Scott R. Anderson", "Jon Åslund", "Neil Brown", "Jeff Dairiki", "Stéphane Gourichon", "Jan Hidders", "Arno Hollosi", "John Jorgensen", "Antti Kaihola", "Jeremie Kass", "Carsten Klapp", "Marco Milanesi", -"Grant Morgan", "Jan Nieuwenhuizen", "Aredridel Niothke", -"Pablo Roca Rozas", "Sandino Araico Sánchez", "Joel Uckelman", -"Reini Urban", "Marc-Etienne Vargenau", "Joby Walker", "Tim Voght", +"Grant Morgan", "Jan Nieuwenhuizen", "Aredridel Niothke", +"Pablo Roca Rozas", "Sandino Araico Sánchez", "Joel Uckelman", +"Reini Urban", "Marc-Etienne Vargenau", "Joby Walker", "Tim Voght", "Jochen Kalmbach"); This file is part of PhpWiki. @@ -37,30 +37,29 @@ //////////////////////////////////////////////////////////////// // PrettyWiki -// Check if we were included by some other wiki version -// (getimg.php, en, de, wiki, ...) or not. +// Check if we were included by some other wiki version +// (getimg.php, en, de, wiki, ...) or not. // If the server requested this index.php fire up the code by loading lib/main.php. -// Parallel wiki scripts can now simply include /index.php for the -// main configuration, extend or redefine some settings and +// Parallel wiki scripts can now simply include /index.php for the +// main configuration, extend or redefine some settings and // load lib/main.php by themselves. See the file 'wiki'. // This overcomes the IndexAsConfigProblem. -// Generally a simple +// Generally a simple // define('VIRTUAL_PATH', $_SERVER['SCRIPT_NAME']); // is enough in the wiki file, plus the action definition in a .htaccess file //////////////////////////////////////////////////////////////// // If every page is just empty, comment the if (@is_dir line out, // to force include "lib/main.php". -// Without the dir check it might fail for index.php via DirectoryIndex +// Without the dir check it might fail for index.php via DirectoryIndex if (@is_dir(SCRIPT_FILENAME) or realpath(SCRIPT_FILENAME) == realpath(__FILE__)) include(dirname(__FILE__)."/lib/main.php"); -// (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/AccessLog.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -52,7 +52,7 @@ //$request->_accesslog =& $this; //if (empty($request->_accesslog->entries)) register_shutdown_function("Request_AccessLogEntry_shutdown_function"); - + if ($do_sql) { if (!$request->_dbi->isSQL()) { trigger_error("Unsupported database backend for ACCESS_LOG_SQL.\nNeed DATABASE_TYPE=SQL or ADODB or PDO"); @@ -126,7 +126,7 @@ if ($this->logtable) { // mysql specific only: return $this->read_sql("request_host=".$this->_dbi->quote($host) - ." AND time_stamp > ". (time()-$since_minutes*60) + ." AND time_stamp > ". (time()-$since_minutes*60) ." ORDER BY time_stamp DESC"); } else { $iter = new WikiDB_Array_generic_iter(); @@ -215,7 +215,7 @@ /** * Constructor. * - * The log entry will be automatically appended to the log file or + * The log entry will be automatically appended to the log file or * SQL table when the current request terminates. * * If you want to modify a Request_AccessLogEntry before it gets @@ -267,7 +267,7 @@ function setStatus ($status) { $this->status = $status; } - + /** * Set response size. * @@ -281,7 +281,7 @@ // Workaround: $this->duration = str_replace(",",".",sprintf("%f",$seconds)); } - + /** * Get time zone offset. * @@ -351,7 +351,7 @@ /* If ACCESS_LOG_SQL & 2 we do write it by our own */ function write_sql() { global $request; - + $dbh =& $request->_dbi; if ($dbh and $dbh->isOpen() and $this->_accesslog->logtable) { //$log_tbl =& $this->_accesslog->logtable; @@ -365,7 +365,7 @@ if (!empty($args['pref']['passwd2'])) $args['pref']['passwd2'] = '<not displayed>'; $this->request_args = substr(serialize($args),0,254); // if VARCHAR(255) is used. } else { - $this->request_args = $request->get('QUERY_STRING'); + $this->request_args = $request->get('QUERY_STRING'); } $this->request_method = $request->get('REQUEST_METHOD'); $this->request_uri = $request->get('REQUEST_URI'); @@ -383,7 +383,7 @@ */ function Request_AccessLogEntry_shutdown_function () { global $request; - + if (isset($request->_accesslog->entries) and $request->_accesslog->logfile) foreach ($request->_accesslog->entries as $entry) { $entry->write_file(); @@ -435,12 +435,12 @@ $query = ''; $backend_type = $request->_dbi->_backend->backendType(); switch ($backend_type) { - case 'mysql': + case 'mysql': $Referring_URL = "left(referer,length(referer)-instr(reverse(referer),'?'))"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $Referring_URL = "substr(referer,0,position('?' in referer))"; break; - default: + default: $Referring_URL = "referer"; } switch ($args['mode']) { @@ -470,12 +470,12 @@ if ($where_conditions<>'') $where_conditions = 'WHERE '.$where_conditions.' '; switch ($backend_type) { - case 'mysql': + case 'mysql': $Referring_Domain = "left(referer, if(locate('/', referer, 8) > 0,locate('/', referer, 8) -1, length(referer)))"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $Referring_Domain = "substr(referer,0,8) || regexp_replace(substr(referer,8), '/.*', '')"; break; - default: + default: $Referring_Domain = "referer"; break; } $query = "SELECT " @@ -552,13 +552,13 @@ // If PHPSESSID appears in the URI, just display the URI to the left of this $sessname = session_name(); switch ($backend_type) { - case 'mysql': + case 'mysql': $Request_URI = "IF(instr(request_uri, '$sessname')=0, request_uri,left(request_uri, instr(request_uri, '$sessname')-2))"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $Request_URI = "regexp_replace(request_uri, '$sessname.*', '')"; break; - default: + default: $Request_URI = 'request_uri'; break; } $now = time(); @@ -608,7 +608,7 @@ return array( 'mode' => 'referring_domains', // referring_domains, referring_urls, remote_hosts, users, host_users, search_bots, search_bots_hits - 'caption' => '', + 'caption' => '', // blank means use the mode as the caption/title for the output 'local_referrers' => 'true', // only show external referring sites 'period' => '', // the type of period to report: @@ -698,19 +698,19 @@ $len = strlen($localhost); $backend_type = $request->_dbi->_backend->backendType(); switch ($backend_type) { - case 'mysql': + case 'mysql': $ref_localhost = "left(referer,$len)<>'$localhost'"; break; - case 'pgsql': - case 'postgres7': + case 'pgsql': + case 'postgres7': $ref_localhost = "substr(referer,0,$len)<>'$localhost'"; break; - default: + default: $ref_localhost = ""; } $where_conditions = $where_conditions.$ref_localhost; } // The assumed contract is that there is a space at the end of the - // conditions string, so that following SQL clauses (such as GROUP BY) + // conditions string, so that following SQL clauses (such as GROUP BY) // will not cause a syntax error if ($where_conditions<>'') $where_conditions = $where_conditions.' '; @@ -729,7 +729,6 @@ } -// For emacs users // Local Variables: // mode: php // tab-width: 8 @@ -737,5 +736,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -// vim: expandtab shiftwidth=4: ?> Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/BlockParser.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -4,17 +4,17 @@ * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. - * + * * PhpWiki is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * PhpWiki is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with PhpWiki; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -24,11 +24,11 @@ require_once('lib/InlineParser.php'); /** - * Deal with paragraphs and proper, recursive block indents + * Deal with paragraphs and proper, recursive block indents * for the new style markup (version 2) * * Everything which goes over more than line: - * automatic lists, UL, OL, DL, table, blockquote, verbatim, + * automatic lists, UL, OL, DL, table, blockquote, verbatim, * p, pre, plugin, ... * * FIXME: @@ -36,12 +36,12 @@ * (old-style) tables * FIXME: unify this with the RegexpSet in InlineParser. * - * FIXME: This is very php5 sensitive: It was fixed for 1.3.9, - * but is again broken with the 1.3.11 + * FIXME: This is very php5 sensitive: It was fixed for 1.3.9, + * but is again broken with the 1.3.11 * allow_call_time_pass_reference clean fixes * * @package Markup - * @author: Geoffrey T. Dairiki + * @author: Geoffrey T. Dairiki */ /** @@ -97,7 +97,7 @@ if (! preg_match($this->_re, $text, $m)) { return false; } - + $match = new AnchoredRegexpSet_match; $match->postmatch = substr($text, strlen($m[0])); $match->match = $m[1]; @@ -136,7 +136,7 @@ if (! preg_match($pat, $text, $m)) { return false; } - + $match = new AnchoredRegexpSet_match; $match->postmatch = substr($text, strlen($m[0])); $match->match = $m[1]; @@ -146,11 +146,11 @@ } - + class BlockParser_Input { function BlockParser_Input ($text) { - + // Expand leading tabs. // FIXME: do this better. // @@ -182,14 +182,14 @@ } return $this->_atSpace; } - + function currentLine () { if ($this->_pos >= count($this->_lines)) { return false; } return $this->_lines[$this->_pos]; } - + function nextLine () { $this->_atSpace = $this->_lines[$this->_pos++] === ''; if ($this->_pos >= count($this->_lines)) { @@ -202,7 +202,7 @@ $this->_atSpace = ($this->_lines[$this->_pos] === ''); $this->_pos++; } - + function getPos () { return array($this->_pos, $this->_atSpace); } @@ -225,7 +225,7 @@ else return "<EOF>"; } - + function _debug ($tab, $msg) { //return ; $where = $this->where(); @@ -233,7 +233,7 @@ printXML(HTML::div("$tab $msg: at: '", HTML::tt($where), "'")); - flush(); + flush(); } } @@ -271,7 +271,7 @@ else return $this->_atSpace; } - + function currentLine () { return $this->_line; } @@ -296,7 +296,7 @@ function advance () { $this->nextLine(); } - + function getPos () { return array($this->_line, $this->_atSpace, $this->_input->getPos()); } @@ -306,7 +306,7 @@ $this->_atSpace = $pos[1]; $this->_input->setPos($pos[2]); } - + function getPrefix () { assert ($this->_line !== false); $line = $this->_input->currentLine(); @@ -322,7 +322,7 @@ return $this->_input->where(); } } - + class Block_HtmlElement extends HtmlElement { @@ -335,7 +335,7 @@ } class ParsedBlock extends Block_HtmlElement { - + function ParsedBlock (&$input, $tag = 'div', $attr = false) { $this->Block_HtmlElement($tag, $attr); $this->_initBlockTypes(); @@ -345,8 +345,8 @@ function _parse (&$input) { // php5 failed to advance the block. php5 copies objects by ref. // nextBlock == block, both are the same objects. So we have to clone it. - for ($block = $this->_getBlock($input); - $block; + for ($block = $this->_getBlock($input); + $block; $block = (is_object($nextBlock) ? clone($nextBlock) : $nextBlock)) { while ($nextBlock = $this->_getBlock($input)) { @@ -399,7 +399,7 @@ $this->_atSpace = $input->skipSpace(); $line = $input->currentLine(); - if ($line === false or $line === '') { // allow $line === '0' + if ($line === false or $line === '') { // allow $line === '0' return false; } $tight_top = !$this->_atSpace; @@ -409,7 +409,7 @@ $block = clone($this->_block_types[$m->regexp_ind]); if (DEBUG & _DEBUG_PARSER) $input->_debug('>', get_class($block)); - + if ($block->_match($input, $m)) { //$block->_text = $line; if (DEBUG & _DEBUG_PARSER) @@ -421,7 +421,7 @@ if (DEBUG & _DEBUG_PARSER) $input->_debug('[', "_match failed"); } - if ($line === false or $line === '') // allow $line === '0' + if ($line === false or $line === '') // allow $line === '0' return false; trigger_error("Couldn't match block: '$line'", E_USER_NOTICE); @@ -500,7 +500,7 @@ 'blockquote'); return true; } - + function merge ($nextBlock) { if (get_class($nextBlock) == get_class($this)) { assert ($nextBlock->_depth < $this->_depth); @@ -535,7 +535,7 @@ if (preg_match('/[*#+-o]/', $input->getPrefix())) { return false; } - + $prefix = $m->match; $indent = sprintf("\\ {%d}", strlen($prefix)); @@ -619,7 +619,7 @@ { var $nrows; var $ncols; - + function Block_table_dl_defn ($term, $defn) { $this->XmlContent(); if (!is_array($defn)) @@ -647,7 +647,7 @@ $this->_tight_top = $tight_top; $this->_tight_bot = $tight_bot; } - + function _addToRow ($item) { if (empty($this->_accum)) { $this->_accum = HTML::td(); @@ -663,7 +663,7 @@ $row->setTightness($this->_next_tight_top, $tight_bottom); $this->_next_tight_top = $tight_bottom; - + $this->pushContent($row); $this->_accum = false; $this->_nrows++; @@ -675,7 +675,7 @@ return; $this->_flushRow($table_rows[0]->_tight_top); - + foreach ($table_rows as $subdef) { $this->pushContent($subdef); $this->_nrows += $subdef->nrows(); @@ -690,7 +690,7 @@ else $first_row->unshiftContent($th); } - + function _ComputeNcols ($defn) { $ncols = 2; foreach ($defn as $item) { @@ -774,7 +774,7 @@ function _setTightness($top, $bot) { $this->_content[0]->setTightness($top, $bot); } - + function finish () { $defs = &$this->_content; @@ -782,7 +782,7 @@ $ncols = 0; foreach ($defs as $defn) $ncols = max($ncols, $defn->ncols()); - + foreach ($defs as $key => $defn) $defs[$key]->setWidth($ncols); @@ -807,7 +807,7 @@ if (!preg_match('/[*#;]*$/A', $input->getPrefix())) { return false; } - + $prefix = $m->match; $oldindent = '[*#;](?=[#*]|;.*:.*\S)'; @@ -873,7 +873,7 @@ */ echo 'count($this->_content): ', count($this->_content),"\n"; echo "\$this->_content[0]: "; var_dump ($this->_content[0]); - + for ($i=1; $i < min(5, count($this->_content)); $i++) { $c =& $this->_content[$i]; echo '$this->_content[',$i,"]: \n"; @@ -918,12 +918,12 @@ } } $input->advance(); - + if ($m->match == '<nowiki>') $text = join("<br>\n", $text); else $text = join("\n", $text); - + // FIXME: no <img>, <big>, <small>, <sup>, or <sub>'s allowed // in a <pre>. if ($m->match == '<pre>') { @@ -1198,7 +1198,7 @@ { var $_attr = array('class' => 'mail-style-quote'); var $_re = '>\ ?'; - + function _match (&$input, $m) { //$indent = str_replace(' ', '\\ ', $m->match) . '|>$'; $indent = $this->_re; @@ -1235,14 +1235,14 @@ class Block_heading extends BlockMarkup { var $_re = '!{1,3}'; - + function _match (&$input, $m) { $tag = "h" . (5 - strlen($m->match)); $text = TransformInline(trim($m->postmatch)); $input->advance(); $this->_element = new Block_HtmlElement($tag, false, $text); - + return true; } } @@ -1250,7 +1250,7 @@ class Block_heading_wikicreole extends BlockMarkup { var $_re = '={2,6}'; - + function _match (&$input, $m) { $tag = "h" . strlen($m->match); // Remove spaces @@ -1261,7 +1261,7 @@ $input->advance(); $this->_element = new Block_HtmlElement($tag, false, $text); - + return true; } } @@ -1312,7 +1312,7 @@ $tag = 'div'; } // without last > - $argstr = substr(trim(substr($m->match,strlen($tag)+1)),0,-1); + $argstr = substr(trim(substr($m->match,strlen($tag)+1)),0,-1); $pos = $input->getPos(); $pi = $content = $m->postmatch; while (!preg_match('/^(.*)\<\/'.$tag.'\>(.*)$/i', $pi, $me)) { @@ -1330,9 +1330,9 @@ $input->advance(); if (strstr($content, "\n")) $content = TransformText($content); - else + else $content = TransformInline($content); - if (!$argstr) + if (!$argstr) $args = false; else { $args = array(); @@ -1398,12 +1398,11 @@ return new XmlContent($output->getContent()); } -// (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/CachedMarkup.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -1,21 +1,21 @@ -<?php +<?php // rcs_id('$Id$'); /* Copyright (C) 2002 Geoffrey T. Dairiki <da...@da...> * Copyright (C) 2004-2010 $ThePhpWikiProgrammingTeam * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. - * + * * PhpWiki is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * PhpWiki is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with PhpWiki; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -62,7 +62,7 @@ // ZLIB format has a five bit checksum in it's header. // Lets check for sanity. if (((ord($packed[0]) * 256 + ord($packed[1])) % 31 == 0) - and (substr($packed,0,2) == "\037\213") + and (substr($packed,0,2) == "\037\213") or (substr($packed,0,2) == "x\332")) // 120, 218 { if (function_exists('gzuncompress')) { @@ -84,11 +84,11 @@ if (preg_match("/^\w+$/", $packed)) return $packed; // happened with _BackendInfo problem also. - trigger_error("Can't unpack bad cached markup. Probably php_zlib extension not loaded.", + trigger_error("Can't unpack bad cached markup. Probably php_zlib extension not loaded.", E_USER_WARNING); return false; } - + /** Get names of wikipages linked to. * * @return array of hashes { linkto=>pagename, relation=>pagename } @@ -102,7 +102,7 @@ continue; $links = array_merge($links, $item_links); } - // array_unique has a bug with hashes! + // array_unique has a bug with hashes! // set_links checks for duplicates, array_merge does not //return array_unique($links); return $links; @@ -181,7 +181,7 @@ . ".*" . "[.?!][\")]*\s*[\"(]*([[:upper:])]|$)"; } - + if (!isset($this->_description) and preg_match("/$two_sentences/sx", $text)) $this->_description = preg_replace("/\s*\n\s*/", " ", trim($text)); } @@ -204,18 +204,18 @@ function getDescription () { return isset($this->_description) ? $this->_description : ''; } - + function asXML () { $xml = ''; $basepage = $this->_basepage; - + foreach ($this->_content as $item) { if (is_string($item)) { $xml .= $item; } - elseif (is_subclass_of($item, - check_php_version(5) - ? 'Cached_DynamicContent' + elseif (is_subclass_of($item, + check_php_version(5) + ? 'Cached_DynamicContent' : 'cached_dynamiccontent')) { $val = $item->expand($basepage, $this); @@ -236,11 +236,11 @@ if (is_string($item)) { print $item; } - elseif (is_subclass_of($item, - check_php_version(5) - ? 'Cached_DynamicContent' - : 'cached_dynamiccontent')) - { // give the content the chance to know about itself or even + elseif (is_subclass_of($item, + check_php_version(5) + ? 'Cached_DynamicContent' + : 'cached_dynamiccontent')) + { // give the content the chance to know about itself or even // to change itself $val = $item->expand($basepage, $this); if ($val) $val->printXML(); @@ -251,7 +251,7 @@ } } } -} +} /** * The base class for all dynamic content. @@ -301,7 +301,7 @@ $this->_getURL($basepage), $this->_getRelation($basepage)); } - + function _getURL($basepage) { return $this->_url; } @@ -343,18 +343,18 @@ if (substr($this->_page,0,1) == ':') { $this->_page = substr($this->_page,1); $this->_nolink = true; - } + } if ($anchor) $this->_anchor = $anchor; if ($label and $label != $page) $this->_label = $label; - $this->_basepage = false; + $this->_basepage = false; } function _getType() { return 'internal'; } - + function getPagename($basepage) { $page = new WikiPageName($this->_page, $basepage); if ($page->isValid()) return $page->name; @@ -364,9 +364,9 @@ function getWikiPageLinks($basepage) { if ($basepage == '') return false; if (isset($this->_nolink)) return false; - if ($link = $this->getPagename($basepage)) + if ($link = $this->getPagename($basepage)) return array(array('linkto' => $link)); - else + else return false; } @@ -428,7 +428,7 @@ } return WikiLink($this->_page, 'if_known'); } -} +} class Cached_SpellCheck extends Cached_WikiLink { @@ -438,14 +438,14 @@ } function expand($basepage, &$markup) { - $link = HTML::a(array('class' => 'spell-wrong', + $link = HTML::a(array('class' => 'spell-wrong', 'title' => 'SpellCheck: '.join(', ', $this->suggestions), - 'name' => $this->_page), + 'name' => $this->_page), $this->_page); return $link; } -} - +} + class Cached_PhpwikiURL extends Cached_DynamicContent { function Cached_PhpwikiURL ($url, $label) { @@ -479,16 +479,16 @@ return $this->_label; return $this->_url; } -} +} /* * Relations (::) are named links to pages. - * Attributes (:=) are named metadata per page, "named links to numbers with units". + * Attributes (:=) are named metadata per page, "named links to numbers with units". * We don't want to exhaust the linktable with numbers, - * since this would create empty pages per each value, - * so we don't store the attributes as full relationlink. - * But we do store the attribute name as relation with an empty pagename - * to denote that this is an attribute, + * since this would create empty pages per each value, + * so we don't store the attributes as full relationlink. + * But we do store the attribute name as relation with an empty pagename + * to denote that this is an attribute, * and to enable a fast listRelations mode=attributes */ class Cached_SemanticLink extends Cached_WikiLink { @@ -519,12 +519,12 @@ if (!isset($this->_page) and isset($this->_attribute)) { // An attribute: we store it in the basepage now, to fill the cache for page->save // TODO: side-effect free query - $page = $GLOBALS['request']->getPage($basepage); + $page = $GLOBALS['request']->getPage($basepage); $page->setAttribute($this->_relation, $this->_attribute); $this->_page = $basepage; return array(array('linkto' => '', 'relation' => $this->_relation)); } - if ($link = $this->getPagename($basepage)) + if ($link = $this->getPagename($basepage)) return array(array('linkto' => $link, 'relation' => $this->_relation)); else return false; @@ -539,10 +539,10 @@ $is_attribute = ($m[2] == ':='); if ($is_attribute) { $this->_attribute = urldecode($m[3]); - // since this stored in the markup cache, we are extra sensible + // since this stored in the markup cache, we are extra sensible // not to store false empty stuff. $units = new Units(); - if (!DISABLE_UNITS and !$units->errcode) + if (!DISABLE_UNITS and !$units->errcode) { $this->_attribute_base = $units->Definition($this->_attribute); $this->_unit = $units->baseunit($this->_attribute); @@ -572,8 +572,8 @@ ( HTML::a(array('href' => WikiURL($is_attribute ? $this->_relation : $this->_page), 'class' => "wiki ".($is_attribute ? "attribute" : "relation"), - 'title' => $is_attribute - ? $title + 'title' => $is_attribute + ? $title : sprintf(_("Relation %s to page %s"), $this->_relation, $this->_page)), $label) ); @@ -617,7 +617,7 @@ } } -/** +/** * Highlight found search engine terms */ class Cached_SearchHighlight extends Cached_DynamicContent @@ -632,8 +632,8 @@ 'title' => _("Found by ") . $this->engine), $this->_word); } -} - +} + class Cached_ExternalLink extends Cached_Link { function Cached_ExternalLink($url, $label=false) { @@ -645,7 +645,7 @@ function _getType() { return 'external'; } - + function _getName($basepage) { $label = isset($this->_label) ? $this->_label : false; return ($label and is_string($label)) ? $label : $this->_url; @@ -658,7 +658,7 @@ $link = LinkURL($this->_url, $label); if (GOOGLE_LINKS_NOFOLLOW) { - // Ignores nofollow when the user who saved the page was authenticated. + // Ignores nofollow when the user who saved the page was authenticated. $page = $request->getPage($basepage); $current = $page->getCurrentRevision(false); if (!$current->get('author_id')) @@ -675,7 +675,7 @@ } class Cached_InterwikiLink extends Cached_ExternalLink { - + function Cached_InterwikiLink($link, $label=false) { $this->_link = $link; if ($label) @@ -706,7 +706,7 @@ $label = isset($this->_label) ? $this->_label : false; return ($label and is_string($label)) ? $label : $this->_link; } - + /* there may be internal interwiki links also */ function _getType() { return $this->getPagename(false) ? 'internal' : 'external'; @@ -737,7 +737,7 @@ } // Needed to put UserPages to backlinks. Special method to markup userpages with icons -// Thanks to PhpWiki:DanFr for finding this bug. +// Thanks to PhpWiki:DanFr for finding this bug. // Fixed since 1.3.8, prev. versions had no userpages in backlinks class Cached_UserLink extends Cached_WikiLink { function expand($basepage, &$markup) { @@ -753,7 +753,7 @@ } /** - * 1.3.13: Previously stored was only _pi. + * 1.3.13: Previously stored was only _pi. * A fresh generated cache has now ->name and ->args also. * main::isActionPage only checks the raw content. */ @@ -771,7 +771,7 @@ function setTightness($top, $bottom) { } - + function isInlineElement() { return false; } @@ -803,12 +803,11 @@ } } -// (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/DbaDatabase.php =================================================================== --- trunk/lib/DbaDatabase.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/DbaDatabase.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -19,7 +19,7 @@ $this->_error( sprintf( _("The DBA handler %s is unsupported!")."\n". - _("Supported handlers are: %s"), + _("Supported handlers are: %s"), $handler, join(",",dba_handlers()))); } $this->readonly = false; @@ -30,11 +30,11 @@ function set_timeout($timeout) { $this->_timeout = $timeout; } - + function open($mode = 'w') { if ($this->_dbh) return; // already open. - + $watchdog = $this->_timeout; global $ErrorManager; @@ -45,7 +45,7 @@ if (!function_exists("dba_open")) { echo "You don't seem to have DBA support compiled into PHP."; } - + if (READONLY) { $mode = 'r'; } @@ -62,12 +62,12 @@ if ($watchdog <= 0) break; // "c" failed, try "w" instead. - if ($mode == "w" - and file_exists($this->_file) + if ($mode == "w" + and file_exists($this->_file) and (isWindows() or !is_writable($this->_file))) { // try to continue with read-only - if (!defined("READONLY")) + if (!defined("READONLY")) define("READONLY", true); $GLOBALS['request']->_dbi->readonly = true; $this->readonly = true; @@ -116,7 +116,7 @@ function exists($key) { return dba_exists($key, $this->_dbh); } - + function fetch($key) { $val = dba_fetch($key, $this->_dbh); if ($val === false) @@ -134,7 +134,7 @@ return $this->_error("replace($key)"); } - + function firstkey() { return dba_firstkey($this->_dbh); } @@ -182,7 +182,7 @@ return $this->_error("optimize()"); return 1; } - + function _error($mes) { //trigger_error("DbaDatabase: $mes", E_USER_WARNING); //return false; @@ -201,12 +201,11 @@ } } -// (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/DbaListSet.php =================================================================== --- trunk/lib/DbaListSet.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/DbaListSet.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -52,7 +52,7 @@ list( $prev , , ) = explode(':', $this->_dbh->fetch(intval($i)), 3); return intval($prev); } - + function exists($i) { $i = intval($i); return $i && $this->_dbh->exists($i); @@ -68,7 +68,7 @@ list($prev, $next,) = explode(':', $dbh->fetch(intval($i)), 3); $dbh->replace($i, "$prev:$next:$data"); } - + function insert_before($i, $data) { assert(intval($i)); return $this->_insert_before_nc($i, $data); @@ -78,7 +78,7 @@ assert(intval($i)); return $this->_insert_after_nc($i, $data); } - + function append($seq, $data) { $key = "s" . urlencode($seq); $this->_insert_before_nc($key, $data); @@ -88,7 +88,7 @@ $key = "s" . urlencode($seq); $this->_insert_after_nc($key, $data); } - + function _insert_before_nc($i, &$data) { $newkey = $this->_new_key(); $old_prev = $this->_setprev($i, $newkey); @@ -135,8 +135,6 @@ } } - -// For emacs users // Local Variables: // mode: php // tab-width: 8 @@ -144,4 +142,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/ErrorManager.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -4,7 +4,7 @@ // php5: ignore E_STRICT (var warnings) /* -if (defined('E_STRICT') +if (defined('E_STRICT') and (E_ALL & E_STRICT) and (error_reporting() & E_STRICT)) { echo " errormgr: error_reporting=", error_reporting(); @@ -17,9 +17,9 @@ E_WARNING | E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING | ((check_php_version(5,3)) ? E_DEPRECATED : 0)); define ('EM_NOTICE_ERRORS', E_NOTICE | E_USER_NOTICE); -/* It is recommended to leave assertions on. +/* It is recommended to leave assertions on. You can simply comment the two lines below to leave them on. - Only where absolute speed is necessary you might want to turn + Only where absolute speed is necessary you might want to turn them off. */ //also turn it on if phpwiki_version notes no release @@ -40,8 +40,8 @@ * of it --- you can access the one instance via $GLOBALS['ErrorManager']. * * FIXME: more docs. - */ -class ErrorManager + */ +class ErrorManager { /** * Constructor. @@ -97,7 +97,7 @@ else echo $this->_flush_errors(); } - + /** * Get rid of all pending error messages in case of all non-html * - pdf or image - output. @@ -112,7 +112,7 @@ * * This also flushes the postponed error queue. * - * @return object HTML describing any queued errors (or false, if none). + * @return object HTML describing any queued errors (or false, if none). */ function getPostponedErrorsAsHTML() { $flushed = $this->_flush_errors(); @@ -129,14 +129,14 @@ } if ($worst_err->isNotice()) return $flushed; - $class = $worst_err->getHtmlClass(); + $class = $worst_err->getHtmlClass(); $html = HTML::div(array('style' => 'border: none', 'class' => $class), - HTML::h4(array('class' => 'errors'), + HTML::h4(array('class' => 'errors'), "PHP " . $worst_err->getDescription())); $html->pushContent($flushed); return $html; } - + /** * Push a custom error handler on the handler stack. * @@ -228,7 +228,7 @@ if (!empty($GLOBALS['request']->_finishing)) { $this->_postpone_mask = 0; } - + $in_handler = true; foreach ($this->_handlers as $handler) { @@ -282,7 +282,7 @@ else if (($error->errno & error_reporting()) != 0) { if (($error->errno & $this->_postpone_mask) != 0) { if ((function_exists('isa') and isa($error, 'PhpErrorOnce')) - or (!function_exists('isa') and + or (!function_exists('isa') and ( // stdlib independent isa() (strtolower(get_class($error)) == 'phperroronce') @@ -311,7 +311,7 @@ function warning($msg, $errno = E_USER_NOTICE) { $this->handleError(new PhpWikiError($errno, $msg, '?', '?')); } - + /** * @access private */ @@ -355,7 +355,7 @@ $request->_validators->_mtime = false; } if ($already) return; - + // FIXME: Howto announce that to Request->cacheControl()? if (!headers_sent()) { header( "Cache-control: no-cache" ); @@ -370,7 +370,7 @@ * * This is necessary since PHP's set_error_handler() does not allow * one to set an object method as a handler. - * + * * @access private */ function ErrorManager_errorHandler($errno, $errstr, $errfile, $errline) @@ -461,7 +461,7 @@ return 'errors'; } } - + function getDescription() { if ($this->isNotice()) { return 'Notice'; @@ -482,7 +482,7 @@ $dir = str_replace('/','\\',$dir); $this->errfile = str_replace('/','\\',$this->errfile); $dir .= "\\"; - } else + } else $dir .= '/'; $errfile = preg_replace('|^' . preg_quote($dir) . '|', '', $this->errfile); $lines = explode("\n", $this->errstr); @@ -502,7 +502,7 @@ $this->getDescription(), array_shift($lines)); } - + $html = HTML::div(array('class' => $this->getHtmlClass()), HTML::p($msg)); // The class is now used for the div container. // $html = HTML::div(HTML::p($msg)); @@ -512,7 +512,7 @@ $list->pushContent(HTML::li($line)); $html->pushContent($list); } - + return $html; } @@ -569,7 +569,7 @@ } function _getDetail() { - return HTML::div(array('class' => $this->getHtmlClass()), + return HTML::div(array('class' => $this->getHtmlClass()), HTML::p($this->getDescription() . ": $this->errstr")); } } @@ -577,7 +577,7 @@ /** * A class representing a Php warning, printed only the first time. * - * Similar to PhpError, except only the first same error message is printed, + * Similar to PhpError, except only the first same error message is printed, * with number of occurences. */ class PhpErrorOnce extends PhpError { @@ -606,7 +606,7 @@ } return $this->_count; } - + function _getDetail($count=0) { if (!$count) $count = $this->_count; $dir = defined('PHPWIKI_DIR') ? PHPWIKI_DIR : substr(dirname(__FILE__),0,-4); @@ -614,7 +614,7 @@ $dir = str_replace('/','\\',$dir); $this->errfile = str_replace('/','\\',$this->errfile); $dir .= "\\"; - } else + } else $dir .= '/'; $errfile = preg_replace('|^' . preg_quote($dir) . '|', '', $this->errfile); if (is_string($this->errstr)) @@ -636,7 +636,7 @@ array_shift($lines), $count > 1 ? sprintf(" (...repeated %d times)",$count) : ""); } - $html = HTML::div(array('class' => $this->getHtmlClass()), + $html = HTML::div(array('class' => $this->getHtmlClass()), HTML::p($msg)); if ($lines) { $list = HTML::ul(); @@ -644,7 +644,7 @@ $list->pushContent(HTML::li($line)); $html->pushContent($list); } - + return $html; } } @@ -659,7 +659,6 @@ $GLOBALS['ErrorManager'] = new ErrorManager; } -// (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/ExternalReferrer.php =================================================================== --- trunk/lib/ExternalReferrer.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/ExternalReferrer.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -1,11 +1,11 @@ <?php // rcs_id('$Id$'); -/** +/** * Detect external referrers * Currently only search engines, and highlight the searched item. * - * Todo: + * Todo: * store all external referrers in (rotatable) log/db for a RecentReferrers plugin. */ if (!function_exists('isExternalReferrer')) { // also defined in stdlib.php @@ -23,7 +23,7 @@ class SearchEngines { - var $searchEngines = + var $searchEngines = array( "search.sli.sympatico.ca/" => array("engine" => "Sympatico", "query1" => "query=", "query2" => "", "url" => "http://www1.sympatico.ca/"), "www.search123.com/cgi-bin/" => array("engine" => "Search123", "query1" => "query=", "query2" => "", "url" => "http://www.search123.com/"), @@ -64,10 +64,10 @@ "lycos." => array("engine" => "Lycos", "query1" => "query=", "query2" => "", "url" => "http://www.lycos.com/"), "msn." => array("engine" => "MSN", "query1" => "q=", "query2" => "", "url" => "http://search.msn.com/"), "dmoz." => array("engine" => "Dmoz", "query1" => "search=", "query2" => "", "url" => "http://www.dmoz.org/"), - + ); - /** + /** * parseSearchQuery(url) * Parses the passed refering url looking for search engine data. If search info is found, * the method determines the name of the search engine, it's URL, and the search keywords @@ -115,7 +115,6 @@ } } -// For emacs users // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/HtmlElement.php =================================================================== --- trunk/lib/HtmlElement.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/HtmlElement.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -33,7 +33,7 @@ assert(count($args) >= 1); assert(is_string($args[0])); $this->_tag = array_shift($args); - + if ($args && is_array($args[0])) $this->_attr = array_shift($args); else { @@ -56,7 +56,7 @@ elseif ($args[0] === false) array_shift($args); } - + if (count($args) == 1 && is_array($args[0])) $args = $args[0]; $this->_content = $args; @@ -89,15 +89,15 @@ if (preg_match("/\[(alt-)?(.)\]$/", $this->_attr['title'], $m)) { $this->_attr['title'] = preg_replace - ("/\[(alt-)?(.)\]$/", - "[".$WikiTheme->tooltipAccessKeyPrefix()."-\\2]", + ("/\[(alt-)?(.)\]$/", + "[".$WikiTheme->tooltipAccessKeyPrefix()."-\\2]", $this->_attr['title']); } else { - $this->_attr['title'] .= + $this->_attr['title'] .= " [".$WikiTheme->tooltipAccessKeyPrefix()."-$key]"; } } else { - $this->_attr['title'] = + $this->_attr['title'] = "[".$WikiTheme->tooltipAccessKeyPrefix()."-$key]"; } } @@ -126,7 +126,7 @@ function raw ($html_text) { return new RawXml($html_text); } - + function getTagProperties($tag) { $props = &$GLOBALS['HTML_TagProperties']; return isset($props[$tag]) ? $props[$tag] : 0; @@ -544,8 +544,7 @@ } return HTML($html); } - -// (c-file-style: "gnu") + // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/HtmlElement5.php =================================================================== --- trunk/lib/HtmlElement5.php 2010-08-10 12:30:47 UTC (rev 7637) +++ trunk/lib/HtmlElement5.php 2010-08-11 11:58:40 UTC (rev 7638) @@ -33,7 +33,7 @@ assert(count($args) >= 1); assert(is_string($args[0])); $this->_tag = array_shift($args); - + if ($args && is_array($args[0])) $this->_attr = array_shift($args); else { @@ -56,7 +56,7 @@ elseif ($args[0] === false) array_shift($args); } - + if (count($args) == 1 && is_array($args[0])) $args = $args[0]; $this->_content = $args; @@ -89,15 +89,15 @@ if (preg_match("/\[(alt-)?(.)\]$/", $this->_attr['title'], $m)) { $this->_attr['title'] = preg_replace - ("/\[(alt-)?(.)\]$/", - "[".$WikiTheme->tooltipAccessKeyPrefix()."-\\2]", + ("/\[(alt-)?(.)\]$/", + "[".$WikiTheme->tooltipAccessKeyPrefix()."-\\2]", $this->_attr['title']); } else { - $this->_attr['title'] .= + $this->_attr['title'] .= " [".$WikiTheme->tooltipAccessKeyPrefix()."-$key]"; } } else { - $this->_attr['title'] = + $this->_attr['title'] = "[".$WikiTheme->tooltipAccessKeyPrefix()."-$key]"; } } @@ -126,7 +126,7 @@ public static function raw ($html_text) { return new RawXml($html_text); } - + function getTagProperties($tag) { $props = &$GLOBALS['HTML_TagProperties']; return isset($props[$tag]) ? $props[$tag] : 0; @@ -544,8... [truncated message content] |