cvs: peardoc /scripts make-chm.php

From: Date: Tue, 29 Nov 2005 16:52:54 +0000
Subject: cvs: peardoc /scripts make-chm.php
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-7228@lists.php.net to get a copy of this message
wiesemann Tue Nov 29 11:52:54 2005 EDT Modified files: /peardoc/scripts make-chm.php Log: fixed usage of File_SearchReplace (it only accepts strings, not arrays) http://cvs.php.net/diff.php/peardoc/scripts/make-chm.php?r1=1.1&r2=1.2&ty=u Index: peardoc/scripts/make-chm.php diff -u peardoc/scripts/make-chm.php:1.1 peardoc/scripts/make-chm.php:1.2 --- peardoc/scripts/make-chm.php:1.1 Sun Mar 13 12:47:53 2005 +++ peardoc/scripts/make-chm.php Tue Nov 29 11:52:50 2005 @@ -17,7 +17,7 @@ | anatoly techtonik <techtonik@php.net> | +----------------------------------------------------------------------+ - $Id: make-chm.php,v 1.1 2005/03/13 17:47:53 techtonik Exp $ + $Id: make-chm.php,v 1.2 2005/11/29 16:52:50 wiesemann Exp $ */ /** @@ -139,18 +139,15 @@ copyr($ind, $outd); -echo "Filtering...\n"; - foreach (glob("$cwd/htmlhelp/*") as $suppfile) { copy($suppfile, "$outd/".basename($suppfile)); } $thtmlfiles = glob("$outd/*.html"); -$find_rx = array(); -$replace = array(); +echo "Filtering (</HEAD) ...\n"; -$find_rx[] = '|</HEAD|ims'; -$replace[] = +$find_rx = '|</HEAD|ims'; +$replace = ' <link rel="stylesheet" type="text/css" href="pear.css" /> <link rel="stylesheet" type="text/css" href="custom.css" /> @@ -158,9 +155,21 @@ </HEAD'; +$sr = &new File_SearchReplace( + $find_rx, + $replace, + $thtmlfiles + ); + +$sr->setSearchFunction("preg"); +$sr->doSearch(); + +echo "\nFilter replacements (</HEAD): " . $sr->occurences." ".$sr->last_error; + +echo "Filtering (</BODY) ...\n"; -$find_rx[] = '|</BODY|is'; -$replace[] = ' +$find_rx = '|</BODY|is'; +$replace = ' <div id="context_menu"> <input type="hidden" id="tmpText"> <div id="context_pear"> @@ -220,7 +229,7 @@ $sr->setSearchFunction("preg"); $sr->doSearch(); -echo "\nFilter replacements: " . $sr->occurences." ".$sr->last_error; +echo "\nFilter replacements (</BODY): " . $sr->occurences." ".$sr->last_error; // pull date, copyright from original index.html $index = file_get_contents("$ind/index.html");

« previous php.pear.doc (#7228) next »