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
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Geoffrey T. D. <da...@us...> - 2001-11-28 18:55:36
|
Update of /cvsroot/phpwiki/phpwiki/locale/it/LC_MESSAGES In directory usw-pr-cvs1:/tmp/cvs-serv3952/locale/it/LC_MESSAGES Modified Files: Tag: release-1_2-branch phpwiki.mo phpwiki.php Log Message: Patches to Swedish translations from Jon Åslund <d9...@na...> Rebuilt .po/.mo files (i.e. ran locale/translate.sh). Index: phpwiki.mo =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/locale/it/LC_MESSAGES/phpwiki.mo,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 Binary files /tmp/cvsSD4yVT and /tmp/cvsOibhWF differ Index: phpwiki.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/locale/it/LC_MESSAGES/phpwiki.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -r1.1.2.1 -r1.1.2.2 *** phpwiki.php 2001/05/21 16:10:31 1.1.2.1 --- phpwiki.php 2001/11/28 18:55:33 1.1.2.2 *************** *** 75,79 **** $locale["Cannot open database %s, giving up."] = "Non riesco ad aprire il database %s, abbandono."; ! $locale["Insert/update failed: %s"] = "Inserimento/aggiornamento fallito: %s"; $locale["Delete on %s failed: %s"] = --- 75,79 ---- $locale["Cannot open database %s, giving up."] = "Non riesco ad aprire il database %s, abbandono."; ! $locale["Insert/update to table 'wiki' failed: %s"] = "Inserimento/aggiornamento fallito: %s"; $locale["Delete on %s failed: %s"] = *************** *** 81,90 **** $locale["Insert into %s failed: %s"] = "Inserimento in %s fallito: %s"; $locale["MySQL error: %s"] = "Errore di MySQL: %s"; $locale["Error writing page '%s'"] = "Errore durante il salvataggio della pagina '%s'"; - $locale["Cannot delete '%s' from table '%s'"] = - "Non posso cancellare '%s' dalla tabella '%s'"; $locale["Enter a page name"] = "Scrivi un nome di una pagina"; --- 81,96 ---- $locale["Insert into %s failed: %s"] = "Inserimento in %s fallito: %s"; + $locale["Insert/update into table 'archive' failed: %s"] = + "Inserimento/aggiornamento fallito: %s"; + $locale["MSSQL error: %s"] = + "Errore di MySQL: %s"; + $locale["Insert/Update failed: %s <br>\n"] = + "Inserimento/aggiornamento fallito: %s"; + $locale["Cannot delete '%s' from table '%s'"] = + "Non posso cancellare '%s' dalla tabella '%s'"; $locale["MySQL error: %s"] = "Errore di MySQL: %s"; $locale["Error writing page '%s'"] = "Errore durante il salvataggio della pagina '%s'"; $locale["Enter a page name"] = "Scrivi un nome di una pagina"; |
From: Geoffrey T. D. <da...@us...> - 2001-11-28 18:55:36
|
Update of /cvsroot/phpwiki/phpwiki/locale/es/LC_MESSAGES In directory usw-pr-cvs1:/tmp/cvs-serv3952/locale/es/LC_MESSAGES Modified Files: Tag: release-1_2-branch phpwiki.mo phpwiki.php Log Message: Patches to Swedish translations from Jon Åslund <d9...@na...> Rebuilt .po/.mo files (i.e. ran locale/translate.sh). Index: phpwiki.mo =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/locale/es/LC_MESSAGES/phpwiki.mo,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -r1.4.2.1 -r1.4.2.2 Binary files /tmp/cvsKCH4Kv and /tmp/cvs6jaR9Q differ Index: phpwiki.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/locale/es/LC_MESSAGES/phpwiki.php,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -r1.3.2.1 -r1.3.2.2 *** phpwiki.php 2001/05/21 16:09:04 1.3.2.1 --- phpwiki.php 2001/11/28 18:55:33 1.3.2.2 *************** *** 75,79 **** $locale["Cannot open database %s, giving up."] = "No se puede abrir la base de datos %s , me doy por vencido."; ! $locale["Insert/update failed: %s"] = "Inserción/Actualización falló: %s"; $locale["Delete on %s failed: %s"] = --- 75,79 ---- $locale["Cannot open database %s, giving up."] = "No se puede abrir la base de datos %s , me doy por vencido."; ! $locale["Insert/update to table 'wiki' failed: %s"] = "Inserción/Actualización falló: %s"; $locale["Delete on %s failed: %s"] = *************** *** 81,90 **** $locale["Insert into %s failed: %s"] = "Inserción en %s falló: %s"; $locale["MySQL error: %s"] = "Error de MySQL: %s"; $locale["Error writing page '%s'"] = "Error al escribir la página `%s'"; - $locale["Cannot delete '%s' from table '%s'"] = - "No se puede borrar '%s' de la tabla '%s'"; $locale["Enter a page name"] = "Escriba un nombre de página"; --- 81,96 ---- $locale["Insert into %s failed: %s"] = "Inserción en %s falló: %s"; + $locale["Insert/update into table 'archive' failed: %s"] = + "Inserción/Actualización falló: %s"; + $locale["MSSQL error: %s"] = + "Error de MySQL: %s"; + $locale["Insert/Update failed: %s <br>\n"] = + "Inserción/Actualización falló: %s"; + $locale["Cannot delete '%s' from table '%s'"] = + "No se puede borrar '%s' de la tabla '%s'"; $locale["MySQL error: %s"] = "Error de MySQL: %s"; $locale["Error writing page '%s'"] = "Error al escribir la página `%s'"; $locale["Enter a page name"] = "Escriba un nombre de página"; *************** *** 131,136 **** $locale["Search"] = "Buscar"; - $locale["Nesting depth exceeded in SetHTMLOutputMode"] = - "Límites de la pila excedidos en SetHTMLOutputMode"; $locale["%d best incoming links:"] = "%d mejores enlaces de entrada:"; --- 137,140 ---- |
From: Geoffrey T. D. <da...@us...> - 2001-11-28 18:55:36
|
Update of /cvsroot/phpwiki/phpwiki/locale/de/LC_MESSAGES In directory usw-pr-cvs1:/tmp/cvs-serv3952/locale/de/LC_MESSAGES Modified Files: Tag: release-1_2-branch phpwiki.mo phpwiki.php Log Message: Patches to Swedish translations from Jon Åslund <d9...@na...> Rebuilt .po/.mo files (i.e. ran locale/translate.sh). Index: phpwiki.mo =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/locale/de/LC_MESSAGES/phpwiki.mo,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -r1.3.2.1 -r1.3.2.2 Binary files /tmp/cvsFApWfr and /tmp/cvs0lE7hI differ Index: phpwiki.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/locale/de/LC_MESSAGES/phpwiki.php,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -r1.3.2.1 -r1.3.2.2 *** phpwiki.php 2001/05/21 16:09:04 1.3.2.1 --- phpwiki.php 2001/11/28 18:55:33 1.3.2.2 *************** *** 67,71 **** $locale["Cannot open database %s, giving up."] = "Kann Datenbank %s nicht öffnen - Abbruch."; ! $locale["Insert/update failed: %s"] = "Einfügen/Verändern fehlgeschlagen: %s"; $locale["Delete on %s failed: %s"] = --- 67,71 ---- $locale["Cannot open database %s, giving up."] = "Kann Datenbank %s nicht öffnen - Abbruch."; ! $locale["Insert/update to table 'wiki' failed: %s"] = "Einfügen/Verändern fehlgeschlagen: %s"; $locale["Delete on %s failed: %s"] = *************** *** 73,82 **** $locale["Insert into %s failed: %s"] = "Einfügen in %s fehlgeschlagen: %s"; $locale["MySQL error: %s"] = "MySQL Fehler: %s"; $locale["Error writing page '%s'"] = "Fehler beim Schreiben der Seite '%s'"; - $locale["Cannot delete '%s' from table '%s'"] = - "Kann nicht '%s' aus Tabelle '%s' löschen"; $locale["Enter a page name"] = "Seitenname eingeben"; --- 73,88 ---- $locale["Insert into %s failed: %s"] = "Einfügen in %s fehlgeschlagen: %s"; + $locale["Insert/update into table 'archive' failed: %s"] = + "Einfügen/Verändern fehlgeschlagen: %s"; + $locale["MSSQL error: %s"] = + "MySQL Fehler: %s"; + $locale["Insert/Update failed: %s <br>\n"] = + "Einfügen/Verändern fehlgeschlagen: %s"; + $locale["Cannot delete '%s' from table '%s'"] = + "Kann nicht '%s' aus Tabelle '%s' löschen"; $locale["MySQL error: %s"] = "MySQL Fehler: %s"; $locale["Error writing page '%s'"] = "Fehler beim Schreiben der Seite '%s'"; $locale["Enter a page name"] = "Seitenname eingeben"; *************** *** 125,130 **** $locale["Search"] = "Suche"; - $locale["Nesting depth exceeded in SetHTMLOutputMode"] = - "Interner Fehler: Stackgrenze in SetHTMLOutputMode überschritten."; $locale["%d best incoming links:"] = "Die %d besten hereinkommenden Links:"; --- 131,134 ---- |
From: Geoffrey T. D. <da...@us...> - 2001-11-26 22:43:27
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv30247/lib Modified Files: main.php Log Message: Fix SF bug #484557: "Fatal error: Call to a member function on a non-object in lib/main.php on line 205" when trying to set user preferences. Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** main.php 2001/11/14 15:29:50 1.17 --- main.php 2001/11/26 22:43:24 1.18 *************** *** 99,104 **** // Enable the output of most of the warning messages. // The warnings will screw up zip files and setpref though. if ($action != 'zip' && $action != 'setprefs') { - global $ErrorManager; $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE); } --- 99,104 ---- // Enable the output of most of the warning messages. // The warnings will screw up zip files and setpref though. + global $ErrorManager; if ($action != 'zip' && $action != 'setprefs') { $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE); } |
From: Geoffrey T. D. <da...@us...> - 2001-11-26 22:37:33
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv28814/lib Modified Files: WikiUser.php Log Message: Fix typos in getPreferences. Index: WikiUser.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiUser.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** WikiUser.php 2001/09/18 19:16:23 1.1 --- WikiUser.php 2001/11/26 22:37:29 1.2 *************** *** 101,106 **** if (is_array($saved)) { ! foreach ($saved as $key => $vval) { ! if (isset($pref[$key]) && !empty($val)) $prefs[$key] = $val; } --- 101,106 ---- if (is_array($saved)) { ! foreach ($saved as $key => $val) { ! if (isset($prefs[$key]) && !empty($val)) $prefs[$key] = $val; } |
From: Geoffrey T. D. <da...@us...> - 2001-11-26 22:00:29
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv16223/lib Modified Files: loadsave.php Log Message: Fix my last fix: minor cleanup of file load diagnostics. Index: loadsave.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** loadsave.php 2001/11/21 17:58:46 1.12 --- loadsave.php 2001/11/26 22:00:26 1.13 *************** *** 219,226 **** ExtractWikiPageLinks($content)); ! if ($pageinfo['version'] == $new->getVersion()) ! $mesg[] = gettext("- saved"); ! else ! $mesg[] = sprintf(gettext("- saved as version %d"), $new->getVersion()); } --- 219,223 ---- ExtractWikiPageLinks($content)); ! $mesg[] = sprintf(gettext("- saved as version %d"), $new->getVersion()); } |
From: Gerrit R. <ri...@us...> - 2001-11-26 09:25:39
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory usw-pr-cvs1:/tmp/cvs-serv17682/lib/WikiDB/backend Modified Files: cvs.php Log Message: implemented the most_recent and most_popular functions, and minor refactorings Index: cvs.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/cvs.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** cvs.php 2001/11/08 11:01:16 1.3 --- cvs.php 2001/11/26 09:25:36 1.4 *************** *** 31,35 **** --- 31,39 ---- define( 'CMD_VERSION', 'version'); define( 'CMD_AUTHOR', 'author'); + define( 'CMD_LINK_ATT', '_links_' ); + // file names used to store specific information + define( 'CVS_MP_FILE', '.most_popular' ); + define( 'CVS_MR_FILE', '.most_recent' ); class WikiDB_backend_cvs *************** *** 147,176 **** // file always has the name, i.e. '_$pagename'. $metaFile = $this->_docDir . "/CVS/_" . $pagename; - - if ( $fd = @fopen( $metaFile, "r" ) ) { ! $locked = flock( $fd, 1 ); // read lock ! if ( !$locked ) { ! fclose( $fd ); ! $this->_cvsError( "Unable to obtain read lock.",__LINE__); } ! $pagehash = unserialize( join( '', file($metaFile) )); ! // need to strip off the new lines at the end of each line ! // hmmmm, content expects an array of lines where each line ! // has it's newline stripped off. Unfortunately because i don't ! // want to store the files in serialize or wiki specific format, ! // i need to add newlines when storing but need to strip them ! // off again when i retrieve the file because file() doesn't remove ! // newlines! ! // $pagehash['content'] = file($filename); ! // array_walk( $pagehash['content'], '_strip_newlines' ); ! // reset( $pagehash['content'] ); ! fclose( $fd ); ! return $pagehash; } - - return false; } --- 151,174 ---- // file always has the name, i.e. '_$pagename'. $metaFile = $this->_docDir . "/CVS/_" . $pagename; ! if ( file_exists( $metaFile ) ) { ! ! $megaHash = ! unserialize(join( '',$this->_readFileWithPath($metaFile))); ! ! $filename = $this->_docDir . "/" . $pagename; ! if ( file_exists( $filename ) ) { ! $megaHash[CMD_CONTENT] = $this->_readFileWithPath( $filename ); ! } else { ! $megaHash[CMD_CONTENT] = ""; } ! $this->_updateMostRecent( $pagename ); ! $this->_updateMostPopular( $pagename ); ! return $megaHash; ! } else { ! return false; } } *************** *** 360,371 **** function set_links($pagename, $links) { ! // TODO: to be implemented ! trigger_error("set_links: Not Implemented", E_USER_WARNING); } function get_links($pagename, $reversed) { ! // TODO: to be implemented ! trigger_error("get_links: Not Implemented", E_USER_WARNING); } --- 358,377 ---- function set_links($pagename, $links) { ! // TODO: needs to be tested .... ! $megaHash = get_pagedata( $pagename ); ! $megaHash[CMD_LINK_ATT] = $links; ! $this->_writeMetaInfo( $pagename, $megaHash ); } function get_links($pagename, $reversed) { ! // TODO: ignores the $reversed argument and returns ! // TODO: the value of _links_ attribute of the meta information ! // TODO: to implement a reversed version, i guess, we going to ! // TODO: need to do a grep on all files for the pagename in ! // TODO: in question and return all those page names that contained ! // TODO: the required pagename! ! $megaHash = get_pagedata( $pagename ); ! return $megaHash[CMD_LINK_ATT]; } *************** *** 400,415 **** --- 406,460 ---- function most_popular($limit) { + // TODO: needs to be tested ... + $mp = $this->_getMostPopular(); + arsort( $mp, SORT_NUMERIC ); + $returnVal = array(); + + while ( (list($key, $val) = each($a)) && $limit > 0 ) { + $returnVal[] = $key; + $limit--; + } + return $returnVal; } + /** + * This only accepts the 'since' and 'limit' attributes, everything + * else is ignored. + */ function most_recent($params) { + // TODO: needs to be tested ... + // most recent are those pages with the highest time value ... + $mr = $this->_getMostRecent(); + arsort( $mp, SORT_NUMERIC ); + $returnVal = array(); + + if ( isset( $params['limit'] ) ) { + $limit = $params['limit']; + while ( (list($key, $val) = each($a)) && $limit > 0 ) { + $returnVal[] = $key; + $limit--; + } + } else if ( isset( $params['since'] ) ) { + while ( (list($key, $val) = each($a)) ) { + if ( $val > $params['since'] ) { + $returnVal[] = $key; + } + } + } + + return new Cvs_Backend_Array_Iterator( $returnVal ); } function lock($write_lock = true) { + // TODO: to be implemented + trigger_error("lock: Not Implemented", E_USER_WARNING); } function unlock($force = false) { + // TODO: to be implemented + trigger_error("unlock: Not Implemented", E_USER_WARNING); } *************** *** 473,476 **** --- 518,523 ---- function _create_meta_file( $page_name, $key, &$backend ) { + // this is used as part of an array walk and therefore takes + // the backend argument $backend->_cvsDebug( "Creating meta file for [$page_name]" ); $backend->update_pagedata( $page_name, array() ); *************** *** 482,485 **** --- 529,580 ---- } + /** + * update the most popular information by incrementing the count + * for the following page. If the page was not defined, it is entered + * with a value of 1. + */ + function _updateMostPopular( $pagename ) + { + $mp = $this->_getMostPopular(); + if ( isset( $mp[$pagename] ) ) { + $mp[$pagename]++; + } else { + $mp[$pagename] = 1; + } + $this->_writeFileWithPath( $this->_docDir . "/CVS/" . CVS_MP_FILE, + serialize( $mp ) ); + } + + + /** + * Returns an array containing the most popular information. This + * creates the most popular file if it does not exist. + */ + function _getMostPopular() + { + $mostPopular = $this->_docDir . "/CVS/" . CVS_MP_FILE; + if ( !file_exists( $mostPopular ) ) { + $this->_writeFileWithPath( $mostPopular, serialize( array() ) ); + } + return unserialize(join( '',$this->_readFileWithPath($mostPopular))); + } + + function _getMostRecent() + { + $mostRecent = $this->_docDir . "/CVS/" . CVS_MR_FILE; + if ( !file_exists( $mostRecent ) ) { + $this->_writeFileWithPath( $mostRecent, serialize( array() ) ); + } + return unserialize(join( '',$this->_readFileWithPath($mostRecent))); + } + + function _updateMostRecent( $pagename ) + { + $mr = $this->_getMostRecent(); + $mr[$pagename] = time(); + $this->_writeFileWithPath( $this->_docDir . "/CVS/" . CVS_MR_FILE, + serialize( $mr ) ); + } + function _writeMetaInfo( $pagename, $hashInfo ) { *************** *** 681,699 **** /** * Either replace the contents of an existing file or create a * new file in the particular store using the page name as the * file name. ! * ! * Returns true if all went well, else false. */ - // function _WriteFile( $pagename, $storename, $contents ) - // { - // global $WikiDB; - // $filename = $WikiDB[$storename] . "/" . $pagename; - // _WriteFileWithPath( $filename, $contents ); - // } - function _writeFileWithPath( $filename, $contents ) { if( $fd = fopen($filename, 'a') ) { $locked = flock($fd,2); // Exclusive blocking lock --- 776,810 ---- /** + * Read locks a file, reads it, and returns it contents + */ + function _readFileWithPath( $filename ) + { + if ( $fd = @fopen( $filename, "r" ) ) { + $locked = flock( $fd, 1 ); // read lock + if ( !$locked ) { + fclose( $fd ); + $this->_cvsError( "Unable to obtain read lock.",__LINE__); + } + + $content = file( $filename ); + fclose( $fd ); + return $content; + } else { + $this->_cvsError( "Unable to open file '$filename' for reading", + __LINE__ ); + return false; + } + } + + /** * Either replace the contents of an existing file or create a * new file in the particular store using the page name as the * file name. ! * ! * Nothing is returned, might be useful to return something ;-) */ function _writeFileWithPath( $filename, $contents ) { + // TODO: $contents should probably be a reference parameter ... if( $fd = fopen($filename, 'a') ) { $locked = flock($fd,2); // Exclusive blocking lock *************** *** 702,706 **** } ! //Second (actually used) filehandle $fdsafe = fopen($filename, 'w'); fwrite($fdsafe, $contents); --- 813,817 ---- } ! // Second filehandle -- we use this to write the contents $fdsafe = fopen($filename, 'w'); fwrite($fdsafe, $contents); *************** *** 708,712 **** fclose($fd); } else { ! $this->_cvsError( "Could not open file [$filename]", __LINE__ ); } } --- 819,824 ---- fclose($fd); } else { ! $this->_cvsError( "Could not open file '$filename' for writing", ! __LINE__ ); } } |
From: Gerrit R. <ri...@us...> - 2001-11-26 09:25:39
|
Update of /cvsroot/phpwiki/phpwiki/tests In directory usw-pr-cvs1:/tmp/cvs-serv17682/tests Modified Files: unit_test_backend_cvs.php Log Message: implemented the most_recent and most_popular functions, and minor refactorings Index: unit_test_backend_cvs.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/tests/unit_test_backend_cvs.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** unit_test_backend_cvs.php 2001/11/08 11:01:16 1.2 --- unit_test_backend_cvs.php 2001/11/26 09:25:36 1.3 *************** *** 114,117 **** --- 114,118 ---- exec( "rm -fr " . $db_params[CVS_REPOSITORY], $cmdout, $retval ); exec( "rm -f " . $db_params[CVS_DEBUG_FILE], $cmdout, $retval ); + print "Test was succesful\n"; } else { print "It appears something went wrong, nothing being removed\n"; |
From: Carsten K. <car...@us...> - 2001-11-26 06:28:34
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv15024/phpwiki/templates Removed Files: .htaccess Log Message: server needs access to subdirectories of templates for theme files (css and images). --- .htaccess DELETED --- |
From: Carsten K. <car...@us...> - 2001-11-26 06:26:40
|
Update of /cvsroot/phpwiki/phpwiki/images In directory usw-pr-cvs1:/tmp/cvs-serv14677/phpwiki/templates/vanilla Added Files: phpwiki.css Log Message: moving style sheets and images to subfolder in templates for "theme module" --- NEW FILE --- /* Classes: DIV.wikitext - the transformed wiki page text. A.wiki - link to page in wiki. A.named-wiki - a named link to page in wiki (from e.g. [name|WikiPage]). A.interwiki - link to page in another wiki SPAN.wikipage - page name within interwiki link. A.named-interwiki - link to page in another wiki A.url - link to external URL from wiki page. A.named-url - link to external URL from wiki page. .wikiunknown A, .wikiunknown U .named-wikiunknown A, .named-wikiunknown U A.wikiaction A.wikiadmin .wikiunsafe A.backlinks TODO: Get rid of tables in wikiaction forms. */ /* NS4 doesn't grok @import. This allows us to put things which break NS4 * in another file. */ @import url(phpwiki-heavy.css); BODY { background: ivory; } BODY { font-family: arial, helvetica, sans-serif; } /* * NS4, defaults from BODY don't always propagate correctly. * So we need this: */ .wikitext, .toolbar, P, TD { font-family: arial, helvetica, sans-serif; } INPUT.button { font-family: arial, helvetica, sans-serif; } .wikitext PRE { font-family: monospace; } DIV.wikitext { background: white; border: thin; border-color: black; border-style: solid; padding-left: 0.8em; padding-right: 0.8em; padding-top: 0px; padding-bottom: 0px; margin: 0.5ex 0px; /* This breaks Netscape 4: (display does not go full width). width: auto; */ clear: both; } INPUT.wikitext { margin:0px; } DIV.toolbar { margin: 1ex 0ex; } /* * This is a kluge for NS4 which doesn't honor the clear: settings on * .tool-left and .tool-right. * * Putting in explicit <br clear="all"> messes up the formatting in * other browsers. Instead we'll put in a: * * <div class="br"><br class="ignore" clear="all"></div> * * The clear:both on DIV.br seems to work. And we'll disable the <br> altogether (in * CSS aware browsers) by setting display:none. * * Actually, I haven't yet found a browser which doesn't put a line break * between successive <div>'s. This makes the <br class="ignore"> completely * unnecessary. */ DIV.br { clear:both; line-height: 0px; } .ignore { display: none; } DIV.errors { background: #eee; border: medium; border-color: red; border-style: solid; padding-left: 0.8em; padding-right: 0.8em; padding-top: 0px; padding-bottom: 0px; margin: 1em; /* This breaks Netscape 4: (display does not go full width). width: auto; */ clear: both; } .errors H4 { color:red; text-decoration: underline; margin:0px; } P.error { font-size: smaller; font-family: monospace; margin:0px; } .error UL { font-size: smaller; font-family: monospace; } /* * Style for <hr>s in wiki markup. */ .wikitext HR { background: #666; height: 1px; width: 90%; margin-left:auto; margin-right:auto; align:center; /* for NS4 */ } /* * Link styles */ /* Wiki Links */ A.wiki { text-decoration: none; } .wiki { font-weight: bold; } /* This is obscene in NS4 B .wiki, STRONG .wiki { font-size: larger; } */ /* Unknown links */ .wikiunknown A, .named-wikiunknown A, .wikiunknown U { text-decoration: none; } .wikiunknown, .named-wikiunknown {color: #600; } .wikiunknown A, .named-wikiunknown { color: white; background-color: #600; } /* Interwiki links */ A.interwiki { text-decoration: none; } .wikipage { font-weight: bold; } .interwiki, I .interwiki .wikipage, EM .interwiki .wikipage { font-style: oblique; } .interwiki .wikipage, I .interwiki, EM .interwiki { font-style: normal; } /* * wikiaction, wikiadmin, wikiunsafe: */ A.wikiaction, A.wikiadmin { text-decoration: none; } A.wikiaction, .wikiaction TABLE, SPAN.wikiaction { background-color: #ddd; } A.wikiadmin, .wikiadmin TABLE { background-color: #fdd; } .wikiunsafe { background-color: #ccc; } /* * Put a border around wikiaction forms: * This doesn't work for NS4. */ .wikiaction TABLE, .wikiadmin TABLE { border-style: ridge; border-width: medium; } .wikiaction TABLE { border-color: #9cf; } .wikiadmin TABLE { border-color: #f99; } /* Backlinks */ A.backlinks { color: #006; } /* Make the textarea on the edit page full width */ TEXTAREA.wikiedit { width: 100%; margin-top: 1ex; } /* Calendar plugin */ a.cal-hide, a.cal-arrow { text-decoration: none; } .cal-arrow { font-weight: bold; } .cal-header { font-size: larger; } .cal-dayname { font-size: smaller; text-decoration: underline; } table.cal { border: thin solid black; } /* For emacs users * * Local Variables: * mode: c * c-file-style: cc-mode * End: */ |
From: Carsten K. <car...@us...> - 2001-11-26 06:26:36
|
Update of /cvsroot/phpwiki/phpwiki/images In directory usw-pr-cvs1:/tmp/cvs-serv14653/phpwiki/templates/vanilla Added Files: phpwiki-heavy.css Log Message: Moving images & style sheets for "theme modules". --- NEW FILE --- /* * phpwiki-heavy.css * * This is stuff which should be in phpwiki.css, but which breaks NS4. */ /* Hide the elements we put in just to get around NS4 bugs. */ .ns4bug, DIV.br { display: none; } /* This makes spacings in NS4 too big. */ .toolbar, DIV.toolbar { margin: 0.5ex 0ex; } /* This break NS4, but is necessary for IE4. */ DIV.wikitext { width: auto; } /* Make Wikilinks inside <B> tags larger. */ B .wiki, STRONG .wiki, B .wikipage, STRONG .wikipage { font-size: larger; } /* Make wikiaction links look like buttons */ A.wikiaction, A.wikiadmin, INPUT.button { border-style: outset; border-width: thin; color: #006; padding-top: 0ex; padding-bottom: 0ex; padding-left: 0.2em; padding-right: 0.2em; } |
From: Carsten K. <car...@us...> - 2001-11-26 06:23:45
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv14254/phpwiki/lib Modified Files: stdlib.php Log Message: CSS & images now stored in a folder within templates according to global $theme. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** stdlib.php 2001/11/14 21:05:38 1.44 --- stdlib.php 2001/11/26 06:23:42 1.45 *************** *** 20,26 **** function DataURL($url) { if (preg_match('@^(\w+:|/)@', $url)) return $url; ! return SERVER_URL . DATA_PATH . "/$url"; } --- 20,27 ---- function DataURL($url) { + global $theme; if (preg_match('@^(\w+:|/)@', $url)) return $url; ! return SERVER_URL . DATA_PATH . "/templates/$theme/$url"; } |
From: Carsten K. <car...@us...> - 2001-11-26 06:23:40
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv14235/phpwiki Modified Files: index.php Log Message: Signature, logo & css settings moved to /templates/theme, to allow for themes and and a step towards simplifying various paths (VIRTUAL_PATH, DATA_PATH) & http server directives. Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** index.php 2001/11/14 17:07:07 1.28 --- index.php 2001/11/26 06:23:38 1.29 *************** *** 247,268 **** //putenv('LC_TIME=de_DE'); ! // If you specify a relative URL for the CSS and images, ! // the are interpreted relative to DATA_PATH (see below). ! // (The default value of DATA_PATH is the directory in which ! // index.php (this file) resides.) ! // CSS location ! // ! // Note that if you use the stock phpwiki style sheet, 'phpwiki.css', ! // you should make sure that it's companion 'phpwiki-heavy.css' ! // is installed in the same directory that the base style file is. ! define("CSS_URL", "phpwiki.css"); ! ! // logo image (path relative to index.php) ! $logo = "images/wikibase.png"; ! ! // Signature image which is shown after saving an edited page ! // If this is left blank (or unset), the signature will be omitted. ! //$SignatureImg = "images/signature.png"; // Date & time formats used to display modification times, etc. --- 247,258 ---- //putenv('LC_TIME=de_DE'); ! // Default PhpWiki theme is vanilla ! // Page logo and signature images are in the theme folder. ! // The appearance can be customized by creating additional folders inside templates. ! // See the file templates/vanilla/theme.php for additional info. ! // Eventually this could be set in user preferences, for now it's just a global. ! $theme = "vanilla"; ! include "templates/$theme/$theme.php"; // Date & time formats used to display modification times, etc. |
From: Carsten K. <car...@us...> - 2001-11-26 06:18:42
|
Update of /cvsroot/phpwiki/phpwiki/images In directory usw-pr-cvs1:/tmp/cvs-serv13349/phpwiki/templates/vanilla Added Files: vanilla.php Log Message: Start of "theme module" support. --- NEW FILE --- <?php // FIXME: these files are moved to a subfolder in /templates // e.g. /templates/vanilla so relative paths to index.php // should be irrelevant. // The current .htaccess in /templates generates an error in apache 1.3.20. // It should be removed or changed to allow access for themes to work. // If you specify a relative URL for the CSS and images, // the are interpreted relative to DATA_PATH (see below). // (The default value of DATA_PATH is the directory in which // index.php (this file) resides.) // CSS location // // Note that if you use the stock phpwiki style sheet, 'phpwiki.css', // you should make sure that it's companion 'phpwiki-heavy.css' // is installed in the same directory that the base style file is. define("CSS_URL", "phpwiki.css"); // logo image $logo = "wikibase.png"; // Signature image which is shown after saving an edited page // If this is left blank (or unset), the signature will be omitted. $SignatureImg = "signature.png"; // (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: ?> |
From: Geoffrey T. D. <da...@us...> - 2001-11-21 20:01:55
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv25069/lib Modified Files: WikiCallback.php Log Message: New class: WikiAnonymousCb Index: WikiCallback.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiCallback.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** WikiCallback.php 2001/11/21 19:44:34 1.1 --- WikiCallback.php 2001/11/21 20:01:52 1.2 *************** *** 158,161 **** --- 158,189 ---- } + /** + * Anonymous function callback. + */ + class WikiAnonymousCb + extends WikiCallback + { + /** + * Constructor + * + * @param $args string Argument declarations + * @param $code string Function body + * @see create_function(). + * @access public + */ + function WikiAnonymousCb ($args, $code) { + $this->function = create_function($args, $code); + } + + function call_array ($args) { + return call_user_func_array($this->function, $args); + } + + function toPearCb() { + trigger_error("Can't convert WikiAnonymousCb to Pear callback", + E_USER_ERROR); + } + } + // (c-file-style: "gnu") // Local Variables: |
From: Geoffrey T. D. <da...@us...> - 2001-11-21 19:49:26
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory usw-pr-cvs1:/tmp/cvs-serv19978/lib/WikiDB/backend Modified Files: PearDB.php Log Message: Fix typo/bug in PearDB::text_search. Change calling conventions for ErrorManager::pushErrorHandler() and ErrorManager::setFatalHandler(). Now these take a WikiCallback instead of the Pear style callback specification. Change argument semantics for TextSearchQuery::makeSqlClause. Now takes a WikiCallback. Index: PearDB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** PearDB.php 2001/11/17 00:49:29 1.9 --- PearDB.php 2001/11/21 19:49:21 1.10 *************** *** 17,21 **** // Install filter to handle bogus error notices from buggy DB.php's. global $ErrorManager; ! $ErrorManager->pushErrorHandler(array($this, '_pear_notice_filter')); // Open connection to database --- 17,21 ---- // Install filter to handle bogus error notices from buggy DB.php's. global $ErrorManager; ! $ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_pear_notice_filter')); // Open connection to database *************** *** 445,452 **** $join_clause = "$nonempty_tbl.id=$page_tbl.id"; $fields = "$page_tbl.*"; ! $callback = '_sql_match_clause'; if ($fullsearch) { ! $table .= ", $recent_tbl,"; $join_clause .= " AND $page_tbl.id=$recent_tbl.id"; --- 445,452 ---- $join_clause = "$nonempty_tbl.id=$page_tbl.id"; $fields = "$page_tbl.*"; ! $callback = new WikiMethodCb($this, '_sql_match_clause'); if ($fullsearch) { ! $table .= ", $recent_tbl"; $join_clause .= " AND $page_tbl.id=$recent_tbl.id"; *************** *** 455,463 **** $fields .= ",$version_tbl.*"; ! $callback = '_fullsearch_sql_match_clause'; } - ! $search_clause = $search->makeSqlClause(array($this, $callback)); $result = $dbh->query("SELECT $fields FROM $table" --- 455,462 ---- $fields .= ",$version_tbl.*"; ! $callback = new WikiMethodCb($this, '_fullsearch_sql_match_clause'); } ! $search_clause = $search->makeSqlClause($callback); $result = $dbh->query("SELECT $fields FROM $table" |
From: Geoffrey T. D. <da...@us...> - 2001-11-21 19:48:20
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv19610/lib Modified Files: TextSearchQuery.php Log Message: Change argument semantics for TextSearchQuery::makeSqlClause. Now takes a WikiCallback. Index: TextSearchQuery.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/TextSearchQuery.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TextSearchQuery.php 2001/09/18 19:16:23 1.1 --- TextSearchQuery.php 2001/11/21 19:48:15 1.2 *************** *** 98,102 **** * Make an SQL clause which matches the query. * ! * @param $make_sql_clause_func string,function or array * A callback which takes a single word as an argument and * returns an SQL clause which will match exactly those records --- 98,102 ---- * Make an SQL clause which matches the query. * ! * @param $make_sql_clause_cb WikiCallback * A callback which takes a single word as an argument and * returns an SQL clause which will match exactly those records *************** *** 104,117 **** * be in all lower case. * - * If $make_sql_clause_func is an array, it is interpreted as a method - * callback. The first element of the array is the object, the second - * element (a string) is the name of the method. - * - * If $make_sql_clause_func is a string, it is taken to be the name - * of a global function to call. - * - * Otherwise, $make_sql_clause_func is assumed to be a function object - * (created by create_function()). - * * Example usage: * <pre> --- 104,107 ---- *************** *** 124,128 **** * * $query = new TextSearchQuery("wiki -page"); ! * $sql_clause = $query->makeSqlClause('sql_title_match'); * </pre> * This will result in $sql_clause containing something like --- 114,119 ---- * * $query = new TextSearchQuery("wiki -page"); ! * $cb = new WikiFunctionCb('sql_title_match'); ! * $sql_clause = $query->makeSqlClause($cb); * </pre> * This will result in $sql_clause containing something like *************** *** 131,136 **** * @return string The PCRE regexp. */ ! function makeSqlClause($make_sql_clause_func) { ! $this->_sql_clause_func = $make_sql_clause_func; return $this->_sql_clause($this->_tree); } --- 122,127 ---- * @return string The PCRE regexp. */ ! function makeSqlClause($make_sql_clause_cb) { ! $this->_sql_clause_cb = $make_sql_clause_cb; return $this->_sql_clause($this->_tree); } *************** *** 139,151 **** switch ($node->op) { case 'WORD': ! $callback = $this->_sql_clause_func; ! if (is_array($callback)) { ! list($object, $method) = $callback; ! return call_user_method($method, $object, $node->word); ! } ! elseif (is_string($callback)) ! return call_user_func($callback, $node->word); ! else ! return $callback($node->word); case 'NOT': return "NOT (" . $this->_sql_clause($node->leaves[0]) . ")"; --- 130,134 ---- switch ($node->op) { case 'WORD': ! return $this->_sql_clause_cb->call($node->word); case 'NOT': return "NOT (" . $this->_sql_clause($node->leaves[0]) . ")"; |
From: Geoffrey T. D. <da...@us...> - 2001-11-21 19:46:53
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory usw-pr-cvs1:/tmp/cvs-serv19032/lib/WikiDB/backend Modified Files: pgsql.php Log Message: Change calling conventions for ErrorManager::pushErrorHandler() and ErrorManager::setFatalHandler(). Now these take a WikiCallback instead of the Pear style callback specification. Index: pgsql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/pgsql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** pgsql.php 2001/09/18 19:16:23 1.1 --- pgsql.php 2001/11/21 19:46:50 1.2 *************** *** 21,25 **** global $ErrorManager; ! $ErrorManager->pushErrorHandler(array($this,'_pgsql_open_error')); $this->WikiDB_backend_PearDB($dbparams); $ErrorManager->popErrorHandler(); --- 21,25 ---- global $ErrorManager; ! $ErrorManager->pushErrorHandler(new WikiMethodCb($this,'_pgsql_open_error')); $this->WikiDB_backend_PearDB($dbparams); $ErrorManager->popErrorHandler(); |
From: Geoffrey T. D. <da...@us...> - 2001-11-21 19:46:53
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv19032/lib Modified Files: ErrorManager.php DbaDatabase.php Template.php prepend.php Log Message: Change calling conventions for ErrorManager::pushErrorHandler() and ErrorManager::setFatalHandler(). Now these take a WikiCallback instead of the Pear style callback specification. Index: ErrorManager.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ErrorManager.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ErrorManager.php 2001/11/06 17:13:22 1.2 --- ErrorManager.php 2001/11/21 19:46:50 1.3 *************** *** 96,103 **** * * @access public ! * @param $handler string or array ! * To register a global function as a handler, just pass the functions name ! * (as a string). To register an object method as a handler, pass a array: ! * the first element is the object, the second is the name of the method. */ function pushErrorHandler($handler) { --- 96,100 ---- * * @access public ! * @param $handler WikiCallback Handler to call. */ function pushErrorHandler($handler) { *************** *** 120,127 **** * * @access public ! * @param $handler string or array ! * To register a global function as a handler, just pass the functions name ! * (as a string). To register an object method as a handler, pass a array: ! * the first element is the object, the second is the name of the method. */ function setFatalHandler($handler) { --- 117,121 ---- * * @access public ! * @param $handler WikiCallback Callback to call on fatal errors. */ function setFatalHandler($handler) { *************** *** 129,145 **** } - function _callHandler($handler, $error) { - if (is_string($handler)) { - return call_user_func($handler, $error); - } - else if (is_array($handler)) { - list($object, $method) = $handler; - if (method_exists($object, $method)) - return call_user_method($method, $object, $error); - } - echo "<div>ErrorManager::_callHandler: BAD HANDLER<br></div>\n"; - return false; - } - /** * Handle an error. --- 123,126 ---- *************** *** 162,166 **** foreach ($this->_handlers as $handler) { ! $result = $this->_callHandler($handler, $error); if (!$result) { continue; // Handler did not handle error. --- 143,147 ---- foreach ($this->_handlers as $handler) { ! $result = $handler->call($error); if (!$result) { continue; // Handler did not handle error. *************** *** 208,212 **** $this->_flush_errors(); if ($this->_fatal_handler) ! $this->_callHandler($this->_fatal_handler, $error); exit -1; } --- 189,193 ---- $this->_flush_errors(); if ($this->_fatal_handler) ! $this->_fatal_hander->call($error); exit -1; } Index: DbaDatabase.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/DbaDatabase.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** DbaDatabase.php 2001/09/18 19:16:23 1.1 --- DbaDatabase.php 2001/11/21 19:46:50 1.2 *************** *** 29,33 **** global $ErrorManager; $this->_dba_open_error = false; ! $ErrorManager->pushErrorHandler(array($this, '_dba_open_error_handler')); while (($dbh = dba_open($this->_file, $mode, $this->_handler)) < 1) { if (--$watchdog <= 0) --- 29,33 ---- global $ErrorManager; $this->_dba_open_error = false; ! $ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_dba_open_error_handler')); while (($dbh = dba_open($this->_file, $mode, $this->_handler)) < 1) { if (--$watchdog <= 0) Index: Template.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/Template.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Template.php 2001/09/19 03:24:36 1.2 --- Template.php 2001/11/21 19:46:50 1.3 *************** *** 113,117 **** global $ErrorManager; ! $ErrorManager->pushErrorHandler(array($this, '_errorHandler')); eval('?>' . $this->_munge_input($this->_tmpl)); $ErrorManager->popErrorHandler(); --- 113,117 ---- global $ErrorManager; ! $ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_errorHandler')); eval('?>' . $this->_munge_input($this->_tmpl)); $ErrorManager->popErrorHandler(); Index: prepend.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/prepend.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** prepend.php 2001/09/18 19:16:23 1.4 --- prepend.php 2001/11/21 19:46:50 1.5 *************** *** 10,13 **** --- 10,14 ---- error_reporting(E_ALL); require_once('lib/ErrorManager.php'); + require_once('lib/WikiCallback.php'); // FIXME: make this part of Request? *************** *** 43,47 **** $ErrorManager->setPostponedErrorMask(E_ALL); ! $ErrorManager->setFatalHandler('ExitWiki'); --- 44,48 ---- $ErrorManager->setPostponedErrorMask(E_ALL); ! $ErrorManager->setFatalHandler(new WikiFunctionCb('ExitWiki')); |
From: Geoffrey T. D. <da...@us...> - 2001-11-21 19:44:37
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv18584/lib Added Files: WikiCallback.php Log Message: Classes for callbacks. ***** Error reading new file: [Errno 2] No such file or directory: 'WikiCallback.php' |
From: Geoffrey T. D. <da...@us...> - 2001-11-21 17:58:49
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv18877/lib Modified Files: loadsave.php Log Message: Typo fix. Index: loadsave.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** loadsave.php 2001/11/14 17:43:50 1.11 --- loadsave.php 2001/11/21 17:58:46 1.12 *************** *** 218,224 **** $versiondata, ExtractWikiPageLinks($content)); ! ! $mesg[] = gettext("- saved"); ! $mesg[] = sprintf(gettext("- saved as version %d"), $new->getVersion()); } --- 218,226 ---- $versiondata, ExtractWikiPageLinks($content)); ! ! if ($pageinfo['version'] == $new->getVersion()) ! $mesg[] = gettext("- saved"); ! else ! $mesg[] = sprintf(gettext("- saved as version %d"), $new->getVersion()); } |
From: Geoffrey T. D. <da...@us...> - 2001-11-17 16:39:11
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv29250/lib Modified Files: Request.php Log Message: Fix file upload bug. Index: Request.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/Request.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** Request.php 2001/09/19 02:58:00 1.2 --- Request.php 2001/11/17 16:39:08 1.3 *************** *** 239,246 **** function open() { if ( ($fd = fopen($this->_info['tmp_name'], "rb")) ) { ! // Dump http headers. ! while ( ($header = fgets($fd, 4096)) ) ! if (trim($header) == '') ! break; } return $fd; --- 239,262 ---- function open() { if ( ($fd = fopen($this->_info['tmp_name'], "rb")) ) { ! if ($this->getSize() < filesize($this->_info['tmp_name'])) { ! // FIXME: Some PHP's (or is it some browsers?) put ! // HTTP/MIME headers in the file body, some don't. ! // ! // At least, I think that's the case. I know I used ! // to need this code, now I don't. ! // ! // This code is more-or-less untested currently. ! // ! // Dump HTTP headers. ! while ( ($header = fgets($fd, 4096)) ) { ! if (trim($header) == '') { ! break; ! } ! else if (!preg_match('/^content-(length|type):/i', $header)) { ! rewind($fd); ! break; ! } ! } ! } } return $fd; |
From: Geoffrey T. D. <da...@us...> - 2001-11-17 00:49:31
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory usw-pr-cvs1:/tmp/cvs-serv24928/lib/WikiDB/backend Modified Files: PearDB.php mysql.php Log Message: For maximum portability, use old fashioned comma join instead of "INNER JOIN ... USING(...)" and "INNER JOIN ... ON ...". Fix for older MySQL's which don't support the "CASE WHEN ... END" syntax. The fix is complicated by the fact that Postgres doesn't support MySQL's "IF(,,)" syntax. Index: PearDB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** PearDB.php 2001/11/07 21:12:47 1.8 --- PearDB.php 2001/11/17 00:49:29 1.9 *************** *** 41,44 **** --- 41,49 ---- 'nonempty_tbl' => $prefix . 'nonempty'); + $this->_expressions + = array('maxmajor' => "MAX(CASE WHEN minor_edit=0 THEN version END)", + 'maxminor' => "MAX(CASE WHEN minor_edit<>0 THEN version END)", + 'maxversion' => "MAX(version)"); + $this->_lock_count = 0; } *************** *** 70,75 **** extract($this->_table_names); return $dbh->getOne(sprintf("SELECT $page_tbl.id" ! . " FROM $nonempty_tbl INNER JOIN $page_tbl USING(id)" ! . " WHERE pagename='%s'", $dbh->quoteString($pagename))); } --- 75,81 ---- extract($this->_table_names); return $dbh->getOne(sprintf("SELECT $page_tbl.id" ! . " FROM $nonempty_tbl, $page_tbl" ! . " WHERE $nonempty_tbl.id=$page_tbl.id" ! . " AND pagename='%s'", $dbh->quoteString($pagename))); } *************** *** 79,83 **** extract($this->_table_names); return $dbh->getCol("SELECT pagename" ! . " FROM $nonempty_tbl INNER JOIN $page_tbl USING(id)"); } --- 85,90 ---- extract($this->_table_names); return $dbh->getCol("SELECT pagename" ! . " FROM $nonempty_tbl, $page_tbl" ! . " WHERE $nonempty_tbl.id=$page_tbl.id"); } *************** *** 179,185 **** return (int)$dbh->getOne(sprintf("SELECT latestversion" ! . " FROM $page_tbl" ! . " INNER JOIN $recent_tbl USING(id)" ! . " WHERE pagename='%s'", $dbh->quoteString($pagename))); } --- 186,192 ---- return (int)$dbh->getOne(sprintf("SELECT latestversion" ! . " FROM $page_tbl, $recent_tbl" ! . " WHERE $page_tbl.id=$recent_tbl.id" ! . " AND pagename='%s'", $dbh->quoteString($pagename))); } *************** *** 191,197 **** return (int)$dbh->getOne(sprintf("SELECT version" ! . " FROM $version_tbl" ! . " INNER JOIN $page_tbl USING(id)" ! . " WHERE pagename='%s'" . " AND version < %d" . " ORDER BY version DESC" --- 198,204 ---- return (int)$dbh->getOne(sprintf("SELECT version" ! . " FROM $version_tbl, $page_tbl" ! . " WHERE $version_tbl.id=$page_tbl.id" ! . " AND pagename='%s'" . " AND version < %d" . " ORDER BY version DESC" *************** *** 229,235 **** $result = $dbh->getRow(sprintf("SELECT $fields" ! . " FROM $page_tbl" ! . " INNER JOIN $version_tbl USING(id)" ! . " WHERE pagename='%s' AND version=%d", $dbh->quoteString($pagename), $version), DB_FETCHMODE_ASSOC); --- 236,243 ---- $result = $dbh->getRow(sprintf("SELECT $fields" ! . " FROM $page_tbl, $version_tbl" ! . " WHERE $page_tbl.id=$version_tbl.id" ! . " AND pagename='%s'" ! . " AND version=%d", $dbh->quoteString($pagename), $version), DB_FETCHMODE_ASSOC); *************** *** 400,407 **** $result = $dbh->query("SELECT $want.*" ! . " FROM $link_tbl" ! . " INNER JOIN $page_tbl AS linker ON linkfrom=linker.id" ! . " INNER JOIN $page_tbl AS linkee ON linkto=linkee.id" ! . " WHERE $have.pagename='$qpagename'" //. " GROUP BY $want.id" . " ORDER BY $want.pagename", --- 408,414 ---- $result = $dbh->query("SELECT $want.*" ! . " FROM $link_tbl, $page_tbl AS linker, $page_tbl AS linkee" ! . " WHERE linkfrom=linker.id AND linkto=linkee.id" ! . " AND $have.pagename='$qpagename'" //. " GROUP BY $want.id" . " ORDER BY $want.pagename", *************** *** 420,424 **** else { $result = $dbh->query("SELECT $page_tbl.*" ! . " FROM $nonempty_tbl INNER JOIN $page_tbl USING(id)" . " ORDER BY pagename"); } --- 427,432 ---- else { $result = $dbh->query("SELECT $page_tbl.*" ! . " FROM $nonempty_tbl $page_tbl" ! . " WHERE $nonempty_tbl.id=$page_tbl.id" . " ORDER BY pagename"); } *************** *** 434,446 **** extract($this->_table_names); ! $table = "$nonempty_tbl INNER JOIN $page_tbl USING(id)"; $fields = "$page_tbl.*"; $callback = '_sql_match_clause'; if ($fullsearch) { ! $table .= (" INNER JOIN $recent_tbl ON $page_tbl.id=$recent_tbl.id" ! . " INNER JOIN $version_tbl" ! . " ON $page_tbl.id=$version_tbl.id" ! . " AND latestversion=version" ); $fields .= ",$version_tbl.*"; $callback = '_fullsearch_sql_match_clause'; --- 442,457 ---- extract($this->_table_names); ! $table = "$nonempty_tbl, $page_tbl"; ! $join_clause = "$nonempty_tbl.id=$page_tbl.id"; $fields = "$page_tbl.*"; $callback = '_sql_match_clause'; if ($fullsearch) { ! $table .= ", $recent_tbl,"; ! $join_clause .= " AND $page_tbl.id=$recent_tbl.id"; ! ! $table .= ", $version_tbl"; ! $join_clause .= " AND $page_tbl.id=$version_tbl.id AND latestversion=version"; ! $fields .= ",$version_tbl.*"; $callback = '_fullsearch_sql_match_clause'; *************** *** 451,455 **** $result = $dbh->query("SELECT $fields FROM $table" ! . " WHERE $search_clause" . " ORDER BY pagename"); --- 462,467 ---- $result = $dbh->query("SELECT $fields FROM $table" ! . " WHERE $join_clause" ! . " AND ($search_clause)" . " ORDER BY pagename"); *************** *** 478,482 **** $limitclause = $limit ? " LIMIT $limit" : ''; $result = $dbh->query("SELECT $page_tbl.*" ! . " FROM $nonempty_tbl INNER JOIN $page_tbl USING(id)" . " ORDER BY hits DESC" . " $limitclause"); --- 490,495 ---- $limitclause = $limit ? " LIMIT $limit" : ''; $result = $dbh->query("SELECT $page_tbl.*" ! . " FROM $nonempty_tbl, $page_tbl" ! . " WHERE $nonempty_tbl.id=$page_tbl.id" . " ORDER BY hits DESC" . " $limitclause"); *************** *** 505,509 **** if ($include_all_revisions) { // Include all revisions of each page. ! $table = "$page_tbl INNER JOIN $version_tbl USING(id)"; if ($exclude_major_revisions) { --- 518,523 ---- if ($include_all_revisions) { // Include all revisions of each page. ! $table = "$page_tbl, $version_tbl"; ! $join_clause = "$page_tbl.id=$version_tbl.id"; if ($exclude_major_revisions) { *************** *** 517,522 **** } else { ! $table = ( "$page_tbl INNER JOIN $recent_tbl USING(id)" ! . " INNER JOIN $version_tbl ON $version_tbl.id=$page_tbl.id"); if ($exclude_major_revisions) { --- 531,538 ---- } else { ! $table = "$page_tbl, $recent_tbl"; ! $join_clause = "$page_tbl.id=$recent_tbl.id"; ! $table .= ", $version_tbl"; ! $join_clause .= " AND $version_tbl.id=$page_tbl.id"; if ($exclude_major_revisions) { *************** *** 535,544 **** $limitclause = $limit ? " LIMIT $limit" : ''; ! $whereclause = $pick ? " WHERE " . join(" AND ", $pick) : ''; // FIXME: use SQL_BUFFER_RESULT for mysql? $result = $dbh->query("SELECT $page_tbl.*,$version_tbl.*" . " FROM $table" ! . $whereclause . " ORDER BY mtime DESC" . $limitclause); --- 551,562 ---- $limitclause = $limit ? " LIMIT $limit" : ''; ! $where_clause = $join_clause; ! if ($pick) ! $where_clause .= " AND " . join(" AND ", $pick); // FIXME: use SQL_BUFFER_RESULT for mysql? $result = $dbh->query("SELECT $page_tbl.*,$version_tbl.*" . " FROM $table" ! . " WHERE $where_clause" . " ORDER BY mtime DESC" . $limitclause); *************** *** 550,557 **** $dbh = &$this->_dbh; extract($this->_table_names); ! ! $maxmajor = "MAX(CASE WHEN minor_edit=0 THEN version END)"; ! $maxminor = "MAX(CASE WHEN minor_edit<>0 THEN version END)"; ! $maxversion = "MAX(version)"; $pageid = (int)$pageid; --- 568,572 ---- $dbh = &$this->_dbh; extract($this->_table_names); ! extract($this->_expressions); $pageid = (int)$pageid; *************** *** 584,591 **** $dbh->query("INSERT INTO $nonempty_tbl (id)" . " SELECT $recent_tbl.id" ! . " FROM $recent_tbl INNER JOIN $version_tbl" ! . " ON $recent_tbl.id=$version_tbl.id" ! . " AND version=latestversion" ! . " WHERE content<>''" . ( $pageid ? " AND $recent_tbl.id=$pageid" : "")); --- 599,606 ---- $dbh->query("INSERT INTO $nonempty_tbl (id)" . " SELECT $recent_tbl.id" ! . " FROM $recent_tbl, $version_tbl" ! . " WHERE $recent_tbl.id=$version_tbl.id" ! . " AND version=latestversion" ! . " AND content<>''" . ( $pageid ? " AND $recent_tbl.id=$pageid" : "")); Index: mysql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/mysql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mysql.php 2001/09/18 19:16:23 1.1 --- mysql.php 2001/11/17 00:49:29 1.2 *************** *** 8,11 **** --- 8,22 ---- { /** + * Constructor. + */ + function WikiDB_backend_mysql($dbparams) { + $this->WikiDB_backend_PearDB($dbparams); + + // Older MySQL's don't have CASE WHEN ... END + $this->_expressions['maxmajor'] = "MAX(IF(minor_edit=0,version,NULL))"; + $this->_expressions['maxminor'] = "MAX(IF(minor_edit<>0,version,NULL))"; + } + + /** * Pack tables. */ |
From: Geoffrey T. D. <da...@us...> - 2001-11-16 22:59:05
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv2140/lib Modified Files: transform.php Log Message: Hack/fix to get proper nesting of lists and list items. (Lists are allowed to contain list items but not other lists. List items are allowed to contain sub lists.) Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** transform.php 2001/11/16 21:02:58 1.26 --- transform.php 2001/11/16 22:59:02 1.27 *************** *** 11,73 **** class WikiTransform { - /* - function WikiTransform() -- init - - function register($type, $function, [$regexp]) - Registers transformer functions - This should be done *before* calling do_transform - - $type: - WT_MODE_MARKUP - If one WT_MODE_MARKUP really sets the html mode, then - all successive WT_MODE_MARKUP functions are skipped - WT_TOKENIZER - The transformer function is called once for each match - of the $regexp in the line. The matched values are tokenized - to protect them from further transformation. - - $function: function name - - $regexp: Required for WT_TOKENIZER functions. Optional for others. - If given, the transformer function will only be called if the - line matches the $regexp. - - function SetHTMLMode($tag, $tagtype, $level) - This is a helper function used to keep track of what HTML - block-level element we are currently processing. - Block-level elements are things like paragraphs "<p>", - pre-formatted text "<pre>", and the various list elements: - "<ul>", "<ol>" and "<dl>". Note that some of these elements - can be nested, while others can not. (In particular, according to - the HTML 4.01 specification, a paragraph "<p>" element is not - allowed to contain any other block-level elements. Also <pre>, - <li>, <dt>, <dd>, <h1> ... have this same restriction.) - - SetHTMLMode generates whatever HTML is necessary to get us into - the requested element type at the requested nesting level. - - $tag ... type of HTML element to open. - If $tag is an array, $tag[0] gives the element type, - and $tag[1] should be a hash containing attribute-value - pairs for the element. - - If $tag is the empty string, all open elements (down to the - level requested by $level) are closed. Use - SetHTMLMode('',0) to close all open block-level elements. - - $level ... requested nesting level for current element. - The nesting level for top level block is one (which is - the default). - - Nesting is arbitrary limited to 10 levels - - function do_transform($html, $content) - contains main-loop and calls transformer functions - - $html ... HTML header (if needed, otherwise '') - $content ... wiki markup as array of lines - */ - - // public variables (only meaningful during do_transform) var $linenumber; // current linenumber --- 11,14 ---- *************** *** 82,86 **** var $stack; // stack for SetHTMLMode (keeping track of open tags) ! // init function function WikiTransform() { --- 23,27 ---- var $stack; // stack for SetHTMLMode (keeping track of open tags) ! /** init function */ function WikiTransform() { *************** *** 89,100 **** } ! // register transformation functions function register($type, $function, $regexp = false) { $this->trfrm_func[] = array ($type, $function, $regexp); } ! ! // sets current mode like list, preformatted text, plain text, ... ! // takes care of closing (open) tags function SetHTMLMode($tag, $level = 1) { --- 30,93 ---- } ! /** ! * Register transformation functions ! * ! * This should be done *before* calling do_transform ! * ! * @param $type enum <dl> ! * <dt>WT_MODE_MARKUP</dt> ! * <dd>If one WT_MODE_MARKUP really sets the html mode, then ! * all successive WT_MODE_MARKUP functions are skipped.</dd> ! * <dt>WT_TOKENIZER</dt> ! * <dd> The transformer function is called once for each match ! * of the $regexp in the line. The matched values are tokenized ! * to protect them from further transformation.</dd> ! * ! * @param $function string Function name ! * @param $regexp string Required for WT_TOKENIZER functions. ! * Optional for others. If given, the transformer function will only be ! * called if the line matches the $regexp. ! */ function register($type, $function, $regexp = false) { $this->trfrm_func[] = array ($type, $function, $regexp); } ! ! /** ! * Sets current mode like list, preformatted text, plain text ! * ! * Takes care of closing (open) tags ! * ! * This is a helper function used to keep track of what HTML ! * block-level element we are currently processing. ! * Block-level elements are things like paragraphs "<p>", ! * pre-formatted text "<pre>", and the various list elements: ! * "<ul>", "<ol>" and "<dl>". Now, SetHTMLMode is also used to ! * keep track of "<li>" and "<dd>" elements. Note that some of these elements ! * can be nested, while others can not. (In particular, according to ! * the HTML 4.01 specification, a paragraph "<p>" element is not ! * allowed to contain any other block-level elements. Also <pre>, ! * <li>, <dt>, <dd>, <h1> ... have this same restriction.) ! * ! * SetHTMLMode generates whatever HTML is necessary to get us into ! * the requested element type at the requested nesting level. ! * ! * @param $tag string Type of HTML element to open. ! * ! * If $tag is an array, $tag[0] gives the element type, ! * and $tag[1] should be a hash containing attribute-value ! * pairs for the element. ! * ! * If $tag is the empty string, all open elements (down to the ! * level requested by $level) are closed. Use ! * SetHTMLMode('',0) to close all open block-level elements. ! * ! * @param $level string Rrequested nesting level for current element. ! * The nesting level for top level block is one (which is ! * the default). ! * Nesting is arbitrary limited to 20 levels. ! * ! * @return string Returns the HTML markup to open the specified element. ! */ function SetHTMLMode($tag, $level = 1) { *************** *** 111,115 **** $retvar = ''; ! if ($level > 10) { // arbitrarily limit tag nesting ExitWiki(gettext ("Lists nested too deep in SetHTMLOutputMode")); --- 104,108 ---- $retvar = ''; ! if ($level > 20) { // arbitrarily limit tag nesting ExitWiki(gettext ("Lists nested too deep in SetHTMLOutputMode")); *************** *** 133,137 **** } ! } else {// $level > $this->stack->cnt() // Test for and close top level elements which are not allowed to contain // other block-level elements. --- 126,131 ---- } ! } ! else {// $level > $this->stack->cnt() // Test for and close top level elements which are not allowed to contain // other block-level elements. *************** *** 139,144 **** preg_match('/^(p|pre|h\d)$/i', $this->stack->top())) { ! $closetag = $this->stack->pop(); ! $retvar .= "</$closetag>"; } --- 133,138 ---- preg_match('/^(p|pre|h\d)$/i', $this->stack->top())) { ! $closetag = $this->stack->pop(); ! $retvar .= "</$closetag>"; } *************** *** 161,166 **** // So now, when we need extra list elements, we use a <dl>, and // open it with an empty <dd>. ! $retvar .= "<dl><dd>"; ! $this->stack->push('dl'); } --- 155,161 ---- // So now, when we need extra list elements, we use a <dl>, and // open it with an empty <dd>. ! $el = $this->stack->cnt() % 2 == 0 ? 'dl' : 'dd'; ! $retvar .= "<$el>"; ! $this->stack->push($el); } *************** *** 171,180 **** return $this->token($retvar); } - // end SetHTMLMode ! // work horse and main loop ! // this function does the transform from wiki markup to HTML function do_transform($html, $content) { --- 166,214 ---- return $this->token($retvar); + } + + /** + * Start new list item element. + * + * This closes any currently open list items at the specified level or deeper, + * then opens a new list item element. + * + * @param $list_type string Type of list element to open. This should + * be one of 'dl', 'ol', or 'ul'. + * + * @param $level integer Nesting depth for list item. Should be a positive integer. + * + * @param $defn_term string Definition term. Specifies the contents for the + * <dt> element. Only used if $list_type is 'dl'. + * + * @return string HTML + */ + function ListItem($list_type, $level, $defn_term = '') + { + $retval = $this->SetHTMLMode($list_type, 2 * $level - 1); + if ($list_type == 'dl') { + $retval .= Element('dt', $defn_term); + $retval .= $this->SetHTMLMode('dd', 2 * $level); + } + else { + $retval .= $this->SetHTMLMode('li', 2 * $level); + } + return $retval; } ! /** Work horse and main loop. ! * ! * This function does the transform from wiki markup to HTML. ! * ! * Contains main-loop and calls transformer functions. ! * ! * @param $html string HTML header (if needed, otherwise '') ! * (This string is prepended to the return value.) ! * ! * @param $content array Wiki markup as array of lines ! * ! * @return string HTML ! */ function do_transform($html, $content) { *************** *** 510,515 **** $numtabs = strlen($matches[1]); $line = preg_replace("/^([#*]*\*)/", '', $line); ! $html = $trfrm->SetHTMLMode('ul', $numtabs); ! $line = $html . Element('li', $line); } return $line; --- 544,548 ---- $numtabs = strlen($matches[1]); $line = preg_replace("/^([#*]*\*)/", '', $line); ! $line = $trfrm->ListItem('ul', $numtabs) . $line; } return $line; *************** *** 521,526 **** $numtabs = strlen($matches[1]); $line = preg_replace("/^([#*]*\#)/", "", $line); ! $html = $trfrm->SetHTMLMode('ol', $numtabs); ! $line = $html . Element('li', $line); } return $line; --- 554,558 ---- $numtabs = strlen($matches[1]); $line = preg_replace("/^([#*]*\#)/", "", $line); ! $line = $trfrm->ListItem('ol', $numtabs) . $line; } return $line; *************** *** 532,539 **** if (preg_match("/^([#*;]*;)(.*?):(.*$)/", $line, $matches)) { $numtabs = strlen($matches[1]); ! $line = $trfrm->SetHTMLMode('dl', $numtabs); ! if(trim($matches[2])) ! $line .= Element('dt', $matches[2]); ! $line .= Element('dd', $matches[3]); } return $line; --- 564,568 ---- if (preg_match("/^([#*;]*;)(.*?):(.*$)/", $line, $matches)) { $numtabs = strlen($matches[1]); ! $line = $trfrm->ListItem('dl', $numtabs, $matches[2]) . $matches[3]; } return $line; |
From: Geoffrey T. D. <da...@us...> - 2001-11-16 21:03:01
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv5531/lib Modified Files: transform.php Log Message: Fix regexp so that punctuation does not get included in the rhs of interwiki links (without the use of square brackets, that is.) Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** transform.php 2001/11/14 21:05:38 1.25 --- transform.php 2001/11/16 21:02:58 1.26 *************** *** 296,300 **** $transform->register(WT_TOKENIZER, 'wtt_interwikilinks', pcre_fix_posix_classes("!?(?<![[:alnum:]])") . ! "$InterWikiLinkRegexp:\\S+"); } $transform->register(WT_TOKENIZER, 'wtt_bumpylinks', "!?$WikiNameRegexp"); --- 296,300 ---- $transform->register(WT_TOKENIZER, 'wtt_interwikilinks', pcre_fix_posix_classes("!?(?<![[:alnum:]])") . ! "$InterWikiLinkRegexp:[^\\s.,;?]+"); } $transform->register(WT_TOKENIZER, 'wtt_bumpylinks', "!?$WikiNameRegexp"); |