Re: Re: ECHO
| From: | Satyam | Date: | Tue, 19 Dec 2006 09:21:55 +0000 |
| Subject: | Re: Re: ECHO | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-246015@lists.php.net to get a copy of this message | ||
You could use the PHP Compiler: http://phpcompiler.org/ and do a preprocessor as I did: http://www.satyam.com.ar/pht/.
PHC is capable of compiling a PHP source and return a modified PHP source. It is easy to make a plugin for any such modifications, there is a class which gets instantiated after parsing and makes a full tree traversal with a method defined for each node type so you simply inherit from the method for your particular tree node and make any modifications you want to it.
For PHC echo is not a language construct, you would have to override the "method invocation" method, check whether the function name is "echo" (print is translated to echo) and then do your changes. One of the tutorials shows you how to do this: http://phpcompiler.org/doc/tutorial2.html
Satyam
----- Original Message ----- From: "Fahad Pervaiz" <fahad.pervaiz@gmail.com>
To: <php-general@lists.php.net>
Sent: Tuesday, December 19, 2006 6:46 AM
Subject: [PHP] Re: ECHO
I have written a framework for internationalization. Now i have incoorperate it into and existing system that is huge and it will take alot of time to change ECHO to a function call, so i want to override its implementation so that i can use it for my own purposes with having to change all the echo calls -- Regards Fahad Pervaiz www.ecommerce-xperts.com