Changeset 551


Ignore:
Timestamp:
2008-04-18T04:10:35+02:00 (6 years ago)
Author:
moo
Message:

fix build for PHP_4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r548 r551  
    2020#include "ext/standard/php_math.h" 
    2121#include "ext/standard/php_string.h" 
     22#ifdef ZEND_ENGINE_2_1 
    2223#include "ext/date/php_date.h" 
     24#endif 
    2325#include "zend_extensions.h" 
    2426#include "SAPI.h" 
     
    879881        xc_hash_value_t h; 
    880882        UNISW(size_t, int) basename_len; 
     883#ifdef ZEND_ENGINE_2 
    881884        php_basename(xce->name.str.val, xce->name.str.len, "", 0, &basename, &basename_len TSRMLS_CC); 
     885#else 
     886        basename = php_basename(xce->name.str.val, xce->name.str.len, "", 0); 
     887        basename_len = strlen(basename); 
     888#endif 
    882889        h = HASH_STR_L(basename, basename_len); 
    883890        efree(basename); 
     
    28312838    php_info_print_table_row(2, "Modules Built", XCACHE_MODULES); 
    28322839    php_info_print_table_row(2, "Readonly Protection", xc_readonly_protection ? "enabled" : "N/A"); 
     2840#ifdef ZEND_ENGINE_2_1 
    28332841    ptr = php_format_date("Y-m-d H:i:s", sizeof("Y-m-d H:i:s") - 1, xc_init_time, 1 TSRMLS_CC); 
    28342842    php_info_print_table_row(2, "Cache Init Time", ptr); 
    28352843    efree(ptr); 
     2844#else 
     2845    snprintf(buf, sizeof(buf), "%lu", (long unsigned) xc_init_time); 
     2846    php_info_print_table_row(2, "Cache Init Time", buf); 
     2847#endif 
    28362848 
    28372849#ifdef ZTS 
Note: See TracChangeset for help on using the changeset viewer.