ports/168441: [patch] devel/pecl-xhprof PHP 5.4 support

Espen Volden espen at responsreklame.no
Tue May 29 20:20:06 UTC 2012


The following reply was made to PR ports/168441; it has been noted by GNATS.

From: Espen Volden <espen at responsreklame.no>
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: ports/168441: [patch] devel/pecl-xhprof PHP 5.4 support
Date: Tue, 29 May 2012 21:29:12 +0200

 This is a multi-part message in MIME format.
 --------------060307030907010106000704
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 For some reason the patch didn't get attached to the PR.
 The patch is attached to this message.
 
 --------------060307030907010106000704
 Content-Type: text/x-csrc;
  name="patch-extensions-xhprof.c"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="patch-extensions-xhprof.c"
 
 --- xhprof.c
 +++ xhprof.c
 @@ -28,6 +28,7 @@
  #include "php_ini.h"
  #include "ext/standard/info.h"
  #include "php_xhprof.h"
 +#include "Zend/zend_extensions.h"
  #include <sys/time.h>
  #include <sys/resource.h>
  #include <stdlib.h>
 @@ -898,7 +899,7 @@ static char *hp_get_base_filename(char *filename) {
  static char *hp_get_function_name(zend_op_array *ops TSRMLS_DC) {
    zend_execute_data *data;
    char              *func = NULL;
 -  char              *cls = NULL;
 +  const char        *cls = NULL;
    char              *ret = NULL;
    int                len;
    zend_function      *curr_func;
 @@ -942,7 +943,12 @@ static char *hp_get_function_name(zend_op_array *ops TSRMLS_DC) {
        /* we are dealing with a special directive/function like
         * include, eval, etc.
         */
 +#if ZEND_EXTENSION_API_NO >= 220100525
 +      curr_op = data->opline->extended_value;
 +#else
        curr_op = data->opline->op2.u.constant.value.lval;
 +#endif
 +
        switch (curr_op) {
          case ZEND_EVAL:
            func = "eval";
 @@ -1660,13 +1666,22 @@ ZEND_DLEXPORT void hp_execute_internal(zend_execute_data *execute_data,
    if (!_zend_execute_internal) {
      /* no old override to begin with. so invoke the builtin's implementation  */
      zend_op *opline = EX(opline);
 +#if ZEND_EXTENSION_API_NO >= 220100525
 +    temp_variable *retvar = &EX_T(opline->result.var);
 +    ((zend_internal_function *) EX(function_state).function)->handler(
 +                       opline->extended_value,
 +                       retvar->var.ptr,
 +                       (EX(function_state).function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ?
 +                       &retvar->var.ptr:NULL,
 +                       EX(object), ret TSRMLS_CC);
 +#else
      ((zend_internal_function *) EX(function_state).function)->handler(
                         opline->extended_value,
                         EX_T(opline->result.u.var).var.ptr,
                         EX(function_state).function->common.return_reference ?
                         &EX_T(opline->result.u.var).var.ptr:NULL,
                         EX(object), ret TSRMLS_CC);
 -
 +#endif
    } else {
      /* call the old override */
      _zend_execute_internal(execute_data, ret TSRMLS_CC);
 
 --------------060307030907010106000704--



More information about the freebsd-ports-bugs mailing list