mirror of
https://github.com/php/php-src.git
synced 2026-04-10 01:23:53 +02:00
- Support require_once().
This commit is contained in:
@@ -200,8 +200,8 @@ unticked_statement:
|
||||
| T_ECHO echo_expr_list ';'
|
||||
| T_INLINE_HTML { do_echo(&$1 CLS_CC); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_REQUIRE expr ';' { do_require(&$2 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename ';' { do_require(&$2 CLS_CC); }
|
||||
| T_REQUIRE expr ';' { do_require(&$2, 0 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename ';' { do_require(&$2, 1 CLS_CC); }
|
||||
| T_USE use_filename ';' { use_filename($2.u.constant.value.str.val, $2.u.constant.value.str.len CLS_CC); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' cvar ')' ';' { do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); do_unset(&$3 CLS_CC); }
|
||||
| T_FOREACH '(' expr T_AS { do_foreach_begin(&$1, &$3, &$2, &$4 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
|
||||
@@ -514,14 +514,14 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
int require_filename(char *filename CLS_DC)
|
||||
int require_filename(char *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
file_handle.filename = filename;
|
||||
file_handle.free_filename = 0;
|
||||
if (require_file(&file_handle, 0 CLS_CC)==FAILURE) {
|
||||
if (require_file(&file_handle, unique CLS_CC)==FAILURE) {
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
|
||||
@@ -1911,11 +1911,11 @@ void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_require(znode *filename CLS_DC)
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
if (filename->op_type==IS_CONST
|
||||
&& filename->u.constant.type==IS_STRING) {
|
||||
require_filename(filename->u.constant.value.str.val CLS_CC);
|
||||
require_filename(filename->u.constant.value.str.val, unique CLS_CC);
|
||||
zval_dtor(&filename->u.constant);
|
||||
} else {
|
||||
znode result;
|
||||
|
||||
@@ -321,7 +321,7 @@ void do_new_list_end(CLS_D);
|
||||
|
||||
void do_cast(znode *result, znode *expr, int type CLS_DC);
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
|
||||
void do_require(znode *filename CLS_DC);
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC);
|
||||
|
||||
void do_unset(znode *variable CLS_DC);
|
||||
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
|
||||
@@ -356,7 +356,7 @@ void do_ticks(CLS_D);
|
||||
|
||||
/* helper functions in zend-scanner.l */
|
||||
ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
|
||||
ZEND_API int require_filename(char *filename CLS_DC);
|
||||
ZEND_API int require_filename(char *filename, zend_bool unique CLS_DC);
|
||||
ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
|
||||
ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...);
|
||||
ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count, va_list files);
|
||||
@@ -551,7 +551,6 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_INCLUDE (1<<1)
|
||||
#define ZEND_INCLUDE_ONCE (1<<2)
|
||||
#define ZEND_REQUIRE (1<<3)
|
||||
#define ZEND_REQUIRE_ONCE (1<<4)
|
||||
|
||||
#define ZEND_ISSET (1<<0)
|
||||
#define ZEND_ISEMPTY (1<<1)
|
||||
|
||||
Reference in New Issue
Block a user