Re: Question about writing custom task for installer
| From: | Gregory Beaver | Date: | Sun, 06 Jan 2008 04:37:18 +0000 |
| Subject: | Re: Question about writing custom task for installer | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28411@lists.php.net to get a copy of this message | ||
Dmitri wrote:
> Hello again!
>
> I am starting to write a class that extends a PEAR_Task_Common
> Basically I need a file task that would set a writable permission on a
> file after the installation of a package
>
> I read Greg Beaver's book but I can't fine this important info: how do I
> suppose to name the file that contains the custom task?
>
> Does that name of the file have to be the same as the name of the task?
> For example if I want to name the task setchmod then does this mean I
> have to name the task Setchmod.php and install in in the
> PEAR/Task/Setchmod.php?
>
> By the way, can this even be done with the task? I mean, is it possible
> to set the file permission with a custom file task or
> do I have to use postinstall script for that?
Hi Dmitri,
The file name would be as you suspect PEAR/Task/Setchmod.php, and it is
only possible to change permissions if you set the $type = 'script' in
your PEAR_Task_Setchmod class definition (look at
PEAR/Task/Postinstallscript.php compared to PEAR/Task/Windowseol.php to
see what I'm talking about if you're confused), as this will make the
task run after installation has completed. any changes run before will
be erased by the chmod file transaction.
Sorry I haven't been more forthcoming with help, I'm trying to focus my
efforts almost exclusively on PEAR2 and related php internals stuff to
make PHP ready for PEAR2 as well as PEAR2 ready for PHP 5.3, and it's
eating up a lot of the time I would otherwise have to be helpful here.
Greg