![]() PEAR_PackageFileManager : The Definitive Guide |
Table of Contents
This lesson :
teachs you how to add a new extension role mapping to default role influences array.
teachs you how to improve message when dealing with package role handler not installed on your system.
Default role mapping array separates extension into seven categories.
Table 11.1. extension role mapping reference
Role | Extension |
---|---|
php | php |
data | all other extension |
doc | html |
test | none |
script | none |
src | h, c, m4, w32 |
ext | dll |
Once a package that reference, manage, the new role is properly installed in your system, you can use it, and add it to the default role mapping array.
We suppose to have previously installed a package that manage the new
role web. Here we will assume
that all log files (*.log) will be copied into directory declared by
<locationconfig> tag of xml web file role (see PEAR/Installer/Role/Web.xml
).
However, if a user does not have the package installed that provides the custom role web, then the error message on installation will simply say File ... has invalid role "web" should be one of data, doc, php, script, test which is not very helpful.
If you don't want to give the same behavior to all file with same extension, but only to one or a set of them, then use option directive exceptions.
PEAR_PackageFileManager : The Definitive Guide | v 1.6.0 : November 17, 2006 |