Changeset 348

Show
Ignore:
Timestamp:
06/20/08 11:20:17 (5 months ago)
Author:
bart
Message:

First stab at php 5.3 support. Only fixes the script cache. phpMyAdmin seems to work with these changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r344 r348  
    1 2008-05-18  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
     12008-05-20  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
     2 
     3        * First stab at php 5.3 support. Only fixes the script cache. 
     4          phpMyAdmin seems to work with these changes. 
     5 
     62008-05-19  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
    27 
    38        * Remove support for all php versions older than php 5.1 
  • eaccelerator/trunk/ea_restore.c

    r344 r348  
    5050#endif 
    5151 
     52#ifdef ZEND_ENGINE_2_3 
     53    #define RESET_PZVAL_REFCOUNT(z) Z_SET_REFCOUNT_P(z, 1) 
     54#else 
     55    #define RESET_PZVAL_REFCOUNT(z) (z)->refcount = 1; 
     56#endif 
     57 
    5258/* pointer to the properties_info hashtable destructor */ 
    5359dtor_func_t properties_info_dtor = NULL; 
     
    277283    restore_zval(p TSRMLS_CC); 
    278284    /* hrak: reset refcount to make sure there is one reference to this val, and prevent memleaks */ 
    279     p->refcount = 1
     285    RESET_PZVAL_REFCOUNT(p)
    280286    return p; 
    281287} 
     
    539545    to->try_catch_array = from->try_catch_array; 
    540546    to->last_try_catch = from->last_try_catch; 
     547#ifdef ZEND_ENGINE_2_3 
     548    to->this_var = from->this_var; 
     549#else 
    541550    to->uses_this = from->uses_this; 
     551#endif 
    542552 
    543553    to->line_start = from->line_start; 
     
    556566            Bucket *p = to->static_variables->pListHead; 
    557567            while (p != NULL) { 
    558                 ((zval *) (p->pDataPtr))->refcount = 1
     568                RESET_PZVAL_REFCOUNT((zval*) p->pDataPtr)
    559569                p = p->pListNext; 
    560570            } 
  • eaccelerator/trunk/ea_store.c

    r344 r348  
    4747inline 
    4848#endif 
     49#ifdef ZEND_ENGINE_2_3 
     50static size_t calc_string(const char *str, int len TSRMLS_DC) 
     51#else 
    4952static size_t calc_string(char *str, int len TSRMLS_DC) 
     53#endif 
    5054{ 
    5155    if (len > MAX_DUP_STR_LEN ||  
     
    324328    EACCELERATOR_ALIGN((*at)); 
    325329 
     330#ifdef ZEND_ENGINE_2_3 
     331static inline char *store_string(char **at, const char *str, int len TSRMLS_DC) 
     332#else 
    326333static inline char *store_string(char **at, char *str, int len TSRMLS_DC) 
     334#endif 
    327335{ 
    328336    char *p; 
     
    553561    to->try_catch_array = from->try_catch_array; 
    554562    to->last_try_catch = from->last_try_catch; 
     563#ifdef ZEND_ENGINE_2_3 
     564    to->this_var = from->this_var; 
     565#else 
    555566    to->uses_this = from->uses_this; 
     567#endif 
    556568    if (from->try_catch_array != NULL) { 
    557569        to->try_catch_array = (zend_try_catch_element *)ALLOCATE(at, sizeof(zend_try_catch_element) * from->last_try_catch); 
  • eaccelerator/trunk/eaccelerator.c

    r347 r348  
    11031103} 
    11041104 
     1105/* copy of zend_class_add_ref, the linker isn't able to link to it any more 
     1106 * in php 5.3 
     1107 * TODO: see if we can steal the pointer 
     1108 */ 
     1109void ea_class_add_ref(zend_class_entry **ce) 
     1110{ 
     1111            (*ce)->refcount++; 
     1112} 
     1113 
    11051114/* 
    11061115 * Intercept compilation of PHP file.  If we already have the file in 
     
    12241233 
    12251234    zend_hash_init_ex(&tmp_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0); 
    1226                 zend_hash_copy(&tmp_class_table, &eaccelerator_global_class_table, (copy_ctor_func_t)zend_class_add_ref, &tmp_class, sizeof(zend_class_entry *)); 
     1235                zend_hash_copy(&tmp_class_table, &eaccelerator_global_class_table, (copy_ctor_func_t)ea_class_add_ref, &tmp_class, sizeof(zend_class_entry *)); 
    12271236 
    12281237    orig_class_table = CG(class_table);; 
  • eaccelerator/trunk/eaccelerator.h

    r344 r348  
    198198typedef struct _eaccelerator_op_array { 
    199199        zend_uchar type; 
     200#ifdef ZEND_ENGINE_2_3 
     201    zend_uint this_var; 
     202#else 
    200203        zend_bool uses_this; 
     204#endif 
    201205        zend_bool return_reference; 
    202206        zend_uint num_args;