![]() PEAR_PackageFileManager : The Definitive Guide |
Table of Contents
This lesson :
teachs you how to add a new task file provide by a third party to default tasks array.
teachs you how to improve message when dealing with package task handler not installed on your system.
Standard file tasks provided by default, allow to : search-and-replace string into file contents, change line-ending, and add a complex postinstall script.
If you want to specialize your installation with a complex task, you will need first to learn how to create customized task in PHP .
Once a package that reference, manage, the new task file is properly
installed in your system (into directory PEAR/Task/
), you can use it with a call to
addTaskToFile()
.
We suppose to have previously installed a package that manage the new task stripwhitespace.
![]() |
Note |
---|---|
Install the PEAR_Task_Stripwhitespace package version 0.1.0 on
__URI channel.
pear install http://pear.laurent-laville.org/get/PEAR_Task_Stripwhitespace-0.1.0.tgz |
This script will generate something like :
![]() |
Important |
---|---|
Allways generate file list contents with generateContents() before trying to add a
task to one of file with addTaskToFile() .
|
However, if a user does not have the package installed that provides the custom task stripwhitespace, then the error message on installation will simply say Unknown task "stripwhitespace" which is not very helpful.
PEAR_PackageFileManager : The Definitive Guide | v 1.6.0 : November 17, 2006 |