dmitry          Tue Nov 15 06:14:34 2005 EDT

  Modified files:              
    /php-src/tests/lang bug35176.phpt 
    /php-src/main       main.c 
  Log:
  Fixed bug #35176 (include()/require()/*_once() produce wrong error messages 
about main())
  
  
http://cvs.php.net/diff.php/php-src/tests/lang/bug35176.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/tests/lang/bug35176.phpt
diff -u /dev/null php-src/tests/lang/bug35176.phpt:1.2
--- /dev/null   Tue Nov 15 06:14:34 2005
+++ php-src/tests/lang/bug35176.phpt    Tue Nov 15 06:14:34 2005
@@ -0,0 +1,14 @@
+--TEST--
+Bug #35176 (include()/require()/*_once() produce wrong error messages about 
main())
+--INI--
+html_errors=1
+error_reporting=4095
+--FILE--
+<?php
+require_once('nonexisiting.php');
+?>
+--EXPECTF--
+<br />
+<b>Warning</b>:  require_once(nonexisiting.php) [<a 
href='function.require-once.html'>function.require-once.html</a>]: failed to 
open stream: No such file or directory in <b>%sbug35176.php</b> on line 
<b>2</b><br />
+<br />
+<b>Fatal error</b>:  require_once() [<a 
href='function.require.html'>function.require.html</a>]: Failed opening 
required 'nonexisiting.php' (%s) in <b>%sbug35176.php</b> on line <b>2</b><br />
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.650&r2=1.651&ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.650 php-src/main/main.c:1.651
--- php-src/main/main.c:1.650   Sun Oct  9 22:26:13 2005
+++ php-src/main/main.c Tue Nov 15 06:14:34 2005
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.650 2005/10/10 02:26:13 rrichards Exp $ */
+/* $Id: main.c,v 1.651 2005/11/15 11:14:34 dmitry Exp $ */
 
 /* {{{ includes
  */
@@ -570,6 +570,28 @@
                stage = "PHP Startup";
        } else if (php_during_module_shutdown()) {
                stage = "PHP Shutdown";
+       } else if (EG(current_execute_data) &&
+                  EG(current_execute_data)->opline &&
+                  EG(current_execute_data)->opline->opcode == 
ZEND_INCLUDE_OR_EVAL) {
+               switch 
(EG(current_execute_data)->opline->op2.u.constant.value.lval) {
+                       case ZEND_EVAL:
+                               function = "eval";
+                               break;
+                       case ZEND_INCLUDE:
+                               function = "include";
+                               break;
+                       case ZEND_INCLUDE_ONCE:
+                               function = "include_once";
+                               break;
+                       case ZEND_REQUIRE:
+                               function = "require";
+                               break;
+                       case ZEND_REQUIRE_ONCE:
+                               function = "require_once";
+                               break;
+                       default:
+                               stage = "Unknown";
+               }
        } else {
                function = get_active_function_name(TSRMLS_C);
                if (!function || !USTR_LEN(function)) {

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

Reply via email to