-Index: php-5.2.4/ext/apc/apc.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc.c php-5.2.5/ext/apc/apc.c
+--- php-5.2.5-orig/ext/apc/apc.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,554 @@
+/*
+ +----------------------------------------------------------------------+
+
+ */
+
-+/* $Id: apc.c,v 3.17 2007/03/17 14:01:41 gopalv Exp $ */
++/* $Id: apc.c,v 3.18 2007/11/29 22:15:53 shire Exp $ */
+
+#include "apc.h"
+#include <regex.h> /* for POSIX regular expressions */
+
+void apc_dprint(const char* fmt, ...)
+{
-+#ifdef APC_DBG
++#ifdef APC_DEBUG
+ va_list args;
+ va_start(args, fmt);
+ my_log(APC_DBG, fmt, args);
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_cache.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_cache.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,1328 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_cache.c php-5.2.5/ext/apc/apc_cache.c
+--- php-5.2.5-orig/ext/apc/apc_cache.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_cache.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,1343 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_cache.c,v 3.140 2007/04/02 22:57:10 rasmus Exp $ */
++/* $Id: apc_cache.c,v 3.145 2007/10/05 23:06:56 gopalv Exp $ */
+
+#include "apc_cache.h"
+#include "apc_lock.h"
+struct local_slot_t {
+ slot_t *original; /* the original slot in shm */
+ int num_hits; /* number of hits */
++ time_t creation_time; /* creation time */
+ apc_cache_entry_t *value; /* shallow copy of slot->value */
+ local_slot_t *next; /* only for dead list */
+};
+ cache_size = sizeof(header_t) + num_slots*sizeof(slot_t*);
+
+ cache->shmaddr = apc_sma_malloc(cache_size);
++ if(!cache->shmaddr) {
++ apc_eprint("Unable to allocate shared memory for cache structures. (Perhaps your shared memory size isn't large enough?). ");
++ }
+ memset(cache->shmaddr, 0, cache_size);
+
+ cache->header = (header_t*) cache->shmaddr;
+ time_t t
+ TSRMLS_DC)
+{
-+ static char canon_path[MAXPATHLEN];
+ struct stat *tmp_buf=NULL;
+ struct apc_fileinfo_t fileinfo = { {0}, };
+ int len;
-+
++
+ assert(key != NULL);
+
+ if (!filename || !SG(request_info).path_translated) {
+ key->mtime = t;
+ key->type = APC_CACHE_KEY_FPFILE;
+ } else {
-+ if(!realpath(filename, canon_path)) {
-+ fprintf(stderr, "realpath failed to canonicalize %s - bailing\n", filename);
++ if (apc_search_paths(filename, include_path, &fileinfo) != 0) {
++ apc_wprint("apc failed to locate %s - bailing", filename);
++ return 0;
++ }
++
++ if(!realpath(fileinfo.fullpath, APCG(canon_path))) {
++ apc_wprint("realpath failed to canonicalize %s - bailing", filename);
+ return 0;
+ }
-+ key->data.fpfile.fullpath = canon_path;
-+ key->data.fpfile.fullpath_len = strlen(canon_path);
++
++ key->data.fpfile.fullpath = APCG(canon_path);
++ key->data.fpfile.fullpath_len = strlen(APCG(canon_path));
+ key->mtime = t;
+ key->type = APC_CACHE_KEY_FPFILE;
+ }
+ entry->type = APC_CACHE_ENTRY_FILE;
+ entry->ref_count = 0;
+ entry->mem_size = 0;
-+ entry->autofiltered = 0;
+ entry->local = 0;
+ return entry;
+}
+ entry->type = APC_CACHE_ENTRY_USER;
+ entry->ref_count = 0;
+ entry->mem_size = 0;
-+ entry->autofiltered = 0;
+ entry->local = 0;
+ return entry;
+}
+#endif
+
+/* {{{ make_local_slot */
-+static local_slot_t* make_local_slot(apc_local_cache_t* cache, local_slot_t* lslot, slot_t* slot)
++static local_slot_t* make_local_slot(apc_local_cache_t* cache, local_slot_t* lslot, slot_t* slot, time_t t)
+{
+ apc_cache_entry_t* value;
+
+
+ lslot->original = slot;
+ lslot->value = value;
-+ lslot->num_hits++;
++ lslot->num_hits = 0;
++ lslot->creation_time = t;
+
+ return lslot; /* for what joy ? ... consistency */
+}
+
+ int i;
+ for(i = 0; i < cache->num_slots; i++) {
-+ slot_t * slot = cache->slots[i].original;
-+ if((slot && slot->access_time < (t - cache->ttl)) ||
++ lslot = &cache->slots[i];
++ /* every slot lives for exactly TTL seconds */
++ if((lslot->original && lslot->creation_time < (t - cache->ttl)) ||
+ cache->generation != cache->shmcache->header->expunges) {
-+ free_local_slot(cache, &cache->slots[i]);
++ free_local_slot(cache, lslot);
+ }
+ }
+
+ free_local_slot(cache, lslot);
+ goto not_found;
+ }
++ cache->num_hits++;
++ lslot->num_hits++;
++ lslot->original->access_time = t; /* unlocked write, but last write wins */
+ return lslot->value;
+ } else if(key.type == APC_CACHE_KEY_FPFILE) {
+ if(!memcmp(slot->key.data.fpfile.fullpath, key.data.fpfile.fullpath, key.data.fpfile.fullpath_len+1)) {
++ cache->num_hits++;
++ lslot->num_hits++;
++ lslot->original->access_time = t; /* unlocked write, but last write wins */
+ return lslot->value;
+ }
+ }
+ /* i.e maintain a sort of top list */
+ if(lslot->original == NULL || (lslot->original->num_hits + lslot->num_hits) < slot->num_hits) {
+ free_local_slot(cache, lslot);
-+ make_local_slot(cache, lslot, slot);
++ make_local_slot(cache, lslot, slot, t);
+ return lslot->value;
+ }
+ return slot->value;
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_cache.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_cache.h 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,313 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_cache.h php-5.2.5/ext/apc/apc_cache.h
+--- php-5.2.5-orig/ext/apc/apc_cache.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_cache.h 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,312 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_cache.h,v 3.45 2007/03/22 16:03:59 gopalv Exp $ */
++/* $Id: apc_cache.h,v 3.46 2007/10/05 23:06:56 gopalv Exp $ */
+
+#ifndef APC_CACHE_H
+#define APC_CACHE_H
+struct apc_cache_entry_t {
+ apc_cache_entry_value_t data;
+ unsigned char type;
-+ unsigned char autofiltered;
+ unsigned char local;
+ int ref_count;
+ size_t mem_size;
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_compile.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_compile.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,2530 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_compile.c php-5.2.5/ext/apc/apc_compile.c
+--- php-5.2.5-orig/ext/apc/apc_compile.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_compile.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,2529 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_compile.c,v 3.85 2007/03/28 07:35:55 gopalv Exp $ */
++/* $Id: apc_compile.c,v 3.87 2007/08/25 13:09:13 gopalv Exp $ */
+
+#include "apc_compile.h"
+#include "apc_globals.h"
+ if((zo->opcode == ZEND_INCLUDE_OR_EVAL) &&
+ (zo->op1.op_type == IS_CONST && zo->op1.u.constant.type == IS_STRING)) {
+ /* constant includes */
-+ if(!IS_ABSOLUTE_PATH(Z_STRVAL_P(&zo->op1.u.constant),len)) {
++ if(!IS_ABSOLUTE_PATH(Z_STRVAL_P(&zo->op1.u.constant),Z_STRLEN_P(&zo->op1.u.constant))) {
+ if (apc_search_paths(Z_STRVAL_P(&zo->op1.u.constant), PG(include_path), &fileinfo) == 0) {
-+ if((IS_ABSOLUTE_PATH(fileinfo.fullpath, strlen(fileinfo.fullpath)) && (fullpath = fileinfo.fullpath))
-+ || (fullpath = realpath(fileinfo.fullpath, canon_path))) {
-+ /* is either an absolute path or it goes through a realpath() */
++ if((fullpath = realpath(fileinfo.fullpath, canon_path))) {
++ /* everything has to go through a realpath() */
+ zend_op *dzo = &(dst->opcodes[i]);
+ deallocate(dzo->op1.u.constant.value.str.val);
+ dzo->op1.u.constant.value.str.len = strlen(fullpath);
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_compile.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_compile.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_compile.h php-5.2.5/ext/apc/apc_compile.h
+--- php-5.2.5-orig/ext/apc/apc_compile.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_compile.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,134 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_debug.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_debug.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_debug.c php-5.2.5/ext/apc/apc_debug.c
+--- php-5.2.5-orig/ext/apc/apc_debug.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_debug.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,57 @@
+/*
+ +----------------------------------------------------------------------+
+ }
+#endif
+}
-Index: php-5.2.4/ext/apc/apc_debug.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_debug.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_debug.h php-5.2.5/ext/apc/apc_debug.h
+--- php-5.2.5-orig/ext/apc/apc_debug.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_debug.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1 @@
+void dump(zend_op_array * TSRMLS_DC);
-Index: php-5.2.4/ext/apc/apc.dsp
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc.dsp 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc.dsp php-5.2.5/ext/apc/apc.dsp
+--- php-5.2.5-orig/ext/apc/apc.dsp 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc.dsp 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,207 @@
+# Microsoft Developer Studio Project File - Name="apc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# End Group
+# End Target
+# End Project
-Index: php-5.2.4/ext/apc/apc_fcntl.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_fcntl.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_fcntl.c php-5.2.5/ext/apc/apc_fcntl.c
+--- php-5.2.5-orig/ext/apc/apc_fcntl.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_fcntl.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,118 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_fcntl.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_fcntl.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_fcntl.h php-5.2.5/ext/apc/apc_fcntl.h
+--- php-5.2.5-orig/ext/apc/apc_fcntl.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_fcntl.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,50 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_fcntl_win32.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_fcntl_win32.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_fcntl_win32.c php-5.2.5/ext/apc/apc_fcntl_win32.c
+--- php-5.2.5-orig/ext/apc/apc_fcntl_win32.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_fcntl_win32.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,117 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_futex.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_futex.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_futex.c php-5.2.5/ext/apc/apc_futex.c
+--- php-5.2.5-orig/ext/apc/apc_futex.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_futex.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,116 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_futex.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_futex.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_futex.h php-5.2.5/ext/apc/apc_futex.h
+--- php-5.2.5-orig/ext/apc/apc_futex.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_futex.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,55 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_globals.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_globals.h 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,110 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_globals.h php-5.2.5/ext/apc/apc_globals.h
+--- php-5.2.5-orig/ext/apc/apc_globals.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_globals.h 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,119 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_globals.h,v 3.59 2007/03/21 21:07:28 rasmus Exp $ */
++/* $Id: apc_globals.h,v 3.70 2007/12/26 22:46:33 rasmus Exp $ */
+
+#ifndef APC_GLOBALS_H
+#define APC_GLOBALS_H
+
-+#define APC_VERSION "3.0.14"
++#define APC_VERSION "3.0.16"
+
+#include "apc_cache.h"
+#include "apc_stack.h"
+ apc_optimize_function_t apc_optimize_function; /* optimizer function callback */
+#ifdef MULTIPART_EVENT_FORMDATA
+ zend_bool rfc1867; /* Flag to enable rfc1867 handler */
++ char* rfc1867_prefix; /* Key prefix */
++ char* rfc1867_name; /* Name of hidden field to activate upload progress/key suffix */
++ double rfc1867_freq; /* Update frequency as percentage or bytes */
+#endif
+ HashTable *copied_zvals; /* my_copy recursion detection list */
+#ifdef ZEND_ENGINE_2
+ zend_bool localcache; /* enable local cache */
+ long localcache_size; /* size of fast cache */
+ apc_local_cache_t* lcache; /* unlocked local cache */
++ zend_bool force_file_update; /* force files to be updated during apc_compile_file */
++ char canon_path[MAXPATHLEN]; /* canonical path for key data */
++#if APC_FILEHITS
++ zval *filehits; /* Files that came from the cache for this request */
++#endif
++ zend_bool coredump_unmap; /* Trap signals that coredump and unmap shared memory */
+ZEND_END_MODULE_GLOBALS(apc)
+
+/* (the following declaration is defined in php_apc.c) */
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc.h php-5.2.5/ext/apc/apc.h
+--- php-5.2.5-orig/ext/apc/apc.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,126 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_lock.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_lock.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_lock.h php-5.2.5/ext/apc/apc_lock.h
+--- php-5.2.5-orig/ext/apc/apc_lock.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_lock.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,105 @@
+/*
+ +----------------------------------------------------------------------+
+#endif
+
+#endif
-Index: php-5.2.4/ext/apc/apc_main.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_main.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,681 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_main.c php-5.2.5/ext/apc/apc_main.c
+--- php-5.2.5-orig/ext/apc/apc_main.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_main.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,701 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_main.c,v 3.97 2007/03/22 16:03:59 gopalv Exp $ */
++/* $Id: apc_main.c,v 3.103 2007/11/14 19:46:46 shire Exp $ */
+
+#include "apc_php.h"
+#include "apc_main.h"
+
+default_compile:
+
-+ cache_entry->autofiltered = 1;
+ if(APCG(report_autofilter)) {
+ apc_wprint("Autofiltering %s", h->opened_path);
+ }
+ }
+
+ apc_stack_pop(APCG(cache_stack)); /* pop out cache_entry */
++
++ apc_cache_release(apc_cache, cache_entry);
+
+ /* cannot free up cache data yet, it maybe in use */
+
+ zend_llist_del_element(&CG(open_files), h, compare_file_handles); /* XXX: kludge */
+
+ h->type = ZEND_HANDLE_FILENAME;
-+
-+ return old_compile_file(h, type TSRMLS_CC);
++
++ return NULL;
+}
+/* }}} */
+
+ return old_compile_file(h, type TSRMLS_CC);
+ }
+
-+#if PHP_API_VERSION <= 20041225
++#if PHP_API_VERSION < 20041225
+#if HAVE_APACHE && defined(APC_PHP4_STAT)
+ t = ((request_rec *)SG(server_context))->request_time;
+#else
+ return old_compile_file(h, type TSRMLS_CC);
+ }
+
-+ if(APCG(localcache)) {
-+ /* search for the file in the local cache */
-+ cache_entry = apc_local_cache_find(APCG(lcache), key, t);
++
++ if(!APCG(force_file_update)) {
++ if(APCG(localcache)) {
++ /* search for the file in the local cache */
++ cache_entry = apc_local_cache_find(APCG(lcache), key, t);
++ } else {
++ /* search for the file in the cache */
++ cache_entry = apc_cache_find(apc_cache, key, t);
++ }
+ } else {
-+ /* search for the file in the cache */
-+ cache_entry = apc_cache_find(apc_cache, key, t);
++ cache_entry = NULL;
+ }
+
-+ if (cache_entry != NULL && !cache_entry->autofiltered) {
++ if (cache_entry != NULL) {
+ int dummy = 1;
+ if (h->opened_path == NULL) {
+ h->opened_path = estrdup(cache_entry->data.file.filename);
+ zend_hash_add(&EG(included_files), h->opened_path, strlen(h->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
+ zend_llist_add_element(&CG(open_files), h); /* XXX kludge */
+ apc_stack_push(APCG(cache_stack), cache_entry);
-+ return cached_compile(h, type TSRMLS_CC);
-+ }
-+ else if(cache_entry != NULL && cache_entry->autofiltered) {
-+ /* nobody else is using this cache_entry */
-+ if(cache_entry->ref_count == 1) {
-+ if(cache_entry->data.file.op_array) {
-+ apc_free_op_array(cache_entry->data.file.op_array, apc_sma_free);
-+ cache_entry->data.file.op_array = NULL;
-+ }
-+ if(cache_entry->data.file.functions) {
-+ apc_free_functions(cache_entry->data.file.functions, apc_sma_free);
-+ cache_entry->data.file.functions = NULL;
-+ }
-+ if(cache_entry->data.file.classes) {
-+ apc_free_classes(cache_entry->data.file.classes, apc_sma_free);
-+ cache_entry->data.file.classes = NULL;
-+ }
++ op_array = cached_compile(h, type TSRMLS_CC);
++ if(op_array) {
++#ifdef APC_FILEHITS
++ /* If the file comes from the cache, add it to the global request file list */
++ add_next_index_string(APCG(filehits), h->filename, 1);
++#endif
++ return op_array;
+ }
-+ /* We never push this into the cache_stack, so we have to do a release */
-+ apc_cache_release(apc_cache, cache_entry);
-+ return old_compile_file(h, type TSRMLS_CC);
++ if(APCG(report_autofilter)) {
++ apc_wprint("Recompiling %s", h->opened_path);
++ }
++ /* TODO: check what happens with EG(included_files) */
+ }
+
+ if(apc_cache_busy(apc_cache) && APCG(localcache)) {
+ }
+ }
+
++ /* Make sure the mtime reflects the files last known mtime in the case of fpstat==0 */
++ if(key.type == APC_CACHE_KEY_FPFILE) {
++ apc_fileinfo_t fileinfo;
++ struct stat *tmp_buf = NULL;
++ if(!strcmp(SG(request_info).path_translated, h->filename)) {
++ tmp_buf = sapi_get_stat(TSRMLS_C); /* Apache has already done this stat() for us */
++ }
++ if(tmp_buf) {
++ fileinfo.st_buf = *tmp_buf;
++ } else {
++ if (apc_search_paths(h->filename, PG(include_path), &fileinfo) != 0) {
++#ifdef __DEBUG_APC__
++ fprintf(stderr,"Stat failed %s - bailing (%s) (%d)\n",filename,SG(request_info).path_translated);
++#endif
++ return op_array;
++ }
++ }
++ key.mtime = fileinfo.st_buf.st_mtime;
++ }
++
+ HANDLE_BLOCK_INTERRUPTIONS();
+
+#if NONBLOCKING_LOCK_AVAILABLE
+ apc_stack_clear(APCG(cache_stack));
+ APCG(slam_rand) = -1;
+ APCG(copied_zvals) = NULL;
++
++#ifdef APC_FILEHITS
++ ALLOC_INIT_ZVAL(APCG(filehits));
++ array_init(APCG(filehits));
++#endif
++
+ return 0;
+}
+
+int apc_request_shutdown(TSRMLS_D)
+{
+ apc_deactivate(TSRMLS_C);
++
++#ifdef APC_FILEHITS
++ zval_ptr_dtor(&APCG(filehits));
++#endif
++
+ return 0;
+}
+
+ apc_cache_entry_t* cache_entry =
+ (apc_cache_entry_t*) apc_stack_pop(APCG(cache_stack));
+
-+ if (cache_entry->data.file.functions) {
-+ for (i = 0; cache_entry->data.file.functions[i].function != NULL; i++) {
-+ zend_hash_del(EG(function_table),
-+ cache_entry->data.file.functions[i].name,
-+ cache_entry->data.file.functions[i].name_len+1);
-+ }
-+ }
-+
+ if (cache_entry->data.file.classes) {
+ for (i = 0; cache_entry->data.file.classes[i].class_entry != NULL; i++) {
+#ifdef ZEND_ENGINE_2
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_main.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_main.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_main.h php-5.2.5/ext/apc/apc_main.h
+--- php-5.2.5-orig/ext/apc/apc_main.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_main.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,67 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_mmap.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_mmap.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,137 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_mmap.c php-5.2.5/ext/apc/apc_mmap.c
+--- php-5.2.5-orig/ext/apc/apc_mmap.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_mmap.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,139 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_mmap.c,v 3.5 2006/03/12 00:31:45 rasmus Exp $ */
++/* $Id: apc_mmap.c,v 3.7 2007/12/20 23:00:51 shire Exp $ */
+
+#include "apc.h"
+
+#define MAP_NOSYNC 0
+#endif
+
-+void *apc_mmap(char *file_mask, int size)
++void *apc_mmap(char *file_mask, size_t size)
+{
+ void* shmaddr; /* the shared memory address */
+
+ return shmaddr;
+}
+
-+void apc_unmap(void* shmaddr, int size)
++void apc_unmap(void* shmaddr, size_t size)
+{
-+ munmap(shmaddr, size);
++ if (munmap(shmaddr, size) < 0) {
++ apc_wprint("apc_unmap: munmap failed:");
++ }
+}
+
+#endif
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc.php
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc.php 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,1313 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc.php php-5.2.5/ext/apc/apc.php
+--- php-5.2.5-orig/ext/apc/apc.php 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc.php 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,1326 @@
+<?php
+/*
+ +----------------------------------------------------------------------+
+
+ */
+
-+$VERSION='$Id: apc.php,v 3.65 2006/10/27 18:32:52 shire Exp $';
++$VERSION='$Id: apc.php,v 3.68 2007/07/22 00:25:48 gopalv Exp $';
+
+////////// READ OPTIONAL CONFIGURATION FILE ////////////
+if (file_exists("apc.conf.php")) include("apc.conf.php");
+
+// rewrite $PHP_SELF to block XSS attacks
+//
-+$PHP_SELF= isset($_SERVER['PHP_SELF']) ? htmlentities(strip_tags($_SERVER['PHP_SELF'],'')) : '';
++$PHP_SELF= isset($_SERVER['PHP_SELF']) ? htmlentities(strip_tags($_SERVER['PHP_SELF'],''), ENT_QUOTES) : '';
+$time = time();
+$host = getenv('HOSTNAME');
+if($host) { $host = '('.$host.')'; }
+$vardom=array(
+ 'OB' => '/^\d+$/', // operational mode switch
+ 'CC' => '/^[01]$/', // clear cache requested
++ 'DU' => '/^.*$/', // Delete User Key
+ 'SH' => '/^[a-z0-9]+$/', // shared object description
+
+ 'IMG' => '/^[123]$/', // image to generate
+ 'SORT1' => '/^[AHSMCDTZ]$/', // first sort key
+ 'SORT2' => '/^[DA]$/', // second sort key
+ 'AGGR' => '/^\d+$/', // aggregation by dir level
-+ 'SEARCH' => '/^.*$/' // aggregation by dir level
++ 'SEARCH' => '~^[a-zA-Z0-1/_.-]*$~' // aggregation by dir level
+);
+
+// default cache mode
+foreach($vardom as $var => $dom) {
+ if (!isset($_REQUEST[$var])) {
+ $MYREQUEST[$var]=NULL;
-+ } else if (!is_array($_REQUEST[$var]) && preg_match($dom,$_REQUEST[$var])) {
++ } else if (!is_array($_REQUEST[$var]) && preg_match($dom.'D',$_REQUEST[$var])) {
+ $MYREQUEST[$var]=$_REQUEST[$var];
+ } else {
+ $MYREQUEST[$var]=$_REQUEST[$var]=NULL;
+ apc_clear_cache($cache_mode);
+}
+
++if ($AUTHENTICATED && !empty($MYREQUEST['DU'])) {
++ apc_delete($MYREQUEST['DU']);
++}
++
+if(!function_exists('apc_cache_info') || !($cache=@apc_cache_info($cache_mode))) {
+ echo "No cache info available. APC does not appear to be running.";
+ exit;
+ $fieldheading='User Entry Label';
+ $fieldkey='info';
+
-+
+// -----------------------------------------------
+// System Cache Entries
+// -----------------------------------------------
+ else
+ echo '<td class="td-n center">None</td>';
+ }
-+ echo
-+ '<td class="td-last center">',$entry['deletion_time'] ? date(DATE_FORMAT,$entry['deletion_time']) : '-','</td>',
-+ '</tr>';
++ if ($entry['deletion_time']) {
++
++ echo '<td class="td-last center">', date(DATE_FORMAT,$entry['deletion_time']), '</td>';
++ } else if ($MYREQUEST['OB'] == OB_USER_CACHE) {
++
++ echo '<td class="td-last center">';
++ echo '[<a href="', $MY_SELF, '&OB=', $MYREQUEST['OB'], '&DU=', urlencode($entry[$fieldkey]), '">Delete Now</a>]';
++ echo '</td>';
++ } else {
++ echo '<td class="td-last center"> </td>';
++ }
++ echo '</tr>';
+ $i++;
+ if ($i == $MYREQUEST['COUNT'])
+ break;
+<!-- <?php echo "\nBased on APCGUI By R.Becker\n$VERSION\n"?> -->
+</body>
+</html>
-Index: php-5.2.4/ext/apc/apc_php.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_php.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_php.h php-5.2.5/ext/apc/apc_php.h
+--- php-5.2.5-orig/ext/apc/apc_php.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_php.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,71 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_pthreadmutex.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_pthreadmutex.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,104 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_pthreadmutex.c php-5.2.5/ext/apc/apc_pthreadmutex.c
+--- php-5.2.5-orig/ext/apc/apc_pthreadmutex.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_pthreadmutex.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,111 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_pthreadmutex.c,v 3.2 2007/02/15 21:40:45 shire Exp $ */
++/* $Id: apc_pthreadmutex.c,v 3.3 2007/12/21 01:36:51 shire Exp $ */
+
+#include "apc_pthreadmutex.h"
+
+ apc_eprint("pthread mutex error: attr is an invalid pointer.");
+ }
+
++#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
++ result = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_ADAPTIVE_NP);
++ if (result == EINVAL) {
++ apc_eprint("pthread_mutexattr_settype: unable to set adaptive mutexes");
++ }
++#endif
++
+ /* pthread_mutexattr_settype(attr, PTHREAD_MUTEX_ERRORCHECK); */
+ result = pthread_mutexattr_setpshared(attr, PTHREAD_PROCESS_SHARED);
+ if(result == EINVAL) {
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_pthreadmutex.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_pthreadmutex.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_pthreadmutex.h php-5.2.5/ext/apc/apc_pthreadmutex.h
+--- php-5.2.5-orig/ext/apc/apc_pthreadmutex.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_pthreadmutex.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,48 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_rfc1867.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_rfc1867.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,175 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_rfc1867.c php-5.2.5/ext/apc/apc_rfc1867.c
+--- php-5.2.5-orig/ext/apc/apc_rfc1867.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_rfc1867.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,195 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_rfc1867.c,v 3.4 2007/02/24 11:45:29 rasmus Exp $*/
++/* $Id: apc_rfc1867.c,v 3.12 2007/10/18 20:37:20 rasmus Exp $*/
+
+#include "apc.h"
++#include "apc_globals.h"
+#include "rfc1867.h"
+
++#ifdef PHP_WIN32
++#include "win32/time.h"
++#endif
++
+#ifdef MULTIPART_EVENT_FORMDATA
+extern int _apc_store(char *strkey, int strkey_len, const zval *val, const unsigned int ttl, const int exclusive TSRMLS_DC);
+
+ struct timeval a;
+ double t;
+ gettimeofday(&a, NULL);
-+ t = a.tv_sec + (a.tv_usec/1000000);
++ t = a.tv_sec + (a.tv_usec/1000000.00);
+ return t;
+}
+
+ static int cancel_upload = 0;
+ static double start_time;
+ static size_t bytes_processed = 0;
++ static size_t prev_bytes_processed = 0;
++ static int update_freq = 0;
+ static double rate;
+ zval *track = NULL;
+
+ start_time = my_time();
+ bytes_processed = 0;
+ rate = 0;
++ update_freq = APCG(rfc1867_freq);
++ if(update_freq < 0) { // frequency is a percentage, not bytes
++ update_freq = content_length * APCG(rfc1867_freq) / 100;
++ }
+ }
+ break;
+
+ case MULTIPART_EVENT_FORMDATA:
+ {
++ int prefix_len = strlen(APCG(rfc1867_prefix));
+ multipart_event_formdata *data = (multipart_event_formdata *) event_data;
-+
-+ if(data->name && !strncasecmp(data->name,"apc_upload_progress",19) && data->value && data->length && data->length < 58) {
-+ strlcat(tracking_key, "upload_", 63);
++ if(data->name && !strncasecmp(data->name, APCG(rfc1867_name), strlen(APCG(rfc1867_name))) && data->value && data->length && data->length < sizeof(tracking_key) - prefix_len) {
++ strlcat(tracking_key, APCG(rfc1867_prefix), 63);
+ strlcat(tracking_key, *data->value, 63);
-+ key_length = data->length+7;
++ key_length = data->length + prefix_len;
+ bytes_processed = data->post_bytes_processed;
+ }
+ }
+ add_assoc_string(track, "filename", filename, 1);
+ add_assoc_string(track, "name", name, 1);
+ add_assoc_long(track, "done", 0);
++ add_assoc_double(track, "start_time", start_time);
+ _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
+ zval_ptr_dtor(&track);
+ }
+ add_assoc_string(track, "filename", filename, 1);
+ add_assoc_string(track, "name", name, 1);
+ add_assoc_long(track, "done", 0);
-+ _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
++ add_assoc_double(track, "start_time", start_time);
++ if(bytes_processed - prev_bytes_processed > update_freq) {
++ _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
++ prev_bytes_processed = bytes_processed;
++ }
+ zval_ptr_dtor(&track);
+ }
+ break;
+ add_assoc_string(track, "temp_filename", temp_filename, 1);
+ add_assoc_long(track, "cancel_upload", cancel_upload);
+ add_assoc_long(track, "done", 0);
++ add_assoc_double(track, "start_time", start_time);
+ _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
+ zval_ptr_dtor(&track);
+ }
+ add_assoc_double(track, "rate", rate);
+ add_assoc_string(track, "filename", filename, 1);
+ add_assoc_string(track, "name", name, 1);
-+ add_assoc_string(track, "temp_filename", temp_filename, 1);
++ if(temp_filename) {
++ add_assoc_string(track, "temp_filename", temp_filename, 1);
++ }
+ add_assoc_long(track, "cancel_upload", cancel_upload);
+ add_assoc_long(track, "done", 1);
++ add_assoc_double(track, "start_time", start_time);
+ _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
+ zval_ptr_dtor(&track);
+ }
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_sem.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_sem.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_sem.c php-5.2.5/ext/apc/apc_sem.c
+--- php-5.2.5-orig/ext/apc/apc_sem.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_sem.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,177 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_sem.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_sem.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_sem.h php-5.2.5/ext/apc/apc_sem.h
+--- php-5.2.5-orig/ext/apc/apc_sem.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_sem.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,51 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_shm.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_shm.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,111 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_shm.c php-5.2.5/ext/apc/apc_shm.c
+--- php-5.2.5-orig/ext/apc/apc_shm.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_shm.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,110 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_shm.c,v 3.10 2006/05/31 22:24:48 rasmus Exp $ */
++/* $Id: apc_shm.c,v 3.11 2007/05/09 22:15:33 shire Exp $ */
+
+#include "apc_shm.h"
+#include "apc.h"
-+#include <sys/types.h>
+#ifdef PHP_WIN32
+/* shm functions are available in TSRM */
+#include <tsrm/tsrm_win32.h>
+# define SHM_A 0222 /* write permission */
+#endif
+
-+int apc_shm_create(const char* pathname, int proj, int size)
++int apc_shm_create(const char* pathname, int proj, size_t size)
+{
+ int shmid; /* shared memory id */
+ int oflag; /* permissions on shm */
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_shm.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_shm.h 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,49 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_shm.h php-5.2.5/ext/apc/apc_shm.h
+--- php-5.2.5-orig/ext/apc/apc_shm.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_shm.h 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,54 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_shm.h,v 3.6 2006/03/12 00:31:45 rasmus Exp $ */
++/* $Id: apc_shm.h,v 3.8 2007/05/23 01:23:21 auroraeosrose Exp $ */
+
+#ifndef APC_SHM_H
+#define APC_SHM_H
+
++#include <sys/types.h>
++#ifdef PHP_WIN32
++#include <time.h>
++#endif
++
+/* Wrapper functions for unix shared memory */
+
-+extern int apc_shm_create(const char* name, int proj, int size);
++extern int apc_shm_create(const char* name, int proj, size_t size);
+extern void apc_shm_destroy(int shmid);
+extern void* apc_shm_attach(int shmid);
+extern void apc_shm_detach(void* shmaddr);
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_sma.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_sma.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,624 @@
+diff -ubrN php-5.2.5-orig/ext/apc/apc_signal.c php-5.2.5/ext/apc/apc_signal.c
+--- php-5.2.5-orig/ext/apc/apc_signal.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_signal.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,178 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006 The PHP Group |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.01 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_01.txt |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Authors: Lucas Nealan <lucas@php.net> |
++ +----------------------------------------------------------------------+
++
++ This software was contributed to PHP by Facebook Inc. in 2007.
++
++ Future revisions and derivatives of this source code must acknowledge
++ Facebook Inc. as the original contributor of this module by leaving
++ this note intact in the source code.
++
++ All other licensing and usage conditions are those of the PHP Group.
++ */
++
++ /* $Id: apc_signal.c,v 1.2 2007/12/26 22:38:43 rasmus Exp $ */
++
++ /* Allows apc to install signal handlers and maintain signalling
++ to already registered handlers. Registers all signals that
++ coredump by default and unmaps the shared memory segment
++ before the coredump. Note: PHP module init is called before
++ signals are set by Apache and thus apc_set_signals should
++ be called in request init (RINIT)
++ */
++
++#include <signal.h>
++#include "apc_globals.h"
++#include "apc_sma.h"
++#include "apc_signal.h"
++
++static apc_signal_info_t apc_signal_info = {0};
++
++static int apc_register_signal(int signo, void (*handler)(int, siginfo_t*, void*));
++static void apc_rehandle_signal(int signo, siginfo_t *siginfo, void *context);
++static void apc_core_unmap(int signo, siginfo_t *siginfo, void *context);
++
++/* {{{ apc_core_unmap
++ * Coredump signal handler, unmaps shm and calls previously installed handlers
++ */
++static void apc_core_unmap(int signo, siginfo_t *siginfo, void *context)
++{
++ apc_sma_cleanup();
++ apc_rehandle_signal(signo, siginfo, context);
++
++#if !defined(WIN32) && !defined(NETWARE)
++ kill(getpid(), signo);
++#else
++ raise(signo);
++#endif
++} /* }}} */
++
++/* {{{ apc_rehandle_signal
++ * Call the previously registered handler for a signal
++ */
++static void apc_rehandle_signal(int signo, siginfo_t *siginfo, void *context)
++{
++ int i;
++ apc_signal_entry_t p_sig = {0};
++
++ for (i=0; (i < apc_signal_info.installed && p_sig.signo != signo); i++) {
++ p_sig = *apc_signal_info.prev[i];
++ if (p_sig.signo == signo) {
++ if (p_sig.siginfo) {
++ (*(void (*)(int, siginfo_t*, void*))p_sig.handler)(signo, siginfo, context);
++ } else {
++ (*(void (*)(int))p_sig.handler)(signo);
++ }
++ }
++ }
++
++} /* }}} */
++
++/* {{{ apc_register_signal
++ * Set a handler for a previously installed signal and save so we can
++ * callback when handled
++ */
++static int apc_register_signal(int signo, void (*handler)(int, siginfo_t*, void*))
++{
++#if HAVE_SIGACTION
++ struct sigaction sa = {0};
++ apc_signal_entry_t p_sig = {0};
++
++ if (sigaction(signo, NULL, &sa) == 0) {
++ if ((void*)sa.sa_handler == (void*)handler) {
++ return SUCCESS;
++ }
++
++ if (sa.sa_handler != SIG_ERR && sa.sa_handler != SIG_DFL && sa.sa_handler != SIG_IGN) {
++ p_sig.signo = signo;
++ p_sig.siginfo = ((sa.sa_flags & SA_SIGINFO) == SA_SIGINFO);
++ p_sig.handler = (void *)sa.sa_handler;
++
++ apc_signal_info.prev = (apc_signal_entry_t **)apc_erealloc(apc_signal_info.prev, (apc_signal_info.installed+1)*sizeof(apc_signal_entry_t *));
++ apc_signal_info.prev[apc_signal_info.installed] = (apc_signal_entry_t *)apc_emalloc(sizeof(apc_signal_entry_t));
++ *apc_signal_info.prev[apc_signal_info.installed++] = p_sig;
++ } else {
++ /* inherit flags and mask if already set */
++ sigemptyset(&sa.sa_mask);
++ sa.sa_flags = 0;
++ sa.sa_flags |= SA_SIGINFO; /* we'll use a siginfo handler */
++#if defined(SA_ONESHOT)
++ sa.sa_flags = SA_ONESHOT;
++#elif defined(SA_RESETHAND)
++ sa.sa_flags = SA_RESETHAND;
++#endif
++ }
++ sa.sa_handler = (void*)handler;
++
++ if (sigaction(signo, &sa, NULL) < 0) {
++ apc_wprint("Error installing apc signal handler for %d", signo);
++ }
++
++ return SUCCESS;
++ }
++#endif
++ return FAILURE;
++} /* }}} */
++
++/* {{{ apc_set_signals
++ * Install our signal handlers */
++void apc_set_signals(TSRMLS_D)
++{
++ if (APCG(coredump_unmap) && apc_signal_info.installed == 0) {
++ /* ISO C standard signals that coredump */
++ apc_register_signal(SIGSEGV, apc_core_unmap);
++ apc_register_signal(SIGABRT, apc_core_unmap);
++ apc_register_signal(SIGFPE, apc_core_unmap);
++ apc_register_signal(SIGILL, apc_core_unmap);
++ /* extended signals that coredump */
++#ifdef SIGBUS
++ apc_register_signal(SIGBUS, apc_core_unmap);
++#endif
++#ifdef SIGABORT
++ apc_register_signal(SIGABORT, apc_core_unmap);
++#endif
++#ifdef SIGEMT
++ apc_register_signal(SIGEMT, apc_core_unmap);
++#endif
++#ifdef SIGIOT
++ apc_register_signal(SIGIOT, apc_core_unmap);
++#endif
++#ifdef SIGQUIT
++ apc_register_signal(SIGQUIT, apc_core_unmap);
++#endif
++#ifdef SIGSYS
++ apc_register_signal(SIGSYS, apc_core_unmap);
++#endif
++#ifdef SIGTRAP
++ apc_register_signal(SIGTRAP, apc_core_unmap);
++#endif
++#ifdef SIGXCPU
++ apc_register_signal(SIGXCPU, apc_core_unmap);
++#endif
++#ifdef SIGXFSZ
++ apc_register_signal(SIGXFSZ, apc_core_unmap);
++#endif
++ }
++} /* }}} */
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -ubrN php-5.2.5-orig/ext/apc/apc_signal.h php-5.2.5/ext/apc/apc_signal.h
+--- php-5.2.5-orig/ext/apc/apc_signal.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_signal.h 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,50 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006 The PHP Group |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.01 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_01.txt |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Authors: Lucas Nealan <lucas@php.net> |
++ +----------------------------------------------------------------------+
++
++ */
++
++/* $Id: apc_signal.h,v 1.1 2007/12/26 22:36:06 rasmus Exp $ */
++
++#ifndef APC_SIGNAL_H
++#define APC_SIGNAL_H
++
++#include "apc.h"
++#include "apc_php.h"
++
++typedef struct apc_signal_entry_t {
++ int signo; /* signal number */
++ int siginfo; /* siginfo style handler calling */
++ void* handler; /* signal handler */
++} apc_signal_entry_t;
++
++typedef struct apc_signal_info_t {
++ int installed; /* How many signals we've installed handles for */
++ apc_signal_entry_t **prev; /* Previous signal handlers */
++} apc_signal_info_t;
++
++void apc_set_signals(TSRMLS_D);
++
++#endif
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -ubrN php-5.2.5-orig/ext/apc/apc_sma.c php-5.2.5/ext/apc/apc_sma.c
+--- php-5.2.5-orig/ext/apc/apc_sma.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_sma.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,628 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: apc_sma.c,v 1.63 2007/04/02 09:02:57 gopalv Exp $ */
++/* $Id: apc_sma.c,v 1.69 2007/12/26 21:35:39 gopalv Exp $ */
+
+#include "apc_sma.h"
+#include "apc.h"
+#include "apc_shm.h"
+#include <limits.h>
+#if APC_MMAP
-+void *apc_mmap(char *file_mask, int size);
-+void apc_unmap(void* shmaddr, int size);
++void *apc_mmap(char *file_mask, size_t size);
++void apc_unmap(void* shmaddr, size_t size);
+#endif
+
+/* {{{ locking macros */
+static int sma_initialized = 0; /* true if the sma has been initialized */
+static unsigned int sma_numseg; /* number of shm segments to allow */
+static size_t sma_segsize; /* size of each shm segment */
-+static int* sma_segments; /* array of shm segment ids */
++static size_t* sma_segments; /* array of shm segment ids */
+static void** sma_shmaddrs; /* array of shm segment addresses */
+static int sma_lastseg = 0; /* index of MRU segment */
+
+ /* If we have a next fit offset, start searching from there */
+ if(header->nfoffset) {
+ prv = BLOCKAT(header->nfoffset);
++ /* if prv is the last block, jump to the beginning */
++ if(prv->next == 0) {
++ prv = BLOCKAT(ALIGNWORD(sizeof(header_t)));
++ wrapped = 1;
++ }
+ } else {
-+ prv = BLOCKAT(sizeof(header_t));
++ prv = BLOCKAT(ALIGNWORD(sizeof(header_t)));
+ }
+
+ CHECK_CANARY(prv);
+
+ /* Check to see if we need to wrap around and search from the top */
+ if(header->nfoffset && prv->next == 0) {
-+ prv = BLOCKAT(sizeof(header_t));
++ prv = BLOCKAT(ALIGNWORD(sizeof(header_t)));
+#ifdef __APC_SMA_DEBUG__
+ CHECK_CANARY(prv);
+#endif
+
+ /* find position of new block in free list */
+ cur = BLOCKAT(offset);
-+ prv = BLOCKAT(sizeof(header_t));
++ prv = BLOCKAT(ALIGNWORD(sizeof(header_t)));
+
+ CHECK_CANARY(cur);
+
+
+/* {{{ apc_sma_init */
+
-+void apc_sma_init(int numseg, int segsize, char *mmap_file_mask)
++void apc_sma_init(int numseg, size_t segsize, char *mmap_file_mask)
+{
+ int i;
+
+
+ sma_segsize = segsize > 0 ? segsize : DEFAULT_SEGSIZE;
+
-+ sma_segments = (int*) apc_emalloc(sma_numseg*sizeof(int));
++ sma_segments = (size_t*) apc_emalloc(sma_numseg*sizeof(size_t));
+ sma_shmaddrs = (void**) apc_emalloc(sma_numseg*sizeof(void*));
+
+ for (i = 0; i < sma_numseg; i++) {
+ header = (header_t*) shmaddr;
+ apc_lck_create(NULL, 0, 1, header->sma_lock);
+ header->segsize = sma_segsize;
-+ header->avail = sma_segsize - sizeof(header_t) - sizeof(block_t) -
-+ ALIGNWORD(sizeof(int));
++ header->avail = sma_segsize - ALIGNWORD(sizeof(header_t)) - ALIGNWORD(sizeof(block_t));
+ header->nfoffset = 0;
+#if ALLOC_DISTRIBUTION
+ {
+ for(j=0; j<30; j++) header->adist[j] = 0;
+ }
+#endif
-+ block = BLOCKAT(sizeof(header_t));
++ block = BLOCKAT(ALIGNWORD(sizeof(header_t)));
+ block->size = 0;
-+ block->next = sizeof(header_t) + sizeof(block_t);
++ block->next = ALIGNWORD(sizeof(header_t)) + ALIGNWORD(sizeof(block_t));
+ SET_CANARY(block);
+#ifdef __APC_SMA_DEBUG__
+ block->id = -1;
+ UNLOCK(((header_t*)sma_shmaddrs[sma_lastseg])->sma_lock);
+
+ for (i = 0; i < sma_numseg; i++) {
-+ LOCK(((header_t*)sma_shmaddrs[i])->sma_lock);
+ if (i == sma_lastseg) {
+ continue;
+ }
++ LOCK(((header_t*)sma_shmaddrs[i])->sma_lock);
+ off = sma_allocate(sma_shmaddrs[i], n);
+ if (off != -1) {
+ void* p = (void *)(((char *)(sma_shmaddrs[i])) + off);
+
+ info = (apc_sma_info_t*) apc_emalloc(sizeof(apc_sma_info_t));
+ info->num_seg = sma_numseg;
-+ info->seg_size = sma_segsize - sizeof(header_t) - sizeof(block_t) - ALIGNWORD(sizeof(int));
++ info->seg_size = sma_segsize - ALIGNWORD(sizeof(header_t)) - ALIGNWORD(sizeof(block_t));
+
+ info->list = apc_emalloc(info->num_seg * sizeof(apc_sma_link_t*));
+ for (i = 0; i < sma_numseg; i++) {
+ for (i = 0; i < sma_numseg; i++) {
+ RDLOCK(((header_t*)sma_shmaddrs[i])->sma_lock);
+ shmaddr = sma_shmaddrs[i];
-+ prv = BLOCKAT(sizeof(header_t));
++ prv = BLOCKAT(ALIGNWORD(sizeof(header_t)));
+
+ link = &info->list[i];
+
+/* }}} */
+
+/* {{{ apc_sma_get_avail_mem */
-+int apc_sma_get_avail_mem()
++size_t apc_sma_get_avail_mem()
+{
-+ int avail_mem = 0;
++ size_t avail_mem = 0;
+ int i;
+
+ for (i = 0; i < sma_numseg; i++) {
+ for (i = 0; i < sma_numseg; i++) {
+ char* shmaddr = sma_shmaddrs[i];
+ header_t* header = (header_t*) shmaddr;
-+ block_t* prv = BLOCKAT(sizeof(header_t));
++ block_t* prv = BLOCKAT(ALIGNWORD(sizeof(header_t)));
+ int avail = 0;
+
+ /* For each block in this segment */
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_sma.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_sma.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_sma.h php-5.2.5/ext/apc/apc_sma.h
+--- php-5.2.5-orig/ext/apc/apc_sma.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_sma.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,82 @@
+/*
+ +----------------------------------------------------------------------+
+
+ */
+
-+/* $Id: apc_sma.h,v 1.16 2007/02/24 11:59:40 rasmus Exp $ */
++/* $Id: apc_sma.h,v 1.18 2007/05/11 01:46:31 shire Exp $ */
+
+#ifndef APC_SMA_H
+#define APC_SMA_H
+
+/* Simple shared memory allocator */
+
-+extern void apc_sma_init(int numseg, int segsize, char *mmap_file_mask);
++extern void apc_sma_init(int numseg, size_t segsize, char *mmap_file_mask);
+extern void apc_sma_cleanup();
+extern void* apc_sma_malloc(size_t size);
+extern void* apc_sma_realloc(void* p, size_t size);
+/* {{{ struct definition: apc_sma_link_t */
+typedef struct apc_sma_link_t apc_sma_link_t;
+struct apc_sma_link_t {
-+ int size; /* size of this free block */
-+ int offset; /* offset in segment of this block */
++ long size; /* size of this free block */
++ long offset; /* offset in segment of this block */
+ apc_sma_link_t* next; /* link to next free block */
+};
+/* }}} */
+typedef struct apc_sma_info_t apc_sma_info_t;
+struct apc_sma_info_t {
+ int num_seg; /* number of shared memory segments */
-+ int seg_size; /* size of each shared memory segment */
++ long seg_size; /* size of each shared memory segment */
+ apc_sma_link_t** list; /* there is one list per segment */
+};
+/* }}} */
+extern apc_sma_info_t* apc_sma_info(zend_bool limited);
+extern void apc_sma_free_info(apc_sma_info_t* info);
+
-+extern int apc_sma_get_avail_mem();
++extern size_t apc_sma_get_avail_mem();
+extern void apc_sma_check_integrity();
+
+#endif
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_spin.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_spin.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_spin.c php-5.2.5/ext/apc/apc_spin.c
+--- php-5.2.5-orig/ext/apc/apc_spin.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_spin.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,65 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_spin.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_spin.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_spin.h php-5.2.5/ext/apc/apc_spin.h
+--- php-5.2.5-orig/ext/apc/apc_spin.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_spin.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,48 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_stack.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_stack.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_stack.c php-5.2.5/ext/apc/apc_stack.c
+--- php-5.2.5-orig/ext/apc/apc_stack.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_stack.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,105 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_stack.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_stack.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_stack.h php-5.2.5/ext/apc/apc_stack.h
+--- php-5.2.5-orig/ext/apc/apc_stack.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_stack.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,58 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_zend.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_zend.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_zend.c php-5.2.5/ext/apc/apc_zend.c
+--- php-5.2.5-orig/ext/apc/apc_zend.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_zend.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,277 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/apc_zend.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/apc_zend.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/apc_zend.h php-5.2.5/ext/apc/apc_zend.h
+--- php-5.2.5-orig/ext/apc/apc_zend.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/apc_zend.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,53 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/CHANGELOG
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/CHANGELOG 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,192 @@
+diff -ubrN php-5.2.5-orig/ext/apc/arch/atomic.h php-5.2.5/ext/apc/arch/atomic.h
+--- php-5.2.5-orig/ext/apc/arch/atomic.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/arch/atomic.h 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,38 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006 The PHP Group |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.01 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_01.txt |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Authors: Brian Shire <shire@php.net> |
++ +----------------------------------------------------------------------+
++
++ */
++
++/* $Id: atomic.h,v 1.1 2006/09/29 07:13:01 shire Exp $ */
++
++#ifndef APC_ARCH_ATOMIC_H
++
++#define APC_ARCH_ATOMIC_H
++
++#if defined __x86_64__
++#include "x86_64/atomic.h"
++
++#elif defined __i386__
++#include "i386/atomic.h"
++
++#else
++#error "Unknown or Unsupported Architecture. If you would like futex suupport for your architecture, please file a request at http://pecl.php.net/bugs/report.php?package=APC"
++
++#endif
++
++
++#endif
+diff -ubrN php-5.2.5-orig/ext/apc/arch/i386/atomic.h php-5.2.5/ext/apc/arch/i386/atomic.h
+--- php-5.2.5-orig/ext/apc/arch/i386/atomic.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/arch/i386/atomic.h 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,79 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006 The PHP Group |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.01 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_01.txt |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Authors: Brian Shire <shire@php.net> |
++ +----------------------------------------------------------------------+
++
++ */
++
++/* $Id: atomic.h,v 1.1 2006/09/29 07:13:01 shire Exp $ */
++
++
++#include <sys/syscall.h>
++#include <sys/time.h>
++#include <linux/futex.h>
++
++/* int sys_futex (void *futex, int op, int val, const struct timespec *timeout); */
++static inline long int apc_sys_futex(void *futex, int op, int val, const struct timespec *timeout) {
++
++ long int ret;
++
++ /* i386 system calls are performed with nt 80h operation.
++ * the argument order is a, b, c, d, S, D
++ */
++ asm volatile ("int $0x80"
++ : "=a" (ret)
++ : "0" (SYS_futex),
++ "b" (futex),
++ "c" (op),
++ "d" (val),
++ "S" (timeout)
++ : "memory"
++ );
++
++ return ret;
++
++}
++
++
++static inline int apc_cmpxchg(volatile int *ptr, int old, int new) {
++
++ int prev;
++
++ asm volatile ("LOCK cmpxchgl %1, %2"
++ : "=a" (prev)
++ : "r" (new),
++ "m" (*(ptr)),
++ "0"(old)
++ : "memory", "cc"
++ );
++
++ return prev;
++}
++
++static inline int apc_xchg(volatile int *ptr, int new) {
++
++ int ret;
++
++ asm volatile ("LOCK xchgl %[new], %[ptr]"
++ : "=a" (ret)
++ : [new] "0" (new),
++ [ptr] "m" (*(ptr))
++ : "memory"
++ );
++
++ return ret;
++
++}
++
+diff -ubrN php-5.2.5-orig/ext/apc/arch/x86_64/atomic.h php-5.2.5/ext/apc/arch/x86_64/atomic.h
+--- php-5.2.5-orig/ext/apc/arch/x86_64/atomic.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/arch/x86_64/atomic.h 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,80 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006 The PHP Group |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.01 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_01.txt |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Authors: Brian Shire <shire@php.net> |
++ +----------------------------------------------------------------------+
++
++ */
++
++/* $Id: atomic.h,v 1.1 2006/09/29 07:13:01 shire Exp $ */
++
++
++#include <sys/syscall.h>
++#include <sys/time.h>
++#include <linux/futex.h>
++
++/* int sys_futex (void *futex, int op, int val, const struct timespec *timeout); */
++static inline long int apc_sys_futex(void *futex, int op, int val, const struct timespec *timeout) {
++
++ long int ret;
++
++ /* x86_64 system calls are performed with the faster SYSCALL operation.
++ * the argument order is D, S, d, c, b, a rather than
++ * a, b, c, d, S, D as on the i386 int 80h call.
++ */
++ asm volatile ("syscall"
++ : "=a" (ret)
++ : "0" (SYS_futex),
++ "D" (futex),
++ "S" (op),
++ "d" (val),
++ "c" (timeout)
++ : "r11", "rcx", "memory"
++ );
++
++ return ret;
++
++}
++
++
++static inline int apc_cmpxchg(volatile int *ptr, int old, int new) {
++
++ int prev;
++
++ asm volatile ("LOCK cmpxchgl %1, %2"
++ : "=a" (prev)
++ : "r" (new),
++ "m" (*(ptr)),
++ "0"(old)
++ : "memory", "cc"
++ );
++
++ return prev;
++}
++
++static inline int apc_xchg(volatile int *ptr, int new) {
++
++ int ret;
++
++ asm volatile ("LOCK xchgl %[new], %[ptr]"
++ : "=a" (ret)
++ : [new] "0" (new),
++ [ptr] "m" (*(ptr))
++ : "memory"
++ );
++
++ return ret;
++
++}
++
+diff -ubrN php-5.2.5-orig/ext/apc/CHANGELOG php-5.2.5/ext/apc/CHANGELOG
+--- php-5.2.5-orig/ext/apc/CHANGELOG 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/CHANGELOG 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,211 @@
++3.0.16: 2007-12-26
++- Fix for longstanding cache-full crash (Christian Seiler)
++ http://news.php.net/php.pecl.dev/4951 for the details
++- Added optional shm unmap on a fatal signal feature (Lucas Nealan)
++- Added PTHREAD_MUTEX_ADAPTIVE_NP option pthread locks (Paul Saab)
++- Minor cleanups (Lucas Nealan)
++- Added configure option to enable apc_cache_info('filehits') (Shire)
++
++3.0.15: 2007-10-18
++- Eliminate a per-request time() syscall (Rasmus)
++- Added rfc1867 prefix, name, and freq ini options (Shire)
++- Allow deletion of individual user cache entries via apc.php (Sara)
++- Fix overzealous cleanup during RSHUTDOWN (Gopal)
++- Fix memory alignment and locking issues (Gopal)
++- Make apc_compile insert/replace entries (Shire)
++- Make mixed inheritance recompile & cache afresh (Gopal)
++- Make nostat mode search include_path for canonicalization (Gopal)
++- ZTS & other compile fixes (Gopal, Edin, Shire)
++
+3.0.14: 2007-03-21
+- Build fix (Shire)
+- Don't hook the upload hook if APC is disabled (Rasmus)
+
+1.0.1:
+- added optional file modification time check [djc 2001-01-12]
-Index: php-5.2.4/ext/apc/config.m4
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/config.m4 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,214 @@
+diff -ubrN php-5.2.5-orig/ext/apc/config.m4 php-5.2.5/ext/apc/config.m4
+--- php-5.2.5-orig/ext/apc/config.m4 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/config.m4 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,238 @@
+dnl
-+dnl $Id: config.m4,v 3.25 2007/02/24 15:57:59 rasmus Exp $
++dnl $Id: config.m4,v 3.30 2007/12/26 22:31:20 rasmus Exp $
+dnl
+
+AC_MSG_CHECKING(whether apc needs to get compiler flags from apxs)
+PHP_ARG_ENABLE(apc, whether to enable APC support,
+[ --enable-apc Enable APC support])
+
++AC_MSG_CHECKING(Checking whether we should enable cache request file info)
++AC_ARG_ENABLE(apc-filehits,
++[ --enable-apc-filehits Enable per request file info about files used from the APC cache (ie: apc_cache_info('filehits')) ],
++[
++ PHP_APC_FILEHITS=$enableval
++ AC_MSG_RESULT($enableval)
++],
++[
++ PHP_APC_FILEHITS=no
++ AC_MSG_RESULT(no)
++])
++
++
++
+AC_MSG_CHECKING(Checking whether we should use mmap)
+AC_ARG_ENABLE(apc-mmap,
+[ --disable-apc-mmap
+
+AC_MSG_CHECKING(Checking whether we should use pthread mutex locking)
+AC_ARG_ENABLE(apc-pthreadmutex,
-+[ --enable-apc-pthreadmutex
-+ Enable pthread mutex locking EXPERIMENTAL ],
-+[
-+ PHP_APC_PTHREADMUTEX=$enableval
-+ AC_MSG_RESULT($enableval)
-+],
++[ --disable-apc-pthreadmutex
++ Disable pthread mutex locking ],
+[
+ PHP_APC_PTHREADMUTEX=no
+ AC_MSG_RESULT(no)
++],
++[
++ PHP_APC_PTHREADMUTEX=yes
++ AC_MSG_RESULT(yes)
+])
+if test "$PHP_APC_PTHREADMUTEX" != "no"; then
+ orig_LIBS="$LIBS"
+ return -1;
+ }
+ if(pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) {
-+ puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_mutexattr_setpshared), your system may not support shared mutex's which are required. (if you're using threads you should just use the built-in php thread locking).");
++ puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_mutexattr_setpshared), your system may not support shared mutex's.");
+ return -1;
+ }
+ if(pthread_mutex_init(&mutex, &attr)) {
+ PHP_ADD_LIBRARY(pthread)
+ ],
+ [ dnl -Failure-
-+ AC_MSG_ERROR([It doesn't appear that pthread mutex's are supported on your system, please try a different configuration])
++ AC_MSG_WARN([It doesn't appear that pthread mutex's are supported on your system])
++ PHP_APC_PTHREADMUTEX=no
+ ],
+ [
+ PHP_ADD_LIBRARY(pthread)
+
+if test "$PHP_APC" != "no"; then
+ test "$PHP_APC_MMAP" != "no" && AC_DEFINE(APC_MMAP, 1, [ ])
-+ test "$PHP_APC_SEM" != "no" && AC_DEFINE(APC_SEM_LOCKS, 1, [ ])
-+ test "$PHP_APC_FUTEX" != "no" && AC_DEFINE(APC_FUTEX_LOCKS, 1, [ ])
-+ test "$PHP_APC_PTHREADMUTEX" != "no" && AC_DEFINE(APC_PTHREADMUTEX_LOCKS, 1, [ ])
-+ test "$PHP_APC_SPINLOCKS" != "no" && AC_DEFINE(APC_SPIN_LOCKS, 1, [ ])
-+
++ test "$PHP_APC_FILEHITS" != "no" && AC_DEFINE(APC_FILEHITS, 1, [ ])
++
++ if test "$PHP_APC_SEM" != "no"; then
++ AC_DEFINE(APC_SEM_LOCKS, 1, [ ])
++ elif test "$PHP_APC_FUTEX" != "no"; then
++ AC_DEFINE(APC_FUTEX_LOCKS, 1, [ ])
++ elif test "$PHP_APC_SPINLOCKS" != "no"; then
++ AC_DEFINE(APC_SPIN_LOCKS, 1, [ ])
++ elif test "$PHP_APC_PTHREADMUTEX" != "no"; then
++ AC_DEFINE(APC_PTHREADMUTEX_LOCKS, 1, [ ])
++ fi
++
++ AC_CHECK_FUNCS(sigaction)
+ AC_CACHE_CHECK(for union semun, php_cv_semun,
+ [
+ AC_TRY_COMPILE([
+ apc_shm.c \
+ apc_futex.c \
+ apc_pthreadmutex.c \
-+ apc_spin.c \
-+ pgsql_s_lock.c \
++ apc_spin.c \
++ pgsql_s_lock.c \
+ apc_sma.c \
+ apc_stack.c \
+ apc_zend.c \
-+ apc_rfc1867.c "
++ apc_rfc1867.c \
++ apc_signal.c "
+
+ PHP_CHECK_LIBRARY(rt, shm_open, [PHP_ADD_LIBRARY(rt,,APC_SHARED_LIBADD)])
+ PHP_NEW_EXTENSION(apc, $apc_sources, $ext_shared,, \\$(APC_CFLAGS))
+ AC_DEFINE(HAVE_APC, 1, [ ])
+fi
+
-Index: php-5.2.4/ext/apc/INSTALL
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/INSTALL 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,405 @@
+diff -ubrN php-5.2.5-orig/ext/apc/INSTALL php-5.2.5/ext/apc/INSTALL
+--- php-5.2.5-orig/ext/apc/INSTALL 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/INSTALL 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,422 @@
+Installation Instructions for APC
+---------------------------------
+
+ still going will disable the tracking for the previous.
+ (Default: 0)
+
++ apc.rfc1867_prefix Key prefix to use for the user cache entry generated by
++ rfc1867 upload progress functionality.
++ (Default: "upload_")
++
++ apc.rfc1867_name Specify the hidden form entry name that activates APC upload
++ progress and specifies the user cache key suffix.
++ (Default: "APC_UPLOAD_PROGRESS")
++
++ apc.rfc1867_freq The frequency that updates should be made to the user cache
++ entry for upload progress. This can take the form of a
++ percentage of the total file size or a size in bytes
++ optionally suffixed with 'k', 'm', or 'g' for kilobytes,
++ megabytes, or gigabytes respectively (case insensitive).
++ A setting of 0 updates as often as possible, which may cause
++ slower uploads.
++ (Default: 0)
++
+ apc.localcache This enables a lock-free local process shadow-cache which
+ reduces lock contention when the cache is being written to.
+ (Default: 0)
+ Optimize include_once and require_once calls and avoid the
+ expensive system calls used.
+ (Default: 0)
-Index: php-5.2.4/ext/apc/LICENSE
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/LICENSE 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/LICENSE php-5.2.5/ext/apc/LICENSE
+--- php-5.2.5-orig/ext/apc/LICENSE 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/LICENSE 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,68 @@
+--------------------------------------------------------------------
+ The PHP License, version 3.01
+
+PHP includes the Zend Engine, freely available at
+<http://www.zend.com>.
-Index: php-5.2.4/ext/apc/NOTICE
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/NOTICE 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/NOTICE php-5.2.5/ext/apc/NOTICE
+--- php-5.2.5-orig/ext/apc/NOTICE 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/NOTICE 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,43 @@
+This is the NOTICE file that holds acknowledgements and stuff.
+
+ Angel Li diffs for ANSI comment compliance
+ Christian Rishøj help debugging phplib problems
+ Sascha Schumann memory error bug fix
-Index: php-5.2.4/ext/apc/pgsql_s_lock.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/pgsql_s_lock.c 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/package.xml php-5.2.5/ext/apc/package.xml
+--- php-5.2.5-orig/ext/apc/package.xml 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/package.xml 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,534 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
++ <name>APC</name>
++ <channel>pecl.php.net</channel>
++ <summary>Alternative PHP Cache</summary>
++ <description>APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.</description>
++ <lead>
++ <name>Daniel Cowgill</name>
++ <user>dcowgill</user>
++ <email>dan@mail.communityconnect.com</email>
++ <active>no</active>
++ </lead>
++ <lead>
++ <name>George Schlossnagle</name>
++ <user>gschlossnagle</user>
++ <email>george@omniti.com</email>
++ <active>no</active>
++ </lead>
++ <lead>
++ <name>Rasmus Lerdorf</name>
++ <user>rasmus</user>
++ <email>rasmus@php.net</email>
++ <active>yes</active>
++ </lead>
++ <lead>
++ <name>Gopal Vijayaraghavan</name>
++ <user>gopalv</user>
++ <email>gopalv@php.net</email>
++ <active>yes</active>
++ </lead>
++ <developer>
++ <name>Edin Kadribasic</name>
++ <user>edink</user>
++ <email>edink@emini.dk</email>
++ <active>yes</active>
++ </developer>
++ <developer>
++ <name>Ilia Alshanetsky</name>
++ <user>iliaa</user>
++ <email>ilia@prohost.org</email>
++ <active>yes</active>
++ </developer>
++ <developer>
++ <name>Marcus Börger</name>
++ <user>helly</user>
++ <email>helly@php.net</email>
++ <active>yes</active>
++ </developer>
++ <developer>
++ <name>Sara Golemon</name>
++ <user>pollita</user>
++ <email>pollita@php.net</email>
++ <active>yes</active>
++ </developer>
++ <developer>
++ <name>Brian Shire</name>
++ <user>shire</user>
++ <email>shire@php.net</email>
++ <active>yes</active>
++ </developer>
++ <date>2007-12-26</date>
++ <time>14:51:32</time>
++ <version>
++ <release>3.0.16</release>
++ <api>3.0.0</api>
++ </version>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <license uri="http://www.php.net/license">PHP License</license>
++ <notes>* Fix for longstanding cache-full crash (Christian Seiler)
++ http://news.php.net/php.pecl.dev/4951 for the details
++* Added optional shm unmap on a fatal signal feature (Lucas Nealan)
++* Added PTHREAD_MUTEX_ADAPTIVE_NP option pthread locks (Paul Saab)
++* Minor cleanups (Lucas Nealan)
++* Added configure option to enable apc_cache_info('filehits') (Shire)</notes>
++ <contents>
++ <dir name="/">
++ <file md5sum="841596cff3b9bd83e79d01ccb591ff55" name="tests/apc_001.phpt" role="test" />
++ <file md5sum="cc1dba4e429ff93dce1ca7dea01c2899" name="tests/apc_002.phpt" role="test" />
++ <file md5sum="411fdc85b170ec696298d38f93132d6b" name="tests/apc_003.phpt" role="test" />
++ <file md5sum="6ecba4154b6bd6f8703000f5198710cc" name="tests/skipif.inc" role="test" />
++ <file md5sum="2a2e8b29dba8df697dbd81b306ccbe73" name="arch/i386/atomic.h" role="src" />
++ <file md5sum="7f01c5cd3a1742c20d6d285f119596a6" name="arch/x86_64/atomic.h" role="src" />
++ <file md5sum="26748a0d6567c5611408eb69fb25c671" name="arch/atomic.h" role="src" />
++ <file md5sum="0714a0039d9ea63cfc26043a7d86f04c" name="CHANGELOG" role="doc" />
++ <file md5sum="3b6ad608e37fb34b24afb90084b4770b" name="INSTALL" role="doc" />
++ <file md5sum="694f49a7e1f276ba75a3dd2c5acd580d" name="LICENSE" role="doc" />
++ <file md5sum="eea150699d3dffb2cdf7d243854189d7" name="NOTICE" role="doc" />
++ <file md5sum="efa40416571fc54aa59912203c0391e6" name="TODO" role="doc" />
++ <file md5sum="b7dd14328e218d3ecc97d85fb83d7ba7" name="TECHNOTES.txt" role="doc" />
++ <file md5sum="c4384f370db6a6112d6c21268bc9a278" name="apc.c" role="src" />
++ <file md5sum="09a525ff9a3850e6de42eee2adf07463" name="apc.dsp" role="src" />
++ <file md5sum="109694ee417962096eb3e962d6bcce8a" name="apc.h" role="src" />
++ <file md5sum="ee19b49ef26dbd491b846a19f9bc9e6a" name="apc_cache.c" role="src" />
++ <file md5sum="e0a4f0c5a49a0beba10f2f831e1b63b6" name="apc_cache.h" role="src" />
++ <file md5sum="7576310688084dd737f7c7bc11c75e22" name="apc_compile.c" role="src" />
++ <file md5sum="a0eea1abcf4ec395ea9a195e98c2cc65" name="apc_compile.h" role="src" />
++ <file md5sum="64bbe1f8cf18261255ef5874039e76e9" name="apc_debug.c" role="src" />
++ <file md5sum="46d182a6122f3c29a1904f62af7cfb51" name="apc_debug.h" role="src" />
++ <file md5sum="3dbdb44d0fc2d45ae15719b4fc5746cd" name="apc_fcntl.c" role="src" />
++ <file md5sum="f4fc86769ce871d42ce0085fa7323d79" name="apc_fcntl.h" role="src" />
++ <file md5sum="9dffe726c9b6cfdd640e07782a0f409b" name="apc_futex.c" role="src" />
++ <file md5sum="ff999238a10bfb6b715e4e8f54ec8326" name="apc_futex.h" role="src" />
++ <file md5sum="33d241202d41095bc1b6fdafc1063cb9" name="apc_globals.h" role="src" />
++ <file md5sum="3e6f98c635b18902aab221f29d8b70ec" name="apc_lock.h" role="src" />
++ <file md5sum="0667187c715fea98569b51a491fb445b" name="apc_main.c" role="src" />
++ <file md5sum="2e8f99d31b4d088eb14859c6e137544a" name="apc_main.h" role="src" />
++ <file md5sum="e9e447ef3994b85d064c9a49f7ed0917" name="apc_mmap.c" role="src" />
++ <file md5sum="a22df1256e20fef8160bbf9529723b50" name="apc_php.h" role="src" />
++ <file md5sum="c285337c2e0b852de9f79ac5015a3fa7" name="apc_pthreadmutex.c" role="src" />
++ <file md5sum="e4e6943b0cfb31facd1148c2dbfc4c93" name="apc_pthreadmutex.h" role="src" />
++ <file md5sum="ea3822772adb45e0046faef855c32aba" name="apc_sem.c" role="src" />
++ <file md5sum="1a7fb689f8d5b01fad537b277c81d59f" name="apc_sem.h" role="src" />
++ <file md5sum="632e60d387e5555f4aa03a8948f52ea7" name="apc_shm.c" role="src" />
++ <file md5sum="6de8e94976f01b2f48ef97020a008774" name="apc_shm.h" role="src" />
++ <file md5sum="25d3e2a3d1c2f9afa8e103492ca7e89e" name="apc_sma.c" role="src" />
++ <file md5sum="fdc0aebc501f2e29389611fa61084da0" name="apc_sma.h" role="src" />
++ <file md5sum="ecd6cc1d56d99dbb7364d40c975fca5e" name="apc_spin.c" role="src" />
++ <file md5sum="c716852258453471a6927f95a617e30f" name="apc_spin.h" role="src" />
++ <file md5sum="17cceda297a61a9185bcafd7d897fad4" name="apc_stack.c" role="src" />
++ <file md5sum="db2f213a3e616313d7864222874197ea" name="apc_stack.h" role="src" />
++ <file md5sum="8cccb8ecfa2d5a893537b2c1a8b6b718" name="apc_zend.c" role="src" />
++ <file md5sum="2ee61624ec5d779d02746ba7254aed14" name="apc_zend.h" role="src" />
++ <file md5sum="113d74a5e70119a63fb86815bf50d03b" name="apc_signal.c" role="src" />
++ <file md5sum="af4c7d0595ce32346f7ee37707d7dada" name="apc_signal.h" role="src" />
++ <file md5sum="5cbb3cbe6477799e7e5fd816eda69937" name="config.m4" role="src" />
++ <file md5sum="b748744f64eb4fbe201cce84cc3d7e33" name="php_apc.c" role="src" />
++ <file md5sum="8c092033ef0cd8a5d207acb4f6ecec11" name="php_apc.h" role="src" />
++ <file md5sum="76fe025ee14897783cee848dc1a77fa6" name="pgsql_s_lock.c" role="src" />
++ <file md5sum="b67725b96ecf0e6851eccce632bab289" name="pgsql_s_lock.h" role="src" />
++ <file md5sum="298e1c6721b21635ef46094c6a175af5" name="apc_fcntl_win32.c" role="src" />
++ <file md5sum="072c127617c90a92331372a3b99494d3" name="apc_rfc1867.c" role="src" />
++ <file md5sum="41fb805e7a151dc6edfe78780b5102d0" name="apc.php" role="php" />
++ </dir>
++ </contents>
++ <dependencies>
++ <required>
++ <php>
++ <min>4.3.0</min>
++ <exclude>5.0.0</exclude>
++ <exclude>5.0.1</exclude>
++ <exclude>5.0.2</exclude>
++ <exclude>5.0.3</exclude>
++ <exclude>5.0.4</exclude>
++ <exclude>5.0.5</exclude>
++ </php>
++ <pearinstaller>
++ <min>1.4.0</min>
++ </pearinstaller>
++ </required>
++ </dependencies>
++ <providesextension>apc</providesextension>
++ <extsrcrelease>
++ <configureoption default="yes" name="with-apxs" prompt="Use apxs to set compile flags (if using APC with Apache)?" />
++ </extsrcrelease>
++ <changelog>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>2.0.0</release>
++ <api>2.0.0</api>
++ </version>
++ <date>2003-07-01</date>
++ <notes>Complete rework.</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>2.0.1</release>
++ <api>2.0.0</api>
++ </version>
++ <date>2003-07-01</date>
++ <notes>Win32 support added.</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>2.0.2</release>
++ <api>2.0.0</api>
++ </version>
++ <date>2004-03-12</date>
++ <notes>Fixed non-existant class bug.</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.0</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-07-05</date>
++ <notes>PHP-5.1 Support and numerous fixes</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.1</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-07-05</date>
++ <notes>PHP4 build fix</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.2</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-07-05</date>
++ <notes>Default to mmap and add a better error message for shmget failures</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.3</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-07-07</date>
++ <notes>Fix compile problem against PHP 5.0.x</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.4</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-07-18</date>
++ <notes>Add win32 support from Edin.
++Add --with-apxs switch to work around problem when loading APC into Apache binary compiled with LFS switches
++A couple of other minor fixes.</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.5</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-07-27</date>
++ <notes>Make it easier for sapis that only populate file_handle->filename to use APC. (Rasmus)
++Support extensions such as bcompiler that need to hook into compile_file. (Val)
++Ralf Becker's apcgui code has now become the default apc.php status page. (Ralf, Rasmus, Ilia)
++Segfault in cache cleanup code (Ilia, Rasmus)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.6</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-07-30</date>
++ <notes>Added apc.php to package.xml file.
++Track per-entry memory usage. (Val)
++Various apc.php fixes and enhancements. (Ralf, Ilia, Rasmus)
++fcntl locking robustness fixes. (Rasmus)
++Shared read-locks where possible. (Rasmus)
++Added file_update_protection configuration parameter. (Rasmus)
++Windows ZTS fixes (Frank)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.7</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-08-16</date>
++ <notes>Fix to apc.php to show final segment in frag chart. (Ilia)
++A couple of win32 fixes. (Frank)
++Add apc.enable_cli ini directive. (Rasmus)
++Add test cases. (Marcus)
++Fix apc_define_constants() bug - http://pecl.php.net/bugs/5084 (Rasmus)
++Simplify user cache handling by removing the user_cache_stack (Rasmus)
++Fix apc_fetch() memory corruption (Andrei,Rasmus)
++Added apc.max_file_size INI setting that allows exclusion of large files from being cached. Default file size limit, 1 megabyte. (Ilia)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.8</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2005-08-24</date>
++ <notes>Fix invalid free in globals destructor introduced in 3.0.7 (Rasmus)
++Cache corruption fix in cache-full cleanup code (Gopal)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.9</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2006-03-04</date>
++ <notes>Eliminate rand() call when slam_defense is not set (Rasmus)
++Fix for __isset problem (Gopal)
++Rewrite allocator from a "best fit" to a "next fit" algorithm (Rasmus)
++Added a Cache Full counter so we have an idea how many times the segment has filled up causing an expunge (Rasmus)
++Report back the correct number of available bytes in the segment instead of the allocated bytes. (Rasmus)
++Add cache busy flag which is set when an expunge is underway (Rasmus)
++Add automatic serialization of objects in apc_store() (Marcus)
++64-bit .ini flag fix (Rasmus)
++Static members fix (Gopal)
++sma_cleanup() mem leak fix (Rasmus)
++Fix for http://pecl.php.net/bugs/5311 (Rasmus)
++Fix autoglobals JIT bug (Gopal)
++Fix instance bug (Gopal)
++Add a lock cleanup safety net to request shutdown (Rasmus)
++Fix apc.slam_defense edge-case bug (Rasmus)
++User entry memory usage tracking support (Ilia)
++Allow keys used in apc_store/apc_fetch/apc_delete to be binary safe and prevent conflicts between keys that are found at the start of other keys. (Ilia)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.10</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2006-03-11</date>
++ <notes>* Add apc.stat ini flag which defaults to 1. If set to 0, the main script and any fullpath
++ includes will not be stat'ed for any changes. You will have to restart the server if you
++ change anything. This mode increases performance quite a bit, especially if you have a
++ lot of includes.
++
++* Get rid of the lock safety net hack I added in 3.0.9. It seems to cause more problems
++ than it solves. I'll need to revisit locking and signal handling at some point soon.</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.11</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2006-08-16</date>
++ <notes>* Made --enable-apc-mmap the default compile option (for real this time)
++
++* Add an optional flag to apc_cache_info() and some apc.php tweaks to make it
++ only fetch header information to make it useful when you have tens of
++ thousands of entries. (Brian Shire)
++
++* 64-bit fixes (George)
++
++* Don't mix Full Path and Inode keys (George)
++
++* Override ZEND_INCLUDE_OR_EVAL opcode (when possible) to speed up use of
++ require_once() and include_once() statements. (Sara)
++
++* Add a non-blocking write_lock for cache inserts. This is a better approach
++ to prevent cache slams and deprecates the slam_defense setting. (Rasmus)
++
++* A bit of work on the optimizer. (Sara)
++
++* Various memory issues resolved. (Gopal)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.12</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2006-09-04</date>
++ <notes>* Fix stray debug message
++
++* Work on the optimizer - still not stable (Gopal, Ilia, Sara)
++
++* Performance boost - Replace multiple loops over the opcode
++ array with a single loop for copying, jump fixups and auto
++ global pre-fetches. (Gopal)
++
++* Perform fetch_global checks only in php5 and only if
++ auto_globals_jit is enabled. (Gopal)
++
++* Fix bug #8579 - scrub php4 classes' function_table and default
++ properties before inserting into cache. (Gopal)
++
++* Fix bug #8606 - ZEND_FETCH_GLOBAL is not an opcode, but is a
++ op1->type. The opcodes applicable are ZEND_FETCH_R and
++ ZEND_FETCH_W. (Gopal)
++
++* PHP 5.2 Compatibility (Gopal)
++
++* Make the include_once override optional - default off (Sara)
++
++* Fixed crash when apc run in CLI, but enable_cli is off. (Ilia)
++
++* Ensure that the apc_globals->cache_stack is cleared before the
++ shm cache is destroyed. Fixes segfault for corner-case i.e request
++ shutdown (apc_deactivate) is not called before module shutdown
++ calls (php_apc_shutdown_globals) (Gopal)
++
++* TSRM fixes (ensure ts_free_id before apc.so is dlclosed) (Gopal)
++
++* Fix memory leak of apc_cache_info_t->deleted_list (Gopal)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.12p1</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2006-09-05</date>
++ <notes>* The only change here is a trivial PHP 4 build fix.</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.12p2</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2006-09-05</date>
++ <notes>* Let's get the version number right. 3.0.12p2 now.</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.13</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2007-02-24</date>
++ <notes>* PHP 5.2 file upload progress tracking support (Rasmus)
++* Pthread mutex and spin locks (Shire)
++* Recursive zval support for apc_fetch/_store (Shire, Gopal)
++* apc.stat_ctime flag for ctime checks (Rasmus)
++* Multiple key fetches with apc_fetch (Shire)
++* Canary checks for shm memory deallocation (Gopal)
++* Add hooks for external optimizer (Shire)
++* Obsolete and remove apc optimizer (Gopal)
++* APC info changes - cache insert rate, hit and miss rates (Shire)
++* Fix apc_load_constants (Gopal)
++* Rewrite dump opcode code to use vld (Gopal)
++* Use apc_[ewn]print functions for error reporting (Shire)
++* Auto global fixes and refactoring (Gopal, Shire)
++* Fix memory leaks in object serialization (Ilia)
++* Memory cleanup code for destructor order (Gopal)
++* Win32 build fixes (Ilia, Wez)
++* ZTS and Php 4 build fixes (Bjori)
++* Add apc_add() function (Rasmus)
++* Add optional limited flag to apc_sma_info() (Rasmus)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.14</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2007-04-02</date>
++ <notes>* Build fix (Shire)
++* Don't hook the upload hook if APC is disabled (Rasmus)
++* Local shadow cache support (Gopal)
++* Avoid uneccessary loops over op_arrays for "known" auto-globals (Gopal)
++* Fix apc_add() to overwrite timed out user entries (Rasmus)
++* Fix double inclusion of files with conditional classes in php4 (Gopal)
++* Allocator fixes to reduce fragmentation (Gopal)</notes>
++ </release>
++ <release>
++ <stability>
++ <release>stable</release>
++ <api>stable</api>
++ </stability>
++ <version>
++ <release>3.0.15</release>
++ <api>3.0.0</api>
++ </version>
++ <date>2007-10-18</date>
++ <notes>* Eliminate a per-request time() syscall (Rasmus)
++* Added rfc1867 prefix, name, and freq ini options (Shire)
++* Allow deletion of individual user cache entries via apc.php (Sara)
++* Fix overzealous cleanup during RSHUTDOWN (Gopal)
++* Fix memory alignment and locking issues (Gopal)
++* Make apc_compile insert/replace entries (Shire)
++* Make mixed inheritance recompile & cache afresh (Gopal)
++* Make nostat mode search include_path for canonicalization (Gopal)
++* ZTS & other compile fixes (Gopal, Edin, Shire)</notes>
++ </release>
++ </changelog>
++</package>
+diff -ubrN php-5.2.5-orig/ext/apc/pgsql_s_lock.c php-5.2.5/ext/apc/pgsql_s_lock.c
+--- php-5.2.5-orig/ext/apc/pgsql_s_lock.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/pgsql_s_lock.c 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,481 @@
+/*
+ +----------------------------------------------------------------------+
+#endif /* S_LOCK_TEST */
+
+#endif /* APC_SPIN_LOCKS */
-Index: php-5.2.4/ext/apc/pgsql_s_lock.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/pgsql_s_lock.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/pgsql_s_lock.h php-5.2.5/ext/apc/pgsql_s_lock.h
+--- php-5.2.5-orig/ext/apc/pgsql_s_lock.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/pgsql_s_lock.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,928 @@
+/*
+ +----------------------------------------------------------------------+
+#endif
+
+#endif /* S_LOCK_H */
-Index: php-5.2.4/ext/apc/php_apc.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/php_apc.c 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,957 @@
+diff -ubrN php-5.2.5-orig/ext/apc/php_apc.c php-5.2.5/ext/apc/php_apc.c
+--- php-5.2.5-orig/ext/apc/php_apc.c 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/php_apc.c 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,991 @@
+/*
+ +----------------------------------------------------------------------+
+ | APC |
+
+ */
+
-+/* $Id: php_apc.c,v 3.140 2007/03/28 07:14:54 gopalv Exp $ */
++/* $Id: php_apc.c,v 3.154 2007/12/26 22:31:20 rasmus Exp $ */
+
+#include "apc_zend.h"
+#include "apc_cache.h"
+#endif
+#endif
+
++#if HAVE_SIGACTION
++#include "apc_signal.h"
++#endif
++
+/* {{{ PHP_FUNCTION declarations */
+PHP_FUNCTION(apc_cache_info);
+PHP_FUNCTION(apc_clear_cache);
+ apc_globals->localcache = 0;
+ apc_globals->localcache_size = 0;
+ apc_globals->lcache = NULL;
++ apc_globals->force_file_update = 0;
++ apc_globals->coredump_unmap = 0;
+}
+
+static void php_apc_shutdown_globals(zend_apc_globals* apc_globals TSRMLS_DC)
+}
+/* }}} */
+
++#ifdef MULTIPART_EVENT_FORMDATA
++static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
++{
++ int tmp;
++ tmp = zend_atoi(new_value, new_value_length);
++ if(tmp < 0) {
++ apc_eprint("rfc1867_freq must be greater than or equal to zero.");
++ return FAILURE;
++ }
++ if(new_value[new_value_length-1] == '%') {
++ if(tmp > 100) {
++ apc_eprint("rfc1867_freq cannot be over 100%%");
++ return FAILURE;
++ }
++ APCG(rfc1867_freq) = tmp / 100.0;
++ } else {
++ APCG(rfc1867_freq) = tmp;
++ }
++ return SUCCESS;
++}
++/* }}} */
++#endif
+
+#ifdef ZEND_ENGINE_2
+#define OnUpdateInt OnUpdateLong
+STD_PHP_INI_BOOLEAN("apc.report_autofilter", "0", PHP_INI_SYSTEM, OnUpdateBool, report_autofilter,zend_apc_globals, apc_globals)
+#ifdef MULTIPART_EVENT_FORMDATA
+STD_PHP_INI_BOOLEAN("apc.rfc1867", "0", PHP_INI_SYSTEM, OnUpdateBool, rfc1867, zend_apc_globals, apc_globals)
++STD_PHP_INI_ENTRY("apc.rfc1867_prefix", "upload_", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_prefix, zend_apc_globals, apc_globals)
++STD_PHP_INI_ENTRY("apc.rfc1867_name", "APC_UPLOAD_PROGRESS", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_name, zend_apc_globals, apc_globals)
++STD_PHP_INI_ENTRY("apc.rfc1867_freq", "0", PHP_INI_SYSTEM, OnUpdateRfc1867Freq, rfc1867_freq, zend_apc_globals, apc_globals)
+#endif
+STD_PHP_INI_BOOLEAN("apc.localcache", "0", PHP_INI_SYSTEM, OnUpdateBool, localcache, zend_apc_globals, apc_globals)
+STD_PHP_INI_ENTRY("apc.localcache.size", "512", PHP_INI_SYSTEM, OnUpdateInt, localcache_size, zend_apc_globals, apc_globals)
++STD_PHP_INI_BOOLEAN("apc.coredump_unmap", "0", PHP_INI_SYSTEM, OnUpdateBool, coredump_unmap, zend_apc_globals, apc_globals)
+PHP_INI_END()
+
+/* }}} */
+#else
+ php_info_print_table_row(2, "Locking type", "File Locks");
+#endif
-+ php_info_print_table_row(2, "Revision", "$Revision: 3.140 $");
++ php_info_print_table_row(2, "Revision", "$Revision: 3.154 $");
+ php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
+ php_info_print_table_end();
+ DISPLAY_INI_ENTRIES();
+{
+ if(APCG(enabled)) {
+ apc_request_init(TSRMLS_C);
++
++#if HAVE_SIGACTION
++ apc_set_signals();
++#endif
+ }
+ return SUCCESS;
+}
+ if(ZEND_NUM_ARGS()) {
+ if(!strcasecmp(cache_type,"user")) {
+ info = apc_cache_info(apc_user_cache, limited);
++ } else if(!strcasecmp(cache_type,"filehits")) {
++#ifdef APC_FILEHITS
++ RETVAL_ZVAL(APCG(filehits), 1, 0);
++ return;
++#else
++ RETURN_FALSE;
++#endif
+ } else {
+ info = apc_cache_info(apc_cache, limited);
+ }
+ time_t t;
+ size_t mem_size = 0;
+
-+#if PHP_API_VERSION <= 20041225
++#if PHP_API_VERSION < 20041225
+#if HAVE_APACHE && defined(APC_PHP4_STAT)
+ t = ((request_rec *)SG(server_context))->request_time;
+#else
+ return;
+ }
+
-+#if PHP_API_VERSION <= 20041225
++#if PHP_API_VERSION < 20041225
+#if HAVE_APACHE && defined(APC_PHP4_STAT)
+ t = ((request_rec *)SG(server_context))->request_time;
+#else
+
+ if(!strkey_len) RETURN_FALSE;
+
-+#if PHP_API_VERSION <= 20041225
++#if PHP_API_VERSION < 20041225
+#if HAVE_APACHE && defined(APC_PHP4_STAT)
+ t = ((request_rec *)SG(server_context))->request_time;
+#else
+
+ if(!filename) RETURN_FALSE;
+
-+ /* If slam defense is active, temporarily disable */
-+ if(APCG(slam_defense)) {
-+ slam_defense = APCG(slam_defense);
-+ APCG(slam_defense) = 0;
-+ }
++ /* reset slam defense, filters, and cache_by_default */
++ slam_defense = APCG(slam_defense);
++ APCG(slam_defense) = 0;
+
-+ /* If filter is active, temporarily disable */
-+ if(APCG(filters) != NULL) {
-+ filters = APCG(filters);
-+ APCG(filters) = NULL;
-+ }
++ filters = APCG(filters);
++ APCG(filters) = NULL;
+
-+ /* If cache_by_default is off, temporarily enable */
-+ if(!APCG(cache_by_default)) {
-+ cache_by_default = APCG(cache_by_default);
-+ APCG(cache_by_default) = 1;
-+ }
++ cache_by_default = APCG(cache_by_default);
++ APCG(cache_by_default) = 1;
+
+ /* Replace function/class tables to avoid namespace conflicts */
+ zend_hash_init_ex(&cg_function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
+ zend_hash_init_ex(&cg_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
+ cg_orig_class_table = CG(class_table);
+ CG(class_table) = &cg_class_table;
-+ zend_hash_init_ex(&eg_function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
+ eg_orig_function_table = EG(function_table);
-+ EG(function_table) = &eg_function_table;
-+ zend_hash_init_ex(&eg_class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
++ EG(function_table) = CG(function_table);
+ eg_orig_class_table = EG(class_table);
-+ EG(class_table) = &eg_class_table;
++ EG(class_table) = CG(class_table);
++ APCG(force_file_update) = 1;
+
+ /* Compile the file, loading it into the cache */
+ file_handle.type = ZEND_HANDLE_FILENAME;
+ zend_try {
+ op_array = zend_compile_file(&file_handle, ZEND_INCLUDE TSRMLS_CC);
+ } zend_catch {
-+ apc_eprint("Error compiling %s in apc_compile_file.", filename);
++ apc_wprint("Error compiling %s in apc_compile_file.", filename);
+ op_array = NULL;
+ } zend_end_try();
+
+ /* Return class/function tables to previous states, destroy temp tables */
++ APCG(force_file_update) = 0;
+ CG(function_table) = cg_orig_function_table;
+ zend_hash_destroy(&cg_function_table);
+ CG(class_table) = cg_orig_class_table;
+ zend_hash_destroy(&cg_class_table);
+ EG(function_table) = eg_orig_function_table;
-+ zend_hash_destroy(&eg_function_table);
+ EG(class_table) = eg_orig_class_table;
-+ zend_hash_destroy(&eg_class_table);
+
+ /* Restore global settings */
+ APCG(slam_defense) = slam_defense;
+ PHP_FE(apc_define_constants, NULL)
+ PHP_FE(apc_load_constants, NULL)
+ PHP_FE(apc_compile_file, NULL)
++ PHP_FE(apc_add, NULL)
+ {NULL, NULL, NULL}
+};
+/* }}} */
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/php_apc.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/php_apc.h 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/php_apc.h php-5.2.5/ext/apc/php_apc.h
+--- php-5.2.5-orig/ext/apc/php_apc.h 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/php_apc.h 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,52 @@
+/*
+ +----------------------------------------------------------------------+
+ * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
+ * vim<600: expandtab sw=4 ts=4 sts=4
+ */
-Index: php-5.2.4/ext/apc/TECHNOTES.txt
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/TECHNOTES.txt 2007-09-02 12:24:46.000000000 +0200
-@@ -0,0 +1,357 @@
+diff -ubrN php-5.2.5-orig/ext/apc/TECHNOTES.txt php-5.2.5/ext/apc/TECHNOTES.txt
+--- php-5.2.5-orig/ext/apc/TECHNOTES.txt 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/TECHNOTES.txt 2007-12-26 16:51:32.000000000 -0600
+@@ -0,0 +1,361 @@
+APC Quick-Start Braindump
+
+This is a rapidly written braindump of how APC currently works in the
+
+ typedef struct block_t block_t;
+ struct block_t {
-+ int size; /* size of this block */
-+ int next; /* offset in segment of next free block */
++ size_t size; /* size of this block */
++ size_t next; /* offset in segment of next free block */
++ size_t canary; /* canary to check for memory overwrites */
++#ifdef __APC_SMA_DEBUG__
++ int id; /* identifier for the memory block */
++#endif
+ };
+
+ The BLOCKAT macro turns an offset into an actual address for you:
+If you made it to the end of this, you should have a pretty good idea of where things are in
+the code. I skimmed over a lot of things, so plan on spending some time reading through the code.
+
-Index: php-5.2.4/ext/apc/tests/apc_001.phpt
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/tests/apc_001.phpt 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/tests/apc_001.phpt php-5.2.5/ext/apc/tests/apc_001.phpt
+--- php-5.2.5-orig/ext/apc/tests/apc_001.phpt 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/tests/apc_001.phpt 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,27 @@
+--TEST--
+APC: apc_store/fetch with strings
+string(11) "hello world"
+string(4) "nice"
+===DONE===
-Index: php-5.2.4/ext/apc/tests/apc_002.phpt
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/tests/apc_002.phpt 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/tests/apc_002.phpt php-5.2.5/ext/apc/tests/apc_002.phpt
+--- php-5.2.5-orig/ext/apc/tests/apc_002.phpt 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/tests/apc_002.phpt 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,34 @@
+--TEST--
+APC: apc_store/fetch with objects
+ bool(true)
+}
+===DONE===
-Index: php-5.2.4/ext/apc/tests/apc_003.phpt
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/tests/apc_003.phpt 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/tests/apc_003.phpt php-5.2.5/ext/apc/tests/apc_003.phpt
+--- php-5.2.5-orig/ext/apc/tests/apc_003.phpt 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/tests/apc_003.phpt 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,112 @@
+--TEST--
+APC: apc_store/fetch with objects
+ bool(true)
+}
+===DONE===
-Index: php-5.2.4/ext/apc/tests/skipif.inc
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/tests/skipif.inc 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/tests/skipif.inc php-5.2.5/ext/apc/tests/skipif.inc
+--- php-5.2.5-orig/ext/apc/tests/skipif.inc 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/tests/skipif.inc 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,6 @@
+<?php
+
+//if (!ini_get('apc.enabled')) die("skip apc not enabled");
+
+?>
-Index: php-5.2.4/ext/apc/TODO
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ php-5.2.4/ext/apc/TODO 2007-09-02 12:24:46.000000000 +0200
+diff -ubrN php-5.2.5-orig/ext/apc/TODO php-5.2.5/ext/apc/TODO
+--- php-5.2.5-orig/ext/apc/TODO 1969-12-31 18:00:00.000000000 -0600
++++ php-5.2.5/ext/apc/TODO 2007-12-26 16:51:32.000000000 -0600
@@ -0,0 +1,30 @@
+Known Bugs
+