perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Moyer <>
Subject Re: mod_perl2 and PHP
Date Sat, 06 Aug 2005 16:38:25 GMT
Thomas Klausner wrote:
> Is it possible and advisable to write the complex part of an application
> (the Controller, if you like) in mod_perl2 and use PHP as a frontend (or
> View) ?

Here's an excellent thread on how to do just that if you are using
mod_perl 2:

> But: can I create a datastructure in Perl (in an ResponseHandler) and pass
> it on to PHP running also as an ResponseHandler, but afterwards. Would I
> need to stuff data in ENV? Can I pass complex data structures around? Do I
> have to serialise (to yaml/xml) between Perl and PHP?

PHP supports BerkeleyDB, SQLite, and Storable
but I don't know offhand if you can serialize with Perl and thaw with
PHP).  Using Storable (if it works with both) and serializing the data
to environment variables is a less i/o intensive operation, but doesn't
give the added advantage of persistent data.

> Or is this a bad idea altogether and I should use a different approach (Like
> forcing everyone to read the Badger)?

If your coworkers already know PHP, this is a good idea.  Create a php
include for them to deserialize the shared data and make it available to
their templates.  And don't forget to write tests for the PHP filters :)



View raw message