components/php-5_3/php-sapi/patches/025_php_Zend_zend.c.patch
author Craig Mohrman <craig.mohrman@oracle.com>
Fri, 18 Apr 2014 11:03:12 -0700
branchs11u1-sru
changeset 3086 649b12aa87ce
parent 846 fe258446a1ae
permissions -rw-r--r--
17362112 problem in UTILITY/PHP 18083695 problem in UTILITY/PHP 18181920 remove BUILD_VERSION from php package manifests 18368537 problem in UTILITY/PHP 18368630 problem in UTILITY/PHP

--- php-5.3.10/Zend/zend.c_orig	Sun Jan  1 05:15:04 2012
+++ php-5.3.10/Zend/zend.c	Wed Feb  8 11:25:25 2012
@@ -29,6 +29,7 @@
 #include "zend_builtin_functions.h"
 #include "zend_ini.h"
 #include "zend_vm.h"
+#include "zend_dtrace.h"
 
 #ifdef ZTS
 # define GLOBAL_FUNCTION_TABLE		global_function_table
@@ -636,10 +637,17 @@
 	zend_getenv = utility_functions->getenv_function;
 	zend_resolve_path = utility_functions->resolve_path_function;
 
+#if HAVE_DTRACE
+/* build with dtrace support */
+       zend_compile_file = dtrace_compile_file;
+       zend_execute = dtrace_execute;
+       zend_execute_internal = dtrace_execute_internal;
+#else
 	zend_compile_file = compile_file;
-	zend_compile_string = compile_string;
 	zend_execute = execute;
 	zend_execute_internal = NULL;
+#endif /* HAVE_SYS_SDT_H */
+	zend_compile_string = compile_string;
 	zend_throw_exception_hook = NULL;
 
 	zend_init_opcodes_handlers();
@@ -1039,6 +1047,15 @@
 
 	va_start(args, format);
 
+#ifdef HAVE_DTRACE
+       if(DTRACE_ERROR_ENABLED()) {
+               char *dtrace_error_buffer;
+               zend_vspprintf(&dtrace_error_buffer, 0, format, args);
+               DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
+               efree(dtrace_error_buffer);
+       }
+#endif /* HAVE_DTRACE */
+
 	/* if we don't have a user defined error handler */
 	if (!EG(user_error_handler)
 		|| !(EG(user_error_handler_error_reporting) & type)