Executing code with CLI without using a file

From: Date: Tue, 05 Mar 2002 18:13:56 +0000
Subject: Executing code with CLI without using a file
Groups: php.dev 
Request: Send a blank email to php-dev+get-80765@lists.php.net to get a copy of this message
hi, i just looked at the code for a possibility to extend CLI to execute code without using files. For example: php -- 'echo "Hello World";' I saw that only files can be executed, so i had to pacth the following files: Zend/zend_compile.h:
        added new constant ZEND_HANDLE_STRING
        added new prototype for zend_execute_code
Zend/zend.c:
        added function zend_execute_code which executed a prepended file a
        code string and an appended file
main/main.c:
        make function php_execute_script recognize type ZEND_HANDLE_STRING
                and invoke zend_execute_code instead zend_execute_scripts on that type.
sapi/cli/php_cli.c
        added switch -- in php_cli_usage
        function main:
                stop interpreting argumants after --
                setting up information for -- with file_handle.type = ZEND_HANDLE_STRING
                        the code pointer uses file_handle.filename
The code compiles but i cannot build an executable. I only have CYGWIN where i am now and the CVS version does not build them.... marcus --------->>> mailto:marcus.boerger@post.rwth-aachen.de <<<------------ "We are animals among animals, all children of matter, save that we are the more disarmed. But since, unlike animals, we know that we must die, let us prepare for that moment by enjoying the life that has been given us by chance and for chance."
                       Umberto Eco, The island of the day before
--------------->>> http://www.marcus-boerger.de <<<-------------------

Attachment: [application/octet-stream] cli-direct.tar.bz2
« previous php.dev (#80765) next »