![]() PEAR_PackageFileManager : The Definitive Guide |
Table of Contents
This lesson :
teachs you how to manipulate file content with 3 basic tasks
teachs you how to perform complex installation with a post install script
The replace task is nearly identical to the old <replace> tag from package.xml 1.0, and does a text search-and-replace of a file's contents.
In this example we will specialize file pear-phpdoc
contents on installation, with the most
common and used basic task : <tasks:replace>.
Search all @PHP-BIN@
occurences in source file pear-phpdoc
,
and replace them by value of option php_bin (PHP CLI/CGI binary location).
To produce a package.xml
version 1.0
To produce a package.xml
version 2.0
![]() |
Tip |
---|---|
If all your files, or almost all of them as the same task
replacement to do, you can use the addGlobalReplacement() function that accept
same $type, $from, $to parameters (#2, #3, #4) of addReplacement() .
|
PEAR_PackageFileManager : The Definitive Guide | v 1.6.0 : November 17, 2006 |