You are here: event driven PHP « PHP Programming Language « IT news, forums, messages
event driven PHP

Posted by Csaba Gabor on 12/18/05 11:09

Maybe someone has an idea about this... I have two PHP scripts and
they would like to efficiently communicate (on a a callback or event
driven basis) with each other. If these are CLI versions of PHP, this
is not so bad because I can have the communication go across a hidden
instance of IE by means of events on IE.

But if one of the PHP instances is invoked via a server (Apache 2),
then the security restrictions become fairly severe. Specifically,
though I can create instances of IE ($ie = new
COM("InternetExplorer.Application")), the CLI versions of PHP cannot
see the 'server instances' of IE and the server PHP's cannot even query
for instances of IE (using the Windows collection of the
Shell.Application COM object). Thus, I cannot hook up the two
instances of PHP.


I thought of other possibilities. Each is essentially a way to
transfer data. I can either use VOLATILE environment variables (for
small amounts of data), or I can use http://php.net/shmop or writing
files (but I hate writing files) for larger amounts of data. All these
suffer from the same problem, however. Near as I can tell, there is
nothing to let the 'listening' side know that data has changed. It has
to keep running a loop, and checking for any possible change in data.
Of course the sending side could specify where the change has happened,
but this still requires the receiving side to be running a loop.

So my question is whether anyone has had a happy approach to the issue
of event driven programming in php? Another way to ask this is whether
php has callback functions that can be remotely triggered by
cooperating programs (e.g. the __destruct of classes is near to this -
it's effectively a callback that responds to an event: the destruction
of a class instance)

Thanks,
Csaba Gabor from Vienna.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация