cvs: php-src(PHP_5_2) /ext/spl php_spl.c php_spl.h /ext/spl/examples directoryfilterdots.inc /ext/spl/internal recursiveiteratoriterator.inc
/ext/spl/tests spl_autoload_009.phpt

From: Date: Fri, 03 Nov 2006 18:58:41 +0000
Subject: cvs: php-src(PHP_5_2) /ext/spl php_spl.c php_spl.h /ext/spl/examples directoryfilterdots.inc /ext/spl/internal recursiveiteratoriterator.inc
/ext/spl/tests spl_autoload_009.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41328@lists.php.net to get a copy of this message
helly Fri Nov 3 18:58:41 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/spl/tests spl_autoload_009.phpt Modified files: /php-src/ext/spl php_spl.c php_spl.h /php-src/ext/spl/examples directoryfilterdots.inc /php-src/ext/spl/internal recursiveiteratoriterator.inc Log: - MFH: Synch http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.6&r2=1.52.2.28.2.7&diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.6 php-src/ext/spl/php_spl.c:1.52.2.28.2.7 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.6 Mon Aug 7 09:49:53 2006 +++ php-src/ext/spl/php_spl.c Fri Nov 3 18:58:41 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.6 2006/08/07 09:49:53 tony2001 Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.7 2006/11/03 18:58:41 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -57,6 +57,7 @@ { spl_globals->autoload_extensions = NULL; spl_globals->autoload_functions = NULL; + spl_globals->autoload_running = 0; } /* }}} */ @@ -305,7 +306,7 @@ EG(active_op_array) = original_active_op_array; EG(function_state_ptr) = original_function_state_ptr; - if (!found) { + if (!found && !SPL_G(autoload_running)) { zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Class %s could not be loaded", class_name); } } /* }}} */ @@ -361,6 +362,8 @@ } if (SPL_G(autoload_functions)) { + int l_autoload_running = SPL_G(autoload_running); + SPL_G(autoload_running) = 1; class_name_len = Z_STRLEN_P(class_name); lc_name = zend_str_tolower_dup(Z_STRVAL_P(class_name), class_name_len); zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos); @@ -377,6 +380,7 @@ zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos); } efree(lc_name); + SPL_G(autoload_running) = l_autoload_running; } else { /* do not use or overwrite &EG(autoload_func) here */ zend_call_method_with_1_params(NULL, NULL, NULL, "spl_autoload", NULL, class_name); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.h?r1=1.17.2.1&r2=1.17.2.1.2.1&diff_format=u Index: php-src/ext/spl/php_spl.h diff -u php-src/ext/spl/php_spl.h:1.17.2.1 php-src/ext/spl/php_spl.h:1.17.2.1.2.1 --- php-src/ext/spl/php_spl.h:1.17.2.1 Sun Jan 1 12:50:13 2006 +++ php-src/ext/spl/php_spl.h Fri Nov 3 18:58:41 2006 @@ -58,6 +58,7 @@ ZEND_BEGIN_MODULE_GLOBALS(spl) char * autoload_extensions; HashTable * autoload_functions; + int autoload_running; ZEND_END_MODULE_GLOBALS(spl) #ifdef ZTS http://cvs.php.net/viewvc.cgi/php-src/ext/spl/examples/directoryfilterdots.inc?r1=1.6&r2=1.6.4.1&diff_format=u Index: php-src/ext/spl/examples/directoryfilterdots.inc diff -u php-src/ext/spl/examples/directoryfilterdots.inc:1.6 php-src/ext/spl/examples/directoryfilterdots.inc:1.6.4.1 --- php-src/ext/spl/examples/directoryfilterdots.inc:1.6 Tue Feb 8 19:10:04 2005 +++ php-src/ext/spl/examples/directoryfilterdots.inc Fri Nov 3 18:58:41 2006 @@ -4,7 +4,7 @@ * @ingroup Examples * @brief class DirectoryFilterDots * @author Marcus Boerger - * @date 2003 - 2005 + * @date 2003 - 2006 * * SPL - Standard PHP Library */ @@ -12,7 +12,7 @@ /** @ingroup Examples * @brief A filtered DirectoryIterator * @author Marcus Boerger - * @version 1.1 + * @version 1.2 * * This Iteraotr takes a pathname from which it creates a DirectoryIterator * and makes it recursive. Further more it filters the entries '.' and '..'. @@ -24,7 +24,7 @@ */ function __construct($path) { - parent::__construct(new DirectoryIterator($path)); + parent::__construct(new RecursiveDirectoryIterator($path)); } /** @return whether the current entry is neither '.' nor '..' http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/recursiveiteratoriterator.inc?r1=1.14.2.2&r2=1.14.2.2.2.1&diff_format=u Index: php-src/ext/spl/internal/recursiveiteratoriterator.inc diff -u php-src/ext/spl/internal/recursiveiteratoriterator.inc:1.14.2.2 php-src/ext/spl/internal/recursiveiteratoriterator.inc:1.14.2.2.2.1 --- php-src/ext/spl/internal/recursiveiteratoriterator.inc:1.14.2.2 Sat Oct 8 19:09:58 2005 +++ php-src/ext/spl/internal/recursiveiteratoriterator.inc Fri Nov 3 18:58:41 2006 @@ -217,7 +217,7 @@ if ($after_move) { if (($this->mode == self::SELF_FIRST && $this->callHasChildren()) - $this->mode == self::LEAVES_ONLY) + || $this->mode == self::LEAVES_ONLY) $this->nextElement(); } else @@ -229,7 +229,9 @@ /** Called when the next element is available */ - function nextElement(); + function nextElement() + { + } } ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_autoload_009.phpt?view=markup&rev=1.1 Index: php-src/ext/spl/tests/spl_autoload_009.phpt +++ php-src/ext/spl/tests/spl_autoload_009.phpt --TEST-- SPL: spl_autoload() and friends --SKIPIF-- <?php if (!extension_loaded("spl")) print "skip"; ?> --INI-- include_path=. --FILE-- <?php function my_autoload($name) { require $name . '.class.inc'; var_dump(class_exists($name)); } spl_autoload_register("spl_autoload"); spl_autoload_register("my_autoload"); $obj = new testclass; ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- %stestclass.inc %stestclass.class.inc bool(true) ===DONE===

« previous php.cvs (#41328) next »