cvs: pecl /apc apc_cache.c apc_globals.h php_apc.c
| From: | Brian Shire | Date: | Sun, 10 Dec 2006 07:36:27 +0000 |
| Subject: | cvs: pecl /apc apc_cache.c apc_globals.h php_apc.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-6783@lists.php.net to get a copy of this message | ||
shire Sun Dec 10 07:36:27 2006 UTC
Modified files:
/pecl/apc apc_cache.c apc_globals.h php_apc.c
Log:
fix for Bug #8663
Added apc.stat_ctime flag so that the ctime value can optionally also be checked (off by default)
http://cvs.php.net/viewvc.cgi/pecl/apc/apc_cache.c?r1=3.126&r2=3.127&diff_format=u
Index: pecl/apc/apc_cache.c
diff -u pecl/apc/apc_cache.c:3.126 pecl/apc/apc_cache.c:3.127
--- pecl/apc/apc_cache.c:3.126 Mon Oct 23 12:50:54 2006
+++ pecl/apc/apc_cache.c Sun Dec 10 07:36:27 2006
@@ -28,7 +28,7 @@
*/
-/* $Id: apc_cache.c,v 3.126 2006/10/23 12:50:54 gopalv Exp $ */
+/* $Id: apc_cache.c,v 3.127 2006/12/10 07:36:27 shire Exp $ */
#include "apc_cache.h"
#include "apc_lock.h"
@@ -752,11 +752,13 @@
* I generally disagree with using the ctime here because you lose the
* ability to warm up new content by saving it to a temporary file, hitting
* it once to cache it and then renaming it into its permanent location so
- * I am leaving this commented out by default. If you need this, uncomment
- * it.
+ * set the apc.stat_ctime=true to enable this check.
*/
- /* key->mtime = (buf.st_ctime > buf.st_mtime) ? buf.st_ctime : buf.st_mtime; */
- key->mtime = buf.st_mtime;
+ if(APCG(stat_ctime)) {
+ key->mtime = (buf.st_ctime > buf.st_mtime) ? buf.st_ctime : buf.st_mtime;
+ } else {
+ key->mtime = buf.st_mtime;
+ }
key->type = APC_CACHE_KEY_FILE;
return 1;
}
http://cvs.php.net/viewvc.cgi/pecl/apc/apc_globals.h?r1=3.53&r2=3.54&diff_format=u
Index: pecl/apc/apc_globals.h
diff -u pecl/apc/apc_globals.h:3.53 pecl/apc/apc_globals.h:3.54
--- pecl/apc/apc_globals.h:3.53 Thu Dec 7 21:55:40 2006
+++ pecl/apc/apc_globals.h Sun Dec 10 07:36:27 2006
@@ -29,7 +29,7 @@
*/
-/* $Id: apc_globals.h,v 3.53 2006/12/07 21:55:40 gopalv Exp $ */
+/* $Id: apc_globals.h,v 3.54 2006/12/10 07:36:27 shire Exp $ */
#ifndef APC_GLOBALS_H
#define APC_GLOBALS_H
@@ -67,6 +67,7 @@
long max_file_size; /* Maximum size of file, in bytes that APC will be allowed to
cache */
long slam_rand; /* A place to store the slam rand value for the request */
zend_bool fpstat; /* true if fullpath includes should be stat'ed */
+ zend_bool stat_ctime; /* true if ctime in addition to mtime should be checked */
zend_bool write_lock; /* true for a global write lock */
zend_bool report_autofilter; /* true for auto-filter warnings */
zend_bool include_once; /* Override the ZEND_INCLUDE_OR_EVAL opcode handler to avoid
pointless fopen()s [still experimental] */
http://cvs.php.net/viewvc.cgi/pecl/apc/php_apc.c?r1=3.122&r2=3.123&diff_format=u
Index: pecl/apc/php_apc.c
diff -u pecl/apc/php_apc.c:3.122 pecl/apc/php_apc.c:3.123
--- pecl/apc/php_apc.c:3.122 Sun Dec 10 02:34:28 2006
+++ pecl/apc/php_apc.c Sun Dec 10 07:36:27 2006
@@ -26,7 +26,7 @@
*/
-/* $Id: php_apc.c,v 3.122 2006/12/10 02:34:28 shire Exp $ */
+/* $Id: php_apc.c,v 3.123 2006/12/10 07:36:27 shire Exp $ */
#include "apc_zend.h"
#include "apc_cache.h"
@@ -76,6 +76,7 @@
apc_globals->slam_defense = 0;
apc_globals->mem_size_ptr = NULL;
apc_globals->fpstat = 1;
+ apc_globals->stat_ctime = 0;
apc_globals->write_lock = 1;
apc_globals->report_autofilter = 0;
#ifdef MULTIPART_EVENT_FORMDATA
@@ -141,6 +142,7 @@
STD_PHP_INI_BOOLEAN("apc.enable_cli", "0", PHP_INI_SYSTEM, OnUpdateBool,
enable_cli, zend_apc_globals, apc_globals)
STD_PHP_INI_ENTRY("apc.max_file_size", "1M", PHP_INI_SYSTEM, OnUpdateInt,
max_file_size, zend_apc_globals, apc_globals)
STD_PHP_INI_BOOLEAN("apc.stat", "1", PHP_INI_SYSTEM, OnUpdateBool,
fpstat, zend_apc_globals, apc_globals)
+STD_PHP_INI_BOOLEAN("apc.stat_ctime", "0", PHP_INI_SYSTEM, OnUpdateBool,
stat_ctime, zend_apc_globals, apc_globals)
STD_PHP_INI_BOOLEAN("apc.write_lock", "1", PHP_INI_SYSTEM, OnUpdateBool,
write_lock, zend_apc_globals, apc_globals)
STD_PHP_INI_BOOLEAN("apc.report_autofilter", "0", PHP_INI_SYSTEM, OnUpdateBool,
report_autofilter,zend_apc_globals, apc_globals)
#ifdef MULTIPART_EVENT_FORMDATA
@@ -169,7 +171,7 @@
#else
php_info_print_table_row(2, "Locking type", "File Locks");
#endif
- php_info_print_table_row(2, "Revision", "$Revision: 3.122 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 3.123 $");
php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
php_info_print_table_end();
DISPLAY_INI_ENTRIES();