iliaa           Mon Jan  8 04:27:29 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/spl/tests      bug38325.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/spl    php_spl.c 
  Log:
  
  Fixed bug #38325 (spl_autoload_register() gaves wrong line for "class
  not found").
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.478&r2=1.2027.2.547.2.479&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.478 php-src/NEWS:1.2027.2.547.2.479
--- php-src/NEWS:1.2027.2.547.2.478     Sun Jan  7 18:38:22 2007
+++ php-src/NEWS        Mon Jan  8 04:27:29 2007
@@ -10,6 +10,8 @@
 - Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag,
   not entity). (Hannes)
 - Fixed bug #39394 (Missing check for older variants of openssl). (Ilia)
+- Fixed bug #38325 (spl_autoload_register() gaves wrong line for "class
+  not found"). (Ilia)
 
 04 Jan 2007, PHP 5.2.1RC2
 - Small optimization of the date() function (Matt,Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.12&r2=1.52.2.28.2.13&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.12 
php-src/ext/spl/php_spl.c:1.52.2.28.2.13
--- php-src/ext/spl/php_spl.c:1.52.2.28.2.12    Mon Jan  8 03:39:09 2007
+++ php-src/ext/spl/php_spl.c   Mon Jan  8 04:27:29 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_spl.c,v 1.52.2.28.2.12 2007/01/08 03:39:09 iliaa Exp $ */
+/* $Id: php_spl.c,v 1.52.2.28.2.13 2007/01/08 04:27:29 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
        #include "config.h"
@@ -297,7 +297,15 @@
        EG(function_state_ptr) = original_function_state_ptr;
 
        if (!found && !SPL_G(autoload_running)) {
-               zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, 
"Class %s could not be loaded", class_name);
+               /* For internal errors, we generate E_ERROR, for direct calls 
an exception is thrown.
+                * The "scope" is determined by an opcode, if it is 
ZEND_FETCH_CLASS we know function was called indirectly by
+                * the Zend engine.
+                */
+               if (active_opline->opcode != ZEND_FETCH_CLASS) {
+                       zend_throw_exception_ex(spl_ce_LogicException, 0 
TSRMLS_CC, "Class %s could not be loaded", class_name);
+               } else {
+                       php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s 
could not be loaded", class_name);
+               }
        }
 } /* }}} */
 

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug38325.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/bug38325.phpt
+++ php-src/ext/spl/tests/bug38325.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to