Changeset 134
- Timestamp:
- 11/20/05 18:53:43 (3 years ago)
- Files:
-
- eaccelerator/trunk/ChangeLog (modified) (1 diff)
- eaccelerator/trunk/Makefile.in (modified) (1 diff)
- eaccelerator/trunk/config.m4 (modified) (2 diffs)
- eaccelerator/trunk/eaccelerator.c (modified) (7 diffs)
- eaccelerator/trunk/eaccelerator.ini (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/ChangeLog
r133 r134 1 2005-11-20 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 3 * Removed executor hooks, they weren't used anyway. 4 * Check if eA has a valid cache directory. 5 * Make the init of php fail if the initialisation of the shared memory 6 or cache directory failes. 7 * set shared memory size in eaccelerator.ini to 0 so the default OS 8 size is used. 9 1 10 2005-11-17 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 11 eaccelerator/trunk/Makefile.in
r116 r134 1 1 LTLIBRARY_NAME = libeaccelerator.la 2 LTLIBRARY_SOURCES = eaccelerator.c optimize.c e xecute.c encoder.c loader.c opcodes.c content.c mm.c webui.c session.c shm.c debug.c cache.c ea_restore.c ea_store.c2 LTLIBRARY_SOURCES = eaccelerator.c optimize.c encoder.c loader.c opcodes.c content.c mm.c webui.c session.c shm.c debug.c cache.c ea_restore.c ea_store.c 3 3 LTLIBRARY_SHARED_NAME = eaccelerator.la 4 4 eaccelerator/trunk/config.m4
r113 r134 79 79 ]) 80 80 81 AC_ARG_WITH(eaccelerator-executor,82 [ --with-eaccelerator-executor Include optimized executor (not implemented yet)],[83 eaccelerator_executor=$withval84 ],[85 eaccelerator_executor=no86 ])87 88 81 AC_ARG_WITH(eaccelerator-use-inode, 89 82 [ --without-eaccelerator-use-inode Don't use inodes to determine hash keys (never used on win32)],[ … … 131 124 if test "$eaccelerator_disassembler" = "yes"; then 132 125 AC_DEFINE(WITH_EACCELERATOR_DISASSEMBLER, 1, [Define if you like to explore Zend bytecode]) 133 fi134 if test "$eaccelerator_executor" = "yes"; then135 AC_DEFINE(WITH_EACCELERATOR_EXECUTOR, 1, [Define if you like use optimized executor (not implemented yet)])136 126 fi 137 127 if test "$eaccelerator_inode" = "yes"; then eaccelerator/trunk/eaccelerator.c
r132 r134 111 111 static zend_op_array *(*mm_saved_zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); 112 112 113 #if defined(DEBUG) || defined(WITH_EACCELERATOR_EXECUTOR)114 static void (*mm_saved_zend_execute)(zend_op_array *op_array TSRMLS_DC);115 #endif116 117 113 /* external declarations */ 118 114 PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC); … … 253 249 } 254 250 251 /* check the cache dir */ 252 static int check_cache_dir(char *cache_dir) { 253 struct stat buf; 254 int uid = 0; 255 int gid = 0; 256 257 if (stat(cache_dir, &buf) == -1) { 258 ea_debug_error("Cache dir does not exist (could not stat %s)\n", cache_dir); 259 return 0; 260 } 261 if (!(buf.st_mode & S_IFDIR)) { 262 ea_debug_error("%s is not a directory!\n", cache_dir); 263 return 0; 264 } 265 #if 0 266 uid = getuid(); 267 gid = getgid(); 268 if (!((buf.st_uid == uid && (buf.st_mode & (S_IRUSR | S_IWUSR))) /* not root, owner and rw */ 269 || (buf.st_gid == gid && (buf.st_mode & (S_IRGRP | S_IWGRP))) /* not root, group and rw */ 270 || (buf.st_mode & (S_IROTH & S_IWOTH)))) { /* other and rw */ 271 ea_debug_error("%s hasn't got the right permissions!\n", cache_dir); 272 return 0; 273 } 274 #endif 275 return 1; 276 } 277 255 278 /* Initialise the shared memory */ 256 279 static int init_mm(TSRMLS_D) { … … 304 327 eaccelerator_mm_instance->last_prune = time(0); 305 328 EACCELERATOR_PROTECT(); 329 330 if (!check_cache_dir(EAG(cache_dir))) { 331 return FAILURE; 332 } 333 306 334 return SUCCESS; 307 335 } … … 1542 1570 EAG(self_time)[EAG(profile_level)] = 0; 1543 1571 EAG(profile_level)++; 1544 #ifdef WITH_EACCELERATOR_EXECUTOR1545 eaccelerator_execute(op_array TSRMLS_CC);1546 #else1547 1572 mm_saved_zend_execute(op_array TSRMLS_CC); 1548 #endif1549 1573 usec = ea_debug_elapsed_time(&tv_start); 1550 1574 EAG(profile_level)--; … … 2000 2024 if (init_mm(TSRMLS_C) == FAILURE) { 2001 2025 zend_error(E_CORE_WARNING,"[%s] Can not create shared memory area", EACCELERATOR_EXTENSION_NAME); 2026 return FAILURE; 2002 2027 } 2003 2028 … … 2010 2035 #else 2011 2036 zend_compile_file = eaccelerator_compile_file; 2012 #ifdef WITH_EACCELERATOR_EXECUTOR2013 mm_saved_zend_execute = zend_execute;2014 zend_execute = eaccelerator_execute;2015 #endif2016 2037 #endif 2017 2038 } … … 2039 2060 } 2040 2061 zend_compile_file = mm_saved_zend_compile_file; 2041 #if defined(DEBUG) || defined(WITH_EACCELERATOR_EXECUTOR)2042 zend_execute = mm_saved_zend_execute;2043 #endif2044 2062 #ifdef WITH_EACCELERATOR_CONTENT_CACHING 2045 2063 eaccelerator_content_cache_shutdown(); eaccelerator/trunk/eaccelerator.ini
r113 r134 22 22 ; The amount of shared memory (in megabytes) that eAccelerator will use. 23 23 ; "0" means OS default. Default value is "0". 24 eaccelerator.shm_size = " 64"24 eaccelerator.shm_size = "0" 25 25 26 26 ; The directory that is used for disk cache. eAccelerator stores precompiled