update php-apc to 3.0.16, disable pthread mutex's as they are on by default now.
authorTim Yardley <lst@openwrt.org>
Wed, 16 Jan 2008 17:30:17 +0000 (17:30 +0000)
committerTim Yardley <lst@openwrt.org>
Wed, 16 Jan 2008 17:30:17 +0000 (17:30 +0000)
SVN-Revision: 10213

lang/php5/Makefile
lang/php5/patches/005-APC.patch

index 51201df21ca3013ca9f2c8993fafa78c1bd6d101..d28e3ebeed4712a4b3bcdbcc49e6106c025cfe96 100644 (file)
@@ -270,7 +270,7 @@ else
   PKG_CONFIGURE_OPTS+= --disable-xml
 endif
 ifneq ($(CONFIG_PACKAGE_php5-mod-apc),)
   PKG_CONFIGURE_OPTS+= --disable-xml
 endif
 ifneq ($(CONFIG_PACKAGE_php5-mod-apc),)
-  PKG_CONFIGURE_OPTS+= --enable-apc --disable-apc-mmap
+  PKG_CONFIGURE_OPTS+= --enable-apc --disable-apc-mmap --disable-apc-pthreadmutex
   PKG_CONFIGURE_LIBS+= -lrt
 else
   PKG_CONFIGURE_OPTS+= --disable-apc
   PKG_CONFIGURE_LIBS+= -lrt
 else
   PKG_CONFIGURE_OPTS+= --disable-apc
index 6e2068202764634c952204c048c4d5a21b6bd610..8eb204e1c06e3a3d5ec7f7d10aec9f4d1d3bafbe 100644 (file)
@@ -1,7 +1,6 @@
-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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,554 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -34,7 +33,7 @@ Index: php-5.2.4/ext/apc/apc.c
 +
 + */
 +
 +
 + */
 +
-+/* $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 */
 +
 +#include "apc.h"
 +#include <regex.h>      /* for POSIX regular expressions */
@@ -179,7 +178,7 @@ Index: php-5.2.4/ext/apc/apc.c
 +
 +void apc_dprint(const char* fmt, ...)
 +{
 +
 +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);
 +    va_list args;
 +    va_start(args, fmt);
 +    my_log(APC_DBG, fmt, args);
@@ -557,11 +556,10 @@ Index: php-5.2.4/ext/apc/apc.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -592,7 +590,7 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +
 + */
 +
 +
 + */
 +
-+/* $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"
 +
 +#include "apc_cache.h"
 +#include "apc_lock.h"
@@ -661,6 +659,7 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +struct local_slot_t {
 +    slot_t *original;           /* the original slot in shm */
 +    int num_hits;               /* number of hits */
 +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 */
 +};
 +    apc_cache_entry_t *value;   /* shallow copy of slot->value */
 +    local_slot_t *next;         /* only for dead list */
 +};
@@ -870,6 +869,9 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +    cache_size = sizeof(header_t) + num_slots*sizeof(slot_t*);
 +
 +    cache->shmaddr = apc_sma_malloc(cache_size);
 +    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;
 +    memset(cache->shmaddr, 0, cache_size);
 +
 +    cache->header = (header_t*) cache->shmaddr;
@@ -1276,11 +1278,10 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +                       time_t t
 +                                         TSRMLS_DC)
 +{
 +                       time_t t
 +                                         TSRMLS_DC)
 +{
-+    static char canon_path[MAXPATHLEN];
 +    struct stat *tmp_buf=NULL;
 +    struct apc_fileinfo_t fileinfo = { {0}, };
 +    int len;
 +    struct stat *tmp_buf=NULL;
 +    struct apc_fileinfo_t fileinfo = { {0}, };
 +    int len;
-+      
++
 +    assert(key != NULL);
 +
 +    if (!filename || !SG(request_info).path_translated) {
 +    assert(key != NULL);
 +
 +    if (!filename || !SG(request_info).path_translated) {
@@ -1298,12 +1299,18 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +            key->mtime = t;
 +            key->type = APC_CACHE_KEY_FPFILE;
 +        } else {
 +            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;
 +            }
 +                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;
 +        }
 +            key->mtime = t;
 +            key->type = APC_CACHE_KEY_FPFILE;
 +        }
@@ -1417,7 +1424,6 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +    entry->type = APC_CACHE_ENTRY_FILE;
 +    entry->ref_count = 0;
 +    entry->mem_size = 0;
 +    entry->type = APC_CACHE_ENTRY_FILE;
 +    entry->ref_count = 0;
 +    entry->mem_size = 0;
-+    entry->autofiltered = 0;
 +    entry->local = 0;
 +    return entry;
 +}
 +    entry->local = 0;
 +    return entry;
 +}
@@ -1559,7 +1565,6 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +    entry->type = APC_CACHE_ENTRY_USER;
 +    entry->ref_count = 0;
 +    entry->mem_size = 0;
 +    entry->type = APC_CACHE_ENTRY_USER;
 +    entry->ref_count = 0;
 +    entry->mem_size = 0;
-+    entry->autofiltered = 0;
 +    entry->local = 0;
 +    return entry;
 +}
 +    entry->local = 0;
 +    return entry;
 +}
@@ -1735,7 +1740,7 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +#endif
 +
 +/* {{{ make_local_slot */
 +#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;
 +
 +{
 +    apc_cache_entry_t* value;
 +
@@ -1745,7 +1750,8 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +
 +    lslot->original = slot;
 +    lslot->value = value;
 +
 +    lslot->original = slot;
 +    lslot->value = value;
-+    lslot->num_hits++;
++    lslot->num_hits = 0;
++    lslot->creation_time = t;
 +
 +    return lslot; /* for what joy ? ... consistency */
 +}
 +
 +    return lslot; /* for what joy ? ... consistency */
 +}
@@ -1797,10 +1803,11 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +    
 +    int i;
 +    for(i = 0; i < cache->num_slots; i++) {
 +    
 +    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) {
 +                cache->generation != cache->shmcache->header->expunges) {
-+            free_local_slot(cache, &cache->slots[i]);
++            free_local_slot(cache, lslot);
 +        }
 +    }
 +
 +        }
 +    }
 +
@@ -1856,9 +1863,15 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +                free_local_slot(cache, lslot);
 +                goto not_found;
 +            }
 +                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)) {
 +            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;
 +            }
 +        }
 +                return lslot->value;
 +            }
 +        }
@@ -1875,7 +1888,7 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 +    /* 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);
 +    /* 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;
 +        return lslot->value;
 +    }
 +    return slot->value;
@@ -1890,11 +1903,10 @@ Index: php-5.2.4/ext/apc/apc_cache.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -1923,7 +1935,7 @@ Index: php-5.2.4/ext/apc/apc_cache.h
 +
 + */
 +
 +
 + */
 +
-+/* $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
 +
 +#ifndef APC_CACHE_H
 +#define APC_CACHE_H
@@ -1990,7 +2002,6 @@ Index: php-5.2.4/ext/apc/apc_cache.h
 +struct apc_cache_entry_t {
 +    apc_cache_entry_value_t data;
 +    unsigned char type;
 +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;
 +    unsigned char local;
 +    int ref_count;
 +    size_t mem_size;
@@ -2208,11 +2219,10 @@ Index: php-5.2.4/ext/apc/apc_cache.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -2243,7 +2253,7 @@ Index: php-5.2.4/ext/apc/apc_compile.c
 +
 + */
 +
 +
 + */
 +
-+/* $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"
 +
 +#include "apc_compile.h"
 +#include "apc_globals.h"
@@ -3481,11 +3491,10 @@ Index: php-5.2.4/ext/apc/apc_compile.c
 +            if((zo->opcode == ZEND_INCLUDE_OR_EVAL) && 
 +                (zo->op1.op_type == IS_CONST && zo->op1.u.constant.type == IS_STRING)) {
 +                /* constant includes */
 +            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 (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);
 +                            zend_op *dzo = &(dst->opcodes[i]);
 +                            deallocate(dzo->op1.u.constant.value.str.val);
 +                            dzo->op1.u.constant.value.str.len = strlen(fullpath);
@@ -4743,10 +4752,9 @@ Index: php-5.2.4/ext/apc/apc_compile.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,134 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -4882,10 +4890,9 @@ Index: php-5.2.4/ext/apc/apc_compile.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,57 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -4944,228 +4951,225 @@ Index: php-5.2.4/ext/apc/apc_debug.c
 +      }
 +#endif
 +}
 +      }
 +#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);
 @@ -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 @@
 @@ -0,0 +1,207 @@
-+# Microsoft Developer Studio Project File - Name="apc" - Package Owner=<4>
-+# Microsoft Developer Studio Generated Build File, Format Version 6.00
-+# ** DO NOT EDIT **
-+
-+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-+
-+CFG=apc - Win32 Debug_TS
-+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-+!MESSAGE use the Export Makefile command and run
-+!MESSAGE 
-+!MESSAGE NMAKE /f "apc.mak".
-+!MESSAGE 
-+!MESSAGE You can specify a configuration when running NMAKE
-+!MESSAGE by defining the macro CFG on the command line. For example:
-+!MESSAGE 
-+!MESSAGE NMAKE /f "apc.mak" CFG="apc - Win32 Debug_TS"
-+!MESSAGE 
-+!MESSAGE Possible choices for configuration are:
-+!MESSAGE 
-+!MESSAGE "apc - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-+!MESSAGE "apc - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-+!MESSAGE 
-+
-+# Begin Project
-+# PROP AllowPerConfigDependencies 0
-+# PROP Scc_ProjName ""
-+# PROP Scc_LocalPath ""
-+CPP=cl.exe
-+MTL=midl.exe
-+RSC=rc.exe
-+
-+!IF  "$(CFG)" == "apc - Win32 Debug_TS"
-+
-+# PROP BASE Use_MFC 0
-+# PROP BASE Use_Debug_Libraries 1
-+# PROP BASE Output_Dir "Debug_TS"
-+# PROP BASE Intermediate_Dir "Debug_TS"
-+# PROP BASE Target_Dir ""
-+# PROP Use_MFC 0
-+# PROP Use_Debug_Libraries 1
-+# PROP Output_Dir "Debug_TS"
-+# PROP Intermediate_Dir "Debug_TS"
-+# PROP Ignore_Export_Lib 0
-+# PROP Target_Dir ""
-+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /GZ /c
-+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php4" /I "..\..\..\php4\main" /I "..\..\..\php4\Zend" /I "..\..\..\php4\TSRM" /I "..\..\..\php4\win32" /I "..\..\..\php4\regex" /D "TSRM_LOCKS" /D HAVE_APC=1 /D "COMPILE_DL_APC" /D ZEND_DEBUG=1 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /GZ /c
-+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-+# ADD BASE RSC /l 0x409 /d "_DEBUG"
-+# ADD RSC /l 0x409 /d "_DEBUG"
-+BSC32=bscmake.exe
-+# ADD BASE BSC32 /nologo
-+# ADD BSC32 /nologo
-+LINK32=link.exe
-+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-+# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug_TS/php_apc.dll" /pdbtype:sept /libpath:"..\..\..\php4\Debug_TS"
-+
-+!ELSEIF  "$(CFG)" == "apc - Win32 Release_TS"
-+
-+# PROP BASE Use_MFC 0
-+# PROP BASE Use_Debug_Libraries 0
-+# PROP BASE Output_Dir "Release_TS"
-+# PROP BASE Intermediate_Dir "Release_TS"
-+# PROP BASE Target_Dir ""
-+# PROP Use_MFC 0
-+# PROP Use_Debug_Libraries 0
-+# PROP Output_Dir "Release_TS"
-+# PROP Intermediate_Dir "Release_TS"
-+# PROP Ignore_Export_Lib 0
-+# PROP Target_Dir ""
-+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /c
-+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\php4" /I "..\..\..\php4\main" /I "..\..\..\php4\Zend" /I "..\..\..\php4\TSRM" /I "..\..\..\php4\win32" /I "..\..\..\php4\regex" /D "TSRM_LOCKS" /D HAVE_APC=1 /D "COMPILE_DL_APC" /D ZEND_DEBUG=0 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /c
-+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-+# ADD BASE RSC /l 0x409 /d "NDEBUG"
-+# ADD RSC /l 0x409 /d "NDEBUG"
-+BSC32=bscmake.exe
-+# ADD BASE BSC32 /nologo
-+# ADD BSC32 /nologo
-+LINK32=link.exe
-+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-+# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../Release_TS/php_apc.dll" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline"
-+
-+!ENDIF 
-+
-+# Begin Target
-+
-+# Name "apc - Win32 Debug_TS"
-+# Name "apc - Win32 Release_TS"
-+# Begin Group "Source Files"
-+
-+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-+# Begin Source File
-+
-+SOURCE=.\apc.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_cache.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_compile.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_debug.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_fcntl_win32.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_main.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_rfc1867.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_shm.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_sma.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_stack.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_zend.c
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\php_apc.c
-+# End Source File
-+# End Group
-+# Begin Group "Header Files"
-+
-+# PROP Default_Filter "h;hpp;hxx;hm;inl"
-+# Begin Source File
-+
-+SOURCE=.\apc.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_cache.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_compile.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_debug.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_fcntl.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_globals.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_lock.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_main.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_php.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_shm.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_sma.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_stack.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\apc_zend.h
-+# End Source File
-+# Begin Source File
-+
-+SOURCE=.\php_apc.h
-+# End Source File
-+# End Group
-+# Begin Group "Resource Files"
-+
-+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-+# 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
++# Microsoft Developer Studio Project File - Name="apc" - Package Owner=<4>\r
++# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
++# ** DO NOT EDIT **\r
++\r
++# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
++\r
++CFG=apc - Win32 Debug_TS\r
++!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
++!MESSAGE use the Export Makefile command and run\r
++!MESSAGE \r
++!MESSAGE NMAKE /f "apc.mak".\r
++!MESSAGE \r
++!MESSAGE You can specify a configuration when running NMAKE\r
++!MESSAGE by defining the macro CFG on the command line. For example:\r
++!MESSAGE \r
++!MESSAGE NMAKE /f "apc.mak" CFG="apc - Win32 Debug_TS"\r
++!MESSAGE \r
++!MESSAGE Possible choices for configuration are:\r
++!MESSAGE \r
++!MESSAGE "apc - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
++!MESSAGE "apc - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
++!MESSAGE \r
++\r
++# Begin Project\r
++# PROP AllowPerConfigDependencies 0\r
++# PROP Scc_ProjName ""\r
++# PROP Scc_LocalPath ""\r
++CPP=cl.exe\r
++MTL=midl.exe\r
++RSC=rc.exe\r
++\r
++!IF  "$(CFG)" == "apc - Win32 Debug_TS"\r
++\r
++# PROP BASE Use_MFC 0\r
++# PROP BASE Use_Debug_Libraries 1\r
++# PROP BASE Output_Dir "Debug_TS"\r
++# PROP BASE Intermediate_Dir "Debug_TS"\r
++# PROP BASE Target_Dir ""\r
++# PROP Use_MFC 0\r
++# PROP Use_Debug_Libraries 1\r
++# PROP Output_Dir "Debug_TS"\r
++# PROP Intermediate_Dir "Debug_TS"\r
++# PROP Ignore_Export_Lib 0\r
++# PROP Target_Dir ""\r
++# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /GZ /c\r
++# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php4" /I "..\..\..\php4\main" /I "..\..\..\php4\Zend" /I "..\..\..\php4\TSRM" /I "..\..\..\php4\win32" /I "..\..\..\php4\regex" /D "TSRM_LOCKS" /D HAVE_APC=1 /D "COMPILE_DL_APC" /D ZEND_DEBUG=1 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /GZ /c\r
++# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
++# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
++# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
++# ADD RSC /l 0x409 /d "_DEBUG"\r
++BSC32=bscmake.exe\r
++# ADD BASE BSC32 /nologo\r
++# ADD BSC32 /nologo\r
++LINK32=link.exe\r
++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\r
++# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug_TS/php_apc.dll" /pdbtype:sept /libpath:"..\..\..\php4\Debug_TS"\r
++\r
++!ELSEIF  "$(CFG)" == "apc - Win32 Release_TS"\r
++\r
++# PROP BASE Use_MFC 0\r
++# PROP BASE Use_Debug_Libraries 0\r
++# PROP BASE Output_Dir "Release_TS"\r
++# PROP BASE Intermediate_Dir "Release_TS"\r
++# PROP BASE Target_Dir ""\r
++# PROP Use_MFC 0\r
++# PROP Use_Debug_Libraries 0\r
++# PROP Output_Dir "Release_TS"\r
++# PROP Intermediate_Dir "Release_TS"\r
++# PROP Ignore_Export_Lib 0\r
++# PROP Target_Dir ""\r
++# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /c\r
++# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\php4" /I "..\..\..\php4\main" /I "..\..\..\php4\Zend" /I "..\..\..\php4\TSRM" /I "..\..\..\php4\win32" /I "..\..\..\php4\regex" /D "TSRM_LOCKS" /D HAVE_APC=1 /D "COMPILE_DL_APC" /D ZEND_DEBUG=0 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APC_EXPORTS" /YX /FD /c\r
++# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
++# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
++# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
++# ADD RSC /l 0x409 /d "NDEBUG"\r
++BSC32=bscmake.exe\r
++# ADD BASE BSC32 /nologo\r
++# ADD BSC32 /nologo\r
++LINK32=link.exe\r
++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\r
++# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../Release_TS/php_apc.dll" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline"\r
++\r
++!ENDIF \r
++\r
++# Begin Target\r
++\r
++# Name "apc - Win32 Debug_TS"\r
++# Name "apc - Win32 Release_TS"\r
++# Begin Group "Source Files"\r
++\r
++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
++# Begin Source File\r
++\r
++SOURCE=.\apc.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_cache.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_compile.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_debug.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_fcntl_win32.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_main.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_rfc1867.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_shm.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_sma.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_stack.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_zend.c\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\php_apc.c\r
++# End Source File\r
++# End Group\r
++# Begin Group "Header Files"\r
++\r
++# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
++# Begin Source File\r
++\r
++SOURCE=.\apc.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_cache.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_compile.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_debug.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_fcntl.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_globals.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_lock.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_main.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_php.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_shm.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_sma.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_stack.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\apc_zend.h\r
++# End Source File\r
++# Begin Source File\r
++\r
++SOURCE=.\php_apc.h\r
++# End Source File\r
++# End Group\r
++# Begin Group "Resource Files"\r
++\r
++# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
++# End Group\r
++# End Target\r
++# End Project\r
+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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,118 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -5285,10 +5289,9 @@ Index: php-5.2.4/ext/apc/apc_fcntl.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,50 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -5340,10 +5343,9 @@ Index: php-5.2.4/ext/apc/apc_fcntl.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,117 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -5462,10 +5464,9 @@ Index: php-5.2.4/ext/apc/apc_fcntl_win32.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,116 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -5583,10 +5584,9 @@ Index: php-5.2.4/ext/apc/apc_futex.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,55 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -5643,11 +5643,10 @@ Index: php-5.2.4/ext/apc/apc_futex.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -5679,12 +5678,12 @@ Index: php-5.2.4/ext/apc/apc_globals.h
 +
 + */
 +
 +
 + */
 +
-+/* $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
 +
 +
 +#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"
 +
 +#include "apc_cache.h"
 +#include "apc_stack.h"
@@ -5724,6 +5723,9 @@ Index: php-5.2.4/ext/apc/apc_globals.h
 +    apc_optimize_function_t apc_optimize_function;   /* optimizer function callback */
 +#ifdef MULTIPART_EVENT_FORMDATA
 +    zend_bool rfc1867;           /* Flag to enable rfc1867 handler */
 +    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
 +#endif
 +    HashTable *copied_zvals;     /* my_copy recursion detection list */
 +#ifdef ZEND_ENGINE_2
@@ -5732,6 +5734,12 @@ Index: php-5.2.4/ext/apc/apc_globals.h
 +    zend_bool localcache;        /* enable local cache */
 +    long localcache_size;        /* size of fast cache */
 +    apc_local_cache_t* lcache;   /* unlocked local cache */
 +    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) */
 +ZEND_END_MODULE_GLOBALS(apc)
 +
 +/* (the following declaration is defined in php_apc.c) */
@@ -5758,10 +5766,9 @@ Index: php-5.2.4/ext/apc/apc_globals.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,126 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -5889,10 +5896,9 @@ Index: php-5.2.4/ext/apc/apc.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,105 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -5999,11 +6005,10 @@ Index: php-5.2.4/ext/apc/apc_lock.h
 +#endif
 +
 +#endif
 +#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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -6034,7 +6039,7 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +
 + */
 +
 +
 + */
 +
-+/* $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"
 +
 +#include "apc_php.h"
 +#include "apc_main.h"
@@ -6264,7 +6269,6 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +
 +default_compile:
 +
 +
 +default_compile:
 +
-+    cache_entry->autofiltered = 1;
 +    if(APCG(report_autofilter)) {
 +        apc_wprint("Autofiltering %s", h->opened_path);
 +    }
 +    if(APCG(report_autofilter)) {
 +        apc_wprint("Autofiltering %s", h->opened_path);
 +    }
@@ -6276,14 +6280,16 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +    }
 +    
 +    apc_stack_pop(APCG(cache_stack)); /* pop out cache_entry */
 +    }
 +    
 +    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;
 +
 +    /* 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;
 +}
 +/* }}} */
 +
 +}
 +/* }}} */
 +
@@ -6317,7 +6323,7 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +        return old_compile_file(h, type TSRMLS_CC);
 +    }
 +
 +        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 
 +#if HAVE_APACHE && defined(APC_PHP4_STAT)
 +    t = ((request_rec *)SG(server_context))->request_time;
 +#else 
@@ -6336,15 +6342,20 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +        return old_compile_file(h, type TSRMLS_CC);
 +    }
 +
 +        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 {
 +    } 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);
 +        int dummy = 1;
 +        if (h->opened_path == NULL) {
 +            h->opened_path = estrdup(cache_entry->data.file.filename);
@@ -6352,27 +6363,18 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +        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);
 +        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)) {
 +    }
 +    
 +    if(apc_cache_busy(apc_cache) && APCG(localcache)) {
@@ -6408,6 +6410,26 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +        }
 +    }
 +
 +        }
 +    }
 +
++    /* 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
 +    HANDLE_BLOCK_INTERRUPTIONS();
 +
 +#if NONBLOCKING_LOCK_AVAILABLE
@@ -6607,12 +6629,23 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +    apc_stack_clear(APCG(cache_stack));
 +    APCG(slam_rand) = -1;
 +    APCG(copied_zvals) = NULL;
 +    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);
 +    return 0;
 +}
 +
 +int apc_request_shutdown(TSRMLS_D)
 +{
 +    apc_deactivate(TSRMLS_C);
++
++#ifdef APC_FILEHITS
++    zval_ptr_dtor(&APCG(filehits));
++#endif
++
 +    return 0;
 +}
 +
 +    return 0;
 +}
 +
@@ -6635,14 +6668,6 @@ Index: php-5.2.4/ext/apc/apc_main.c
 +        apc_cache_entry_t* cache_entry =
 +            (apc_cache_entry_t*) apc_stack_pop(APCG(cache_stack));
 +
 +        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
 +        if (cache_entry->data.file.classes) {
 +            for (i = 0; cache_entry->data.file.classes[i].class_entry != NULL; i++) {
 +#ifdef ZEND_ENGINE_2
@@ -6685,10 +6710,9 @@ Index: php-5.2.4/ext/apc/apc_main.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,67 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -6757,11 +6781,10 @@ Index: php-5.2.4/ext/apc/apc_main.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -6789,7 +6812,7 @@ Index: php-5.2.4/ext/apc/apc_mmap.c
 +
 + */
 +
 +
 + */
 +
-+/* $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"
 +
 +
 +#include "apc.h"
 +
@@ -6810,7 +6833,7 @@ Index: php-5.2.4/ext/apc/apc_mmap.c
 +#define MAP_NOSYNC 0
 +#endif
 +
 +#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 */
 +
 +{
 +    void* shmaddr;  /* the shared memory address */
 +
@@ -6884,9 +6907,11 @@ Index: php-5.2.4/ext/apc/apc_mmap.c
 +    return shmaddr;
 +}
 +
 +    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
 +}
 +
 +#endif
@@ -6899,11 +6924,10 @@ Index: php-5.2.4/ext/apc/apc_mmap.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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
 +/*
 +  +----------------------------------------------------------------------+
 +<?php
 +/*
 +  +----------------------------------------------------------------------+
@@ -6928,7 +6952,7 @@ Index: php-5.2.4/ext/apc/apc.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");
 +
 +////////// READ OPTIONAL CONFIGURATION FILE ////////////
 +if (file_exists("apc.conf.php")) include("apc.conf.php");
@@ -6965,7 +6989,7 @@ Index: php-5.2.4/ext/apc/apc.php
 +
 +// rewrite $PHP_SELF to block XSS attacks
 +//
 +
 +// 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.')'; }
 +$time = time();
 +$host = getenv('HOSTNAME');
 +if($host) { $host = '('.$host.')'; }
@@ -6981,6 +7005,7 @@ Index: php-5.2.4/ext/apc/apc.php
 +$vardom=array(
 +      'OB'    => '/^\d+$/',                   // operational mode switch
 +      'CC'    => '/^[01]$/',                  // clear cache requested
 +$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
 +      'SH'    => '/^[a-z0-9]+$/',             // shared object description
 +
 +      'IMG'   => '/^[123]$/',                 // image to generate
@@ -6991,7 +7016,7 @@ Index: php-5.2.4/ext/apc/apc.php
 +      'SORT1' => '/^[AHSMCDTZ]$/',    // first sort key
 +      'SORT2' => '/^[DA]$/',                  // second sort key
 +      'AGGR'  => '/^\d+$/',                   // aggregation by dir level
 +      '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
 +);
 +
 +// default cache mode
@@ -7020,7 +7045,7 @@ Index: php-5.2.4/ext/apc/apc.php
 +foreach($vardom as $var => $dom) {
 +      if (!isset($_REQUEST[$var])) {
 +              $MYREQUEST[$var]=NULL;
 +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;
 +              $MYREQUEST[$var]=$_REQUEST[$var];
 +      } else {
 +              $MYREQUEST[$var]=$_REQUEST[$var]=NULL;
@@ -7085,6 +7110,10 @@ Index: php-5.2.4/ext/apc/apc.php
 +      apc_clear_cache($cache_mode);
 +}
 +
 +      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;
 +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;
@@ -7835,7 +7864,6 @@ Index: php-5.2.4/ext/apc/apc.php
 +      $fieldheading='User Entry Label';
 +      $fieldkey='info';
 +
 +      $fieldheading='User Entry Label';
 +      $fieldkey='info';
 +
-+
 +// -----------------------------------------------
 +// System Cache Entries               
 +// -----------------------------------------------
 +// -----------------------------------------------
 +// System Cache Entries               
 +// -----------------------------------------------
@@ -7999,9 +8027,18 @@ Index: php-5.2.4/ext/apc/apc.php
 +          else
 +            echo '<td class="td-n center">None</td>';
 +        }
 +          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"> &nbsp; </td>';
++        }
++        echo '</tr>';
 +        $i++;
 +        if ($i == $MYREQUEST['COUNT'])
 +          break;
 +        $i++;
 +        if ($i == $MYREQUEST['COUNT'])
 +          break;
@@ -8217,10 +8254,9 @@ Index: php-5.2.4/ext/apc/apc.php
 +<!-- <?php echo "\nBased on APCGUI By R.Becker\n$VERSION\n"?> -->
 +</body>
 +</html>
 +<!-- <?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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,71 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -8293,11 +8329,10 @@ Index: php-5.2.4/ext/apc/apc_php.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -8317,7 +8352,7 @@ Index: php-5.2.4/ext/apc/apc_pthreadmutex.c
 +
 + */
 +
 +
 + */
 +
-+/* $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"
 +
 +
 +#include "apc_pthreadmutex.h"
 +
@@ -8338,6 +8373,13 @@ Index: php-5.2.4/ext/apc/apc_pthreadmutex.c
 +        apc_eprint("pthread mutex error: attr is an invalid pointer.");
 +    } 
 +
 +        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) {
 +    /* pthread_mutexattr_settype(attr, PTHREAD_MUTEX_ERRORCHECK); */
 +    result = pthread_mutexattr_setpshared(attr, PTHREAD_PROCESS_SHARED);
 +    if(result == EINVAL) {
@@ -8402,10 +8444,9 @@ Index: php-5.2.4/ext/apc/apc_pthreadmutex.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,48 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -8455,11 +8496,10 @@ Index: php-5.2.4/ext/apc/apc_pthreadmutex.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -8487,11 +8527,16 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +
 + */
 +
 +
 + */
 +
-+/* $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.h"
++#include "apc_globals.h"
 +#include "rfc1867.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);
 +
 +#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);
 +
@@ -8499,7 +8544,7 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +    struct timeval a;
 +    double t;
 +    gettimeofday(&a, NULL);
 +    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;
 +}
 +
 +    return t;
 +}
 +
@@ -8513,6 +8558,8 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +    static int cancel_upload = 0;
 +    static double start_time;
 +    static size_t bytes_processed = 0;
 +    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;
 +
 +    static double rate;
 +    zval *track = NULL;
 +
@@ -8530,17 +8577,21 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +                start_time = my_time();
 +                bytes_processed = 0;
 +                rate = 0;
 +                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:
 +                      {
 +                      }
 +                      break;
 +
 +              case MULTIPART_EVENT_FORMDATA:
 +                      {
++                int prefix_len = strlen(APCG(rfc1867_prefix));
 +                multipart_event_formdata *data = (multipart_event_formdata *) event_data;
 +                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);
 +                    strlcat(tracking_key, *data->value, 63);
-+                    key_length = data->length+7;
++                    key_length = data->length + prefix_len;
 +                    bytes_processed = data->post_bytes_processed;
 +                              }
 +                      }
 +                    bytes_processed = data->post_bytes_processed;
 +                              }
 +                      }
@@ -8561,6 +8612,7 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +                add_assoc_string(track, "filename", filename, 1);
 +                add_assoc_string(track, "name", name, 1);
 +                add_assoc_long(track, "done", 0);
 +                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);
 +            }
 +                _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
 +                zval_ptr_dtor(&track);
 +            }
@@ -8577,7 +8629,11 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +                add_assoc_string(track, "filename", filename, 1);
 +                add_assoc_string(track, "name", name, 1);
 +                add_assoc_long(track, "done", 0);
 +                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;
 +                zval_ptr_dtor(&track);
 +                      }
 +                      break;
@@ -8597,6 +8653,7 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +                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_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);
 +                      }
 +                _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
 +                zval_ptr_dtor(&track);
 +                      }
@@ -8616,9 +8673,12 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 +                add_assoc_double(track, "rate", rate);
 +                add_assoc_string(track, "filename", filename, 1);
 +                add_assoc_string(track, "name", name, 1);
 +                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_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);
 +                      }
 +                _apc_store(tracking_key, key_length, track, 3600, 0 TSRMLS_CC);
 +                zval_ptr_dtor(&track);
 +                      }
@@ -8635,10 +8695,9 @@ Index: php-5.2.4/ext/apc/apc_rfc1867.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,177 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -8817,10 +8876,9 @@ Index: php-5.2.4/ext/apc/apc_sem.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,51 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -8873,11 +8931,10 @@ Index: php-5.2.4/ext/apc/apc_sem.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -8906,11 +8963,10 @@ Index: php-5.2.4/ext/apc/apc_shm.c
 +
 + */
 +
 +
 + */
 +
-+/* $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 "apc_shm.h"
 +#include "apc.h"
-+#include <sys/types.h>
 +#ifdef PHP_WIN32
 +/* shm functions are available in TSRM */
 +#include <tsrm/tsrm_win32.h>
 +#ifdef PHP_WIN32
 +/* shm functions are available in TSRM */
 +#include <tsrm/tsrm_win32.h>
@@ -8928,7 +8984,7 @@ Index: php-5.2.4/ext/apc/apc_shm.c
 +# define SHM_A 0222 /* write permission */
 +#endif
 +
 +# 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 */
 +{
 +    int shmid;  /* shared memory id */
 +    int oflag;  /* permissions on shm */
@@ -8989,11 +9045,10 @@ Index: php-5.2.4/ext/apc/apc_shm.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -9021,14 +9076,19 @@ Index: php-5.2.4/ext/apc/apc_shm.h
 +
 + */
 +
 +
 + */
 +
-+/* $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
 +
 +
 +#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 */
 +
 +/* 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);
 +extern void apc_shm_destroy(int shmid);
 +extern void* apc_shm_attach(int shmid);
 +extern void apc_shm_detach(void* shmaddr);
@@ -9043,11 +9103,246 @@ Index: php-5.2.4/ext/apc/apc_shm.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -9076,7 +9371,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +
 + */
 +
 +
 + */
 +
-+/* $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_sma.h"
 +#include "apc.h"
@@ -9085,8 +9380,8 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +#include "apc_shm.h"
 +#include <limits.h>
 +#if APC_MMAP
 +#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 */
 +#endif
 +
 +/* {{{ locking macros */
@@ -9100,7 +9395,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +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_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 */
 +
 +static void** sma_shmaddrs;         /* array of shm segment addresses */
 +static int sma_lastseg = 0;         /* index of MRU segment */
 +
@@ -9200,8 +9495,13 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +    /* If we have a next fit offset, start searching from there */
 +    if(header->nfoffset) {
 +        prv = BLOCKAT(header->nfoffset);
 +    /* 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 {    
 +    } else {    
-+        prv = BLOCKAT(sizeof(header_t));
++        prv = BLOCKAT(ALIGNWORD(sizeof(header_t)));
 +    }
 +   
 +    CHECK_CANARY(prv);
 +    }
 +   
 +    CHECK_CANARY(prv);
@@ -9222,7 +9522,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +
 +        /* Check to see if we need to wrap around and search from the top */
 +        if(header->nfoffset && prv->next == 0) {
 +
 +        /* 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
 +#ifdef __APC_SMA_DEBUG__
 +            CHECK_CANARY(prv);
 +#endif
@@ -9297,7 +9597,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +
 +    /* find position of new block in free list */
 +    cur = BLOCKAT(offset);
 +
 +    /* 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);
 +
 +   
 +    CHECK_CANARY(cur);
 +
@@ -9356,7 +9656,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +
 +/* {{{ apc_sma_init */
 +
 +
 +/* {{{ 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;
 +
 +{
 +    int i;
 +
@@ -9383,7 +9683,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +
 +    sma_segsize = segsize > 0 ? segsize : DEFAULT_SEGSIZE;
 +
 +
 +    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++) {
 +    sma_shmaddrs = (void**) apc_emalloc(sma_numseg*sizeof(void*));
 +    
 +    for (i = 0; i < sma_numseg; i++) {
@@ -9404,8 +9704,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +        header = (header_t*) shmaddr;
 +        apc_lck_create(NULL, 0, 1, header->sma_lock);
 +        header->segsize = sma_segsize;
 +        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
 +              {
 +        header->nfoffset = 0;
 +#if ALLOC_DISTRIBUTION
 +              {
@@ -9413,9 +9712,9 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +           for(j=0; j<30; j++) header->adist[j] = 0; 
 +        }
 +#endif 
 +           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->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;
 +        SET_CANARY(block);
 +#ifdef __APC_SMA_DEBUG__
 +        block->id = -1;
@@ -9472,10 +9771,10 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +    UNLOCK(((header_t*)sma_shmaddrs[sma_lastseg])->sma_lock);
 +
 +    for (i = 0; i < sma_numseg; i++) {
 +    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;
 +        }
 +        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);
 +        off = sma_allocate(sma_shmaddrs[i], n);
 +        if (off != -1) {
 +            void* p = (void *)(((char *)(sma_shmaddrs[i])) + off);
@@ -9560,7 +9859,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +
 +    info = (apc_sma_info_t*) apc_emalloc(sizeof(apc_sma_info_t));
 +    info->num_seg = sma_numseg;
 +
 +    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++) {
 +
 +    info->list = apc_emalloc(info->num_seg * sizeof(apc_sma_link_t*));
 +    for (i = 0; i < sma_numseg; i++) {
@@ -9573,7 +9872,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +    for (i = 0; i < sma_numseg; i++) {
 +        RDLOCK(((header_t*)sma_shmaddrs[i])->sma_lock);
 +        shmaddr = sma_shmaddrs[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];
 +
 +
 +        link = &info->list[i];
 +
@@ -9618,9 +9917,9 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +/* }}} */
 +
 +/* {{{ apc_sma_get_avail_mem */
 +/* }}} */
 +
 +/* {{{ 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++) {
 +    int i;
 +    
 +    for (i = 0; i < sma_numseg; i++) {
@@ -9648,7 +9947,7 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 +    for (i = 0; i < sma_numseg; i++) {
 +        char* shmaddr = sma_shmaddrs[i];
 +        header_t* header = (header_t*) shmaddr;
 +    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 */
 +        int avail = 0;
 +
 +        /* For each block in this segment */
@@ -9672,10 +9971,9 @@ Index: php-5.2.4/ext/apc/apc_sma.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,82 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -9704,7 +10002,7 @@ Index: php-5.2.4/ext/apc/apc_sma.h
 +
 + */
 +
 +
 + */
 +
-+/* $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
 +
 +#ifndef APC_SMA_H
 +#define APC_SMA_H
@@ -9715,7 +10013,7 @@ Index: php-5.2.4/ext/apc/apc_sma.h
 +
 +/* Simple shared memory allocator */
 +
 +
 +/* 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);
 +extern void apc_sma_cleanup();
 +extern void* apc_sma_malloc(size_t size);
 +extern void* apc_sma_realloc(void* p, size_t size);
@@ -9728,8 +10026,8 @@ Index: php-5.2.4/ext/apc/apc_sma.h
 +/* {{{ struct definition: apc_sma_link_t */
 +typedef struct apc_sma_link_t apc_sma_link_t;
 +struct apc_sma_link_t {
 +/* {{{ 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 */
 +};
 +/* }}} */
 +    apc_sma_link_t* next;   /* link to next free block */
 +};
 +/* }}} */
@@ -9738,7 +10036,7 @@ Index: php-5.2.4/ext/apc/apc_sma.h
 +typedef struct apc_sma_info_t apc_sma_info_t;
 +struct apc_sma_info_t {
 +    int num_seg;            /* number of shared memory segments */
 +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 */
 +};
 +/* }}} */
 +    apc_sma_link_t** list;  /* there is one list per segment */
 +};
 +/* }}} */
@@ -9746,7 +10044,7 @@ Index: php-5.2.4/ext/apc/apc_sma.h
 +extern apc_sma_info_t* apc_sma_info(zend_bool limited);
 +extern void apc_sma_free_info(apc_sma_info_t* info);
 +
 +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
 +extern void apc_sma_check_integrity();
 +
 +#endif
@@ -9759,10 +10057,9 @@ Index: php-5.2.4/ext/apc/apc_sma.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,65 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -9829,10 +10126,9 @@ Index: php-5.2.4/ext/apc/apc_spin.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,48 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -9882,10 +10178,9 @@ Index: php-5.2.4/ext/apc/apc_spin.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,105 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -9992,10 +10287,9 @@ Index: php-5.2.4/ext/apc/apc_stack.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,58 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -10055,10 +10349,9 @@ Index: php-5.2.4/ext/apc/apc_stack.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,277 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -10337,10 +10630,9 @@ Index: php-5.2.4/ext/apc/apc_zend.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,53 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -10395,11 +10687,238 @@ Index: php-5.2.4/ext/apc/apc_zend.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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)
 +3.0.14: 2007-03-21
 +- Build fix (Shire)
 +- Don't hook the upload hook if APC is disabled (Rasmus)
@@ -10592,13 +11111,12 @@ Index: php-5.2.4/ext/apc/CHANGELOG
 +
 +1.0.1:
 +- added optional file modification time check [djc 2001-01-12]
 +
 +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
-+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)
 +dnl
 +
 +AC_MSG_CHECKING(whether apc needs to get compiler flags from apxs)
@@ -10646,6 +11164,20 @@ Index: php-5.2.4/ext/apc/config.m4
 +PHP_ARG_ENABLE(apc, whether to enable APC support,
 +[  --enable-apc           Enable APC support])
 +
 +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 mmap)
 +AC_ARG_ENABLE(apc-mmap,
 +[  --disable-apc-mmap
@@ -10689,15 +11221,15 @@ Index: php-5.2.4/ext/apc/config.m4
 +
 +AC_MSG_CHECKING(Checking whether we should use pthread mutex locking)
 +AC_ARG_ENABLE(apc-pthreadmutex,
 +
 +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=no
 +  AC_MSG_RESULT(no)
++],
++[
++  PHP_APC_PTHREADMUTEX=yes
++  AC_MSG_RESULT(yes)
 +])
 +if test "$PHP_APC_PTHREADMUTEX" != "no"; then
 +      orig_LIBS="$LIBS"
 +])
 +if test "$PHP_APC_PTHREADMUTEX" != "no"; then
 +      orig_LIBS="$LIBS"
@@ -10715,7 +11247,7 @@ Index: php-5.2.4/ext/apc/config.m4
 +                                      return -1; 
 +                              }
 +                              if(pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) { 
 +                                      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)) { 
 +                                      return -1; 
 +                              }       
 +                              if(pthread_mutex_init(&mutex, &attr)) { 
@@ -10739,7 +11271,8 @@ Index: php-5.2.4/ext/apc/config.m4
 +                              PHP_ADD_LIBRARY(pthread)
 +                      ],
 +                      [ dnl -Failure-
 +                              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)
 +                      ],
 +                      [
 +                              PHP_ADD_LIBRARY(pthread)
@@ -10763,11 +11296,19 @@ Index: php-5.2.4/ext/apc/config.m4
 +
 +if test "$PHP_APC" != "no"; then
 +  test "$PHP_APC_MMAP" != "no" && AC_DEFINE(APC_MMAP, 1, [ ])
 +
 +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([
 +  AC_CACHE_CHECK(for union semun, php_cv_semun,
 +  [
 +    AC_TRY_COMPILE([
@@ -10797,12 +11338,13 @@ Index: php-5.2.4/ext/apc/config.m4
 +               apc_shm.c \
 +               apc_futex.c \
 +               apc_pthreadmutex.c \
 +               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_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))
 +
 +  PHP_CHECK_LIBRARY(rt, shm_open, [PHP_ADD_LIBRARY(rt,,APC_SHARED_LIBADD)])
 +  PHP_NEW_EXTENSION(apc, $apc_sources, $ext_shared,, \\$(APC_CFLAGS))
@@ -10811,11 +11353,10 @@ Index: php-5.2.4/ext/apc/config.m4
 +  AC_DEFINE(HAVE_APC, 1, [ ])
 +fi
 +
 +  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
 +---------------------------------
 +
 +Installation Instructions for APC
 +---------------------------------
 +
@@ -11209,6 +11750,23 @@ Index: php-5.2.4/ext/apc/INSTALL
 +                            still going will disable the tracking for the previous.
 +                            (Default: 0)
 +
 +                            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)
 +    apc.localcache          This enables a lock-free local process shadow-cache which 
 +                            reduces lock contention when the cache is being written to.
 +                            (Default: 0)
@@ -11221,10 +11779,9 @@ Index: php-5.2.4/ext/apc/INSTALL
 +                            Optimize include_once and require_once calls and avoid the 
 +                            expensive system calls used.
 +                            (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
 @@ -0,0 +1,68 @@
 +-------------------------------------------------------------------- 
 +                  The PHP License, version 3.01
@@ -11294,10 +11851,9 @@ Index: php-5.2.4/ext/apc/LICENSE
 +
 +PHP includes the Zend Engine, freely available at
 +<http://www.zend.com>.
 +
 +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.
 +
 @@ -0,0 +1,43 @@
 +This is the NOTICE file that holds acknowledgements and stuff.
 +
@@ -11342,10 +11898,547 @@ Index: php-5.2.4/ext/apc/NOTICE
 +    Angel Li            diffs for ANSI comment compliance
 +    Christian Rishøj    help debugging phplib problems
 +    Sascha Schumann     memory error bug fix
 +    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(&apos;filehits&apos;) (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-&gt;filename to use APC. (Rasmus)
++Support extensions such as bcompiler that need to hook into compile_file. (Val)
++Ralf Becker&apos;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 &quot;best fit&quot; to a &quot;next fit&quot; 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&apos;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&apos;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&apos;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&apos; function_table and default
++  properties before inserting into cache. (Gopal)
++
++* Fix bug #8606 - ZEND_FETCH_GLOBAL is not an opcode, but is a 
++  op1-&gt;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-&gt;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-&gt;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&apos;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&apos;t hook the upload hook if APC is disabled (Rasmus)
++* Local shadow cache support (Gopal)
++* Avoid uneccessary loops over op_arrays for &quot;known&quot; 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 &amp; cache afresh  (Gopal)
++* Make nostat mode search include_path for canonicalization (Gopal)
++* ZTS &amp; 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,481 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -11828,10 +12921,9 @@ Index: php-5.2.4/ext/apc/pgsql_s_lock.c
 +#endif   /* S_LOCK_TEST */
 +
 +#endif /* APC_SPIN_LOCKS */
 +#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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,928 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -12761,11 +13853,10 @@ Index: php-5.2.4/ext/apc/pgsql_s_lock.h
 +#endif
 +
 +#endif         /* S_LOCK_H */
 +#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                                                                  |
 +/*
 +  +----------------------------------------------------------------------+
 +  | APC                                                                  |
@@ -12794,7 +13885,7 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +
 + */
 +
 +
 + */
 +
-+/* $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"
 +
 +#include "apc_zend.h"
 +#include "apc_cache.h"
@@ -12816,6 +13907,10 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +#endif
 +#endif
 +
 +#endif
 +#endif
 +
++#if HAVE_SIGACTION
++#include "apc_signal.h"
++#endif
++
 +/* {{{ PHP_FUNCTION declarations */
 +PHP_FUNCTION(apc_cache_info);
 +PHP_FUNCTION(apc_clear_cache);
 +/* {{{ PHP_FUNCTION declarations */
 +PHP_FUNCTION(apc_cache_info);
 +PHP_FUNCTION(apc_clear_cache);
@@ -12860,6 +13955,8 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +    apc_globals->localcache = 0;
 +    apc_globals->localcache_size = 0;
 +    apc_globals->lcache = NULL;
 +    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)
 +}
 +
 +static void php_apc_shutdown_globals(zend_apc_globals* apc_globals TSRMLS_DC)
@@ -12907,6 +14004,28 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +}
 +/* }}} */
 +
 +}
 +/* }}} */
 +
++#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
 +
 +#ifdef ZEND_ENGINE_2
 +#define OnUpdateInt OnUpdateLong
@@ -12937,9 +14056,13 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +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_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)
 +#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()
 +
 +/* }}} */
 +PHP_INI_END()
 +
 +/* }}} */
@@ -12967,7 +14090,7 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +#else
 +    php_info_print_table_row(2, "Locking type", "File Locks");
 +#endif
 +#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();
 +    php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
 +    php_info_print_table_end();
 +    DISPLAY_INI_ENTRIES();
@@ -13034,6 +14157,10 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +{
 +    if(APCG(enabled)) {
 +        apc_request_init(TSRMLS_C);
 +{
 +    if(APCG(enabled)) {
 +        apc_request_init(TSRMLS_C);
++
++#if HAVE_SIGACTION
++        apc_set_signals();
++#endif
 +    }
 +    return SUCCESS;
 +}
 +    }
 +    return SUCCESS;
 +}
@@ -13066,6 +14193,13 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +    if(ZEND_NUM_ARGS()) {
 +        if(!strcasecmp(cache_type,"user")) {
 +            info = apc_cache_info(apc_user_cache, limited);
 +    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);
 +        }
 +        } else {
 +            info = apc_cache_info(apc_cache, limited);
 +        }
@@ -13271,7 +14405,7 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +    time_t t;
 +    size_t mem_size = 0;
 +
 +    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
 +#if HAVE_APACHE && defined(APC_PHP4_STAT)
 +    t = ((request_rec *)SG(server_context))->request_time;
 +#else
@@ -13406,7 +14540,7 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +        return;
 +    }
 +
 +        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 HAVE_APACHE && defined(APC_PHP4_STAT)
 +    t = ((request_rec *)SG(server_context))->request_time;
 +#else 
@@ -13563,7 +14697,7 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +
 +    if(!strkey_len) RETURN_FALSE;
 +
 +
 +    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 HAVE_APACHE && defined(APC_PHP4_STAT)
 +    t = ((request_rec *)SG(server_context))->request_time;
 +#else 
@@ -13606,23 +14740,15 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +
 +    if(!filename) RETURN_FALSE;
 +
 +
 +    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);
 +
 +    /* Replace function/class tables to avoid namespace conflicts */
 +    zend_hash_init_ex(&cg_function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
@@ -13631,12 +14757,11 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +    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(&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_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_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;
 +    
 +    /* Compile the file, loading it into the cache */
 +    file_handle.type = ZEND_HANDLE_FILENAME;
@@ -13646,19 +14771,18 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +    zend_try {
 +        op_array = zend_compile_file(&file_handle, ZEND_INCLUDE TSRMLS_CC);
 +    } zend_catch {
 +    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 */
 +        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;
 +    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;
 +    EG(class_table) = eg_orig_class_table;
-+    zend_hash_destroy(&eg_class_table);
 +    
 +    /* Restore global settings */
 +    APCG(slam_defense) = slam_defense;
 +    
 +    /* Restore global settings */
 +    APCG(slam_defense) = slam_defense;
@@ -13691,6 +14815,7 @@ Index: php-5.2.4/ext/apc/php_apc.c
 +      PHP_FE(apc_define_constants,    NULL)
 +      PHP_FE(apc_load_constants,      NULL)
 +      PHP_FE(apc_compile_file,        NULL)
 +      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}
 +};
 +/* }}} */
 +      {NULL,          NULL,                           NULL}
 +};
 +/* }}} */
@@ -13723,10 +14848,9 @@ Index: php-5.2.4/ext/apc/php_apc.c
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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 @@
 +/*
 +  +----------------------------------------------------------------------+
 @@ -0,0 +1,52 @@
 +/*
 +  +----------------------------------------------------------------------+
@@ -13780,11 +14904,10 @@ Index: php-5.2.4/ext/apc/php_apc.h
 + * vim600: expandtab sw=4 ts=4 sts=4 fdm=marker
 + * vim<600: expandtab sw=4 ts=4 sts=4
 + */
 + * 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
 +APC Quick-Start Braindump
 +
 +This is a rapidly written braindump of how APC currently works in the
@@ -13870,8 +14993,12 @@ Index: php-5.2.4/ext/apc/TECHNOTES.txt
 +
 +     typedef struct block_t block_t;
 +     struct block_t {
 +
 +     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:
 +     };
 +
 +   The BLOCKAT macro turns an offset into an actual address for you:
@@ -14142,10 +15269,9 @@ Index: php-5.2.4/ext/apc/TECHNOTES.txt
 +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.
 +
 +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
 @@ -0,0 +1,27 @@
 +--TEST--
 +APC: apc_store/fetch with strings
@@ -14174,10 +15300,9 @@ Index: php-5.2.4/ext/apc/tests/apc_001.phpt
 +string(11) "hello world"
 +string(4) "nice"
 +===DONE===
 +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
 @@ -0,0 +1,34 @@
 +--TEST--
 +APC: apc_store/fetch with objects
@@ -14213,10 +15338,9 @@ Index: php-5.2.4/ext/apc/tests/apc_002.phpt
 +  bool(true)
 +}
 +===DONE===
 +  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
 @@ -0,0 +1,112 @@
 +--TEST--
 +APC: apc_store/fetch with objects
@@ -14330,10 +15454,9 @@ Index: php-5.2.4/ext/apc/tests/apc_003.phpt
 +  bool(true)
 +}
 +===DONE===
 +  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
 +
 @@ -0,0 +1,6 @@
 +<?php
 +
@@ -14341,10 +15464,9 @@ Index: php-5.2.4/ext/apc/tests/skipif.inc
 +//if (!ini_get('apc.enabled')) die("skip apc not enabled");
 +
 +?>
 +//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
 + 
 @@ -0,0 +1,30 @@
 +Known Bugs
 +