The XML format in package.xml is identical, so no change need be made to
<paramgroup> or other tags. The script itself
should still follow the naming conventions of PEAR. The only real difference
is the naming of methods within the script.
PEAR requires that all post-install scripts implement init(),
run() and optionally postProcessPrompts().
Pyrus requires post-install scripts to implement init2(),
run2(), and optionally postProcessPrompts2().
This allows PEAR and Pyrus-based post-install scripts to co-exist in the
same package without difficulty. Note that post-install scripts must be
otherwise many PHP warnings will be emitted. One way of handling this issue
is to put PHP4 non-E_STRICT-compatible code into a separate file and include it
dynamically at run-time. The same should be done for any PHP5+ non-PHP4
compatible code if the post-install script is expected to be able to run in PHP 4.
The init2() method should accept two parameters like so:
function init2($pkg, $lastversion)
$pkg is an object representing the package, and
$lastversion is the last installed version of the
These two methods should accept identical parameters to what the PEAR equivalent accepted. The only reason these are called is to allow easy differentiation between what kind of installer is calling the post-install script.