iliaa Sat Aug 14 17:34:05 2004 EDT
Modified files: /livedocs build-ops.in build.sh configure.in mk_notes.php mkindex.php style_mapping.php toc.xsl /livedocs/themes/default html_format.php Log: Patches from http://livedocs.aborla.net/ build.misc format_listing.nl themes.default toc-and-links user-notes
http://cvs.php.net/diff.php/livedocs/build-ops.in?r1=1.8&r2=1.9&ty=u Index: livedocs/build-ops.in diff -u livedocs/build-ops.in:1.8 livedocs/build-ops.in:1.9 --- livedocs/build-ops.in:1.8 Tue May 4 21:35:41 2004 +++ livedocs/build-ops.in Sat Aug 14 17:34:05 2004 @@ -16,6 +16,5 @@ # "en" should be the first! # LANGUAGES="en ar cs de es fi fr he hk hu it ja kr lt nl pl pt_BR ro ru sk sl sv tr tw zh" LANGUAGES="@LANGUAGES@" -TOKEN="@TOKEN@" - [EMAIL PROTECTED]@ http://cvs.php.net/diff.php/livedocs/build.sh?r1=1.24&r2=1.25&ty=u Index: livedocs/build.sh diff -u livedocs/build.sh:1.24 livedocs/build.sh:1.25 --- livedocs/build.sh:1.24 Tue May 4 21:37:02 2004 +++ livedocs/build.sh Sat Aug 14 17:34:05 2004 @@ -6,10 +6,9 @@ echo "####################" -if test -n "$TOKEN" ; then - export TOKEN +if test -n "$NOTES_MIRROR" ; then echo "Building user notes" - ${PHP} ${LIVEDOCSFORPHP}/mk_notes.php ${OUTPUTDIR} + ${PHP} ${LIVEDOCSFORPHP}/mk_notes.php ${OUTPUTDIR} ${GENDIR} ${NOTES_MIRROR} fi # running ./buildconf @@ -63,4 +62,4 @@ echo -n "End: " date -#rm -f ${GENDIR}/toc-ugly.xml ${GENDIR}/toc-insert.sql +rm -f ${GENDIR}/toc-ugly.xml ${GENDIR}/toc-insert.sql http://cvs.php.net/diff.php/livedocs/configure.in?r1=1.27&r2=1.28&ty=u Index: livedocs/configure.in diff -u livedocs/configure.in:1.27 livedocs/configure.in:1.28 --- livedocs/configure.in:1.27 Fri Jul 30 11:19:25 2004 +++ livedocs/configure.in Sat Aug 14 17:34:05 2004 @@ -1,5 +1,5 @@ ## A configure script -## $Id: configure.in,v 1.27 2004/07/30 15:19:25 iliaa Exp $ +## $Id: configure.in,v 1.28 2004/08/14 21:34:05 iliaa Exp $ AC_PREREQ(2.13) AC_INIT(livedoc.php) @@ -83,9 +83,9 @@ fi ],[FORCE_DYNAMIC=1]) -AC_ARG_WITH(notes-token,[ --with-notes-token=token Token for fetching user notes], - [TOKEN="$withval"], - [TOKEN=""]) +AC_ARG_WITH(notes-mirror,[ --with-notes-mirror=MIRROR Select a mirror to fetch user notes (e.g. pt)], + [NOTES_MIRROR="$withval"], + [NOTES_MIRROR=""]) AC_ARG_WITH(web-base,[ --with-web-base[=DIR] Relative URL for livedocs links [default=/]], [WEBBASE="$withval"], @@ -127,7 +127,7 @@ AC_SUBST(LIVEDOCSFORPHP) AC_SUBST(OUTPUTDIRFORPHP) AC_SUBST(XSLTPROC) -AC_SUBST(TOKEN) +AC_SUBST(NOTES_MIRROR) AC_OUTPUT(build-ops config.php .htaccess) @@ -135,8 +135,9 @@ AC_MSG_ERROR([HEY!! You should probably mkdir $OUTPUTDIR...]) else echo "Copying livedoc files to $OUTPUTDIR..." - cp common.php config.php .htaccess $OUTPUTDIR + cp config.php .htaccess $OUTPUTDIR rm -f .htaccess + $lncmd $LIVEDOCS/common.php $OUTPUTDIR/common.php $lncmd $LIVEDOCS/livedoc.php $OUTPUTDIR/index.php $lncmd $LIVEDOCS/livedoc_funcs.php $OUTPUTDIR/livedoc_funcs.php $lncmd $LIVEDOCS/error.php $OUTPUTDIR/error.php http://cvs.php.net/diff.php/livedocs/mk_notes.php?r1=1.2&r2=1.3&ty=u Index: livedocs/mk_notes.php diff -u livedocs/mk_notes.php:1.2 livedocs/mk_notes.php:1.3 --- livedocs/mk_notes.php:1.2 Sun Aug 8 06:49:34 2004 +++ livedocs/mk_notes.php Sat Aug 14 17:34:05 2004 @@ -19,9 +19,7 @@ // | livedocs. | // +----------------------------------------------------------------------+ // -// $Id: mk_notes.php,v 1.2 2004/08/08 10:49:34 goba Exp $ - -$token = getenv("TOKEN"); +// $Id: mk_notes.php,v 1.3 2004/08/14 21:34:05 iliaa Exp $ $create = <<<SQL BEGIN; @@ -37,6 +35,8 @@ SQL; $dbname = $argv[1] . '/livedoc-notes.sqlite'; +$tmpdir = $argv[2]; +$mirror = $argv[3]; if (file_exists($dbname)) unlink($dbname); @@ -49,11 +49,11 @@ $n_notes = 0; $n_data = 0; -if (!empty($token)) { - $fp = fopen("http://master.php.net/fetch/user-notes.php?token=$token", "r"); -} else { - $fp = fopen("./all", "r"); -} + +$name = tempnam($tmpdir, 'notes'); +copy('http://'.$mirror.'.php.net/backend/notes/all.bz2', $name); +$fp = fopen("compress.bzip2://".$name, 'r'); + do { $line = fgets($fp); $n_data += strlen($line); @@ -65,17 +65,11 @@ } list ($id, $sect, $rate, $ts, $user, $note) = explode('|', $line); - $n_notes++; + ++$n_notes; - if (!empty($token)) { - $note = sqlite_escape_string(gzuncompress(base64_decode($note))); - } else { - $note = sqlite_escape_string(base64_decode($note)); - } + $note = sqlite_escape_string(base64_decode($note)); $user = sqlite_escape_string($user); - printf("\r%d notes %d bytes", $n_notes, $n_data); - sqlite_query($DB, "INSERT INTO notes values ($id, '$sect', $rate, $ts, '$user', '$note');"); } while (true); @@ -83,5 +77,8 @@ printf("\rDone: %d notes %d bytes\n", $n_notes, $n_data); sqlite_query($DB, 'COMMIT;'); + +fclose($fp); +unlink($name); ?> http://cvs.php.net/diff.php/livedocs/mkindex.php?r1=1.35&r2=1.36&ty=u Index: livedocs/mkindex.php diff -u livedocs/mkindex.php:1.35 livedocs/mkindex.php:1.36 --- livedocs/mkindex.php:1.35 Tue May 25 07:33:48 2004 +++ livedocs/mkindex.php Sat Aug 14 17:34:05 2004 @@ -19,7 +19,7 @@ // | construct an index | // +----------------------------------------------------------------------+ // -// $Id: mkindex.php,v 1.35 2004/05/25 11:33:48 wez Exp $ +// $Id: mkindex.php,v 1.36 2004/08/14 21:34:05 iliaa Exp $ /* just to be on the safe side */ @@ -87,7 +87,7 @@ } function start_elem($parser, $name, $attrs) { - static $titles = array('TITLE', 'REFNAME'); + static $titles = array('TITLE', 'REFNAME', 'QANDAENTRY', 'VARLISTENTRY'); // if there is an ID attribute, record it if (isset($attrs['ID'])) { http://cvs.php.net/diff.php/livedocs/style_mapping.php?r1=1.19&r2=1.20&ty=u Index: livedocs/style_mapping.php diff -u livedocs/style_mapping.php:1.19 livedocs/style_mapping.php:1.20 --- livedocs/style_mapping.php:1.19 Fri Jul 30 11:16:29 2004 +++ livedocs/style_mapping.php Sat Aug 14 17:34:05 2004 @@ -18,7 +18,7 @@ // | Helper functions for formatting elements | // +----------------------------------------------------------------------+ // -// $Id: style_mapping.php,v 1.19 2004/07/30 15:16:29 iliaa Exp $ +// $Id: style_mapping.php,v 1.20 2004/08/14 21:34:05 iliaa Exp $ // almost XPATH.. ;-) $map = array( @@ -310,7 +310,6 @@ } switch ($node->attributes['role']) { - case 'asp': case 'php': $content = str_replace( array( @@ -334,14 +333,13 @@ $content = preg_replace_callback('{([\w_]+)\s*</span>(\s*<span\s+class="keyword">\s*\()}m', 'format_listing_hyperlink_function', $content); break; + case 'asp': case 'shell': case 'html': case 'xml': case 'c': - $content = '<pre>' . htmlspecialchars($content) . '</pre>'; - break; default: - $content = htmlspecialchars($content); + $content = '<pre>' . htmlspecialchars($content) . '</pre>'; } return sprintf('<div class="%scode"%s>%s</div>', $node->attributes['role'], LTR, $content); } http://cvs.php.net/diff.php/livedocs/toc.xsl?r1=1.2&r2=1.3&ty=u Index: livedocs/toc.xsl diff -u livedocs/toc.xsl:1.2 livedocs/toc.xsl:1.3 --- livedocs/toc.xsl:1.2 Thu Jun 12 06:05:55 2003 +++ livedocs/toc.xsl Sat Aug 14 17:34:05 2004 @@ -41,7 +41,7 @@ <appendix> <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> <xsl:attribute name="title"><xsl:value-of select="title"/></xsl:attribute> - <xsl:apply-templates select="sect1"/> + <xsl:apply-templates select="sect1|section"/> </appendix> </xsl:template> @@ -99,4 +99,3 @@ </chapter> </xsl:template> </xsl:stylesheet> - http://cvs.php.net/diff.php/livedocs/themes/default/html_format.php?r1=1.11&r2=1.12&ty=u Index: livedocs/themes/default/html_format.php diff -u livedocs/themes/default/html_format.php:1.11 livedocs/themes/default/html_format.php:1.12 --- livedocs/themes/default/html_format.php:1.11 Tue May 25 07:33:48 2004 +++ livedocs/themes/default/html_format.php Sat Aug 14 17:34:05 2004 @@ -18,7 +18,7 @@ // | headers and footers for the HTML rendering | // +----------------------------------------------------------------------+ // -// $Id: html_format.php,v 1.11 2004/05/25 11:33:48 wez Exp $ +// $Id: html_format.php,v 1.12 2004/08/14 21:34:05 iliaa Exp $ // in livedoc.php @@ -28,13 +28,13 @@ $charset = CHARSET; $dir = RTL; $head =<<<HEAD -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> -<html lang="$lang"> +<?xml version="1.0" encoding="$charset"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html lang="$lang" xmlns="http://www.w3.org/1999/xhtml" xml:lang="$lang"> <head> <meta http-equiv="Content-Type" content="text/html; charset=$charset"/> <title>$title</title> -<link rel="stylesheet" href="$css_url" /> +<link rel="stylesheet" href="$css_url" type="text/css"/> </head> <body$dir> <table border="0" cellpadding="0" cellspacing="0" width="100%">