++ if (!sma_initialized) {
++ return NULL;
++ }
++
++ info = (apc_sma_info_t*) apc_emalloc(sizeof(apc_sma_info_t));
++ info->num_seg = sma_numseg;
++ info->seg_size = sma_segsize - (ALIGNWORD(sizeof(sma_header_t)) + ALIGNWORD(sizeof(block_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[i] = NULL;
++ }
++
++ if(limited) return info;
++
++ /* For each segment */
++ for (i = 0; i < sma_numseg; i++) {
++ RDLOCK(SMA_LCK(i));
++ shmaddr = SMA_ADDR(i);
++ prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t)));
++
++ link = &info->list[i];
++
++ /* For each block in this segment */
++ while (BLOCKAT(prv->fnext)->fnext != 0) {
++ block_t* cur = BLOCKAT(prv->fnext);
++#ifdef __APC_SMA_DEBUG__
++ CHECK_CANARY(cur);
++#endif
++
++ *link = apc_emalloc(sizeof(apc_sma_link_t));
++ (*link)->size = cur->size;
++ (*link)->offset = prv->fnext;
++ (*link)->next = NULL;
++ link = &(*link)->next;
++
++ prv = cur;
++
++#if ALLOC_DISTRIBUTION
++ sma_header_t* header = (sma_header_t*) segment->shmaddr;
++ memcpy(info->seginfo[i].adist, header->adist, sizeof(size_t) * 30);
++#endif
++
++ }
++ UNLOCK(SMA_LCK(i));
++ }
++
++ return info;
++}
++/* }}} */
++
++/* {{{ apc_sma_free_info */
++void apc_sma_free_info(apc_sma_info_t* info)
++{
++ int i;
++
++ for (i = 0; i < info->num_seg; i++) {
++ apc_sma_link_t* p = info->list[i];
++ while (p) {
++ apc_sma_link_t* q = p;
++ p = p->next;
++ apc_efree(q);
++ }
++ }
++ apc_efree(info->list);
++ apc_efree(info);
++}
++/* }}} */
++
++/* {{{ apc_sma_get_avail_mem */
++size_t apc_sma_get_avail_mem()
++{
++ size_t avail_mem = 0;
++ uint i;
++
++ for (i = 0; i < sma_numseg; i++) {
++ sma_header_t* header = SMA_HDR(i);
++ avail_mem += header->avail;
++ }
++ return avail_mem;
++}
++/* }}} */
++
++#if ALLOC_DISTRIBUTION
++size_t *apc_sma_get_alloc_distribution(void) {
++ sma_header_t* header = (sma_header_t*) segment->sma_shmaddr;
++ return header->adist;
++}
++#endif
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/apc_sma.h php-5.3.1/ext/apc/apc_sma.h
+--- php-5.3.1.orig/ext/apc/apc_sma.h 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/apc_sma.h 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,102 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006-2008 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: Daniel Cowgill <dcowgill@communityconnect.com> |
++ +----------------------------------------------------------------------+
++
++ This software was contributed to PHP by Community Connect Inc. in 2002
++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
++ Future revisions and derivatives of this source code must acknowledge
++ Community Connect 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_sma.h 277617 2009-03-23 02:16:24Z shire $ */
++
++#ifndef APC_SMA_H
++#define APC_SMA_H
++
++#define ALLOC_DISTRIBUTION 0
++
++#include "apc.h"
++
++/* Simple shared memory allocator */
++
++typedef struct _apc_segment_t apc_segment_t;
++
++struct _apc_segment_t {
++ size_t size;
++ void* shmaddr;
++#ifdef APC_MEMPROTECT
++ void* roaddr;
++#endif
++};
++
++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_malloc_ex(size_t size, size_t fragment, size_t* allocated);
++extern void* apc_sma_realloc(void* p, size_t size);
++extern char* apc_sma_strdup(const char *s);
++extern void apc_sma_free(void* p);
++#if ALLOC_DISTRIBUTION
++extern size_t *apc_sma_get_alloc_distribution();
++#endif
++
++extern void* apc_sma_protect(void *p);
++extern void* apc_sma_unprotect(void *p);
++
++/* {{{ struct definition: apc_sma_link_t */
++typedef struct apc_sma_link_t apc_sma_link_t;
++struct apc_sma_link_t {
++ 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 */
++};
++/* }}} */
++
++/* {{{ struct definition: apc_sma_info_t */
++typedef struct apc_sma_info_t apc_sma_info_t;
++struct apc_sma_info_t {
++ int num_seg; /* number of shared memory segments */
++ size_t seg_size; /* size of each shared memory segment */
++ apc_sma_link_t** list; /* there is one list per segment */
++};
++/* }}} */
++
++extern apc_sma_info_t* apc_sma_info(zend_bool limited);
++extern void apc_sma_free_info(apc_sma_info_t* info);
++
++extern size_t apc_sma_get_avail_mem();
++extern void apc_sma_check_integrity();
++
++/* {{{ ALIGNWORD: pad up x, aligned to the system's word boundary */
++typedef union { void* p; int i; long l; double d; void (*f)(); } apc_word_t;
++#define ALIGNSIZE(x, size) ((size) * (1 + (((x)-1)/(size))))
++#define ALIGNWORD(x) ALIGNSIZE(x, sizeof(apc_word_t))
++/* }}} */
++
++#endif
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/apc_spin.c php-5.3.1/ext/apc/apc_spin.c
+--- php-5.3.1.orig/ext/apc/apc_spin.c 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/apc_spin.c 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,66 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2007-2008 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: apc_spin.c 268255 2008-11-04 05:42:11Z rasmus $ */
++
++#include "apc_spin.h"
++
++#ifdef APC_SPIN_LOCKS
++
++slock_t *apc_slock_create(slock_t *lock)
++{
++ S_INIT_LOCK(lock);
++ return lock;
++}
++
++void apc_slock_destroy(slock_t *lock)
++{
++ return;
++}
++
++void apc_slock_lock(slock_t *lock)
++{
++ S_LOCK(lock);
++}
++
++void apc_slock_unlock(slock_t *lock)
++{
++ S_UNLOCK(lock);
++}
++
++zend_bool apc_slock_nonblocking_lock(slock_t *lock)
++{
++ /* Technically we aren't supposed to call this directly, but the original
++ * code provides no method for absolute non-blocking locks, so we'll call into
++ * the TAS (test and set) functionality directly
++ */
++ return !(TAS(lock)); /* if TAS returns 0 we obtained the lock, otherwise we failed */
++}
++
++
++#endif
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/apc_spin.h php-5.3.1/ext/apc/apc_spin.h
+--- php-5.3.1.orig/ext/apc/apc_spin.h 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/apc_spin.h 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,49 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2007-2008 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: apc_spin.h 268255 2008-11-04 05:42:11Z rasmus $ */
++
++#ifndef APC_SPIN_H
++#define APC_SPIN_H
++
++#include "apc.h"
++
++#ifdef APC_SPIN_LOCKS
++
++#include "pgsql_s_lock.h"
++
++slock_t *apc_slock_create(slock_t *lock);
++void apc_slock_destroy(slock_t *lock);
++void apc_slock_lock(slock_t *lock);
++zend_bool apc_slock_nonblocking_lock(slock_t *lock);
++void apc_slock_lock(slock_t *lock);
++void apc_slock_unlock(slock_t *lock);
++
++#endif
++
++#endif
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/apc_stack.c php-5.3.1/ext/apc/apc_stack.c
+--- php-5.3.1.orig/ext/apc/apc_stack.c 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/apc_stack.c 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,106 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006-2008 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: Daniel Cowgill <dcowgill@communityconnect.com> |
++ +----------------------------------------------------------------------+
++
++ This software was contributed to PHP by Community Connect Inc. in 2002
++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
++ Future revisions and derivatives of this source code must acknowledge
++ Community Connect 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_stack.c 268255 2008-11-04 05:42:11Z rasmus $ */
++
++#include "apc_stack.h"
++#include "apc.h"
++
++struct apc_stack_t {
++ void** data;
++ int capacity;
++ int size;
++};
++
++apc_stack_t* apc_stack_create(int size_hint)
++{
++ apc_stack_t* stack = (apc_stack_t*) apc_emalloc(sizeof(apc_stack_t));
++
++ stack->capacity = (size_hint > 0) ? size_hint : 10;
++ stack->size = 0;
++ stack->data = (void**) apc_emalloc(sizeof(void*) * stack->capacity);
++
++ return stack;
++}
++
++void apc_stack_destroy(apc_stack_t* stack)
++{
++ if (stack != NULL) {
++ apc_efree(stack->data);
++ apc_efree(stack);
++ }
++}
++
++void apc_stack_clear(apc_stack_t* stack)
++{
++ assert(stack != NULL);
++ stack->size = 0;
++}
++
++void apc_stack_push(apc_stack_t* stack, void* item)
++{
++ assert(stack != NULL);
++ if (stack->size == stack->capacity) {
++ stack->capacity *= 2;
++ stack->data = apc_erealloc(stack->data, sizeof(void*)*stack->capacity);
++ }
++ stack->data[stack->size++] = item;
++}
++
++void* apc_stack_pop(apc_stack_t* stack)
++{
++ assert(stack != NULL && stack->size > 0);
++ return stack->data[--stack->size];
++}
++
++void* apc_stack_top(apc_stack_t* stack)
++{
++ assert(stack != NULL && stack->size > 0);
++ return stack->data[stack->size-1];
++}
++
++void* apc_stack_get(apc_stack_t* stack, int n)
++{
++ assert(stack != NULL && stack->size > n);
++ return stack->data[n];
++}
++
++int apc_stack_size(apc_stack_t* stack)
++{
++ assert(stack != NULL);
++ return stack->size;
++}
++
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/apc_stack.h php-5.3.1/ext/apc/apc_stack.h
+--- php-5.3.1.orig/ext/apc/apc_stack.h 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/apc_stack.h 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,58 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006-2008 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: Daniel Cowgill <dcowgill@communityconnect.com> |
++ | George Schlossnagle <george@omniti.com> |
++ +----------------------------------------------------------------------+
++
++ This software was contributed to PHP by Community Connect Inc. in 2002
++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
++ Future revisions and derivatives of this source code must acknowledge
++ Community Connect 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_stack.h 268255 2008-11-04 05:42:11Z rasmus $ */
++
++#ifndef APC_STACK_H
++#define APC_STACK_H
++
++/* Basic stack datatype */
++
++#define T apc_stack_t*
++typedef struct apc_stack_t apc_stack_t; /* opaque stack type */
++
++extern T apc_stack_create(int size_hint);
++extern void apc_stack_destroy(T stack);
++extern void apc_stack_clear(T stack);
++extern void apc_stack_push(T stack, void* item);
++extern void* apc_stack_pop(T stack);
++extern void* apc_stack_top(T stack);
++extern void* apc_stack_get(T stack, int n);
++extern int apc_stack_size(T stack);
++
++#undef T
++#endif
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/apc_zend.c php-5.3.1/ext/apc/apc_zend.c
+--- php-5.3.1.orig/ext/apc/apc_zend.c 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/apc_zend.c 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,213 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006-2008 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: Daniel Cowgill <dcowgill@communityconnect.com> |
++ +----------------------------------------------------------------------+
++
++ This software was contributed to PHP by Community Connect Inc. in 2002
++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
++ Future revisions and derivatives of this source code must acknowledge
++ Community Connect 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_zend.c 276053 2009-02-18 08:59:00Z gopalv $ */
++
++#include "apc_zend.h"
++#include "apc_globals.h"
++
++/* true global */
++int apc_reserved_offset;
++
++void* apc_php_malloc(size_t n)
++{
++ return emalloc(n);
++}
++
++void apc_php_free(void* p)
++{
++ efree(p);
++}
++
++#ifdef APC_OPCODE_OVERRIDE
++
++static opcode_handler_t *apc_original_opcode_handlers;
++static opcode_handler_t apc_opcode_handlers[APC_OPCODE_HANDLER_COUNT];
++
++#define APC_EX_T(offset) (*(temp_variable *)((char*)execute_data->Ts + offset))
++
++static zval *apc_get_zval_ptr(znode *node, zval **freeval, zend_execute_data *execute_data TSRMLS_DC)
++{
++ *freeval = NULL;
++
++ switch (node->op_type) {
++ case IS_CONST:
++ return &(node->u.constant);
++ case IS_VAR:
++ return APC_EX_T(node->u.var).var.ptr;
++ case IS_TMP_VAR:
++ return (*freeval = &APC_EX_T(node->u.var).tmp_var);
++#ifdef ZEND_ENGINE_2_1
++ case IS_CV:
++ {
++ zval ***ret = &execute_data->CVs[node->u.var];
++
++ if (!*ret) {
++ zend_compiled_variable *cv = &EG(active_op_array)->vars[node->u.var];
++
++ if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void**)ret)==FAILURE) {
++ apc_nprint("Undefined variable: %s", cv->name);
++ return &EG(uninitialized_zval);
++ }
++ }
++ return **ret;
++ }
++#endif
++ case IS_UNUSED:
++ default:
++ return NULL;
++ }
++}
++
++static int ZEND_FASTCALL apc_op_ZEND_INCLUDE_OR_EVAL(ZEND_OPCODE_HANDLER_ARGS)
++{
++ APC_ZEND_OPLINE
++ zval *freeop1 = NULL;
++ zval *inc_filename = NULL, tmp_inc_filename;
++ char realpath[MAXPATHLEN];
++ php_stream_wrapper *wrapper;
++ char *path_for_open;
++ int ret = 0;
++ apc_opflags_t* flags = NULL;
++
++ if (Z_LVAL(opline->op2.u.constant) != ZEND_INCLUDE_ONCE &&
++ Z_LVAL(opline->op2.u.constant) != ZEND_REQUIRE_ONCE) {
++ return apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
++ }
++
++ inc_filename = apc_get_zval_ptr(&opline->op1, &freeop1, execute_data TSRMLS_CC);
++ if (Z_TYPE_P(inc_filename) != IS_STRING) {
++ tmp_inc_filename = *inc_filename;
++ zval_copy_ctor(&tmp_inc_filename);
++ convert_to_string(&tmp_inc_filename);
++ inc_filename = &tmp_inc_filename;
++ }
++
++ wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(inc_filename), &path_for_open, 0 TSRMLS_CC);
++
++ if (wrapper != &php_plain_files_wrapper ||
++ !(IS_ABSOLUTE_PATH(path_for_open, strlen(path_for_open)) ||
++ expand_filepath(path_for_open, realpath TSRMLS_CC))) {
++ /* Fallback to original handler */
++ if (inc_filename == &tmp_inc_filename) {
++ zval_dtor(&tmp_inc_filename);
++ }
++ return apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
++ }
++
++ if (zend_hash_exists(&EG(included_files), realpath, strlen(realpath) + 1)) {
++ if (!(opline->result.u.EA.type & EXT_TYPE_UNUSED)) {
++ ALLOC_INIT_ZVAL(APC_EX_T(opline->result.u.var).var.ptr);
++ ZVAL_TRUE(APC_EX_T(opline->result.u.var).var.ptr);
++ }
++ if (inc_filename == &tmp_inc_filename) {
++ zval_dtor(&tmp_inc_filename);
++ }
++ if (freeop1) {
++ zval_dtor(freeop1);
++ }
++ execute_data->opline++;
++ return 0;
++ }
++
++ if (inc_filename == &tmp_inc_filename) {
++ zval_dtor(&tmp_inc_filename);
++ }
++
++ if(apc_reserved_offset != -1) {
++ /* Insanity alert: look into apc_compile.c for why a void** is cast to a apc_opflags_t* */
++ flags = (apc_opflags_t*) & (execute_data->op_array->reserved[apc_reserved_offset]);
++ }
++
++ if(flags && flags->deep_copy == 1) {
++ /* Since the op array is a local copy, we can cheat our way through the file inclusion by temporarily
++ * changing the op to a plain require/include, calling its handler and finally restoring the opcode.
++ */
++ Z_LVAL(opline->op2.u.constant) = (Z_LVAL(opline->op2.u.constant) == ZEND_INCLUDE_ONCE) ? ZEND_INCLUDE : ZEND_REQUIRE;
++ ret = apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
++ Z_LVAL(opline->op2.u.constant) = (Z_LVAL(opline->op2.u.constant) == ZEND_INCLUDE) ? ZEND_INCLUDE_ONCE : ZEND_REQUIRE_ONCE;
++ } else {
++ ret = apc_original_opcode_handlers[APC_OPCODE_HANDLER_DECODE(opline)](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
++ }
++
++ return ret;
++}
++
++void apc_zend_init(TSRMLS_D)
++{
++ zend_extension dummy_ext;
++ apc_reserved_offset = zend_get_resource_handle(&dummy_ext);
++ assert(apc_reserved_offset == dummy_ext.resource_number);
++ assert(apc_reserved_offset != -1);
++ assert(sizeof(apc_opflags_t) <= sizeof(void*));
++ if (!APCG(include_once)) {
++ /* If we're not overriding the INCLUDE_OR_EVAL handler, then just skip this malarkey */
++ return;
++ }
++
++ memcpy(apc_opcode_handlers, zend_opcode_handlers, sizeof(apc_opcode_handlers));
++
++ /* 5.0 exposes zend_opcode_handlers differently than 5.1 and later */
++#ifdef ZEND_ENGINE_2_1
++ apc_original_opcode_handlers = zend_opcode_handlers;
++ zend_opcode_handlers = apc_opcode_handlers;
++#else
++ apc_original_opcode_handlers = apc_opcode_handlers;
++#endif
++
++ APC_REPLACE_OPCODE(ZEND_INCLUDE_OR_EVAL);
++}
++
++void apc_zend_shutdown(TSRMLS_D)
++{
++ if (!APCG(include_once)) {
++ /* Nothing changed, nothing to restore */
++ return;
++ }
++
++#ifdef ZEND_ENGINE_2_1
++ zend_opcode_handlers = apc_original_opcode_handlers;
++#else
++ memcpy(zend_opcode_handlers, apc_original_opcode_handlers, sizeof(apc_opcode_handlers));
++#endif
++}
++
++#else /* Opcode Overrides unavailable */
++
++void apc_zend_init(TSRMLS_D) { }
++void apc_zend_shutdown(TSRMLS_D) { }
++
++#endif /* APC_OPCODE_OVERRIDE */
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/apc_zend.h php-5.3.1/ext/apc/apc_zend.h
+--- php-5.3.1.orig/ext/apc/apc_zend.h 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/apc_zend.h 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,169 @@
++/*
++ +----------------------------------------------------------------------+
++ | APC |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2006-2008 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: Daniel Cowgill <dcowgill@communityconnect.com> |
++ +----------------------------------------------------------------------+
++
++ This software was contributed to PHP by Community Connect Inc. in 2002
++ and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
++ Future revisions and derivatives of this source code must acknowledge
++ Community Connect 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_zend.h 286799 2009-08-04 11:27:29Z gopalv $ */
++
++#ifndef APC_ZEND_H
++#define APC_ZEND_H
++
++/* Utilities for interfacing with the zend engine */
++
++#include "apc.h"
++#include "apc_php.h"
++
++#ifndef Z_REFCOUNT_P
++#define Z_REFCOUNT_P(pz) (pz)->refcount
++#define Z_REFCOUNT_PP(ppz) Z_REFCOUNT_P(*(ppz))
++#endif
++
++#ifndef Z_SET_REFCOUNT_P
++#define Z_SET_REFCOUNT_P(pz, rc) (pz)->refcount = rc
++#define Z_SET_REFCOUNT_PP(ppz, rc) Z_SET_REFCOUNT_P(*(ppz), rc)
++#endif
++
++#ifndef Z_ADDREF_P
++#define Z_ADDREF_P(pz) (pz)->refcount++
++#define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz))
++#endif
++
++#ifndef Z_DELREF_P
++#define Z_DELREF_P(pz) (pz)->refcount--
++#define Z_DELREF_PP(ppz) Z_DELREF_P(*(ppz))
++#endif
++
++#ifndef Z_ISREF_P
++#define Z_ISREF_P(pz) (pz)->is_ref
++#define Z_ISREF_PP(ppz) Z_ISREF_P(*(ppz))
++#endif
++
++#ifndef Z_SET_ISREF_P
++#define Z_SET_ISREF_P(pz) (pz)->is_ref = 1
++#define Z_SET_ISREF_PP(ppz) Z_SET_ISREF_P(*(ppz))
++#endif
++
++#ifndef Z_UNSET_ISREF_P
++#define Z_UNSET_ISREF_P(pz) (pz)->is_ref = 0
++#define Z_UNSET_ISREF_PP(ppz) Z_UNSET_ISREF_P(*(ppz))
++#endif
++
++#ifndef Z_SET_ISREF_TO_P
++#define Z_SET_ISREF_TO_P(pz, isref) (pz)->is_ref = isref
++#define Z_SET_ISREF_TO_PP(ppz, isref) Z_SET_ISREF_TO_P(*(ppz), isref)
++#endif
++
++
++extern void* apc_php_malloc(size_t n);
++extern void apc_php_free(void* p);
++
++extern void apc_zend_init(TSRMLS_D);
++extern void apc_zend_shutdown(TSRMLS_D);
++
++
++/* offset for apc info in op_array->reserved */
++extern int apc_reserved_offset;
++
++#ifndef ZEND_VM_KIND_CALL /* Not currently defined by any ZE version */
++# define ZEND_VM_KIND_CALL 1
++#endif
++
++#ifndef ZEND_VM_KIND /* Indicates PHP < 5.1 */
++# define ZEND_VM_KIND ZEND_VM_KIND_CALL
++#endif
++
++#if defined(ZEND_ENGINE_2) && (ZEND_VM_KIND == ZEND_VM_KIND_CALL)
++# define APC_OPCODE_OVERRIDE
++#endif
++
++#ifdef APC_OPCODE_OVERRIDE
++
++#ifdef ZEND_ENGINE_2_1
++/* Taken from Zend/zend_vm_execute.h */
++#define _CONST_CODE 0
++#define _TMP_CODE 1
++#define _VAR_CODE 2
++#define _UNUSED_CODE 3
++#define _CV_CODE 4
++static inline int _apc_opcode_handler_decode(zend_op *opline)
++{
++ static const int apc_vm_decode[] = {
++ _UNUSED_CODE, /* 0 */
++ _CONST_CODE, /* 1 = IS_CONST */
++ _TMP_CODE, /* 2 = IS_TMP_VAR */
++ _UNUSED_CODE, /* 3 */
++ _VAR_CODE, /* 4 = IS_VAR */
++ _UNUSED_CODE, /* 5 */
++ _UNUSED_CODE, /* 6 */
++ _UNUSED_CODE, /* 7 */
++ _UNUSED_CODE, /* 8 = IS_UNUSED */
++ _UNUSED_CODE, /* 9 */
++ _UNUSED_CODE, /* 10 */
++ _UNUSED_CODE, /* 11 */
++ _UNUSED_CODE, /* 12 */
++ _UNUSED_CODE, /* 13 */
++ _UNUSED_CODE, /* 14 */
++ _UNUSED_CODE, /* 15 */
++ _CV_CODE /* 16 = IS_CV */
++ };
++ return (opline->opcode * 25) + (apc_vm_decode[opline->op1.op_type] * 5) + apc_vm_decode[opline->op2.op_type];
++}
++
++# define APC_ZEND_OPLINE zend_op *opline = execute_data->opline;
++# define APC_OPCODE_HANDLER_DECODE(opline) _apc_opcode_handler_decode(opline)
++# if PHP_MAJOR_VERSION >= 6
++# define APC_OPCODE_HANDLER_COUNT ((25 * 152) + 1)
++# elif PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3
++# define APC_OPCODE_HANDLER_COUNT ((25 * 154) + 1) /* 3 new opcodes in 5.3 - unused, lambda, jmp_set */
++# else
++# define APC_OPCODE_HANDLER_COUNT ((25 * 151) + 1)
++# endif
++# define APC_REPLACE_OPCODE(opname) { int i; for(i = 0; i < 25; i++) if (zend_opcode_handlers[(opname*25) + i]) zend_opcode_handlers[(opname*25) + i] = apc_op_##opname; }
++
++#else /* ZE2.0 */
++# define APC_ZEND_ONLINE
++# define APC_OPCODE_HANDLER_DECODE(opline) (opline->opcode)
++# define APC_OPCODE_HANDLER_COUNT 512
++# define APC_REPLACE_OPCODE(opname) zend_opcode_handlers[opname] = apc_op_##opname;
++#endif
++
++#ifndef ZEND_FASTCALL /* Added in ZE2.3.0 */
++#define ZEND_FASTCALL
++#endif
++
++
++#endif /* APC_OPCODE_OVERRIDE */
++
++
++#endif /* APC_ZEND_H */
++
++/*
++ * Local variables:
++ * tab-width: 4
++ * c-basic-offset: 4
++ * End:
++ * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
++ * vim<600: expandtab sw=4 ts=4 sts=4
++ */
+diff -Naur php-5.3.1.orig/ext/apc/CHANGELOG php-5.3.1/ext/apc/CHANGELOG
+--- php-5.3.1.orig/ext/apc/CHANGELOG 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/CHANGELOG 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,249 @@
++
++3.1.2 : 2008-12-12
++
++- pecl package.xml/build fixes (bjori)
++
++3.1.1 : 2008-12-12
++
++- PHP4 compatibilty break
++- apc_pool allocator (Gopal)
++- doubly-linked sma allocator (Shire)
++- php 5.3 gc compatibility (Gopal)
++- APCIterator for easy access (Shire)
++- apc_delete_file (Shire)
++- apc_inc/apc_dec/apc_cas functions (Shire)
++- apc.canonicalize (Gopal)
++- apc.preload_path (Gopal)
++- apc.rfc1867_ttl (Shire)
++- apc.file_md5 (Shire)
++- consolidate locking macros (Shire)
++- remove futex/TSRM locks (Shire)
++- non-blocking semaphore locks (Shire)
++- zval* object rework (Gopal)
++
++3.0.19: 2008-05-14
++- Safe-mode and fast-cgi fixes
++- Fix double-free of builtin_functions
++- php 5.3 fixes
++
++3.0.18: 2008-03-29
++- Revert apc_expunge_cb bug-fix
++- Misc memleaks
++
++3.0.17: 2008-03-26
++- Crash fixes
++- Fix apc_add() cache expunge bug (Rasmus)
++- Added parameter to apc_fetch to determine success/failure when fetching booleans (shire)
++- Fix misc. memleaks (shire)
++
++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)
++- Local shadow cache support (Gopal)
++- Avoid uneccessary loops over op_arrays for "known" auto-globals (Gopal)
++- Fix apc_add() to overwrite timed out user entries (Rasmus)
++- Fix double inclusion of files with conditional classes in php4 (Gopal)
++- Allocator fixes to reduce fragmentation (Gopal)
++
++3.0.13: 2007-02-24
++- File upload progress (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)
++
++3.0.12p2: 2006-09-05
++- Package version up
++
++3.0,12p1: 2006-09-05
++- PHP4 build fixes
++
++3.0.12: 2006-09-05
++- PHP 5.2 compatibility (Gopal)
++- TSRM fixes (Gopal)
++- Add extra flags to op_array->reserved to improve op array
++ processing code (Gopal)
++- Fix crashes in optimizer and cli mode (Ilia)
++- Optimizer fixes for PHP5 (Ilia, Gopal)
++- Allow multiple inclusions of a file with a dynamic class (Gopal)
++- Php 4 function table and properties fixes (Gopal)
++- Fix memory leaks in apc_cache_info (Gopal)
++
++3.0.11: 2006-08-16
++- Made --enable-apc-mmap the default compile option (for real this time)
++- Add an optional flag to apc_cache_info() and some apc.php tweaks to make it
++ only fetch header information to make it useful when you have tens of
++ thousands of entries. (Brian Shire)
++- 64-bit fixes (George)
++- Don't mix Full Path and Inode keys (George)
++- Override ZEND_INCLUDE_OR_EVAL opcode (when possible) to speed up use of
++ require_once() and include_once() statements. (Sara)
++- Add a non-blocking write_lock for cache inserts. This is a better approach
++ to prevent cache slams and deprecates the slam_defense setting. (Rasmus)
++- A bit of work on the optimizer. (Sara)
++- Various memory issues resolved. (Gopal)
++
++3.0.10: 2006-03-11
++- Add apc.stat ini flag which defaults to 1. If set to 0, the main script and any fullpath
++ includes will not be stat'ed for any changes. You will have to restart the server if you
++ change anything. This mode increases performance quite a bit, especially if you have a
++ lot of includes.
++
++- Get rid of the lock safety net hack I added in 3.0.9. It seems to cause more problems
++ than it solves. I'll need to revisit locking and signal handling at some point soon.
++
++3.0.9: 2006-03-04
++- Eliminate rand() call when slam_defense is not set (Rasmus)
++- Fix for __isset problem (Gopal)
++- Rewrite allocator from a "best fit" to a "next fit" algorithm (Rasmus)
++- Added a Cache Full counter so we have an idea how many times the segment has filled up causing an expunge (Rasmus)
++- Report back the correct number of available bytes in the segment instead of the allocated bytes. (Rasmus)
++- Add cache busy flag which is set when an expunge is underway (Rasmus)
++- Add automatic serialization of objects in apc_store() (Marcus)
++- 64-bit .ini flag fix (Rasmus)
++- Static members fix (Gopal)
++- sma_cleanup() mem leak fix (Rasmus)
++- Fix for http://pecl.php.net/bugs/5311 (Rasmus)
++- Fix autoglobals JIT bug (Gopal)
++- Fix instance bug (Gopal)
++- Add a lock cleanup safety net to request shutdown (Rasmus)
++- Fix apc.slam_defense edge-case bug (Rasmus)
++- User entry memory usage tracking support (Ilia)
++- Allow keys used in apc_store/apc_fetch/apc_delete to be binary safe and prevent conflicts between keys that are found at the start of other keys. (Ilia)
++
++3.0.8: 2005-08-24
++Fix invalid free in globals destructor introduced in 3.0.7 (Rasmus)
++Cache corruption fix in cache-full cleanup code (Gopal)
++
++3.0.7: 2005-08-16
++- 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)
++
++3.0.6: 2005-07-30
++- 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)
++
++3.0.5: 2005-07-27
++- Make it easier for sapis that only populate file_handle->filename to use APC. (Rasmus)
++- Support extensions such as bcompiler that need to hook into compile_file. (Val)
++- Ralf Becker's apcgui code has now become the default apc.php status page. (Ralf, Rasmus, Ilia)
++- Segfault in cache cleanup code (Ilia, Rasmus)
++
++3.0.4: 2005-07-18
++- Add win32 support (Edin )
++- Add --with-apxs switch to work around problem when loading APC into Apache binary compiled with LFS switches (Rasmus)
++- A couple of other minor fixes
++
++3.0.3: 2005-07-05
++- Fix compile problem against PHP 5.0.x
++
++3.0.2: 2005-07-05
++- Better shm error message
++
++3.0.1: 2005-07-05
++- PHP4 build fix
++
++3.0: 2005-06-23
++- PHP 5.1 support (Arun, Gopal, Rasmus)
++- Major Inheritance bug fix (Arun, Gopal)
++
++2.0: 2003-02-10
++- ground-up rewrite sharing none of the original source code (djc)
++
++1.0.10:
++- merge mmap / shm code to be in one file, module supports both modes now [mpb 2001-05-15]
++- added apc.mode config parameter [mpb 2001-05-15] NOTE: You'll have to add
++ this parameter to your php.ini file to activate apc shm or mmap caching
++- generic source cleanup (missing includes, PATH_MAX usage etc) [mpb
++ 2001-05-15]
++- fixed: realpath return result checking in generate_key [mpb 2001-05-15]
++- updated: gui updated (extras/apc_gui-1.0.2.tar.gz)
++- experminental 'fast' cache-retrieval [djc 2001-05-20]
++- fixed regex support [gws 2001-05-16]
++- enhanced reader-writer lock support [rg 2001-05-07]
++
++1.0.9:
++- fixed (?) memory alignment bug on 64 bit archiecures
++- added many cache visibiliy functions
++- added opional fcntl locks under shm version
++- numerous bug fixes
++
++1.0.8:
++- added ability to detect and decompile compiled files placed as 'source'
++ [gws,dw 2001-01-30]
++- fixed apc_rstat bug [gws 2001-01-29]
++- added hack to support included urls [gws 2001-01-30]
++- fixed apc_cache_index [mb 2001-01-31]
++- added multiple regex support [gs 2001-02-03]
++- added apc_cache_info [mb,gs 2001-02-03]
++
++1.0.7:
++- partially fixed for Solaris [gws 2001-01-29]
++- fixed mtime support for relative includes [gws 2001-01-29]
++- code cleanup [yg,ta,gws 2001-01-29]
++
++1.0.6:
++- support for mtime in mmap [yg,gws 2001-01-27]
++- fixed indexed-array initialization bug [djc,gws 2001-01-27]
++
++1.0.5:
++- support for relative include paths [djc,gws 2001-01-19]
++- class member array support fixed [djc 2001-01-18]
++- added apc_cache_index [gws 2001-01-18]
++
++1.0.4:
++- support for class hierarchies greater than two levels deep [djc 2001-01-17]
++
++1.0.3:
++- fixed support for class inheritance [djc 2001-01-16]
++
++1.0.2:
++- support for inherited classes [gws 2001-01-15]
++- support for intialization of class variables and objects [gws 2001-01-13]
++
++1.0.1:
++- added optional file modification time check [djc 2001-01-12]
+diff -Naur php-5.3.1.orig/ext/apc/config.m4 php-5.3.1/ext/apc/config.m4
+--- php-5.3.1.orig/ext/apc/config.m4 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/config.m4 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,232 @@
++dnl
++dnl $Id: config.m4 286829 2009-08-05 10:31:28Z gopalv $
++dnl
++
++PHP_ARG_ENABLE(apc, whether to enable APC support,
++[ --enable-apc Enable APC support])
++
++AC_MSG_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(whether we should use mmap)
++AC_ARG_ENABLE(apc-mmap,
++[ --disable-apc-mmap
++ Disable mmap support and use IPC shm instead],
++[
++ PHP_APC_MMAP=$enableval
++ AC_MSG_RESULT($enableval)
++], [
++ PHP_APC_MMAP=yes
++ AC_MSG_RESULT(yes)
++])
++
++AC_MSG_CHECKING(whether we should use semaphore locking instead of fcntl)
++AC_ARG_ENABLE(apc-sem,
++[ --enable-apc-sem
++ Enable semaphore locks instead of fcntl],
++[
++ PHP_APC_SEM=$enableval
++ AC_MSG_RESULT($enableval)
++], [
++ PHP_APC_SEM=no
++ AC_MSG_RESULT(no)
++])
++
++AC_MSG_CHECKING(whether we should use pthread mutex locking)
++AC_ARG_ENABLE(apc-pthreadmutex,
++[ --disable-apc-pthreadmutex
++ Disable pthread mutex locking ],
++[
++ PHP_APC_PTHREADMUTEX=$enableval
++ AC_MSG_RESULT($enableval)
++],
++[
++ PHP_APC_PTHREADMUTEX=yes
++ AC_MSG_RESULT(yes)
++])
++
++if test "$PHP_APC_PTHREADMUTEX" != "no"; then
++ orig_LIBS="$LIBS"
++ LIBS="$LIBS -lpthread"
++ AC_TRY_RUN(
++ [
++ #include <sys/types.h>
++ #include <pthread.h>
++ main() {
++ pthread_mutex_t mutex;
++ pthread_mutexattr_t attr;
++
++ if(pthread_mutexattr_init(&attr)) {
++ puts("Unable to initialize pthread attributes (pthread_mutexattr_init).");
++ 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.");
++ return -1;
++ }
++ if(pthread_mutex_init(&mutex, &attr)) {
++ puts("Unable to initialize the mutex (pthread_mutex_init).");
++ return -1;
++ }
++ if(pthread_mutexattr_destroy(&attr)) {
++ puts("Unable to destroy mutex attributes (pthread_mutexattr_destroy).");
++ return -1;
++ }
++ if(pthread_mutex_destroy(&mutex)) {
++ puts("Unable to destroy mutex (pthread_mutex_destroy).");
++ return -1;
++ }
++
++ puts("pthread mutex's are supported!");
++ return 0;
++ }
++ ],
++ [ dnl -Success-
++ PHP_ADD_LIBRARY(pthread)
++ ],
++ [ dnl -Failure-
++ AC_MSG_WARN([It doesn't appear that pthread mutex's are supported on your system])
++ PHP_APC_PTHREADMUTEX=no
++ ],
++ [
++ PHP_ADD_LIBRARY(pthread)
++ ]
++ )
++ LIBS="$orig_LIBS"
++fi
++
++AC_MSG_CHECKING(whether we should use spin locks)
++AC_ARG_ENABLE(apc-spinlocks,
++[ --enable-apc-spinlocks
++ Enable spin locks EXPERIMENTAL ],
++[
++ PHP_APC_SPINLOCKS=$enableval
++ AC_MSG_RESULT($enableval)
++],
++[
++ PHP_APC_SPINLOCKS=no
++ AC_MSG_RESULT(no)
++])
++
++AC_MSG_CHECKING(whether we should enable memory protection)
++AC_ARG_ENABLE(memory-protection,
++[ --enable-memory-protection
++ Enable mmap/shm memory protection],
++[
++ PHP_APC_MEMPROTECT=$enableval
++ AC_MSG_RESULT($enableval)
++], [
++ PHP_APC_MEMPROTECT=no
++ AC_MSG_RESULT(no)
++])
++
++if test "$PHP_APC" != "no"; then
++ test "$PHP_APC_MMAP" != "no" && AC_DEFINE(APC_MMAP, 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_SPINLOCKS" != "no"; then
++ AC_DEFINE(APC_SPIN_LOCKS, 1, [ ])
++ elif test "$PHP_APC_PTHREADMUTEX" != "no"; then
++ AC_DEFINE(APC_PTHREADMUTEX_LOCKS, 1, [ ])
++ else
++ AC_DEFINE(APC_FCNTL_LOCKS, 1, [ ])
++ fi
++
++ if test "$PHP_APC_MEMPROTECT" != "no"; then
++ AC_DEFINE(APC_MEMPROTECT, 1, [ shm/mmap memory protection ])
++ fi
++
++ AC_CACHE_CHECK(for zend_set_lookup_function_hook, php_cv_zend_set_lookup_function_hook,
++ [
++ orig_cflags=$CFLAGS
++ CFLAGS="$INCLUDES $EXTRA_INCLUDES"
++ AC_TRY_COMPILE([
++#include "main/php.h"
++#include "Zend/zend_API.h"
++ ], [#ifndef zend_set_lookup_function_hook
++ (void) zend_set_lookup_function_hook;
++#endif], [
++ php_cv_zend_set_lookup_function_hook=yes
++ ],[
++ php_cv_zend_set_lookup_function_hook=no
++ ])
++ CFLAGS=$orig_cflags
++ ])
++ if test "$php_cv_zend_set_lookup_function_hook" = "yes"; then
++ AC_DEFINE(APC_HAVE_LOOKUP_HOOKS, 1, [ ])
++ else
++ AC_DEFINE(APC_HAVE_LOOKUP_HOOKS, 0, [ ])
++ fi
++
++ AC_CHECK_FUNCS(sigaction)
++ AC_CACHE_CHECK(for union semun, php_cv_semun,
++ [
++ AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <sys/ipc.h>
++#include <sys/sem.h>
++ ], [union semun x; x.val=1], [
++ php_cv_semun=yes
++ ],[
++ php_cv_semun=no
++ ])
++ ])
++ if test "$php_cv_semun" = "yes"; then
++ AC_DEFINE(HAVE_SEMUN, 1, [ ])
++ else
++ AC_DEFINE(HAVE_SEMUN, 0, [ ])
++ fi
++
++ AC_MSG_CHECKING(whether we should enable valgrind support)
++ AC_ARG_ENABLE(valgrind-checks,
++ [ --disable-valgrind-checks
++ Disable valgrind based memory checks],
++ [
++ PHP_APC_VALGRIND=$enableval
++ AC_MSG_RESULT($enableval)
++ ], [
++ PHP_APC_VALGRIND=yes
++ AC_MSG_RESULT(yes)
++ AC_CHECK_HEADER(valgrind/memcheck.h,
++ [AC_DEFINE([HAVE_VALGRIND_MEMCHECK_H],1, [enable valgrind memchecks])])
++ ])
++
++ apc_sources="apc.c php_apc.c \
++ apc_cache.c \
++ apc_compile.c \
++ apc_debug.c \
++ apc_fcntl.c \
++ apc_main.c \
++ apc_mmap.c \
++ apc_sem.c \
++ apc_shm.c \
++ apc_pthreadmutex.c \
++ apc_spin.c \
++ pgsql_s_lock.c \
++ apc_sma.c \
++ apc_stack.c \
++ apc_zend.c \
++ apc_rfc1867.c \
++ apc_signal.c \
++ apc_pool.c \
++ apc_iterator.c \
++ apc_bin.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_SUBST(APC_SHARED_LIBADD)
++ PHP_SUBST(APC_CFLAGS)
++ AC_DEFINE(HAVE_APC, 1, [ ])
++fi
++
+diff -Naur php-5.3.1.orig/ext/apc/config.w32 php-5.3.1/ext/apc/config.w32
+--- php-5.3.1.orig/ext/apc/config.w32 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/config.w32 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,27 @@
++// $Id: config.w32 284592 2009-07-22 10:53:50Z kalle $
++// vim:ft=javascript
++
++ARG_ENABLE("apc", "Alternative PHP Cache", "no");
++
++if (PHP_APC != "no") {
++ apc_sources="apc.c php_apc.c \
++ apc_cache.c \
++ apc_compile.c \
++ apc_debug.c \
++ apc_fcntl_win32.c \
++ apc_iterator.c \
++ apc_main.c \
++ apc_shm.c \
++ apc_sma.c \
++ apc_stack.c \
++ apc_rfc1867.c \
++ apc_zend.c \
++ apc_pool.c \
++ apc_bin.c \
++ apc_spin.c \
++ pgsql_s_lock.c";
++
++ EXTENSION('apc', apc_sources);
++ AC_DEFINE('HAVE_APC', 1);
++ ADD_FLAG('CFLAGS_APC', "/DAPC_SPIN_LOCKS=1 /DWIN32_ONLY_COMPILER=1");
++}
+diff -Naur php-5.3.1.orig/ext/apc/INSTALL php-5.3.1/ext/apc/INSTALL
+--- php-5.3.1.orig/ext/apc/INSTALL 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/INSTALL 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,421 @@
++Installation Instructions for APC
++---------------------------------
++
++This version of APC should work on PHP 4.3.0 - 4.4.x and
++5.1.0 - 5.2.x. Yes, that means PHP 5.0.x is no longer
++supported. Upgrade to PHP 5.1.x or 5.2.x and you will
++notice all sorts of performance increases.
++
++CVS Instructions
++----------------
++Building from CVS can be done like this:
++
++ cvs -d :pserver:cvsread@cvs.php.net:/repository login
++ Password: phpfi
++ cvs -d :pserver:cvsread@cvs.php.net:/repository co pecl/apc
++ cd pecl/apc
++ phpize
++ ./configure --enable-apc-mmap --with-apxs --with-php-config=/usr/local/php/bin/php-config
++ make
++ make install
++
++Suggested Configuration (in your php.ini file)
++----------------------------------------------
++ extension=apc.so
++ apc.enabled=1
++ apc.shm_segments=1
++ apc.shm_size=128
++ apc.ttl=7200
++ apc.user_ttl=7200
++ apc.num_files_hint=1024
++ apc.mmap_file_mask=/tmp/apc.XXXXXX
++ apc.enable_cli=1
++
++These are fully described at the bottom of this file.
++
++PHP 4 Optimization
++------------------
++If you are trying to get every little bit of speed out of PHP4+APC, you need
++to tell APC where to find your httpd.h file and also add -DAPC_PHP4_STAT to
++your CPPFLAGS. (if you don't have httpd.h, install the apache_dev package
++for your OS) and do:
++ export CPPFLAGS="-I/usr/include/apache-1.3 -DAPC_PHP4_STAT" (for bash on Debian)
++ setenv CPPFLAGS "-I/usr/include/apache-1.3 -DAPC_PHP4_STAT" (for tsch on Debian)
++and then re-run your configure script.
++
++This optimization saves a stat syscall on the main script file. In PHP5 this
++optimization is automatic and doesn't need any special build flags.
++
++The second thing you are going to want to do to save another syscall is to
++compile using the --with-apxs configure switch. This should work for both
++Apache1 and Apache2. Point it directly at your apxs2 script for Apache2.
++eg. --with-apxs=/usr/local/bin/apxs2
++
+++---------------------+
++| QUICK INSTALL (DSO) |
+++---------------------+
++
++These instructions assume your PHP installation is located in /usr/local/php and you
++want Apache optimizations (--with-apxs).
++
++$ gunzip -c apc_x.y.tar.gz | tar xf -
++$ cd apc_x.y
++$ /usr/local/php/bin/phpize
++$ ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/php/bin/php-config
++$ make
++$ make install
++
++You will probably need to run the final command (make install) as root.
++
++The above sequence of commands will install a .so file in your PHP
++installation extension directory. The output of make install should display
++that path to the screen.
++
++Next you must edit your php.ini file, which is normally located in
++/usr/local/php/lib/php.ini, and add the following line:
++
++ extension="apc.so"
++
++Replace "/path/to/php/extensions" with whatever path was displayed when you
++ran make install above.
++
++Then restart your web server and consult the output of phpinfo(). If there is
++an informational section for APC, the installation was successful.
++
+++------------------------+
++| QUICK INSTALL (Static) |
+++------------------------+
++
++APC will not successfully compile on all systems as a DSO. If you run into
++problems using the DSO quick install, you can try to compile it statically
++into PHP. (The DSO install is recommended, though.)
++
++These instructions assume the current directory is the root of the PHP source
++tree, and that you have already configured PHP by running its bundled
++configure script.
++
++$ cd ext
++$ gunzip -c apc_x.y.tar.gz | tar xf -
++$ cd ..
++$ ./buildconf
++$ ./config.nice
++$ make
++$ make install
++
++Once this is complete, simply restart your web server. You do not need to
++modify your php.ini file to enable APC.
++
+++-----------------+
++| VERBOSE INSTALL |
+++-----------------+
++
++These instructions assume your PHP installation is located in /usr/local/php.
++
++1. Unpack your distribution file.
++
++ You will have downloaded a file named something like apc_x.y.tar.gz.
++ Unzip this file with a command like
++
++ gunzip apc_x.y.tar.gz
++
++ Next you have to untar it with
++
++ tar xvf apc_x.y.tar
++
++ This will create an apc_x.y directory. cd into this new directory:
++
++ cd apc_x.y
++
++2. Run phpize.
++
++ phpize is a script that should have been installed with PHP, and is
++ normally located in /usr/local/php/bin assuming you installed PHP in
++ /usr/local/php. (If you do not have the phpize script, you must reinstall
++ PHP and be sure not to disable PEAR.)
++
++ Run the phpize command:
++
++ /usr/local/php/bin/phpize
++
++ Its output should resemble this:
++
++ autoheader: `config.h.in' is created
++ You should update your `aclocal.m4' by running aclocal.
++ Configuring for:
++ PHP Api Version: 20020918
++ Zend Module Api No: 20020429
++ Zend Extension Api No: 20021010
++
++ phpize should create a configure script in the current directory. If you
++ get errors instead, you might be missing some required development tools,
++ such as autoconf or libtool. You can try downloading the latest versions
++ of those tools and running phpize again.
++
++3. Run the configure script.
++
++ phpize creates a configure script. The only option you need to specify is
++ the location of your php-config script:
++
++ ./configure --enable-apc
++
++ php-config should be located in the same directory as phpize.
++
++ If you prefer to use mmap instead of the default IPC shared memory support,
++ add --enable-apc-mmap to your configure line.
++
++ If you prefer to use sysv IPC semaphores over the safer fcntl() locks, add
++ --enable-sem to your configure line. If you don't have a problem
++ with your server segaulting, or any other unnatural accumulation of
++ semaphores on your system, the semaphore based locking is slightly faster.
++
++4. Compile and install the files. Simply type: make install
++
++ (You may need to be root in order to install)
++
++ If you encounter errors from libtool or gcc during this step, please
++ contact the project maintainer (dcowgill@php.net).
++
++5. Edit your php.ini
++
++ make install should have printed a line resembling the following:
++
++ Installing shared extensions: /path/to/extension/
++
++ Copy the path /path/to/extension/ and add the following line to your
++ php.ini file (normally located in /usr/local/php/lib/php.ini):
++
++ extension="apc.so"
++
++ If you don't have a php.ini file in that location, you can create it now.
++
++6. Restart the web server and test the installation.
++
++ Restart your web server now (for apache, it's apachectl restart) and
++ create a small test PHP file in your document root. The file should
++ contain just the following line:
++
++ <?php phpinfo() ?>
++
++ Request that file in a web browser. If there is an entry for APC in the
++ list of installed modules, the installation was successful.
++
++ If APC is not listed, consult your web server error log. If it contains an
++ error message saying that it can't load the APC extension, your system
++ might not be able to load shared libraries created with PHP's build
++ system. One alternative would be to compile APC statically into PHP. See
++ the Quick Install (Static) instructions above.
++
++ You should consult your error log anyway to see if APC generated any
++ errors. On BSD-based platforms, it is typical for APC to be unable to
++ allocate the default-sized shared memory segment. See below for hints on
++ raising your system's shared memory limitations.
++
+++-----------------+
++| CONFIGURING APC |
+++-----------------+
++
++Although the default APC settings are fine for many installations, serious
++users should consider tuning the following parameters:
++
++ OPTION DESCRIPTION
++ ------------------ --------------------------------------------------
++ apc.enabled This can be set to 0 to disable APC. This is
++ primarily useful when APC is statically compiled
++ into PHP, since there is no other way to disable
++ it (when compiled as a DSO, the zend_extension
++ line can just be commented-out).
++ (Default: 1)
++
++ apc.shm_segments The number of shared memory segments to allocate
++ for the compiler cache. If APC is running out of
++ shared memory but you have already set
++ apc.shm_size as high as your system allows, you
++ can try raising this value. Setting this to a
++ value other than 1 has no effect in mmap mode
++ since mmap'ed shm segments don't have size limits.
++ (Default: 1)
++
++ apc.shm_size The size of each shared memory segment in MB.
++ By default, some systems (including most BSD
++ variants) have very low limits on the size of a
++ shared memory segment.
++ (Default: 30)
++
++ apc.optimization This option has been deprecated.
++ (Default: 0)
++
++ apc.num_files_hint A "hint" about the number of distinct source files
++ that will be included or requested on your web
++ server. Set to zero or omit if you're not sure;
++ this setting is mainly useful for sites that have
++ many thousands of source files.
++ (Default: 1000)
++
++ apc.user_entries_hint Just like num_files_hint, a "hint" about the number
++ of distinct user cache variables to store.
++ Set to zero or omit if you're not sure;
++ (Default: 4096)
++
++ apc.ttl The number of seconds a cache entry is allowed to
++ idle in a slot in case this cache entry slot is
++ needed by another entry. Leaving this at zero
++ means that your cache could potentially fill up
++ with stale entries while newer entries won't be
++ cached.
++ (Default: 0)
++
++ apc.user_ttl The number of seconds a user cache entry is allowed
++ to idle in a slot in case this cache entry slot is
++ needed by another entry. Leaving this at zero
++ means that your cache could potentially fill up
++ with stale entries while newer entries won't be
++ cached.
++ (Default: 0)
++
++
++ apc.gc_ttl The number of seconds that a cache entry may
++ remain on the garbage-collection list. This value
++ provides a failsafe in the event that a server
++ process dies while executing a cached source file;
++ if that source file is modified, the memory
++ allocated for the old version will not be
++ reclaimed until this TTL reached. Set to zero to
++ disable this feature.
++ (Default: 3600)
++
++ apc.cache_by_default On by default, but can be set to off and used in
++ conjunction with positive apc.filters so that files
++ are only cached if matched by a positive filter.
++ (Default: On)
++
++ apc.filters A comma-separated list of POSIX extended regular
++ expressions. If any pattern matches the source
++ filename, the file will not be cached. Note that
++ the filename used for matching is the one passed
++ to include/require, not the absolute path. If the
++ first character of the expression is a + then the
++ expression will be additive in the sense that any
++ files matched by the expression will be cached, and
++ if the first character is a - then anything matched
++ will not be cached. The - case is the default, so
++ it can be left off.
++ (Default: "")
++
++ apc.mmap_file_mask If compiled with MMAP support by using --enable-mmap
++ this is the mktemp-style file_mask to pass to the
++ mmap module for determing whether your mmap'ed memory
++ region is going to be file-backed or shared memory
++ backed. For straight file-backed mmap, set it to
++ something like /tmp/apc.XXXXXX (exactly 6 X's).
++ To use POSIX-style shm_open/mmap put a ".shm"
++ somewhere in your mask. eg. "/apc.shm.XXXXXX"
++ You can also set it to "/dev/zero" to use your
++ kernel's /dev/zero interface to anonymous mmap'ed
++ memory. Leaving it undefined will force an
++ anonymous mmap.
++ (Default: "")
++
++ apc.slam_defense ** DEPRECATED - Use apc.write_lock instead **
++ On very busy servers whenever you start the server or
++ modify files you can create a race of many processes
++ all trying to cache the same file at the same time.
++ This option sets the percentage of processes that will
++ skip trying to cache an uncached file. Or think of it
++ as the probability of a single process to skip caching.
++ For example, setting this to 75 would mean that there is
++ a 75% chance that the process will not cache an uncached
++ file. So the higher the setting the greater the defense
++ against cache slams. Setting this to 0 disables this
++ feature.
++ (Default: 0)
++
++ apc.file_update_protection
++ When you modify a file on a live web server you really
++ should do so in an atomic manner. That is, write to a
++ temporary file and rename (mv) the file into its permanent
++ position when it is ready. Many text editors, cp, tar and
++ other such programs don't do this. This means that there
++ is a chance that a file is accessed (and cached) while it
++ is still being written to. This file_update_protection
++ setting puts a delay on caching brand new files. The
++ default is 2 seconds which means that if the modification
++ timestamp (mtime) on a file shows that it is less than 2
++ seconds old when it is accessed, it will not be cached.
++ The unfortunate person who accessed this half-written file
++ will still see weirdness, but at least it won't persist.
++ If you are certain you always atomically update your files
++ by using something like rsync which does this correctly, you
++ can turn this protection off by setting it to 0. If you
++ have a system that is flooded with io causing some update
++ procedure to take longer than 2 seconds, you may want to
++ increase this a bit.
++ (Default: 2)
++
++ apc.enable_cli Mostly for testing and debugging. Setting this enables APC
++ for the CLI version of PHP. Normally you wouldn't want to
++ create, populate and tear down the APC cache on every CLI
++ request, but for various test scenarios it is handy to be
++ able to enable APC for the CLI version of APC easily.
++ (Default: 0)
++
++ apc.max_file_size Prevents large files from being cached.
++ (Default: 1M)
++
++ apc.stat Whether to stat the main script file and the fullpath
++ includes. If you turn this off you will need to restart
++ your server in order to update scripts.
++ (Default: 1)
++
++ apc.canonicalize Whether to canonicalize paths in stat=0 mode or
++ fall back to stat behaviour if set to 0
++ (Default: 0)
++
++ apc.write_lock On busy servers when you first start up the server, or when
++ many files are modified, you can end up with all your processes
++ trying to compile and cache the same files. With write_lock
++ enabled, only one process at a time will try to compile an
++ uncached script while the other processes will run uncached
++ instead of sitting around waiting on a lock.
++ (Default: 1)
++
++ apc.report_autofilter Logs any scripts that were automatically excluded from being
++ cached due to early/late binding issues.
++ (Default: 0)
++
++ apc.rfc1867 RFC1867 File Upload Progress hook handler is only available
++ if you compiled APC against PHP 5.2.0 or later. When enabled
++ any file uploads which includes a field called
++ APC_UPLOAD_PROGRESS before the file field in an upload form
++ will cause APC to automatically create an upload_<key>
++ user cache entry where <key> is the value of the
++ APC_UPLOAD_PROGRESS form entry.
++
++ Note that the file upload tracking is not threadsafe at this
++ point, so new uploads that happen while a previous one is
++ 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 ** REMOVED
++ apc.localcache.size ** REMOVED
++
++ apc.include_once_override
++ Optimize include_once and require_once calls and avoid the
++ expensive system calls used.
++ (Default: 0)
+diff -Naur php-5.3.1.orig/ext/apc/LICENSE php-5.3.1/ext/apc/LICENSE
+--- php-5.3.1.orig/ext/apc/LICENSE 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/LICENSE 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,68 @@
++--------------------------------------------------------------------
++ The PHP License, version 3.01
++Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
++--------------------------------------------------------------------
++
++Redistribution and use in source and binary forms, with or without
++modification, is permitted provided that the following conditions
++are met:
++
++ 1. Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++
++ 2. Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in
++ the documentation and/or other materials provided with the
++ distribution.
++
++ 3. The name "PHP" must not be used to endorse or promote products
++ derived from this software without prior written permission. For
++ written permission, please contact group@php.net.
++
++ 4. Products derived from this software may not be called "PHP", nor
++ may "PHP" appear in their name, without prior written permission
++ from group@php.net. You may indicate that your software works in
++ conjunction with PHP by saying "Foo for PHP" instead of calling
++ it "PHP Foo" or "phpfoo"
++
++ 5. The PHP Group may publish revised and/or new versions of the
++ license from time to time. Each version will be given a
++ distinguishing version number.
++ Once covered code has been published under a particular version
++ of the license, you may always continue to use it under the terms
++ of that version. You may also choose to use such covered code
++ under the terms of any subsequent version of the license
++ published by the PHP Group. No one other than the PHP Group has
++ the right to modify the terms applicable to covered code created
++ under this License.
++
++ 6. Redistributions of any form whatsoever must retain the following
++ acknowledgment:
++ "This product includes PHP software, freely available from
++ <http://www.php.net/software/>".
++
++THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
++ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
++DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
++INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
++OF THE POSSIBILITY OF SUCH DAMAGE.
++
++--------------------------------------------------------------------
++
++This software consists of voluntary contributions made by many
++individuals on behalf of the PHP Group.
++
++The PHP Group can be contacted via Email at group@php.net.
++
++For more information on the PHP Group and the PHP project,
++please see <http://www.php.net>.
++
++PHP includes the Zend Engine, freely available at
++<http://www.zend.com>.
+diff -Naur php-5.3.1.orig/ext/apc/NOTICE php-5.3.1/ext/apc/NOTICE
+--- php-5.3.1.orig/ext/apc/NOTICE 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/NOTICE 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,43 @@
++This is the NOTICE file that holds acknowledgements and stuff.
++
++The Alternative PHP Cache (APC) is a free and open opcode cache for PHP.
++This extension is being released under the PHP License for complete compliance
++with PHP and to encourage wide-spread use. It is our intention that this
++project be kept open source and that all commercial spin-offs contribute their
++modifications back into the public source-tree.
++
++Creators:
++ Daniel Cowgill
++ George Schlossnagle
++
++PHP5 support and major features by:
++ Arun C. Murthy
++ Gopal Vijayaraghavan
++ Rasmus Lerdorf
++
++This software was contributed to PHP by Community Connect Inc. in 2002
++and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1.
++Future revisions and derivatives of this source code must acknowledge
++Community Connect 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.
++
++We would like to thank Community Connect Inc. and Yahoo! Inc. for supporting
++this project and providing a challenging and stimulating environment in
++which exciting projects can happen.
++
++Contributors:
++ Mike Bretz bug fixes, GUI, and lots of work
++ Ricardo Galli changed read-write locks to prefer readers
++ Yann Grossel bug fixes
++ Thies Arntzen bug fixes
++ Sara Golemon optimizer work
++
++Special Thanks:
++ Florian Baumert help debugging phplib problems
++ Thomas Duffey help debugging inheritance issues
++ Vibol Hou help debugging phplib problems
++ Angel Li diffs for ANSI comment compliance
++ Christian Rishøj help debugging phplib problems
++ Sascha Schumann memory error bug fix
+diff -Naur php-5.3.1.orig/ext/apc/package.xml php-5.3.1/ext/apc/package.xml
+--- php-5.3.1.orig/ext/apc/package.xml 1970-01-01 01:00:00.000000000 +0100
++++ php-5.3.1/ext/apc/package.xml 1970-01-01 10:13:08.000000000 +0100
+@@ -0,0 +1,736 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<package packagerversion="1.8.0" 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>