cvs: ZendEngine2(PHP_5_3) / zend_compile.c /tests ns_066.phpt ns_067.inc ns_067.phpt

"Dmitry Stogov" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsdmitry1213982225@cvsserver>
dmitry		Fri Jun 20 17:17:05 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /ZendEngine2/tests	ns_066.phpt ns_067.inc ns_067.phpt 

  Modified files:              
    /ZendEngine2	zend_compile.c 
  Log:
  Allowed to override internal classaes with "use"
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.68&r2=1.647.2.27.2.41.2.69&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.68 ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.69
--- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.68	Sun Jun 15 18:27:37 2008
+++ ZendEngine2/zend_compile.c	Fri Jun 20 17:17:05 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.68 2008/06/15 18:27:37 felipe Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.69 2008/06/20 17:17:05 dmitry Exp $ */
 
 #include <zend_language_parser.h>
 #include "zend.h"
@@ -4959,6 +4959,7 @@
 	char *lcname;
 	zval *name, *ns, tmp;
 	zend_bool warn = 0;
+	zend_class_entry **pce;
 
 	if (!CG(current_import)) {
 		CG(current_import) = emalloc(sizeof(HashTable));
@@ -5012,7 +5013,9 @@
 			efree(tmp);
 		}
 		efree(ns_name);
-	} else if (zend_hash_exists(CG(class_table), lcname, Z_STRLEN_P(name)+1)) {
+	} else if (zend_hash_find(CG(class_table), lcname, Z_STRLEN_P(name)+1, (void**)&pce) == SUCCESS &&
+	           (*pce)->type == ZEND_USER_CLASS &&
+	           (*pce)->filename == CG(compiled_filename)) {
 		char *tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns));
 
 		if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) ||

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_066.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/ns_066.phpt
+++ ZendEngine2/tests/ns_066.phpt

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_067.inc?view=markup&rev=1.1
Index: ZendEngine2/tests/ns_067.inc
+++ ZendEngine2/tests/ns_067.inc

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_067.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/ns_067.phpt
+++ ZendEngine2/tests/ns_067.phpt



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.