components/php-5_3/php-sapi/patches/026_php_Zend_zend_API.c.patch
changeset 846 fe258446a1ae
equal deleted inserted replaced
845:f38158deaa77 846:fe258446a1ae
       
     1 --- php-5.3.10/Zend/zend_API.c_orig	Sun Jan  1 05:15:04 2012
       
     2 +++ php-5.3.10/Zend/zend_API.c	Wed Feb  8 11:25:25 2012
       
     3 @@ -27,11 +27,16 @@
       
     4  #include "zend_constants.h"
       
     5  #include "zend_exceptions.h"
       
     6  #include "zend_closures.h"
       
     7 +#include "zend_dtrace.h"
       
     8  
       
     9  #ifdef HAVE_STDARG_H
       
    10  #include <stdarg.h>
       
    11  #endif
       
    12  
       
    13 +#ifdef HAVE_DTRACE
       
    14 +extern char* dtrace_get_executed_filename(TSRMLS_D);
       
    15 +#endif
       
    16 +
       
    17  /* these variables are true statics/globals, and have to be mutex'ed on every access */
       
    18  static int module_count=0;
       
    19  ZEND_API HashTable module_registry;
       
    20 @@ -1073,6 +1078,17 @@
       
    21  		zend_error(E_ERROR, "Cannot instantiate %s %s", what, class_type->name);
       
    22  	}
       
    23  
       
    24 +#ifdef HAVE_DTRACE
       
    25 +       if (DTRACE_OBJECT_CREATE_ENABLED()) {
       
    26 +               char *filename;
       
    27 +               int lineno;
       
    28 +
       
    29 +               filename = dtrace_get_executed_filename(TSRMLS_C);
       
    30 +               lineno = zend_get_executed_lineno(TSRMLS_C);
       
    31 +               DTRACE_OBJECT_CREATE(class_type->name, filename, lineno);
       
    32 +       }
       
    33 +#endif /* HAVE_DTRACE */
       
    34 +
       
    35  	zend_update_class_constants(class_type TSRMLS_CC);
       
    36  
       
    37  	Z_TYPE_P(arg) = IS_OBJECT;