Changeset 344 for eaccelerator/trunk/eaccelerator.c
- Timestamp:
- 06/19/08 18:01:31 (7 months ago)
- Files:
-
- eaccelerator/trunk/eaccelerator.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/eaccelerator.c
r342 r344 102 102 int binary_zend_version[2]; 103 103 104 #ifdef ZEND_ENGINE_2105 104 /* pointer to the properties_info hashtable destructor */ 106 105 extern dtor_func_t properties_info_dtor; 107 #endif108 106 109 107 /* saved original functions */ … … 1166 1164 // segv74: really cheap work around to auto_global problem. 1167 1165 // it makes just in time to every time. 1168 #ifdef ZEND_ENGINE_21169 1166 zend_is_auto_global("_GET", sizeof("_GET")-1 TSRMLS_CC); 1170 1167 zend_is_auto_global("_POST", sizeof("_POST")-1 TSRMLS_CC); … … 1174 1171 zend_is_auto_global("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); 1175 1172 zend_is_auto_global("_FILES", sizeof("_FILES")-1 TSRMLS_CC); 1176 #endif1177 1173 1178 1174 if (t != NULL) { // restore from cache … … 1184 1180 1185 1181 zend_llist_add_element(&CG(open_files), file_handle); 1186 #ifdef ZEND_ENGINE_21187 1182 if (file_handle->opened_path == NULL && file_handle->type != ZEND_HANDLE_STREAM) { 1188 1183 file_handle->handle.stream.handle = (void*)1; 1189 1184 file_handle->opened_path = EAG(mem); /* EAG(mem) = p->realfilename from eaccelerator_restore here */ 1190 1185 } 1191 #else1192 if (file_handle->opened_path == NULL && file_handle->type != ZEND_HANDLE_FP) {1193 int dummy = 1;1194 file_handle->opened_path = EAG(mem); /* EAG(mem) = p->realfilename from eaccelerator_restore here */1195 zend_hash_add(&EG(included_files), file_handle->opened_path, strlen(file_handle->opened_path)+1, (void *)&dummy, sizeof(int), NULL);1196 file_handle->handle.fp = NULL;1197 }1198 #endif1199 1186 1200 1187 DBG(ea_debug_printf, (EA_TEST_PERFORMANCE, "\t[%d] compile_file: restored (%ld)\n", getpid(), ea_debug_elapsed_time(&tv_start))); … … 1237 1224 1238 1225 zend_hash_init_ex(&tmp_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0); 1239 #ifdef ZEND_ENGINE_21240 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 *)); 1241 #else1242 zend_hash_copy(&tmp_class_table, &eaccelerator_global_class_table, NULL, &tmp_class, sizeof(zend_class_entry));1243 #endif1244 1227 1245 1228 orig_class_table = CG(class_table);; 1246 1229 CG(class_table) = &tmp_class_table; 1247 #ifdef ZEND_ENGINE_21248 1230 orig_eg_class_table = EG(class_table);; 1249 1231 EG(class_table) = &tmp_class_table; 1250 #endif1251 1232 1252 1233 /* Storing global pre-compiled functions and classes */ … … 1267 1248 CG(function_table) = orig_function_table; 1268 1249 CG(class_table) = orig_class_table; 1269 #ifdef ZEND_ENGINE_21270 1250 EG(class_table) = orig_eg_class_table; 1271 #endif1272 1251 ea_bailout = 1; 1273 1252 } zend_end_try(); … … 1305 1284 CG(function_table) = orig_function_table; 1306 1285 CG(class_table) = orig_class_table; 1307 #ifdef ZEND_ENGINE_21308 1286 EG(class_table) = orig_eg_class_table; 1309 1287 DBG(ea_debug_printf, (EA_DEBUG, "\t[%d] restoring CG(class_table)[%08x] != EG(class_table)[%08x]\n", 1310 1288 getpid(), CG(class_table), EG(class_table))); 1311 #endif1312 1289 while (function_table_tail != NULL) { 1313 1290 zend_op_array *op_array = (zend_op_array*)function_table_tail->pData; … … 1317 1294 CG(in_compilation) = 1; 1318 1295 CG(compiled_filename) = file_handle->opened_path; 1319 #ifdef ZEND_ENGINE_21320 1296 CG(zend_lineno) = op_array->line_start; 1321 #else1322 CG(zend_lineno) = op_array->opcodes[0].lineno;1323 #endif1324 1297 zend_error(E_ERROR, "Cannot redeclare %s()", function_table_tail->arKey); 1325 1298 } … … 1328 1301 } 1329 1302 while (class_table_tail != NULL) { 1330 #ifdef ZEND_ENGINE_21331 1303 zend_class_entry **ce = (zend_class_entry**)class_table_tail->pData; 1332 1304 if ((*ce)->type == ZEND_USER_CLASS) { … … 1336 1308 CG(compiled_filename) = file_handle->opened_path; 1337 1309 CG(zend_lineno) = (*ce)->line_start; 1338 #else1339 zend_class_entry *ce = (zend_class_entry*)class_table_tail->pData;1340 if (ce->type == ZEND_USER_CLASS) {1341 if (ce->parent != NULL) {1342 if (zend_hash_find(CG(class_table), (void*)ce->parent->name, ce->parent->name_length+1, (void **)&ce->parent) != SUCCESS) {1343 ce->parent = NULL;1344 }1345 }1346 if (zend_hash_add(CG(class_table), class_table_tail->arKey, class_table_tail->nKeyLength, ce,1347 sizeof(zend_class_entry), NULL) == FAILURE && class_table_tail->arKey[0] != '\000') {1348 CG(in_compilation) = 1;1349 CG(compiled_filename) = file_handle->opened_path;1350 CG(zend_lineno) = 0;1351 #endif1352 1310 zend_error(E_ERROR, "Cannot redeclare class %s", class_table_tail->arKey); 1353 1311 } … … 1531 1489 return SUCCESS; 1532 1490 } 1533 1534 #ifndef ZEND_ENGINE_21535 #define OnUpdateLong OnUpdateInt1536 #endif1537 1491 1538 1492 PHP_INI_BEGIN() … … 1874 1828 } 1875 1829 1876 #ifdef ZEND_ENGINE_21877 1830 /* cache the properties_info destructor */ 1878 1831 properties_info_dtor = get_zend_destroy_property_info(TSRMLS_C); 1879 #endif1880 1832 return SUCCESS; 1881 1833 } … … 2024 1976 } 2025 1977 2026 #ifdef ZEND_ENGINE_22027 1978 ZEND_BEGIN_ARG_INFO(eaccelerator_second_arg_force_ref, 0) 2028 1979 ZEND_ARG_PASS_INFO(0) 2029 1980 ZEND_ARG_PASS_INFO(1) 2030 1981 ZEND_END_ARG_INFO(); 2031 #else2032 static unsigned char eaccelerator_second_arg_force_ref[] = {2, BYREF_NONE, BYREF_FORCE};2033 #endif2034 1982 2035 1983 function_entry eaccelerator_functions[] = { … … 2067 2015 PHP_FE(eaccelerator_dasm_file, NULL) 2068 2016 #endif 2069 #ifdef ZEND_ENGINE_22070 2017 {NULL, NULL, NULL, 0U, 0U} 2071 #else2072 {NULL, NULL, NULL}2073 #endif2074 2018 }; 2075 2019