Show
Ignore:
Timestamp:
06/19/08 18:01:31 (7 months ago)
Author:
bart
Message:

Remove support for all php versions older than php 5.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/eaccelerator.c

    r342 r344  
    102102int binary_zend_version[2]; 
    103103 
    104 #ifdef ZEND_ENGINE_2 
    105104/* pointer to the properties_info hashtable destructor */ 
    106105extern dtor_func_t properties_info_dtor; 
    107 #endif 
    108106 
    109107/* saved original functions */ 
     
    11661164// segv74: really cheap work around to auto_global problem. 
    11671165//         it makes just in time to every time. 
    1168 #ifdef ZEND_ENGINE_2 
    11691166  zend_is_auto_global("_GET", sizeof("_GET")-1 TSRMLS_CC); 
    11701167  zend_is_auto_global("_POST", sizeof("_POST")-1 TSRMLS_CC); 
     
    11741171  zend_is_auto_global("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC); 
    11751172  zend_is_auto_global("_FILES", sizeof("_FILES")-1 TSRMLS_CC); 
    1176 #endif 
    11771173 
    11781174  if (t != NULL) { // restore from cache 
     
    11841180 
    11851181    zend_llist_add_element(&CG(open_files), file_handle); 
    1186 #ifdef ZEND_ENGINE_2 
    11871182    if (file_handle->opened_path == NULL && file_handle->type != ZEND_HANDLE_STREAM) { 
    11881183      file_handle->handle.stream.handle = (void*)1; 
    11891184      file_handle->opened_path = EAG(mem);      /* EAG(mem) = p->realfilename from eaccelerator_restore here */ 
    11901185    } 
    1191 #else 
    1192     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 #endif 
    11991186 
    12001187    DBG(ea_debug_printf, (EA_TEST_PERFORMANCE, "\t[%d] compile_file: restored (%ld)\n", getpid(), ea_debug_elapsed_time(&tv_start))); 
     
    12371224 
    12381225    zend_hash_init_ex(&tmp_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0); 
    1239 #ifdef ZEND_ENGINE_2 
    12401226                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 #else 
    1242     zend_hash_copy(&tmp_class_table, &eaccelerator_global_class_table, NULL, &tmp_class, sizeof(zend_class_entry)); 
    1243 #endif 
    12441227 
    12451228    orig_class_table = CG(class_table);; 
    12461229    CG(class_table) = &tmp_class_table; 
    1247 #ifdef ZEND_ENGINE_2 
    12481230    orig_eg_class_table = EG(class_table);; 
    12491231    EG(class_table) = &tmp_class_table; 
    1250 #endif 
    12511232 
    12521233    /* Storing global pre-compiled functions and classes */ 
     
    12671248      CG(function_table) = orig_function_table; 
    12681249      CG(class_table) = orig_class_table; 
    1269 #ifdef ZEND_ENGINE_2 
    12701250      EG(class_table) = orig_eg_class_table; 
    1271 #endif 
    12721251      ea_bailout = 1; 
    12731252    } zend_end_try(); 
     
    13051284    CG(function_table) = orig_function_table; 
    13061285    CG(class_table) = orig_class_table; 
    1307 #ifdef ZEND_ENGINE_2 
    13081286    EG(class_table) = orig_eg_class_table; 
    13091287    DBG(ea_debug_printf, (EA_DEBUG, "\t[%d] restoring CG(class_table)[%08x] != EG(class_table)[%08x]\n",  
    13101288                getpid(), CG(class_table), EG(class_table))); 
    1311 #endif 
    13121289    while (function_table_tail != NULL) { 
    13131290      zend_op_array *op_array = (zend_op_array*)function_table_tail->pData; 
     
    13171294          CG(in_compilation) = 1; 
    13181295          CG(compiled_filename) = file_handle->opened_path; 
    1319 #ifdef ZEND_ENGINE_2 
    13201296          CG(zend_lineno) = op_array->line_start; 
    1321 #else 
    1322           CG(zend_lineno) = op_array->opcodes[0].lineno; 
    1323 #endif 
    13241297          zend_error(E_ERROR, "Cannot redeclare %s()", function_table_tail->arKey); 
    13251298        } 
     
    13281301    } 
    13291302    while (class_table_tail != NULL) { 
    1330 #ifdef ZEND_ENGINE_2 
    13311303      zend_class_entry **ce = (zend_class_entry**)class_table_tail->pData; 
    13321304      if ((*ce)->type == ZEND_USER_CLASS) { 
     
    13361308          CG(compiled_filename) = file_handle->opened_path; 
    13371309          CG(zend_lineno) = (*ce)->line_start; 
    1338 #else 
    1339       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 #endif 
    13521310          zend_error(E_ERROR, "Cannot redeclare class %s", class_table_tail->arKey); 
    13531311        } 
     
    15311489  return SUCCESS; 
    15321490} 
    1533  
    1534 #ifndef ZEND_ENGINE_2 
    1535 #define OnUpdateLong OnUpdateInt 
    1536 #endif 
    15371491 
    15381492PHP_INI_BEGIN() 
     
    18741828  } 
    18751829   
    1876 #ifdef ZEND_ENGINE_2 
    18771830  /* cache the properties_info destructor */ 
    18781831  properties_info_dtor = get_zend_destroy_property_info(TSRMLS_C); 
    1879 #endif 
    18801832  return SUCCESS; 
    18811833} 
     
    20241976} 
    20251977 
    2026 #ifdef ZEND_ENGINE_2 
    20271978ZEND_BEGIN_ARG_INFO(eaccelerator_second_arg_force_ref, 0) 
    20281979  ZEND_ARG_PASS_INFO(0) 
    20291980  ZEND_ARG_PASS_INFO(1) 
    20301981ZEND_END_ARG_INFO(); 
    2031 #else 
    2032 static unsigned char eaccelerator_second_arg_force_ref[] = {2, BYREF_NONE, BYREF_FORCE}; 
    2033 #endif 
    20341982 
    20351983function_entry eaccelerator_functions[] = { 
     
    20672015  PHP_FE(eaccelerator_dasm_file, NULL) 
    20682016#endif 
    2069 #ifdef ZEND_ENGINE_2 
    20702017  {NULL, NULL, NULL, 0U, 0U} 
    2071 #else 
    2072   {NULL, NULL, NULL} 
    2073 #endif 
    20742018}; 
    20752019