- Timestamp:
- 2006-09-13T14:20:49+02:00 (7 years ago)
- File:
-
- 1 edited
-
trunk/xcache.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xcache.c
r163 r164 2050 2050 /* {{{ PHP_INI */ 2051 2051 2052 static PHP_INI_MH(xc_OnUpdateDummy) 2053 { 2054 return SUCCESS; 2055 } 2056 2057 static PHP_INI_MH(xc_OnUpdateULong) 2058 { 2059 zend_ulong *p = (zend_ulong *) mh_arg1; 2060 2061 *p = (zend_ulong) atoi(new_value); 2062 return SUCCESS; 2063 } 2064 2052 2065 static PHP_INI_MH(xc_OnUpdateBool) 2053 2066 { … … 2088 2101 PHP_INI_ENTRY1 ("xcache.test", "0", PHP_INI_SYSTEM, xc_OnUpdateBool, &xc_test) 2089 2102 PHP_INI_ENTRY1 ("xcache.readonly_protection", "0", PHP_INI_SYSTEM, xc_OnUpdateBool, &xc_readonly_protection) 2103 /* opcode cache */ 2104 PHP_INI_ENTRY1 ("xcache.size", "0", PHP_INI_SYSTEM, xc_OnUpdateDummy, NULL) 2105 PHP_INI_ENTRY1 ("xcache.count", "1", PHP_INI_SYSTEM, xc_OnUpdateDummy, NULL) 2106 PHP_INI_ENTRY1 ("xcache.slots", "8K", PHP_INI_SYSTEM, xc_OnUpdateDummy, NULL) 2107 PHP_INI_ENTRY1 ("xcache.shm_scheme", "mmap", PHP_INI_SYSTEM, xc_OnUpdateString, &xc_shm_scheme) 2108 PHP_INI_ENTRY1 ("xcache.ttl", "0", PHP_INI_SYSTEM, xc_OnUpdateULong, &xc_php_ttl) 2109 PHP_INI_ENTRY1 ("xcache.gc_interval", "0", PHP_INI_SYSTEM, xc_OnUpdateULong, &xc_php_gc_interval) 2110 /* var cache */ 2111 PHP_INI_ENTRY1 ("xcache.var_size", "0", PHP_INI_SYSTEM, xc_OnUpdateDummy, NULL) 2112 PHP_INI_ENTRY1 ("xcache.var_count", "1", PHP_INI_SYSTEM, xc_OnUpdateDummy, NULL) 2113 PHP_INI_ENTRY1 ("xcache.var_slots", "8K", PHP_INI_SYSTEM, xc_OnUpdateDummy, NULL) 2114 PHP_INI_ENTRY1 ("xcache.var_maxttl", "0", PHP_INI_SYSTEM, xc_OnUpdateULong, &xc_var_maxttl) 2115 PHP_INI_ENTRY1 ("xcache.var_gc_interval", "120", PHP_INI_SYSTEM, xc_OnUpdateULong, &xc_var_gc_interval) 2090 2116 2091 2117 STD_PHP_INI_BOOLEAN("xcache.cacher", "1", PHP_INI_ALL, OnUpdateBool, cacher, zend_xcache_globals, xcache_globals) … … 2093 2119 STD_PHP_INI_BOOLEAN("xcache.optimizer", "0", PHP_INI_ALL, OnUpdateBool, optimizer, zend_xcache_globals, xcache_globals) 2094 2120 #endif 2095 STD_PHP_INI_BOOLEAN("xcache.var_ttl", "0", PHP_INI_ALL, OnUpdateLong, var_ttl, zend_xcache_globals, xcache_globals)2121 STD_PHP_INI_BOOLEAN("xcache.var_ttl", "0", PHP_INI_ALL, OnUpdateLong, var_ttl, zend_xcache_globals, xcache_globals) 2096 2122 #ifdef HAVE_XCACHE_COVERAGER 2097 2123 PHP_INI_ENTRY1 ("xcache.coveragedump_directory", "/tmp/pcov/", PHP_INI_SYSTEM, xc_OnUpdateString, &xc_coveragedump_dir) … … 2100 2126 PHP_INI_END() 2101 2127 /* }}} */ 2102 static int xc_config_string_disp(char *name, char *default_value) /* {{{ */2103 {2104 char *value;2105 char buf[100];2106 2107 if (cfg_get_string(name, &value) != SUCCESS) {2108 sprintf(buf, "%s (default)", default_value);2109 php_info_print_table_row(2, name, buf);2110 }2111 else {2112 php_info_print_table_row(2, name, value);2113 }2114 2115 return SUCCESS;2116 }2117 /* }}} */2118 #define xc_config_hash_disp xc_config_string_disp2119 #define xc_config_long_disp xc_config_string_disp2120 2128 /* {{{ PHP_MINFO_FUNCTION(xcache) */ 2121 2129 static PHP_MINFO_FUNCTION(xcache) … … 2166 2174 php_info_print_table_end(); 2167 2175 2168 php_info_print_table_start();2169 php_info_print_table_header(2, "Directive ", "Value");2170 xc_config_string_disp("xcache.shm_scheme", "mmap");2171 xc_config_long_disp("xcache.size", "0");2172 xc_config_hash_disp("xcache.count", "1");2173 xc_config_hash_disp("xcache.slots", "8K");2174 xc_config_hash_disp("xcache.ttl", "0");2175 xc_config_hash_disp("xcache.gc_interval", "0");2176 2177 xc_config_long_disp("xcache.var_size", "0");2178 xc_config_hash_disp("xcache.var_count", "1");2179 xc_config_hash_disp("xcache.var_slots", "8K");2180 xc_config_hash_disp("xcache.var_maxttl", "0");2181 xc_config_hash_disp("xcache.var_gc_interval", "300");2182 php_info_print_table_end();2183 2184 2176 DISPLAY_INI_ENTRIES(); 2185 2177 } … … 2250 2242 } 2251 2243 /* }}} */ 2252 static int xc_config_string(char **p, char *name, char *default_value) /* {{{ */2253 {2254 char *value;2255 2256 if (cfg_get_string(name, &value) != SUCCESS) {2257 value = default_value;2258 }2259 2260 *p = strdup(value);2261 return SUCCESS;2262 }2263 /* }}} */2264 2244 /* {{{ PHP_MINIT_FUNCTION(xcache) */ 2265 2245 static PHP_MINIT_FUNCTION(xcache) … … 2290 2270 } 2291 2271 2292 xc_config_string(&xc_shm_scheme, "xcache.shm_scheme", "mmap");2293 2272 xc_config_long(&xc_php_size, "xcache.size", "0"); 2294 2273 xc_config_hash(&xc_php_hcache, "xcache.count", "1"); 2295 2274 xc_config_hash(&xc_php_hentry, "xcache.slots", "8K"); 2296 xc_config_long(&xc_php_ttl, "xcache.ttl", "0"); 2297 xc_config_long(&xc_php_gc_interval, "xcache.gc_interval", "0"); 2298 2299 xc_config_long(&xc_var_size, "xcache.var_size", "0"); 2300 xc_config_hash(&xc_var_hcache, "xcache.var_count", "1"); 2301 xc_config_hash(&xc_var_hentry, "xcache.var_slots", "8K"); 2302 xc_config_long(&xc_var_maxttl, "xcache.var_maxttl", "0"); 2303 xc_config_long(&xc_var_gc_interval, "xcache.var_gc_interval", "120"); 2275 2276 xc_config_long(&xc_var_size, "xcache.var_size", "0"); 2277 xc_config_hash(&xc_var_hcache, "xcache.var_count", "1"); 2278 xc_config_hash(&xc_var_hentry, "xcache.var_slots", "8K"); 2304 2279 2305 2280 if (xc_php_size <= 0) {
Note: See TracChangeset
for help on using the changeset viewer.

