PHP Engine hooks

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

PHP Engine hooks

Post by alex.barylski »

This can probably be done using an extension, but I would like to avoid that if possible. Ideally if there is a way to invoke a command before parsing of every script file (includes and all) that would be best.

Basically I have a filter program which I wish to run over the source code and have that feed the results to the PHP engine for parsing, execution, etc...

Other than using an extension, is there a way I can configure PHP to pass the source to a binary and use the results of that operation?

Any ideas?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

I fail to see why you would want to do this.. and as far I know, there isn't a way to do it.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Jenk wrote:I fail to see why you would want to do this.. and as far I know, there isn't a way to do it.
I have my reasons. :)

I've looked into it and it doesn't appear possible - at least using the technique I've described.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There is nothing automagically available. You would either have to run through your own version of include/require or extend PHP.

You'll also need an auto_prepend.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

There was a thread about something similar (rewriting code on the fly)... oh, here it is: viewtopic.php?p=415646
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Thats looking pretty promising...Thanks for that :)
Post Reply