Changeset 540
- Timestamp:
- 03/02/2008 08:52:34 AM (5 years ago)
- Files:
-
- 1 modified
-
trunk/xcache.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xcache.c
r537 r540 19 19 #include "ext/standard/md5.h" 20 20 #include "ext/standard/php_math.h" 21 #include "ext/standard/php_string.h" 21 22 #include "zend_extensions.h" 22 23 #include "SAPI.h" … … 857 858 } 858 859 /* }}} */ 860 static inline xc_hash_value_t xc_entry_hash_php_basename(xc_entry_t *xce TSRMLS_DC) /* {{{ */ 861 { 862 #ifdef IS_UNICODE 863 if (UG(unicode) && xce->name_type == IS_UNICODE) { 864 UChar *basename; 865 int basename_len; 866 php_u_basename(xce->name.uni.val, xce->name.uni.len, NULL_ZSTR, 0, &basename, &basename_len TSRMLS_CC); 867 return HASH_USTR_L(IS_UNICODE, basename, basename_len); 868 } 869 else 870 #endif 871 { 872 char *basename; 873 UNISW(size_t, int) basename_len; 874 php_basename(xce->name.str.val, xce->name.str.len, "", 0, &basename, &basename_len TSRMLS_CC); 875 return HASH_STR_L(basename, basename_len); 876 } 877 } 878 /* }}} */ 859 879 static int xc_entry_init_key_php(xc_entry_t *xce, char *filename, char *opened_path_buffer TSRMLS_DC) /* {{{ */ 860 880 { … … 955 975 xce->name.str.len = strlen(filename); 956 976 977 if (xc_php_hcache.size > 1) { 978 hv = xc_entry_hash_php_basename(xce TSRMLS_CC); 979 cacheid = xc_hash_fold(hv, &xc_php_hcache); 980 } 981 else { 982 cacheid = 0; 983 } 984 xce->cache = xc_php_caches[cacheid]; 985 957 986 hv = xc_entry_hash_php(xce TSRMLS_CC); 958 cacheid = xc_hash_fold(hv, &xc_php_hcache);959 xce->cache = xc_php_caches[cacheid];960 987 xce->hvalue = xc_hash_fold(hv, &xc_php_hentry); 961 988

