nlopess Sun Jul 10 13:34:59 2005 EDT Added files: /phpdoc/en make_chm_index.html
Removed files: /phpdoc/en make_chm_index_en.html Modified files: /phpdoc/scripts revcheck.php /phpdoc/chm common.php make_chm.bat make_chm.php make_chm_fancy.php /phpdoc Makefile.in Log: backport my fixes from smarty docs to chm scripts: * add a simple 'make chm' option * allow the main page to be localized * update the contributors list
http://cvs.php.net/diff.php/phpdoc/scripts/revcheck.php?r1=1.50&r2=1.51&ty=u Index: phpdoc/scripts/revcheck.php diff -u phpdoc/scripts/revcheck.php:1.50 phpdoc/scripts/revcheck.php:1.51 --- phpdoc/scripts/revcheck.php:1.50 Sat Jul 2 15:11:58 2005 +++ phpdoc/scripts/revcheck.php Sun Jul 10 13:34:58 2005 @@ -326,8 +326,7 @@ // If we found a file functions.xml in the // <lang>/reference/ tree, skip the file if ( - $file == "make_chm_index_en.html" - || $file == "rsusi.txt" + $file == "rsusi.txt" || $file == "README" || $file == "contributors.xml" || $file == "contributors.ent" http://cvs.php.net/diff.php/phpdoc/chm/common.php?r1=1.3&r2=1.4&ty=u Index: phpdoc/chm/common.php diff -u phpdoc/chm/common.php:1.3 phpdoc/chm/common.php:1.4 --- phpdoc/chm/common.php:1.3 Mon May 12 12:14:31 2003 +++ phpdoc/chm/common.php Sun Jul 10 13:34:59 2005 @@ -5,18 +5,6 @@ $LANGUAGE = getenv("PHP_HELP_COMPILE_LANG"); $INTERNAL_CHARSET = "UTF-8"; -// backwards compatibility -if (!function_exists("file_get_contents")) { - function file_get_contents($file) - { - $cnt = file($file); - if ($cnt !== false) { - return join('', $cnt); - } - return false; - } -} - // Return a file joined on one line function oneLiner($filename, $only_tags = false) { @@ -73,7 +61,7 @@ // Returns the name of character set in the given document function detectDocumentCharset($doc) { - if (preg_match("/<META\\s+HTTP-EQUIV=\"CONTENT-TYPE\"\\s+CONTENT=\"TEXT\\/HTML;\\s+CHARSET=([\\w\\d-]*)\"\\s*>/iU", $doc, $reg)) { + if (preg_match('/<META[^>]+CHARSET=["\'\s]?([\w\d-]+)["\'\s]?\s*>/iS', $doc, $reg)) { return $reg[1]; } return false; http://cvs.php.net/diff.php/phpdoc/chm/make_chm.bat?r1=1.2&r2=1.3&ty=u Index: phpdoc/chm/make_chm.bat diff -u phpdoc/chm/make_chm.bat:1.2 phpdoc/chm/make_chm.bat:1.3 --- phpdoc/chm/make_chm.bat:1.2 Sun May 19 05:29:58 2002 +++ phpdoc/chm/make_chm.bat Sun Jul 10 13:34:59 2005 @@ -3,20 +3,17 @@ rem !! Please read the make_chm.README file for information rem !! about how to build a "php_manual_lang.chm" file. -rem Path of the PHP CGI executable -set PHP_PATH=D:\progra~1\php404\php.exe +rem Path of the PHP CLI executable +set PHP_PATH=php rem Path of the Help Compiler command line tool -set PHP_HELP_COMPILER=D:\progra~1\helpwo~1\hhc.exe - -rem The language of the manual to compile -set PHP_HELP_COMPILE_LANG=en +set PHP_HELP_COMPILER=C:\progra~1\htmlhe~1\hhc.exe rem The source directory with the original DSSSL made HTML set PHP_HELP_COMPILE_DIR=html rem The directory, where the fancy files need to be copied -set PHP_HELP_COMPILE_FANCYDIR=fancy +set PHP_HELP_COMPILE_FANCYDIR=chm\fancy rem ========================================================== rem !!!!! DO NOT MODIFY ANYTHING BELOW THIS LINE !!!!! @@ -24,13 +21,16 @@ echo. -if a%1a == anormala goto skipfancy +set PHP_HELP_COMPILE_LANG=%1 +if "%1" == "" set PHP_HELP_COMPILE_LANG=en + +echo Language choosen: %PHP_HELP_COMPILE_LANG% + +if a%2a == anormala goto skipfancy echo Now generating the fancy manual in %PHP_HELP_COMPILE_FANCYDIR% dir... IF NOT EXIST %PHP_HELP_COMPILE_FANCYDIR%\NUL md %PHP_HELP_COMPILE_FANCYDIR% -IF NOT EXIST %PHP_HELP_COMPILE_FANCYDIR%\figures md %PHP_HELP_COMPILE_FANCYDIR%\figures -copy %PHP_HELP_COMPILE_DIR%\figures\*.* %PHP_HELP_COMPILE_FANCYDIR%\figures\*.* -%PHP_PATH% -q make_chm_fancy.php +%PHP_PATH% chm\make_chm_fancy.php goto normal @@ -41,14 +41,14 @@ :normal echo Now running the toc and project file generator script... -%PHP_PATH% -q make_chm.php +%PHP_PATH% chm\make_chm.php echo Compiling the actual helpfile (php_manual_%PHP_HELP_COMPILE_LANG%.chm)... -%PHP_HELP_COMPILER% php_manual_%PHP_HELP_COMPILE_LANG%.hhp +%PHP_HELP_COMPILER% chm\php_manual_%PHP_HELP_COMPILE_LANG%.hhp echo. echo Cleaning up the directory -rem del php_manual_%PHP_HELP_COMPILE_LANG%.hh? +del chm\php_manual_%PHP_HELP_COMPILE_LANG%.hh? echo Done! echo. http://cvs.php.net/diff.php/phpdoc/chm/make_chm.php?r1=1.23&r2=1.24&ty=u Index: phpdoc/chm/make_chm.php diff -u phpdoc/chm/make_chm.php:1.23 phpdoc/chm/make_chm.php:1.24 --- phpdoc/chm/make_chm.php:1.23 Wed Apr 27 13:07:06 2005 +++ phpdoc/chm/make_chm.php Sun Jul 10 13:34:59 2005 @@ -19,11 +19,11 @@ // Files on the top level of the TOC $MAIN_FILES = array( "getting-started.html", + "install.html", "langref.html", "security.html", "features.html", "funcref.html", - "zend.html", "api.html", "faq.html", "appendixes.html" @@ -51,8 +51,8 @@ global $LANGUAGE, $MANUAL_TITLE, $HEADER, $MAIN_FILES, $HTML_PATH, $INDEX_IN_HTML, $FIRST_PAGE; - $toc = fopen("php_manual_$LANGUAGE.hhc", "w"); - $index = fopen("php_manual_$LANGUAGE.hhk", "w"); + $toc = fopen("chm/php_manual_$LANGUAGE.hhc", "w"); + $index = fopen("chm/php_manual_$LANGUAGE.hhk", "w"); // Write out file headers fputs_wrapper($toc, $HEADER); @@ -131,16 +131,18 @@ } else { $FIRST_PAGE = $INDEX_IN_HTML; } - + + $FIRST_PAGEP = substr($FANCY_PATH, 4) . "\\$FIRST_PAGE"; + // Start writing the project file - $project = fopen("php_manual_$LANGUAGE.hhp", "w"); + $project = fopen("chm/php_manual_$LANGUAGE.hhp", "w"); fputs_wrapper($project, "[OPTIONS]\n"); fputs_wrapper($project, "Compatibility=1.1 or later\n"); fputs_wrapper($project, "Compiled file=php_manual_$LANGUAGE.chm\n"); fputs_wrapper($project, "Contents file=php_manual_$LANGUAGE.hhc\n"); fputs_wrapper($project, "Index file=php_manual_$LANGUAGE.hhk\n"); fputs_wrapper($project, "Default Window=phpdoc\n"); - fputs_wrapper($project, "Default topic=$FANCY_PATH\\$FIRST_PAGE\n"); + fputs_wrapper($project, "Default topic=$FIRST_PAGEP\n"); fputs_wrapper($project, "Display compile progress=Yes\n"); fputs_wrapper($project, "Full-text search=Yes\n"); @@ -161,14 +163,14 @@ // Define the phpdoc window style (adds more functionality) fputs_wrapper($project, "\n[WINDOWS]\nphpdoc=\"$MANUAL_TITLE\",\"php_manual_$LANGUAGE.hhc\",\"php_manual_$LANGUAGE.hhk\"," . - "\"$FANCY_PATH\\$FIRST_PAGE\",\"$FANCY_PATH\\$FIRST_PAGE\",,,,,0x23520,,0x386e,,,,,,,,0\n"); + "\"$FIRST_PAGEP\",\"$FIRST_PAGEP\",,,,,0x23520,,0x386e,,,,,,,,0\n"); // Write out all the filenames as in FANCY_PATH fputs_wrapper($project, "\n[FILES]\n"); $handle = opendir($FANCY_PATH); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { - fputs_wrapper($project, "$FANCY_PATH\\$file\n"); + fputs_wrapper($project, substr($FANCY_PATH, 4)."\\$file\n"); } } closedir($handle); @@ -184,17 +186,17 @@ fputs_wrapper($toc, " $tabs<li><object type=\"text/sitemap\"> $tabs <param name=\"Name\" value=\"$name\"> -$tabs <param name=\"Local\" value=\"$FANCY_PATH\\$local\"> +$tabs <param name=\"Local\" value=\"".substr($FANCY_PATH, 4)."\\$local\"> "); if ($imgnum != "auto") { - fputs_wrapper($toc, "$tabs <param name=\"ImageNumber\" value=\"$imgnum\">\n"); + fputs_wrapper($toc, "$tabs <param name=\"ImageNumber\" value=\"$imgnum\">\r\n"); } - fputs_wrapper($toc, "$tabs </object>\n"); + fputs_wrapper($toc, "$tabs </object>\r\n"); fputs_wrapper($index, " <li><object type=\"text/sitemap\"> - <param name=\"Local\" value=\"$FANCY_PATH\\$local\"> + <param name=\"Local\" value=\"".substr($FANCY_PATH, 4)."\\$local\"> <param name=\"Name\" value=\"$name\"> </object></li> "); @@ -207,10 +209,10 @@ { global $HTML_PATH; $contents = oneLiner("$HTML_PATH/$filename"); - + // Find all sublinks if (preg_match_all("!<DT\\s*><A\\s+HREF=\"(([\\w\\.-]+\\.)+html)(\\#[\\w\\.-]+)?\"\\s*>(.*)</A\\s*>!U", $contents, $matches, PREG_SET_ORDER)) { - + // Print out the file informations for all the links fputs_wrapper($toc, "\n <ul>"); foreach ($matches as $onematch) { http://cvs.php.net/diff.php/phpdoc/chm/make_chm_fancy.php?r1=1.11&r2=1.12&ty=u Index: phpdoc/chm/make_chm_fancy.php diff -u phpdoc/chm/make_chm_fancy.php:1.11 phpdoc/chm/make_chm_fancy.php:1.12 --- phpdoc/chm/make_chm_fancy.php:1.11 Fri Jul 11 10:50:26 2003 +++ phpdoc/chm/make_chm_fancy.php Sun Jul 10 13:34:59 2005 @@ -39,12 +39,8 @@ closedir($handle); // Look for CHM index file (snap-downloader, cvs-usr with/without lang-support) -if (false == ($content = oneLiner("make_chm_index_$LANGUAGE.html", true))) { - if (false == ($content = oneLiner("$LANGUAGE/make_chm_index_$LANGUAGE.html", true))) { - if (false == ($content = oneLiner("$HTML_PATH/../$LANGUAGE/make_chm_index_$LANGUAGE.html", true))) { - $content = oneLiner("en/make_chm_index_en.html", true); - } - } +if (false == ($content = oneLiner("$LANGUAGE/make_chm_index.html", true))) { + $content = oneLiner("en/make_chm_index.html", true); } // Make GENTIME the actual date/time http://cvs.php.net/diff.php/phpdoc/Makefile.in?r1=1.167&r2=1.168&ty=u Index: phpdoc/Makefile.in diff -u phpdoc/Makefile.in:1.167 phpdoc/Makefile.in:1.168 --- phpdoc/Makefile.in:1.167 Mon Apr 11 16:38:08 2005 +++ phpdoc/Makefile.in Sun Jul 10 13:34:59 2005 @@ -16,7 +16,7 @@ # # -# $Id: Makefile.in,v 1.167 2005/04/11 20:38:08 techtonik Exp $ +# $Id: Makefile.in,v 1.168 2005/07/10 17:34:59 nlopess Exp $ # all: html @@ -257,6 +257,9 @@ install.html: install.xml $(HTML_DEPS) $(JADE) $(CATALOG) -V nochunks -d dsssl/install.dsl -t sgml $(XMLDCL) install.xml > $@ +chm: html FORCE + chm/make_chm.bat $(LANG) + # File endings we are going to define general rules for: .SUFFIXES: .html .xml .sgml .tex .dvi .ps .pdf .rtf .gz .bz2 .txt .PRECIOUS: %.html %.dvi http://cvs.php.net/co.php/phpdoc/en/make_chm_index.html?r=1.1&p=1 Index: phpdoc/en/make_chm_index.html +++ phpdoc/en/make_chm_index.html <HTML> <HEAD> <TITLE>PHP Manual</TITLE> <META NAME="HTTP_EQUIV" CONTENT="text/html; charset=ISO-8859-1"> <LINK REL="STYLESHEET" HREF="style.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" TOPMARGIN="0" LEFTMARGIN="0"> <TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0" CELLPADDING="0"> <TR><TD COLSPAN="3"><DIV CLASS="NAVHEADER"><TABLE BGCOLOR="#CCCCFF" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD><TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0"><TR><TH COLSPAN="3">PHP Manual</TH></TR><TR><TD COLSPAN="3" ALIGN="center"> </TD></TR></TABLE></TD></TR><TR BGCOLOR="#333366"> <TD><IMG SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR></TABLE></DIV></TD></TR> <TR><TD><IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1"></TD><TD HEIGHT="100%" VALIGN="MIDDLE" WIDTH="100%"><BR> <P><TABLE ALIGN="CENTER"> <TR><TD ALIGN="CENTER"> <H1 CLASS="title">PHP Manual</H1> <div class="author">Mehdi Achour</div> <div class="author">Friedhelm Betz</div> <div class="author">Antony Dovgal</div> <div class="author">Nuno Lopes</div> <div class="author">Philip Olson</div> <div class="author">Georg Richter</div> <div class="author">Damien Seguy</div> <div class="author">Jakub Vrana</div> <H4 CLASS="EDITEDBY">Edited by</H4> <H3 CLASS="editor">Gabor Hojtsy</H3> </TD></TR></TABLE> <BR><P ALIGN="CENTER">This file was generated: [GENTIME]<BR> Go to <A HREF="http://www.php.net/docs.php">http://www.php.net/docs.php</A> to get the actual version.</P> <BR><P CLASS="copyright" ALIGN="CENTER"><A HREF="copyright.html">Copyright</A> © 1997 - 2005 the PHP Documentation Group</P> </TD><TD><IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1"></TD></TR> <TR><TD COLSPAN="3"><DIV CLASS="NAVFOOTER"><TABLE BGCOLOR="#CCCCFF" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#333366"> <TD><IMG SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR> <TR><TD><TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0"> <TR><TD COLSPAN="3"> </TD></TR><TR><TD COLSPAN="3" ALIGN="center"> </TD> </TR></TABLE></TD></TR></TABLE></DIV></TD></TR></TABLE> </BODY></HTML>