Subject Re: [firebird-php] PHP-CLI and event handling
Author Jochem Maas
Alan McDonald wrote:
>>We need to handle events from scripts running on Linux and Windows
>>servers. After a brief search we've decided that the best support is
>>offered by PHP (as an aside, does anyone know of a Firebird module for
>>Perl?).
>>Having never developed in PHP, is there any advice or tips anyone wants
>>to offer?
>>
>>The basic script would be started by cron, register an event handler,
>>and then wait until the handler executed and notified the main thread it
>>was done, or the main thread reached a timeout threshold, deregistered
>>the event handler and exited.
>>
>>I also want to make sure we're running a minimum install of PHP, as it
>>won't be used for HTTP traffic.

you need the CLI build. :-)

>>
>>Thanks, Rick DeBay
>
>
> PHP is fairly minimal anyway - there's only one exe script interpreter. You
> only need to decalre the extensions you require in the php.ini file e.g.
> interbase.dll.
> I don't know how to make php register interest in an event and scripts are

seesh, doesn't anyone read the manual anymore these days ;-)

> subject to another script timeout setting as well. You will need to make
> that very long I guess.

the CLI build of php doesn't have a timeout for execution ...
lots of people write little deamon scripts and socket server thingies
that stick around for as long as you like. also you can fork (assuming
a *nix OS) and have the process run completely in the background (i.e.
let the parent process die)

regarding listening for firebird events, Ard made this possible with php,
I have never used it though, but I'm assured it works:

http://php.net/manual/en/function.ibase-set-event-handler.php
http://php.net/manual/en/function.ibase-free-event-handler.php

I would be very interested in the non-specific (to your project)
parts of the any script you end up creating... I hope you have the
time/desire to post us a little info on your progress!

rgds,
Jochem

> I think there is a perl firebird connection somewhere.
> Alan
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>