Re: cvs: peardoc /scripts make-chm.php

From: Date: Sat, 03 Dec 2005 19:00:46 +0000
Subject: Re: cvs: peardoc /scripts make-chm.php
References: 1  Groups: php.pear.doc php.pear.qa 
Request: Send a blank email to pear-qa+get-3309@lists.php.net to get a copy of this message
Hello Mark, Mark, File_SearchReplace accepts arrays also - get it from CVS http://cvs.php.net/cvs.php/pear/File_SearchReplace Martin, can somebody from PEAR group finally give me access to pearweb to release this package? Somebody gave it to user "anatoly" - I can only guess it was an error. From Tuesday, November 29, 2005, 6:52:54 PM, you wrote: MW> wiesemann Tue Nov 29 11:52:54 2005 EDT MW> Modified files: MW> /peardoc/scripts make-chm.php MW> Log: MW> fixed usage of File_SearchReplace (it only accepts strings, not arrays) MW> MW> http://cvs.php.net/diff.php/peardoc/scripts/make-chm.php?r1=1.1&r2=1.2&ty=u MW> Index: peardoc/scripts/make-chm.php MW> diff -u peardoc/scripts/make-chm.php:1.1 MW> peardoc/scripts/make-chm.php:1.2 MW> --- peardoc/scripts/make-chm.php:1.1 Sun Mar 13 12:47:53 2005 MW> +++ peardoc/scripts/make-chm.php Tue Nov 29 11:52:50 2005 MW> @@ -17,7 +17,7 @@ MW> | anatoly techtonik <techtonik@php.net> MW> MW> +----------------------------------------------------------------------+ MW> - $Id: make-chm.php,v 1.1 2005/03/13 17:47:53 techtonik Exp $ MW> + $Id: make-chm.php,v 1.2 2005/11/29 16:52:50 wiesemann Exp $ MW> */ MW> /** MW> @@ -139,18 +139,15 @@ MW> copyr($ind, $outd); MW> -echo "Filtering...\n"; MW> - MW> foreach (glob("$cwd/htmlhelp/*") as $suppfile) { MW> copy($suppfile, "$outd/".basename($suppfile)); MW> } MW> $thtmlfiles = glob("$outd/*.html"); MW> -$find_rx = array(); MW> -$replace = array(); MW> +echo "Filtering (</HEAD) ...\n"; MW> -$find_rx[] = '|</HEAD|ims'; MW> -$replace[] = MW> +$find_rx = '|</HEAD|ims'; MW> +$replace = MW> ' MW> <link rel="stylesheet" type="text/css" href="pear.css" MW> /> MW> <link rel="stylesheet" type="text/css" href="custom.css" MW> /> MW> @@ -158,9 +155,21 @@ MW> </HEAD'; MW> +$sr = &new File_SearchReplace( MW> + $find_rx, MW> + $replace, MW> + $thtmlfiles MW> + ); MW> + +$sr->>setSearchFunction("preg"); +$sr->>doSearch(); MW> + MW> +echo "\nFilter replacements (</HEAD): " . $sr->occurences." MW> ".$sr->last_error; MW> + MW> +echo "Filtering (</BODY) ...\n"; MW> -$find_rx[] = '|</BODY|is'; MW> -$replace[] = ' MW> +$find_rx = '|</BODY|is'; MW> +$replace = ' MW> <div id="context_menu"> MW> <input type="hidden" id="tmpText"> MW> <div id="context_pear"> MW> @@ -220,7 +229,7 @@ MW> $sr->setSearchFunction("preg"); MW> $sr->doSearch(); MW> -echo "\nFilter replacements: " . $sr->occurences." MW> ".$sr->last_error; MW> +echo "\nFilter replacements (</BODY): " . $sr->occurences." MW> ".$sr->last_error; MW> // pull date, copyright from original index.html MW> $index = file_get_contents("$ind/index.html"); -- anatoly

« previous php.pear.qa (#3309) next »