cvs: pecl /apc apc_cache.c
| From: | Rasmus Lerdorf | Date: | Tue, 14 Sep 2004 17:34:28 +0000 |
| Subject: | cvs: pecl /apc apc_cache.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-1832@lists.php.net to get a copy of this message | ||
rasmus Tue Sep 14 13:34:28 2004 EDT
Modified files:
/pecl/apc apc_cache.c
Log:
Revert ctime change for the reason listed in the comment in the code.
http://cvs.php.net/diff.php/pecl/apc/apc_cache.c?r1=3.70&r2=3.71&ty=u
Index: pecl/apc/apc_cache.c
diff -u pecl/apc/apc_cache.c:3.70 pecl/apc/apc_cache.c:3.71
--- pecl/apc/apc_cache.c:3.70 Tue Sep 14 00:35:27 2004
+++ pecl/apc/apc_cache.c Tue Sep 14 13:34:28 2004
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apc_cache.c,v 3.70 2004/09/14 04:35:27 rasmus Exp $ */
+/* $Id: apc_cache.c,v 3.71 2004/09/14 17:34:28 rasmus Exp $ */
#include "apc_cache.h"
#include "apc_lock.h"
@@ -526,7 +526,19 @@
key->data.file.device = buf.st_dev;
key->data.file.inode = buf.st_ino;
- key->mtime = (buf.st_ctime > buf.st_mtime) ? buf.st_ctime : buf.st_mtime;
+
+ /*
+ * If working with content management systems that like to munge the mtime,
+ * it might be appropriate to key off of the ctime to be immune to systems
+ * that try to backdate a template. If the mtime is set to something older
+ * than the previous mtime of a template we will obviously never see this
+ * "older" template. At some point the Smarty templating system did this.
+ * 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.
+ */
+ /* key->mtime = (buf.st_ctime > buf.st_mtime) ? buf.st_ctime : buf.st_mtime; */
+ key->mtime = buf.st_mtime;
return 1;
}
/* }}} */