cvs: peardoc /scripts make-chm.php
| From: | anatoly techtonik | Date: | Sun, 04 Dec 2005 08:59:55 +0000 |
| Subject: | cvs: peardoc /scripts make-chm.php | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7261@lists.php.net to get a copy of this message | ||
techtonik Sun Dec 4 03:59:55 2005 EDT
Modified files:
/peardoc/scripts make-chm.php
Log:
- remove makefile dependency - language passed by parameter
- do not try to copy CVS subdirectories
- do not touch timezone chaos
http://cvs.php.net/diff.php/peardoc/scripts/make-chm.php?r1=1.3&r2=1.4&ty=u
Index: peardoc/scripts/make-chm.php
diff -u peardoc/scripts/make-chm.php:1.3 peardoc/scripts/make-chm.php:1.4
--- peardoc/scripts/make-chm.php:1.3 Tue Nov 29 12:44:32 2005
+++ peardoc/scripts/make-chm.php Sun Dec 4 03:59:50 2005
@@ -17,7 +17,7 @@
| anatoly techtonik <techtonik@php.net> |
+----------------------------------------------------------------------+
- $Id: make-chm.php,v 1.3 2005/11/29 17:44:32 wiesemann Exp $
+ $Id: make-chm.php,v 1.4 2005/12/04 08:59:50 techtonik Exp $
*/
/**
@@ -43,10 +43,10 @@
$cwd = dirname(__FILE__);
-// determine which language is configured
-$makefile = file_get_contents($cwd . '/../Makefile');
-preg_match('#^chm: html chm/pear_manual_([a-z_]{2,5})\.hhp$#ims', $makefile, $matches);
-$lang = $matches[1];
+// determine language from first command line parameter
+$lang = (isset($argv[1])) ? $argv[1] : "en";
+
+echo "Preparing '$lang' version of CHM manual...\n";
$ind = "$cwd/../html"; // source directory
$chmd = "$cwd/../chm"; // path for HH project files (autopurged)
@@ -143,7 +143,9 @@
copyr($ind, $outd);
-foreach (glob("$cwd/htmlhelp/*") as $suppfile) {
+// avoid copy of subdirectories, such as CVS
+$files = array_diff(glob("$cwd/htmlhelp/*"), glob("$cwd/htmlhelp/*",
GLOB_ONLYDIR));
+foreach ($files as $suppfile) {
copy($suppfile, "$outd/".basename($suppfile));
}
$thtmlfiles = glob("$outd/*.html");
@@ -240,7 +242,7 @@
preg_match("!pubdate\".*?>(.+?)<!is", $index, $matches);
// $matches[1] is Wed Mar 2 20:31:52 JST 2005
list($dw, $m, $d, $time, $l, $Y) = sscanf($matches[1], "%s %s %d %s %s %s");
-echo "\nPubdate: " . $date = date("d-m-Y", strtotime("$dw, $d $m $Y $time
$l"));
+echo "\nPubdate: " . $date = date("d-m-Y", strtotime("$dw, $d $m $Y
$time"));
preg_match("!©[^<]+!is", $index, $matches);
$copy = $matches[0];