components/php-5_3/php-sapi/patches/025_php_Zend_zend.c.patch
changeset 846 fe258446a1ae
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/php-5_3/php-sapi/patches/025_php_Zend_zend.c.patch	Thu May 31 14:36:45 2012 -0700
@@ -0,0 +1,45 @@
+--- 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)