PEAR logo

PEAR_PackageFileManager : The Definitive Guide



Improve warning message requiring custom file task handler

This problem may be solve easily by adding a <userstask> tag documenting package to install that will handle the new task. Uses methods : addUsestask() with (replace task) or without (append task) its resetUsestask() companion.

Table 12.1. install custom file task handler

PHP code XML equivalent
           
$p2->resetUsestask();
// use channel-based package
$p2->addUsestask('foo',
    'Task_Foo', 'pear.example.com');
           
          
           
<usestask>
 <task>foo</task>
 <package>Task_Foo</package>
 <channel>pear.example.com</channel>
</usestask>
           
          
           
$p2->resetUsestask();
// use uri-based package
$p2->addUsestask('foo',
    'http://pear.example.com/Task_Foo-0.1.0');
           
          
           
<usestask>
 <task>foo</task>
 <package>Task_Foo</package>
 <uri>http://pear.example.com/Task_Foo-0.1.0</uri>
</usestask>
           
          
[Tip] Tip
If Task_Foo package is not installed, then PEAR installer take aware user with a message like This package contains task "foo" and requires package "http://pear.example.com/Task_Foo-0.1.0.tgz" to be used.
PEAR_PackageFileManager : The Definitive Guide v 1.6.0 : November 17, 2006