[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: any chance to se PHP incorporated in wml?
- From: Jim Hebert <nospam@thanx>
- Date: Thu, 1 Apr 1999 03:00:55 -0500 (EST)
On Wed, 31 Mar 1999, Davor Cengija wrote:
> greetings everyone.
>
> is it there any chance to use PHP language in wml? i see ePerl
> is incorporated into wml (pass 3), but my Perl knowledge is
> poor, so i'm looking for a way to use PHP code.
Well, how you implement this largely depends on which pass you'd like php3
to be. We'll assume that somewhere in the neighborhood of 3 is good, since
you mention ePerl.
That really means we can use passes 1, 2, and 3 to implement this. The
include file stuff doesn't help here, nor does meta-html (maybe it does
but I'm not very imaginative tonight). So let's see what we can do in
Perl.
I have no idea how the php3 interpreter is used/invoked/whatever, but
let's assume I can just feed it code on the stdin and get results on the
stdout. *shrug*
<!-- some perl code off the top of my head, it probably sucks -->
<perl>
open PHP, "|/usr/local/bin/php > /home/me/tmp/php-tmp$$"; # watch for races!
print PHP <<END_OF_PHP;
php3 code goes here
END_OF_PHP
close PHP;
open PHP, "</home/me/tmp/php-tmp$$";
print <PHP>;
close PHP;
</perl>
And now that I think about it, you could use meta html to make your <?php
?> tag, I think, basically making it replace the <?php with the first part
and the ?> with the last part. Then you wouldn't have to clutter up each
file with any special syntax, just the appropriate #use to import the
right definitions.
This would in effect make php3 processing happen during/after "pass 3"
depending on your perspective.
Something much cleaner to encapsulate the interaction with php3 could be come
up with I'm sure, but I'm such a lame perl hacker. =)
HTH
jim
>
> can i somehow call /usr/local/bin/php (maybe even from ePerl)
> to parse my code?
>
> <?php .. ?> tag will be very useful in the future, maybe just
> as an option while compiling and it could use already
> installed and compiled php cgi module.
>
> the key benefit would be the possibility to create static
> pages with the content taken from some database (php is very
> powerful there).
>
> regards, Davor
>
--
"[T]hey said something to the effect that Linux has 'the tendency not to
crash.' ... It's like me listing 'the tendency not to murder people' as one of
my good character traits. :-> It seems that people have grown so accustomed to
buggy OS's that when Linux simply does what it's supposed to do, it comes
across as something new and different." Scott Webster on linux-biz 20 Feb 1999
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com