lex_state->in = yyin;
lex_state->lineno = CG(zend_lineno);
lex_state->state = YYSTATE;
- lex_state->filename = zend_get_compiled_filename();
+ lex_state->filename = zend_get_compiled_filename(CLS_C);
#else
lex_state->ZFL = CG(ZFL);
#endif
int i;
int compiler_result;
int compiled_files=0;
+ zend_bool original_in_compilation = CG(in_compilation);
+ CG(in_compilation) = 1;
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
save_lexical_state(&original_lex_state CLS_CC);
retval = NULL;
}
}
+ CG(in_compilation) = original_in_compilation;
return retval;
}
zend_op_array *retval;
zval tmp;
int compiler_result;
+ zend_bool original_in_compilation = CG(in_compilation);
if (source_string->value.str.len==0) {
efree(op_array);
return NULL;
}
+
+ CG(in_compilation) = 1;
+
tmp = *source_string;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
}
}
zval_dtor(&tmp);
+ CG(in_compilation) = original_in_compilation;
return retval;
}
}
<ST_IN_SCRIPTING>"__FILE__" {
- char *filename = zend_get_compiled_filename();
+ char *filename = zend_get_compiled_filename(CLS_C);
if (!filename) {
filename = "";
CG(asp_tags) = ZEND_UV(asp_tags);
CG(allow_call_time_pass_reference) = ZEND_UV(allow_call_time_pass_reference);
CG(handle_op_arrays) = 1;
+ CG(in_compilation) = 0;
init_resource_list(ELS_C);
CG(unclean_shutdown) = 0;
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
CG(compiled_filename) = original_compiled_filename;
}
-ZEND_API char *zend_get_compiled_filename()
+
+ZEND_API char *zend_get_compiled_filename(CLS_D)
+{
+ return CG(compiled_filename);
+}
+
+
+ZEND_API int zend_get_compiled_lineno(CLS_D)
+{
+ return CG(zend_lineno);
+}
+
+
+ZEND_API zend_bool zend_is_compiling()
{
CLS_FETCH();
- return CG(compiled_filename);
+ return CG(in_compilation);
}
ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename);
ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename);
-ZEND_API char *zend_get_compiled_filename(void);
+ZEND_API char *zend_get_compiled_filename(CLS_D);
+ZEND_API int zend_get_compiled_lineno(CLS_D);
#ifdef ZTS
const char *zend_get_zendtext(CLS_D);
int pass_two(zend_op_array *op_array);
void pass_include_eval(zend_op_array *op_array);
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
+ZEND_API zend_bool zend_is_compiling(void);
int zendlex(znode *zendlval CLS_DC);
#else
temp_variable Ts[op_array->T];
#endif
+ zend_bool original_in_execution=EG(in_execution);
+ EG(in_execution) = 1;
#if SUPPORT_INTERACTIVE
if (EG(interactive)) {
opline = op_array->opcodes + op_array->start_op_number;
op_array->last_executed_op_number = opline-op_array->opcodes;
#endif
free_alloca(Ts);
+ EG(in_execution) = original_in_execution;
return;
}
break;
ZEND_API char *get_active_function_name(void);
ZEND_API char *zend_get_executed_filename(ELS_D);
ZEND_API uint zend_get_executed_lineno(ELS_D);
+ZEND_API zend_bool zend_is_executing(void);
#define zendi_zval_copy_ctor(p) zval_copy_ctor(&(p))
#define zendi_zval_dtor(p) zval_dtor(&(p))
EG(function_table) = CG(function_table);
EG(class_table) = CG(class_table);
+ EG(in_execution) = 0;
+
zend_ptr_stack_init(&EG(argument_stack));
EG(main_op_array) = NULL;
}
+ZEND_API zend_bool zend_is_executing()
+{
+ ELS_FETCH();
+
+ return EG(in_execution);
+}
+
+
ZEND_API inline void safe_free_zval_ptr(zval *p)
{
ELS_FETCH();
zend_llist filenames_list;
+ zend_bool in_compilation;
zend_bool short_tags;
zend_bool asp_tags;
zend_bool allow_call_time_pass_reference;
int ticks_count;
+ zend_bool in_execution;
+
/* for extended information support */
zend_bool no_extensions;
void init_op(zend_op *op CLS_DC)
{
op->lineno = CG(zend_lineno);
- op->filename = zend_get_compiled_filename();
+ op->filename = zend_get_compiled_filename(CLS_C);
op->result.op_type = IS_UNUSED;
op->extended_value = 0;
op->op1.u.EA.var = 0;