cvs: pecl /inclued inclued_zend.c
| From: | Gopal Vijayaraghavan | Date: | Thu, 30 Oct 2008 18:07:40 +0000 |
| Subject: | cvs: pecl /inclued inclued_zend.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-11470@lists.php.net to get a copy of this message | ||
gopalv Thu Oct 30 18:07:40 2008 UTC
Modified files:
/pecl/inclued inclued_zend.c
Log:
treat __autoload like the "special" function it is.
http://cvs.php.net/viewvc.cgi/pecl/inclued/inclued_zend.c?r1=1.4&r2=1.5&diff_format=u
Index: pecl/inclued/inclued_zend.c
diff -u pecl/inclued/inclued_zend.c:1.4 pecl/inclued/inclued_zend.c:1.5
--- pecl/inclued/inclued_zend.c:1.4 Wed Oct 29 12:04:28 2008
+++ pecl/inclued/inclued_zend.c Thu Oct 30 18:07:40 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: inclued_zend.c,v 1.4 2008/10/29 12:04:28 kalle Exp $ */
+/* $Id: inclued_zend.c,v 1.5 2008/10/30 18:07:40 gopalv Exp $ */
#include "php_inclued.h"
#include "inclued_zend.h"
@@ -64,6 +64,7 @@
char * operation;
zval * include_entry;
+ zval * autoload_entry;
php_stream_wrapper *wrapper;
zval *inc_filename = NULL, tmp_inc_filename;
@@ -71,6 +72,7 @@
char *path_for_open;
zend_file_handle file_handle;
int op_type = opline->op2.u.constant.value.lval;
+ zend_execute_data *real_execute_data;
assert(includes_hash != NULL);
@@ -177,6 +179,25 @@
add_assoc_string_ex(include_entry, "function", sizeof("function"),
(char*)execute_data->op_array->function_name, 1);
}
+ if(execute_data->op_array->function_name && (strcmp("__autoload",
execute_data->op_array->function_name) == 0))
+ {
+ real_execute_data = execute_data->prev_execute_data;
+ if(real_execute_data->opline == NULL &&
+ real_execute_data->prev_execute_data != NULL &&
+ real_execute_data->prev_execute_data->opline != NULL)
+ {
+ MAKE_STD_ZVAL(autoload_entry);
+ array_init(autoload_entry);
+
+ real_execute_data = real_execute_data->prev_execute_data;
+
+ add_assoc_string_ex(autoload_entry, "fromfile", sizeof("fromfile"),
real_execute_data->op_array->filename, 1);
+ add_assoc_long_ex(autoload_entry, "fromline", sizeof("fromline"),
real_execute_data->opline->lineno);
+
+ add_assoc_zval(include_entry, "autoload", autoload_entry);
+ }
+ }
+
if(opline->op1.op_type != IS_CONST)
{
add_assoc_bool_ex(include_entry, "variable_include",
sizeof("variable_include"), 1);