You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(43) |
Nov
(73) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(34) |
Feb
(110) |
Mar
(24) |
Apr
(44) |
May
(37) |
Jun
(22) |
Jul
(20) |
Aug
(28) |
Sep
(50) |
Oct
(11) |
Nov
(132) |
Dec
(595) |
2002 |
Jan
(1099) |
Feb
(579) |
Mar
(63) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(125) |
Sep
(101) |
Oct
(25) |
Nov
(34) |
Dec
(47) |
2003 |
Jan
(82) |
Feb
(182) |
Mar
(71) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(14) |
Oct
(6) |
Nov
(124) |
Dec
(68) |
2004 |
Jan
(64) |
Feb
(191) |
Mar
(199) |
Apr
(298) |
May
(252) |
Jun
(426) |
Jul
(134) |
Aug
(13) |
Sep
(96) |
Oct
(75) |
Nov
(232) |
Dec
(171) |
2005 |
Jan
(205) |
Feb
(165) |
Mar
(8) |
Apr
(74) |
May
(21) |
Jun
(19) |
Jul
(37) |
Aug
(69) |
Sep
(141) |
Oct
(118) |
Nov
(31) |
Dec
(7) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
(35) |
Apr
(24) |
May
(34) |
Jun
(29) |
Jul
(5) |
Aug
(38) |
Sep
(30) |
Oct
(37) |
Nov
(30) |
Dec
(86) |
2007 |
Jan
(414) |
Feb
(40) |
Mar
(18) |
Apr
(10) |
May
(66) |
Jun
(60) |
Jul
(105) |
Aug
(55) |
Sep
(64) |
Oct
(7) |
Nov
(11) |
Dec
(5) |
2008 |
Jan
(26) |
Feb
(28) |
Mar
(79) |
Apr
(34) |
May
(61) |
Jun
(24) |
Jul
(29) |
Aug
(160) |
Sep
(62) |
Oct
(70) |
Nov
(32) |
Dec
(14) |
2009 |
Jan
(140) |
Feb
(135) |
Mar
(153) |
Apr
(53) |
May
(24) |
Jun
(138) |
Jul
(90) |
Aug
(46) |
Sep
(72) |
Oct
(84) |
Nov
(32) |
Dec
(4) |
2010 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(55) |
May
(89) |
Jun
(131) |
Jul
(41) |
Aug
(38) |
Sep
(42) |
Oct
(11) |
Nov
(27) |
Dec
(54) |
2011 |
Jan
(127) |
Feb
(16) |
Mar
(71) |
Apr
(52) |
May
(32) |
Jun
(31) |
Jul
(4) |
Aug
|
Sep
(45) |
Oct
(26) |
Nov
(36) |
Dec
(10) |
2012 |
Jan
(23) |
Feb
(6) |
Mar
(13) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
(3) |
Aug
(12) |
Sep
(57) |
Oct
(96) |
Nov
(163) |
Dec
(124) |
2013 |
Jan
(11) |
Feb
(17) |
Mar
(7) |
Apr
(48) |
May
(15) |
Jun
(29) |
Jul
(12) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(3) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(8) |
Jun
(90) |
Jul
(104) |
Aug
(12) |
Sep
(81) |
Oct
(139) |
Nov
(111) |
Dec
(64) |
2015 |
Jan
(46) |
Feb
(74) |
Mar
(56) |
Apr
(61) |
May
(3) |
Jun
(7) |
Jul
(11) |
Aug
(5) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
(15) |
2016 |
Jan
(25) |
Feb
(33) |
Mar
(24) |
Apr
(4) |
May
(24) |
Jun
(3) |
Jul
(75) |
Aug
|
Sep
(2) |
Oct
(38) |
Nov
(4) |
Dec
(18) |
2017 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(14) |
Jun
|
Jul
(5) |
Aug
(9) |
Sep
|
Oct
(23) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(9) |
Apr
(60) |
May
(1) |
Jun
|
Jul
(13) |
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(15) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
2021 |
Jan
(24) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(64) |
Jul
(71) |
Aug
(114) |
Sep
(82) |
Oct
(32) |
Nov
(76) |
Dec
(86) |
2022 |
Jan
(162) |
Feb
(41) |
Mar
(11) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2023 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2024 |
Jan
(7) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(90) |
Mar
(19) |
Apr
|
May
(6) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <var...@us...> - 2010-08-11 13:00:55
|
Revision: 7641 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7641&view=rev Author: vargenau Date: 2010-08-11 13:00:46 +0000 (Wed, 11 Aug 2010) Log Message: ----------- Harmonize header Modified Paths: -------------- trunk/lib/DbSession/ADODB.php trunk/lib/HtmlParser.php trunk/lib/PageType.php trunk/lib/RssParser.php trunk/lib/SemanticWeb.php trunk/lib/WikiDB/backend/ADODB.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/dumb/LinkSearchIter.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend/flatfile.php trunk/lib/WikiDB/file.php trunk/lib/WikiDB/flatfile.php trunk/lib/XmlParser.php trunk/lib/install.php trunk/lib/loadsave.php trunk/lib/wikilens/PageListColumns.php trunk/lib/wikilens/Utils.php Modified: trunk/lib/DbSession/ADODB.php =================================================================== --- trunk/lib/DbSession/ADODB.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/DbSession/ADODB.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -1,25 +1,25 @@ <?php // rcs_id('$Id$'); /* - Copyright 2005 $ThePhpWikiProgrammingTeam + * Copyright 2005 $ThePhpWikiProgrammingTeam + * + * 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 + */ - 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 -*/ - -/** +/** * ADODB db sessions, based on pear DB Sessions. * * @author: Reini Urban @@ -52,13 +52,13 @@ if (!$dbh or !is_resource($dbh->_connectionID)) { if (!$parsed) $parsed = parseDSN($request->_dbi->getParam('dsn')); $this->_dbh =& ADONewConnection($parsed['phptype']); // Probably only MySql works just now - $this->_dbh->Connect($parsed['hostspec'],$parsed['username'], + $this->_dbh->Connect($parsed['hostspec'],$parsed['username'], $parsed['password'], $parsed['database']); - $dbh = &$this->_dbh; + $dbh = &$this->_dbh; } return $dbh; } - + function query($sql) { return $this->_dbh->Execute($sql); } @@ -78,7 +78,7 @@ * Actually this function is a fake for session_set_save_handle. * @param string $save_path a path to stored files * @param string $session_name a name of the concrete file - * @return boolean true just a variable to notify PHP that everything + * @return boolean true just a variable to notify PHP that everything * is good. * @access private */ @@ -92,7 +92,7 @@ * * This function is called just after <i>write</i> call. * - * @return boolean true just a variable to notify PHP that everything + * @return boolean true just a variable to notify PHP that everything * is good. * @access private */ @@ -129,11 +129,11 @@ } return $res; } - + /** * Saves the session data into DB. * - * Just a comment: The "write" handler is not + * Just a comment: The "write" handler is not * executed until after the output stream is closed. Thus, * output from debugging statements in the "write" handler * will never be seen in the browser. If debugging output @@ -147,8 +147,8 @@ * @access private */ function write ($id, $sess_data) { - if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return; - + if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return; + $dbh = $this->_connect(); $table = $this->_table; $qid = $dbh->qstr($id); @@ -181,7 +181,7 @@ } } $result = ! $rs->EOF; - if ($result) $rs->free(); + if ($result) $rs->free(); $this->_disconnect(); return $result; } @@ -192,7 +192,7 @@ * Removes a session from the table. * * @param string $id - * @return boolean true + * @return boolean true * @access private */ function destroy ($id) { @@ -203,7 +203,7 @@ $dbh->Execute("DELETE FROM $table WHERE sess_id=$qid"); $this->_disconnect(); - return true; + return true; } /** @@ -224,7 +224,7 @@ return true; } - // WhoIsOnline support. + // WhoIsOnline support. // TODO: ip-accesstime dynamic blocking API function currentSessions() { $sessions = array(); Modified: trunk/lib/HtmlParser.php =================================================================== --- trunk/lib/HtmlParser.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/HtmlParser.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -6,23 +6,23 @@ */ /* - Copyright (C) 2004 Reini Urban - - 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 + * Copyright (C) 2004 Reini Urban + * + * 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 */ /** Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/PageType.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -1,23 +1,23 @@ <?php // -*-php-*- // rcs_id('$Id$'); /* - Copyright 1999,2000,2001,2002,2003,2004,2005,2006 $ThePhpWikiProgrammingTeam - - 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 + * Copyright 1999,2000,2001,2002,2003,2004,2005,2006 $ThePhpWikiProgrammingTeam + * + * 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 */ require_once('lib/CachedMarkup.php'); @@ -57,7 +57,7 @@ * Currently the only information encapsulated is how to format * the specific page type. In the future or capabilities may be * added, e.g. the abilities to edit different page types (differently.) - * e.g. Support for the javascript htmlarea editor, which can only edit + * e.g. Support for the javascript htmlarea editor, which can only edit * pure HTML. * * IMPORTANT NOTE: Since the whole PageType class gets stored (serialized) @@ -142,7 +142,7 @@ trigger_error(_("WARNING: InterWikiMap page is unlocked, so not using those links.")); $intermap = false; } - else + else $intermap = false; } else { $intermap = $this->_getMapFromWikiText($pagetext); @@ -171,7 +171,7 @@ function link ($link, $linktext = false) { global $WikiTheme; list ($moniker, $page) = explode (":", $link, 2); - + if (!isset($this->_map[$moniker])) { return HTML::span(array('class' => 'bad-interwiki'), $linktext ? $linktext : $link); @@ -198,7 +198,7 @@ $link_prefix = NormalizeWebFileName(substr($url, strlen($wikiroot))); } } - + // Urlencode page only if it's a query arg. // FIXME: this is a somewhat broken heuristic. if ($moniker == 'Upload') { @@ -223,7 +223,7 @@ $link->pushContent(PossiblyGlueIconToText('interwiki', $linktext)); $link->setAttr('class', 'named-interwiki'); } - + return $link; } @@ -240,13 +240,13 @@ // Add virtual monikers: "Upload:" "Talk:" "User:", ":" // and expand special variables %u, %b, %d - // Upload: Should be expanded later to user-specific upload dirs. + // Upload: Should be expanded later to user-specific upload dirs. // In the Upload plugin, not here: Upload:ReiniUrban/uploaded-file.png if (empty($map['Upload'])) { $map['Upload'] = getUploadDataPath(); } // User:ReiniUrban => ReiniUrban or Users/ReiniUrban - // Can be easily overriden by a customized InterWikiMap: + // Can be easily overriden by a customized InterWikiMap: // User Users/%s if (empty($map["User"])) { $map["User"] = "%s"; @@ -270,15 +270,15 @@ // %s is expanded later to the pagename if (strstr($map[$special], '%u')) $map[$special] = str_replace($map[$special], - '%u', + '%u', $GLOBALS['request']->_user->_userid); if (strstr($map[$special], '%b')) $map[$special] = str_replace($map[$special], - '%b', + '%b', PHPWIKI_BASE_URL); if (strstr($map[$special], '%d')) $map[$special] = str_replace($map[$special], - '%d', + '%d', // such as 2003-01-11T14:03:02+00:00 Iso8601DateTime()); } @@ -295,7 +295,7 @@ function _getMapFromFile ($filename) { if (defined('WARN_NONPUBLIC_INTERWIKIMAP') and WARN_NONPUBLIC_INTERWIKIMAP) { - $error_html = sprintf(_("Loading InterWikiMap from external file %s."), + $error_html = sprintf(_("Loading InterWikiMap from external file %s."), $filename); trigger_error( $error_html, E_USER_NOTICE ); } @@ -313,7 +313,7 @@ function _getRegexp () { if (!$this->_map) return '(?:(?!a)a)'; // Never matches. - + foreach (array_keys($this->_map) as $moniker) $qkeys[] = preg_quote($moniker, '/'); return "(?:" . join("|", $qkeys) . ")"; @@ -335,7 +335,7 @@ if (!empty($meta['markup'])) $this->_markup = $meta['markup']; else - $this->_markup = 2; // dump used old-markup as empty. + $this->_markup = 2; // dump used old-markup as empty. // FIXME: To be able to restore old plain-backups we should keep markup 1 as default. // New policy: default = new markup (old crashes quite often) } @@ -355,7 +355,7 @@ } } -class PageFormatter_wikitext extends PageFormatter +class PageFormatter_wikitext extends PageFormatter { function format(&$text) { return HTML::div(array('class' => 'wikitext'), @@ -379,12 +379,12 @@ function _getFooter($text) { return preg_replace('@.*?(</verbatim>|\Z)@s', '', $text, 1); } - + function _getMap($pagetext) { $map = getInterwikiMap($pagetext, 'force'); return $map->_map; } - + function _formatMap($pagetext) { $map = $this->_getMap($pagetext); if (!$map) @@ -392,14 +392,14 @@ $mon_attr = array('class' => 'interwiki-moniker'); $url_attr = array('class' => 'interwiki-url'); - + $thead = HTML::thead(HTML::tr(HTML::th($mon_attr, _("Moniker")), HTML::th($url_attr, _("InterWiki Address")))); foreach ($map as $moniker => $interurl) { $rows[] = HTML::tr(HTML::td($mon_attr, new Cached_WikiLinkIfKnown($moniker)), HTML::td($url_attr, HTML::tt($interurl))); } - + return HTML::table(array('class' => 'interwiki-map'), $thead, HTML::tbody(false, $rows)); @@ -422,7 +422,7 @@ class PageFormatter_attach extends PageFormatter { var $type, $prefix; - + // Display templated contents for wikiblog, comment and wikiforum function format($text) { if (empty($this->type)) @@ -439,7 +439,7 @@ $meta = $this->_meta[$this->type]; foreach(array('ctime', 'creator', 'creator_id') as $key) $tokens[$this->prefix . "_" . strtoupper($key)] = $meta[$key]; - + return new Template($this->type, $request, $tokens); } } @@ -454,12 +454,12 @@ var $type = 'wikiforum', $prefix = "FORUM"; } -/** wikiabuse for htmlarea editing. not yet used. +/** wikiabuse for htmlarea editing. not yet used. * * Warning! Once a page is edited with a htmlarea like control it is * stored in HTML and cannot be converted back to WikiText as long as - * we have no HTML => WikiText or any other interim format (WikiExchangeFormat e.g. XML) - * converter. See lib/HtmlParser.php for ongoing work on that. + * we have no HTML => WikiText or any other interim format (WikiExchangeFormat e.g. XML) + * converter. See lib/HtmlParser.php for ongoing work on that. * So it has a viral effect and certain plugins will not work anymore. * But a lot of wikiusers seem to like it. */ @@ -497,7 +497,7 @@ // We can make use of several pdf extensions. This one - fpdf // - is pure php and very easy, but looks quite ugly and has a - // terrible interface, as terrible as most of the othes. + // terrible interface, as terrible as most of the othes. // The closest to HTML is htmldoc which needs an external cgi // binary. // We use a custom HTML->PDF class converter from PHPWebthings Modified: trunk/lib/RssParser.php =================================================================== --- trunk/lib/RssParser.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/RssParser.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -12,21 +12,21 @@ */ /* - 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 + * 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 */ /** Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/SemanticWeb.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -84,23 +84,23 @@ */ /*============================================================================*/ /* - Copyright 2004,2007 Reini Urban - - 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 + * Copyright 2004,2007 Reini Urban + * + * 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 */ require_once('lib/RssWriter.php'); @@ -403,5 +403,5 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/WikiDB/backend/ADODB.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/ADODB.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,26 +2,25 @@ // rcs_id('$Id$'); /* - Copyright 2002,2004,2005,2006 $ThePhpWikiProgrammingTeam + * Copyright 2002,2004,2005,2006 $ThePhpWikiProgrammingTeam + * + * 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 + */ - 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 - -*/ - /** * Based on PearDB.php. * @author: Lawrence Akka, Reini Urban @@ -162,7 +161,7 @@ $dbh->qstr($pagename))); return $row ? $row[0] : false; } - + function get_all_pagenames() { $dbh = &$this->_dbh; extract($this->_table_names); @@ -230,13 +229,13 @@ $where = sprintf("pagename=%s", $dbh->qstr($pagename)); $dbh->BeginTrans( ); $dbh->RowLock($page_tbl,$where); - + $data = $this->get_pagedata($pagename); if (!$data) { $data = array(); $this->_get_pageid($pagename, true); // Creates page record } - + $hits = (empty($data['hits'])) ? 0 : (int)$data['hits']; unset($data['hits']); @@ -353,7 +352,7 @@ 1); return $rs->fields ? (int)$rs->fields[0] : false; } - + /** * Get version data. * @@ -366,10 +365,10 @@ $dbh = &$this->_dbh; extract($this->_table_names); extract($this->_expressions); - + assert(is_string($pagename) and $pagename != ''); assert($version > 0); - + // FIXME: optimization: sometimes don't get page data? if ($want_content) { $fields = $this->page_tbl_fields . ", $page_tbl.pagedata AS pagedata" @@ -437,10 +436,10 @@ function set_versiondata($pagename, $version, $data) { $dbh = &$this->_dbh; $version_tbl = $this->_table_names['version_tbl']; - + $minor_edit = (int) !empty($data['is_minor_edit']); unset($data['is_minor_edit']); - + $mtime = (int)$data['mtime']; unset($data['mtime']); assert(!empty($mtime)); @@ -448,7 +447,7 @@ @$content = (string) $data['%content']; unset($data['%content']); unset($data['%pagedata']); - + $this->lock(array('page','recent','version','nonempty')); $dbh->BeginTrans( ); $dbh->CommitLock($version_tbl); @@ -468,7 +467,7 @@ else $dbh->RollbackTrans( ); $this->unlock(array('page','recent','version','nonempty')); } - + /** * Delete an old revision of a page. */ @@ -542,7 +541,7 @@ function purge_page($pagename) { $dbh = &$this->_dbh; extract($this->_table_names); - + $this->lock(array('version','recent','nonempty','page','link')); if ( ($id = $this->_get_pageid($pagename, false)) ) { $dbh->Execute("DELETE FROM $nonempty_tbl WHERE id=$id"); @@ -615,7 +614,7 @@ if ($relation) { $dbh->Execute("INSERT INTO $link_tbl (linkfrom, linkto, relation)" . " VALUES ($pageid, $linkid, $relation)"); - } else { + } else { $dbh->Execute("INSERT INTO $link_tbl (linkfrom, linkto)" . " VALUES ($pageid, $linkid)"); } @@ -702,7 +701,7 @@ if ($relation) { $dbh->Execute("INSERT INTO $link_tbl (linkfrom, linkto, relation)" . " VALUES ($pageid, $linkid, $relation)"); - } else { + } else { $dbh->Execute("INSERT INTO $link_tbl (linkfrom, linkto)" . " VALUES ($pageid, $linkid)"); } @@ -736,7 +735,7 @@ $this->unlock(array('link')); return true; } - + /** * Find pages which link to or are linked from a page. * @@ -785,7 +784,7 @@ echo "SELECT linkee.id AS id, linkee.pagename AS pagename, related.pagename as linkrelation FROM link, page linkee, page linker JOIN page related ON (link.relation=related.id) WHERE linkfrom=linker.id AND linkto=linkee.id AND linker.pagename='SanDiego'" | mysql phpwiki id pagename linkrelation 2268 California located_in -*/ +*/ if ($limit) { // extract from,count from limit list($offset,$count) = $this->limit($limit); @@ -883,7 +882,7 @@ //$dbh->SetFetchMode(ADODB_FETCH_NUM); return new WikiDB_backend_ADODB_iter($this, $result, $this->page_tbl_field_list); } - + /** * Title and fulltext search. */ @@ -894,13 +893,13 @@ extract($this->_table_names); $orderby = $this->sortby($sortby, 'db'); if ($orderby) $orderby = ' ORDER BY ' . $orderby; - + $table = "$nonempty_tbl, $page_tbl"; $join_clause = "$nonempty_tbl.id=$page_tbl.id"; $fields = $this->page_tbl_fields; $field_list = $this->page_tbl_field_list; $searchobj = new WikiDB_backend_ADODB_search($search, $dbh); - + if ($fullsearch) { $table .= ", $recent_tbl"; $join_clause .= " AND $page_tbl.id=$recent_tbl.id"; @@ -915,7 +914,7 @@ } else { $callback = new WikiMethodCb($searchobj, "_pagename_match_clause"); } - + $search_clause = $search->makeSqlClauseObj($callback); $sql = "SELECT $fields FROM $table" . " WHERE $join_clause" @@ -1000,7 +999,7 @@ $pick = array(); if ($since) $pick[] = "mtime >= $since"; - + if ($include_all_revisions) { // Include all revisions of each page. $table = "$page_tbl, $version_tbl"; @@ -1020,7 +1019,7 @@ $join_clause = "$page_tbl.id=$recent_tbl.id"; $table .= ", $version_tbl"; $join_clause .= " AND $version_tbl.id=$page_tbl.id"; - + if ($exclude_major_revisions) { // Include only most recent minor revision $pick[] = 'version=latestminor'; @@ -1068,7 +1067,7 @@ extract($this->_table_names); if ($orderby = $this->sortby($sortby, 'db', array('pagename','wantedfrom'))) $orderby = 'ORDER BY ' . $orderby; - + if ($exclude_from) // array of pagenames $exclude_from = " AND pp.pagename NOT IN ".$this->_sql_set($exclude_from); if ($exclude) // array of pagenames @@ -1107,7 +1106,7 @@ function rename_page($pagename, $to) { $dbh = &$this->_dbh; extract($this->_table_names); - + $this->lock(array('page','version','recent','nonempty','link')); if ( ($id = $this->_get_pageid($pagename, false)) ) { if ($new = $this->_get_pageid($to, false)) { @@ -1204,7 +1203,7 @@ function _lock_tables($tables, $write_lock) { return $this->_current_lock; } - + /** * Release a write lock on the tables in the SQL database. * @@ -1269,7 +1268,7 @@ function listOfTables() { return $this->_dbh->MetaTables(); } - + // other database needs another connection and other privileges. function listOfFields($database, $table) { $field_list = array(); @@ -1315,7 +1314,7 @@ $this->_fields = $field_list; } - + function count() { if (!$this->_result) { return false; @@ -1568,5 +1567,5 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/PDO.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,25 +2,25 @@ // rcs_id('$Id$'); /* - Copyright 2005 $ThePhpWikiProgrammingTeam + * Copyright 2005 $ThePhpWikiProgrammingTeam + * + * 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 + */ - 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 -*/ - /** * @author: Reini Urban */ @@ -220,7 +220,7 @@ else return false; } - + function get_all_pagenames() { $dbh = &$this->_dbh; extract($this->_table_names); @@ -292,7 +292,7 @@ $data = array(); $this->_get_pageid($pagename, true); // Creates page record } - + $hits = (empty($data['hits'])) ? 0 : (int)$data['hits']; unset($data['hits']); @@ -354,7 +354,7 @@ // attributes play this game. if ($pagename === '') return 0; - + $dbh = &$this->_dbh; $page_tbl = $this->_table_names['page_tbl']; $sth = $dbh->prepare("SELECT id FROM $page_tbl WHERE pagename=? LIMIT 1"); @@ -422,7 +422,7 @@ $sth->execute(); return $sth->fetchSingle(); } - + /** * Get version data. * @@ -435,10 +435,10 @@ $dbh = &$this->_dbh; extract($this->_table_names); extract($this->_expressions); - + assert(is_string($pagename) and $pagename != ''); assert($version > 0); - + // FIXME: optimization: sometimes don't get page data? if ($want_content) { $fields = $this->page_tbl_fields . ", $page_tbl.pagedata AS pagedata" @@ -508,10 +508,10 @@ function set_versiondata($pagename, $version, $data) { $dbh = &$this->_dbh; $version_tbl = $this->_table_names['version_tbl']; - + $minor_edit = (int) !empty($data['is_minor_edit']); unset($data['is_minor_edit']); - + $mtime = (int)$data['mtime']; unset($data['mtime']); assert(!empty($mtime)); @@ -519,7 +519,7 @@ @$content = (string) $data['%content']; unset($data['%content']); unset($data['%pagedata']); - + $this->lock(array('page','recent','version','nonempty')); $this->beginTransaction(); $id = $this->_get_pageid($pagename, true); @@ -559,7 +559,7 @@ else $this->rollBack( ); $this->unlock(array('page','recent','version','nonempty')); } - + /** * Delete an old revision of a page. */ @@ -638,7 +638,7 @@ function purge_page($pagename) { $dbh = &$this->_dbh; extract($this->_table_names); - + $this->lock(array('version','recent','nonempty','page','link')); if ( ($id = $this->_get_pageid($pagename, false)) ) { $dbh->query("DELETE FROM $version_tbl WHERE id=$id"); @@ -716,7 +716,7 @@ $this->unlock(array('link')); return true; } - + /** * Find pages which link to or are linked from a page. * @@ -832,7 +832,7 @@ $result = $sth->fetch(PDO_FETCH_BOTH); return new WikiDB_backend_PDO_iter($this, $result, $this->page_tbl_field_list); } - + /** * Title search. */ @@ -848,7 +848,7 @@ $fields = $this->page_tbl_fields; $field_list = $this->page_tbl_field_list; $searchobj = new WikiDB_backend_PDO_search($search, $dbh); - + if ($fullsearch) { $table .= ", $recent_tbl"; $join_clause .= " AND $page_tbl.id=$recent_tbl.id"; @@ -862,7 +862,7 @@ } else { $callback = new WikiMethodCb($searchobj, "_pagename_match_clause"); } - + $search_clause = $search->makeSqlClauseObj($callback); $sth = $dbh->prepare("SELECT $fields FROM $table" . " WHERE $join_clause" @@ -942,7 +942,7 @@ $pick = array(); if ($since) $pick[] = "mtime >= $since"; - + if ($include_all_revisions) { // Include all revisions of each page. $table = "$page_tbl, $version_tbl"; @@ -962,7 +962,7 @@ $join_clause = "$page_tbl.id=$recent_tbl.id"; $table .= ", $version_tbl"; $join_clause .= " AND $version_tbl.id=$page_tbl.id"; - + if ($exclude_major_revisions) { // Include only most recent minor revision $pick[] = 'version=latestminor'; @@ -1008,7 +1008,7 @@ extract($this->_table_names); if ($orderby = $this->sortby($sortby, 'db', array('pagename','wantedfrom'))) $orderby = 'ORDER BY ' . $orderby; - + if ($exclude_from) // array of pagenames $exclude_from = " AND linked.pagename NOT IN ".$this->_sql_set($exclude_from); if ($exclude) // array of pagenames @@ -1047,7 +1047,7 @@ function rename_page($pagename, $to) { $dbh = &$this->_dbh; extract($this->_table_names); - + $this->lock(array('page','version','recent','nonempty','link')); if ( ($id = $this->_get_pageid($pagename, false)) ) { if ($new = $this->_get_pageid($to, false)) { @@ -1153,7 +1153,7 @@ } $this->_dbh->query("LOCK TABLES " . join(",", $locks)); } - + /** * Release a write lock on the tables in the SQL database. * @@ -1286,7 +1286,7 @@ $this->_result = $query_result; //$this->_fields = $field_list; } - + function count() { if (!is_object($this->_result)) { return false; @@ -1497,5 +1497,5 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/WikiDB/backend/PDO_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_mysql.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/PDO_mysql.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,25 +2,25 @@ // rcs_id('$Id$'); /* - Copyright 2005 $ThePhpWikiProgrammingTeam + * Copyright 2005 $ThePhpWikiProgrammingTeam + * + * 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 + */ - 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 -*/ - /** * @author: Reini Urban */ @@ -156,5 +156,5 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/WikiDB/backend/PDO_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_oci8.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/PDO_oci8.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,25 +2,25 @@ // rcs_id('$Id$'); /* - Copyright 2007 $ThePhpWikiProgrammingTeam + * Copyright 2007 $ThePhpWikiProgrammingTeam + * + * 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 + */ - 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 -*/ - /** * @author: Reini Urban */ @@ -41,7 +41,7 @@ */ function _lock_tables($write_lock=true) { $dbh = &$this->_dbh; - + // Not sure if we really need to lock tables here, the Oracle row // locking mechanism should be more than enough // For the time being, lets stay on the safe side and lock... @@ -93,5 +93,5 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/WikiDB/backend/PDO_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_pgsql.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/PDO_pgsql.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,25 +2,25 @@ // rcs_id('$Id$'); /* - Copyright 2005 $ThePhpWikiProgrammingTeam + * Copyright 2005 $ThePhpWikiProgrammingTeam + * + * 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 + */ - 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 -*/ - /** * @author: Reini Urban */ @@ -56,5 +56,5 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/WikiDB/backend/dumb/LinkSearchIter.php =================================================================== --- trunk/lib/WikiDB/backend/dumb/LinkSearchIter.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/dumb/LinkSearchIter.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -1,23 +1,23 @@ <?php // -*-php-*- // rcs_id('$Id$'); /* - Copyright 2007 Reini Urban - - 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 + * Copyright 2007 Reini Urban + * + * 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 */ /** Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/file.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,23 +2,23 @@ // rcs_id('$Id$'); /** - Copyright 1999, 2000, 2001, 2002, 2003 $ThePhpWikiProgrammingTeam - - 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 + * Copyright 1999, 2000, 2001, 2002, 2003 $ThePhpWikiProgrammingTeam + * + * 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 */ /** @@ -311,7 +311,7 @@ $this->_savePageData($pagename, $newdata); // create a new pagedata-file return; } - + foreach ($newdata as $key => $val) { if (empty($val)) unset($data[$key]); @@ -320,8 +320,8 @@ } $this->_savePageData($pagename, $data); // write new pagedata-file } - + /** * Get the current version number for a page. * @@ -332,7 +332,7 @@ function get_latest_version($pagename) { return $this->_getLatestVersion($pagename); } - + /** * Get preceding version number. * @@ -350,7 +350,7 @@ } return $prev; } - + /** * Get revision meta-data and content. * @@ -426,7 +426,7 @@ // remove page from latest_version... $this->_setLatestVersion($pagename, 0); } - + /** * Delete an old revision of a page. * @@ -453,7 +453,7 @@ } } $this->_removePage('ver_data', $pagename, $version); - } + } /** * Create a new page revision. @@ -497,7 +497,7 @@ } $this->set_versiondata($pagename, $version, $data); } - + /** * Set links for page. * @@ -508,7 +508,7 @@ function set_links($pagename, $links) { $this->_savePageLinks($pagename, $links); } - + /** * Find pages which link to or are linked from a page. * @@ -552,7 +552,7 @@ return new WikiDB_backend_dumb_AllRevisionsIter($this, $pagename); } */ - + /** * Get all pages in the database. * @@ -678,7 +678,7 @@ $search = strtolower(trim($search)); if (!$search) return array(array(),array()); - + $words = preg_split('/\s+/', $search); $exclude = array(); foreach ($words as $key => $word) { @@ -690,7 +690,7 @@ } return array($words, $exclude); } - + }; class WikiDB_backend_file_iter extends WikiDB_backend_iterator @@ -703,7 +703,7 @@ if (count($this->_result) > 0) reset($this->_result); } - + function next() { if (!$this->_result) return false; @@ -714,7 +714,7 @@ if ($e == false) { return false; } - + $pn = $e[1]; if (is_array($pn) and isset($pn['linkto'])) { // support relation link iterator $pn = $pn['linkto']; Modified: trunk/lib/WikiDB/backend/flatfile.php =================================================================== --- trunk/lib/WikiDB/backend/flatfile.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/backend/flatfile.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,23 +2,23 @@ // rcs_id('$Id$'); /** - Copyright 1999,2005,2006 $ThePhpWikiProgrammingTeam - - 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 + * Copyright 1999,2005,2006 $ThePhpWikiProgrammingTeam + * + * 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 */ /** @@ -51,7 +51,7 @@ return $this->_dir_names[$type].'/'.FilenameForPage($pagename); else return $this->_dir_names[$type].'/'.FilenameForPage($pagename).'--'.$version; -*/ +*/ } // Load/Save Page-Data @@ -62,7 +62,7 @@ } } //$pd = $this->_loadPage('page_data', $pagename, 0); - + $filename = $this->_pagename2filename('page_data', $pagename, 0); if (!file_exists($filename)) return NULL; if (!filesize($filename)) return array(); @@ -85,7 +85,7 @@ } fclose($fd); } - + if ($pd != NULL) $this->_page_data = $pd; if ($this->_page_data != NULL) { @@ -95,7 +95,7 @@ } return array(); // no values found } - + /** Store latest version as full page_data flatfile, * earlier versions as file backend ver_data. * _cached_html will not be stored. @@ -114,7 +114,7 @@ $this->_savePage('ver_data', $pagename, $version, $data); } } - + // This is different to file and not yet finished. // TODO: fields not being saved as page_data should be saved to ver_data // Store as full page_data flatfile @@ -176,7 +176,7 @@ $pagedata .= sprintf("Mime-Version: 1.0 (Produced by PhpWiki %s)\r\n", PHPWIKI_VERSION); $pagedata .= MimeifyPageRevision($page, $current); - + if ($fd = fopen($filename, 'a+b')) { $locked = flock($fd, 2); // Exclusive blocking lock if (!$locked) { Modified: trunk/lib/WikiDB/file.php =================================================================== --- trunk/lib/WikiDB/file.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/file.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -3,23 +3,23 @@ // rcs_id( '$Id$' ); /** - Copyright 1999, 2000, 2001, 2002, 2003 $ThePhpWikiProgrammingTeam - - 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 + * Copyright 1999, 2000, 2001, 2002, 2003 $ThePhpWikiProgrammingTeam + * + * 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 */ @@ -55,6 +55,6 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: +// End: ?> Modified: trunk/lib/WikiDB/flatfile.php =================================================================== --- trunk/lib/WikiDB/flatfile.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/WikiDB/flatfile.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -1,28 +1,26 @@ <?php - // rcs_id( '$Id$' ); /** - Copyright 1999, 2005 $ThePhpWikiProgrammingTeam - - 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 + * Copyright 1999, 2005 $ThePhpWikiProgrammingTeam + * + * 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 */ - require_once( 'lib/WikiDB.php' ); require_once( 'lib/WikiDB/backend/flatfile.php' ); @@ -55,6 +53,5 @@ // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil -// End: - +// End: ?> Modified: trunk/lib/XmlParser.php =================================================================== --- trunk/lib/XmlParser.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/XmlParser.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -21,21 +21,21 @@ */ /* - 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 + * 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 */ /** @@ -79,7 +79,7 @@ if (!empty($this->_parser)) xml_parser_free($this->_parser); unset($this->_parser); - + if (isset($xml_parser_root)) { $xml_parser_root->_destruct(); unset($xml_parser_root); // nested parsing forbidden! Modified: trunk/lib/install.php =================================================================== --- trunk/lib/install.php 2010-08-11 12:33:25 UTC (rev 7640) +++ trunk/lib/install.php 2010-08-11 13:00:46 UTC (rev 7641) @@ -2,23 +2,23 @@ // rcs_id('$Id$'); /* - Copyright 2004 $ThePhpWikiProgrammingTeam - - 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 late... [truncated message content] |
From: <var...@us...> - 2010-08-11 12:33:32
|
Revision: 7640 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7640&view=rev Author: vargenau Date: 2010-08-11 12:33:25 +0000 (Wed, 11 Aug 2010) Log Message: ----------- Add file header Modified Paths: -------------- trunk/lib/WikiUser/AdoDb.php trunk/lib/WikiUser/BogoLogin.php trunk/lib/WikiUser/Db.php trunk/lib/WikiUser/EMailConfirm.php trunk/lib/WikiUser/Facebook.php trunk/lib/WikiUser/File.php trunk/lib/WikiUser/Forbidden.php trunk/lib/WikiUser/GForge.php trunk/lib/WikiUser/HttpAuth.php trunk/lib/WikiUser/HttpAuthUpper.php trunk/lib/WikiUser/IMAP.php trunk/lib/WikiUser/LDAP.php trunk/lib/WikiUser/LdapUpper.php trunk/lib/WikiUser/OpenID.php trunk/lib/WikiUser/POP3.php trunk/lib/WikiUser/PdoDb.php trunk/lib/WikiUser/PearDb.php trunk/lib/WikiUser/PersonalPage.php trunk/lib/WikiUser/Session.php Modified: trunk/lib/WikiUser/AdoDb.php =================================================================== --- trunk/lib/WikiUser/AdoDb.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/AdoDb.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ include_once("lib/WikiUser/Db.php"); Modified: trunk/lib/WikiUser/BogoLogin.php =================================================================== --- trunk/lib/WikiUser/BogoLogin.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/BogoLogin.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ /** Without stored password. A _BogoLoginPassUser with password Modified: trunk/lib/WikiUser/Db.php =================================================================== --- trunk/lib/WikiUser/Db.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/Db.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ /** Modified: trunk/lib/WikiUser/EMailConfirm.php =================================================================== --- trunk/lib/WikiUser/EMailConfirm.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/EMailConfirm.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2006 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2006 ReiniUrban + * + * 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 */ class _EMailConfirmPassUser Modified: trunk/lib/WikiUser/Facebook.php =================================================================== --- trunk/lib/WikiUser/Facebook.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/Facebook.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,8 +1,24 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2009 Reini Urban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2009 Reini Urban * + * 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 + * * From http://developeronline.blogspot.com/2008/10/using-perl-against-facebook-part-i.html: * GET 'http://www.facebook.com/login.php', and rest our virtual browser there to collect the cookies * POST to 'https://login.facebook.com/login.php' with the proper parameters @@ -79,4 +95,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/WikiUser/File.php =================================================================== --- trunk/lib/WikiUser/File.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/File.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ class _FilePassUser Modified: trunk/lib/WikiUser/Forbidden.php =================================================================== --- trunk/lib/WikiUser/Forbidden.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/Forbidden.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ /** Modified: trunk/lib/WikiUser/GForge.php =================================================================== --- trunk/lib/WikiUser/GForge.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/GForge.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2006 Alain Peyrat - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2006 Alain Peyrat + * + * 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 */ /** Call the gforge functions to get the username Modified: trunk/lib/WikiUser/HttpAuth.php =================================================================== --- trunk/lib/WikiUser/HttpAuth.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/HttpAuth.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ /** Modified: trunk/lib/WikiUser/HttpAuthUpper.php =================================================================== --- trunk/lib/WikiUser/HttpAuthUpper.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/HttpAuthUpper.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004,2007 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004,2007 ReiniUrban + * + * 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 */ /** Modified: trunk/lib/WikiUser/IMAP.php =================================================================== --- trunk/lib/WikiUser/IMAP.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/IMAP.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 $ThePhpWikiProgrammingTeam - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 $ThePhpWikiProgrammingTeam + * + * 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 */ class _IMAPPassUser Modified: trunk/lib/WikiUser/LDAP.php =================================================================== --- trunk/lib/WikiUser/LDAP.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/LDAP.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004,2007 $ThePhpWikiProgrammingTeam - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004,2007 $ThePhpWikiProgrammingTeam + * + * 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 */ class _LDAPPassUser Modified: trunk/lib/WikiUser/LdapUpper.php =================================================================== --- trunk/lib/WikiUser/LdapUpper.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/LdapUpper.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2007,2009 Reini Urban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2007,2009 Reini Urban + * + * 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 */ include_once("lib/WikiUser/LDAP.php"); Modified: trunk/lib/WikiUser/OpenID.php =================================================================== --- trunk/lib/WikiUser/OpenID.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/OpenID.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,10 +1,26 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2010 ReiniUrban - * Zend_OpenId_Consumer parts from Zend licensed under +/* + * Copyright (C) 2010 ReiniUrban + * Zend_OpenId_Consumer parts from Zend licensed under * http://framework.zend.com/license/new-bsd - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) * + * 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 + * * This is not yet finished. We do not want to use zend extensions. * * See http://openid.net/specs/openid-authentication-1_1.html @@ -30,7 +46,7 @@ * @param string &$identity this argument is set to end-user's claimed * identifier or OpenID provider local identifier. * @param mixed $extensions extension object or array of extensions objects - * @return bool + * @return bool */ function verify($params, &$identity = "", $extensions = null) { $version = 1.1; @@ -82,7 +98,7 @@ return false; } } - + /** * Performs check of OpenID identity. * @@ -135,7 +151,7 @@ //$params['openid.ns'] = Zend_OpenId::NS_2_0; } - $params['openid.mode'] = $immediate ? + $params['openid.mode'] = $immediate ? 'checkid_immediate' : 'checkid_setup'; $params['openid.identity'] = $id; @@ -214,7 +230,7 @@ } if (!loadPhpExtension('openssl')) { trigger_error - (sprintf(_("The PECL %s extension cannot be loaded."), "openssl") + (sprintf(_("The PECL %s extension cannot be loaded."), "openssl") . sprintf(_(" %s AUTH ignored."), 'OpenID'), E_USER_WARNING); return $this->_tryNextUser(); @@ -238,4 +254,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/WikiUser/POP3.php =================================================================== --- trunk/lib/WikiUser/POP3.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/POP3.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 $ThePhpWikiProgrammingTeam - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 $ThePhpWikiProgrammingTeam + * + * 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 */ require_once("lib/WikiUser/IMAP.php"); Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/PdoDb.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004, 2005 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004, 2005 ReiniUrban + * + * 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 */ include_once("lib/WikiUser/Db.php"); Modified: trunk/lib/WikiUser/PearDb.php =================================================================== --- trunk/lib/WikiUser/PearDb.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/PearDb.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ include_once("lib/WikiUser/Db.php"); Modified: trunk/lib/WikiUser/PersonalPage.php =================================================================== --- trunk/lib/WikiUser/PersonalPage.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/PersonalPage.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ /** Modified: trunk/lib/WikiUser/Session.php =================================================================== --- trunk/lib/WikiUser/Session.php 2010-08-11 12:15:16 UTC (rev 7639) +++ trunk/lib/WikiUser/Session.php 2010-08-11 12:33:25 UTC (rev 7640) @@ -1,7 +1,23 @@ <?php //-*-php-*- // rcs_id('$Id$'); -/* Copyright (C) 2004 ReiniUrban - * This file is part of PhpWiki. Terms and Conditions see LICENSE. (GPL2) +/* + * Copyright (C) 2004 ReiniUrban + * + * 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 */ /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-11 12:15:25
|
Revision: 7639 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7639&view=rev Author: vargenau Date: 2010-08-11 12:15:16 +0000 (Wed, 11 Aug 2010) Log Message: ----------- Harmonize file footer Modified Paths: -------------- trunk/lib/AccessLog.php trunk/lib/WikiDB/adodb/adodb.inc.php trunk/lib/WikiPluginCached.php trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/ldap.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php trunk/lib/pear/PEAR.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/FacebookLike.php trunk/lib/plugin/RecentChangesCached.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/Video.php trunk/lib/plugin/text2png.php Modified: trunk/lib/AccessLog.php =================================================================== --- trunk/lib/AccessLog.php 2010-08-11 11:58:40 UTC (rev 7638) +++ trunk/lib/AccessLog.php 2010-08-11 12:15:16 UTC (rev 7639) @@ -730,10 +730,10 @@ } // Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil // End: ?> Modified: trunk/lib/WikiDB/adodb/adodb.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb.inc.php 2010-08-11 11:58:40 UTC (rev 7638) +++ trunk/lib/WikiDB/adodb/adodb.inc.php 2010-08-11 12:15:16 UTC (rev 7639) @@ -12,1958 +12,1958 @@ */ /** - \mainpage + \mainpage - @version V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim\@natsoft.com.my). All rights reserved. + @version V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim\@natsoft.com.my). All rights reserved. - Released under both BSD license and Lesser GPL library license. You can choose which license - you prefer. + Released under both BSD license and Lesser GPL library license. You can choose which license + you prefer. - PHP's database access functions are not standardised. This creates a need for a database - class library to hide the differences between the different database API's (encapsulate - the differences) so we can easily switch databases. + PHP's database access functions are not standardised. This creates a need for a database + class library to hide the differences between the different database API's (encapsulate + the differences) so we can easily switch databases. - We currently support MySQL, Oracle, Microsoft SQL Server, Sybase, Sybase SQL Anywhere, DB2, - Informix, PostgreSQL, FrontBase, Interbase (Firebird and Borland variants), Foxpro, Access, - ADO, SAP DB, SQLite and ODBC. We have had successful reports of connecting to Progress and - other databases via ODBC. + We currently support MySQL, Oracle, Microsoft SQL Server, Sybase, Sybase SQL Anywhere, DB2, + Informix, PostgreSQL, FrontBase, Interbase (Firebird and Borland variants), Foxpro, Access, + ADO, SAP DB, SQLite and ODBC. We have had successful reports of connecting to Progress and + other databases via ODBC. - Latest Download at http://php.weblogs.com/adodb<br> - Manual is at http://php.weblogs.com/adodb_manual + Latest Download at http://php.weblogs.com/adodb<br> + Manual is at http://php.weblogs.com/adodb_manual */ if (!defined('_ADODB_LAYER')) { - define('_ADODB_LAYER',1); + define('_ADODB_LAYER',1); - //========================================================================== - // CONSTANT DEFINITIONS - //========================================================================== + //========================================================================== + // CONSTANT DEFINITIONS + //========================================================================== - /** - * Set ADODB_DIR to the directory where this file resides... - * This constant was formerly called $ADODB_RootPath - */ - if (!defined('ADODB_DIR')) define('ADODB_DIR',dirname(__FILE__)); + /** + * Set ADODB_DIR to the directory where this file resides... + * This constant was formerly called $ADODB_RootPath + */ + if (!defined('ADODB_DIR')) define('ADODB_DIR',dirname(__FILE__)); - //========================================================================== - // GLOBAL VARIABLES - //========================================================================== + //========================================================================== + // GLOBAL VARIABLES + //========================================================================== - GLOBAL - $ADODB_vers, // database version - $ADODB_COUNTRECS, // count number of records returned - slows down query - $ADODB_CACHE_DIR, // directory to cache recordsets - $ADODB_EXTENSION, // ADODB extension installed - $ADODB_COMPAT_PATCH, // If $ADODB_COUNTRECS and this is true, $rs->fields is available on EOF - $ADODB_FETCH_MODE; // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default... + GLOBAL + $ADODB_vers, // database version + $ADODB_COUNTRECS, // count number of records returned - slows down query + $ADODB_CACHE_DIR, // directory to cache recordsets + $ADODB_EXTENSION, // ADODB extension installed + $ADODB_COMPAT_PATCH, // If $ADODB_COUNTRECS and this is true, $rs->fields is available on EOF + $ADODB_FETCH_MODE; // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default... - //========================================================================== - // GLOBAL SETUP - //========================================================================== + //========================================================================== + // GLOBAL SETUP + //========================================================================== - $ADODB_EXTENSION = defined('ADODB_EXTENSION'); - if (!$ADODB_EXTENSION || ADODB_EXTENSION < 4.0) { + $ADODB_EXTENSION = defined('ADODB_EXTENSION'); + if (!$ADODB_EXTENSION || ADODB_EXTENSION < 4.0) { - define('ADODB_BAD_RS','<p>Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true;</p>'); + define('ADODB_BAD_RS','<p>Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true;</p>'); - // allow [ ] @ ` " and . in table names - define('ADODB_TABLE_REGEX','([]0-9a-z_\"\`\.\@\[-]*)'); + // allow [ ] @ ` " and . in table names + define('ADODB_TABLE_REGEX','([]0-9a-z_\"\`\.\@\[-]*)'); - // prefetching used by oracle - if (!defined('ADODB_PREFETCH_ROWS')) define('ADODB_PREFETCH_ROWS',10); + // prefetching used by oracle + if (!defined('ADODB_PREFETCH_ROWS')) define('ADODB_PREFETCH_ROWS',10); - /* - Controls ADODB_FETCH_ASSOC field-name case. Default is 2, use native case-names. - This currently works only with mssql, odbc, oci8po and ibase derived drivers. + /* + Controls ADODB_FETCH_ASSOC field-name case. Default is 2, use native case-names. + This currently works only with mssql, odbc, oci8po and ibase derived drivers. - 0 = assoc lowercase field names. $rs->fields['orderid'] - 1 = assoc uppercase field names. $rs->fields['ORDERID'] - 2 = use native-case field names. $rs->fields['OrderID'] - */ + 0 = assoc lowercase field names. $rs->fields['orderid'] + 1 = assoc uppercase field names. $rs->fields['ORDERID'] + 2 = use native-case field names. $rs->fields['OrderID'] + */ - define('ADODB_FETCH_DEFAULT',0); - define('ADODB_FETCH_NUM',1); - define('ADODB_FETCH_ASSOC',2); - define('ADODB_FETCH_BOTH',3); + define('ADODB_FETCH_DEFAULT',0); + define('ADODB_FETCH_NUM',1); + define('ADODB_FETCH_ASSOC',2); + define('ADODB_FETCH_BOTH',3); - if (!defined('TIMESTAMP_FIRST_YEAR')) define('TIMESTAMP_FIRST_YEAR',100); + if (!defined('TIMESTAMP_FIRST_YEAR')) define('TIMESTAMP_FIRST_YEAR',100); - if (strnatcmp(PHP_VERSION,'4.3.0')>=0) { - define('ADODB_PHPVER',0x4300); - } else if (strnatcmp(PHP_VERSION,'4.2.0')>=0) { - define('ADODB_PHPVER',0x4200); - } else if (strnatcmp(PHP_VERSION,'4.0.5')>=0) { - define('ADODB_PHPVER',0x4050); - } else { - define('ADODB_PHPVER',0x4000); - } - } + if (strnatcmp(PHP_VERSION,'4.3.0')>=0) { + define('ADODB_PHPVER',0x4300); + } else if (strnatcmp(PHP_VERSION,'4.2.0')>=0) { + define('ADODB_PHPVER',0x4200); + } else if (strnatcmp(PHP_VERSION,'4.0.5')>=0) { + define('ADODB_PHPVER',0x4050); + } else { + define('ADODB_PHPVER',0x4000); + } + } - //if (!defined('ADODB_ASSOC_CASE')) define('ADODB_ASSOC_CASE',2); + //if (!defined('ADODB_ASSOC_CASE')) define('ADODB_ASSOC_CASE',2); - /** - Accepts $src and $dest arrays, replacing string $data - */ - function ADODB_str_replace($src, $dest, $data) - { - if (ADODB_PHPVER >= 0x4050) return str_replace($src,$dest,$data); + /** + Accepts $src and $dest arrays, replacing string $data + */ + function ADODB_str_replace($src, $dest, $data) + { + if (ADODB_PHPVER >= 0x4050) return str_replace($src,$dest,$data); - $s = reset($src); - $d = reset($dest); - while ($s !== false) { - $data = str_replace($s,$d,$data); - $s = next($src); - $d = next($dest); - } - return $data; - } + $s = reset($src); + $d = reset($dest); + while ($s !== false) { + $data = str_replace($s,$d,$data); + $s = next($src); + $d = next($dest); + } + return $data; + } - function ADODB_Setup() - { - GLOBAL - $ADODB_vers, // database version - $ADODB_COUNTRECS, // count number of records returned - slows down query - $ADODB_CACHE_DIR, // directory to cache recordsets - $ADODB_FETCH_MODE; + function ADODB_Setup() + { + GLOBAL + $ADODB_vers, // database version + $ADODB_COUNTRECS, // count number of records returned - slows down query + $ADODB_CACHE_DIR, // directory to cache recordsets + $ADODB_FETCH_MODE; - $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT; + $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT; - if (!isset($ADODB_CACHE_DIR)) { - $ADODB_CACHE_DIR = '/tmp'; //(isset($_ENV['TMP'])) ? $_ENV['TMP'] : '/tmp'; - } else { - // do not accept url based paths, eg. http:/ or ftp:/ - if (strpos($ADODB_CACHE_DIR,'://') !== false) - die("Illegal path http:// or ftp://"); - } + if (!isset($ADODB_CACHE_DIR)) { + $ADODB_CACHE_DIR = '/tmp'; //(isset($_ENV['TMP'])) ? $_ENV['TMP'] : '/tmp'; + } else { + // do not accept url based paths, eg. http:/ or ftp:/ + if (strpos($ADODB_CACHE_DIR,'://') !== false) + die("Illegal path http:// or ftp://"); + } - - // Initialize random number generator for randomizing cache flushes - srand(((double)microtime())*1000000); + + // Initialize random number generator for randomizing cache flushes + srand(((double)microtime())*1000000); - /** - * ADODB version as a string. - */ - $ADODB_vers = 'V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.'; + /** + * ADODB version as a string. + */ + $ADODB_vers = 'V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.'; - /** - * Determines whether recordset->RecordCount() is used. - * Set to false for highest performance -- RecordCount() will always return -1 then - * for databases that provide "virtual" recordcounts... - */ - if (!isset($ADODB_COUNTRECS)) $ADODB_COUNTRECS = true; - } + /** + * Determines whether recordset->RecordCount() is used. + * Set to false for highest performance -- RecordCount() will always return -1 then + * for databases that provide "virtual" recordcounts... + */ + if (!isset($ADODB_COUNTRECS)) $ADODB_COUNTRECS = true; + } - //========================================================================== - // CHANGE NOTHING BELOW UNLESS YOU ARE DESIGNING ADODB - //========================================================================== + //========================================================================== + // CHANGE NOTHING BELOW UNLESS YOU ARE DESIGNING ADODB + //========================================================================== - ADODB_Setup(); + ADODB_Setup(); - //========================================================================== - // CLASS ADOFieldObject - //========================================================================== - /** - * Helper class for FetchFields -- holds info on a column - */ - class ADOFieldObject { - var $name = ''; - var $max_length=0; - var $type=""; + //========================================================================== + // CLASS ADOFieldObject + //========================================================================== + /** + * Helper class for FetchFields -- holds info on a column + */ + class ADOFieldObject { + var $name = ''; + var $max_length=0; + var $type=""; - // additional fields by dannym... (dan...@ya...) - var $not_null = false; - // actually, this has already been built-in in the postgres, fbsql AND mysql module? ^-^ - // so we can as well make not_null standard (leaving it at "false" does not harm anyways) + // additional fields by dannym... (dan...@ya...) + var $not_null = false; + // actually, this has already been built-in in the postgres, fbsql AND mysql module? ^-^ + // so we can as well make not_null standard (leaving it at "false" does not harm anyways) - var $has_default = false; // this one I have done only in mysql and postgres for now ... - // others to come (dannym) - var $default_value; // default, if any, and supported. Check has_default first. - } + var $has_default = false; // this one I have done only in mysql and postgres for now ... + // others to come (dannym) + var $default_value; // default, if any, and supported. Check has_default first. + } - function ADODB_TransMonitor($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) - { - //print "Errorno ($fn errno=$errno m=$errmsg) "; - $thisConnection->_transOK = false; - if ($thisConnection->_oldRaiseFn) { - $fn = $thisConnection->_oldRaiseFn; - $fn($dbms, $fn, $errno, $errmsg, $p1, $p2,$thisConnection); - } - } + function ADODB_TransMonitor($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) + { + //print "Errorno ($fn errno=$errno m=$errmsg) "; + $thisConnection->_transOK = false; + if ($thisConnection->_oldRaiseFn) { + $fn = $thisConnection->_oldRaiseFn; + $fn($dbms, $fn, $errno, $errmsg, $p1, $p2,$thisConnection); + } + } - //========================================================================== - // CLASS ADOConnection - //========================================================================== + //========================================================================== + // CLASS ADOConnection + //========================================================================== - /** - * Connection object. For connecting to databases, and executing queries. - */ - class ADOConnection { - // - // PUBLIC VARS - // - var $dataProvider = 'native'; - var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql - var $database = ''; /// Name of database to be used. - var $host = ''; /// The hostname of the database server - var $user = ''; /// The username which is used to connect to the database server. - var $password = ''; /// Password for the username. For security, we no longer store it. - var $debug = false; /// if set to true will output sql statements - var $maxblobsize = 256000; /// maximum size of blobs or large text fields -- some databases die otherwise like foxpro - var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase - var $substr = 'substr'; /// substring operator - var $length = 'length'; /// string length operator - var $random = 'rand()'; /// random function - var $upperCase = false; /// uppercase function - var $fmtDate = "'Y-m-d'"; /// used by DBDate() as the default date format used by the database - var $fmtTimeStamp = "'Y-m-d, h:i:s A'"; /// used by DBTimeStamp as the default timestamp fmt. - var $true = '1'; /// string that represents TRUE for a database - var $false = '0'; /// string that represents FALSE for a database - var $replaceQuote = "\\'"; /// string to use to replace quotes - var $nameQuote = '"'; /// string to use to quote identifiers and names - var $charSet=false; /// character set to use - only for interbase - var $metaDatabasesSQL = ''; - var $metaTablesSQL = ''; - var $uniqueOrderBy = false; /// All order by columns have to be unique - var $emptyDate = ' '; - var $emptyTimeStamp = ' '; - var $lastInsID = false; - //-- - var $hasInsertID = false; /// supports autoincrement ID? - var $hasAffectedRows = false; /// supports affected rows for update/delete? - var $hasTop = false; /// support mssql/access SELECT TOP 10 * FROM TABLE - var $hasLimit = false; /// support pgsql/mysql SELECT * FROM TABLE LIMIT 10 - var $readOnly = false; /// this is a readonly database - used by phpLens - var $hasMoveFirst = false; /// has ability to run MoveFirst(), scrolling backwards - var $hasGenID = false; /// can generate sequences using GenID(); - var $hasTransactions = true; /// has transactions - //-- - var $genID = 0; /// sequence id used by GenID(); - var $raiseErrorFn = false; /// error function to call - var $isoDates = false; /// accepts dates in ISO format - var $cacheSecs = 3600; /// cache for 1 hour - var $sysDate = false; /// name of function that returns the current date - var $sysTimeStamp = false; /// name of function that returns the current timestamp - var $arrayClass = 'ADORecordSet_array'; /// name of class used to generate array recordsets, which are pre-downloaded recordsets + /** + * Connection object. For connecting to databases, and executing queries. + */ + class ADOConnection { + // + // PUBLIC VARS + // + var $dataProvider = 'native'; + var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql + var $database = ''; /// Name of database to be used. + var $host = ''; /// The hostname of the database server + var $user = ''; /// The username which is used to connect to the database server. + var $password = ''; /// Password for the username. For security, we no longer store it. + var $debug = false; /// if set to true will output sql statements + var $maxblobsize = 256000; /// maximum size of blobs or large text fields -- some databases die otherwise like foxpro + var $concat_operator = '+'; /// default concat operator -- change to || for Oracle/Interbase + var $substr = 'substr'; /// substring operator + var $length = 'length'; /// string length operator + var $random = 'rand()'; /// random function + var $upperCase = false; /// uppercase function + var $fmtDate = "'Y-m-d'"; /// used by DBDate() as the default date format used by the database + var $fmtTimeStamp = "'Y-m-d, h:i:s A'"; /// used by DBTimeStamp as the default timestamp fmt. + var $true = '1'; /// string that represents TRUE for a database + var $false = '0'; /// string that represents FALSE for a database + var $replaceQuote = "\\'"; /// string to use to replace quotes + var $nameQuote = '"'; /// string to use to quote identifiers and names + var $charSet=false; /// character set to use - only for interbase + var $metaDatabasesSQL = ''; + var $metaTablesSQL = ''; + var $uniqueOrderBy = false; /// All order by columns have to be unique + var $emptyDate = ' '; + var $emptyTimeStamp = ' '; + var $lastInsID = false; + //-- + var $hasInsertID = false; /// supports autoincrement ID? + var $hasAffectedRows = false; /// supports affected rows for update/delete? + var $hasTop = false; /// support mssql/access SELECT TOP 10 * FROM TABLE + var $hasLimit = false; /// support pgsql/mysql SELECT * FROM TABLE LIMIT 10 + var $readOnly = false; /// this is a readonly database - used by phpLens + var $hasMoveFirst = false; /// has ability to run MoveFirst(), scrolling backwards + var $hasGenID = false; /// can generate sequences using GenID(); + var $hasTransactions = true; /// has transactions + //-- + var $genID = 0; /// sequence id used by GenID(); + var $raiseErrorFn = false; /// error function to call + var $isoDates = false; /// accepts dates in ISO format + var $cacheSecs = 3600; /// cache for 1 hour + var $sysDate = false; /// name of function that returns the current date + var $sysTimeStamp = false; /// name of function that returns the current timestamp + var $arrayClass = 'ADORecordSet_array'; /// name of class used to generate array recordsets, which are pre-downloaded recordsets - var $noNullStrings = false; /// oracle specific stuff - if true ensures that '' is converted to ' ' - var $numCacheHits = 0; - var $numCacheMisses = 0; - var $pageExecuteCountRows = true; - var $uniqueSort = false; /// indicates that all fields in order by must be unique - var $leftOuter = false; /// operator to use for left outer join in WHERE clause - var $rightOuter = false; /// operator to use for right outer join in WHERE clause - var $ansiOuter = false; /// whether ansi outer join syntax supported - var $autoRollback = false; // autoRollback on PConnect(). - var $poorAffectedRows = false; // affectedRows not working or unreliable + var $noNullStrings = false; /// oracle specific stuff - if true ensures that '' is converted to ' ' + var $numCacheHits = 0; + var $numCacheMisses = 0; + var $pageExecuteCountRows = true; + var $uniqueSort = false; /// indicates that all fields in order by must be unique + var $leftOuter = false; /// operator to use for left outer join in WHERE clause + var $rightOuter = false; /// operator to use for right outer join in WHERE clause + var $ansiOuter = false; /// whether ansi outer join syntax supported + var $autoRollback = false; // autoRollback on PConnect(). + var $poorAffectedRows = false; // affectedRows not working or unreliable - var $fnExecute = false; - var $fnCacheExecute = false; - var $blobEncodeType = false; // false=not required, 'I'=encode to integer, 'C'=encode to char - var $rsPrefix = "ADORecordSet_"; + var $fnExecute = false; + var $fnCacheExecute = false; + var $blobEncodeType = false; // false=not required, 'I'=encode to integer, 'C'=encode to char + var $rsPrefix = "ADORecordSet_"; - var $autoCommit = true; /// do not modify this yourself - actually private - var $transOff = 0; /// temporarily disable transactions - var $transCnt = 0; /// count of nested transactions + var $autoCommit = true; /// do not modify this yourself - actually private + var $transOff = 0; /// temporarily disable transactions + var $transCnt = 0; /// count of nested transactions - var $fetchMode=false; - // - // PRIVATE VARS - // - var $_oldRaiseFn = false; - var $_transOK = null; - var $_connectionID = false; /// The returned link identifier whenever a successful database connection is made. - var $_errorMsg = false; /// A variable which was used to keep the returned last error message. The value will - /// then returned by the errorMsg() function - var $_errorCode = false; /// Last error code, not guaranteed to be used - only by oci8 - var $_queryID = false; /// This variable keeps the last created result link identifier + var $fetchMode=false; + // + // PRIVATE VARS + // + var $_oldRaiseFn = false; + var $_transOK = null; + var $_connectionID = false; /// The returned link identifier whenever a successful database connection is made. + var $_errorMsg = false; /// A variable which was used to keep the returned last error message. The value will + /// then returned by the errorMsg() function + var $_errorCode = false; /// Last error code, not guaranteed to be used - only by oci8 + var $_queryID = false; /// This variable keeps the last created result link identifier - var $_isPersistentConnection = false; /// A boolean variable to state whether its a persistent connection or normal connection. */ - var $_bindInputArray = false; /// set to true if ADOConnection.Execute() permits binding of array parameters. - var $_evalAll = false; - var $_affected = false; - var $_logsql = false; + var $_isPersistentConnection = false; /// A boolean variable to state whether its a persistent connection or normal connection. */ + var $_bindInputArray = false; /// set to true if ADOConnection.Execute() permits binding of array parameters. + var $_evalAll = false; + var $_affected = false; + var $_logsql = false; - /** - * Constructor - */ - function ADOConnection() - { - die('Virtual Class -- cannot instantiate'); - } + /** + * Constructor + */ + function ADOConnection() + { + die('Virtual Class -- cannot instantiate'); + } - /** - Get server version info... + /** + Get server version info... - @returns An array with 2 elements: $arr['string'] is the description string, - and $arr[version] is the version (also a string). - */ - function ServerInfo() - { - return array('description' => '', 'version' => ''); - } + @returns An array with 2 elements: $arr['string'] is the description string, + and $arr[version] is the version (also a string). + */ + function ServerInfo() + { + return array('description' => '', 'version' => ''); + } - function _findvers($str) - { - if (preg_match('/([0-9]+\.([0-9\.])+)/',$str, $arr)) return $arr[1]; - else return ''; - } + function _findvers($str) + { + if (preg_match('/([0-9]+\.([0-9\.])+)/',$str, $arr)) return $arr[1]; + else return ''; + } - /** - * All error messages go through this bottleneck function. - * You can define your own handler by defining the function name in ADODB_OUTP. - */ - function outp($msg,$newline=true) - { - global $HTTP_SERVER_VARS,$ADODB_FLUSH,$ADODB_OUTP; + /** + * All error messages go through this bottleneck function. + * You can define your own handler by defining the function name in ADODB_OUTP. + */ + function outp($msg,$newline=true) + { + global $HTTP_SERVER_VARS,$ADODB_FLUSH,$ADODB_OUTP; - if (defined('ADODB_OUTP')) { - $fn = ADODB_OUTP; - $fn($msg,$newline); - return; - } else if (isset($ADODB_OUTP)) { - $fn = $ADODB_OUTP; - $fn($msg,$newline); - return; - } + if (defined('ADODB_OUTP')) { + $fn = ADODB_OUTP; + $fn($msg,$newline); + return; + } else if (isset($ADODB_OUTP)) { + $fn = $ADODB_OUTP; + $fn($msg,$newline); + return; + } - if ($newline) $msg .= "<br>\n"; + if ($newline) $msg .= "<br>\n"; - if (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) echo $msg; - else echo strip_tags($msg); - if (!empty($ADODB_FLUSH) && ob_get_length() !== false) flush(); // dp not flush if output buffering enabled - useless - thx to Jesse Mullan + if (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) echo $msg; + else echo strip_tags($msg); + if (!empty($ADODB_FLUSH) && ob_get_length() !== false) flush(); // dp not flush if output buffering enabled - useless - thx to Jesse Mullan - } + } - function Time() - { - $rs =& $this->Execute("select $this->sysTimeStamp"); - if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields)); + function Time() + { + $rs =& $this->Execute("select $this->sysTimeStamp"); + if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields)); - return false; - } + return false; + } - /** - * Connect to database - * - * @param [argHostname] Host to connect to - * @param [argUsername] Userid to login - * @param [argPassword] Associated password - * @param [argDatabaseName] database - * @param [forceNew] force new connection - * - * @return true or false - */ - function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false) - { - if ($argHostname != "") $this->host = $argHostname; - if ($argUsername != "") $this->user = $argUsername; - if ($argPassword != "") $this->password = $argPassword; // not stored for security reasons - if ($argDatabaseName != "") $this->database = $argDatabaseName; + /** + * Connect to database + * + * @param [argHostname] Host to connect to + * @param [argUsername] Userid to login + * @param [argPassword] Associated password + * @param [argDatabaseName] database + * @param [forceNew] force new connection + * + * @return true or false + */ + function Connect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "", $forceNew = false) + { + if ($argHostname != "") $this->host = $argHostname; + if ($argUsername != "") $this->user = $argUsername; + if ($argPassword != "") $this->password = $argPassword; // not stored for security reasons + if ($argDatabaseName != "") $this->database = $argDatabaseName; - $this->_isPersistentConnection = false; - if ($fn = $this->raiseErrorFn) { - if ($forceNew) { - if ($this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; - } else { - if ($this->_connect($this->host, $this->user, $this->password, $this->database)) return true; - } - $err = $this->ErrorMsg(); - if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'"; - $fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); - } else { - if ($forceNew) { - if ($this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; - } else { - if ($this->_connect($this->host, $this->user, $this->password, $this->database)) return true; - } - } - if ($this->debug) ADOConnection::outp( $this->host.': '.$this->ErrorMsg()); - return false; - } + $this->_isPersistentConnection = false; + if ($fn = $this->raiseErrorFn) { + if ($forceNew) { + if ($this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; + } else { + if ($this->_connect($this->host, $this->user, $this->password, $this->database)) return true; + } + $err = $this->ErrorMsg(); + if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'"; + $fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); + } else { + if ($forceNew) { + if ($this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; + } else { + if ($this->_connect($this->host, $this->user, $this->password, $this->database)) return true; + } + } + if ($this->debug) ADOConnection::outp( $this->host.': '.$this->ErrorMsg()); + return false; + } - function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName) - { - return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName); - } + function _nconnect($argHostname, $argUsername, $argPassword, $argDatabaseName) + { + return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabaseName); + } - /** - * Always force a new connection to database - currently only works with oracle - * - * @param [argHostname] Host to connect to - * @param [argUsername] Userid to login - * @param [argPassword] Associated password - * @param [argDatabaseName] database - * - * @return true or false - */ - function NConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") - { - return $this->Connect($argHostname, $argUsername, $argPassword, $argDatabaseName, true); - } + /** + * Always force a new connection to database - currently only works with oracle + * + * @param [argHostname] Host to connect to + * @param [argUsername] Userid to login + * @param [argPassword] Associated password + * @param [argDatabaseName] database + * + * @return true or false + */ + function NConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") + { + return $this->Connect($argHostname, $argUsername, $argPassword, $argDatabaseName, true); + } - /** - * Establish persistent connect to database - * - * @param [argHostname] Host to connect to - * @param [argUsername] Userid to login - * @param [argPassword] Associated password - * @param [argDatabaseName] database - * - * @return return true or false - */ - function PConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") - { - if (defined('ADODB_NEVER_PERSIST')) - return $this->Connect($argHostname,$argUsername,$argPassword,$argDatabaseName); + /** + * Establish persistent connect to database + * + * @param [argHostname] Host to connect to + * @param [argUsername] Userid to login + * @param [argPassword] Associated password + * @param [argDatabaseName] database + * + * @return return true or false + */ + function PConnect($argHostname = "", $argUsername = "", $argPassword = "", $argDatabaseName = "") + { + if (defined('ADODB_NEVER_PERSIST')) + return $this->Connect($argHostname,$argUsername,$argPassword,$argDatabaseName); - if ($argHostname != "") $this->host = $argHostname; - if ($argUsername != "") $this->user = $argUsername; - if ($argPassword != "") $this->password = $argPassword; - if ($argDatabaseName != "") $this->database = $argDatabaseName; - - $this->_isPersistentConnection = true; + if ($argHostname != "") $this->host = $argHostname; + if ($argUsername != "") $this->user = $argUsername; + if ($argPassword != "") $this->password = $argPassword; + if ($argDatabaseName != "") $this->database = $argDatabaseName; + + $this->_isPersistentConnection = true; - if ($fn = $this->raiseErrorFn) { - if ($this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true; - $err = $this->ErrorMsg(); - if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'"; - $fn($this->databaseType,'PCONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); - } else - if ($this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true; + if ($fn = $this->raiseErrorFn) { + if ($this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true; + $err = $this->ErrorMsg(); + if (empty($err)) $err = "Connection error to server '$argHostname' with user '$argUsername'"; + $fn($this->databaseType,'PCONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); + } else + if ($this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true; - if ($this->debug) ADOConnection::outp( $this->host.': '.$this->ErrorMsg()); - return false; - } + if ($this->debug) ADOConnection::outp( $this->host.': '.$this->ErrorMsg()); + return false; + } - // Format date column in sql string given an input format that understands Y M D - function SQLDate($fmt, $col=false) - { - if (!$col) $col = $this->sysDate; - return $col; // child class implement - } + // Format date column in sql string given an input format that understands Y M D + function SQLDate($fmt, $col=false) + { + if (!$col) $col = $this->sysDate; + return $col; // child class implement + } - /** - * Should prepare the sql statement and return the stmt resource. - * For databases that do not support this, we return the $sql. To ensure - * compatibility with databases that do not support prepare: - * - * $stmt = $db->Prepare("insert into table (id, name) values (?,?)"); - * $db->Execute($stmt,array(1,'Jill')) or die('insert failed'); - * $db->Execute($stmt,array(2,'Joe')) or die('insert failed'); - * - * @param sql SQL to send to database - * - * @return return FALSE, or the prepared statement, or the original sql if - * if the database does not support prepare. - * - */ - function Prepare($sql) - { - return $sql; - } + /** + * Should prepare the sql statement and return the stmt resource. + * For databases that do not support this, we return the $sql. To ensure + * compatibility with databases that do not support prepare: + * + * $stmt = $db->Prepare("insert into table (id, name) values (?,?)"); + * $db->Execute($stmt,array(1,'Jill')) or die('insert failed'); + * $db->Execute($stmt,array(2,'Joe')) or die('insert failed'); + * + * @param sql SQL to send to database + * + * @return return FALSE, or the prepared statement, or the original sql if + * if the database does not support prepare. + * + */ + function Prepare($sql) + { + return $sql; + } - /** - * Some databases, eg. mssql require a different function for preparing - * stored procedures. So we cannot use Prepare(). - * - * Should prepare the stored procedure and return the stmt resource. - * For databases that do not support this, we return the $sql. To ensure - * compatibility with databases that do not support prepare: - * - * @param sql SQL to send to database - * - * @return return FALSE, or the prepared statement, or the original sql if - * if the database does not support prepare. - * - */ - function PrepareSP($sql,$param=true) - { - return $this->Prepare($sql,$param); - } + /** + * Some databases, eg. mssql require a different function for preparing + * stored procedures. So we cannot use Prepare(). + * + * Should prepare the stored procedure and return the stmt resource. + * For databases that do not support this, we return the $sql. To ensure + * compatibility with databases that do not support prepare: + * + * @param sql SQL to send to database + * + * @return return FALSE, or the prepared statement, or the original sql if + * if the database does not support prepare. + * + */ + function PrepareSP($sql,$param=true) + { + return $this->Prepare($sql,$param); + } - /** - * PEAR DB Compat - */ - function Quote($s) - { - return $this->qstr($s,false); - } + /** + * PEAR DB Compat + */ + function Quote($s) + { + return $this->qstr($s,false); + } - /** - Requested by "Karsten Dambekalns" <k.d...@fi...> - */ - function QMagic($s) - { - return $this->qstr($s,get_magic_quotes_gpc()); - } + /** + Requested by "Karsten Dambekalns" <k.d...@fi...> + */ + function QMagic($s) + { + return $this->qstr($s,get_magic_quotes_gpc()); + } - function q(&$s) - { - $s = $this->qstr($s,false); - } + function q(&$s) + { + $s = $this->qstr($s,false); + } - /** - * PEAR DB Compat - do not use internally. - */ - function ErrorNative() - { - return $this->ErrorNo(); - } + /** + * PEAR DB Compat - do not use internally. + */ + function ErrorNative() + { + return $this->ErrorNo(); + } /** - * PEAR DB Compat - do not use internally. - */ - function nextId($seq_name) - { - return $this->GenID($seq_name); - } + * PEAR DB Compat - do not use internally. + */ + function nextId($seq_name) + { + return $this->GenID($seq_name); + } - /** - * Lock a row, will escalate and lock the table if row locking not supported - * will normally free the lock at the end of the transaction - * - * @param $table name of table to lock - * @param $where where clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock - */ - function RowLock($table,$where) - { - return false; - } + /** + * Lock a row, will escalate and lock the table if row locking not supported + * will normally free the lock at the end of the transaction + * + * @param $table name of table to lock + * @param $where where clause to use, eg: "WHERE row=12". If left empty, will escalate to table lock + */ + function RowLock($table,$where) + { + return false; + } - function CommitLock($table) - { - return $this->CommitTrans(); - } + function CommitLock($table) + { + return $this->CommitTrans(); + } - function RollbackLock($table) - { - return $this->RollbackTrans(); - } + function RollbackLock($table) + { + return $this->RollbackTrans(); + } - /** - * PEAR DB Compat - do not use internally. - * - * The fetch modes for NUMERIC and ASSOC for PEAR DB and ADODB are identical - * for easy porting :-) - * - * @param mode The fetchmode ADODB_FETCH_ASSOC or ADODB_FETCH_NUM - * @returns The previous fetch mode - */ - function SetFetchMode($mode) - { - $old = $this->fetchMode; - $this->fetchMode = $mode; + /** + * PEAR DB Compat - do not use internally. + * + * The fetch modes for NUMERIC and ASSOC for PEAR DB and ADODB are identical + * for easy porting :-) + * + * @param mode The fetchmode ADODB_FETCH_ASSOC or ADODB_FETCH_NUM + * @returns The previous fetch mode + */ + function SetFetchMode($mode) + { + $old = $this->fetchMode; + $this->fetchMode = $mode; - if ($old === false) { - global $ADODB_FETCH_MODE; - return $ADODB_FETCH_MODE; - } - return $old; - } + if ($old === false) { + global $ADODB_FETCH_MODE; + return $ADODB_FETCH_MODE; + } + return $old; + } - /** - * PEAR DB Compat - do not use internally. - */ - function &Query($sql, $inputarr=false) - { - $rs = &$this->Execute($sql, $inputarr); - if (!$rs && defined('ADODB_PEAR')) return ADODB_PEAR_Error(); - return $rs; - } + /** + * PEAR DB Compat - do not use internally. + */ + function &Query($sql, $inputarr=false) + { + $rs = &$this->Execute($sql, $inputarr); + if (!$rs && defined('ADODB_PEAR')) return ADODB_PEAR_Error(); + return $rs; + } - /** - * PEAR DB Compat - do not use internally - */ - function &LimitQuery($sql, $offset, $count, $params=false) - { - $rs = &$this->SelectLimit($sql, $count, $offset, $params); - if (!$rs && defined('ADODB_PEAR')) return ADODB_PEAR_Error(); - return $rs; - } + /** + * PEAR DB Compat - do not use internally + */ + function &LimitQuery($sql, $offset, $count, $params=false) + { + $rs = &$this->SelectLimit($sql, $count, $offset, $params); + if (!$rs && defined('ADODB_PEAR')) return ADODB_PEAR_Error(); + return $rs; + } - /** - * PEAR DB Compat - do not use internally - */ - function Disconnect() - { - return $this->Close(); - } + /** + * PEAR DB Compat - do not use internally + */ + function Disconnect() + { + return $this->Close(); + } - /* - Returns placeholder for parameter, eg. - $DB->Param('a') + /* + Returns placeholder for parameter, eg. + $DB->Param('a') - will return ':a' for Oracle, and '?' for most other databases... + will return ':a' for Oracle, and '?' for most other databases... - For databases that require positioned params, eg $1, $2, $3 for postgresql, - pass in Param(false) before setting the first parameter. - */ - function Param($name) - { - return '?'; - } + For databases that require positioned params, eg $1, $2, $3 for postgresql, + pass in Param(false) before setting the first parameter. + */ + function Param($name) + { + return '?'; + } - /* - InParameter and OutParameter are self-documenting versions of Parameter(). - */ - function InParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false) - { - return $this->Parameter($stmt,$var,$name,false,$maxLen,$type); - } + /* + InParameter and OutParameter are self-documenting versions of Parameter(). + */ + function InParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false) + { + return $this->Parameter($stmt,$var,$name,false,$maxLen,$type); + } - /* - */ - function OutParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false) - { - return $this->Parameter($stmt,$var,$name,true,$maxLen,$type); + /* + */ + function OutParameter(&$stmt,&$var,$name,$maxLen=4000,$type=false) + { + return $this->Parameter($stmt,$var,$name,true,$maxLen,$type); - } + } - /* - Usage in oracle - $stmt = $db->Prepare('select * from table where id =:myid and group=:group'); - $db->Parameter($stmt,$id,'myid'); - $db->Parameter($stmt,$group,'group',64); - $db->Execute(); + /* + Usage in oracle + $stmt = $db->Prepare('select * from table where id =:myid and group=:group'); + $db->Parameter($stmt,$id,'myid'); + $db->Parameter($stmt,$group,'group',64); + $db->Execute(); - @param $stmt Statement returned by Prepare() or PrepareSP(). - @param $var PHP variable to bind to - @param $name Name of stored procedure variable name to bind to. - @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. - @param [$maxLen] Holds an maximum length of the variable. - @param [$type] The data type of $var. Legal values depend on driver. + @param $stmt Statement returned by Prepare() or PrepareSP(). + @param $var PHP variable to bind to + @param $name Name of stored procedure variable name to bind to. + @param [$isOutput] Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. + @param [$maxLen] Holds an maximum length of the variable. + @param [$type] The data type of $var. Legal values depend on driver. - */ - function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) - { - return false; - } + */ + function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) + { + return false; + } - /** - Improved method of initiating a transaction. Used together with CompleteTrans(). - Advantages include: + /** + Improved method of initiating a transaction. Used together with CompleteTrans(). + Advantages include: - a. StartTrans/CompleteTrans is nestable, unlike BeginTrans/CommitTrans/RollbackTrans. - Only the outermost block is treated as a transaction.<br> - b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.<br> - c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block - are disabled, making it backward compatible. - */ - function StartTrans($errfn = 'ADODB_TransMonitor') - { - if ($this->transOff > 0) { - $this->transOff += 1; - return; - } + a. StartTrans/CompleteTrans is nestable, unlike BeginTrans/CommitTrans/RollbackTrans. + Only the outermost block is treated as a transaction.<br> + b. CompleteTrans auto-detects SQL errors, and will rollback on errors, commit otherwise.<br> + c. All BeginTrans/CommitTrans/RollbackTrans inside a StartTrans/CompleteTrans block + are disabled, making it backward compatible. + */ + function StartTrans($errfn = 'ADODB_TransMonitor') + { + if ($this->transOff > 0) { + $this->transOff += 1; + return; + } - $this->_oldRaiseFn = $this->raiseErrorFn; - $this->raiseErrorFn = $errfn; - $this->_transOK = true; + $this->_oldRaiseFn = $this->raiseErrorFn; + $this->raiseErrorFn = $errfn; + $this->_transOK = true; - if ($this->debug && $this->transCnt > 0) ADOConnection::outp("Bad Transaction: StartTrans called within BeginTrans"); - $this->BeginTrans(); - $this->transOff = 1; - } + if ($this->debug && $this->transCnt > 0) ADOConnection::outp("Bad Transaction: StartTrans called within BeginTrans"); + $this->BeginTrans(); + $this->transOff = 1; + } - /** - Used together with StartTrans() to end a transaction. Monitors connection - for sql errors, and will commit or rollback as appropriate. + /** + Used together with StartTrans() to end a transaction. Monitors connection + for sql errors, and will commit or rollback as appropriate. - @autoComplete if true, monitor sql errors and commit and rollback as appropriate, - and if set to false force rollback even if no SQL error detected. - @returns true on commit, false on rollback. - */ - function CompleteTrans($autoComplete = true) - { - if ($this->transOff > 1) { - $this->transOff -= 1; - return true; - } - $this->raiseErrorFn = $this->_oldRaiseFn; + @autoComplete if true, monitor sql errors and commit and rollback as appropriate, + and if set to false force rollback even if no SQL error detected. + @returns true on commit, false on rollback. + */ + function CompleteTrans($autoComplete = true) + { + if ($this->transOff > 1) { + $this->transOff -= 1; + return true; + } + $this->raiseErrorFn = $this->_oldRaiseFn; - $this->transOff = 0; - if ($this->_transOK && $autoComplete) { - if (!$this->CommitTrans()) { - $this->_transOK = false; - if ($this->debug) ADOConnection::outp("Smart Commit failed"); - } else - if ($this->debug) ADOConnection::outp("Smart Commit occurred"); - } else { - $this->RollbackTrans(); - if ($this->debug) ADOCOnnection::outp("Smart Rollback occurred"); - } + $this->transOff = 0; + if ($this->_transOK && $autoComplete) { + if (!$this->CommitTrans()) { + $this->_transOK = false; + if ($this->debug) ADOConnection::outp("Smart Commit failed"); + } else + if ($this->debug) ADOConnection::outp("Smart Commit occurred"); + } else { + $this->RollbackTrans(); + if ($this->debug) ADOCOnnection::outp("Smart Rollback occurred"); + } - return $this->_transOK; - } + return $this->_transOK; + } - /* - At the end of a StartTrans/CompleteTrans block, perform a rollback. - */ - function FailTrans() - { - if ($this->debug) - if ($this->transOff == 0) { - ADOConnection::outp("FailTrans outside StartTrans/CompleteTrans"); - } else { - ADOConnection::outp("FailTrans was called"); - adodb_backtrace(); - } - $this->_transOK = false; - } + /* + At the end of a StartTrans/CompleteTrans block, perform a rollback. + */ + function FailTrans() + { + if ($this->debug) + if ($this->transOff == 0) { + ADOConnection::outp("FailTrans outside StartTrans/CompleteTrans"); + } else { + ADOConnection::outp("FailTrans was called"); + adodb_backtrace(); + } + $this->_transOK = false; + } - /** - Check if transaction has failed, only for Smart Transactions. - */ - function HasFailedTrans() - { - if ($this->transOff > 0) return $this->_transOK == false; - return false; - } + /** + Check if transaction has failed, only for Smart Transactions. + */ + function HasFailedTrans() + { + if ($this->transOff > 0) return $this->_transOK == false; + return false; + } - /** - * Execute SQL - * - * @param sql SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text) - * @param [inputarr] holds the input data to bind to. Null elements will be set to null. - * @return RecordSet or false - */ - function &Execute($sql,$inputarr=false) - { - if ($this->fnExecute) { - $fn = $this->fnExecute; - $ret =& $fn($this,$sql,$inputarr); - if (isset($ret)) return $ret; - } - if ($inputarr && is_array($inputarr)) { - $element0 = reset($inputarr); - # is_object check is because oci8 descriptors can be passed in - $array_2d = is_array($element0) && !is_object(reset($element0)); - - if (!is_array($sql) && !$this->_bindInputArray) { - $sqlarr = explode('?',$sql); - - if (!$array_2d) $inputarr = array($inputarr); - foreach($inputarr as $arr) { - $sql = ''; $i = 0; - foreach($arr as $v) { - $sql .= $sqlarr[$i]; - // from Ron Baldwin <ron...@so...> - // Only quote string types - if (gettype($v) == 'string') - $sql .= $this->qstr($v); - else if ($v === null) - $sql .= 'NULL'; - else - $sql .= $v; - $i += 1; - } - $sql .= $sqlarr[$i]; - - if ($i+1 != sizeof($sqlarr)) - ADOConnection::outp( "Input Array does not match ?: ".htmlspecialchars($sql)); + /** + * Execute SQL + * + * @param sql SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text) + * @param [inputarr] holds the input data to bind to. Null elements will be set to null. + * @return RecordSet or false + */ + function &Execute($sql,$inputarr=false) + { + if ($this->fnExecute) { + $fn = $this->fnExecute; + $ret =& $fn($this,$sql,$inputarr); + if (isset($ret)) return $ret; + } + if ($inputarr && is_array($inputarr)) { + $element0 = reset($inputarr); + # is_object check is because oci8 descriptors can be passed in + $array_2d = is_array($element0) && !is_object(reset($element0)); + + if (!is_array($sql) && !$this->_bindInputArray) { + $sqlarr = explode('?',$sql); + + if (!$array_2d) $inputarr = array($inputarr); + foreach($inputarr as $arr) { + $sql = ''; $i = 0; + foreach($arr as $v) { + $sql .= $sqlarr[$i]; + // from Ron Baldwin <ron...@so...> + // Only quote string types + if (gettype($v) == 'string') + $sql .= $this->qstr($v); + else if ($v === null) + $sql .= 'NULL'; + else + $sql .= $v; + $i += 1; + } + $sql .= $sqlarr[$i]; + + if ($i+1 != sizeof($sqlarr)) + ADOConnection::outp( "Input Array does not match ?: ".htmlspecialchars($sql)); - $ret =& $this->_Execute($sql,false); - if (!$ret) return $ret; - } - } else { - if ($array_2d) { - $stmt = $this->Prepare($sql); - foreach($inputarr as $arr) { - $ret =& $this->_Execute($stmt,$arr); - if (!$ret) return $ret; - } - } else - $ret =& $this->_Execute($sql,$inputarr); - } - } else { - $ret =& $this->_Execute($sql,false); - } + $ret =& $this->_Execute($sql,false); + if (!$ret) return $ret; + } + } else { + if ($array_2d) { + $stmt = $this->Prepare($sql); + foreach($inputarr as $arr) { + $ret =& $this->_Execute($stmt,$arr); + if (!$ret) return $ret; + } + } else + $ret =& $this->_Execute($sql,$inputarr); + } + } else { + $ret =& $this->_Execute($sql,false); + } - return $ret; - } + return $ret; + } - function& _Execute($sql,$inputarr=false) - { + function& _Execute($sql,$inputarr=false) + { - if ($this->debug) { - global $HTTP_SERVER_VARS; + if ($this->debug) { + global $HTTP_SERVER_VARS; - $ss = ''; - if ($inputarr) { - foreach($inputarr as $kk=>$vv) { - if (is_string($vv) && strlen($vv)>64) $vv = substr($vv,0,64).'...'; - $ss .= "($kk=>'$vv') "; - } - $ss = "[ $ss ]"; - } - $sqlTxt = str_replace(',',', ',is_array($sql) ?$sql[0] : $sql); - - // check if running from browser or command-line - $inBrowser = isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']); - - if ($inBrowser) { - if ($this->debug === -1) - ADOConnection::outp( "<br>\n($this->databaseType): ".htmlspecialchars($sqlTxt)." <code>$ss</code>\n<br>\n",false); - else - ADOConnection::outp( "<hr>\n($this->databaseType): ".htmlspecialchars($sqlTxt)." <code>$ss</code>\n<hr>\n",false); - } else { - ADOConnection::outp("-----\n($this->databaseType): ".($sqlTxt)." \n-----\n",false); - } - $this->_queryID = $this->_query($sql,$inputarr); - /* - Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql - because ErrorNo() calls Execute('SELECT @ERROR'), causing recursion - */ - if ($this->databaseType == 'mssql') { - // ErrorNo is a slow function call in mssql, and not reliable in PHP 4.0.6 - if($emsg = $this->ErrorMsg()) { - if ($err = $this->ErrorNo()) ADOConnection::outp($err.': '.$emsg); - } - } else if (!$this->_queryID) { - ADOConnection::outp($this->ErrorNo() .': '. $this->ErrorMsg()); - } - } else { - //**************************** - // non-debug version of query - //**************************** - - $this->_queryID =@$this->_query($sql,$inputarr); - } + $ss = ''; + if ($inputarr) { + foreach($inputarr as $kk=>$vv) { + if (is_string($vv) && strlen($vv)>64) $vv = substr($vv,0,64).'...'; + $ss .= "($kk=>'$vv') "; + } + $ss = "[ $ss ]"; + } + $sqlTxt = str_replace(',',', ',is_array($sql) ?$sql[0] : $sql); + + // check if running from browser or command-line + $inBrowser = isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']); + + if ($inBrowser) { + if ($this->debug === -1) + ADOConnection::outp( "<br>\n($this->databaseType): ".htmlspecialchars($sqlTxt)." <code>$ss</code>\n<br>\n",false); + else + ADOConnection::outp( "<hr>\n($this->databaseType): ".htmlspecialchars($sqlTxt)." <code>$ss</code>\n<hr>\n",false); + } else { + ADOConnection::outp("-----\n($this->databaseType): ".($sqlTxt)." \n-----\n",false); + } + $this->_queryID = $this->_query($sql,$inputarr); + /* + Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql + because ErrorNo() calls Execute('SELECT @ERROR'), causing recursion + */ + if ($this->databaseType == 'mssql') { + // ErrorNo is a slow function call in mssql, and not reliable in PHP 4.0.6 + if($emsg = $this->ErrorMsg()) { + if ($err = $this->ErrorNo()) ADOConnection::outp($err.': '.$emsg); + } + } else if (!$this->_queryID) { + ADOConnection::outp($this->ErrorNo() .': '. $this->ErrorMsg()); + } + } else { + //*********... [truncated message content] |
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] |
From: <var...@us...> - 2010-08-10 12:30:53
|
Revision: 7637 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7637&view=rev Author: vargenau Date: 2010-08-10 12:30:47 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Remove commented code Modified Paths: -------------- trunk/lib/plugin/WikiAdminSetAcl.php Modified: trunk/lib/plugin/WikiAdminSetAcl.php =================================================================== --- trunk/lib/plugin/WikiAdminSetAcl.php 2010-08-10 07:38:13 UTC (rev 7636) +++ trunk/lib/plugin/WikiAdminSetAcl.php 2010-08-10 12:30:47 UTC (rev 7637) @@ -136,8 +136,6 @@ } function run($dbi, $argstr, &$request, $basepage) { - //if (!DEBUG) - // return $this->disabled("WikiAdminSetAcl not yet enabled. Set DEBUG to try it."); if ($request->getArg('action') != 'browse') if ($request->getArg('action') != _("PhpWikiAdministration/SetAcl")) return $this->disabled("(action != 'browse')"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sle...@us...> - 2010-08-10 07:38:19
|
Revision: 7636 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7636&view=rev Author: slecallonnec Date: 2010-08-10 07:38:13 +0000 (Tue, 10 Aug 2010) Log Message: ----------- Fixed UserPreferences by setting again in user Modified Paths: -------------- trunk/lib/plugin/UserPreferences.php Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2010-08-09 16:40:16 UTC (rev 7635) +++ trunk/lib/plugin/UserPreferences.php 2010-08-10 07:38:13 UTC (rev 7636) @@ -65,6 +65,7 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); $user =& $request->_user; + $user->_request = $request; if (isa($request,'MockRequest')) return ''; if (defined('GFORGE') and GFORGE) { @@ -80,22 +81,16 @@ or (isa($user,'_ForbiddenUser'))) { $no_args = $this->getDefaultArguments(); -// ? -// foreach ($no_args as $key => $value) { -// $no_args[$value] = false; -// } $no_args['errmsg'] = HTML::div(array('class' => 'errors'), _("Error: The user HomePage must be a valid WikiWord. Sorry, UserPreferences cannot be saved.")); $no_args['isForm'] = false; return Template('userprefs', $no_args); } $userid = $user->UserName(); - if (// ((defined('ALLOW_BOGO_LOGIN') && ALLOW_BOGO_LOGIN && $user->isSignedIn()) || - $user->isAuthenticated() and !empty($userid)) + if ($user->isAuthenticated() and !empty($userid)) { $pref = &$request->_prefs; $args['isForm'] = true; - //trigger_error("DEBUG: reading prefs from getPreferences".print_r($pref)); if ($request->isPost()) { $errmsg = ''; @@ -127,8 +122,6 @@ if (!empty($rp['passwd']) and ($rp['passwd2'] != $rp['passwd'])) { $errmsg = _("Wrong password. Try again."); } else { - //trigger_error("DEBUG: reading prefs from request".print_r($rp)); - //trigger_error("DEBUG: writing prefs with setPreferences".print_r($pref)); if (empty($rp['passwd'])) unset($rp['passwd']); // fix to set system pulldown's. empty values don't get posted if (empty($rp['theme'])) $rp['theme'] = ''; @@ -175,7 +168,6 @@ } else { // wrong or unauthenticated user return $request->_notAuthorized(WIKIAUTH_BOGO); - //return $user->PrintLoginForm ($request, $args, false, false); } } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-09 16:40:23
|
Revision: 7635 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7635&view=rev Author: vargenau Date: 2010-08-09 16:40:16 +0000 (Mon, 09 Aug 2010) Log Message: ----------- GROUP_HASHOMEPAGE is not used Modified Paths: -------------- trunk/lib/WikiGroup.php Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2010-08-09 15:30:20 UTC (rev 7634) +++ trunk/lib/WikiGroup.php 2010-08-09 16:40:16 UTC (rev 7635) @@ -1,7 +1,8 @@ <?php -// rcs_id('$Id$'); +// $Id$' /* * Copyright (C) 2003, 2004 $ThePhpWikiProgrammingTeam + * Copyright (C) 2010 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -20,16 +21,15 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -if (!defined('GROUP_METHOD') or +if (!defined('GROUP_METHOD') or !in_array(GROUP_METHOD, array('NONE','WIKIPAGE','DB','FILE','LDAP'))) trigger_error(_("No or unsupported GROUP_METHOD defined"), E_USER_WARNING); - -/* Special group names for ACL */ + +/* Special group names for ACL */ define('GROUP_EVERY', _("Every")); define('GROUP_ANONYMOUS', _("Anonymous Users")); define('GROUP_BOGOUSER', _("Bogo Users")); -define('GROUP_HASHOMEPAGE', _("HasHomePage")); define('GROUP_SIGNED', _("Signed Users")); define('GROUP_AUTHENTICATED', _("Authenticated Users")); define('GROUP_ADMIN', _("Administrators")); @@ -40,9 +40,9 @@ * WikiGroup is an abstract class to provide the base functions for determining * group membership for a specific user. Some functions are user independent. * - * Limitation: For the current user only. This must be fixed to be able to query + * Limitation: For the current user only. This must be fixed to be able to query * for membership of any user. - * + * * WikiGroup is an abstract class with three functions: * <ol><li />Provide the static method getGroup with will return the proper * subclass. @@ -54,7 +54,7 @@ * * @author Joby Walker <zo...@im...> * @author Reini Urban - */ + */ class WikiGroup{ /** User name */ var $username = ''; @@ -66,12 +66,12 @@ var $membership; /** boolean if not the current user */ var $not_current = false; - + /** * Initializes a WikiGroup object which should never happen. Use: * $group = &WikiGroup::getGroup(); * @param object $request The global WikiRequest object -- ignored. - */ + */ function WikiGroup($not_current = false) { $this->not_current = $not_current; //$this->request =& $GLOBALS['request']; @@ -82,7 +82,7 @@ * and erases $this->membership if is different than * the stored $this->username * @return string Current username. - */ + */ function _getUserName(){ global $request; $user = (!empty($this->user)) ? $this->user : $request->getUser(); @@ -95,16 +95,16 @@ $this->user = $user; return $username; } - + /** * Static method to return the WikiGroup subclass used in this wiki. Controlled * by the constant GROUP_METHOD. * @param object $request The global WikiRequest object. * @return object Subclass of WikiGroup selected via GROUP_METHOD. - */ + */ function getGroup($not_current = false){ switch (GROUP_METHOD){ - case "NONE": + case "NONE": return new GroupNone($not_current); break; case "WIKIPAGE": @@ -116,15 +116,15 @@ } elseif ($GLOBALS['DBParams']['dbtype'] == 'SQL') { return new GroupDb_PearDB($not_current); } else { - trigger_error("GROUP_METHOD = DB: Unsupported dbtype " + trigger_error("GROUP_METHOD = DB: Unsupported dbtype " . $GLOBALS['DBParams']['dbtype'], E_USER_ERROR); } break; - case "FILE": + case "FILE": return new GroupFile($not_current); break; - case "LDAP": + case "LDAP": return new GroupLDAP($not_current); break; default: @@ -134,7 +134,7 @@ } /** ACL PagePermissions will need those special groups based on the User status only. - * translated + * translated */ function specialGroup($group){ return in_array($group,$this->specialGroups()); @@ -170,12 +170,12 @@ /** * Determines if the current user is a member of a group. - * + * * This method is an abstraction. The group is ignored, an error is sent, and * false (not a member of the group) is returned. * @param string $group Name of the group to check for membership (ignored). * @return boolean True if user is a member, else false (always false). - */ + */ function isMember($group){ if (isset($this->membership[$group])) return $this->membership[$group]; @@ -201,14 +201,14 @@ case GROUP_ANONYMOUS: return $this->membership[$group] = ! $user->isSignedIn(); case GROUP_BOGOUSER: - return $this->membership[$group] = (isa($user,'_BogoUser') + return $this->membership[$group] = (isa($user,'_BogoUser') and $user->_level >= WIKIAUTH_BOGO); case GROUP_SIGNED: return $this->membership[$group] = $user->isSignedIn(); case GROUP_AUTHENTICATED: return $this->membership[$group] = $user->isAuthenticated(); case GROUP_ADMIN: - return $this->membership[$group] = (isset($user->_level) + return $this->membership[$group] = (isset($user->_level) and $user->_level == WIKIAUTH_ADMIN); case GROUP_OWNER: case GROUP_CREATOR: @@ -220,14 +220,14 @@ } return false; } - + /** * Determines all of the groups of which the current user is a member. - * - * This method is an abstraction. An error is sent and an empty + * + * This method is an abstraction. An error is sent and an empty * array is returned. * @return array Array of groups to which the user belongs (always empty). - */ + */ function getAllGroupsIn(){ trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", 'getAllGroupsIn', GROUP_METHOD), @@ -253,7 +253,7 @@ /* WikiDB users from prefs (not from users): */ if (ENABLE_USER_NEW) $dbi = _PassUser::getAuthDbh(); - else + else $dbi = false; if ($dbi and $dbh->getAuthParam('pref_select')) { @@ -301,12 +301,12 @@ /** * Determines all of the members of a particular group. - * - * This method is an abstraction. The group is ignored, an error is sent, + * + * This method is an abstraction. The group is ignored, an error is sent, * and an empty array is returned * @param string $group Name of the group to get the full membership list of. * @return array Array of usernames that have joined the group (always empty). - */ + */ function getMembersOf($group){ if ($this->specialGroup($group)) { return $this->getSpecialMembersOf($group); @@ -316,7 +316,7 @@ E_USER_WARNING); return array(); } - + function getSpecialMembersOf($group) { //$request = &$this->request; $all = $this->_allUsers(); @@ -324,14 +324,14 @@ switch ($group) { case GROUP_EVERY: return $all; - case GROUP_ANONYMOUS: + case GROUP_ANONYMOUS: return $users; case GROUP_BOGOUSER: foreach ($all as $u) { if (isWikiWord($u)) $users[] = $u; } return $users; - case GROUP_SIGNED: + case GROUP_SIGNED: foreach ($all as $u) { $user = WikiUser($u); if ($user->isSignedIn()) $users[] = $u; @@ -343,10 +343,10 @@ if ($user->isAuthenticated()) $users[] = $u; } return $users; - case GROUP_ADMIN: + case GROUP_ADMIN: foreach ($all as $u) { $user = WikiUser($u); - if (isset($user->_level) and $user->_level == WIKIAUTH_ADMIN) + if (isset($user->_level) and $user->_level == WIKIAUTH_ADMIN) $users[] = $u; } return $users; @@ -362,29 +362,29 @@ /** * Add the current or specified user to a group. - * - * This method is an abstraction. The group and user are ignored, an error + * + * This method is an abstraction. The group and user are ignored, an error * is sent, and false (not added) is always returned. * @param string $group User added to this group. * @param string $user Username to add to the group (default = current user). * @return bool On true user was added, false if not. - */ + */ function setMemberOf($group, $user = false){ trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", 'setMemberOf', GROUP_METHOD), E_USER_WARNING); return false; } - + /** * Remove the current or specified user to a group. - * + * * This method is an abstraction. The group and user are ignored, and error * is sent, and false (not removed) is always returned. * @param string $group User removed from this group. * @param string $user Username to remove from the group (default = current user). * @return bool On true user was removed, false if not. - */ + */ function removeMemberOf($group, $user = false){ trigger_error(__sprintf("Method '%s' not implemented in this GROUP_METHOD %s", 'removeMemberOf', GROUP_METHOD), @@ -395,31 +395,31 @@ /** * GroupNone disables all Group funtionality - * - * All of the GroupNone functions return false or empty values to indicate failure or + * + * All of the GroupNone functions return false or empty values to indicate failure or * no results. Use GroupNone if group controls are not desired. * @author Joby Walker <zo...@im...> - */ + */ class GroupNone extends WikiGroup{ /** * Constructor - * + * * Ignores the parameter provided. * @param object $request The global WikiRequest object - ignored. - */ + */ function GroupNone() { //$this->request = &$GLOBALS['request']; return; - } + } /** * Determines if the current user is a member of a group. - * + * * The group is ignored and false (not a member of the group) is returned. * @param string $group Name of the group to check for membership (ignored). * @return boolean True if user is a member, else false (always false). - */ + */ function isMember($group){ if ($this->specialGroup($group)) { return $this->isSpecialMember($group); @@ -427,25 +427,25 @@ return false; } } - + /** * Determines all of the groups of which the current user is a member. - * + * * The group is ignored and an empty array (a member of no groups) is returned. * @param string $group Name of the group to check for membership (ignored). * @return array Array of groups to which the user belongs (always empty). - */ + */ function getAllGroupsIn(){ return array(); } /** * Determines all of the members of a particular group. - * + * * The group is ignored and an empty array (a member of no groups) is returned. * @param string $group Name of the group to check for membership (ignored). * @return array Array of groups user belongs to (always empty). - */ + */ function getMembersOf($group){ return array(); } @@ -454,20 +454,20 @@ /** * GroupWikiPage provides group functionality via pages within the Wiki. - * - * GroupWikiPage is the Wiki way of managing a group. Every group will have - * a page. To modify the membership of the group, one only needs to edit the + * + * GroupWikiPage is the Wiki way of managing a group. Every group will have + * a page. To modify the membership of the group, one only needs to edit the * membership list on the page. * @author Joby Walker <zo...@im...> - */ + */ class GroupWikiPage extends WikiGroup{ - + /** * Constructor - * + * * Initializes the three superclass instance variables * @param object $request The global WikiRequest object. - */ + */ function GroupWikiPage() { //$this->request = &$GLOBALS['request']; $this->username = $this->_getUserName(); @@ -477,14 +477,14 @@ /** * Determines if the current user is a member of a group. - * - * To determine membership in a particular group, this method checks the - * superclass instance variable $membership to see if membership has - * already been determined. If not, then the group page is parsed to + * + * To determine membership in a particular group, this method checks the + * superclass instance variable $membership to see if membership has + * already been determined. If not, then the group page is parsed to * determine membership. * @param string $group Name of the group to check for membership. * @return boolean True if user is a member, else false. - */ + */ function isMember($group){ if (isset($this->membership[$group])) { return $this->membership[$group]; @@ -502,7 +502,7 @@ } return false; } - + /** * Private method to take a WikiDB_Page and parse to determine if the * current_user is a member of the group. @@ -514,7 +514,7 @@ $group_revision = $group_page->getCurrentRevision(); if ($group_revision->hasDefaultContents()) { $group = $group_page->getName(); - if ($strict) trigger_error(sprintf(_("Group page '%s' does not exist"), $group), + if ($strict) trigger_error(sprintf(_("Group page '%s' does not exist"), $group), E_USER_WARNING); return false; } @@ -527,15 +527,15 @@ } return false; } - + /** * Determines all of the groups of which the current user is a member. - * - * Checks the root Group page ('CategoryGroup') for the list of all groups, + * + * Checks the root Group page ('CategoryGroup') for the list of all groups, * then checks each group to see if the current user is a member. * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. - */ + */ function getAllGroupsIn(){ $membership = array(); @@ -560,12 +560,12 @@ /** * Determines all of the members of a particular group. - * + * * Checks a group's page to return all the current members. Currently this * method is disabled and triggers an error and returns an empty array. * @param string $group Name of the group to get the full membership list of. * @return array Array of usernames that have joined the group (always empty). - */ + */ function getMembersOf($group){ if ($this->specialGroup($group)) return $this->getSpecialMembersOf($group); @@ -591,29 +591,29 @@ /** * GroupDb is configured by $DbAuthParams[] statements - * + * * Fixme: adodb * @author ReiniUrban - */ + */ class GroupDb extends WikiGroup { - + var $_is_member, $_group_members, $_user_groups; /** * Constructor - * + * * @param object $request The global WikiRequest object. ignored - */ + */ function GroupDb() { global $DBAuthParams, $DBParams; //$this->request = &$GLOBALS['request']; $this->username = $this->_getUserName(); $this->membership = array(); - if (empty($DBAuthParams['group_members']) or + if (empty($DBAuthParams['group_members']) or empty($DBAuthParams['user_groups']) or empty($DBAuthParams['is_member'])) { - trigger_error(_("No or not enough GROUP_DB SQL statements defined"), + trigger_error(_("No or not enough GROUP_DB SQL statements defined"), E_USER_WARNING); return new GroupNone(); } @@ -641,17 +641,17 @@ /** * PearDB methods - * + * * @author ReiniUrban - */ + */ class GroupDb_PearDB extends GroupDb { - + /** * Determines if the current user is a member of a database group. - * + * * @param string $group Name of the group to check for membership. * @return boolean True if user is a member, else false. - */ + */ function isMember($group) { if (isset($this->membership[$group])) { return $this->membership[$group]; @@ -670,14 +670,14 @@ return $this->isSpecialMember($group); return false; } - + /** * Determines all of the groups of which the current user is a member. - * + * * then checks each group to see if the current user is a member. * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. - */ + */ function getAllGroupsIn(){ $membership = array(); @@ -701,12 +701,12 @@ /** * Determines all of the members of a particular group. - * + * * Checks a group's page to return all the current members. Currently this * method is disabled and triggers an error and returns an empty array. * @param string $group Name of the group to get the full membership list of. * @return array Array of usernames that have joined the group. - */ + */ function getMembersOf($group){ $members = array(); @@ -726,17 +726,17 @@ /** * ADODB methods - * + * * @author ReiniUrban - */ + */ class GroupDb_ADODB extends GroupDb { /** * Determines if the current user is a member of a database group. - * + * * @param string $group Name of the group to check for membership. * @return boolean True if user is a member, else false. - */ + */ function isMember($group) { if (isset($this->membership[$group])) { return $this->membership[$group]; @@ -759,14 +759,14 @@ return false; } - + /** * Determines all of the groups of which the current user is a member. * then checks each group to see if the current user is a member. * * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. - */ + */ function getAllGroupsIn(){ $membership = array(); @@ -793,10 +793,10 @@ /** * Determines all of the members of a particular group. - * + * * @param string $group Name of the group to get the full membership list of. * @return array Array of usernames that have joined the group. - */ + */ function getMembersOf($group){ $members = array(); $dbh = & $this->dbh; @@ -818,16 +818,16 @@ /** * GroupFile is configured by AUTH_GROUP_FILE * groupname: user1 user2 ... - * + * * @author ReiniUrban - */ + */ class GroupFile extends WikiGroup { - + /** * Constructor - * + * * @param object $request The global WikiRequest object. - */ + */ function GroupFile(){ //$this->request = &$GLOBALS['request']; $this->username = $this->_getUserName(); @@ -840,7 +840,7 @@ return false; } if (!file_exists(AUTH_GROUP_FILE)) { - trigger_error(sprintf(_("Cannot open AUTH_GROUP_FILE %s"), AUTH_GROUP_FILE), + trigger_error(sprintf(_("Cannot open AUTH_GROUP_FILE %s"), AUTH_GROUP_FILE), E_USER_WARNING); return false; } @@ -850,14 +850,14 @@ /** * Determines if the current user is a member of a group. - * - * To determine membership in a particular group, this method checks the - * superclass instance variable $membership to see if membership has - * already been determined. If not, then the group file is parsed to + * + * To determine membership in a particular group, this method checks the + * superclass instance variable $membership to see if membership has + * already been determined. If not, then the group file is parsed to * determine membership. * @param string $group Name of the group to check for membership. * @return boolean True if user is a member, else false. - */ + */ function isMember($group) { //$request = $this->request; //$username = $this->username; @@ -879,14 +879,14 @@ return $this->isSpecialMember($group); return false; } - + /** * Determines all of the groups of which the current user is a member. - * + * * then checks each group to see if the current user is a member. * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. - */ + */ function getAllGroupsIn(){ //$username = $this->_getUserName(); $membership = array(); @@ -913,11 +913,11 @@ /** * Determines all of the members of a particular group. - * + * * Return all the current members. * @param string $group Name of the group to get the full membership list of. * @return array Array of usernames that have joined the group. - */ + */ function getMembersOf($group){ $members = array(); if (!empty($this->_file->users[$group])) { @@ -932,16 +932,16 @@ /** * Ldap is configured in index.php - * + * * @author ReiniUrban - */ + */ class GroupLdap extends WikiGroup { - + /** * Constructor - * + * * @param object $request The global WikiRequest object. - */ + */ function GroupLdap(){ //$this->request = &$GLOBALS['request']; $this->username = $this->_getUserName(); @@ -956,7 +956,7 @@ // CGI does work. if (! function_exists('ldap_connect') and (!isWindows() or isCGI())) { // on MacOSX >= 4.3 you'll need PHP_SHLIB_SUFFIX instead. - dl("ldap".defined('PHP_SHLIB_SUFFIX') ? PHP_SHLIB_SUFFIX : DLL_EXT); + dl("ldap".defined('PHP_SHLIB_SUFFIX') ? PHP_SHLIB_SUFFIX : DLL_EXT); if (! function_exists('ldap_connect')) { trigger_error(_("No LDAP in this PHP version"), E_USER_WARNING); return false; @@ -974,17 +974,17 @@ if (!isset($this->user) or !isa($this->user, '_LDAPPassUser')) $this->_user = new _LDAPPassUser('LdapGroupTest'); // to have a valid username - else + else $this->_user =& $this->user; } /** * Determines if the current user is a member of a group. * Not ready yet! - * + * * @param string $group Name of the group to check for membership. * @return boolean True if user is a member, else false. - */ + */ function isMember($group) { if (isset($this->membership[$group])) { return $this->membership[$group]; @@ -997,13 +997,13 @@ if ($this->specialGroup($group)) return $this->isSpecialMember($group); } - + /** * Determines all of the groups of which the current user is a member. * * @param string $group Name of the group to check for membership. * @return array Array of groups to which the user belongs. - */ + */ function getAllGroupsIn(){ //$request = &$this->request; //$username = $this->_getUserName(); @@ -1016,13 +1016,13 @@ $membership[] = $group; } } - + // must be a valid LDAP server, and username must not contain a wildcard if ($ldap = $this->_user->_init()) { $st_search = LDAP_SEARCH_FIELD ? LDAP_SEARCH_FIELD."=".$this->username : "uid=".$this->username; $sr = ldap_search($ldap, (LDAP_OU_USERS ? LDAP_OU_USERS : "ou=Users") - .($this->base_dn ? ",".$this->base_dn : ''), + .($this->base_dn ? ",".$this->base_dn : ''), $st_search); if (!$sr) { $this->_user->_free(); @@ -1047,7 +1047,7 @@ } } } else { - trigger_error(fmt("Unable to connect to LDAP server %s", LDAP_AUTH_HOST), + trigger_error(fmt("Unable to connect to LDAP server %s", LDAP_AUTH_HOST), E_USER_WARNING); } $this->_user->_free(); @@ -1058,11 +1058,11 @@ /** * Determines all of the members of a particular group. - * + * * Return all the members of the given group. LDAP just returns the gid of each user * @param string $group Name of the group to get the full membership list of. * @return array Array of usernames that have joined the group. - */ + */ function getMembersOf($group){ $members = array(); if ($ldap = $this->_user->_init()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-09 15:30:26
|
Revision: 7634 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7634&view=rev Author: vargenau Date: 2010-08-09 15:30:20 +0000 (Mon, 09 Aug 2010) Log Message: ----------- PhpWikiAdministration/Replace --> PhpWikiAdministration/SearchReplace Modified Paths: -------------- trunk/lib/PagePerm.php Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2010-08-09 14:00:30 UTC (rev 7633) +++ trunk/lib/PagePerm.php 2010-08-09 15:30:20 UTC (rev 7634) @@ -2,7 +2,7 @@ // rcs_id('$Id$'); /* * Copyright 2004,2007 $ThePhpWikiProgrammingTeam - * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -22,45 +22,45 @@ */ /** - Permissions per page and action based on current user, - ownership and group membership implemented with ACL's (Access Control Lists), - opposed to the simplier unix-like ugo:rwx system. - The previous system was only based on action and current user. (lib/main.php) + * Permissions per page and action based on current user, + * ownership and group membership implemented with ACL's (Access Control Lists), + * opposed to the simplier unix-like ugo:rwx system. + * The previous system was only based on action and current user. (lib/main.php) + * + * Permissions may be inherited from its parent pages, a optional the + * optional master page ("."), and predefined default permissions, if "." + * is not defined. + * Pagenames starting with "." have special default permissions. + * For Authentication see WikiUserNew.php, WikiGroup.php and main.php + * Page Permissions are in PhpWiki since v1.3.9 and enabled since v1.4.0 + * + * This file might replace the following functions from main.php: + * Request::_notAuthorized($require_level) + * display the denied message and optionally a login form + * to gain higher privileges + * Request::getActionDescription($action) + * helper to localize the _notAuthorized message per action, + * when login is tried. + * Request::getDisallowedActionDescription($action) + * helper to localize the _notAuthorized message per action, + * when it aborts + * Request::requiredAuthority($action) + * returns the needed user level + * has a hook for plugins on POST + * Request::requiredAuthorityForAction($action) + * just returns the level per action, will be replaced with the + * action + page pair + * + * The defined main.php actions map to simplier access types: + * browse => view + * edit => edit + * create => edit or create + * remove => remove + * rename => change + * store prefs => change + * list in PageList => list + */ - Permissions may be inherited from its parent pages, a optional the - optional master page ("."), and predefined default permissions, if "." - is not defined. - Pagenames starting with "." have special default permissions. - For Authentication see WikiUserNew.php, WikiGroup.php and main.php - Page Permissions are in PhpWiki since v1.3.9 and enabled since v1.4.0 - - This file might replace the following functions from main.php: - Request::_notAuthorized($require_level) - display the denied message and optionally a login form - to gain higher privileges - Request::getActionDescription($action) - helper to localize the _notAuthorized message per action, - when login is tried. - Request::getDisallowedActionDescription($action) - helper to localize the _notAuthorized message per action, - when it aborts - Request::requiredAuthority($action) - returns the needed user level - has a hook for plugins on POST - Request::requiredAuthorityForAction($action) - just returns the level per action, will be replaced with the - action + page pair - - The defined main.php actions map to simplier access types: - browse => view - edit => edit - create => edit or create - remove => remove - rename => change - store prefs => change - list in PageList => list -*/ - /* Symbolic special ACL groups. Untranslated to be stored in page metadata*/ define('ACL_EVERY', '_EVERY'); define('ACL_ANONYMOUS', '_ANONYMOUS'); @@ -89,7 +89,7 @@ } elseif ($perm = getPagePermissions($page)) { return array('page', $perm); // or no permissions defined; returned inherited permissions, to be displayed in gray - } elseif ($pagename == '.') { // stop recursion in pathological case. + } elseif ($pagename == '.') { // stop recursion in pathological case. // "." defined, without any acl return array('default', new PagePermission()); } else { @@ -141,10 +141,10 @@ return $perm->asTable($type); } -/** +/** * Check the permissions for the current action. - * Walk down the inheritance tree. Collect all permissions until - * the minimum required level is gained, which is not + * Walk down the inheritance tree. Collect all permissions until + * the minimum required level is gained, which is not * overruled by more specific forbid rules. * Todo: cache result per access and page in session? */ @@ -188,7 +188,7 @@ // invent a new access-perm massedit? or switch back to change, or keep it at edit? case _("PhpWikiAdministration")."/"._("Rename"): - case _("PhpWikiAdministration")."/"._("Replace"): + case _("PhpWikiAdministration")."/"._("SearchReplace"): case 'replace': case 'rename': case 'revert': @@ -199,10 +199,10 @@ if (!$page->exists()) return 'create'; else - return 'view'; + return 'view'; break; case 'upload': - case 'loadfile': + case 'loadfile': // probably create/edit but we cannot check all page permissions, can we? case 'remove': case 'purge': @@ -227,11 +227,11 @@ // Maybe page-(current+edit+change?)action pairs will help function _requiredAuthorityForPagename($access, $pagename) { static $permcache = array(); - + if (array_key_exists($pagename, $permcache) and array_key_exists($access, $permcache[$pagename])) return $permcache[$pagename][$access]; - + global $request; $page = $request->getPage($pagename); @@ -256,7 +256,7 @@ return $result; } // no ACL defined; check for special dotfile or walk down - if (! ($perm = getPagePermissions($page))) { + if (! ($perm = getPagePermissions($page))) { if ($pagename == '.') { $perm = new PagePermission(); if ($perm->isAuthorized('change', $request->_user)) { @@ -282,7 +282,7 @@ return $authorized; } elseif ($pagename == '.') { return false; - } else { + } else { return _requiredAuthorityForPagename($access, getParentPage($pagename)); } } @@ -300,12 +300,12 @@ } // Read the ACL from the page -// Done: Not existing pages should NOT be queried. +// Done: Not existing pages should NOT be queried. // Check the parent page instead and don't take the default ACL's function getPagePermissions ($page) { if ($hash = $page->get('perm')) // hash => object return new PagePermission(unserialize($hash)); - else + else return false; } @@ -335,7 +335,7 @@ } /** - * The ACL object per page. It is stored in a page, but can also + * The ACL object per page. It is stored in a page, but can also * be merged with ACL's from other pages or taken from the master (pseudo) dot-file. * * A hash of "access" => "requires" pairs. @@ -343,7 +343,7 @@ * "requires" required username or groupname or any special group => true or false * * Define any special rules here, like don't list dot-pages. - */ + */ class PagePermission { var $perm; @@ -367,7 +367,7 @@ /** * The workhorse to check the user against the current ACL pairs. - * Must translate the various special groups to the actual users settings + * Must translate the various special groups to the actual users settings * (userid, group membership). */ function isAuthorized($access, $user) { @@ -385,7 +385,7 @@ } /** - * Translate the various special groups to the actual users settings + * Translate the various special groups to the actual users settings * (userid, group membership). */ function isMember($user, $group) { @@ -395,14 +395,14 @@ else $member =& $this->_group; //$user = & $request->_user; if ($group === ACL_ADMIN) // WIKI_ADMIN or member of _("Administrators") - return $user->isAdmin() or - ($user->isAuthenticated() and + return $user->isAdmin() or + ($user->isAuthenticated() and $member->isMember(GROUP_ADMIN)); - if ($group === ACL_ANONYMOUS) + if ($group === ACL_ANONYMOUS) return ! $user->isSignedIn(); if ($group === ACL_BOGOUSER) if (ENABLE_USER_NEW) - return isa($user,'_BogoUser') or + return isa($user,'_BogoUser') or (isWikiWord($user->_userid) and $user->_level >= WIKIAUTH_BOGO); else return isWikiWord($user->UserName()); if ($group === ACL_HASHOMEPAGE) @@ -415,19 +415,19 @@ if (!$user->isAuthenticated()) return false; $page = $request->getPage(); $owner = $page->getOwner(); - return ($owner === $user->UserName() + return ($owner === $user->UserName() or $member->isMember($owner)); } if ($group === ACL_CREATOR) { if (!$user->isAuthenticated()) return false; $page = $request->getPage(); $creator = $page->getCreator(); - return ($creator === $user->UserName() + return ($creator === $user->UserName() or $member->isMember($creator)); } /* Or named groups or usernames. - Note: We don't seperate groups and users here. - Users overrides groups with the same name. + Note: We don't seperate groups and users here. + Users overrides groups with the same name. */ return $user->UserName() === $group or $member->isMember($group); @@ -467,17 +467,17 @@ $perm['edit'] = array(ACL_SIGNED => true); // view: if (!ALLOW_ANON_USER) { - if (!ALLOW_USER_PASSWORDS) + if (!ALLOW_USER_PASSWORDS) $perm['view'] = array(ACL_SIGNED => true); - else + else $perm['view'] = array(ACL_AUTHENTICATED => true); $perm['view'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false; } // edit: if (!ALLOW_ANON_EDIT) { - if (!ALLOW_USER_PASSWORDS) + if (!ALLOW_USER_PASSWORDS) $perm['edit'] = array(ACL_SIGNED => true); - else + else $perm['edit'] = array(ACL_AUTHENTICATED => true); $perm['edit'][ACL_BOGOUSER] = ALLOW_BOGO_LOGIN ? true : false; $perm['create'] = $perm['edit']; @@ -504,7 +504,7 @@ // Use case is when a rule is removed. return (print_r($this->perm, true) === print_r($otherperm, true)); } - + /** * returns list of all supported access types. */ @@ -533,7 +533,7 @@ $hash = $page->get('perm'); if ($hash) // hash => object $perm = new PagePermission(unserialize($hash)); - else + else $perm = new PagePermission(); $perm->sanify(); return $perm; @@ -549,7 +549,7 @@ if ($group[0] == '_') return constant("GROUP".$group); else return $group; } - + /* type: page, default, inherited */ function asTable($type) { $table = HTML::table(); @@ -570,11 +570,11 @@ $table->setAttr('style','border: solid thin black; font-weight: bold;'); return $table; } - + /* type: page, default, inherited */ function asEditableTable($type) { global $WikiTheme; - if (!isset($this->_group)) { + if (!isset($this->_group)) { $this->_group =& $GLOBALS['request']->getGroup(); } $table = HTML::table(); @@ -586,7 +586,7 @@ HTML::th(_("Grant")), HTML::th(_("Del/+")), HTML::th(_("Description")))); - + $allGroups = $this->_group->_specialGroups(); foreach ($this->_group->getAllGroupsIn() as $group) { if (!in_array($group,$this->_group->specialGroups())) @@ -740,33 +740,33 @@ $perm =& $this->perm; // get effective user and group $s = '---------+'; - if (isset($perm['view'][$owner]) or + if (isset($perm['view'][$owner]) or (isset($perm['view'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[0] = 'r'; - if (isset($perm['edit'][$owner]) or + if (isset($perm['edit'][$owner]) or (isset($perm['edit'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[1] = 'w'; - if (isset($perm['change'][$owner]) or + if (isset($perm['change'][$owner]) or (isset($perm['change'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[2] = 'x'; if (!empty($group)) { - if (isset($perm['view'][$group]) or + if (isset($perm['view'][$group]) or (isset($perm['view'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[3] = 'r'; - if (isset($perm['edit'][$group]) or + if (isset($perm['edit'][$group]) or (isset($perm['edit'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[4] = 'w'; - if (isset($perm['change'][$group]) or + if (isset($perm['change'][$group]) or (isset($perm['change'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[5] = 'x'; } - if (isset($perm['view'][ACL_EVERY]) or + if (isset($perm['view'][ACL_EVERY]) or (isset($perm['view'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[6] = 'r'; - if (isset($perm['edit'][ACL_EVERY]) or + if (isset($perm['edit'][ACL_EVERY]) or (isset($perm['edit'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[7] = 'w'; - if (isset($perm['change'][ACL_EVERY]) or + if (isset($perm['change'][ACL_EVERY]) or (isset($perm['change'][ACL_AUTHENTICATED]) and $request->_user->isAuthenticated())) $s[8] = 'x'; return $s; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-09 14:00:37
|
Revision: 7633 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7633&view=rev Author: vargenau Date: 2010-08-09 14:00:30 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Consistent naming for templates: TemplateTalk --> Template/Talk Modified Paths: -------------- trunk/lib/loadsave.php trunk/themes/MonoBook/templates/actionbar.tmpl trunk/themes/gforge/templates/actionbar.tmpl Added Paths: ----------- trunk/pgsrc/Template%2FTalk Removed Paths: ------------- trunk/pgsrc/TemplateTalk Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2010-08-09 12:06:15 UTC (rev 7632) +++ trunk/lib/loadsave.php 2010-08-09 14:00:30 UTC (rev 7633) @@ -1528,11 +1528,11 @@ $finder = new FileFinder; if (!GFORGE) { - $mandatory = explode(':','SandBox:Template/Category:TemplateTalk:SpecialPages:CategoryCategory:CategoryActionPage:Help/OldTextFormattingRules:Help/TextFormattingRules:PhpWikiAdministration'); + $mandatory = explode(':','SandBox:Template/Category:Template/Talk:SpecialPages:CategoryCategory:CategoryActionPage:Help/OldTextFormattingRules:Help/TextFormattingRules:PhpWikiAdministration'); } else if (WIKI_NAME == "help") { - $mandatory = explode(':','SandBox:Template/Category:TemplateTalk:SpecialPages:CategoryCategory:CategoryActionPage:Help/TextFormattingRules:PhpWikiAdministration'); + $mandatory = explode(':','SandBox:Template/Category:Template/Talk:SpecialPages:CategoryCategory:CategoryActionPage:Help/TextFormattingRules:PhpWikiAdministration'); } else { - $mandatory = explode(':','SandBox:Template/UserPage:Template/Category:TemplateTalk:SpecialPages:CategoryCategory:CategoryActionPage:TextFormattingRules:PhpWikiAdministration'); + $mandatory = explode(':','SandBox:Template/UserPage:Template/Category:Template/Talk:SpecialPages:CategoryCategory:CategoryActionPage:TextFormattingRules:PhpWikiAdministration'); } foreach (array_merge($mandatory, $GLOBALS['AllActionPages'], Copied: trunk/pgsrc/Template%2FTalk (from rev 7632, trunk/pgsrc/TemplateTalk) =================================================================== --- trunk/pgsrc/Template%2FTalk (rev 0) +++ trunk/pgsrc/Template%2FTalk 2010-08-09 14:00:30 UTC (rev 7633) @@ -0,0 +1,14 @@ +Date: Mon, 9 Apr 2010 15:32:58 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) +X-Rcs-Id: $Id$ +Content-Type: application/x-phpwiki; + pagename=Template%2FTalk; + flags=EXTERNAL_PAGE; + markup=2; + charset=UTF-8 +Content-Transfer-Encoding: binary + +You can discuss here the content of the page. + +Do not forget to sign your contribution (you can use the +Signature button in the edit Toolbar). Deleted: trunk/pgsrc/TemplateTalk =================================================================== --- trunk/pgsrc/TemplateTalk 2010-08-09 12:06:15 UTC (rev 7632) +++ trunk/pgsrc/TemplateTalk 2010-08-09 14:00:30 UTC (rev 7633) @@ -1,14 +0,0 @@ -Date: Thu, 15 Apr 2010 16:32:58 +0000 -Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) -X-Rcs-Id: $Id$ -Content-Type: application/x-phpwiki; - pagename=TemplateTalk; - flags=EXTERNAL_PAGE; - markup=2; - charset=UTF-8 -Content-Transfer-Encoding: binary - -You can discuss here the content of the page. - -Do not forget to sign your contribution (you can use the -Signature button in the edit Toolbar). Modified: trunk/themes/MonoBook/templates/actionbar.tmpl =================================================================== --- trunk/themes/MonoBook/templates/actionbar.tmpl 2010-08-09 12:06:15 UTC (rev 7632) +++ trunk/themes/MonoBook/templates/actionbar.tmpl 2010-08-09 14:00:30 UTC (rev 7633) @@ -22,7 +22,7 @@ <?php echo ActionButton(array('action'=>'browse'), _("Discussion"), $talk->getName()) ?> <?php } else { ?> <?php echo ActionButton(array('action'=>'create', - 'template'=>_("TemplateTalk")), + 'template'=>_("Template/Talk")), _("Discussion"), $talk->getName()) ?> <?php } ?> <?php } ?> Modified: trunk/themes/gforge/templates/actionbar.tmpl =================================================================== --- trunk/themes/gforge/templates/actionbar.tmpl 2010-08-09 12:06:15 UTC (rev 7632) +++ trunk/themes/gforge/templates/actionbar.tmpl 2010-08-09 14:00:30 UTC (rev 7633) @@ -31,7 +31,7 @@ <?php } else { ?> <td> <?php echo Button(array('action'=>'create', - 'template'=>_("TemplateTalk")), + 'template'=>_("Template/Talk")), _("Discussion"), $talk->getName()) ?> </td> <?php } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-09 12:06:21
|
Revision: 7632 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7632&view=rev Author: vargenau Date: 2010-08-09 12:06:15 +0000 (Mon, 09 Aug 2010) Log Message: ----------- This is not true: content can be put before the plugin call Modified Paths: -------------- trunk/lib/plugin/RedirectTo.php trunk/pgsrc/Help%2FRedirectToPlugin Modified: trunk/lib/plugin/RedirectTo.php =================================================================== --- trunk/lib/plugin/RedirectTo.php 2010-08-09 12:00:55 UTC (rev 7631) +++ trunk/lib/plugin/RedirectTo.php 2010-08-09 12:06:15 UTC (rev 7632) @@ -25,7 +25,6 @@ * Usage: * <<RedirectTo href="http://www.internet-technology.de/fourwins_de.htm" >> * or <<RedirectTo page=AnotherPage >> - * at the VERY FIRST LINE in the content! Otherwise it will be ignored. * * Author: Reini Urban <ru...@x-...> * Modified: trunk/pgsrc/Help%2FRedirectToPlugin =================================================================== --- trunk/pgsrc/Help%2FRedirectToPlugin 2010-08-09 12:00:55 UTC (rev 7631) +++ trunk/pgsrc/Help%2FRedirectToPlugin 2010-08-09 12:06:15 UTC (rev 7632) @@ -1,4 +1,4 @@ -Date: Mon, 9 Aug 2010 14:00:10 +0000 +Date: Mon, 9 Aug 2010 14:02:27 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -14,6 +14,7 @@ When redirecting to another wiki page, a note is added to the top of the target page saying //(Redirected from SomeRedirectingPage)//. +Redirection to external URLs will only work on locked pages. == Arguments == @@ -36,12 +37,11 @@ == Caveats == -The ~RedirectToPlugin invocation must be the first thing on a page. -For most purposes it makes any other content on the page inaccessible. +For most purposes, the ~RedirectToPlugin invocation makes any other content on the page inaccessible. == Example == -A page may be made a alias for the HomePage by placing this code at the top: +A page may be made a alias for the [[HomePage]] by using this code: {{{ <<RedirectTo page="HomePage">> }}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-09 12:01:01
|
Revision: 7631 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7631&view=rev Author: vargenau Date: 2010-08-09 12:00:55 +0000 (Mon, 09 Aug 2010) Log Message: ----------- Add info about "Redirected" message Modified Paths: -------------- trunk/pgsrc/Help%2FRedirectToPlugin Modified: trunk/pgsrc/Help%2FRedirectToPlugin =================================================================== --- trunk/pgsrc/Help%2FRedirectToPlugin 2010-08-09 11:54:20 UTC (rev 7630) +++ trunk/pgsrc/Help%2FRedirectToPlugin 2010-08-09 12:00:55 UTC (rev 7631) @@ -1,4 +1,4 @@ -Date: Wed, 19 May 2010 18:15:54 +0000 +Date: Mon, 9 Aug 2010 14:00:10 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -11,6 +11,10 @@ The **~RedirectTo** [[Help:WikiPlugin|plugin]] can be used to redirect a user to another page. In other words it makes a page an //alias// for another page. +When redirecting to another wiki page, a note is added to the top of the target +page saying //(Redirected from SomeRedirectingPage)//. + + == Arguments == Use only one of these arguments at a time. @@ -42,7 +46,7 @@ <<RedirectTo page="HomePage">> }}} -To see the example in action, visit HomePageAlias. +To see the example in action, visit [[HomePageAlias]]. <noinclude> ---- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-09 11:54:26
|
Revision: 7630 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7630&view=rev Author: vargenau Date: 2010-08-09 11:54:20 +0000 (Mon, 09 Aug 2010) Log Message: ----------- This is already done. Modified Paths: -------------- trunk/lib/plugin/RedirectTo.php Modified: trunk/lib/plugin/RedirectTo.php =================================================================== --- trunk/lib/plugin/RedirectTo.php 2010-07-20 17:45:40 UTC (rev 7629) +++ trunk/lib/plugin/RedirectTo.php 2010-08-09 11:54:20 UTC (rev 7630) @@ -35,11 +35,8 @@ * This plugin could probably result in a lot of confusion, especially when * redirecting to external sites. (Perhaps it can even be used for dastardly * purposes?) Maybe it should be disabled by default. - * - * It would be nice, when redirecting to another wiki page, to (as - * UseModWiki does) add a note to the top of the target page saying - * something like "(Redirected from SomeRedirectingPage)". */ + class WikiPlugin_RedirectTo extends WikiPlugin { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-07-20 17:45:46
|
Revision: 7629 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7629&view=rev Author: rurban Date: 2010-07-20 17:45:40 +0000 (Tue, 20 Jul 2010) Log Message: ----------- Marc-Etiennes list Modified Paths: -------------- trunk/TODO Modified: trunk/TODO =================================================================== --- trunk/TODO 2010-07-20 16:01:50 UTC (rev 7628) +++ trunk/TODO 2010-07-20 17:45:40 UTC (rev 7629) @@ -1,3 +1,17 @@ +== Blockers == +* can no longer save UserPreferences: Warning: "Attempt to assign property of non-object" +* AllPages give too many pages +* WantedPages give too many pages (from interwiki map) + (to be tested in both Pear and ADODB) + +== Others== +* Minimizer for JS/CSS +** no "make clean" in themes +** "make clean" does not work in themes with no Javascript +** in MonoBook, IEFixes.js cannot be minimized, yuicompressor-2.4.2 gives syntax errors +* plugin Video does not work + + short-term TODO: * rename should check existing subpages and rename these also. * Sidebar: merge AVL theme (internal MonoBook derivate with customizable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-20 16:01:56
|
Revision: 7628 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7628&view=rev Author: vargenau Date: 2010-07-20 16:01:50 +0000 (Tue, 20 Jul 2010) Log Message: ----------- Add "Help/Advice for Mediawiki users" Modified Paths: -------------- trunk/pgsrc/PhpWikiManual Modified: trunk/pgsrc/PhpWikiManual =================================================================== --- trunk/pgsrc/PhpWikiManual 2010-07-20 15:39:34 UTC (rev 7627) +++ trunk/pgsrc/PhpWikiManual 2010-07-20 16:01:50 UTC (rev 7628) @@ -1,4 +1,4 @@ -Date: Thu, 20 May 2010 14:16:02 +0000 +Date: Tue, 20 Jul 2010 18:01:30 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -29,4 +29,5 @@ <<IncludePage page="Help/SemanticRelations">> <<IncludePage page="Help/Spreadsheet">> <<IncludePage page="Help/PageList">> +<<IncludePage page="Help/Advice for Mediawiki users">> <<IncludePages pages=<!plugin-list BackLinks page=CategoryWikiPlugin sortby=pagename exclude="Template/*" !> >> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-20 15:39:41
|
Revision: 7627 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7627&view=rev Author: vargenau Date: 2010-07-20 15:39:34 +0000 (Tue, 20 Jul 2010) Log Message: ----------- Use table for arguments Modified Paths: -------------- trunk/pgsrc/Help%2FModeratedPagePlugin Modified: trunk/pgsrc/Help%2FModeratedPagePlugin =================================================================== --- trunk/pgsrc/Help%2FModeratedPagePlugin 2010-07-20 15:15:46 UTC (rev 7626) +++ trunk/pgsrc/Help%2FModeratedPagePlugin 2010-07-20 15:39:34 UTC (rev 7627) @@ -37,18 +37,31 @@ == Usage == {{{ -<<ModeratedPage>> +<<ModeratedPage arguments>> }}} == Arguments == -* moderators: comma seperated list of registered usernames or groups. - Each user should have his email defined in his prefs. Default: "Administrators" or -<<SystemInfo ADMIN_USER>> -* requirelevel: one of 0, 1, 2 or 10 on which moderation is used. Default: false (use requireaccess instead) -* requireaccess: comma separated list of access perms, on which the moderation is used - "view,edit,create,list,remove,change" - Default: edit,remove,change +{| class="bordered" +|- +! Argument +! Description +! Default value +|- +| **moderators** +| comma-separated list of registered usernames or groups. +Each user should have his email defined in his prefs. +| "Administrators" or "<<SystemInfo ADMIN_USER>>" +|- +| **requirelevel** +| one of 0, 1, 2 or 10 on which moderation is used +| false (use requireaccess instead) +|- +| **requireaccess** +| comma-separated list of access perms, on which the moderation is used +"view,edit,create,list,remove,change" +| edit,remove,change +|} == Example == This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-20 15:15:57
|
Revision: 7626 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7626&view=rev Author: vargenau Date: 2010-07-20 15:15:46 +0000 (Tue, 20 Jul 2010) Log Message: ----------- New help page: Help/Advice for Mediawiki users Added Paths: ----------- trunk/pgsrc/Help%2FAdvice%20for%20Mediawiki%20users Added: trunk/pgsrc/Help%2FAdvice%20for%20Mediawiki%20users =================================================================== --- trunk/pgsrc/Help%2FAdvice%20for%20Mediawiki%20users (rev 0) +++ trunk/pgsrc/Help%2FAdvice%20for%20Mediawiki%20users 2010-07-20 15:15:46 UTC (rev 7626) @@ -0,0 +1,32 @@ +Date: Thu, 15 Apr 2010 16:32:58 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) +X-Rcs-Id: $Id$ +Content-Type: application/x-phpwiki; + pagename=Help%2FAdvice%20Mediawiki%20users; + flags=PAGE_LOCKED%2CEXTERNAL_PAGE; + markup=2; + charset=UTF-8 +Content-Transfer-Encoding: binary + +If you contribute to Wikipedia or to other wikis that use the Mediawiki +software, you will notice some differences in the wiki syntax of Mediawiki +and the wiki syntax of Phpwiki. + +== Syntax differences == + +Here are some differences between Mediawiki and Phpwiki: +* Italics are ##//## (but you can also use ##''## like in Wikipedia) +* Bold is ##~*~*## (you //cannot use// ##'''## like in Wikipedia) +* There is **no automatic capitalisation** of first character of page name. Pages *<tt>~[~[foo~]~]</tt>* and *<tt>~[~[Foo~]~]</tt>* are different. +* A space in a page name in not equivalent to an underscore. Pages *<tt>~[~[foo bar~]~]</tt>* and *<tt>~[~[foo_bar~]~]</tt>* are different. We recommend to use a space in the page names. +* Many things that are built-in in Mediawiki use plug-ins in Phpwiki (table of contents, redirections, back links, etc.). +* Redirections are less sophisticated in Phpwiki (e.g. backlinks do not show redirected pages) + +== Tables == + +You can use in ACOS Forge the [[Help:MediawikiTablePlugin|Mediawiki table syntax]]. + +<noinclude> +---- +[[PhpWikiDocumentation]] +</noinclude> Property changes on: trunk/pgsrc/Help%2FAdvice%20for%20Mediawiki%20users ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-20 09:09:11
|
Revision: 7625 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7625&view=rev Author: vargenau Date: 2010-07-20 09:09:04 +0000 (Tue, 20 Jul 2010) Log Message: ----------- Create user page automagically (for Gforge) Modified Paths: -------------- trunk/lib/loadsave.php trunk/themes/gforge/templates/navbar.tmpl trunk/themes/gforge/themeinfo.php Added Paths: ----------- trunk/themes/gforge/pgsrc/CategoryWiki%20user Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2010-07-18 12:40:33 UTC (rev 7624) +++ trunk/lib/loadsave.php 2010-07-20 09:09:04 UTC (rev 7625) @@ -1532,7 +1532,7 @@ } else if (WIKI_NAME == "help") { $mandatory = explode(':','SandBox:Template/Category:TemplateTalk:SpecialPages:CategoryCategory:CategoryActionPage:Help/TextFormattingRules:PhpWikiAdministration'); } else { - $mandatory = explode(':','SandBox:Template/Category:TemplateTalk:SpecialPages:CategoryCategory:CategoryActionPage:TextFormattingRules:PhpWikiAdministration'); + $mandatory = explode(':','SandBox:Template/UserPage:Template/Category:TemplateTalk:SpecialPages:CategoryCategory:CategoryActionPage:TextFormattingRules:PhpWikiAdministration'); } foreach (array_merge($mandatory, $GLOBALS['AllActionPages'], Added: trunk/themes/gforge/pgsrc/CategoryWiki%20user =================================================================== --- trunk/themes/gforge/pgsrc/CategoryWiki%20user (rev 0) +++ trunk/themes/gforge/pgsrc/CategoryWiki%20user 2010-07-20 09:09:04 UTC (rev 7625) @@ -0,0 +1,16 @@ +Date: Thu, 15 Apr 2010 16:33:18 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) +X-Rcs-Id: $Id$ +Content-Type: application/x-phpwiki; + pagename=CategoryWiki%20user; + flags=EXTERNAL_PAGE; + markup=2; + charset=UTF-8 +Content-Transfer-Encoding: binary + +This Category lists **all users who have created their own user page** in this wiki. + +<<BackLinks info||=pagename,mtime sortby||=+pagename >> + +---- +[[CategoryCategory]] Property changes on: trunk/themes/gforge/pgsrc/CategoryWiki%20user ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/themes/gforge/templates/navbar.tmpl =================================================================== --- trunk/themes/gforge/templates/navbar.tmpl 2010-07-18 12:40:33 UTC (rev 7624) +++ trunk/themes/gforge/templates/navbar.tmpl 2010-07-20 09:09:04 UTC (rev 7625) @@ -3,6 +3,8 @@ ?> <?php $curuserprefs = $user->getPreferences(); +$dbh = $request->getDbh(); +$username = $user->UserName(); ?> <tr><td class="submenu"><?php echo WikiLink(_("HomePage"), "","Home Page") ?></td></tr> @@ -20,5 +22,8 @@ <tr><td class="submenu"><?php echo WikiLink(_("PhpWikiAdministration"), "","Wiki Admin") ?></td></tr> <?php } ?> <?php if (!empty($user) && $user->isSignedIn()) { ?> + <?php if ($dbh->isWikiPage($username)) { ?> + <tr><td class="submenu"><?php echo WikiLink($username, "","My User Page") ?></td></tr> + <?php } ?> <tr><td class="submenu"><?php echo WikiLink(_("UserPreferences"), "","User Preferences") ?></td></tr> <?php } ?> Modified: trunk/themes/gforge/themeinfo.php =================================================================== --- trunk/themes/gforge/themeinfo.php 2010-07-18 12:40:33 UTC (rev 7624) +++ trunk/themes/gforge/themeinfo.php 2010-07-20 09:09:04 UTC (rev 7625) @@ -137,6 +137,15 @@ $this->setDateFormat("%d %B %Y"); $this->setTimeFormat("%H:%M"); } + + /* Callback when a new user creates or edits a page */ + function CbNewUserEdit (&$request, $userid) { + $content = "{{Template/UserPage}}\n\n----\n[[CategoryWiki user]]"; + $dbi =& $request->_dbi; + $page = $dbi->getPage($userid); + $page->save($content, WIKIDB_FORCE_CREATE, array('author' => $userid)); + $dbi->touch(); + } } $WikiTheme = new WikiTheme_gforge('gforge'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-18 12:40:39
|
Revision: 7624 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7624&view=rev Author: vargenau Date: 2010-07-18 12:40:33 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Template/UserPage needed for Sidebar theme Added Paths: ----------- trunk/pgsrc/Template%2FUserPage Added: trunk/pgsrc/Template%2FUserPage =================================================================== --- trunk/pgsrc/Template%2FUserPage (rev 0) +++ trunk/pgsrc/Template%2FUserPage 2010-07-18 12:40:33 UTC (rev 7624) @@ -0,0 +1,13 @@ +Date: Sun, 18 Jul 2010 14:38:36 +0000 +Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) +X-Rcs-Id: $Id$ +Content-Type: application/x-phpwiki; + pagename=Template%2FUserPage; + flags=""; + markup=2; + charset=UTF-8 +Content-Transfer-Encoding: binary + +This is your user page. + +Please describe yourself and what you intend to contribute in this wiki. Property changes on: trunk/pgsrc/Template%2FUserPage ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-16 15:26:45
|
Revision: 7623 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7623&view=rev Author: vargenau Date: 2010-07-16 15:26:39 +0000 (Fri, 16 Jul 2010) Log Message: ----------- When upgrading, create pages as ADMIN_USER Modified Paths: -------------- trunk/lib/loadsave.php Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2010-07-16 14:25:17 UTC (rev 7622) +++ trunk/lib/loadsave.php 2010-07-16 15:26:39 UTC (rev 7623) @@ -3,7 +3,7 @@ /* Copyright 1999,2000,2001,2002,2004,2005,2006,2007 $ThePhpWikiProgrammingTeam - Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + Copyright 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent This file is part of PhpWiki. @@ -969,6 +969,8 @@ $current = $page->getCurrentRevision(); } if ($current->getVersion() == 0) { + $versiondata['author'] = ADMIN_USER; + $versiondata['author_id'] = ADMIN_USER; $mesg->pushContent(' - ', _("New page")); $isnew = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-16 14:25:24
|
Revision: 7622 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7622&view=rev Author: vargenau Date: 2010-07-16 14:25:17 +0000 (Fri, 16 Jul 2010) Log Message: ----------- Make upgrade work for subpages like PhpWikiAdministration/Chown Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2010-07-16 08:13:55 UTC (rev 7621) +++ trunk/lib/upgrade.php 2010-07-16 14:25:17 UTC (rev 7622) @@ -132,7 +132,7 @@ if (substr($filename,-1,1) == '~') continue; if (substr($filename,-5,5) == '.orig') continue; $pagename = urldecode($filename); - if (isActionPage($filename)) { + if (isActionPage($pagename)) { $translation = gettext($pagename); if ($translation == $pagename) $this->doPgsrcUpdate($pagename, $path, $filename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-16 08:14:14
|
Revision: 7621 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7621&view=rev Author: vargenau Date: 2010-07-16 08:13:55 +0000 (Fri, 16 Jul 2010) Log Message: ----------- Patch 3024787 by S?\195?\169bastien Le Callonnec: AllPages plugin not working for ?\226?\128?\156AllPages?\226?\128?\157 page Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/WikiDB/backend/ADODB.php trunk/lib/plugin/AllPages.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2010-07-16 08:01:14 UTC (rev 7620) +++ trunk/lib/PageList.php 2010-07-16 08:13:55 UTC (rev 7621) @@ -90,16 +90,12 @@ $this->_heading = $default_heading; if ($align) { - // align="char" isn't supported by any browsers yet :( - //if (is_array($align)) - // $this->_tdattr = $align; - //else $this->_tdattr['align'] = $align; } } function format ($pagelist, $page_handle, &$revision_handle) { - $nbsp = HTML::raw(' '); + $nbsp = HTML::raw(' '); return HTML::td($this->_tdattr, $nbsp, $this->_getValue($page_handle, $revision_handle), @@ -116,7 +112,7 @@ // old-style heading function heading () { - global $request; + global $request; $nbsp = HTML::raw(' '); // allow sorting? if (1 /* or in_array($this->_field, PageList::sortable_columns())*/) { @@ -157,8 +153,8 @@ $src = $WikiTheme->getButtonURL($desc ? 'asc_order' : 'desc_order'); $reverse = $desc ? _("reverse")." " : ""; } else { - // initially unsorted - $sortby = $pagelist->sortby($colNum, 'get'); + // initially unsorted + $sortby = $pagelist->sortby($colNum, 'get'); } if (!$src) { $img = $noimg; @@ -252,7 +248,7 @@ */ class _PageList_Column_custom extends _PageList_Column { function _PageList_Column_custom($params) { - $this->_pagelist =& $params[3]; + $this->_pagelist =& $params[3]; $this->_PageList_Column($params[0], $params[1], $params[2]); } } @@ -281,8 +277,8 @@ function _getSortableValue ($page_handle, &$revision_handle) { if (!$revision_handle) $revision_handle = $page_handle->getCurrentRevision(true); - return (empty($revision_handle->_data['%content'])) - ? 0 : strlen($revision_handle->_data['%content']); + return (empty($revision_handle->_data['%content'])) + ? 0 : strlen($revision_handle->_data['%content']); } function _getSize($revision_handle) { @@ -300,7 +296,7 @@ } function _getValue ($page_handle, &$revision_handle) { - //FIXME: check if $this is available in the parent (->need_rev) + //FIXME: check if $this is available in the parent (->need_rev) $val = _PageList_Column::_getValue($page_handle, $revision_handle); return $val ? $this->_textIfTrue : $this->_textIfFalse; } @@ -402,23 +398,20 @@ or $revision_handle->_data['%content'] === true)) { $revision_handle = $page_handle->getCurrentRevision(true); } - //if (!empty($pagelist->_sortby) and empty($pagelist->_sortby[$this->_field])) - // unset($revision_handle->_data['%content']); + if ($this->_field == 'hi_content') { if (!empty($revision_handle->_data['%pagedata'])) { $revision_handle->_data['%pagedata']['_cached_html'] = ''; - // PHP Fatal error: Cannot unset string offsets - //unset($revision_handle->_data['%pagedata']['_cached_html']); } $search = $this->search; $score = ''; if (is_object($page_handle) and !empty($page_handle->score)) - $score = $page_handle->score; - elseif (is_array($page_handle) and !empty($page_handle['score'])) - $score = $page_handle['score']; - - $hilight_re = $this->hilight_re; - // use the TextSearchQuery highlighter + $score = $page_handle->score; + elseif (is_array($page_handle) and !empty($page_handle['score'])) + $score = $page_handle['score']; + + $hilight_re = $this->hilight_re; + // use the TextSearchQuery highlighter if ($search and $hilight_re) { $matches = preg_grep("/$hilight_re/i", $revision_handle->getContent()); $html = array(); @@ -431,8 +424,8 @@ return $html; } // Remove special characters so that highlighting works - $search = preg_replace('/^[\^\*]/', '', $search); - $search = preg_replace('/[\^\*]$/', '', $search); + $search = preg_replace('/^[\^\*]/', '', $search); + $search = preg_replace('/[\^\*]$/', '', $search); $c =& $revision_handle->getPackedContent(); if ($search and ($i = strpos(strtolower($c), strtolower($search))) !== false) { $l = strlen($search); @@ -448,8 +441,8 @@ .($score ? sprintf("[%0.1f]",$score):"")))); } else { if (strpos($c," ") !== false) - $c = ""; - else + $c = ""; + else $c = sprintf(_("%s not found"), '»'.$search.'«'); return HTML::div(array('style' => 'font-size:x-small','align'=>'center'), $c." ".($score ? sprintf("[%0.1f]",$score):"")); @@ -468,16 +461,18 @@ ($this->parent->_columns_seen['size'] or !$len) ? "" : ByteFormatter($len, /*$longformat = */true)); } + function _getSortableValue ($page_handle, &$revision_handle) { - if (is_object($page_handle) and !empty($page_handle->score)) - return $page_handle->score; - elseif (is_array($page_handle) and !empty($page_handle['score'])) - return $page_handle['score']; - else - return substr(_PageList_Column::_getValue($page_handle, $revision_handle),0,50); + if (is_object($page_handle) and !empty($page_handle->score)) + return $page_handle->score; + elseif (is_array($page_handle) and !empty($page_handle['score'])) + return $page_handle['score']; + else + return substr(_PageList_Column::_getValue($page_handle, $revision_handle),0,50); } }; + class _PageList_Column_author extends _PageList_Column { function _PageList_Column_author ($field, $default_heading, $align = false) { _PageList_Column::_PageList_Column($field, $default_heading, $align); @@ -540,7 +535,7 @@ } function _getSortableValue ($page_handle, &$revision_handle) { - return $page_handle->getName(); + return $page_handle->getName(); } /** @@ -566,14 +561,14 @@ var $_maxlen = 0; function PageList ($columns = false, $exclude = false, $options = false) { - // unique id per pagelist on each page. - if (!isset($GLOBALS['request']->_pagelist)) - $GLOBALS['request']->_pagelist = 0; - else - $GLOBALS['request']->_pagelist++; - $this->id = $GLOBALS['request']->_pagelist; - if ($GLOBALS['request']->getArg('count')) - $options['count'] = $GLOBALS['request']->getArg('count'); + // unique id per pagelist on each page. + if (!isset($GLOBALS['request']->_pagelist)) + $GLOBALS['request']->_pagelist = 0; + else + $GLOBALS['request']->_pagelist++; + $this->id = $GLOBALS['request']->_pagelist; + if ($GLOBALS['request']->getArg('count')) + $options['count'] = $GLOBALS['request']->getArg('count'); if ($options) $this->_options = $options; @@ -587,9 +582,9 @@ 'most' => array('pagename','mtime','author','hits'), 'some' => array('pagename','mtime','author') ); - if (isset($this->_options['listtype']) - and $this->_options['listtype'] == 'dl') - $this->_options['nopage'] = 1; + if (isset($this->_options['listtype']) + and $this->_options['listtype'] == 'dl') + $this->_options['nopage'] = 1; if ($columns) { if (!is_array($columns)) $columns = explode(',', $columns); @@ -603,18 +598,18 @@ if (empty($this->_options['nopage']) and !in_array('pagename',$columns)) $this->_addColumn('pagename'); foreach ($columns as $col) { - if (!empty($col)) - $this->_addColumn($col); + if (!empty($col)) + $this->_addColumn($col); } unset($col); } // If 'pagename' is already present, _addColumn() will not add it again - if (empty($this->_options['nopage'])) - $this->_addColumn('pagename'); + if (empty($this->_options['nopage'])) + $this->_addColumn('pagename'); - if (!empty($this->_options['types'])) { + if (!empty($this->_options['types'])) { foreach ($this->_options['types'] as $type) { - $this->_types[$type->_field] = $type; + $this->_types[$type->_field] = $type; $this->_addColumn($type->_field); } unset($this->_options['types']); @@ -631,32 +626,32 @@ $this->_options['sortby'] = $request->getArg('sortby'); } // plugin options if (!empty($options['sortby'])) { - if (empty($this->_options['sortby'])) - $this->_options['sortby'] = $options['sortby']; + if (empty($this->_options['sortby'])) + $this->_options['sortby'] = $options['sortby']; $this->sortby($options['sortby'], 'init'); - } // global options - if (!isset($request->args["id"]) and $request->getArg('sortby') - and empty($this->_options['sortby'])) - { - $this->_options['sortby'] = $request->getArg('sortby'); + } // global options + if (!isset($request->args["id"]) and $request->getArg('sortby') + and empty($this->_options['sortby'])) + { + $this->_options['sortby'] = $request->getArg('sortby'); $this->sortby($this->_options['sortby'], 'init'); - } - // same as above but without the special sortby push, and mutually exclusive (elseif) + } + // same as above but without the special sortby push, and mutually exclusive (elseif) foreach ($this->pagingArgs() as $key) { - if ($key == 'sortby') continue; + if ($key == 'sortby') continue; if (($this->id == $request->getArg("id")) and $request->getArg($key)) { $this->_options[$key] = $request->getArg($key); } // plugin options elseif (!empty($options) and !empty($options[$key])) { - $this->_options[$key] = $options[$key]; - } // global options - elseif (!isset($request->args["id"]) and $request->getArg($key)) { - $this->_options[$key] = $request->getArg($key); - } - else - $this->_options[$key] = false; + $this->_options[$key] = $options[$key]; + } // global options + elseif (!isset($request->args["id"]) and $request->getArg($key)) { + $this->_options[$key] = $request->getArg($key); + } + else + $this->_options[$key] = false; } if ($exclude) { if (is_string($exclude) and !is_array($exclude)) @@ -678,7 +673,7 @@ /* what columns, what pages */ 'info' => 'pagename', 'exclude' => '', // also wildcards, comma-seperated lists - // and <!plugin-list !> arrays + // and <!plugin-list !> arrays /* select pages by meta-data: */ 'author' => false, // current user by [] 'owner' => false, // current user by [] @@ -686,17 +681,17 @@ /* for the sort buttons in <th> */ 'sortby' => '', // same as for WikiDB::getAllPages - // (unsorted is faster) + // (unsorted is faster) /* PageList pager options: * These options may also be given to _generate(List|Table) later * But limit and offset might help the query WikiDB::getAllPages() */ 'limit' => 50, // number of rows (pagesize) - 'paging' => 'auto', // 'auto' top + bottom rows if applicable - // // 'top' top only if applicable - // // 'bottom' bottom only if applicable - // // 'none' don't page at all + 'paging' => 'auto', // 'auto' top + bottom rows if applicable + // // 'top' top only if applicable + // // 'bottom' bottom only if applicable + // // 'none' don't page at all // (TODO: clarify what if $paging==false ?) /* list-style options (with single pagename column only so far) */ @@ -704,30 +699,35 @@ 'azhead' => 0, // 1: group by initials // 2: provide shortcut links to initials also 'comma' => 0, // condensed comma-seperated list, - // 1 if without links, 2 if with + // 1 if without links, 2 if with 'commasep' => false, // Default: ', ' 'listtype' => '', // ul (default), ol, dl, comma 'ordered' => false, // OL or just UL lists (ignored for comma) - 'linkmore' => '', // If count>0 and limit>0 display a link with - // the number of all results, linked to the given pagename. - - 'nopage' => false, // for info=col omit the pagename column - // array_keys($this->_types). filter by columns: e.g. locked=1 - 'pagename' => null, // string regex - 'locked' => null, - 'minor' => null, - 'mtime' => null, - 'hits' => null, - 'size' => null, - 'version' => null, - 'markup' => null, - 'external' => null, + 'linkmore' => '', // If count>0 and limit>0 display a link with + // the number of all results, linked to the given pagename. + + 'nopage' => false, // for info=col omit the pagename column + // array_keys($this->_types). filter by columns: e.g. locked=1 + 'pagename' => null, // string regex + 'locked' => null, + 'minor' => null, + 'mtime' => null, + 'hits' => null, + 'size' => null, + 'version' => null, + 'markup' => null, + 'external' => null, ); } function pagingArgs() { - return array('sortby','limit','paging','count','dosort'); + return array('sortby','limit','paging','count','dosort'); } + + function clearArg($arg_name) { + if (isset($this->_options[$arg_name])) + unset($this->_options[$arg_name]); + } /** * @param caption string or HTML @@ -756,8 +756,8 @@ function getTotal () { - return !empty($this->_options['count']) - ? (integer) $this->_options['count'] : count($this->_pages); + return !empty($this->_options['count']) + ? (integer) $this->_options['count'] : count($this->_pages); } function isEmpty () { @@ -765,7 +765,7 @@ } function addPage($page_handle) { - if (!empty($this->_excluded_pages)) { + if (!empty($this->_excluded_pages)) { if (!in_array((is_string($page_handle) ? $page_handle : $page_handle->getName()), $this->_excluded_pages)) $this->_pages[] = $page_handle; @@ -776,11 +776,11 @@ function pageNames() { $pages = array(); - $limit = @$this->_options['limit']; + $limit = @$this->_options['limit']; foreach ($this->_pages as $page_handle) { $pages[] = $page_handle->getName(); - if ($limit and count($pages) > $limit) - break; + if ($limit and count($pages) > $limit) + break; } return $pages; } @@ -788,7 +788,6 @@ function _getPageFromHandle($page_handle) { if (is_string($page_handle)) { if (empty($page_handle)) return $page_handle; - //$dbi = $GLOBALS['request']->getDbh(); // no, safe some memory! $page_handle = $GLOBALS['request']->_dbi->getPage($page_handle); } return $page_handle; @@ -824,15 +823,15 @@ $row = HTML::tr(array('class' => $class)); $j = 0; foreach ($this->_columns as $col) { - $col->current_row = $i; - $col->current_column = $j; + $col->current_row = $i; + $col->current_column = $j; $row->pushContent($col->format($this, $page_handle, $revision_handle)); $j++; } } else { $col = $this->_columns[0]; - $col->current_row = $i; - $col->current_column = 0; + $col->current_row = $i; + $col->current_column = 0; $row = $col->_getValue($page_handle, $revision_handle); } @@ -918,8 +917,7 @@ if ($this->isEmpty()) return $this->_emptyList($caption); elseif (isset($this->_options['listtype']) - and in_array($this->_options['listtype'], - array('ol','ul','comma','dl'))) + and in_array($this->_options['listtype'], array('ol','ul','comma','dl'))) return $this->_generateList($caption); elseif (count($this->_columns) == 1) return $this->_generateList($caption); @@ -954,9 +952,8 @@ if (empty($column)) return ''; if (is_int($column)) { $column = $this->_columns[$column - 1]->_field; - //$column = $col->_field; } - //if (!is_string($column)) return ''; + // support multiple comma-delimited sortby args: "+hits,+pagename" // recursive concat if (strstr($column, ',')) { @@ -994,13 +991,12 @@ return $order . $column; } elseif ($action == 'flip_order') { if (0 and DEBUG) - trigger_error("flip $order $column ".$this->id, E_USER_NOTICE); + trigger_error("flip $order $column ".$this->id, E_USER_NOTICE); return ($order == '+' ? '-' : '+') . $column; } elseif ($action == 'init') { // only allowed from PageList::PageList if (0 and DEBUG) { if ($this->sortby($column, 'clicked')) { - trigger_error("clicked $order $column $this->id", E_USER_NOTICE); - //$order = ($order == '+' ? '-' : '+'); // $this->sortby($sortby, 'flip_order'); + trigger_error("clicked $order $column $this->id", E_USER_NOTICE); } } $this->_sortby[$column] = $order; // forces show icon @@ -1011,7 +1007,7 @@ if (0 and $show and DEBUG) { trigger_error("show $order $column ".$this->id, E_USER_NOTICE); } - return $show; + return $show; } elseif ($action == 'clicked') { // flip sort order? global $request; $arg = $request->getArg('sortby'); @@ -1058,15 +1054,6 @@ $pages[] = trim($pagehandle->getName()); } return $pages; - /* - //TODO: need an SQL optimization here - $allPagehandles = $dbi->getAllPages($include_empty, $sortby, $limit, - $exclude); - while ($pagehandle = $allPagehandles->next()) { - $allPages[] = $pagehandle->getName(); - } - return explodeList($input, $allPages); - */ } else { //TODO: do the sorting, normally not needed if used for exclude only return array_map("trim", explode(',', $input)); @@ -1279,10 +1266,9 @@ * @return true if column is added, false otherwise */ function _addColumn ($column) { - if (isset($this->_columns_seen[$column])) return false; // Already have this one. - if (!isset($this->_types[$column])) + if (!isset($this->_types[$column])) $this->_initAvailableColumns(); $this->_columns_seen[$column] = true; @@ -1295,7 +1281,6 @@ $silently_ignore = array('numbacklinks', 'rating','ratingvalue', 'coagreement', 'minmisery', - /*'prediction',*/ 'averagerating', 'top3recs', 'relation', 'linkto'); if (!in_array($column, $silently_ignore)) @@ -1321,8 +1306,8 @@ * @param $col object An object derived from _PageList_Column. **/ function addColumnObject($col) { - if (is_array($col)) {// custom column object - $params =& $col; + if (is_array($col)) {// custom column object + $params =& $col; $class_name = array_shift($params); $params[3] =& $this; $col = new $class_name($params); @@ -1349,7 +1334,7 @@ $pageb = $this->_getPageFromHandle($b); // If a string, convert to page assert(isa($pageb, 'WikiDB_Page')); foreach ($this->_sortby as $colNum => $direction) { - // get column type object + // get column type object if (!is_int($colNum)) { // or column fieldname if (isset($this->_columnsMap[$colNum])) $col = $this->_columns[$this->_columnsMap[$colNum] - 1]; @@ -1391,15 +1376,14 @@ $need_sort = true; } if ($need_sort) { // There are some columns to sort by - // TODO: consider nopage + // TODO: consider nopage usort($this->_pages, array($this, '_pageCompare')); } } - //unset($GLOBALS['PhpWiki_pagelist']); } function limit($limit) { - if (is_array($limit)) { + if (is_array($limit)) { list($from, $count) = $limit; if ((!empty($from) && !is_numeric($from)) or (!empty($count) && !is_numeric($count))) { return $this->error(_("Illegal 'limit' argument: must be numeric")); @@ -1485,9 +1469,9 @@ $i = 0; $count = $this->getTotal(); $do_paging = ( isset($this->_options['paging']) - and !empty($this->_options['limit']) - and $count - and $this->_options['paging'] != 'none' ); + and !empty($this->_options['limit']) + and $count + and $this->_options['paging'] != 'none' ); if ($do_paging) { $tokens = $this->pagingTokens($count, count($this->_columns), @@ -1503,11 +1487,10 @@ 'cellspacing' => 1, 'border' => 0, 'width' => '100%', - 'class' => 'pagelist', - )); + 'class' => 'pagelist')); if ($caption) { $table->pushContent(HTML::caption(array('align'=>'top'), $caption)); - } + } $row = HTML::tr(); $table_summary = array(); @@ -1518,7 +1501,6 @@ and isset($col->_field) and $col->_field == 'pagename' and ($maxlen = $this->maxLen())) { - // $heading->setAttr('width', $maxlen * 7); } $row->pushContent($heading); if (is_string($col->getHeading())) @@ -1562,8 +1544,8 @@ $this->_stack->push($stack); } function _restoreOptions() { - assert($this->_stack); - $stack = $this->_stack->pop(); + assert($this->_stack); + $stack = $this->_stack->pop(); $this->_pages = $stack['pages']; unset($stack['pages']); foreach ($stack as $k => $v) { @@ -1577,27 +1559,28 @@ // 'comma' - condensed comma-list only, 1: no links, >1: with links // FIXME: only unique list entries, esp. with nopage function _generateList($caption='') { - if (empty($this->_pages)) return; // stop recursion - if (!isset($this->_options['listtype'])) - $this->_options['listtype'] = ''; - foreach ($this->_pages as $pagenum => $page) { - $one_row = $this->_renderPageRow($page); + if (empty($this->_pages)) return; // stop recursion + if (!isset($this->_options['listtype'])) + $this->_options['listtype'] = ''; + foreach ($this->_pages as $pagenum => $page) { + $one_row = $this->_renderPageRow($page); $rows[] = array('header' => WikiLink($page), 'render' => $one_row); - } + } $out = HTML(); if ($caption) { $out->pushContent(HTML::p($caption)); } - // Semantic Search et al: only unique list entries, esp. with nopage - if (!is_array($this->_pages[0]) and is_string($this->_pages[0])) { - $this->_pages = array_unique($this->_pages); - } + + // Semantic Search et al: only unique list entries, esp. with nopage + if (!is_array($this->_pages[0]) and is_string($this->_pages[0])) { + $this->_pages = array_unique($this->_pages); + } if (count($this->_sortby) > 0) $this->_sortPages(); - $count = $this->getTotal(); + $count = $this->getTotal(); $do_paging = ( isset($this->_options['paging']) - and !empty($this->_options['limit']) - and $count - and $this->_options['paging'] != 'none' ); + and !empty($this->_options['limit']) + and $count + and $this->_options['paging'] != 'none' ); if ( $do_paging ) { $tokens = $this->pagingTokens($count, count($this->_columns), @@ -1632,8 +1615,7 @@ } // speed up table rendering by defining colgroups $out->pushContent(HTML::table(HTML::colgroup - (array('span' => $this->_options['cols'], - 'width' => $width)), + (array('span' => $this->_options['cols'], 'width' => $width)), $cols)); return $out; } @@ -1668,7 +1650,7 @@ } return $out; } - + if ($this->_options['listtype'] == 'comma') $this->_options['comma'] = 2; if (!empty($this->_options['comma'])) { @@ -1686,29 +1668,28 @@ } elseif ($this->_options['listtype'] == 'ul') $this->_options['ordered'] = 0; if ($this->_options['listtype'] == 'ol' and !empty($this->_options['ordered'])) { - $list = HTML::ol(array('class' => 'pagelist', - 'start' => $this->_options['ordered'])); + $list = HTML::ol(array('class' => 'pagelist', + 'start' => $this->_options['ordered'])); } elseif ($this->_options['listtype'] == 'dl') { $list = HTML::dl(array('class' => 'pagelist')); - } else { + } else { $list = HTML::ul(array('class' => 'pagelist')); - } + } $i = 0; //TODO: currently we ignore limit here and hope that the backend didn't ignore it. (BackLinks) if (!empty($this->_options['limit'])) list($offset, $pagesize) = $this->limit($this->_options['limit']); - else - $pagesize=0; - foreach (array_reverse($rows) as $one_row) { - $pagehtml = $one_row['render']; + else + $pagesize=0; + foreach (array_reverse($rows) as $one_row) { + $pagehtml = $one_row['render']; if (!$pagehtml) continue; $group = ($i++ / $this->_group_rows); //TODO: here we switch every row, in tables every third. // unification or parametrized? $class = ($group % 2) ? 'oddrow' : 'evenrow'; if ($this->_options['listtype'] == 'dl') { - $header = $one_row['header']; - //if ($this->_sortby['hi_content']) + $header = $one_row['header']; $list->pushContent(HTML::dt(array('class' => $class), $header), HTML::dd(array('class' => $class), $pagehtml)); } else @@ -1727,15 +1708,15 @@ // Alternative $seperator = HTML::Raw(' · ') // FIXME: only unique list entries, esp. with nopage function _generateCommaListAsString() { - if (defined($this->_options['commasep'])) - $seperator = $this->_options['commasep']; - else - $seperator = ', '; - $pages = array(); - foreach ($this->_pages as $pagenum => $page) { - if ($s = $this->_renderPageRow($page)) // some pages are not viewable - $pages[] = is_string($s) ? $s : $s->asString(); - } + if (defined($this->_options['commasep'])) + $seperator = $this->_options['commasep']; + else + $seperator = ', '; + $pages = array(); + foreach ($this->_pages as $pagenum => $page) { + if ($s = $this->_renderPageRow($page)) // some pages are not viewable + $pages[] = is_string($s) ? $s : $s->asString(); + } return HTML(join($seperator, $pages)); } @@ -1745,17 +1726,17 @@ // 2 and more => HTML link specialization? // FIXME: only unique list entries, esp. with nopage function _generateCommaList($style = false) { - if (defined($this->_options['commasep'])) - $seperator = HTLM::Raw($this->_options['commasep']); - else - $seperator = ', '; - $html = HTML(); + if (defined($this->_options['commasep'])) + $seperator = HTLM::Raw($this->_options['commasep']); + else + $seperator = ', '; + $html = HTML(); $html->pushContent($this->_renderPageRow($this->_pages[0])); next($this->_pages); - foreach ($this->_pages as $pagenum => $page) { - if ($s = $this->_renderPageRow($page)) // some pages are not viewable + foreach ($this->_pages as $pagenum => $page) { + if ($s = $this->_renderPageRow($page)) // some pages are not viewable $html->pushContent($seperator, $s); - } + } return $html; } Modified: trunk/lib/WikiDB/backend/ADODB.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB.php 2010-07-16 08:01:14 UTC (rev 7620) +++ trunk/lib/WikiDB/backend/ADODB.php 2010-07-16 08:13:55 UTC (rev 7621) @@ -828,10 +828,13 @@ extract($this->_table_names); $orderby = $this->sortby($sortby, 'db'); if ($orderby) $orderby = ' ORDER BY ' . $orderby; - if ($exclude) // array of pagenames - $exclude = " AND $page_tbl.pagename NOT IN ".$this->_sql_set($exclude); - else + $and = ''; + if ($exclude) {// array of pagenames + $and = ' AND '; + $exclude = " $page_tbl.pagename NOT IN ".$this->_sql_set($exclude); + } else { $exclude=''; + } //$dbh->SetFetchMode(ADODB_FETCH_ASSOC); if (strstr($orderby, 'mtime ')) { // was ' mtime' @@ -841,7 +844,7 @@ ." FROM $page_tbl, $recent_tbl, $version_tbl" . " WHERE $page_tbl.id=$recent_tbl.id" . " AND $page_tbl.id=$version_tbl.id AND latestversion=version" - . $exclude + . " $and$exclude" . $orderby; } else { @@ -851,7 +854,7 @@ . " WHERE $nonempty_tbl.id=$page_tbl.id" . " AND $page_tbl.id=$recent_tbl.id" . " AND $page_tbl.id=$version_tbl.id AND latestversion=version" - . $exclude + . " $and$exclude" . $orderby; } } else { @@ -866,7 +869,7 @@ . $this->page_tbl_fields . " FROM $nonempty_tbl, $page_tbl" . " WHERE $nonempty_tbl.id=$page_tbl.id" - . $exclude + . " $and$exclude" . $orderby; } } Modified: trunk/lib/plugin/AllPages.php =================================================================== --- trunk/lib/plugin/AllPages.php 2010-07-16 08:01:14 UTC (rev 7620) +++ trunk/lib/plugin/AllPages.php 2010-07-16 08:13:55 UTC (rev 7621) @@ -67,17 +67,18 @@ $timer = new DebugTimer; } $caption = _("All pages in this wiki (%d total):"); + $exclude_empty_pagename = array(''); if ( !empty($args['userpages']) ) { $pages = PageList::allUserPages($args['include_empty'], - $args['sortby'], '' - ); + $args['sortby'], '', + $exclude_empty_pagename); $caption = _("List of user-created pages (%d total):"); $args['count'] = $request->getArg('count'); } elseif ( !empty($args['owner']) ) { $pages = PageList::allPagesByOwner($args['owner'], $args['include_empty'], - $args['sortby'], '' - ); + $args['sortby'], '', + $exclude_empty_pagename); $args['count'] = $request->getArg('count'); if (!$args['count']) $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']); @@ -89,8 +90,8 @@ $pages->_options['count'] = $args['count']; } elseif ( !empty($args['author']) ) { $pages = PageList::allPagesByAuthor($args['author'], $args['include_empty'], - $args['sortby'], '' - ); + $args['sortby'], '', + $exclude_empty_pagename); $args['count'] = $request->getArg('count'); if (!$args['count']) $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']); @@ -102,7 +103,8 @@ $pages->_options['count'] = $args['count']; } elseif ( !empty($args['creator']) ) { $pages = PageList::allPagesByCreator($args['creator'], $args['include_empty'], - $args['sortby'], '' + $args['sortby'], '', + $exclude_empty_pagename ); $args['count'] = $request->getArg('count'); if (!$args['count']) @@ -113,8 +115,6 @@ : $args['creator'], 'if_known'), $args['count']); $pages->_options['count'] = $args['count']; - //} elseif ($pages) { - // $args['count'] = count($pages); } else { if (! $request->getArg('count')) $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']); @@ -126,15 +126,17 @@ $pagelist = new PageList($args['info'], $args['exclude'], $args); if (!$args['noheader']) $pagelist->setCaption($caption); - // deleted pages show up as version 0. - //if ($args['include_empty']) - // $pagelist->_addColumn('version'); - - if ($pages !== false) + if ($pages !== false) { $pagelist->addPageList($pages); - else - $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'], - $args['limit']) ); + } + else { + // Clear count as previous value was for non-empty pages. + $pagelist->clearArg('count'); + $pagelist->addPages($dbi->getAllPages($args['include_empty'], + $args['sortby'], + $args['limit'], + $exclude_empty_pagename)); + } if (DEBUG && $args['debug']) { return HTML($pagelist, HTML::p(fmt("Elapsed time: %s s", $timer->getStats()))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-16 08:01:20
|
Revision: 7620 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7620&view=rev Author: vargenau Date: 2010-07-16 08:01:14 +0000 (Fri, 16 Jul 2010) Log Message: ----------- Valid XHTML Modified Paths: -------------- trunk/themes/MonoBook/templates/viewsource.tmpl Modified: trunk/themes/MonoBook/templates/viewsource.tmpl =================================================================== --- trunk/themes/MonoBook/templates/viewsource.tmpl 2010-07-16 07:16:29 UTC (rev 7619) +++ trunk/themes/MonoBook/templates/viewsource.tmpl 2010-07-16 08:01:14 UTC (rev 7620) @@ -19,7 +19,6 @@ name="content" rows="<?php echo $request->getPref('editHeight')?>" cols="<?php echo $request->getPref('editWidth')?>" -readonly="readonly" -wrap="virtual"><?php echo $PAGE_SOURCE ?></textarea> +readonly="readonly"><?php echo $PAGE_SOURCE ?></textarea> <?php echo $HIDDEN_INPUTS?> </form> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-16 07:16:35
|
Revision: 7619 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7619&view=rev Author: vargenau Date: 2010-07-16 07:16:29 +0000 (Fri, 16 Jul 2010) Log Message: ----------- Patch 3024802 by S?\195?\169bastien Le Callonnec: Error : sortables_init is not defined Modified Paths: -------------- trunk/lib/WikiTheme.php Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2010-07-16 06:59:16 UTC (rev 7618) +++ trunk/lib/WikiTheme.php 2010-07-16 07:16:29 UTC (rev 7619) @@ -223,8 +223,8 @@ return; } $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("wikicommon.js")))); - if (DEBUG and !GFORGE) { - // Gforge and non-debug already load this + if (!GFORGE) { + // Gforge already loads this $this->addMoreHeaders(JavaScript('',array('src' => $this->_findData("sortable.js")))); } // by pixels This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-16 06:59:22
|
Revision: 7618 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7618&view=rev Author: vargenau Date: 2010-07-16 06:59:16 +0000 (Fri, 16 Jul 2010) Log Message: ----------- Patch 3022476 by S?\195?\169bastien Le Callonnec: Broken HTML when uploading pages Modified Paths: -------------- trunk/themes/Crao/templates/head.tmpl trunk/themes/default/templates/head.tmpl trunk/themes/wikilens/templates/head.tmpl Modified: trunk/themes/Crao/templates/head.tmpl =================================================================== --- trunk/themes/Crao/templates/head.tmpl 2010-07-15 19:22:14 UTC (rev 7617) +++ trunk/themes/Crao/templates/head.tmpl 2010-07-16 06:59:16 UTC (rev 7618) @@ -110,7 +110,7 @@ $pagetitle = " - ". AsString($TITLE); ?> <title><?php echo WIKI_NAME.$pagetitle?></title> -<meta property="og:title" content="<?php echo $TITLE ?>"/> +<meta property="og:title" content="<?php echo strip_tags($TITLE) ?>"/> <meta property="og:site_name" content="<?php echo WIKI_NAME ?>"/> <?php echo $WikiTheme->getMoreHeaders() ?> </head> Modified: trunk/themes/default/templates/head.tmpl =================================================================== --- trunk/themes/default/templates/head.tmpl 2010-07-15 19:22:14 UTC (rev 7617) +++ trunk/themes/default/templates/head.tmpl 2010-07-16 06:59:16 UTC (rev 7618) @@ -117,7 +117,7 @@ $pagetitle = " - ". AsString($TITLE); ?> <title><?php echo WIKI_NAME.$pagetitle ?></title> -<meta property="og:title" content="<?php echo $TITLE ?>"/> +<meta property="og:title" content="<?php echo strip_tags($TITLE) ?>"/> <meta property="og:site_name" content="<?php echo WIKI_NAME ?>"/> <?php echo $WikiTheme->getMoreHeaders() ?> </head> Modified: trunk/themes/wikilens/templates/head.tmpl =================================================================== --- trunk/themes/wikilens/templates/head.tmpl 2010-07-15 19:22:14 UTC (rev 7617) +++ trunk/themes/wikilens/templates/head.tmpl 2010-07-16 06:59:16 UTC (rev 7618) @@ -110,7 +110,7 @@ $pagetitle = " - ". AsString($TITLE); ?> <title><?php echo WIKI_NAME.$pagetitle ?></title> -<meta property="og:title" content="<?php echo $TITLE ?>"/> +<meta property="og:title" content="<?php echo strip_tags($TITLE) ?>"/> <meta property="og:site_name" content="<?php echo WIKI_NAME ?>"/> <?php require_once("lib/plugin/RateIt.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-07-15 19:22:20
|
Revision: 7617 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7617&view=rev Author: vargenau Date: 2010-07-15 19:22:14 +0000 (Thu, 15 Jul 2010) Log Message: ----------- Protect set_magic_quotes_runtime with PHP version Modified Paths: -------------- trunk/lib/fpdf/chinese.php trunk/lib/fpdf/japanese.php trunk/lib/fpdf.php trunk/lib/nusoap/nusoap.php Modified: trunk/lib/fpdf/chinese.php =================================================================== --- trunk/lib/fpdf/chinese.php 2010-07-15 19:09:00 UTC (rev 7616) +++ trunk/lib/fpdf/chinese.php 2010-07-15 19:22:14 UTC (rev 7617) @@ -322,8 +322,11 @@ $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); $this->_out('endobj'); } - $mqr=get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + + if (!check_php_version(5,3)) { + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + } foreach($this->FontFiles as $file=>$info) { //Font file embedding @@ -346,7 +349,9 @@ fclose($f); $this->_out('endobj'); } - set_magic_quotes_runtime($mqr); + if (!check_php_version(5,3)) { + set_magic_quotes_runtime($mqr); + } foreach($this->fonts as $k=>$font) { //Font objects @@ -456,4 +461,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/fpdf/japanese.php =================================================================== --- trunk/lib/fpdf/japanese.php 2010-07-15 19:09:00 UTC (rev 7616) +++ trunk/lib/fpdf/japanese.php 2010-07-15 19:22:14 UTC (rev 7617) @@ -302,8 +302,10 @@ $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); $this->_out('endobj'); } - $mqr=get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + if (!check_php_version(5,3)) { + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + } foreach($this->FontFiles as $file=>$info) { //Font file embedding $this->_newobj(); @@ -325,7 +327,9 @@ fclose($f); $this->_out('endobj'); } - set_magic_quotes_runtime($mqr); + if (!check_php_version(5,3)) { + set_magic_quotes_runtime($mqr); + } foreach($this->fonts as $k=>$font) { //Font objects $this->_newobj(); Modified: trunk/lib/fpdf.php =================================================================== --- trunk/lib/fpdf.php 2010-07-15 19:09:00 UTC (rev 7616) +++ trunk/lib/fpdf.php 2010-07-15 19:22:14 UTC (rev 7617) @@ -1073,8 +1073,10 @@ $this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>'); $this->_out('endobj'); } - $mqr=get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + if (!check_php_version(5,3)) { + $mqr=get_magic_quotes_runtime(); + set_magic_quotes_runtime(0); + } foreach($this->FontFiles as $file=>$info) { //Font file embedding $this->_newobj(); @@ -1096,7 +1098,9 @@ fclose($f); $this->_out('endobj'); } - set_magic_quotes_runtime($mqr); + if (!check_php_version(5,3)) { + set_magic_quotes_runtime($mqr); + } foreach($this->fonts as $k=>$font) { //Font objects $this->fonts[$k]['n']=$this->n+1; @@ -1558,4 +1562,4 @@ // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> Modified: trunk/lib/nusoap/nusoap.php =================================================================== --- trunk/lib/nusoap/nusoap.php 2010-07-15 19:09:00 UTC (rev 7616) +++ trunk/lib/nusoap/nusoap.php 2010-07-15 19:22:14 UTC (rev 7617) @@ -1390,7 +1390,9 @@ if($this->encoding != '' && function_exists('gzdeflate')){ $this->outgoing_payload .= "Accept-Encoding: $this->encoding\r\n". "Connection: close\r\n"; - set_magic_quotes_runtime(0); + if (!check_php_version(5,3)) { + set_magic_quotes_runtime(0); + } } // set soapaction if($this->useSOAPAction){ @@ -1556,7 +1558,9 @@ if(function_exists('gzdeflate')){ $encoding_headers = "Accept-Encoding: $this->encoding\r\n". "Connection: close\r\n"; - set_magic_quotes_runtime(0); + if (!check_php_version(5,3)) { + set_magic_quotes_runtime(0); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |