Changeset 954 in svn


Ignore:
Timestamp:
2012-07-06T09:18:49Z (3 years ago)
Author:
Xuefer
Message:

restore open_files handling, it is required. disable included_files which is real EG since PHP 5_2

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils.c

    r938 r954  
    585585    ZEND_24(NOTHING, const) char *filename;
    586586
     587#ifndef ZEND_ENGINE_2_2
    587588    HashTable orig_included_files;
    588589    HashTable *tmp_included_files;
     590#endif
    589591
    590592#ifdef HAVE_XCACHE_CONSTANT
     
    772774    memset(sandbox, 0, sizeof(sandbox[0]));
    773775
     776#ifndef ZEND_ENGINE_2_2
    774777    memcpy(&OG(included_files), &EG(included_files), sizeof(EG(included_files)));
     778#endif
    775779
    776780#ifdef HAVE_XCACHE_CONSTANT
     
    791795#endif
    792796
     797#ifndef ZEND_ENGINE_2_2
    793798    TG(included_files) = &EG(included_files);
    794 
     799#endif
     800
     801#ifndef ZEND_ENGINE_2_2
    795802    zend_hash_init_ex(TG(included_files), 5, NULL, NULL, 0, 1);
     803#endif
    796804#ifdef HAVE_XCACHE_CONSTANT
    797805    h = OG(zend_constants);
     
    926934#endif
    927935
     936#ifndef ZEND_ENGINE_2_2
    928937    i = 1;
    929938    zend_hash_add(&OG(included_files), sandbox->filename, strlen(sandbox->filename) + 1, (void *)&i, sizeof(int), NULL);
     939#endif
    930940}
    931941/* }}} */
     
    978988    zend_hash_destroy(&TG(auto_globals));
    979989#endif
     990#ifndef ZEND_ENGINE_2_2
    980991    zend_hash_destroy(TG(included_files));
    981 
     992#endif
     993
     994#ifndef ZEND_ENGINE_2_2
    982995    /* restore orig here, as EG/CG holded tmp before */
    983996    memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files)));
     997#endif
    984998
    985999#ifdef XCACHE_ERROR_CACHING
  • trunk/xcache.c

    r950 r954  
    746746/* }}} */
    747747
    748 static zend_op_array *xc_entry_install(xc_entry_php_t *entry_php TSRMLS_DC) /* {{{ */
     748static zend_op_array *xc_entry_install(xc_entry_php_t *entry_php, zend_file_handle *h TSRMLS_DC) /* {{{ */
    749749{
    750750    zend_uint i;
     
    815815
    816816    i = 1;
     817#ifndef ZEND_ENGINE_2_2
    817818    zend_hash_add(&EG(included_files), entry_php->entry.name.str.val, entry_php->entry.name.str.len+1, (void *)&i, sizeof(int), NULL);
     819#endif
     820    if (h) {
     821        zend_llist_add_element(&CG(open_files), h);
     822    }
    818823
    819824#ifndef ZEND_ENGINE_2
     
    18401845}
    18411846/* }}} */
    1842 static zend_op_array *xc_compile_restore(xc_entry_php_t *stored_entry, xc_entry_data_php_t *stored_php TSRMLS_DC) /* {{{ */
     1847static zend_op_array *xc_compile_restore(xc_entry_php_t *stored_entry, xc_entry_data_php_t *stored_php, zend_file_handle *h TSRMLS_DC) /* {{{ */
    18431848{
    18441849    zend_op_array *op_array;
     
    18601865    catched = 0;
    18611866    zend_try {
    1862         op_array = xc_entry_install(&restored_entry TSRMLS_CC);
     1867        op_array = xc_entry_install(&restored_entry, h TSRMLS_CC);
    18631868    } zend_catch {
    18641869        catched = 1;
     
    21182123    /* found entry */
    21192124    if (stored_entry && stored_php) {
    2120         return xc_compile_restore(stored_entry, stored_php TSRMLS_CC);
     2125        return xc_compile_restore(stored_entry, stored_php, NULL /* h */ TSRMLS_CC);
    21212126    }
    21222127
     
    21342139    op_array = xc_sandbox(xc_compile_file_sandboxed, (void *) &sandboxed_compiler, h->opened_path ? h->opened_path : h->filename TSRMLS_CC);
    21352140    if (sandboxed_compiler.stored_entry) {
    2136         return xc_compile_restore(sandboxed_compiler.stored_entry, sandboxed_compiler.stored_php TSRMLS_CC);
     2141        return xc_compile_restore(sandboxed_compiler.stored_entry, sandboxed_compiler.stored_php, sandboxed_compiler.h TSRMLS_CC);
    21372142    }
    21382143    else {
Note: See TracChangeset for help on using the changeset viewer.