PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
korn
Forum Newbie
Posts: 3 Joined: Fri Apr 04, 2003 8:21 am
Location: Croatia
Post
by korn » Fri Apr 04, 2003 8:21 am
I study php source code and I need to compile it (php 4.3.1) from source
for windows with some modification on source and my problem is:
I cant locate part of php source code that read file (php script) before
parsing and execution (something like fopen...).
I looked around
Code: Select all
php_execute_script, zend_execute_scripts, zend_compile_file functions...
It would be wary helpful for me if you can just point my attention on that
part of source code
thanks
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Fri Apr 04, 2003 10:08 am
take a closer look at
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...) and
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
korn
Forum Newbie
Posts: 3 Joined: Fri Apr 04, 2003 8:21 am
Location: Croatia
Post
by korn » Fri Apr 04, 2003 7:44 pm
Hmm... I looked at this functions but cant find code that read file php script.
then I thought I'll find it in:
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
If it is not problem, maybe you cat tell me the line number or quote parts of code so I can find it.
Thanks
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sat Apr 05, 2003 3:26 am
the actual parsing is done by a bison parser.
send_language_parser.l
Code: Select all
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC)
{
...
if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) {
if (type==ZEND_REQUIRE) {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
zend_bailout();
} else {
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
}
compilation_successful=0;
} else {
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC);
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
compiler_result = zendparse(TSRMLS_C); // invokes the parser.
...