svn: /pecl/yaf/trunk/ php_yaf.h yaf_loader.c
| From: | Xinchen Hui | Date: | Fri, 06 Jan 2012 06:12:54 +0000 |
| Subject: | svn: /pecl/yaf/trunk/ php_yaf.h yaf_loader.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-17432@lists.php.net to get a copy of this message | ||
laruence Fri, 06 Jan 2012 06:12:54 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=321814
Log:
Fix Bug classname with namespace can not be auto loaded
Changed paths:
U pecl/yaf/trunk/php_yaf.h
U pecl/yaf/trunk/yaf_loader.c
Modified: pecl/yaf/trunk/php_yaf.h
===================================================================
--- pecl/yaf/trunk/php_yaf.h 2012-01-06 05:49:12 UTC (rev 321813)
+++ pecl/yaf/trunk/php_yaf.h 2012-01-06 06:12:54 UTC (rev 321814)
@@ -41,7 +41,7 @@
#define YAF_G(v) (yaf_globals.v)
#endif
-#define YAF_VERSION "2.1.6-dev"
+#define YAF_VERSION "2.1.6"
#define YAF_STARTUP_FUNCTION(module) ZEND_MINIT_FUNCTION(yaf_##module)
#define YAF_RINIT_FUNCTION(modle) ZEND_RINIT_FUNCTION(yaf_##module)
Modified: pecl/yaf/trunk/yaf_loader.c
===================================================================
--- pecl/yaf/trunk/yaf_loader.c 2012-01-06 05:49:12 UTC (rev 321813)
+++ pecl/yaf/trunk/yaf_loader.c 2012-01-06 06:12:54 UTC (rev 321814)
@@ -749,7 +749,7 @@
/** {{{ proto public Yaf_Loader::autoload($class_name)
*/
PHP_METHOD(yaf_loader, autoload) {
- char *class_name, *app_directory, *directory = NULL, *file_name = NULL;
+ char *class_name, *origin_classname, *app_directory, *directory = NULL, *file_name = NULL;
#ifdef YAF_HAVE_NAMESPACE
char *origin_lcname = NULL;
#endif
@@ -761,6 +761,7 @@
separator_len = strlen(YAF_G(name_separator));
app_directory = YAF_G(directory);
+ origin_classname = class_name;
do {
if (!class_name_len) {
@@ -844,7 +845,7 @@
if (!YAF_G(use_spl_autoload)) {
/** directory might be NULL since we passed a NULL */
if (yaf_internal_autoload(file_name, file_name_len, &directory TSRMLS_CC)) {
- if (zend_hash_exists(EG(class_table), zend_str_tolower_dup(class_name, class_name_len),
class_name_len + 1)) {
+ if (zend_hash_exists(EG(class_table), zend_str_tolower_dup(origin_classname, class_name_len),
class_name_len + 1)) {
#ifdef YAF_HAVE_NAMESPACE
if (origin_lcname) {
efree(origin_lcname);
@@ -880,7 +881,7 @@
RETURN_TRUE;
} else {
if (yaf_internal_autoload(file_name, file_name_len, &directory TSRMLS_CC) &&
- zend_hash_exists(EG(class_table), zend_str_tolower_dup(class_name, class_name_len),
class_name_len + 1)) {
+ zend_hash_exists(EG(class_table), zend_str_tolower_dup(origin_classname, class_name_len),
class_name_len + 1)) {
#ifdef YAF_HAVE_NAMESPACE
if (origin_lcname) {
efree(origin_lcname);