[prev in list] [next in list] [prev in thread] [next in thread]
List: pecl-cvs
Subject: [PECL-CVS] cvs: pecl /xhprof/extension xhprof.c /xhprof/extension/tests xhprof_004.phpt xhprof_004_
From: "Kannan Muthukkaruppan" <kannan () php ! net>
Date: 2009-05-27 18:11:04
Message-ID: cvskannan1243447864 () cvsserver
[Download RAW message or body]
kannan Wed May 27 18:11:04 2009 UTC
Added files:
/pecl/xhprof/extension/tests xhprof_004_require.php
Modified files:
/pecl/xhprof/extension xhprof.c
/pecl/xhprof/extension/tests xhprof_004.phpt
Log:
Bug #16574 require/require_once not special cased like include/include_once
http://cvs.php.net/viewvc.cgi/pecl/xhprof/extension/xhprof.c?r1=1.3&r2=1.4&diff_format=u
Index: pecl/xhprof/extension/xhprof.c
diff -u pecl/xhprof/extension/xhprof.c:1.3 pecl/xhprof/extension/xhprof.c:1.4
--- pecl/xhprof/extension/xhprof.c:1.3 Wed May 27 00:08:28 2009
+++ pecl/xhprof/extension/xhprof.c Wed May 27 18:11:04 2009
@@ -919,6 +919,7 @@
break;
case ZEND_REQUIRE:
func = "require";
+ add_filename = 1;
break;
case ZEND_INCLUDE_ONCE:
func = "include_once";
@@ -926,6 +927,7 @@
break;
case ZEND_REQUIRE_ONCE:
func = "require_once";
+ add_filename = 1;
break;
default:
func = "???_op";
http://cvs.php.net/viewvc.cgi/pecl/xhprof/extension/tests/xhprof_004.phpt?r1=1.1.1.1&r2=1.2&diff_format=u
Index: pecl/xhprof/extension/tests/xhprof_004.phpt
diff -u pecl/xhprof/extension/tests/xhprof_004.phpt:1.1.1.1 \
pecl/xhprof/extension/tests/xhprof_004.phpt:1.2
--- pecl/xhprof/extension/tests/xhprof_004.phpt:1.1.1.1 Tue Mar 17 18:35:18 2009
+++ pecl/xhprof/extension/tests/xhprof_004.phpt Wed May 27 18:11:04 2009
@@ -18,9 +18,19 @@
include_once dirname(__FILE__).'/xhprof_004_inc.php';
include_once dirname(__FILE__).'/xhprof_004_inc.php';
+
+// require_once:
+// Note: the 2nd and 3rd attempts should be no-ops and
+// will not show up in the profiler data. Only the first
+// one should.
+
+require_once dirname(__FILE__).'/xhprof_004_require.php';
+require_once dirname(__FILE__).'/xhprof_004_require.php';
+require_once dirname(__FILE__).'/xhprof_004_require.php';
+
$output = xhprof_disable();
-echo "Test for 'include' operation\n";
+echo "Test for 'include_once' & 'require_once' operation\n";
print_canonical($output);
echo "\n";
@@ -28,12 +38,20 @@
--EXPECT--
abc,def,ghi
I am in foo()...
-Test for 'include' operation
+11
+I am in bar()...
+Test for 'include_once' & 'require_once' operation
main() : ct= 1; wt=*;
-main()==>dirname : ct= 3; wt=*;
+main()==>dirname : ct= 6; wt=*;
main()==>load::tests/xhprof_004_inc.php : ct= 1; wt=*;
+main()==>load::tests/xhprof_004_require.php: ct= 1; wt=*;
main()==>run_init::tests/xhprof_004_inc.php: ct= 1; wt=*;
+main()==>run_init::tests/xhprof_004_require.php: ct= 1; wt=*;
main()==>xhprof_disable : ct= 1; wt=*;
run_init::tests/xhprof_004_inc.php==>explode: ct= 1; wt=*;
run_init::tests/xhprof_004_inc.php==>foo: ct= 1; wt=*;
run_init::tests/xhprof_004_inc.php==>implode: ct= 1; wt=*;
+run_init::tests/xhprof_004_require.php==>bar: ct= 1; wt=*;
+run_init::tests/xhprof_004_require.php==>explode: ct= 1; wt=*;
+run_init::tests/xhprof_004_require.php==>implode: ct= 1; wt=*;
+run_init::tests/xhprof_004_require.php==>strlen: ct= 1; wt=*;
http://cvs.php.net/viewvc.cgi/pecl/xhprof/extension/tests/xhprof_004_require.php?view=markup&rev=1.1
Index: pecl/xhprof/extension/tests/xhprof_004_require.php
+++ pecl/xhprof/extension/tests/xhprof_004_require.php
<?php
// This file is part of xhprof_004.phpt test.
function bar() {
echo "I am in bar()...\n";
}
// run some top-level code in this file.
// The profiler should mark functions called from here as
// children of the pseudo-function "run_init::<this_file_name>"
// which represents the initialization block of a file.
//
$result1 = explode(" ", "abc def ghi");
$result2 = implode(",", $result1);
$result3 = strlen($result2);
echo $result3 . "\n";
bar();
--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic