cvs: ZendEngine2 / zend_API.c zend_API.h
| From: | Stanislav Malyshev | Date: | Fri, 04 Apr 2003 12:25:47 +0000 |
| Subject: | cvs: ZendEngine2 / zend_API.c zend_API.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1113@lists.php.net to get a copy of this message | ||
stas Fri Apr 4 07:25:47 2003 EDT
Modified files:
/ZendEngine2 zend_API.c zend_API.h
Log:
Fix namespace issues
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.165 ZendEngine2/zend_API.c:1.166
--- ZendEngine2/zend_API.c:1.165 Thu Apr 3 14:05:25 2003
+++ ZendEngine2/zend_API.c Fri Apr 4 07:25:47 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.165 2003/04/03 19:05:25 andrei Exp $ */
+/* $Id: zend_API.c,v 1.166 2003/04/04 12:25:47 stas Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -1147,6 +1147,7 @@
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL;
char *lowercase_name;
int fname_len;
+ zend_namespace *scope_namespace;
if (type==MODULE_PERSISTENT) {
error_type = E_CORE_WARNING;
@@ -1158,6 +1159,12 @@
target_function_table = CG(function_table);
}
internal_function->type = ZEND_INTERNAL_FUNCTION;
+
+ if(scope) {
+ scope_namespace = scope->ns;
+ } else {
+ scope_namespace = EG(active_namespace);
+ }
while (ptr->fname) {
internal_function->handler = ptr->handler;
@@ -1165,11 +1172,7 @@
internal_function->function_name = ptr->fname;
internal_function->scope = scope;
internal_function->fn_flags = ZEND_ACC_PUBLIC;
- if (!scope) {
- internal_function->ns = EG(active_namespace);
- } else {
- internal_function->ns = NULL;
- }
+ internal_function->ns = scope_namespace;
internal_function->prototype = NULL;
if (!internal_function->handler) {
zend_error(error_type, "Null function defined as active function");
@@ -1412,6 +1415,7 @@
orig_class_table = CG(class_table);
CG(class_table) = &ns->class_table;
}
+ class_entry->ns = ns;
register_class = zend_register_internal_class_ex(class_entry, parent_ce, NULL TSRMLS_CC);
if (restore_orig) {
EG(active_namespace) = orig_namespace;
Index: ZendEngine2/zend_API.h
diff -u ZendEngine2/zend_API.h:1.133 ZendEngine2/zend_API.h:1.134
--- ZendEngine2/zend_API.h:1.133 Wed Apr 2 15:27:44 2003
+++ ZendEngine2/zend_API.h Fri Apr 4 07:25:47 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.h,v 1.133 2003/04/02 20:27:44 andrei Exp $ */
+/* $Id: zend_API.h,v 1.134 2003/04/04 12:25:47 stas Exp $ */
#ifndef ZEND_API_H
#define ZEND_API_H
@@ -99,6 +99,7 @@
class_container.__call = handle_fcall; \
class_container.__get = handle_propget; \
class_container.__set = handle_propset; \
+ class_container.num_interfaces = 0; \
}
#define INIT_NAMESPACE(ns_container, ns_name) INIT_CLASS_ENTRY(ns_container, ns_name, NULL)