Page 1 of 1

part of source that read .php script

Posted: Fri Apr 04, 2003 8:21 am
by korn
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

Posted: Fri Apr 04, 2003 9:36 am
by BDKR
Why don't you check here?

http://www.php.net/manual/en/zend.php

Cheers,
BDKR

Posted: Fri Apr 04, 2003 10:08 am
by volka
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)

Posted: Fri Apr 04, 2003 7:44 pm
by korn
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

Posted: Sat Apr 05, 2003 3:26 am
by volka
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.
...