diff --git a/xcache.c b/xcache.c
index f7b0fad..0681f8b 100644
|
a
|
b
|
static int xc_entry_data_php_init_md5(xc_cache_t *cache, xc_compiler_t *compiler |
| 1214 | 1214 | php_stream *stream; |
| 1215 | 1215 | ulong old_rsid = EG(regular_list).nNextFreeElement; |
| 1216 | 1216 | |
| | 1217 | php_stream_wrapper *wrapper = NULL; |
| | 1218 | char *path_for_open = NULL; |
| | 1219 | wrapper = php_stream_locate_url_wrapper(compiler->filename, &path_for_open, 0 TSRMLS_CC); |
| | 1220 | TRACE("wrapper == &php_plain_files_wrapper => (%i) for file %s", wrapper == &php_plain_files_wrapper, compiler->filename); |
| | 1221 | |
| 1217 | 1222 | stream = php_stream_open_wrapper((char *) compiler->filename, "rb", USE_PATH | REPORT_ERRORS | ENFORCE_SAFE_MODE | STREAM_DISABLE_OPEN_BASEDIR, NULL); |
| 1218 | 1223 | if (!stream) { |
| 1219 | 1224 | return FAILURE; |
| … |
… |
static zend_op_array *xc_compile_file_cached(xc_compiler_t *compiler, zend_file_ |
| 2135 | 2140 | } |
| 2136 | 2141 | } |
| 2137 | 2142 | /* }}} */ |
| | 2143 | |
| | 2144 | static php_stream_wrapper *xc_swap_file_stream_wrapper(php_stream_wrapper *new_wrapper, zend_file_handle *h){ |
| | 2145 | php_stream_wrapper *wrapper = NULL; |
| | 2146 | char *path_for_open = NULL; |
| | 2147 | char *protocol = "file"; |
| | 2148 | int succes =0; |
| | 2149 | |
| | 2150 | wrapper = php_stream_locate_url_wrapper( h->filename, &path_for_open, 0 TSRMLS_CC); |
| | 2151 | succes = php_unregister_url_stream_wrapper_volatile(protocol TSRMLS_CC); |
| | 2152 | TRACE("php_unregister_url_stream_wrapper => (%i)", succes == SUCCESS); |
| | 2153 | succes = php_register_url_stream_wrapper_volatile(protocol, new_wrapper TSRMLS_DC); |
| | 2154 | TRACE("php_register_url_stream_wrapper => (%i)", succes == SUCCESS); |
| | 2155 | return wrapper; |
| | 2156 | } |
| | 2157 | |
| 2138 | 2158 | static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ |
| 2139 | 2159 | { |
| 2140 | 2160 | xc_compiler_t compiler; |
| … |
… |
static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / |
| 2142 | 2162 | |
| 2143 | 2163 | assert(xc_initized); |
| 2144 | 2164 | |
| | 2165 | php_stream_wrapper *stream_wrapper = NULL; |
| | 2166 | TRACE("using plain wrapper in xc_compile_file",0); |
| | 2167 | stream_wrapper = xc_swap_file_stream_wrapper(&php_plain_files_wrapper, h); |
| | 2168 | |
| 2145 | 2169 | TRACE("xc_compile_file: type=%d name=%s", h->type, h->filename ? h->filename : "NULL"); |
| 2146 | 2170 | |
| 2147 | 2171 | if (!XG(cacher) |
| … |
… |
static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / |
| 2156 | 2180 | #endif |
| 2157 | 2181 | ) { |
| 2158 | 2182 | TRACE("%s", "cacher not enabled"); |
| | 2183 | xc_swap_file_stream_wrapper(stream_wrapper, h); |
| 2159 | 2184 | return old_compile_file(h, type TSRMLS_CC); |
| 2160 | 2185 | } |
| 2161 | 2186 | |
| … |
… |
static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / |
| 2165 | 2190 | compiler.filename_len = strlen(compiler.filename); |
| 2166 | 2191 | if (xc_entry_php_init_key(&compiler TSRMLS_CC) != SUCCESS) { |
| 2167 | 2192 | TRACE("failed to init key for %s", compiler.filename); |
| | 2193 | xc_swap_file_stream_wrapper(stream_wrapper, h); |
| 2168 | 2194 | return old_compile_file(h, type TSRMLS_CC); |
| 2169 | 2195 | } |
| 2170 | 2196 | /* }}} */ |
| … |
… |
static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) / |
| 2172 | 2198 | op_array = xc_compile_file_cached(&compiler, h, type TSRMLS_CC); |
| 2173 | 2199 | |
| 2174 | 2200 | xc_entry_free_key_php(&compiler.new_entry TSRMLS_CC); |
| 2175 | | |
| | 2201 | xc_swap_file_stream_wrapper(stream_wrapper, h); |
| 2176 | 2202 | return op_array; |
| 2177 | 2203 | } |
| 2178 | 2204 | /* }}} */ |