Changeset 1558 in svn for trunk/mod_cacher/xc_cacher.c


Ignore:
Timestamp:
2014-11-10T06:08:07Z (5 years ago)
Author:
Xuefer
Message:

closes #342: object caching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1551 r1558  
    33433343        if (stored_entry_var) {
    33443344            /* return */
    3345             xc_processor_restore_zval(return_value, stored_entry_var->value, stored_entry_var->have_references TSRMLS_CC);
     3345            xc_processor_restore_var(return_value, stored_entry_var TSRMLS_CC);
    33463346            xc_cached_hit_unlocked(cache->cached TSRMLS_CC);
    33473347        }
     
    33823382    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &name, &value, &entry_var.entry.ttl) == FAILURE) {
    33833383        return;
    3384     }
    3385 
    3386     if (Z_TYPE_P(value) == IS_OBJECT) {
    3387         php_error_docref(NULL TSRMLS_CC, E_ERROR, "Objects cannot be stored in the variable cache. Use serialize before xcache_set");
    3388         RETURN_NULL();
    33893384    }
    33903385
     
    36163611
    36173612            TRACE("%s", "incdec: notlong");
    3618             xc_processor_restore_zval(&oldzval, stored_entry_var->value, stored_entry_var->have_references TSRMLS_CC);
    3619             convert_to_long(&oldzval);
    3620             value = Z_LVAL(oldzval);
    3621             zval_dtor(&oldzval);
     3613            if (stored_entry_var->objects_count) {
     3614                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert object to integer");
     3615                value = 0;
     3616            }
     3617            else {
     3618                xc_processor_restore_var(&oldzval, stored_entry_var TSRMLS_CC);
     3619                convert_to_long(&oldzval);
     3620                value = Z_LVAL(oldzval);
     3621                zval_dtor(&oldzval);
     3622            }
    36223623        }
    36233624        else {
Note: See TracChangeset for help on using the changeset viewer.