Changeset 231

Show
Ignore:
Timestamp:
07/22/06 12:07:15 (2 years ago)
Author:
bart
Message:

Some zval macro's differ for php4 and 5, this fixes #146.

Files:

Legend:

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

    r230 r231  
     12006-07-22  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
     2 
     3        * Some zval macro's differ for php4 and 5, this fixes #146. 
     4 
    152006-07-19  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
    26 
  • eaccelerator/trunk/ea_restore.c

    r228 r231  
    165165                } 
    166166#ifndef ZEND_ENGINE_2 
    167                 FIXUP(Z_OBJVAL_P(zv).ce); 
    168                 if (Z_OBJVAL_P(zv).properties != NULL) { 
    169                         FIXUP(Z_OBJVAL_P(zv).properties); 
    170                         fixup_zval_hash(Z_OBJVAL_P(zv).properties); 
     167                FIXUP(Z_OBJCE_P(zv)); 
     168                if (Z_OBJPROP_P(zv) != NULL) { 
     169                        FIXUP(Z_OBJPROP_P(zv)); 
     170                        fixup_zval_hash(Z_OBJPROP_P(zv)); 
    171171                } 
    172172#endif 
     
    402402#ifndef ZEND_ENGINE_2 
    403403        zend_bool incomplete_class = 0; 
    404         char *class_name = (char *) Z_OBJVAL_P(zv).ce
     404        char *class_name = (char *) Z_OBJCE_P(zv)
    405405        int name_len = 0; 
    406406        if (!EAG(compress)) { 
     
    418418                } else { 
    419419                    efree(lowercase_name); 
    420                     Z_OBJVAL_P(zv).ce = ce; 
     420                    Z_OBJCE_P(zv) = ce; 
    421421                    incomplete_class = 1; 
    422422                } 
    423423            } else { 
    424                 Z_OBJVAL_P(zv).ce = ce; 
     424                Z_OBJCE_P(zv) = ce; 
    425425            } 
    426426        } 
    427         if (Z_OBJVAL_P(zv).properties != NULL) { 
    428             Z_OBJVAL_P(zv).properties = restore_zval_hash(NULL, Z_OBJVAL_P(zv).properties); 
    429             Z_OBJVAL_P(zv).properties->pDestructor = ZVAL_PTR_DTOR; 
     427        if (Z_OBJPROP_P(zv) != NULL) { 
     428            Z_OBJPROP_P(zv) = restore_zval_hash(NULL, Z_OBJPROP_P(zv)); 
     429            Z_OBJPROP_P(zv)->pDestructor = ZVAL_PTR_DTOR; 
    430430            /* Clearing references */ 
    431431            { 
    432                 Bucket *p = Z_OBJVAL_P(zv).properties->pListHead; 
     432                Bucket *p = Z_OBJPROP_P(zv)->pListHead; 
    433433                while (p != NULL) { 
    434434                    ((zval *) (p->pDataPtr))->refcount = 1; 
  • eaccelerator/trunk/ea_store.c

    r228 r231  
    129129        case IS_OBJECT: 
    130130#ifndef ZEND_ENGINE_2 
    131                 if (Z_OBJVAL_P(zv).ce != NULL) { 
    132                         zend_class_entry *ce = Z_OBJVAL_P(zv).ce
     131                if (Z_OBJCE_P(zv) != NULL) { 
     132                        zend_class_entry *ce = Z_OBJCE_P(zv)
    133133                        if (!EAG(compress)) { 
    134134                                DBG(ea_debug_error, ("[%d] EACCELERATOR can't cache objects\n", getpid())); 
     
    142142                                ce = ce->parent; 
    143143                        } 
    144                         calc_string(Z_OBJVAL_P(zv).ce->name, Z_OBJVAL_P(zv).ce->name_length + 1 TSRMLS_CC); 
    145                 } 
    146                 if (Z_OBJVAL_P(zv).properties != NULL) { 
     144                        calc_string(Z_OBJCE_P(zv)->name, Z_OBJCE_P(zv)->name_length + 1 TSRMLS_CC); 
     145                } 
     146                if (Z_OBJPROP_P(zv) != NULL) { 
    147147                        EACCELERATOR_ALIGN(EAG(mem)); 
    148148                        EAG(mem) += sizeof(HashTable); 
    149                         calc_zval_hash(Z_OBJVAL_P(zv).properties); 
     149                        calc_zval_hash(Z_OBJPROP_P(zv)); 
    150150                } 
    151151#endif 
     
    497497                } 
    498498#ifndef ZEND_ENGINE_2 
    499                 if (Z_OBJVAL_P(zv).ce != NULL) { 
    500                         char *s = store_string(Z_OBJVAL_P(zv).ce->name, Z_OBJVAL_P(zv).ce->name_length + 1 TSRMLS_CC); 
    501                         zend_str_tolower(s, Z_OBJVAL_P(zv).ce->name_length); 
    502                         Z_OBJVAL_P(zv).ce = (zend_class_entry *) s; 
    503                 } 
    504                 if (Z_OBJVAL_P(zv).properties != NULL) { 
     499                if (Z_OBJCE_P(zv) != NULL) { 
     500                        char *s = store_string(Z_OBJCE_P(zv)->name, Z_OBJCE_P(zv)->name_length + 1 TSRMLS_CC); 
     501                        zend_str_tolower(s, Z_OBJCE_P(zv)->name_length); 
     502                        Z_OBJCE_P(zv) = (zend_class_entry *) s; 
     503                } 
     504                if (Z_OBJPROP_P(zv) != NULL) { 
    505505                        HashTable *p; 
    506506                        EACCELERATOR_ALIGN(EAG(mem)); 
    507507                        p = (HashTable *) EAG(mem); 
    508508                        EAG(mem) += sizeof(HashTable); 
    509                         store_zval_hash(p, Z_OBJVAL_P(zv).properties); 
    510                         Z_OBJVAL_P(zv).properties = p; 
     509                        store_zval_hash(p, Z_OBJPROP_P(zv)); 
     510                        Z_OBJPROP_P(zv) = p; 
    511511                } 
    512512#endif