diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_api.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_api.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_api.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APCu | - +----------------------------------------------------------------------+ - | Copyright (c) 2013 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. | - +----------------------------------------------------------------------+ - | Author: Joe Watkins | - +----------------------------------------------------------------------+ - */ - -#ifndef APC_API_H -#define APC_API_H - -#include "apc.h" -#include "apc_lock_api.h" -#include "apc_pool_api.h" -#include "apc_sma_api.h" -#include "apc_cache_api.h" -#include "apc_bin_api.h" - -#endif diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_bin_api.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_bin_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_bin_api.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_bin_api.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - */ - -/* $Id: apc_bin_api.h 328743 2012-12-12 07:58:32Z ab $ */ - -#ifndef APC_BIN_API_H -#define APC_BIN_API_H - -#include "ext/standard/basic_functions.h" - -/* APC binload flags */ -#define APC_BIN_VERIFY_MD5 1 << 0 -#define APC_BIN_VERIFY_CRC32 1 << 1 - -typedef struct _apc_bd_entry_t { - unsigned char type; - uint num_functions; - uint num_classes; - struct { - char* str; - uint len; - } key; - apc_cache_entry_t val; -} apc_bd_entry_t; - -typedef struct _apc_bd_t { - unsigned int size; - int swizzled; - unsigned char md5[16]; - php_uint32 crc; - unsigned int num_entries; - apc_bd_entry_t *entries; - int num_swizzled_ptrs; - void ***swizzled_ptrs; -} apc_bd_t; - -PHP_APCU_API apc_bd_t* apc_bin_dump(apc_cache_t* cache, HashTable *user_vars TSRMLS_DC); -PHP_APCU_API int apc_bin_load(apc_cache_t* cache, apc_bd_t *bd, int flags TSRMLS_DC); - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_bin.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_bin.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_bin.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_bin.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,557 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | Xinchen Hui | - +----------------------------------------------------------------------+ - - */ - -/* $Id: apc_bin.c 328828 2012-12-18 15:18:39Z remi $ */ - -/* Creates an architecture specific binary output to a string or file containing - * the current cache contents. This is accomplished via the apc_copy_* functions and - * "swizzling" pointers to achieve position independence. - */ - -#include "apc_globals.h" -#include "apc_bin.h" -#include "apc_php.h" -#include "apc_sma.h" -#include "apc_pool.h" -#include "apc_cache.h" - -#include "ext/standard/md5.h" - -/* in apc_cache.c */ -extern zval* apc_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC); - -#define APC_BINDUMP_DEBUG 0 - -#if APC_BINDUMP_DEBUG - -#define SWIZZLE(bd, ptr) \ - do { \ - if((ptrdiff_t)bd < (ptrdiff_t)ptr && (size_t)ptr < ((size_t)bd + bd->size)) { \ - printf("SWIZZLE: %x ~> ", ptr); \ - ptr = (void*)((ptrdiff_t)(ptr) - (ptrdiff_t)(bd)); \ - printf("%x in %s on line %d", ptr, __FILE__, __LINE__); \ - } else if((ptrdiff_t)ptr > bd->size) { /* not swizzled */ \ - apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (ptrdiff_t)bd, ptr, ((size_t)bd + bd->size), __FILE__, __LINE__); \ - return; \ - } \ - printf("\n"); \ - } while(0); - -#define UNSWIZZLE(bd, ptr) \ - do { \ - printf("UNSWIZZLE: %x -> ", ptr); \ - ptr = (void*)((ptrdiff_t)(ptr) + (ptrdiff_t)(bd)); \ - printf("%x in %s on line %d \n", ptr, __FILE__, __LINE__); \ - } while(0); - -#else /* !APC_BINDUMP_DEBUG */ - -#define SWIZZLE(bd, ptr) \ - do { \ - if((ptrdiff_t)bd < (ptrdiff_t)ptr && (size_t)ptr < ((size_t)bd + bd->size)) { \ - ptr = (void*)((ptrdiff_t)(ptr) - (ptrdiff_t)(bd)); \ - } else if((size_t)ptr > bd->size) { /* not swizzled */ \ - apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (ptrdiff_t)bd, ptr, ((size_t)bd + bd->size), __FILE__, __LINE__); \ - return NULL; \ - } \ - } while(0); - -#define UNSWIZZLE(bd, ptr) \ - do { \ - ptr = (void*)((ptrdiff_t)(ptr) + (ptrdiff_t)(bd)); \ - } while(0); - -#endif - -static void *apc_bd_alloc(size_t size TSRMLS_DC); -static void apc_bd_free(void *ptr TSRMLS_DC); -static void *apc_bd_alloc_ex(void *ptr_new, size_t size TSRMLS_DC); - -typedef void (*apc_swizzle_cb_t)(apc_bd_t *bd, zend_llist *ll, void *ptr TSRMLS_DC); - -#if APC_BINDUMP_DEBUG -#define apc_swizzle_ptr(bd, ctxt, ll, ptr) _apc_swizzle_ptr(bd, ctxt, ll, (void*)ptr, __FILE__, __LINE__ TSRMLS_CC) -#else -#define apc_swizzle_ptr(bd, ctxt, ll, ptr) _apc_swizzle_ptr(bd, ctxt, ll, (void*)ptr, NULL, 0 TSRMLS_CC) -#endif - -static void _apc_swizzle_ptr(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, void **ptr, const char* file, int line TSRMLS_DC); -static void apc_swizzle_hashtable(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, HashTable *ht, apc_swizzle_cb_t swizzle_cb, int is_ptr TSRMLS_DC); -static void apc_swizzle_zval(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, zval *zv TSRMLS_DC); - -static apc_bd_t* apc_swizzle_bd(apc_bd_t* bd, zend_llist *ll TSRMLS_DC); -static int apc_unswizzle_bd(apc_bd_t *bd, int flags TSRMLS_DC); - -/* {{{ apc_bd_alloc - * callback for copy_* functions */ -static void *apc_bd_alloc(size_t size TSRMLS_DC) { - return apc_bd_alloc_ex(NULL, size TSRMLS_CC); -} /* }}} */ - -/* {{{ apc_bd_free - * callback for copy_* functions */ -static void apc_bd_free(void *ptr TSRMLS_DC) { - size_t *size; - if(zend_hash_index_find(&APCG(apc_bd_alloc_list), (ulong)ptr, (void**)&size) == FAILURE) { - apc_error("apc_bd_free could not free pointer (not found in list: %x)" TSRMLS_CC, ptr); - return; - } - APCG(apc_bd_alloc_ptr) = (void*)((size_t)APCG(apc_bd_alloc_ptr) - *size); - zend_hash_index_del(&APCG(apc_bd_alloc_list), (ulong)ptr); -} /* }}} */ - -/* {{{ apc_bd_alloc_ex - * set ranges or allocate a block of data from an already (e)malloc'd range. - * if ptr_new is not NULL, it will reset the pointer to start at ptr_new, - * with a range of size. If ptr_new is NULL, returns the next available - * block of given size. - */ -static void *apc_bd_alloc_ex(void *ptr_new, size_t size TSRMLS_DC) { - void *rval; - - rval = APCG(apc_bd_alloc_ptr); - if(ptr_new != NULL) { /* reset ptrs */ - APCG(apc_bd_alloc_ptr) = ptr_new; - APCG(apc_bd_alloc_ubptr) = (void*)((unsigned char *) ptr_new + size); - } else { /* alloc block */ - APCG(apc_bd_alloc_ptr) = (void*)((size_t)APCG(apc_bd_alloc_ptr) + size); -#if APC_BINDUMP_DEBUG - apc_notice("apc_bd_alloc: rval: 0x%x ptr: 0x%x ubptr: 0x%x size: %d" TSRMLS_CC, rval, APCG(apc_bd_alloc_ptr), APCG(apc_bd_alloc_ubptr), size); -#endif - if(APCG(apc_bd_alloc_ptr) > APCG(apc_bd_alloc_ubptr)) { - apc_error("Exceeded bounds check in apc_bd_alloc_ex by %d bytes." TSRMLS_CC, (unsigned char *) APCG(apc_bd_alloc_ptr) - (unsigned char *) APCG(apc_bd_alloc_ubptr)); - return NULL; - } - zend_hash_index_update(&APCG(apc_bd_alloc_list), (ulong)rval, &size, sizeof(size_t), NULL); - } - - return rval; -} /* }}} */ - -/* {{{ _apc_swizzle_ptr */ -static void _apc_swizzle_ptr(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, void **ptr, const char* file, int line TSRMLS_DC) { - if(*ptr) { - if((ptrdiff_t)bd < (ptrdiff_t)*ptr && (size_t)*ptr < ((size_t)bd + bd->size)) { - zend_llist_add_element(ll, &ptr); -#if APC_BINDUMP_DEBUG - printf("[%06d] apc_swizzle_ptr: %x -> %x ", zend_llist_count(ll), ptr, *ptr); - printf(" in %s on line %d \n", file, line); -#endif - } else if((size_t)ptr > bd->size) { - apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (ptrdiff_t)bd, *ptr, ((ptrdiff_t)bd + bd->size), file, line); \ - return; - } - } -} /* }}} */ - -/* {{{ apc_swizzle_hashtable */ -static void apc_swizzle_hashtable(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, HashTable *ht, apc_swizzle_cb_t swizzle_cb, int is_ptr TSRMLS_DC) { - uint i; - Bucket **bp, **bp_prev; - - bp = &ht->pListHead; - while(*bp) { - bp_prev = bp; - bp = &(*bp)->pListNext; - if(is_ptr) { - swizzle_cb(bd, ll, *(void**)(*bp_prev)->pData TSRMLS_CC); - apc_swizzle_ptr(bd, ctxt, ll, (*bp_prev)->pData); - } else { - swizzle_cb(bd, ll, (void**)(*bp_prev)->pData TSRMLS_CC); - } -#ifdef ZEND_ENGINE_2_4 - if ((*bp_prev)->nKeyLength) { - if (IS_INTERNED((*bp_prev)->arKey)) { - /* we should dump that internal string out */ - char *tmp = apc_bd_alloc((*bp_prev)->nKeyLength TSRMLS_CC); - memcpy(tmp, (*bp_prev)->arKey, (*bp_prev)->nKeyLength); - (*bp_prev)->arKey = tmp; - } - apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->arKey); - } -#endif - apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pData); - if((*bp_prev)->pDataPtr) { - apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pDataPtr); - } - if((*bp_prev)->pListLast) { - apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pListLast); - } - if((*bp_prev)->pNext) { - apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pNext); - } - if((*bp_prev)->pLast) { - apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pLast); - } - apc_swizzle_ptr(bd, ctxt, ll, bp_prev); - } - for(i=0; i < ht->nTableSize; i++) { - if(ht->arBuckets[i]) { - apc_swizzle_ptr(bd, ctxt, ll, &ht->arBuckets[i]); - } - } - apc_swizzle_ptr(bd, ctxt, ll, &ht->pListTail); - - apc_swizzle_ptr(bd, ctxt, ll, &ht->arBuckets); -} /* }}} */ - -/* {{{ apc_swizzle_zval */ -static void apc_swizzle_zval(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, zval *zv TSRMLS_DC) { - - if(ctxt->copied.nTableSize) { - if(zend_hash_index_exists(&ctxt->copied, (ulong)zv)) { - return; - } - zend_hash_index_update(&ctxt->copied, (ulong)zv, (void**)&zv, sizeof(zval*), NULL); - } - - switch(Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) { - case IS_NULL: - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_RESOURCE: - /* nothing to do */ - break; - case IS_CONSTANT: - case IS_STRING: - apc_swizzle_ptr(bd, ctxt, ll, &zv->value.str.val); - break; - case IS_ARRAY: - apc_swizzle_hashtable(bd, ctxt, ll, zv->value.ht, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC); - apc_swizzle_ptr(bd, ctxt, ll, &zv->value.ht); - break; - case IS_OBJECT: - break; - default: - assert(0); /* shouldn't happen */ - } -} /* }}} */ - -/* {{{ apc_swizzle_bd */ -static apc_bd_t* apc_swizzle_bd(apc_bd_t* bd, zend_llist *ll TSRMLS_DC) { - unsigned int i; - int count; - PHP_MD5_CTX context; - unsigned char digest[16]; - register php_uint32 crc; - void ***ptr; - void ***ptr_list; - - count = zend_llist_count(ll); - ptr_list = emalloc(count * sizeof(void**)); - ptr = zend_llist_get_first(ll); - for(i=0; i < count; i++) { -#if APC_BINDUMP_DEBUG - printf("[%06d] ", i+1); -#endif - SWIZZLE(bd, **ptr); /* swizzle ptr */ - if((ptrdiff_t)bd < (ptrdiff_t)*ptr && (size_t)*ptr < ((size_t)bd + bd->size)) { /* exclude ptrs that aren't actually included in the ptr list */ -#if APC_BINDUMP_DEBUG - printf("[------] "); -#endif - SWIZZLE(bd, *ptr); /* swizzle ptr list */ - ptr_list[i] = *ptr; - } - ptr = zend_llist_get_next(ll); - } - SWIZZLE(bd, bd->entries); - - if(count > 0) { - bd = erealloc(bd, bd->size + (count * sizeof(void**))); - bd->num_swizzled_ptrs = count; - bd->swizzled_ptrs = (void***)((unsigned char *)bd + bd->size -2); /* extra -1 for null termination */ - bd->size += count * sizeof(void**); - memcpy(bd->swizzled_ptrs, ptr_list, count * sizeof(void**)); - SWIZZLE(bd, bd->swizzled_ptrs); - } else { - bd->num_swizzled_ptrs = 0; - bd->swizzled_ptrs = NULL; - } - ((unsigned char*)bd)[((bd->size >= 1) ? (bd->size-1) : 0)] = 0; /* silence null termination for zval strings */ - efree(ptr_list); - bd->swizzled = 1; - - /* Generate MD5/CRC32 checksum */ - memset(bd->md5, 0, 16); - bd->crc=0; - - PHP_MD5Init(&context); - PHP_MD5Update(&context, (const unsigned char*)bd, bd->size); - PHP_MD5Final(digest, &context); - crc = apc_crc32((unsigned char*)bd, bd->size); - - memmove(bd->md5, digest, 16); - bd->crc = crc; - - return bd; -} /* }}} */ - -/* {{{ apc_unswizzle_bd */ -static int apc_unswizzle_bd(apc_bd_t *bd, int flags TSRMLS_DC) { - unsigned int i; - unsigned char md5_orig[16]; - unsigned char digest[16]; - PHP_MD5_CTX context; - register php_uint32 crc; - php_uint32 crc_orig; - - /* Verify the md5 or crc32 before we unswizzle */ - memmove(md5_orig, bd->md5, 16); - memset(bd->md5, 0, 16); - crc_orig = bd->crc; - bd->crc=0; - - if(flags & APC_BIN_VERIFY_MD5) { - PHP_MD5Init(&context); - PHP_MD5Update(&context, (const unsigned char*)bd, bd->size); - PHP_MD5Final(digest, &context); - if(memcmp(md5_orig, digest, 16)) { - apc_error("MD5 checksum of binary dump failed." TSRMLS_CC); - return -1; - } - } - if(flags & APC_BIN_VERIFY_CRC32) { - crc = apc_crc32((unsigned char*)bd, bd->size); - if(crc_orig != crc) { - apc_error("CRC32 checksum of binary dump failed." TSRMLS_CC); - return -1; - } - } - memcpy(bd->md5, md5_orig, 16); /* add back md5 checksum */ - bd->crc = crc_orig; - - UNSWIZZLE(bd, bd->entries); - UNSWIZZLE(bd, bd->swizzled_ptrs); - for(i=0; i < bd->num_swizzled_ptrs; i++) { - if(bd->swizzled_ptrs[i]) { - UNSWIZZLE(bd, bd->swizzled_ptrs[i]); - if(*bd->swizzled_ptrs[i] && (*bd->swizzled_ptrs[i] < (void*)bd)) { - UNSWIZZLE(bd, *bd->swizzled_ptrs[i]); - } - } - } - - bd->swizzled=0; - - return 0; -} /* }}} */ - -/* {{{ apc_bin_checkfilter */ -static int apc_bin_checkfilter(HashTable *filter, const char *key, uint key_len) { - zval **zptr; - - if(filter == NULL) { - return 1; - } - - if(zend_hash_find(filter, (char*)key, key_len, (void**)&zptr) == SUCCESS) { - if(Z_TYPE_PP(zptr) == IS_LONG && Z_LVAL_PP(zptr) == 0) { - return 0; - } - } else { - return 0; - } - - - return 1; -} /* }}} */ - -/* {{{ apc_bin_dump */ -PHP_APCU_API apc_bd_t* apc_bin_dump(apc_cache_t* cache, HashTable *user_vars TSRMLS_DC) { - apc_cache_slot_t *sp; - apc_bd_entry_t *ep; - int i, count=0; - apc_bd_t *bd; - zend_llist ll; - size_t size=0; - apc_context_t ctxt; - void *pool_ptr; - - zend_llist_init(&ll, sizeof(void*), NULL, 0); - zend_hash_init(&APCG(apc_bd_alloc_list), 0, NULL, NULL, 0); - - /* flip the hash for faster filter checking */ - user_vars = apc_flip_hash(user_vars); - - APC_RLOCK(cache->header); - - /* get size and entry counts */ - for(i=0; i < cache->nslots; i++) { - sp = cache->slots[i]; - for(; sp != NULL; sp = sp->next) { - if(apc_bin_checkfilter(user_vars, sp->key.str, sp->key.len)) { - size += sizeof(apc_bd_entry_t*) + sizeof(apc_bd_entry_t); - size += sp->value->mem_size - (sizeof(apc_cache_entry_t)); - count++; - } - } - } - - size += sizeof(apc_bd_t) +1; /* +1 for null termination */ - bd = emalloc(size); - bd->size = (unsigned int)size; - pool_ptr = emalloc(sizeof(apc_pool)); - apc_bd_alloc_ex(pool_ptr, sizeof(apc_pool) TSRMLS_CC); - - ctxt.serializer = cache->serializer; - ctxt.pool = apc_pool_create(APC_UNPOOL, apc_bd_alloc, apc_bd_free, NULL, NULL TSRMLS_CC); /* ideally the pool wouldn't be alloc'd as part of this */ - if (!ctxt.pool) { /* TODO need to cleanup */ - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); - return NULL; - } - - ctxt.copy = APC_COPY_OTHER; /* avoid stupid ALLOC_ZVAL calls here, hack */ - apc_bd_alloc_ex((void*)((size_t)bd + sizeof(apc_bd_t)), bd->size - sizeof(apc_bd_t) -1 TSRMLS_CC); - bd->num_entries = count; - bd->entries = apc_bd_alloc_ex(NULL, sizeof(apc_bd_entry_t) * count TSRMLS_CC); - - /* User entries */ - zend_hash_init(&ctxt.copied, 0, NULL, NULL, 0); - count = 0; - for(i=0; i < cache->nslots; i++) { - sp = cache->slots[i]; - for(; sp != NULL; sp = sp->next) { - if(apc_bin_checkfilter(user_vars, sp->key.str, sp->key.len)) { - ep = &bd->entries[count]; - - /* copy key with current pool */ - ep->key.str = apc_pmemcpy(sp->key.str, sp->key.len, ctxt.pool TSRMLS_CC); - ep->key.len = sp->key.len; - - if ((Z_TYPE_P(sp->value->val) == IS_ARRAY && cache->serializer) - || Z_TYPE_P(sp->value->val) == IS_OBJECT) { - /* avoiding hash copy, hack */ - uint type = Z_TYPE_P(sp->value->val); - Z_TYPE_P(sp->value->val) = IS_STRING; - ep->val.val = apc_copy_zval(NULL, sp->value->val, &ctxt TSRMLS_CC); - - Z_TYPE_P(ep->val.val) = IS_OBJECT; - sp->value->val->type = type; - } else if (Z_TYPE_P(sp->value->val) == IS_ARRAY && !cache->serializer) { - /* this is a little complicated, we have to unserialize it first, then serialize it again */ - zval *garbage; - ctxt.copy = APC_COPY_OUT; - garbage = apc_copy_zval(NULL, sp->value->val, &ctxt TSRMLS_CC); - ctxt.copy = APC_COPY_IN; - ep->val.val = apc_copy_zval(NULL, garbage, &ctxt TSRMLS_CC); - ep->val.val->type = IS_OBJECT; - /* a memleak can not be avoided: zval_ptr_dtor(&garbage); */ - ctxt.copy = APC_COPY_OTHER; - } else { - ep->val.val = apc_copy_zval(NULL, sp->value->val, &ctxt TSRMLS_CC); - } - ep->val.ttl = sp->value->ttl; - - /* swizzle pointers */ - zend_hash_clean(&ctxt.copied); - if (ep->val.val->type == IS_OBJECT) { - apc_swizzle_ptr(bd, &ctxt, &ll, &bd->entries[count].val.val->value.str.val); - } else { - apc_swizzle_zval(bd, &ctxt, &ll, bd->entries[count].val.val TSRMLS_CC); - } - apc_swizzle_ptr(bd, &ctxt, &ll, &bd->entries[count].val.val); - apc_swizzle_ptr(bd, &ctxt, &ll, &bd->entries[count].key.str); - - count++; - } - } - } - zend_hash_destroy(&ctxt.copied); - ctxt.copied.nTableSize=0; - - /* append swizzle pointer list to bd */ - bd = apc_swizzle_bd(bd, &ll TSRMLS_CC); - zend_llist_destroy(&ll); - zend_hash_destroy(&APCG(apc_bd_alloc_list)); - - APC_RUNLOCK(cache->header); - - if(user_vars) { - zend_hash_destroy(user_vars); - efree(user_vars); - } - - efree(pool_ptr); - - return bd; -} /* }}} */ - -/* {{{ apc_bin_load */ -PHP_APCU_API int apc_bin_load(apc_cache_t* cache, apc_bd_t *bd, int flags TSRMLS_DC) { - apc_bd_entry_t *ep; - uint i; - apc_context_t ctxt; - - if (bd->swizzled) { - if(apc_unswizzle_bd(bd, flags TSRMLS_CC) < 0) { - return -1; - } - } - - for(i = 0; i < bd->num_entries; i++) { - ctxt.pool = apc_pool_create(APC_SMALL_POOL, (apc_malloc_t) apc_sma_malloc, (apc_free_t) apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); - if (!ctxt.pool) { /* TODO need to cleanup previous pools */ - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); - goto failure; - } - ep = &bd->entries[i]; - { - zval *data; - uint use_copy = 0; - switch (Z_TYPE_P(ep->val.val)) { - case IS_OBJECT: - ctxt.copy = APC_COPY_OUT; - data = apc_copy_zval(NULL, ep->val.val, &ctxt TSRMLS_CC); - use_copy = 1; - break; - default: - data = ep->val.val; - break; - } - ctxt.copy = APC_COPY_IN; - - apc_cache_store( - cache, ep->key.str, ep->key.len, data, ep->val.ttl, 0 TSRMLS_CC); - - if (use_copy) { - zval_ptr_dtor(&data); - } - } - } - - return 0; - -failure: - apc_pool_destroy(ctxt.pool TSRMLS_CC); - apc_warning("Unable to allocate memory for apc binary load/dump functionality." TSRMLS_CC); - - HANDLE_UNBLOCK_INTERRUPTIONS(); - return -1; -} /* }}} */ - -/* - * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_bin.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_bin.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_bin.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_bin.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - */ - -/* $Id: apc_bin.h 328743 2012-12-12 07:58:32Z ab $ */ - -#ifndef APC_BIN_H -#define APC_BIN_H - -#include "apc.h" - -#ifndef APC_BIN_API_H -# include "apc_bin_api.h" -#endif - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,424 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | George Schlossnagle | - | Rasmus Lerdorf | - | Arun C. Murthy | - | Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - 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.c 328941 2012-12-31 18:41:07Z ab $ */ - -#include "apc.h" -#include "apc_cache.h" -#include "apc_globals.h" -#include "php.h" - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -/* Deal with problem present until php-5.2.2 where php_pcre.h was not installed correctly */ -# if !HAVE_BUNDLED_PCRE && PHP_MAJOR_VERSION == 5 && (PHP_MINOR_VERSION < 2 || (PHP_MINOR_VERSION == 2 && PHP_RELEASE_VERSION < 2)) -# include "apc_php_pcre.h" -# else -# include "ext/pcre/php_pcre.h" -# endif -# include "ext/standard/php_smart_str.h" -#endif - -#define NELEMS(a) (sizeof(a)/sizeof((a)[0])) - -/* {{{ memory allocation wrappers */ - -PHP_APCU_API void* apc_emalloc(size_t n TSRMLS_DC) -{ - void* p = malloc(n); - if (p == NULL) { - apc_error("apc_emalloc: malloc failed to allocate %u bytes:" TSRMLS_CC, n); - return NULL; - } - return p; -} - -PHP_APCU_API void* apc_erealloc(void* p, size_t n TSRMLS_DC) -{ - void *new; - new = realloc(p, n); - if (new == NULL) { - apc_error("apc_erealloc: realloc failed to allocate %u bytes:" TSRMLS_CC, n); - return NULL; - } - return new; -} - -PHP_APCU_API void apc_efree(void* p TSRMLS_DC) -{ - if (p == NULL) { - apc_error("apc_efree: attempt to free null pointer" TSRMLS_CC); - return; - } - free(p); -} - -PHP_APCU_API void* apc_php_malloc(size_t n TSRMLS_DC) -{ - return emalloc(n); -} - -PHP_APCU_API void apc_php_free(void* p TSRMLS_DC) -{ - efree(p); -} - -PHP_APCU_API char* APC_ALLOC apc_estrdup(const char* s TSRMLS_DC) -{ - int len; - char* dup; - - if (s == NULL) { - return NULL; - } - len = strlen(s); - dup = (char*) malloc(len+1); - if (dup == NULL) { - apc_error("apc_estrdup: malloc failed to allocate %u bytes:" TSRMLS_CC, len+1); - return NULL; - } - memcpy(dup, s, len); - dup[len] = '\0'; - return dup; -} - -PHP_APCU_API void* APC_ALLOC apc_xstrdup(const char* s, apc_malloc_t f TSRMLS_DC) -{ - return s != NULL ? apc_xmemcpy(s, strlen(s)+1, f TSRMLS_CC) : NULL; -} - -PHP_APCU_API void* APC_ALLOC apc_xmemcpy(const void* p, size_t n, apc_malloc_t f TSRMLS_DC) -{ - void* q; - - if (p != NULL && (q = f(n TSRMLS_CC)) != NULL) { - memcpy(q, p, n); - return q; - } - return NULL; -} - -/* }}} */ - -/* {{{ console display functions */ -#ifdef ZTS -# define APC_PRINT_FUNCTION_PARAMETER TSRMLS_C -#else -# define APC_PRINT_FUNCTION_PARAMETER format -#endif - -#define APC_PRINT_FUNCTION(name, verbosity) \ - void apc_##name(const char *format TSRMLS_DC, ...) \ - { \ - va_list args; \ - \ - va_start(args, APC_PRINT_FUNCTION_PARAMETER); \ - php_verror(NULL, "", verbosity, format, args TSRMLS_CC); \ - va_end(args); \ - } - -APC_PRINT_FUNCTION(error, E_ERROR) -APC_PRINT_FUNCTION(warning, E_WARNING) -APC_PRINT_FUNCTION(notice, E_NOTICE) - -#ifdef APC_DEBUG -APC_PRINT_FUNCTION(debug, E_NOTICE) -#else -void apc_debug(const char *format TSRMLS_DC, ...) {} -#endif -/* }}} */ - -/* {{{ string and text manipulation */ - -char* apc_append(const char* s, const char* t TSRMLS_DC) -{ - int slen; - int tlen; - char* p; - - slen = strlen(s); - tlen = strlen(t); - - p = (char*) apc_emalloc((slen + tlen + 1) * sizeof(char) TSRMLS_CC); - memcpy(p, s, slen); - memcpy(p + slen, t, tlen + 1); - - return p; -} - -char* apc_substr(const char* s, int start, int length TSRMLS_DC) -{ - char* substr; - int src_len = strlen(s); - - /* bring start into range */ - if (start < 0) { - start = 0; - } - else if (start >= src_len) { - start = src_len - 1; - } - - /* bring length into range */ - if (length < 0 || src_len - start < length) { - length = src_len - start; - } - - /* create the substring */ - substr = apc_xmemcpy(s + start, length + 1, apc_emalloc TSRMLS_CC); - substr[length] = '\0'; - return substr; -} - -char** apc_tokenize(const char* s, char delim TSRMLS_DC) -{ - char** tokens; /* array of tokens, NULL terminated */ - int size; /* size of tokens array */ - int n; /* index of next token in tokens array */ - int cur; /* current position in input string */ - int end; /* final legal position in input string */ - int next; /* position of next delimiter in input */ - - if (!s) { - return NULL; - } - - size = 2; - n = 0; - cur = 0; - end = strlen(s) - 1; - - tokens = (char**) apc_emalloc(size * sizeof(char*) TSRMLS_CC); - tokens[n] = NULL; - - while (cur <= end) { - /* search for the next delimiter */ - char* p = strchr(s + cur, delim); - next = p ? p-s : end+1; - - /* resize token array if necessary */ - if (n == size-1) { - size *= 2; - tokens = (char**) apc_erealloc(tokens, size * sizeof(char*) TSRMLS_CC); - } - - /* save the current token */ - tokens[n] = apc_substr(s, cur, next-cur TSRMLS_CC); - - tokens[++n] = NULL; - cur = next + 1; - } - - return tokens; -} - -/* }}} */ - -/* {{{ crc32 implementation */ - -/* this table was generated by crc32gen() */ -static unsigned int crc32tab[] = { - /* 0 */ 0x00000000, 0x3b83984b, 0x77073096, 0x4c84a8dd, - /* 4 */ 0xee0e612c, 0xd58df967, 0x990951ba, 0xa28ac9f1, - /* 8 */ 0x076dc419, 0x3cee5c52, 0x706af48f, 0x4be96cc4, - /* 12 */ 0xe963a535, 0xd2e03d7e, 0x9e6495a3, 0xa5e70de8, - /* 16 */ 0x0edb8832, 0x35581079, 0x79dcb8a4, 0x425f20ef, - /* 20 */ 0xe0d5e91e, 0xdb567155, 0x97d2d988, 0xac5141c3, - /* 24 */ 0x09b64c2b, 0x3235d460, 0x7eb17cbd, 0x4532e4f6, - /* 28 */ 0xe7b82d07, 0xdc3bb54c, 0x90bf1d91, 0xab3c85da, - /* 32 */ 0x1db71064, 0x2634882f, 0x6ab020f2, 0x5133b8b9, - /* 36 */ 0xf3b97148, 0xc83ae903, 0x84be41de, 0xbf3dd995, - /* 40 */ 0x1adad47d, 0x21594c36, 0x6ddde4eb, 0x565e7ca0, - /* 44 */ 0xf4d4b551, 0xcf572d1a, 0x83d385c7, 0xb8501d8c, - /* 48 */ 0x136c9856, 0x28ef001d, 0x646ba8c0, 0x5fe8308b, - /* 52 */ 0xfd62f97a, 0xc6e16131, 0x8a65c9ec, 0xb1e651a7, - /* 56 */ 0x14015c4f, 0x2f82c404, 0x63066cd9, 0x5885f492, - /* 60 */ 0xfa0f3d63, 0xc18ca528, 0x8d080df5, 0xb68b95be, - /* 64 */ 0x3b6e20c8, 0x00edb883, 0x4c69105e, 0x77ea8815, - /* 68 */ 0xd56041e4, 0xeee3d9af, 0xa2677172, 0x99e4e939, - /* 72 */ 0x3c03e4d1, 0x07807c9a, 0x4b04d447, 0x70874c0c, - /* 76 */ 0xd20d85fd, 0xe98e1db6, 0xa50ab56b, 0x9e892d20, - /* 80 */ 0x35b5a8fa, 0x0e3630b1, 0x42b2986c, 0x79310027, - /* 84 */ 0xdbbbc9d6, 0xe038519d, 0xacbcf940, 0x973f610b, - /* 88 */ 0x32d86ce3, 0x095bf4a8, 0x45df5c75, 0x7e5cc43e, - /* 92 */ 0xdcd60dcf, 0xe7559584, 0xabd13d59, 0x9052a512, - /* 96 */ 0x26d930ac, 0x1d5aa8e7, 0x51de003a, 0x6a5d9871, - /* 100 */ 0xc8d75180, 0xf354c9cb, 0xbfd06116, 0x8453f95d, - /* 104 */ 0x21b4f4b5, 0x1a376cfe, 0x56b3c423, 0x6d305c68, - /* 108 */ 0xcfba9599, 0xf4390dd2, 0xb8bda50f, 0x833e3d44, - /* 112 */ 0x2802b89e, 0x138120d5, 0x5f058808, 0x64861043, - /* 116 */ 0xc60cd9b2, 0xfd8f41f9, 0xb10be924, 0x8a88716f, - /* 120 */ 0x2f6f7c87, 0x14ece4cc, 0x58684c11, 0x63ebd45a, - /* 124 */ 0xc1611dab, 0xfae285e0, 0xb6662d3d, 0x8de5b576, - /* 128 */ 0x76dc4190, 0x4d5fd9db, 0x01db7106, 0x3a58e94d, - /* 132 */ 0x98d220bc, 0xa351b8f7, 0xefd5102a, 0xd4568861, - /* 136 */ 0x71b18589, 0x4a321dc2, 0x06b6b51f, 0x3d352d54, - /* 140 */ 0x9fbfe4a5, 0xa43c7cee, 0xe8b8d433, 0xd33b4c78, - /* 144 */ 0x7807c9a2, 0x438451e9, 0x0f00f934, 0x3483617f, - /* 148 */ 0x9609a88e, 0xad8a30c5, 0xe10e9818, 0xda8d0053, - /* 152 */ 0x7f6a0dbb, 0x44e995f0, 0x086d3d2d, 0x33eea566, - /* 156 */ 0x91646c97, 0xaae7f4dc, 0xe6635c01, 0xdde0c44a, - /* 160 */ 0x6b6b51f4, 0x50e8c9bf, 0x1c6c6162, 0x27eff929, - /* 164 */ 0x856530d8, 0xbee6a893, 0xf262004e, 0xc9e19805, - /* 168 */ 0x6c0695ed, 0x57850da6, 0x1b01a57b, 0x20823d30, - /* 172 */ 0x8208f4c1, 0xb98b6c8a, 0xf50fc457, 0xce8c5c1c, - /* 176 */ 0x65b0d9c6, 0x5e33418d, 0x12b7e950, 0x2934711b, - /* 180 */ 0x8bbeb8ea, 0xb03d20a1, 0xfcb9887c, 0xc73a1037, - /* 184 */ 0x62dd1ddf, 0x595e8594, 0x15da2d49, 0x2e59b502, - /* 188 */ 0x8cd37cf3, 0xb750e4b8, 0xfbd44c65, 0xc057d42e, - /* 192 */ 0x4db26158, 0x7631f913, 0x3ab551ce, 0x0136c985, - /* 196 */ 0xa3bc0074, 0x983f983f, 0xd4bb30e2, 0xef38a8a9, - /* 200 */ 0x4adfa541, 0x715c3d0a, 0x3dd895d7, 0x065b0d9c, - /* 204 */ 0xa4d1c46d, 0x9f525c26, 0xd3d6f4fb, 0xe8556cb0, - /* 208 */ 0x4369e96a, 0x78ea7121, 0x346ed9fc, 0x0fed41b7, - /* 212 */ 0xad678846, 0x96e4100d, 0xda60b8d0, 0xe1e3209b, - /* 216 */ 0x44042d73, 0x7f87b538, 0x33031de5, 0x088085ae, - /* 220 */ 0xaa0a4c5f, 0x9189d414, 0xdd0d7cc9, 0xe68ee482, - /* 224 */ 0x5005713c, 0x6b86e977, 0x270241aa, 0x1c81d9e1, - /* 228 */ 0xbe0b1010, 0x8588885b, 0xc90c2086, 0xf28fb8cd, - /* 232 */ 0x5768b525, 0x6ceb2d6e, 0x206f85b3, 0x1bec1df8, - /* 236 */ 0xb966d409, 0x82e54c42, 0xce61e49f, 0xf5e27cd4, - /* 240 */ 0x5edef90e, 0x655d6145, 0x29d9c998, 0x125a51d3, - /* 244 */ 0xb0d09822, 0x8b530069, 0xc7d7a8b4, 0xfc5430ff, - /* 248 */ 0x59b33d17, 0x6230a55c, 0x2eb40d81, 0x153795ca, - /* 252 */ 0xb7bd5c3b, 0x8c3ec470, 0xc0ba6cad, 0xfb39f4e6, -}; - -unsigned int apc_crc32(const unsigned char* buf, unsigned int len) -{ - unsigned int i; - int k; - unsigned int crc; - - /* preconditioning */ - crc = 0xFFFFFFFF; - - for (i = 0; i < len; i++) { - k = (crc ^ buf[i]) & 0x000000FF; - assert(k >= 0 && k <= 255); - crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[k]; - } - - /* postconditioning */ - return ~crc; -} /* }}} */ - -/* {{{ apc_flip_hash */ -HashTable* apc_flip_hash(HashTable *hash) { - zval **entry, *data; - HashTable *new_hash; - HashPosition pos; - - if(hash == NULL) return hash; - - MAKE_STD_ZVAL(data); - ZVAL_LONG(data, 1); - - new_hash = emalloc(sizeof(HashTable)); - zend_hash_init(new_hash, hash->nTableSize, NULL, ZVAL_PTR_DTOR, 0); - - zend_hash_internal_pointer_reset_ex(hash, &pos); - while (zend_hash_get_current_data_ex(hash, (void **)&entry, &pos) == SUCCESS) { - if(Z_TYPE_PP(entry) == IS_STRING) { - zend_hash_update(new_hash, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) +1, &data, sizeof(data), NULL); - } else { - zend_hash_index_update(new_hash, Z_LVAL_PP(entry), &data, sizeof(data), NULL); - } - Z_ADDREF_P(data); - zend_hash_move_forward_ex(hash, &pos); - } - zval_ptr_dtor(&data); - - return new_hash; -} -/* }}} */ - -/* -* Serializer API -*/ -#define APC_MAX_SERIALIZERS 16 - -/* pointer to the list of serializers */ -static apc_serializer_t apc_serializers[APC_MAX_SERIALIZERS] = {{0,}}; -/* }}} */ - -/* {{{ apc_register_serializer */ -PHP_APCU_API int _apc_register_serializer(const char* name, - apc_serialize_t serialize, - apc_unserialize_t unserialize, - void *config TSRMLS_DC) { - int i; - apc_serializer_t *serializer; - - for(i = 0; i < APC_MAX_SERIALIZERS; i++) { - serializer = &apc_serializers[i]; - if(!serializer->name) { - /* empty entry */ - serializer->name = name; - serializer->serialize = serialize; - serializer->unserialize = unserialize; - serializer->config = config; - if (i < APC_MAX_SERIALIZERS - 1) { - apc_serializers[i+1].name = NULL; - } - return 1; - } - } - - return 0; -} /* }}} */ - -/* {{{ apc_get_serializers */ -PHP_APCU_API apc_serializer_t* apc_get_serializers(TSRMLS_D) { - return &(apc_serializers[0]); -} /* }}} */ - -/* {{{ apc_find_serializer */ -PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name TSRMLS_DC) { - int i; - apc_serializer_t *serializer; - - for(i = 0; i < APC_MAX_SERIALIZERS; i++) { - serializer = &apc_serializers[i]; - if(serializer->name && (strcmp(serializer->name, name) == 0)) { - return serializer; - } - } - return NULL; -} /* }}} */ - -/* - * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_cache_api.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_cache_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_cache_api.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_cache_api.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,421 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | 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. - - */ - -/* $Id: apc_cache.h 328172 2012-10-28 21:44:47Z rasmus $ */ - -#ifndef APC_CACHE_API_H -#define APC_CACHE_API_H - -/* {{{ used for slam defense to determine the context which created any key */ -#ifdef ZTS -typedef void*** apc_cache_owner_t; -#else -typedef pid_t apc_cache_owner_t; -#endif /* }}} */ - -/* {{{ struct definition: apc_cache_key_t */ -typedef struct apc_cache_key_t apc_cache_key_t; -struct apc_cache_key_t { - const char *str; /* pointer to constant string key */ - zend_uint len; /* length of data at str */ - zend_ulong h; /* pre-computed hash of key */ - time_t mtime; /* the mtime of this cached entry */ - apc_cache_owner_t owner; /* the context that created this key */ -}; /* }}} */ - -/* {{{ struct definition: apc_cache_entry_t */ -typedef struct apc_cache_entry_t apc_cache_entry_t; -struct apc_cache_entry_t { - zval *val; /* the zval copied at store time */ - zend_uint ttl; /* the ttl on this specific entry */ - int ref_count; /* the reference count of this entry */ - size_t mem_size; /* memory used */ - apc_pool *pool; /* pool which allocated the value */ -}; -/* }}} */ - -/* {{{ struct definition: apc_cache_slot_t */ -typedef struct apc_cache_slot_t apc_cache_slot_t; -struct apc_cache_slot_t { - apc_cache_key_t key; /* slot key */ - apc_cache_entry_t* value; /* slot value */ - apc_cache_slot_t* next; /* next slot in linked list */ - zend_ulong nhits; /* number of hits to this slot */ - time_t ctime; /* time slot was initialized */ - time_t dtime; /* time slot was removed from cache */ - time_t atime; /* time slot was last accessed */ -}; -/* }}} */ - -/* {{{ state constants */ -#define APC_CACHE_ST_NONE 0 -#define APC_CACHE_ST_BUSY 0x00000001 /* }}} */ - -/* {{{ struct definition: apc_cache_header_t - Any values that must be shared among processes should go in here. */ -typedef struct _apc_cache_header_t { - apc_lock_t lock; /* header lock */ - zend_ulong nhits; /* hit count */ - zend_ulong nmisses; /* miss count */ - zend_ulong ninserts; /* insert count */ - zend_ulong nexpunges; /* expunge count */ - zend_ulong nentries; /* entry count */ - zend_ulong mem_size; /* used */ - time_t stime; /* start time */ - zend_ushort state; /* cache state */ - apc_cache_key_t lastkey; /* last key inserted (not necessarily without error) */ - apc_cache_slot_t* gc; /* gc list */ -} apc_cache_header_t; /* }}} */ - -/* {{{ struct definition: apc_cache_t */ -typedef struct _apc_cache_t { - void* shmaddr; /* process (local) address of shared cache */ - apc_cache_header_t* header; /* cache header (stored in SHM) */ - apc_cache_slot_t** slots; /* array of cache slots (stored in SHM) */ - apc_sma_t* sma; /* shared memory allocator */ - apc_serializer_t* serializer; /* serializer */ - zend_ulong nslots; /* number of slots in cache */ - zend_ulong gc_ttl; /* maximum time on GC list for a slot */ - zend_ulong ttl; /* if slot is needed and entry's access time is older than this ttl, remove it */ - zend_ulong smart; /* smart parameter for gc */ - zend_bool defend; /* defense parameter for runtime */ -} apc_cache_t; /* }}} */ - -/* {{{ typedef: apc_cache_updater_t */ -typedef zend_bool (*apc_cache_updater_t)(apc_cache_t*, apc_cache_entry_t*, void* data); /* }}} */ - -/* - * apc_cache_create creates the shared memory cache. - * - * This function should be called once per process per cache - * - * serializer for APCu is set by globals on MINIT and ensured with apc_cache_serializer - * during execution. Using apc_cache_serializer avoids race conditions between MINIT/RINIT of - * APCU and the third party serializer. API users can choose to leave this null to use default - * PHP serializers, or search the list of serializers for the preferred serializer - * - * size_hint is a "hint" at the total number entries that will be expected. - * It determines the physical size of the hash table. Passing 0 for - * this argument will use a reasonable default value - * - * gc_ttl is the maximum time a cache entry may speed on the garbage - * collection list. This is basically a work around for the inherent - * unreliability of our reference counting mechanism (see apc_cache_release). - * - * ttl is the maximum time a cache entry can idle in a slot in case the slot - * is needed. This helps in cleaning up the cache and ensuring that entries - * hit frequently stay cached and ones not hit very often eventually disappear. - * - * for an explanation of smart, see apc_cache_default_expunge - * - * defend enables/disables slam defense for this particular cache - */ -PHP_APCU_API apc_cache_t* apc_cache_create(apc_sma_t* sma, - apc_serializer_t* serializer, - int size_hint, - int gc_ttl, - int ttl, - long smart, - zend_bool defend TSRMLS_DC); -/* -* apc_cache_preload preloads the data at path into the specified cache -*/ -PHP_APCU_API zend_bool apc_cache_preload(apc_cache_t* cache, - const char* path TSRMLS_DC); - -/* - * apc_cache_destroy releases any OS resources associated with a cache object. - * Under apache, this function can be safely called by the child processes - * when they exit. - */ -PHP_APCU_API void apc_cache_destroy(apc_cache_t* cache TSRMLS_DC); - -/* - * apc_cache_clear empties a cache. This can safely be called at any time. - */ -PHP_APCU_API void apc_cache_clear(apc_cache_t* cache TSRMLS_DC); - -/* -* apc_cache_make_context initializes a context with an appropriate pool and options provided -* -* Some of the APC API requires a context in which to operate -* -* The type of context required depends on the operation being performed, for example -* an insert should happen in a shared context, a fetch should happen in a nonshared context -*/ -PHP_APCU_API zend_bool apc_cache_make_context(apc_cache_t* cache, - apc_context_t* context, - apc_context_type context_type, - apc_pool_type pool_type, - apc_copy_type copy_type, - uint force_update TSRMLS_DC); - -/* -* apc_cache_make_context_ex is an advanced/external version of make_context -*/ -PHP_APCU_API zend_bool apc_cache_make_context_ex(apc_context_t* context, - apc_serializer_t* serializer, - apc_malloc_t _malloc, - apc_free_t _free, - apc_protect_t _protect, - apc_unprotect_t _unprotect, - apc_pool_type pool_type, - apc_copy_type copy_type, - uint force_update TSRMLS_DC); -/* -* apc_context_destroy should be called when a context is finished being used -*/ -PHP_APCU_API zend_bool apc_cache_destroy_context(apc_context_t* context TSRMLS_DC); - -/* - * apc_cache_insert adds an entry to the cache. - * Returns true if the entry was successfully inserted, false otherwise. - * If false is returned, the caller must free the cache entry by calling - * apc_cache_free_entry (see below). - * - * key is the value created by apc_cache_make_key - * - * value is a cache entry returned by apc_cache_make_entry (see below). - * - * an easier API exists in the form of apc_cache_store - */ -PHP_APCU_API zend_bool apc_cache_insert(apc_cache_t* cache, - apc_cache_key_t key, - apc_cache_entry_t* value, - apc_context_t* ctxt, - time_t t, - zend_bool exclusive TSRMLS_DC); - -/* - * apc_cache_store creates key, entry and context in which to make an insertion of val into the specified cache - */ -PHP_APCU_API zend_bool apc_cache_store(apc_cache_t* cache, - char *strkey, - zend_uint keylen, - const zval *val, - const zend_uint ttl, - const zend_bool exclusive TSRMLS_DC); -/* -* apc_cache_update updates an entry in place, this is used for rfc1867 and inc/dec/cas -*/ -PHP_APCU_API zend_bool apc_cache_update(apc_cache_t* cache, - char *strkey, - zend_uint keylen, - apc_cache_updater_t updater, - void* data TSRMLS_DC); - -/* - * apc_cache_find searches for a cache entry by its hashed identifier, - * and returns a pointer to the entry if found, NULL otherwise. - * - */ -PHP_APCU_API apc_cache_entry_t* apc_cache_find(apc_cache_t* cache, - char* strkey, - zend_uint keylen, - time_t t TSRMLS_DC); - -/* - * apc_cache_fetch fetches an entry from the cache directly into dst - * - */ -PHP_APCU_API zend_bool apc_cache_fetch(apc_cache_t* cache, - char* strkey, - zend_uint keylen, - time_t t, - zval **dst TSRMLS_DC); - -/* - * apc_cache_exists searches for a cache entry by its hashed identifier, - * and returns a pointer to the entry if found, NULL otherwise. This is a - * quick non-locking version of apc_cache_find that does not modify the - * shared memory segment in any way. - * - */ -PHP_APCU_API apc_cache_entry_t* apc_cache_exists(apc_cache_t* cache, - char* strkey, - zend_uint keylen, - time_t t TSRMLS_DC); - -/* - * apc_cache_delete and apc_cache_delete finds an entry in the cache and deletes it. - */ -PHP_APCU_API zend_bool apc_cache_delete(apc_cache_t* cache, - char *strkey, - zend_uint keylen TSRMLS_DC); - -/* apc_cach_fetch_zval takes a zval in the cache and reconstructs a runtime - * zval from it. - * - */ -PHP_APCU_API zval* apc_cache_fetch_zval(apc_context_t* ctxt, - zval* dst, - const zval* src TSRMLS_DC); - -/* - * apc_cache_release decrements the reference count associated with a cache - * entry. Calling apc_cache_find automatically increments the reference count, - * and this function must be called post-execution to return the count to its - * original value. Failing to do so will prevent the entry from being - * garbage-collected. - * - * entry is the cache entry whose ref count you want to decrement. - */ -PHP_APCU_API void apc_cache_release(apc_cache_t* cache, - apc_cache_entry_t* entry TSRMLS_DC); - -/* -* apc_cache_make_key creates an apc_cache_key_t from an identifier, it's length and the current time -*/ -PHP_APCU_API zend_bool apc_cache_make_key(apc_cache_key_t* key, - char* str, - zend_ulong len TSRMLS_DC); - -/* - * apc_cache_make_entry creates an apc_cache_entry_t given a zval, context and ttl - */ -PHP_APCU_API apc_cache_entry_t* apc_cache_make_entry(apc_context_t* ctxt, - apc_cache_key_t* key, - const zval *val, - const zend_uint ttl TSRMLS_DC); - -/* - fetches information about the cache provided for userland status functions -*/ -PHP_APCU_API zval* apc_cache_info(apc_cache_t* cache, - zend_bool limited TSRMLS_DC); - -/* - fetches information about the key provided -*/ -PHP_APCU_API zval* apc_cache_stat(apc_cache_t* cache, - char *strkey, - zend_uint keylen TSRMLS_DC); - -/* -* apc_cache_busy returns true while the cache is busy -* -* a cache is considered busy when any of the following occur: -* a) the cache becomes busy when the allocator beneath it is running out of resources -* b) a clear of the cache was requested -* c) garbage collection is in progress -* -* Note: garbage collection can be invoked by the SMA and is invoked on insert -*/ -PHP_APCU_API zend_bool apc_cache_busy(apc_cache_t* cache TSRMLS_DC); - -/* -* apc_cache_defense: guard against slamming a key -* will return true if the following conditions are met: -* the key provided has a matching hash and length to the last key inserted into cache -* the last key has a different owner -* in ZTS mode, TSRM determines owner -* in non-ZTS mode, PID determines owner -* Note: this function sets the owner of key during execution -*/ -PHP_APCU_API zend_bool apc_cache_defense(apc_cache_t* cache, - apc_cache_key_t* key TSRMLS_DC); - -/* -* apc_cache_serializer -* sets the serializer for a cache, and by proxy contexts created for the cache -* Note: this avoids race conditions between third party serializers and APCu -*/ -PHP_APCU_API void apc_cache_serializer(apc_cache_t* cache, const char* name TSRMLS_DC); - -/* -* The remaining functions allow a third party to reimplement expunge -* -* Look at the source of apc_cache_default_expunge for what is expected of this function -* -* The default behaviour of expunge is explained below, should no combination of those options -* be suitable, you will need to reimplement apc_cache_default_expunge and pass it to your -* call to apc_sma_api_impl, this will replace the default functionality. -* The functions below you can use during your own implementation of expunge to gain more -* control over how the expunge process works ... -* -* Note: beware of locking (copy it exactly), setting states is also important -*/ - -/* {{{ apc_cache_default_expunge -* Where smart is not set: -* Where no ttl is set on cache: -* 1) Perform cleanup of stale entries -* 2) Expunge if available memory is less than sma->size/2 -* Where ttl is set on cache: -* 1) Perform cleanup of stale entries -* 2) If available memory if less than the size requested, run full expunge -* -* Where smart is set: -* Where no ttl is set on cache: -* 1) Perform cleanup of stale entries -* 2) Expunge is available memory is less than size * smart -* Where ttl is set on cache: -* 1) Perform cleanup of stale entries -* 2) If available memory if less than the size requested, run full expunge -* -* The TTL of an entry takes precedence over the TTL of a cache -*/ -PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size TSRMLS_DC); - -/* -* The remaining functions are used during the APCu implementation of expunge -*/ - -/* -* apc_cache_real_expunge: trashes the whole cache -* -* Note: it is assumed you have a write lock on the header when you enter real expunge -*/ -PHP_APCU_API void apc_cache_real_expunge(apc_cache_t* cache TSRMLS_DC); - -/* -* apc_cache_gc: runs garbage collection on cache -* -* Note: it is assumed you have a write lock on the header when you enter gc -*/ -PHP_APCU_API void apc_cache_gc(apc_cache_t* cache TSRMLS_DC); - -/* -* apc_cache_remove_slot: removes slot -* -* if no references remain, the slot is free'd immediately -* if there are references remaining, the slot is trashed -* -* Note: it is assumed you have a write lock on the header when you remove slots -*/ -PHP_APCU_API void apc_cache_remove_slot(apc_cache_t* cache, apc_cache_slot_t** slot TSRMLS_DC); -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_cache.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_cache.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_cache.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_cache.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1711 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | Rasmus Lerdorf | - | Arun C. Murthy | - | Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - 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_cache.c 328743 2012-12-12 07:58:32Z ab $ */ - -#include "apc_cache.h" -#include "apc_sma.h" -#include "apc_globals.h" -#include "php_scandir.h" -#include "SAPI.h" -#include "TSRM.h" -#include "php_main.h" -#include "ext/standard/md5.h" -#include "ext/standard/php_var.h" -#include "ext/standard/php_smart_str.h" - -typedef void* (*ht_copy_fun_t)(void*, void*, apc_context_t* TSRMLS_DC); -typedef int (*ht_check_copy_fun_t)(Bucket*, va_list); - -#define CHECK(p) { if ((p) == NULL) return NULL; } - -static APC_HOTSPOT zval* my_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC); -static HashTable* my_copy_hashtable_ex(HashTable*, HashTable* TSRMLS_DC, ht_copy_fun_t, int, apc_context_t*, ht_check_copy_fun_t, ...); -#define my_copy_hashtable( dst, src, copy_fn, holds_ptr, ctxt) \ - my_copy_hashtable_ex(dst, src TSRMLS_CC, copy_fn, holds_ptr, ctxt, NULL) - -/* {{{ make_prime */ -static int const primes[] = { - 257, /* 256 */ - 521, /* 512 */ - 1031, /* 1024 */ - 2053, /* 2048 */ - 3079, /* 3072 */ - 4099, /* 4096 */ - 5147, /* 5120 */ - 6151, /* 6144 */ - 7177, /* 7168 */ - 8209, /* 8192 */ - 9221, /* 9216 */ -10243, /* 10240 */ -11273, /* 11264 */ -12289, /* 12288 */ -13313, /* 13312 */ -14341, /* 14336 */ -15361, /* 15360 */ -16411, /* 16384 */ -17417, /* 17408 */ -18433, /* 18432 */ -19457, /* 19456 */ -0 /* sentinel */ -}; - -static int make_prime(int n) -{ - int *k = (int*)primes; - while(*k) { - if((*k) > n) return *k; - k++; - } - return *(k-1); -} -/* }}} */ - -/* {{{ make_slot */ -apc_cache_slot_t* make_slot(apc_cache_t* cache, apc_cache_key_t *key, apc_cache_entry_t* value, apc_cache_slot_t* next, time_t t TSRMLS_DC) -{ - apc_cache_slot_t* p = NULL; - - /* allocate slot */ - if ((p = value->pool->palloc(value->pool, sizeof(apc_cache_slot_t) TSRMLS_CC))) { - - /* copy identifier */ - char* strkey = (char*) apc_pmemcpy( - key->str, key->len, - value->pool TSRMLS_CC - ); - - if (strkey) { - /* set idenfieir */ - key->str = strkey; - - /* set slot data */ - p->key = key[0]; - p->value = value; - - /* set slot relation */ - p->next = next; - - /* set slot defaults */ - p->nhits = 0; - p->ctime = t; - p->atime = t; - p->dtime = 0; - } - } - - return p; -} -/* }}} */ - -/* {{{ free_slot */ -static void free_slot(apc_cache_slot_t* slot TSRMLS_DC) -{ - /* destroy slot pool */ - apc_pool_destroy( - slot->value->pool TSRMLS_CC); -} -/* }}} */ - -/* {{{ apc_cache_hash_slot - Note: These calculations can and should be done outside of a lock */ -static void apc_cache_hash_slot(apc_cache_t* cache, - char *str, - zend_uint len, - zend_ulong* hash, - zend_ulong* slot) { - (*hash) = zend_inline_hash_func(str, len); - (*slot) = (*hash) % (cache->nslots); -} /* }}} */ - -/* {{{ apc_cache_remove_slot */ -PHP_APCU_API void apc_cache_remove_slot(apc_cache_t* cache, apc_cache_slot_t** slot TSRMLS_DC) -{ - apc_cache_slot_t* dead = *slot; - - /* think here is safer */ - *slot = (*slot)->next; - - /* adjust header info */ - if (cache->header->mem_size) - cache->header->mem_size -= dead->value->mem_size; - - if (cache->header->nentries) - cache->header->nentries--; - - /* remove if there are no references */ - if (dead->value->ref_count <= 0) { - free_slot(dead TSRMLS_CC); - } else { - /* add to gc if there are still refs */ - dead->next = cache->header->gc; - dead->dtime = time(0); - cache->header->gc = dead; - } -} -/* }}} */ - -/* {{{ apc_cache_gc */ -PHP_APCU_API void apc_cache_gc(apc_cache_t* cache TSRMLS_DC) -{ - /* This function scans the list of removed cache entries and deletes any - * entry whose reference count is zero or that has been on the gc - * list for more than cache->gc_ttl seconds - * (we issue a warning in the latter case). - */ - if (!cache || !cache->header->gc) { - return; - } - - { - apc_cache_slot_t** slot = &cache->header->gc; - - while (*slot != NULL) { - time_t now = time(0); - time_t gc_sec = cache->gc_ttl ? (now - (*slot)->dtime) : 0; - - if (!(*slot)->value->ref_count || gc_sec > (time_t)cache->gc_ttl) { - apc_cache_slot_t* dead = *slot; - - /* good ol' whining */ - if (dead->value->ref_count > 0) { - apc_debug( - "GC cache entry '%s' was on gc-list for %d seconds" TSRMLS_CC, - dead->key.str, gc_sec - ); - } - - /* set next slot */ - *slot = dead->next; - - /* free slot */ - free_slot( - dead TSRMLS_CC); - - /* next */ - continue; - - } else { - slot = &(*slot)->next; - } - } - } -} -/* }}} */ - -/* {{{ php serializer */ -PHP_APCU_API int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS) -{ - smart_str strbuf = {0}; - php_serialize_data_t var_hash; - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&strbuf, (zval**)&value, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - if(strbuf.c) { - *buf = (unsigned char*)strbuf.c; - *buf_len = strbuf.len; - smart_str_0(&strbuf); - return 1; - } - return 0; -} /* }}} */ - -/* {{{ php unserializer */ -PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS) -{ - const unsigned char *tmp = buf; - php_unserialize_data_t var_hash; - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if(!php_var_unserialize(value, &tmp, buf + buf_len, &var_hash TSRMLS_CC)) { - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zval_dtor(*value); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %ld bytes", (long)(tmp - buf), (long)buf_len); - (*value)->type = IS_NULL; - return 0; - } - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - return 1; -} /* }}} */ - -/* {{{ apc_cache_create */ -PHP_APCU_API apc_cache_t* apc_cache_create(apc_sma_t* sma, apc_serializer_t* serializer, int size_hint, int gc_ttl, int ttl, long smart, zend_bool defend TSRMLS_DC) { - apc_cache_t* cache; - int cache_size; - int nslots; - - /* calculate number of slots */ - nslots = make_prime(size_hint > 0 ? size_hint : 2000); - - /* allocate pointer by normal means */ - cache = (apc_cache_t*) apc_emalloc(sizeof(apc_cache_t) TSRMLS_CC); - - /* calculate cache size for shm allocation */ - cache_size = sizeof(apc_cache_header_t) + nslots*sizeof(apc_cache_slot_t*); - - /* allocate shm */ - cache->shmaddr = sma->smalloc(cache_size TSRMLS_CC); - if(!cache->shmaddr) { - apc_error("Unable to allocate shared memory for cache structures. (Perhaps your shared memory size isn't large enough?). " TSRMLS_CC); - return NULL; - } - - /* zero shm */ - memset(cache->shmaddr, 0, cache_size); - - /* set default header */ - cache->header = (apc_cache_header_t*) cache->shmaddr; - - cache->header->nhits = 0; - cache->header->nmisses = 0; - cache->header->nentries = 0; - cache->header->nexpunges = 0; - cache->header->gc = NULL; - cache->header->stime = time(NULL); - cache->header->state |= APC_CACHE_ST_NONE; - - /* set cache options */ - cache->slots = (apc_cache_slot_t**) (((char*) cache->shmaddr) + sizeof(apc_cache_header_t)); - cache->sma = sma; - cache->serializer = serializer; - cache->nslots = nslots; - cache->gc_ttl = gc_ttl; - cache->ttl = ttl; - cache->smart = smart; - cache->defend = defend; - - /* header lock */ - CREATE_LOCK(&cache->header->lock); - - /* zero slots */ - memset(cache->slots, 0, sizeof(apc_cache_slot_t*)*nslots); - - return cache; -} /* }}} */ - -/* {{{ apc_cache_store */ -PHP_APCU_API zend_bool apc_cache_store(apc_cache_t* cache, char *strkey, zend_uint keylen, const zval *val, const zend_uint ttl, const zend_bool exclusive TSRMLS_DC) { - apc_cache_entry_t *entry; - apc_cache_key_t key; - time_t t; - apc_context_t ctxt={0,}; - zend_bool ret = 0; - - t = apc_time(); - - /* initialize a context suitable for making an insert */ - if (apc_cache_make_context(cache, &ctxt, APC_CONTEXT_SHARE, APC_SMALL_POOL, APC_COPY_IN, 0 TSRMLS_CC)) { - - /* initialize the key for insertion */ - if (apc_cache_make_key(&key, strkey, keylen TSRMLS_CC)) { - - /* run cache defense */ - if (!apc_cache_defense(cache, &key TSRMLS_CC)) { - - /* initialize the entry for insertion */ - if ((entry = apc_cache_make_entry(&ctxt, &key, val, ttl TSRMLS_CC))) { - - /* execute an insertion */ - if (apc_cache_insert(cache, key, entry, &ctxt, t, exclusive TSRMLS_CC)) { - ret = 1; - } - } - } - } - - /* in any case of failure the context should be destroyed */ - if (!ret) { - apc_cache_destroy_context(&ctxt TSRMLS_CC); - } - } - - return ret; -} /* }}} */ - -/* {{{ data_unserialize */ -static zval* data_unserialize(const char *filename TSRMLS_DC) -{ - zval* retval; - long len = 0; - struct stat sb; - char *contents, *tmp; - FILE *fp; - php_unserialize_data_t var_hash = {0,}; - - if(VCWD_STAT(filename, &sb) == -1) { - return NULL; - } - - fp = fopen(filename, "rb"); - - len = sizeof(char)*sb.st_size; - - tmp = contents = malloc(len); - - if(!contents) { - fclose(fp); - return NULL; - } - - if(fread(contents, 1, len, fp) < 1) { - fclose(fp); - free(contents); - return NULL; - } - - MAKE_STD_ZVAL(retval); - - PHP_VAR_UNSERIALIZE_INIT(var_hash); - - /* I wish I could use json */ - if(!php_var_unserialize(&retval, (const unsigned char**)&tmp, (const unsigned char*)(contents+len), &var_hash TSRMLS_CC)) { - fclose(fp); - zval_ptr_dtor(&retval); - return NULL; - } - - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - - free(contents); - fclose(fp); - - return retval; -} - -static int apc_load_data(apc_cache_t* cache, const char *data_file TSRMLS_DC) -{ - char *p; - char key[MAXPATHLEN] = {0,}; - unsigned int key_len; - zval *data; - - p = strrchr(data_file, DEFAULT_SLASH); - - if(p && p[1]) { - strlcpy(key, p+1, sizeof(key)); - p = strrchr(key, '.'); - - if(p) { - p[0] = '\0'; - key_len = strlen(key)+1; - - data = data_unserialize(data_file TSRMLS_CC); - if(data) { - apc_cache_store(cache, key, key_len, data, 0, 1 TSRMLS_CC); - } - return 1; - } - } - - return 0; -} - -/* {{{ apc_cache_preload shall load the prepared data files in path into the specified cache */ -PHP_APCU_API zend_bool apc_cache_preload(apc_cache_t* cache, const char *path TSRMLS_DC) -{ -#ifndef ZTS - zend_bool result = 0; - char file[MAXPATHLEN]={0,}; - int ndir, i; - char *p = NULL; - struct dirent **namelist = NULL; - - if ((ndir = php_scandir(path, &namelist, 0, php_alphasort)) > 0) { - for (i = 0; i < ndir; i++) { - /* check for extension */ - if (!(p = strrchr(namelist[i]->d_name, '.')) - || (p && strcmp(p, ".data"))) { - free(namelist[i]); - continue; - } - - snprintf(file, MAXPATHLEN, "%s%c%s", - path, DEFAULT_SLASH, namelist[i]->d_name); - - if(apc_load_data(cache, file TSRMLS_CC)) { - result = 1; - } - free(namelist[i]); - } - free(namelist); - } - return result; -#else - apc_error("Cannot load data from apc.preload_path=%s in thread-safe mode" TSRMLS_CC, path); - return 0; -#endif -} /* }}} */ - -/* {{{ apc_cache_release */ -PHP_APCU_API void apc_cache_release(apc_cache_t* cache, apc_cache_entry_t* entry TSRMLS_DC) -{ - entry->ref_count--; -} -/* }}} */ - -/* {{{ apc_cache_destroy */ -PHP_APCU_API void apc_cache_destroy(apc_cache_t* cache TSRMLS_DC) -{ - if (!cache) { - return; - } - - /* destroy lock */ - DESTROY_LOCK(&cache->header->lock); - - /* XXX this is definitely a leak, but freeing this causes all the apache - children to freeze. It might be because the segment is shared between - several processes. To figure out is how to free this safely. */ - /*apc_sma_free(cache->shmaddr);*/ - apc_efree(cache TSRMLS_CC); -} -/* }}} */ - -/* {{{ apc_cache_real_expunge */ -PHP_APCU_API void apc_cache_real_expunge(apc_cache_t* cache TSRMLS_DC) { - /* increment counter */ - cache->header->nexpunges++; - - /* expunge */ - { - zend_ulong i; - - for (i = 0; i < cache->nslots; i++) { - apc_cache_slot_t* p = cache->slots[i]; - while (p) { - apc_cache_remove_slot(cache, &p TSRMLS_CC); - } - cache->slots[i] = NULL; - } - } - - /* set new time so counters make sense */ - cache->header->stime = apc_time(); - - /* reset counters */ - cache->header->ninserts = 0; - cache->header->nentries = 0; - cache->header->nhits = 0; - cache->header->nmisses = 0; - - /* resets lastkey */ - memset(&cache->header->lastkey, 0, sizeof(apc_cache_key_t)); -} /* }}} */ - -/* {{{ apc_cache_clear */ -PHP_APCU_API void apc_cache_clear(apc_cache_t* cache TSRMLS_DC) -{ - /* check there is a cache and it is not busy */ - if(!cache || apc_cache_busy(cache TSRMLS_CC)) { - return; - } - - /* lock header */ - APC_LOCK(cache->header); - - /* set busy */ - cache->header->state |= APC_CACHE_ST_BUSY; - - /* expunge cache */ - apc_cache_real_expunge(cache TSRMLS_CC); - - /* set info */ - cache->header->stime = apc_time(); - cache->header->nexpunges = 0; - - /* unset busy */ - cache->header->state &= ~APC_CACHE_ST_BUSY; - - /* unlock header */ - APC_UNLOCK(cache->header); -} -/* }}} */ - -/* {{{ apc_cache_default_expunge */ -PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size TSRMLS_DC) -{ - time_t t; - size_t suitable = 0L; - size_t available = 0L; - - t = apc_time(); - - /* check there is a cache, and it is not busy */ - if(!cache || apc_cache_busy(cache TSRMLS_CC)) { - return; - } - - /* get the lock for header */ - APC_LOCK(cache->header); - - /* update state in header */ - cache->header->state |= APC_CACHE_ST_BUSY; - - /* make suitable selection */ - suitable = (cache->smart > 0L) ? (size_t) (cache->smart * size) : (size_t) (cache->sma->size/2); - - /* gc */ - apc_cache_gc(cache TSRMLS_CC); - - /* get available */ - available = cache->sma->get_avail_mem(); - - /* perform expunge processing */ - if(!cache->ttl) { - - /* check it is necessary to expunge */ - if (available < suitable) { - apc_cache_real_expunge(cache TSRMLS_CC); - } - } else { - apc_cache_slot_t **slot; - - /* check that expunge is necessary */ - if (available < suitable) { - zend_ulong i; - - /* look for junk */ - for (i = 0; i < cache->nslots; i++) { - slot = &cache->slots[i]; - while (*slot) { - /* - * Entry TTL has precedence over cache TTL - */ - if((*slot)->value->ttl) { - if((time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) { - apc_cache_remove_slot(cache, slot TSRMLS_CC); - continue; - } - } else if(cache->ttl) { - if((time_t) ((*slot)->ctime + cache->ttl) < t) { - apc_cache_remove_slot(cache, slot TSRMLS_CC); - continue; - } - } - - /* grab next slot */ - slot = &(*slot)->next; - } - } - - /* if the cache now has space, then reset last key */ - if (cache->sma->get_avail_size(size)) { - /* wipe lastkey */ - memset(&cache->header->lastkey, 0, sizeof(apc_cache_key_t)); - } else { - /* with not enough space left in cache, we are forced to expunge */ - apc_cache_real_expunge(cache TSRMLS_CC); - } - } - } - - /* we are done */ - cache->header->state &= ~APC_CACHE_ST_BUSY; - - /* unlock header */ - APC_UNLOCK(cache->header); -} -/* }}} */ - -/* {{{ apc_cache_make_context */ -PHP_APCU_API zend_bool apc_cache_make_context(apc_cache_t* cache, - apc_context_t* context, - apc_context_type context_type, - apc_pool_type pool_type, - apc_copy_type copy_type, - uint force_update TSRMLS_DC) { - switch (context_type) { - case APC_CONTEXT_SHARE: { - return apc_cache_make_context_ex( - context, - cache->serializer, - (apc_malloc_t) cache->sma->smalloc, - cache->sma->sfree, - cache->sma->protect, - cache->sma->unprotect, - pool_type, copy_type, force_update TSRMLS_CC - ); - } break; - - case APC_CONTEXT_NOSHARE: { - return apc_cache_make_context_ex( - context, - cache->serializer, - apc_php_malloc, apc_php_free, NULL, NULL, - pool_type, copy_type, force_update TSRMLS_CC - ); - } break; - - case APC_CONTEXT_NONE: - /* never used, just to make gcc warning free */ - break; - } - - return 0; -} /* }}} */ - -/* {{{ apc_cache_make_context_ex */ -PHP_APCU_API zend_bool apc_cache_make_context_ex(apc_context_t* context, - apc_serializer_t* serializer, - apc_malloc_t _malloc, - apc_free_t _free, - apc_protect_t _protect, - apc_unprotect_t _unprotect, - apc_pool_type pool_type, - apc_copy_type copy_type, - uint force_update TSRMLS_DC) { - /* attempt to create the pool */ - context->pool = apc_pool_create( - pool_type, _malloc, _free, _protect, _unprotect TSRMLS_CC - ); - - if (!context->pool) { - apc_warning("Unable to allocate memory for pool." TSRMLS_CC); - return 0; - } - - /* set context information */ - context->serializer = serializer; - context->copy = copy_type; - context->force_update = force_update; - - /* set this to avoid memory errors */ - memset(&context->copied, 0, sizeof(HashTable)); - - return 1; -} /* }}} */ - -/* {{{ apc_context_destroy */ -PHP_APCU_API zend_bool apc_cache_destroy_context(apc_context_t* context TSRMLS_DC) { - if (!context->pool) { - return 0; - } - - apc_pool_destroy(context->pool TSRMLS_CC); - - return 1; -} /* }}} */ - -/* {{{ apc_cache_insert */ -PHP_APCU_API zend_bool apc_cache_insert(apc_cache_t* cache, - apc_cache_key_t key, - apc_cache_entry_t* value, - apc_context_t* ctxt, - time_t t, - zend_bool exclusive TSRMLS_DC) -{ - zend_bool result = 0; - - /* at least */ - if (!value) { - return result; - } - - /* check we are able to deal with this request */ - if (!cache || apc_cache_busy(cache TSRMLS_CC)) { - return result; - } - - /* lock header */ - APC_LOCK(cache->header); - - /* process deleted list */ - apc_cache_gc(cache TSRMLS_CC); - - /* make the insertion */ - { - apc_cache_slot_t** slot; - - /* - * select appropriate slot ... - */ - slot = &cache->slots[key.h % cache->nslots]; - - while (*slot) { - - /* check for a match by hash and string */ - if (((*slot)->key.h == key.h) && (!memcmp((*slot)->key.str, key.str, key.len))) { - - /* - * At this point we have found the user cache entry. If we are doing - * an exclusive insert (apc_add) we are going to bail right away if - * the user entry already exists and it has no ttl, or - * there is a ttl and the entry has not timed out yet. - */ - if(exclusive) { - if (!(*slot)->value->ttl || (time_t) ((*slot)->ctime + (*slot)->value->ttl) >= t) { - goto nothing; - } - } - apc_cache_remove_slot(cache, slot TSRMLS_CC); - break; - } else - - /* - * This is a bit nasty. The idea here is to do runtime cleanup of the linked list of - * slot entries so we don't always have to skip past a bunch of stale entries. We check - * for staleness here and get rid of them by first checking to see if the cache has a global - * access ttl on it and removing entries that haven't been accessed for ttl seconds and secondly - * we see if the entry has a hard ttl on it and remove it if it has been around longer than its ttl - */ - if((cache->ttl && (time_t)(*slot)->atime < (t - (time_t)cache->ttl)) || - ((*slot)->value->ttl && (time_t) ((*slot)->ctime + (*slot)->value->ttl) < t)) { - apc_cache_remove_slot(cache, slot TSRMLS_CC); - continue; - } - - /* set next slot */ - slot = &(*slot)->next; - } - - if ((*slot = make_slot(cache, &key, value, *slot, t TSRMLS_CC)) != NULL) { - /* set value size from pool size */ - value->mem_size = ctxt->pool->size; - - cache->header->mem_size += ctxt->pool->size; - cache->header->nentries++; - cache->header->ninserts++; - } else { - goto nothing; - } - } - - /* unlock and return succesfull */ - APC_UNLOCK(cache->header); - - return 1; - - /* bail */ -nothing: - APC_UNLOCK(cache->header); - - return 0; -} -/* }}} */ - -/* {{{ apc_cache_find */ -PHP_APCU_API apc_cache_entry_t* apc_cache_find(apc_cache_t* cache, char *strkey, zend_uint keylen, time_t t TSRMLS_DC) -{ - /* check we are able to deal with the request */ - if(!cache || apc_cache_busy(cache TSRMLS_CC)) { - return NULL; - } - - /* we only declare a volatile we need */ - { - apc_cache_slot_t** slot; - zend_ulong h, s; - - volatile apc_cache_entry_t* value = NULL; - - /* calculate hash and slot */ - apc_cache_hash_slot(cache, strkey, keylen, &h, &s); - - /* read lock header */ - APC_RLOCK(cache->header); - - /* find head */ - slot = &cache->slots[s]; - - while (*slot) { - /* check for a matching key by has and identifier */ - if ((h == (*slot)->key.h) && !memcmp((*slot)->key.str, strkey, keylen)) { - - /* Check to make sure this entry isn't expired by a hard TTL */ - if((*slot)->value->ttl && (time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) { - /* increment misses on cache */ - cache->header->nmisses++; - - /* unlock header */ - APC_RUNLOCK(cache->header); - - return NULL; - } - - /* Otherwise we are fine, increase counters and return the cache entry */ - (*slot)->nhits++; - (*slot)->value->ref_count++; - (*slot)->atime = t; - - /* set cache num hits */ - cache->header->nhits++; - - /* grab value */ - value = (*slot)->value; - - /* unlock header */ - APC_RUNLOCK(cache->header); - - return (apc_cache_entry_t*)value; - } - - /* next */ - slot = &(*slot)->next; - } - - /* not found, so increment misses */ - cache->header->nmisses++; - - /* unlock header */ - APC_RUNLOCK(cache->header); - } - - return NULL; -} -/* }}} */ - -/* {{{ apc_cache_fetch */ -PHP_APCU_API zend_bool apc_cache_fetch(apc_cache_t* cache, char* strkey, zend_uint keylen, time_t t, zval **dst TSRMLS_DC) -{ - apc_cache_entry_t *entry; - zend_bool ret = 0; - - /* find the entry */ - if ((entry = apc_cache_find(cache, strkey, keylen, t TSRMLS_CC))) { - /* context for copying out */ - apc_context_t ctxt = {0, }; - - /* create unpool context */ - if (apc_cache_make_context(cache, &ctxt, APC_CONTEXT_NOSHARE, APC_UNPOOL, APC_COPY_OUT, 0 TSRMLS_CC)) { - - /* copy to destination */ - apc_cache_fetch_zval(&ctxt, *dst, entry->val TSRMLS_CC); - - /* release entry */ - apc_cache_release( - cache, entry TSRMLS_CC); - - /* destroy context */ - apc_cache_destroy_context(&ctxt TSRMLS_CC ); - - /* set result */ - ret = 1; - } - } - - return ret; -} /* }}} */ - -/* {{{ apc_cache_exists */ -PHP_APCU_API apc_cache_entry_t* apc_cache_exists(apc_cache_t* cache, char *strkey, zend_uint keylen, time_t t TSRMLS_DC) -{ - if(apc_cache_busy(cache TSRMLS_CC)) - { - /* cache cleanup in progress */ - return NULL; - } - - /* we only declare volatiles we need */ - { - apc_cache_slot_t** slot; - - volatile apc_cache_entry_t* value = NULL; - zend_ulong h, s; - - /* get hash and slot */ - apc_cache_hash_slot(cache, strkey, keylen, &h, &s); - - /* read lock header */ - APC_RLOCK(cache->header); - - /* find head */ - slot = &cache->slots[s]; - - while (*slot) { - /* check for match by hash and identifier */ - if ((h == (*slot)->key.h) && - !memcmp((*slot)->key.str, strkey, keylen)) { - - /* Check to make sure this entry isn't expired by a hard TTL */ - if((*slot)->value->ttl && (time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) { - /* marked as a miss */ - cache->header->nmisses++; - - /* unlock header */ - APC_RUNLOCK(cache->header); - - return NULL; - } - - /* Return the cache entry ptr */ - value = (*slot)->value; - - /* unlock header */ - APC_RUNLOCK(cache->header); - - return (apc_cache_entry_t*)value; - } - - slot = &(*slot)->next; - } - - /* unlock header */ - APC_RUNLOCK(cache->header); - } - - return NULL; -} -/* }}} */ - -/* {{{ apc_cache_update */ -PHP_APCU_API zend_bool apc_cache_update(apc_cache_t* cache, char *strkey, zend_uint keylen, apc_cache_updater_t updater, void* data TSRMLS_DC) -{ - apc_cache_slot_t** slot; - - zend_bool retval = 0; - zend_ulong h, s; - - if(apc_cache_busy(cache TSRMLS_CC)) - { - /* cannot service request right now */ - return 0; - } - - /* calculate hash */ - apc_cache_hash_slot(cache, strkey, keylen, &h, &s); - - /* lock header */ - APC_LOCK(cache->header); - - /* find head */ - slot = &cache->slots[s]; - - while (*slot) { - /* check for a match by hash and identifier */ - if ((h == (*slot)->key.h) && - !memcmp((*slot)->key.str, strkey, keylen)) { - /* attempt to perform update */ - switch(Z_TYPE_P((*slot)->value->val) & ~IS_CONSTANT_TYPE_MASK) { - case IS_ARRAY: - case IS_OBJECT: - { - if(cache->serializer) { - retval = 0; - break; - } else { - /* fall through */ - } - } - /* fall through */ - default: - { - /* executing update */ - retval = updater( - cache, (*slot)->value, data); - - /* set modified time */ - (*slot)->key.mtime = apc_time(); - } - break; - } - /* unlock header */ - APC_UNLOCK(cache->header); - - return retval; - } - - /* set next slot */ - slot = &(*slot)->next; - } - - /* unlock header */ - APC_UNLOCK(cache->header); - - return 0; -} -/* }}} */ - -/* {{{ apc_cache_delete */ -PHP_APCU_API zend_bool apc_cache_delete(apc_cache_t* cache, char *strkey, zend_uint keylen TSRMLS_DC) -{ - apc_cache_slot_t** slot; - - zend_ulong h, s; - - if (!cache) { - return 1; - } - - /* calculate hash and slot */ - apc_cache_hash_slot(cache, strkey, keylen, &h, &s); - - /* lock cache */ - APC_LOCK(cache->header); - - /* find head */ - slot = &cache->slots[s]; - - while (*slot) { - /* check for a match by hash and identifier */ - if ((h == (*slot)->key.h) && - !memcmp((*slot)->key.str, strkey, keylen)) { - /* executing removal */ - apc_cache_remove_slot( - cache, slot TSRMLS_CC); - goto deleted; - } - - /* continue locking */ - slot = &(*slot)->next; - } - - /* unlock header */ - APC_UNLOCK(cache->header); - - return 0; - -deleted: - /* unlock deleted */ - APC_UNLOCK(cache->header); - - return 1; -} -/* }}} */ - -/* {{{ apc_cache_make_key */ -PHP_APCU_API zend_bool apc_cache_make_key(apc_cache_key_t* key, char* str, zend_ulong len TSRMLS_DC) -{ - assert(key != NULL); - - if (!str) { - return 0; - } - - if (!len) - len = strlen(str) + 1; - - key->str = str; - key->len = len; - key->h = zend_inline_hash_func((char *)key->str, key->len); - key->mtime = apc_time(); - - return 1; -} -/* }}} */ - -/* {{{ my_serialize_object */ -static zval* my_serialize_object(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) -{ - smart_str buf = {0}; - apc_pool* pool = ctxt->pool; - apc_serialize_t serialize = APC_SERIALIZER_NAME(php); - void *config = NULL; - - if(ctxt->serializer) { - serialize = ctxt->serializer->serialize; - config = (ctxt->serializer->config != NULL) ? ctxt->serializer->config : ctxt; - } - - if(serialize((unsigned char**)&buf.c, &buf.len, src, config TSRMLS_CC)) { - dst->type = src->type & ~IS_CONSTANT; - dst->value.str.len = buf.len; - CHECK(dst->value.str.val = apc_pmemcpy(buf.c, (buf.len + 1), pool TSRMLS_CC)); - } - - if(buf.c) { - smart_str_free(&buf); - } - - return dst; -} -/* }}} */ - -/* {{{ my_unserialize_object */ -static zval* my_unserialize_object(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) -{ - apc_unserialize_t unserialize = APC_UNSERIALIZER_NAME(php); - unsigned char *p = (unsigned char*)Z_STRVAL_P(src); - void *config = NULL; - - if(ctxt->serializer) { - unserialize = ctxt->serializer->unserialize; - config = (ctxt->serializer->config != NULL) ? ctxt->serializer->config : ctxt; - } - - if(unserialize(&dst, p, Z_STRLEN_P(src), config TSRMLS_CC)) { - return dst; - } else { - zval_dtor(dst); - dst->type = IS_NULL; - } - return dst; -} -/* }}} */ - - -/* {{{ my_copy_hashtable_ex */ -static APC_HOTSPOT HashTable* my_copy_hashtable_ex(HashTable* dst, - HashTable* src TSRMLS_DC, - ht_copy_fun_t copy_fn, - int holds_ptrs, - apc_context_t* ctxt, - ht_check_copy_fun_t check_fn, - ...) -{ - Bucket* curr = NULL; - Bucket* prev = NULL; - Bucket* newp = NULL; - int first = 1; - apc_pool* pool = ctxt->pool; - - assert(src != NULL); - - if (!dst) { - CHECK(dst = (HashTable*) pool->palloc(pool, sizeof(src[0]) TSRMLS_CC)); - } - - memcpy(dst, src, sizeof(src[0])); - - /* allocate buckets for the new hashtable */ - CHECK((dst->arBuckets = pool->palloc(pool, (dst->nTableSize * sizeof(Bucket*)) TSRMLS_CC))); - - memset(dst->arBuckets, 0, dst->nTableSize * sizeof(Bucket*)); - dst->pInternalPointer = NULL; - dst->pListHead = NULL; - - for (curr = src->pListHead; curr != NULL; curr = curr->pListNext) { - int n = curr->h % dst->nTableSize; - - if(check_fn) { - va_list args; - va_start(args, check_fn); - - /* Call the check_fn to see if the current bucket - * needs to be copied out - */ - if(!check_fn(curr, args)) { - dst->nNumOfElements--; - va_end(args); - continue; - } - - va_end(args); - } - - /* create a copy of the bucket 'curr' */ -#ifdef ZEND_ENGINE_2_4 - if (!curr->nKeyLength) { - CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC))); - } else if (IS_INTERNED(curr->arKey)) { - CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC))); - } else { - /* I repeat, this is ugly */ - CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket) + curr->nKeyLength, pool TSRMLS_CC))); - newp->arKey = (const char*)(newp+1); - } -#else - CHECK((newp = (Bucket*) apc_pmemcpy(curr, - (sizeof(Bucket) + curr->nKeyLength - 1), - pool TSRMLS_CC))); -#endif - - /* insert 'newp' into the linked list at its hashed index */ - if (dst->arBuckets[n]) { - newp->pNext = dst->arBuckets[n]; - newp->pLast = NULL; - newp->pNext->pLast = newp; - } else { - newp->pNext = newp->pLast = NULL; - } - - dst->arBuckets[n] = newp; - - /* copy the bucket data using our 'copy_fn' callback function */ - CHECK((newp->pData = copy_fn(NULL, curr->pData, ctxt TSRMLS_CC))); - - if (holds_ptrs) { - memcpy(&newp->pDataPtr, newp->pData, sizeof(void*)); - } - else { - newp->pDataPtr = NULL; - } - - /* insert 'newp' into the table-thread linked list */ - newp->pListLast = prev; - newp->pListNext = NULL; - - if (prev) { - prev->pListNext = newp; - } - - if (first) { - dst->pListHead = newp; - first = 0; - } - - prev = newp; - } - - dst->pListTail = newp; - - zend_hash_internal_pointer_reset(dst); - - return dst; -} -/* }}} */ - - -/* {{{ my_copy_zval_ptr */ -static zval** my_copy_zval_ptr(zval** dst, const zval** src, apc_context_t* ctxt TSRMLS_DC) -{ - zval* dst_new; - apc_pool* pool = ctxt->pool; - int usegc = (ctxt->copy == APC_COPY_OUT); - - assert(src != NULL); - - if (!dst) { - CHECK(dst = (zval**) pool->palloc(pool, sizeof(zval*) TSRMLS_CC)); - } - - if(usegc) { - ALLOC_ZVAL(dst[0]); - CHECK(dst[0]); - } else { - CHECK((dst[0] = (zval*) pool->palloc(pool, sizeof(zval) TSRMLS_CC))); - } - - CHECK((dst_new = my_copy_zval(*dst, *src, ctxt TSRMLS_CC))); - - if(dst_new != *dst) { - if(usegc) { - FREE_ZVAL(dst[0]); - } - *dst = dst_new; - } - - return dst; -} -/* }}} */ - -/* {{{ my_copy_zval */ -static APC_HOTSPOT zval* my_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) -{ - zval **tmp; - apc_pool* pool = ctxt->pool; - - assert(dst != NULL); - assert(src != NULL); - - memcpy(dst, src, sizeof(src[0])); - - if(ctxt->copied.nTableSize) { - if(zend_hash_index_find(&ctxt->copied, (ulong)src, (void**)&tmp) == SUCCESS) { - if(Z_ISREF_P((zval*)src)) { - Z_SET_ISREF_PP(tmp); - } - Z_ADDREF_PP(tmp); - return *tmp; - } - - zend_hash_index_update(&ctxt->copied, (ulong)src, (void**)&dst, sizeof(zval*), NULL); - } - - if(ctxt->copy == APC_COPY_OUT || ctxt->copy == APC_COPY_IN) { - /* deep copies are refcount(1), but moved up for recursive - * arrays, which end up being add_ref'd during its copy. */ - Z_SET_REFCOUNT_P(dst, 1); - Z_UNSET_ISREF_P(dst); - } else { - /* code uses refcount=2 for consts */ - Z_SET_REFCOUNT_P(dst, Z_REFCOUNT_P((zval*)src)); - Z_SET_ISREF_TO_P(dst, Z_ISREF_P((zval*)src)); - } - - switch (src->type & IS_CONSTANT_TYPE_MASK) { - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - case IS_DOUBLE: - case IS_NULL: - break; - - case IS_CONSTANT: - case IS_STRING: - if (src->value.str.val) { - CHECK(dst->value.str.val = apc_pmemcpy(src->value.str.val, - src->value.str.len+1, - pool TSRMLS_CC)); - } - break; - - case IS_ARRAY: - if(ctxt->serializer == NULL) { - - CHECK(dst->value.ht = - my_copy_hashtable(NULL, - src->value.ht, - (ht_copy_fun_t) my_copy_zval_ptr, - 1, - ctxt)); - break; - } else { - /* fall through to object case */ - } - - case IS_OBJECT: - - dst->type = IS_NULL; - if(ctxt->copy == APC_COPY_IN) { - dst = my_serialize_object(dst, src, ctxt TSRMLS_CC); - } else if(ctxt->copy == APC_COPY_OUT) { - dst = my_unserialize_object(dst, src, ctxt TSRMLS_CC); - } - break; -#ifdef ZEND_ENGINE_2_4 - case IS_CALLABLE: - /* XXX implement this */ - assert(0); - break; -#endif - - default: - assert(0); - } - - return dst; -} -/* }}} */ - -/* {{{ apc_copy_zval */ -PHP_APCU_API zval* apc_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) -{ - apc_pool* pool = ctxt->pool; - - assert(src != NULL); - - if (!dst) { - if(ctxt->copy == APC_COPY_OUT) { - ALLOC_ZVAL(dst); - CHECK(dst); - } else { - CHECK(dst = (zval*) pool->palloc(pool, sizeof(zval) TSRMLS_CC)); - } - } - - CHECK(dst = my_copy_zval(dst, src, ctxt TSRMLS_CC)); - return dst; -} -/* }}} */ - -/* {{{ apc_cache_store_zval */ -PHP_APCU_API zval* apc_cache_store_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC) -{ - if (Z_TYPE_P(src) == IS_ARRAY) { - /* Maintain a list of zvals we've copied to properly handle recursive structures */ - zend_hash_init(&ctxt->copied, 0, NULL, NULL, 0); - dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); - zend_hash_destroy(&ctxt->copied); - ctxt->copied.nTableSize=0; - } else { - dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); - } - - - return dst; -} -/* }}} */ - -/* {{{ apc_cache_fetch_zval */ -PHP_APCU_API zval* apc_cache_fetch_zval(apc_context_t* ctxt, zval* dst, const zval* src TSRMLS_DC) -{ - if (Z_TYPE_P(src) == IS_ARRAY) { - /* Maintain a list of zvals we've copied to properly handle recursive structures */ - zend_hash_init(&ctxt->copied, 0, NULL, NULL, 0); - dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); - zend_hash_destroy(&ctxt->copied); - ctxt->copied.nTableSize=0; - } else { - dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC); - } - - - return dst; -} -/* }}} */ - -/* {{{ apc_cache_make_entry */ -PHP_APCU_API apc_cache_entry_t* apc_cache_make_entry(apc_context_t* ctxt, apc_cache_key_t *key, const zval* val, const unsigned int ttl TSRMLS_DC) -{ - apc_cache_entry_t* entry; - apc_pool* pool = ctxt->pool; - - entry = (apc_cache_entry_t*) pool->palloc(pool, sizeof(apc_cache_entry_t) TSRMLS_CC); - if (!entry) { - return NULL; - } - - /* set key for serializer */ - ctxt->key = key; - - entry->val = apc_cache_store_zval(NULL, val, ctxt TSRMLS_CC); - if(!entry->val) { - return NULL; - } - - INIT_PZVAL(entry->val); - entry->ttl = ttl; - entry->ref_count = 0; - entry->mem_size = 0; - entry->pool = pool; - return entry; -} -/* }}} */ - -/* {{{ apc_cache_link_info */ -static zval* apc_cache_link_info(apc_cache_t *cache, apc_cache_slot_t* p TSRMLS_DC) -{ - zval *link = NULL; - - ALLOC_INIT_ZVAL(link); - - if(!link) { - return NULL; - } - - array_init(link); - - add_assoc_stringl(link, "key", (char*) p->key.str, p->key.len-1, 1); - add_assoc_long(link, "ttl", (long)p->value->ttl); - - add_assoc_double(link, "nhits", (double)p->nhits); - add_assoc_long(link, "mtime", p->key.mtime); - add_assoc_long(link, "ctime", p->ctime); - add_assoc_long(link, "dtime", p->dtime); - add_assoc_long(link, "atime", p->atime); - add_assoc_long(link, "ref_count", p->value->ref_count); - add_assoc_long(link, "mem_size", p->value->mem_size); - - return link; -} -/* }}} */ - -/* {{{ apc_cache_info */ -PHP_APCU_API zval* apc_cache_info(apc_cache_t* cache, zend_bool limited TSRMLS_DC) -{ - zval *info = NULL; - zval *list = NULL; - zval *gc = NULL; - zval *slots = NULL; - apc_cache_slot_t* p; - zend_ulong i, j; - - if(!cache) { - return NULL; - } - - ALLOC_INIT_ZVAL(info); - - /* read lock header */ - APC_RLOCK(cache->header); - - array_init(info); - add_assoc_long(info, "nslots", cache->nslots); - add_assoc_long(info, "ttl", cache->ttl); - - add_assoc_double(info, "nhits", (double)cache->header->nhits); - add_assoc_double(info, "nmisses", (double)cache->header->nmisses); - add_assoc_double(info, "ninserts", (double)cache->header->ninserts); - add_assoc_long(info, "nentries", cache->header->nentries); - add_assoc_double(info, "nexpunges", (double)cache->header->nexpunges); - - add_assoc_long(info, "stime", cache->header->stime); - add_assoc_double(info, "mem_size", (double)cache->header->mem_size); - -#ifdef MULTIPART_EVENT_FORMDATA - add_assoc_long(info, "file_upload_progress", 1); -#else - add_assoc_long(info, "file_upload_progress", 0); -#endif -#if APC_MMAP - add_assoc_stringl(info, "memory_type", "mmap", sizeof("mmap")-1, 1); -#else - add_assoc_stringl(info, "memory_type", "IPC shared", sizeof("IPC shared")-1, 1); -#endif - - if(!limited) { - /* For each hashtable slot */ - ALLOC_INIT_ZVAL(list); - array_init(list); - - ALLOC_INIT_ZVAL(slots); - array_init(slots); - - for (i = 0; i < cache->nslots; i++) { - p = cache->slots[i]; - j = 0; - for (; p != NULL; p = p->next) { - zval *link = apc_cache_link_info(cache, p TSRMLS_CC); - add_next_index_zval(list, link); - j++; - } - if(j != 0) { - add_index_long(slots, (ulong)i, j); - } - } - - /* For each slot pending deletion */ - ALLOC_INIT_ZVAL(gc); - array_init(gc); - - for (p = cache->header->gc; p != NULL; p = p->next) { - zval *link = apc_cache_link_info(cache, p TSRMLS_CC); - add_next_index_zval(gc, link); - } - - add_assoc_zval(info, "cache_list", list); - add_assoc_zval(info, "deleted_list", gc); - add_assoc_zval(info, "slot_distribution", slots); - } - - /* unlock header */ - APC_RUNLOCK(cache->header); - - return info; -} -/* }}} */ - -/* - fetches information about the key provided -*/ -PHP_APCU_API zval* apc_cache_stat(apc_cache_t* cache, - char *strkey, - zend_uint keylen TSRMLS_DC) { - zval *stat; - apc_cache_slot_t** slot; - zend_ulong h, s; - - /* calculate hash and slot */ - apc_cache_hash_slot(cache, strkey, keylen, &h, &s); - - /* allocate stat buffer */ - ALLOC_INIT_ZVAL(stat); - - /* read lock header */ - APC_RLOCK(cache->header); - - /* find head */ - slot = &cache->slots[s]; - - while (*slot) { - /* check for a matching key by has and identifier */ - if ((h == (*slot)->key.h) && !memcmp((*slot)->key.str, strkey, keylen)) { - array_init(stat); - - add_assoc_long(stat, "hits", (*slot)->nhits); - add_assoc_long(stat, "atime", (*slot)->atime); - add_assoc_long(stat, "mtime", (*slot)->key.mtime); - add_assoc_long(stat, "ctime", (*slot)->ctime); - add_assoc_long(stat, "dtime", (*slot)->dtime); - add_assoc_long(stat, "ttl", (*slot)->value->ttl); - add_assoc_long(stat, "refs", (*slot)->value->ref_count); - - break; - } - - /* next */ - slot = &(*slot)->next; - } - - APC_RUNLOCK(cache->header); - - return stat; -} - -/* {{{ apc_cache_busy */ -PHP_APCU_API zend_bool apc_cache_busy(apc_cache_t* cache TSRMLS_DC) -{ - return (cache->header->state & APC_CACHE_ST_BUSY); -} -/* }}} */ - -/* {{{ apc_cache_defense */ -PHP_APCU_API zend_bool apc_cache_defense(apc_cache_t* cache, apc_cache_key_t* key TSRMLS_DC) -{ - zend_bool result = 0; - - /* in ZTS mode, we use the current TSRM context to determine the owner */ -#ifdef ZTS -# define FROM_DIFFERENT_THREAD(k) ((key->owner = TSRMLS_C) != (k)->owner) -#else -# define FROM_DIFFERENT_THREAD(k) ((key->owner = getpid()) != (k)->owner) -#endif - - /* only continue if slam defense is enabled */ - if (cache->defend) { - - /* for copy of locking key struct */ - apc_cache_key_t *last = &cache->header->lastkey; - - /* check the hash and length match */ - if(last->h == key->h && last->len == key->len) { - - /* check the time ( last second considered slam ) and context */ - if(last->mtime == key->mtime && - FROM_DIFFERENT_THREAD(last)) { - - /* potential cache slam */ - apc_debug( - "Potential cache slam averted for key '%s'" TSRMLS_CC, key->str); - result = 1; - } else { - /* sets enough information for an educated guess, but is not exact */ - last->h = key->h; - last->len = key->len; - last->mtime = apc_time(); - - /* required to tell contexts apart */ -#ifdef ZTS - last->owner = TSRMLS_C; -#else - last->owner = getpid(); -#endif - } - } - } - - return result; -} -/* }}} */ - -/* {{{ apc_cache_serializer */ -PHP_APCU_API void apc_cache_serializer(apc_cache_t* cache, const char* name TSRMLS_DC) { - if (cache && !cache->serializer) { - cache->serializer = apc_find_serializer(name TSRMLS_CC); - } -} /* }}} */ - -/* - * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_cache.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_cache.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_cache.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_cache.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | 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. - - */ - -/* $Id: apc_cache.h 328172 2012-10-28 21:44:47Z rasmus $ */ - -#ifndef APC_CACHE_H -#define APC_CACHE_H - -#include "apc.h" -#include "apc_lock.h" -#include "apc_pool.h" -#include "TSRM.h" - -#ifndef APC_CACHE_API_H -# include "apc_cache_api.h" -#endif - -#ifdef APC_FULL_BC -# define APC_CACHE_IS_USER(ct, ct_len) ((ct_len) == 4 && !strncasecmp("user", (ct), 4)) -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_globals.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_globals.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_globals.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_globals.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | George Schlossnagle | - | Rasmus Lerdorf | - | Arun C. Murthy | - | Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - 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_globals.h 328290 2012-11-09 03:30:09Z laruence $ */ - -#ifndef APC_GLOBALS_H -#define APC_GLOBALS_H - -#include "apc.h" -#include "apc_cache.h" -#include "apc_stack.h" -#include "apc_php.h" - -/* {{{ struct apc_rfc1867_data */ - -typedef struct _apc_rfc1867_data apc_rfc1867_data; - -struct _apc_rfc1867_data { - char tracking_key[64]; - int key_length; - size_t content_length; - char filename[128]; - char name[64]; - char *temp_filename; - int cancel_upload; - double start_time; - size_t bytes_processed; - size_t prev_bytes_processed; - int update_freq; - double rate; - int started; -}; -/* }}} */ - - -ZEND_BEGIN_MODULE_GLOBALS(apcu) - /* configuration parameters */ - zend_bool enabled; /* if true, apc is enabled (defaults to true) */ - long shm_segments; /* number of shared memory segments to use */ - long shm_size; /* size of each shared memory segment (in MB) */ - long entries_hint; /* hint at the number of entries expected */ - long gc_ttl; /* parameter to apc_cache_create */ - long ttl; /* parameter to apc_cache_create */ - long smart; /* smart value */ - -#if APC_MMAP - char *mmap_file_mask; /* mktemp-style file-mask to pass to mmap */ -#endif - - /* module variables */ - zend_bool initialized; /* true if module was initialized */ - zend_bool enable_cli; /* Flag to override turning APC off for CLI */ - zend_bool slam_defense; /* true for user cache slam defense */ - -#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 */ - long rfc1867_ttl; /* TTL for rfc1867 entries */ - apc_rfc1867_data rfc1867_data;/* Per-request data */ -#endif - - void *apc_bd_alloc_ptr; /* bindump alloc() ptr */ - void *apc_bd_alloc_ubptr; /* bindump alloc() upper bound ptr */ - HashTable apc_bd_alloc_list; /* bindump alloc() ptr list */ - char *preload_path; /* preload path */ - zend_bool coredump_unmap; /* trap signals that coredump and unmap shared memory */ - zend_bool use_request_time; /* use the SAPI request start time for TTL */ - - char *serializer_name; /* the serializer config option */ - char *writable; /* writable path for general use */ -ZEND_END_MODULE_GLOBALS(apcu) - -/* (the following declaration is defined in php_apc.c) */ -ZEND_EXTERN_MODULE_GLOBALS(apcu) - -#ifdef ZTS -# define APCG(v) TSRMG(apcu_globals_id, zend_apcu_globals *, v) -#else -# define APCG(v) (apcu_globals.v) -#endif - -/* True globals */ -extern apc_cache_t* apc_user_cache; /* the global cache */ -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | George Schlossnagle | - | Rasmus Lerdorf | - | Arun C. Murthy | - | Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - 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.h 328292 2012-11-09 07:05:17Z laruence $ */ - -#ifndef APC_H -#define APC_H - -/* - * This module defines utilities and helper functions used elsewhere in APC. - */ -#ifdef PHP_WIN32 -# define PHP_APCU_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -# define PHP_APCU_API __attribute__ ((visibility("default"))) -#else -# define PHP_APCU_API -#endif - -/* Commonly needed C library headers. */ -#include -#include -#include -#include -#include -#include -#include -#include - -/* UNIX headers (needed for struct stat) */ -#include -#include -#ifndef PHP_WIN32 -#include -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "php.h" -#include "main/php_streams.h" - -/* typedefs for extensible memory allocators */ -typedef void* (*apc_malloc_t)(size_t TSRMLS_DC); -typedef void (*apc_free_t) (void * TSRMLS_DC); - -/* wrappers for memory allocation routines */ -PHP_APCU_API void* apc_emalloc(size_t n TSRMLS_DC); -PHP_APCU_API void* apc_erealloc(void* p, size_t n TSRMLS_DC); -PHP_APCU_API void* apc_php_malloc(size_t n TSRMLS_DC); -PHP_APCU_API void apc_php_free(void* p TSRMLS_DC); -PHP_APCU_API void apc_efree(void* p TSRMLS_DC); -PHP_APCU_API char* apc_estrdup(const char* s TSRMLS_DC); -PHP_APCU_API void* apc_xstrdup(const char* s, apc_malloc_t f TSRMLS_DC); -PHP_APCU_API void* apc_xmemcpy(const void* p, size_t n, apc_malloc_t f TSRMLS_DC); - -/* console display functions */ -PHP_APCU_API void apc_error(const char *format TSRMLS_DC, ...); -PHP_APCU_API void apc_warning(const char *format TSRMLS_DC, ...); -PHP_APCU_API void apc_notice(const char *format TSRMLS_DC, ...); -PHP_APCU_API void apc_debug(const char *format TSRMLS_DC, ...); - -/* string and text manipulation */ -PHP_APCU_API char* apc_append(const char* s, const char* t TSRMLS_DC); -PHP_APCU_API char* apc_substr(const char* s, int start, int length TSRMLS_DC); -PHP_APCU_API char** apc_tokenize(const char* s, char delim TSRMLS_DC); - -/* apc_crc32: returns the CRC-32 checksum of the first len bytes in buf */ -PHP_APCU_API unsigned int apc_crc32(const unsigned char* buf, unsigned int len); - -/* apc_flip_hash flips keys and values for faster searching */ -PHP_APCU_API HashTable* apc_flip_hash(HashTable *hash); - -#define APC_NEGATIVE_MATCH 1 -#define APC_POSITIVE_MATCH 2 - -#define apc_time() \ - (APCG(use_request_time) ? (time_t) sapi_get_request_time(TSRMLS_C) : time(0)); - -#if defined(__GNUC__) -# define APC_UNUSED __attribute__((unused)) -# define APC_USED __attribute__((used)) -# define APC_ALLOC __attribute__((malloc)) -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2) -# define APC_HOTSPOT __attribute__((hot)) -# else -# define APC_HOTSPOT -# endif -#else -# define APC_UNUSED -# define APC_USED -# define APC_ALLOC -# define APC_HOTSPOT -#endif - -/* -* Serializer API -*/ -#define APC_SERIALIZER_ABI "0" -#define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI - -#define APC_SERIALIZER_NAME(module) module##_apc_serializer -#define APC_UNSERIALIZER_NAME(module) module##_apc_unserializer - -#define APC_SERIALIZER_ARGS unsigned char **buf, size_t *buf_len, const zval *value, void *config TSRMLS_DC -#define APC_UNSERIALIZER_ARGS zval **value, unsigned char *buf, size_t buf_len, void *config TSRMLS_DC - -typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS); -typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS); - -/* {{{ struct definition: apc_serializer_t */ -typedef struct apc_serializer_t { - const char* name; - apc_serialize_t serialize; - apc_unserialize_t unserialize; - void* config; -} apc_serializer_t; -/* }}} */ - -/* {{{ _apc_register_serializer - registers the serializer using the given name and paramters */ -PHP_APCU_API int _apc_register_serializer(const char* name, - apc_serialize_t serialize, - apc_unserialize_t unserialize, - void *config TSRMLS_DC); /* }}} */ - -/* {{{ apc_get_serializers - fetches the list of serializers */ -PHP_APCU_API apc_serializer_t* apc_get_serializers(TSRMLS_D); /* }}} */ - -/* {{{ apc_find_serializer - finds a previously registered serializer by name */ -PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name TSRMLS_DC); /* }}} */ - -/* {{{ default serializers */ -PHP_APCU_API int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS); -PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS); /* }}} */ - -/* {{{ eval serializers */ -PHP_APCU_API int APC_SERIALIZER_NAME(eval) (APC_SERIALIZER_ARGS); -PHP_APCU_API int APC_UNSERIALIZER_NAME(eval) (APC_UNSERIALIZER_ARGS); /* }}} */ - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_iterator.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_iterator.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_iterator.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_iterator.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,675 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - */ - -/* $Id: apc_iterator.c 327134 2012-08-15 14:21:28Z ab $ */ - -#include "php_apc.h" -#include "apc_iterator.h" -#include "apc_cache.h" - -#include "ext/standard/md5.h" - -#include "zend_interfaces.h" - -zend_class_entry *apc_iterator_ce; -zend_object_handlers apc_iterator_object_handlers; - -/* {{{ apc_iterator_item */ -static apc_iterator_item_t* apc_iterator_item_ctor(apc_iterator_t *iterator, apc_cache_slot_t **slot_pp TSRMLS_DC) { - zval *zvalue; - apc_cache_slot_t *slot = *slot_pp; - apc_context_t ctxt = {0, }; - apc_iterator_item_t *item = ecalloc(1, sizeof(apc_iterator_item_t)); - - ALLOC_INIT_ZVAL(item->value); - array_init(item->value); - - item->key = estrndup( - slot->key.str, slot->key.len); - item->key_len = slot->key.len; - - /* for bc, in any mode */ - if (APC_ITER_TYPE & iterator->format) { - add_assoc_string(item->value, "type", "user", 1); - } - - if (APC_ITER_KEY & iterator->format) { - add_assoc_stringl(item->value, "key", item->key, (item->key_len - 1), 1); - } - - if (APC_ITER_VALUE & iterator->format) { - apc_cache_make_context( - apc_user_cache, &ctxt, APC_CONTEXT_NOSHARE, APC_UNPOOL, APC_COPY_OUT, 0 TSRMLS_CC); - - MAKE_STD_ZVAL(zvalue); - apc_cache_fetch_zval(&ctxt, zvalue, slot->value->val TSRMLS_CC); - apc_pool_destroy(ctxt.pool TSRMLS_CC); - add_assoc_zval(item->value, "value", zvalue); - } - if (APC_ITER_NUM_HITS & iterator->format) { - add_assoc_long(item->value, "num_hits", slot->nhits); - } - if (APC_ITER_MTIME & iterator->format) { - add_assoc_long(item->value, "modified_time", slot->key.mtime); - } - if (APC_ITER_CTIME & iterator->format) { - add_assoc_long(item->value, "creation_time", slot->ctime); - } - if (APC_ITER_DTIME & iterator->format) { - add_assoc_long(item->value, "deletion_time", slot->dtime); - } - if (APC_ITER_ATIME & iterator->format) { - add_assoc_long(item->value, "access_time", slot->atime); - } - if (APC_ITER_REFCOUNT & iterator->format) { - add_assoc_long(item->value, "ref_count", slot->value->ref_count); - } - if (APC_ITER_MEM_SIZE & iterator->format) { - add_assoc_long(item->value, "mem_size", slot->value->mem_size); - } - if (APC_ITER_TTL & iterator->format) { - add_assoc_long(item->value, "ttl", slot->value->ttl); - } - - return item; -} -/* }}} */ - -/* {{{ apc_iterator_clone */ -static zend_object_value apc_iterator_clone(zval *zobject TSRMLS_DC) { - zend_object_value value = {0}; - apc_error("APCIterator object cannot be cloned." TSRMLS_CC); - return value; -} -/* }}} */ - -/* {{{ apc_iterator_item_dtor */ -static void apc_iterator_item_dtor(apc_iterator_item_t *item) { - if (item->key) { - efree(item->key); - } - - if (item->value) { - zval_ptr_dtor(&item->value); - } - efree(item); -} -/* }}} */ - -/* {{{ apc_iterator_destroy */ -static void apc_iterator_destroy(void *object, zend_object_handle handle TSRMLS_DC) { - apc_iterator_t *iterator = (apc_iterator_t*)object; - - if (iterator->initialized == 0) { - return; - } - - while (apc_stack_size(iterator->stack) > 0) { - apc_iterator_item_dtor(apc_stack_pop(iterator->stack)); - } - apc_stack_destroy(iterator->stack TSRMLS_CC); - -#ifdef ITERATOR_PCRE - if (iterator->regex) { - efree(iterator->regex); - } -#endif - if (iterator->search_hash) { - zend_hash_destroy(iterator->search_hash); - efree(iterator->search_hash); - } - iterator->initialized = 0; - -} -/* }}} */ - -/* {{{ acp_iterator_free */ -static void apc_iterator_free(void *object TSRMLS_DC) { - zend_object_std_dtor(object TSRMLS_CC); - efree(object); -} -/* }}} */ - -/* {{{ apc_iterator_create */ -static zend_object_value apc_iterator_create(zend_class_entry *ce TSRMLS_DC) { - zend_object_value retval; - apc_iterator_t *iterator; - - iterator = emalloc(sizeof(apc_iterator_t)); - iterator->obj.ce = ce; - ALLOC_HASHTABLE(iterator->obj.properties); - zend_hash_init(iterator->obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0); -#ifdef ZEND_ENGINE_2_4 - iterator->obj.properties_table = NULL; -#endif - iterator->obj.guards = NULL; - iterator->initialized = 0; - iterator->stack = NULL; - iterator->regex_len = 0; - iterator->search_hash = NULL; - retval.handle = zend_objects_store_put(iterator, apc_iterator_destroy, apc_iterator_free, NULL TSRMLS_CC); - retval.handlers = &apc_iterator_object_handlers; - - return retval; -} -/* }}} */ - -/* {{{ apc_iterator_search_match - * Verify if the key matches our search parameters - */ -static int apc_iterator_search_match(apc_iterator_t *iterator, apc_cache_slot_t **slot) { - char *key; - int key_len; - char *fname_key = NULL; - int fname_key_len = 0; - int rval = 1; - - key = (char*)(*slot)->key.str; - key_len = (*slot)->key.len; - -#ifdef ITERATOR_PCRE - if (iterator->regex) { - rval = (pcre_exec(iterator->re, NULL, key, strlen(key), 0, 0, NULL, 0) >= 0); - } -#endif - - if (iterator->search_hash) { - rval = zend_hash_exists(iterator->search_hash, key, key_len); - if (!rval && fname_key) { - rval = zend_hash_exists(iterator->search_hash, fname_key, fname_key_len+1); - } - } - - if (fname_key) { - efree(fname_key); - } - - return rval; -} -/* }}} */ - -/* {{{ apc_iterator_check_expiry */ -static int apc_iterator_check_expiry(apc_cache_t* cache, apc_cache_slot_t **slot, time_t t) -{ - if((*slot)->value->ttl) { - if((time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) { - return 0; - } - } else if(cache->ttl) { - if((*slot)->ctime + cache->ttl < t) { - return 0; - } - } - - return 1; -} -/* }}} */ - -/* {{{ apc_iterator_fetch_active */ -static int apc_iterator_fetch_active(apc_iterator_t *iterator TSRMLS_DC) { - int count=0; - apc_cache_slot_t **slot; - apc_iterator_item_t *item; - time_t t; - - t = apc_time(); - - while (apc_stack_size(iterator->stack) > 0) { - apc_iterator_item_dtor(apc_stack_pop(iterator->stack)); - } - - while(count <= iterator->chunk_size && iterator->slot_idx < apc_user_cache->nslots) { - slot = &apc_user_cache->slots[iterator->slot_idx]; - while(*slot) { - if (apc_iterator_check_expiry(apc_user_cache, slot, t)) { - if (apc_iterator_search_match(iterator, slot)) { - count++; - item = apc_iterator_item_ctor(iterator, slot TSRMLS_CC); - if (item) { - apc_stack_push(iterator->stack, item TSRMLS_CC); - } - } - } - slot = &(*slot)->next; - } - iterator->slot_idx++; - } - - iterator->stack_idx = 0; - return count; -} -/* }}} */ - -/* {{{ apc_iterator_fetch_deleted */ -static int apc_iterator_fetch_deleted(apc_iterator_t *iterator TSRMLS_DC) { - int count=0; - apc_cache_slot_t **slot; - apc_iterator_item_t *item; - - APC_RLOCK(apc_user_cache->header); - slot = &apc_user_cache->header->gc; - while ((*slot) && count <= iterator->slot_idx) { - count++; - slot = &(*slot)->next; - } - count = 0; - while ((*slot) && count < iterator->chunk_size) { - if (apc_iterator_search_match(iterator, slot)) { - count++; - item = apc_iterator_item_ctor(iterator, slot TSRMLS_CC); - if (item) { - apc_stack_push(iterator->stack, item TSRMLS_CC); - } - } - slot = &(*slot)->next; - } - - iterator->slot_idx += count; - iterator->stack_idx = 0; - APC_RUNLOCK(apc_user_cache->header); - - return count; -} -/* }}} */ - -/* {{{ apc_iterator_totals */ -static void apc_iterator_totals(apc_iterator_t *iterator TSRMLS_DC) { - apc_cache_slot_t **slot; - int i; - - for (i=0; i < apc_user_cache->nslots; i++) { - slot = &apc_user_cache->slots[i]; - while((*slot)) { - if (apc_iterator_search_match(iterator, slot)) { - iterator->size += (*slot)->value->mem_size; - iterator->hits += (*slot)->nhits; - iterator->count++; - } - slot = &(*slot)->next; - } - } - - iterator->totals_flag = 1; -} -/* }}} */ - -/* {{{ proto object APCIterator::__costruct([ mixed search [, long format [, long chunk_size [, long list ]]]]) */ -PHP_METHOD(apc_iterator, __construct) { - zval *object = getThis(); - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(object TSRMLS_CC); - long format = APC_ITER_ALL; - long chunk_size=0; - zval *search = NULL; - long list = APC_LIST_ACTIVE; -#if defined(APC_FULL_BC) && APC_FULL_BC - /* these are ignored */ - char *cache_type; - int cache_type_len; -#endif - -#if defined(APC_FULL_BC) && APC_FULL_BC - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zlll", &cache_type, &cache_type_len, &search, &format, &chunk_size, &list) == FAILURE) { - return; - } -#else - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zlll", &search, &format, &chunk_size, &list) == FAILURE) { - return; - } -#endif - - if (!APCG(enabled)) { - apc_error("APC must be enabled to use APCIterator." TSRMLS_CC); - } - - if (chunk_size < 0) { - apc_error("APCIterator chunk size must be 0 or greater." TSRMLS_CC); - return; - } - - if (format > APC_ITER_ALL) { - apc_error("APCIterator format is invalid." TSRMLS_CC); - return; - } - - if (list == APC_LIST_ACTIVE) { - iterator->fetch = apc_iterator_fetch_active; - } else if (list == APC_LIST_DELETED) { - iterator->fetch = apc_iterator_fetch_deleted; - } else { - apc_warning("APCIterator invalid list type." TSRMLS_CC); - return; - } -#if defined(APC_FULL_BC) && APC_FULL_BC - if (!APC_CACHE_IS_USER(cache_type, cache_type_len)) { - iterator->initialized = 0; - return; - } -#endif - - iterator->slot_idx = 0; - iterator->stack_idx = 0; - iterator->key_idx = 0; - iterator->chunk_size = chunk_size == 0 ? APC_DEFAULT_CHUNK_SIZE : chunk_size; - iterator->stack = apc_stack_create(chunk_size TSRMLS_CC); - iterator->format = format; - iterator->totals_flag = 0; - iterator->count = 0; - iterator->size = 0; - iterator->hits = 0; - iterator->regex = NULL; - iterator->regex_len = 0; - iterator->search_hash = NULL; - if (search && Z_TYPE_P(search) == IS_STRING && Z_STRLEN_P(search)) { -#ifdef ITERATOR_PCRE - iterator->regex = estrndup(Z_STRVAL_P(search), Z_STRLEN_P(search)); - iterator->regex_len = Z_STRLEN_P(search); - iterator->re = pcre_get_compiled_regex(Z_STRVAL_P(search), NULL, NULL TSRMLS_CC); - - if(!iterator->re) { - apc_error("Could not compile regular expression: %s" TSRMLS_CC, Z_STRVAL_P(search)); - } -#else - apc_error("Regular expressions support is not enabled, please enable PCRE for APCIterator regex support" TSRMLS_CC); -#endif - } else if (search && Z_TYPE_P(search) == IS_ARRAY) { - Z_ADDREF_P(search); - iterator->search_hash = apc_flip_hash(Z_ARRVAL_P(search)); - } - iterator->initialized = 1; -} -/* }}} */ - -/* {{{ proto APCIterator::rewind() */ -PHP_METHOD(apc_iterator, rewind) { - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0) { - RETURN_FALSE; - } - - iterator->slot_idx = 0; - iterator->stack_idx = 0; - iterator->key_idx = 0; - iterator->fetch(iterator TSRMLS_CC); -} -/* }}} */ - -/* {{{ proto boolean APCIterator::valid() */ -PHP_METHOD(apc_iterator, valid) { - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0) { - RETURN_FALSE; - } - - if (apc_stack_size(iterator->stack) == iterator->stack_idx) { - iterator->fetch(iterator TSRMLS_CC); - } - - RETURN_BOOL(apc_stack_size(iterator->stack) == 0 ? 0 : 1); -} -/* }}} */ - -/* {{{ proto mixed APCIterator::current() */ -PHP_METHOD(apc_iterator, current) { - apc_iterator_item_t *item; - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0) { - RETURN_FALSE; - } - - if (apc_stack_size(iterator->stack) == iterator->stack_idx) { - if (iterator->fetch(iterator TSRMLS_CC) == 0) { - RETURN_FALSE; - } - } - - item = apc_stack_get(iterator->stack, iterator->stack_idx); - RETURN_ZVAL(item->value, 1, 0); -} -/* }}} */ - -/* {{{ proto string APCIterator::key() */ -PHP_METHOD(apc_iterator, key) { - apc_iterator_item_t *item; - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0 || apc_stack_size(iterator->stack) == 0) { - RETURN_FALSE; - } - - if (apc_stack_size(iterator->stack) == iterator->stack_idx) { - if (iterator->fetch(iterator TSRMLS_CC) == 0) { - RETURN_FALSE; - } - } - - item = apc_stack_get(iterator->stack, iterator->stack_idx); - - if (item->key) { - RETURN_STRINGL(item->key, (item->key_len-1), 1); - } else { - RETURN_LONG(iterator->key_idx); - } -} -/* }}} */ - -/* {{{ proto APCIterator::next() */ -PHP_METHOD(apc_iterator, next) { - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0 || apc_stack_size(iterator->stack) == 0) { - RETURN_FALSE; - } - - iterator->stack_idx++; - iterator->key_idx++; - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto long APCIterator::getTotalHits() */ -PHP_METHOD(apc_iterator, getTotalHits) { - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0) { - RETURN_FALSE; - } - - if (iterator->totals_flag == 0) { - apc_iterator_totals(iterator TSRMLS_CC); - } - - RETURN_LONG(iterator->hits); -} -/* }}} */ - -/* {{{ proto long APCIterator::getTotalSize() */ -PHP_METHOD(apc_iterator, getTotalSize) { - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0) { - RETURN_FALSE; - } - - if (iterator->totals_flag == 0) { - apc_iterator_totals(iterator TSRMLS_CC); - } - - RETURN_LONG(iterator->size); -} -/* }}} */ - -/* {{{ proto long APCIterator::getTotalCount() */ -PHP_METHOD(apc_iterator, getTotalCount) { - apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC); - - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - if (iterator->initialized == 0) { - RETURN_FALSE; - } - - if (iterator->totals_flag == 0) { - apc_iterator_totals(iterator TSRMLS_CC); - } - - RETURN_LONG(iterator->count); -} -/* }}} */ - -/* {{{ arginfo */ -#if (PHP_MAJOR_VERSION >= 6 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3)) -# define PHP_APC_ARGINFO -#else -# define PHP_APC_ARGINFO static -#endif - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_iterator___construct, 0, 0, 1) -#if defined(APC_FULL_BC) && APC_FULL_BC - ZEND_ARG_INFO(0, cache) -#endif - ZEND_ARG_INFO(0, search) - ZEND_ARG_INFO(0, format) - ZEND_ARG_INFO(0, chunk_size) - ZEND_ARG_INFO(0, list) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_iterator_void, 0, 0, 0) -ZEND_END_ARG_INFO() -/* }}} */ - -/* {{{ apc_iterator_functions */ -static zend_function_entry apc_iterator_functions[] = { - PHP_ME(apc_iterator, __construct, arginfo_apc_iterator___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(apc_iterator, rewind, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - PHP_ME(apc_iterator, current, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - PHP_ME(apc_iterator, key, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - PHP_ME(apc_iterator, next, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - PHP_ME(apc_iterator, valid, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - PHP_ME(apc_iterator, getTotalHits, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - PHP_ME(apc_iterator, getTotalSize, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - PHP_ME(apc_iterator, getTotalCount, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ apc_iterator_init */ -int apc_iterator_init(int module_number TSRMLS_DC) { - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, APC_ITERATOR_NAME, apc_iterator_functions); - apc_iterator_ce = zend_register_internal_class(&ce TSRMLS_CC); - apc_iterator_ce->create_object = apc_iterator_create; - zend_class_implements(apc_iterator_ce TSRMLS_CC, 1, zend_ce_iterator); - - REGISTER_LONG_CONSTANT("APC_LIST_ACTIVE", APC_LIST_ACTIVE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_LIST_DELETED", APC_LIST_DELETED, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_TYPE", APC_ITER_TYPE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_KEY", APC_ITER_KEY, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_VALUE", APC_ITER_VALUE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_NUM_HITS", APC_ITER_NUM_HITS, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_MTIME", APC_ITER_MTIME, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_CTIME", APC_ITER_CTIME, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_DTIME", APC_ITER_DTIME, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_ATIME", APC_ITER_ATIME, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_REFCOUNT", APC_ITER_REFCOUNT, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_MEM_SIZE", APC_ITER_MEM_SIZE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_TTL", APC_ITER_TTL, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_NONE", APC_ITER_NONE, CONST_PERSISTENT | CONST_CS); - REGISTER_LONG_CONSTANT("APC_ITER_ALL", APC_ITER_ALL, CONST_PERSISTENT | CONST_CS); - - memcpy(&apc_iterator_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - apc_iterator_object_handlers.clone_obj = apc_iterator_clone; - - return SUCCESS; -} -/* }}} */ - -/* {{{ apc_iterator_delete */ -int apc_iterator_delete(zval *zobj TSRMLS_DC) { - apc_iterator_t *iterator; - zend_class_entry *ce = Z_OBJCE_P(zobj); - apc_iterator_item_t *item; - - if (!ce || !instanceof_function(ce, apc_iterator_ce TSRMLS_CC)) { - apc_error("apc_delete object argument must be instance of APCIterator" TSRMLS_CC); - return 0; - } - iterator = (apc_iterator_t*)zend_object_store_get_object(zobj TSRMLS_CC); - - if (iterator->initialized == 0) { - return 0; - } - - while (iterator->fetch(iterator TSRMLS_CC)) { - while (iterator->stack_idx < apc_stack_size(iterator->stack)) { - item = apc_stack_get(iterator->stack, iterator->stack_idx++); - apc_cache_delete( - apc_user_cache, item->key, item->key_len TSRMLS_CC); - } - } - - return 1; -} -/* }}} */ - - -/* - * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_iterator.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_iterator.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_iterator.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_iterator.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - */ - -/* $Id: apc_iterator.h 307048 2011-01-03 23:53:17Z kalle $ */ - -#ifndef APC_ITERATOR_H -#define APC_ITERATOR_H - -#include "apc.h" -#include "apc_stack.h" - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE -/* Deal with problem present until php-5.2.2 where php_pcre.h was not installed correctly */ -# if !HAVE_BUNDLED_PCRE && PHP_MAJOR_VERSION == 5 && (PHP_MINOR_VERSION < 2 || (PHP_MINOR_VERSION == 2 && PHP_RELEASE_VERSION < 2)) -# include "apc_php_pcre.h" -# else -# include "ext/pcre/php_pcre.h" -# endif -# include "ext/standard/php_smart_str.h" -# define ITERATOR_PCRE 1 -#endif - - -#define APC_ITERATOR_NAME "APCIterator" - -#define APC_DEFAULT_CHUNK_SIZE 100 - -#define APC_LIST_ACTIVE 0x1 -#define APC_LIST_DELETED 0x2 - -#define APC_ITER_TYPE (1L << 0) -#define APC_ITER_KEY (1L << 1) -#define APC_ITER_VALUE (1L << 2) -#define APC_ITER_NUM_HITS (1L << 3) -#define APC_ITER_MTIME (1L << 4) -#define APC_ITER_CTIME (1L << 5) -#define APC_ITER_DTIME (1L << 6) -#define APC_ITER_ATIME (1L << 7) -#define APC_ITER_REFCOUNT (1L << 8) -#define APC_ITER_MEM_SIZE (1L << 9) -#define APC_ITER_TTL (1L << 10) - -#define APC_ITER_NONE (0x00000000L) -#define APC_ITER_ALL (0xffffffffL) - -typedef void* (*apc_iterator_item_cb_t)(apc_cache_slot_t **slot); - - -/* {{{ apc_iterator_t */ -typedef struct _apc_iterator_t { - zend_object obj; /* must always be first */ - short int initialized; /* sanity check in case __construct failed */ - long format; /* format bitmask of the return values ie: key, value, info */ - int (*fetch)(struct _apc_iterator_t *iterator TSRMLS_DC); - /* fetch callback to fetch items from cache slots or lists */ - long slot_idx; /* index to the slot array or linked list */ - long chunk_size; /* number of entries to pull down per fetch */ - apc_stack_t *stack; /* stack of entries pulled from cache */ - int stack_idx; /* index into the current stack */ -#ifdef ITERATOR_PCRE - pcre *re; /* regex filter on entry identifiers */ -#endif - char *regex; /* original regex expression or NULL */ - int regex_len; /* regex length */ - HashTable *search_hash; /* hash of keys to iterate over */ - long key_idx; /* incrementing index for numerical keys */ - short int totals_flag; /* flag if totals have been calculated */ - long hits; /* hit total */ - size_t size; /* size total */ - long count; /* count total */ -} apc_iterator_t; -/* }}} */ - -/* {{{ apc_iterator_item */ -typedef struct _apc_iterator_item_t { - char *key; /* string key */ - long key_len; /* strlen of key */ - zval *value; -} apc_iterator_item_t; -/* }}} */ - - -extern int apc_iterator_init(int module_number TSRMLS_DC); -extern int apc_iterator_delete(zval *zobj TSRMLS_DC); - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_lock_api.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_lock_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_lock_api.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_lock_api.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APCu | - +----------------------------------------------------------------------+ - | Copyright (c) 2013 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. | - +----------------------------------------------------------------------+ - | Author: Joe Watkins | - +----------------------------------------------------------------------+ - */ - -#ifndef APC_LOCK_API_H -#define APC_LOCK_API_H - -/* - APCu works most efficiently where there is access to native read/write locks - If the current system has native rwlocks present they will be used, if they are - not present, APCu will emulate their behavior with standard mutex. - While APCu is emulating read/write locks, reads and writes are exclusive, - additionally the write lock prefers readers, as is the default behaviour of - the majority of Posix rwlock implementations -*/ - -#ifndef PHP_WIN32 -# ifndef __USE_UNIX98 -# define __USE_UNIX98 -# endif -# include "pthread.h" -# ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifdef APC_NATIVE_RWLOCK - typedef pthread_rwlock_t apc_lock_t; -# else - typedef struct _apc_lock_t { - pthread_mutex_t read; - pthread_mutex_t write; - } apc_lock_t; -# endif -# else - typedef int apc_lock_t; -# endif -# else -# define APC_LOCK_NICE 1 -typedef struct { - unsigned long state; -} apc_lock_t; - -PHP_APCU_API int apc_lock_init(apc_lock_t* lock); -PHP_APCU_API int apc_lock_try(apc_lock_t* lock); -PHP_APCU_API int apc_lock_get(apc_lock_t* lock); -PHP_APCU_API int apc_lock_release(apc_lock_t* lock); -# endif -#else -/* XXX kernel lock mode only for now, compatible through all the wins, add more ifdefs for others */ -# include "apc_windows_srwlock_kernel.h" -typedef apc_windows_cs_rwlock_t apc_lock_t; -#endif - -/* {{{ functions */ -/* - The following functions should be called once per process: - apc_lock_init initializes attributes suitable for all locks - apc_lock_cleanup destroys those attributes - This saves us from having to create and destroy attributes for - every lock we use at runtime */ -PHP_APCU_API zend_bool apc_lock_init(TSRMLS_D); -PHP_APCU_API void apc_lock_cleanup(TSRMLS_D); -/* - The following functions should be self explanitory: -*/ -PHP_APCU_API zend_bool apc_lock_create(apc_lock_t *lock TSRMLS_DC); -PHP_APCU_API zend_bool apc_lock_rlock(apc_lock_t *lock TSRMLS_DC); -PHP_APCU_API zend_bool apc_lock_wlock(apc_lock_t *lock TSRMLS_DC); -PHP_APCU_API zend_bool apc_lock_runlock(apc_lock_t *lock TSRMLS_DC); -PHP_APCU_API zend_bool apc_lock_wunlock(apc_lock_t *lock TSRMLS_DC); -PHP_APCU_API void apc_lock_destroy(apc_lock_t *lock TSRMLS_DC); /* }}} */ - -/* {{{ generic locking macros */ -#define CREATE_LOCK(lock) apc_lock_create(lock TSRMLS_CC) -#define DESTROY_LOCK(lock) apc_lock_destroy(lock TSRMLS_CC) -#define WLOCK(lock) { HANDLE_BLOCK_INTERRUPTIONS(); apc_lock_wlock(lock TSRMLS_CC); } -#define WUNLOCK(lock) { apc_lock_wunlock(lock TSRMLS_CC); HANDLE_UNBLOCK_INTERRUPTIONS(); } -#define RLOCK(lock) { HANDLE_BLOCK_INTERRUPTIONS(); apc_lock_rlock(lock TSRMLS_CC); } -#define RUNLOCK(lock) { apc_lock_runlock(lock TSRMLS_CC); HANDLE_UNBLOCK_INTERRUPTIONS(); } -#define LOCK WLOCK -#define UNLOCK WUNLOCK -/* }}} */ - -/* {{{ object locking macros */ -#define APC_WLOCK(o) WLOCK(&(o)->lock) -#define APC_LOCK APC_WLOCK -#define APC_WUNLOCK(o) WUNLOCK(&(o)->lock) -#define APC_UNLOCK APC_WUNLOCK -#define APC_RLOCK(o) RLOCK(&(o)->lock) -#define APC_RUNLOCK(o) RUNLOCK(&(o)->lock) /* }}} */ - -#endif - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_lock.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_lock.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_lock.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_lock.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APCu | - +----------------------------------------------------------------------+ - | Copyright (c) 2013 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. | - +----------------------------------------------------------------------+ - | Author: Joe Watkins | - +----------------------------------------------------------------------+ - */ -#ifndef HAVE_APC_LOCK -#define HAVE_APC_LOCK - -#ifndef HAVE_APC_LOCK_H -# include "apc_lock.h" -#endif - -/* - APCu never checks the return value of a locking call, it assumes it should not fail - and execution continues regardless, therefore it is pointless to check the return - values of calls to locking functions, lets save ourselves the comparison. -*/ - -/* {{{ There's very little point in initializing a billion sets of attributes */ -#ifndef PHP_WIN32 -# ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - static pthread_mutexattr_t apc_lock_attr; -# else - static pthread_rwlockattr_t apc_lock_attr; -# endif -# else -# include -# include - - static int apc_fcntl_call(int fd, int cmd, int type, off_t offset, int whence, off_t len) { - int ret; - struct flock lock; - - lock.l_type = type; - lock.l_start = offset; - lock.l_whence = whence; - lock.l_len = len; - lock.l_pid = 0; - - do { - ret = fcntl(fd, cmd, &lock) ; - } while(ret < 0 && errno == EINTR); - - return(ret); - } -# endif -# else -PHP_APCU_API int apc_lock_init(apc_lock_t* lock) -{ - lock->state = 0; -} - -PHP_APCU_API int apc_lock_try(apc_lock_t* lock) -{ - int failed = 1; - - asm volatile - ( - "xchgl %0, 0(%1)" : - "=r" (failed) : "r" (&lock->state), - "0" (failed) - ); - - return failed; -} - -PHP_APCU_API int apc_lock_get(apc_lock_t* lock) -{ - int failed = 1; - - do { - failed = apc_lock_try( - lock); -#ifdef APC_LOCK_NICE - usleep(0); -#endif - } while (failed); - - return failed; -} - -PHP_APCU_API int apc_lock_release(apc_lock_t* lock) -{ - int released = 0; - - asm volatile ( - "xchg %0, 0(%1)" : "=r" (released) : "r" (&lock->state), - "0" (released) - ); - - return !released; -} -# endif -static zend_bool apc_lock_ready = 0; -#endif /* }}} */ - -/* {{{ Initialize the global lock attributes */ -PHP_APCU_API zend_bool apc_lock_init(TSRMLS_D) { -#ifndef PHP_WIN32 - if (apc_lock_ready) - return 1; - - /* once per process please */ - apc_lock_ready = 1; - -#ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - if (pthread_mutexattr_init(&apc_lock_attr) == SUCCESS) { - if (pthread_mutexattr_setpshared(&apc_lock_attr, PTHREAD_PROCESS_SHARED) == SUCCESS) { - pthread_mutexattr_settype(&apc_lock_attr, PTHREAD_MUTEX_RECURSIVE); - return 1; - } - } -# else - if (pthread_rwlockattr_init(&apc_lock_attr) == SUCCESS) { - if (pthread_rwlockattr_setpshared(&apc_lock_attr, PTHREAD_PROCESS_SHARED) == SUCCESS) { - return 1; - } - } -# endif -# endif -#endif - return 0; -#else - return 1; -#endif -} /* }}} */ - -/* {{{ Cleanup attributes and statics */ -PHP_APCU_API void apc_lock_cleanup(TSRMLS_D) { -#ifndef PHP_WIN32 - if (!apc_lock_ready) - return; - - /* once per process please */ - apc_lock_ready = 0; - -#ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - pthread_mutexattr_destroy(&apc_lock_attr); -# else - pthread_rwlockattr_destroy(&apc_lock_attr); -# endif -# endif -#endif -#endif -} /* }}} */ - -PHP_APCU_API zend_bool apc_lock_create(apc_lock_t *lock TSRMLS_DC) { -#ifndef PHP_WIN32 -# ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - { - /* Emulated */ - pthread_mutex_init(&lock->read, &apc_lock_attr); - pthread_mutex_init(&lock->write, &apc_lock_attr); - - return 1; - } -# else - { - /* Native */ - return (pthread_rwlock_init(lock, &apc_lock_attr)==SUCCESS); - } -# endif -# else - { - /* FCNTL */ - char lock_path[] = "/tmp/.apc.XXXXXX"; - mktemp( - lock_path); - (*lock) = open(lock_path, O_RDWR|O_CREAT, 0666); - if((*lock) > 0 ) { - unlink( - lock_path); - return 1; - } else { - return 0; - } - } -# endif -#else - { - /* SPIN */ - lock->state = 0; - return 1; - } - -#endif -#else - lock = (apc_lock_t *)apc_windows_cs_create((apc_windows_cs_rwlock_t *)lock TSRMLS_CC); - - return (NULL != lock); -#endif -} - -PHP_APCU_API zend_bool apc_lock_rlock(apc_lock_t *lock TSRMLS_DC) { -#ifndef PHP_WIN32 - HANDLE_BLOCK_INTERRUPTIONS(); -#ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - pthread_mutex_lock(&lock->read); -# else - pthread_rwlock_rdlock(lock); -# endif -# else - { - /* FCNTL */ - apc_fcntl_call((*lock), F_SETLKW, F_RDLCK, 0, SEEK_SET, 0); - } -# endif -#else - { - /* SPIN */ - apc_lock_get(lock); - } -#endif - HANDLE_UNBLOCK_INTERRUPTIONS(); -#else - apc_windows_cs_rdlock((apc_windows_cs_rwlock_t *)lock TSRMLS_CC); -#endif - return 1; -} - -PHP_APCU_API zend_bool apc_lock_wlock(apc_lock_t *lock TSRMLS_DC) { -#ifndef PHP_WIN32 - HANDLE_BLOCK_INTERRUPTIONS(); -#ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - pthread_mutex_lock(&lock->read); - pthread_mutex_lock(&lock->write); -# else - pthread_rwlock_wrlock(lock); -# endif -# else - { - /* FCNTL */ - apc_fcntl_call((*lock), F_SETLKW, F_WRLCK, 0, SEEK_SET, 0); - } -# endif -#else - { - /* SPIN */ - apc_lock_get(lock); - } -#endif - HANDLE_UNBLOCK_INTERRUPTIONS(); -#else - apc_windows_cs_lock((apc_windows_cs_rwlock_t *)lock TSRMLS_CC); -#endif - return 1; -} - -PHP_APCU_API zend_bool apc_lock_wunlock(apc_lock_t *lock TSRMLS_DC) { -#ifndef PHP_WIN32 - HANDLE_BLOCK_INTERRUPTIONS(); -#ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - pthread_mutex_unlock(&lock->read); - pthread_mutex_unlock(&lock->write); -# else - pthread_rwlock_unlock(lock); -# endif -# else - { - /* FCNTL */ - apc_fcntl_call((*lock), F_SETLKW, F_UNLCK, 0, SEEK_SET, 0); - } -# endif -#else - { - /* SPIN */ - apc_lock_release(lock); - } -#endif - HANDLE_UNBLOCK_INTERRUPTIONS(); -#else - apc_windows_cs_unlock_wr((apc_windows_cs_rwlock_t *)lock TSRMLS_CC); -#endif - return 1; -} - -PHP_APCU_API zend_bool apc_lock_runlock(apc_lock_t *lock TSRMLS_DC) { -#ifndef PHP_WIN32 - HANDLE_BLOCK_INTERRUPTIONS(); -#ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - pthread_mutex_unlock(&lock->read); -# else - pthread_rwlock_unlock(lock); -# endif -# else - { - /* FCNTL */ - apc_fcntl_call((*lock), F_SETLKW, F_UNLCK, 0, SEEK_SET, 0); - } -# endif -#else - { - /* SPIN */ - apc_lock_release(lock); - } -#endif - HANDLE_UNBLOCK_INTERRUPTIONS(); -#else - apc_windows_cs_unlock_rd((apc_windows_cs_rwlock_t *)lock TSRMLS_CC); -#endif - return 1; -} - -PHP_APCU_API void apc_lock_destroy(apc_lock_t *lock TSRMLS_DC) { -#ifndef PHP_WIN32 -#ifndef APC_SPIN_LOCK -# ifndef APC_FCNTL_LOCK -# ifndef APC_NATIVE_RWLOCK - /* nothing */ -# else - /* nothing */ -# endif -# else - { - /* FCNTL */ - close ((*lock)); - } -# endif -#endif -#else - apc_windows_cs_destroy((apc_windows_cs_rwlock_t *)lock); -#endif -} -#endif - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_lock.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_lock.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_lock.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_lock.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APCu | - +----------------------------------------------------------------------+ - | Copyright (c) 2013 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. | - +----------------------------------------------------------------------+ - | Author: Joe Watkins | - +----------------------------------------------------------------------+ - */ - -#ifndef APC_LOCK_H -#define APC_LOCK_H - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "apc.h" - -#ifndef APC_LOCK_API_H -# include "apc_lock_api.h" -#endif - -#endif diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_mmap.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_mmap.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_mmap.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_mmap.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: 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. - - */ - -/* $Id: apc_mmap.c 328964 2013-01-03 12:38:55Z remi $ */ - -#include "apc.h" -#include "apc_mmap.h" -#include "apc_lock.h" - -#if APC_MMAP - -#include -#include -#include - -/* - * Some operating systems (like FreeBSD) have a MAP_NOSYNC flag that - * tells whatever update daemons might be running to not flush dirty - * vm pages to disk unless absolutely necessary. My guess is that - * most systems that don't have this probably default to only synching - * to disk when absolutely necessary. - */ -#ifndef MAP_NOSYNC -#define MAP_NOSYNC 0 -#endif - -/* support for systems where MAP_ANONYMOUS is defined but not MAP_ANON, ie: HP-UX bug #14615 */ -#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) -# define MAP_ANON MAP_ANONYMOUS -#endif - -apc_segment_t apc_mmap(char *file_mask, size_t size TSRMLS_DC) -{ - apc_segment_t segment; - - int fd = -1; - int flags = MAP_SHARED | MAP_NOSYNC; -#ifdef APC_MEMPROTECT - int remap = 1; -#endif - - /* If no filename was provided, do an anonymous mmap */ - if(!file_mask || (file_mask && !strlen(file_mask))) { -#if !defined(MAP_ANON) - apc_error("Anonymous mmap does not apear to be available on this system (MAP_ANON/MAP_ANONYMOUS). Please see the apc.mmap_file_mask INI option." TSRMLS_CC); -#else - fd = -1; - flags = MAP_SHARED | MAP_ANON; -#ifdef APC_MEMPROTECT - remap = 0; -#endif -#endif - } else if(!strcmp(file_mask,"/dev/zero")) { - fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR); - if(fd == -1) { - apc_error("apc_mmap: open on /dev/zero failed:" TSRMLS_CC); - goto error; - } -#ifdef APC_MEMPROTECT - remap = 0; /* cannot remap */ -#endif - } else if(strstr(file_mask,".shm")) { - /* - * If the filemask contains .shm we try to do a POSIX-compliant shared memory - * backed mmap which should avoid synchs on some platforms. At least on - * FreeBSD this implies MAP_NOSYNC and on Linux it is equivalent of mmap'ing - * a file in a mounted shmfs. For this to work on Linux you need to make sure - * you actually have shmfs mounted. Also on Linux, make sure the file_mask you - * pass in has a leading / and no other /'s. eg. /apc.shm.XXXXXX - * On FreeBSD these are mapped onto the regular filesystem so you can put whatever - * path you want here. - */ - if(!mktemp(file_mask)) { - apc_error("apc_mmap: mktemp on %s failed:" TSRMLS_CC, file_mask); - goto error; - } - fd = shm_open(file_mask, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR); - if(fd == -1) { - apc_error("apc_mmap: shm_open on %s failed:" TSRMLS_CC, file_mask); - goto error; - } - if (ftruncate(fd, size) < 0) { - close(fd); - shm_unlink(file_mask); - apc_error("apc_mmap: ftruncate failed:" TSRMLS_CC); - goto error; - } - shm_unlink(file_mask); - } else { - /* - * Otherwise we do a normal filesystem mmap - */ - fd = mkstemp(file_mask); - if(fd == -1) { - apc_error("apc_mmap: mkstemp on %s failed:" TSRMLS_CC, file_mask); - goto error; - } - if (ftruncate(fd, size) < 0) { - close(fd); - unlink(file_mask); - apc_error("apc_mmap: ftruncate failed:" TSRMLS_CC); - goto error; - } - unlink(file_mask); - } - - segment.shmaddr = (void *)mmap(NULL, size, PROT_READ | PROT_WRITE, flags, fd, 0); - segment.size = size; - -#ifdef APC_MEMPROTECT - if(remap) { - segment.roaddr = (void *)mmap(NULL, size, PROT_READ, flags, fd, 0); - } else { - segment.roaddr = NULL; - } -#endif - - if((long)segment.shmaddr == -1) { - apc_error("apc_mmap: mmap failed:" TSRMLS_CC); - } - - if(fd != -1) close(fd); - - return segment; - -error: - - segment.shmaddr = (void*)-1; - segment.size = 0; -#ifdef APC_MEMPROTECT - segment.roaddr = NULL; -#endif - return segment; -} - -void apc_unmap(apc_segment_t *segment TSRMLS_DC) -{ - if (munmap(segment->shmaddr, segment->size) < 0) { - apc_warning("apc_unmap: munmap failed:" TSRMLS_CC); - } - -#ifdef APC_MEMPROTECT - if (segment->roaddr && munmap(segment->roaddr, segment->size) < 0) { - apc_warning("apc_unmap: munmap failed:" TSRMLS_CC); - } -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_mmap.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_mmap.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_mmap.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_mmap.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: Gopal V | - +----------------------------------------------------------------------+ - - 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_mmap.h 307048 2011-01-03 23:53:17Z kalle $ */ - -#ifndef APC_MMAP_H -#define APC_MMAP_H - -#include - -#include "apc.h" -#include "apc_sma.h" - -/* Wrapper functions for shared memory mapped files */ - -#if APC_MMAP -apc_segment_t apc_mmap(char *file_mask, size_t size TSRMLS_DC); -void apc_unmap(apc_segment_t* segment TSRMLS_DC); -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc.php php5-easybib-apcu-4.0.7/apcu-4.0.6/apc.php --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc.php 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc.php 1970-01-01 00:00:00.000000000 +0000 @@ -1,1146 +0,0 @@ - | - | Rasmus Lerdorf | - | Ilia Alshanetsky | - +----------------------------------------------------------------------+ - - All other licensing and usage conditions are those of the PHP Group. - - */ - -$VERSION='$Id$'; - -////////// READ OPTIONAL CONFIGURATION FILE //////////// -if (file_exists("apc.conf.php")) include("apc.conf.php"); -//////////////////////////////////////////////////////// - -////////// BEGIN OF DEFAULT CONFIG AREA /////////////////////////////////////////////////////////// - -defaults('USE_AUTHENTICATION',1); // Use (internal) authentication - best choice if - // no other authentication is available - // If set to 0: - // There will be no further authentication. You - // will have to handle this by yourself! - // If set to 1: - // You need to change ADMIN_PASSWORD to make - // this work! -defaults('ADMIN_USERNAME','apc'); // Admin Username -defaults('ADMIN_PASSWORD','password'); // Admin Password - CHANGE THIS TO ENABLE!!! - -// (beckerr) I'm using a clear text password here, because I've no good idea how to let -// users generate a md5 or crypt password in a easy way to fill it in above - -//defaults('DATE_FORMAT', "d.m.Y H:i:s"); // German -defaults('DATE_FORMAT', 'Y/m/d H:i:s'); // US - -defaults('GRAPH_SIZE',200); // Image size - -//defaults('PROXY', 'tcp://127.0.0.1:8080'); - -////////// END OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////// - - -// "define if not defined" -function defaults($d,$v) { - if (!defined($d)) define($d,$v); // or just @define(...) -} - -// rewrite $PHP_SELF to block XSS attacks -// -$PHP_SELF= isset($_SERVER['PHP_SELF']) ? htmlentities(strip_tags($_SERVER['PHP_SELF'],''), ENT_QUOTES, 'UTF-8') : ''; -$time = time(); -$host = php_uname('n'); -if($host) { $host = '('.$host.')'; } -if (isset($_SERVER['SERVER_ADDR'])) { - $host .= ' ('.$_SERVER['SERVER_ADDR'].')'; -} - -// operation constants -define('OB_HOST_STATS',1); -define('OB_USER_CACHE',2); -define('OB_VERSION_CHECK',3); - -// check validity of input variables -$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 - 'LO' => '/^1$/', // login requested - - 'COUNT' => '/^\d+$/', // number of line displayed in list - 'SCOPE' => '/^[AD]$/', // list view scope - 'SORT1' => '/^[AHSMCDTZ]$/', // first sort key - 'SORT2' => '/^[DA]$/', // second sort key - 'AGGR' => '/^\d+$/', // aggregation by dir level - 'SEARCH' => '~^[a-zA-Z0-9/_.-]*$~' // aggregation by dir level -); - -// cache scope -$scope_list=array( - 'A' => 'cache_list', - 'D' => 'deleted_list' -); - -// handle POST and GET requests -if (empty($_REQUEST)) { - if (!empty($_GET) && !empty($_POST)) { - $_REQUEST = array_merge($_GET, $_POST); - } else if (!empty($_GET)) { - $_REQUEST = $_GET; - } else if (!empty($_POST)) { - $_REQUEST = $_POST; - } else { - $_REQUEST = array(); - } -} - -// check parameter syntax -foreach($vardom as $var => $dom) { - if (!isset($_REQUEST[$var])) { - $MYREQUEST[$var]=NULL; - } else if (!is_array($_REQUEST[$var]) && preg_match($dom.'D',$_REQUEST[$var])) { - $MYREQUEST[$var]=$_REQUEST[$var]; - } else { - $MYREQUEST[$var]=$_REQUEST[$var]=NULL; - } -} - -// check parameter sematics -if (empty($MYREQUEST['SCOPE'])) $MYREQUEST['SCOPE']="A"; -if (empty($MYREQUEST['SORT1'])) $MYREQUEST['SORT1']="H"; -if (empty($MYREQUEST['SORT2'])) $MYREQUEST['SORT2']="D"; -if (empty($MYREQUEST['OB'])) $MYREQUEST['OB']=OB_HOST_STATS; -if (!isset($MYREQUEST['COUNT'])) $MYREQUEST['COUNT']=20; -if (!isset($scope_list[$MYREQUEST['SCOPE']])) $MYREQUEST['SCOPE']='A'; - -$MY_SELF= - "$PHP_SELF". - "?SCOPE=".$MYREQUEST['SCOPE']. - "&SORT1=".$MYREQUEST['SORT1']. - "&SORT2=".$MYREQUEST['SORT2']. - "&COUNT=".$MYREQUEST['COUNT']; -$MY_SELF_WO_SORT= - "$PHP_SELF". - "?SCOPE=".$MYREQUEST['SCOPE']. - "&COUNT=".$MYREQUEST['COUNT']; - -// authentication needed? -// -if (!USE_AUTHENTICATION) { - $AUTHENTICATED=1; -} else { - $AUTHENTICATED=0; - if (ADMIN_PASSWORD!='password' && ($MYREQUEST['LO'] == 1 || isset($_SERVER['PHP_AUTH_USER']))) { - - if (!isset($_SERVER['PHP_AUTH_USER']) || - !isset($_SERVER['PHP_AUTH_PW']) || - $_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME || - $_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) { - Header("WWW-Authenticate: Basic realm=\"APC Login\""); - Header("HTTP/1.0 401 Unauthorized"); - - echo << -

Rejected!

- Wrong Username or Password!
 
  - Continue... - -EOB; - exit; - - } else { - $AUTHENTICATED=1; - } - } -} - -// clear cache -if ($AUTHENTICATED && isset($MYREQUEST['CC']) && $MYREQUEST['CC']) { - apcu_clear_cache(); -} - -if ($AUTHENTICATED && !empty($MYREQUEST['DU'])) { - apcu_delete($MYREQUEST['DU']); -} - -if(!function_exists('apcu_cache_info')) { - echo "No cache info available. APC does not appear to be running."; - exit; -} - -$cache = apcu_cache_info(); - -$mem=apcu_sma_info(); - -// don't cache this page -// -header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 -header("Cache-Control: post-check=0, pre-check=0", false); -header("Pragma: no-cache"); // HTTP/1.0 - -function duration($ts) { - global $time; - $years = (int)((($time - $ts)/(7*86400))/52.177457); - $rem = (int)(($time-$ts)-($years * 52.177457 * 7 * 86400)); - $weeks = (int)(($rem)/(7*86400)); - $days = (int)(($rem)/86400) - $weeks*7; - $hours = (int)(($rem)/3600) - $days*24 - $weeks*7*24; - $mins = (int)(($rem)/60) - $hours*60 - $days*24*60 - $weeks*7*24*60; - $str = ''; - if($years==1) $str .= "$years year, "; - if($years>1) $str .= "$years years, "; - if($weeks==1) $str .= "$weeks week, "; - if($weeks>1) $str .= "$weeks weeks, "; - if($days==1) $str .= "$days day,"; - if($days>1) $str .= "$days days,"; - if($hours == 1) $str .= " $hours hour and"; - if($hours>1) $str .= " $hours hours and"; - if($mins == 1) $str .= " 1 minute"; - else $str .= " $mins minutes"; - return $str; -} - -// create graphics -// -function graphics_avail() { - return extension_loaded('gd'); -} -if (isset($MYREQUEST['IMG'])) -{ - if (!graphics_avail()) { - exit(0); - } - - function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$color2,$text='',$placeindex=0) { - $r=$diameter/2; - $w=deg2rad((360+$start+($end-$start)/2)%360); - - - if (function_exists("imagefilledarc")) { - // exists only if GD 2.0.1 is avaliable - imagefilledarc($im, $centerX+1, $centerY+1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE); - imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE); - imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL|IMG_ARC_EDGED); - } else { - imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2); - imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); - imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start+1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); - imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end-1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); - imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); - imagefill($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2, $color2); - } - if ($text) { - if ($placeindex>0) { - imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); - imagestring($im,4,$diameter, $placeindex*12,$text,$color1); - - } else { - imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); - } - } - } - - function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$text,$placeindex=0) { - $r=$diameter/2; - $w=deg2rad((360+$start+($end-$start)/2)%360); - - if ($placeindex>0) { - imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); - imagestring($im,4,$diameter, $placeindex*12,$text,$color1); - - } else { - imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); - } - } - - function fill_box($im, $x, $y, $w, $h, $color1, $color2,$text='',$placeindex='') { - global $col_black; - $x1=$x+$w-1; - $y1=$y+$h-1; - - imagerectangle($im, $x, $y1, $x1+1, $y+1, $col_black); - if($y1>$y) imagefilledrectangle($im, $x, $y, $x1, $y1, $color2); - else imagefilledrectangle($im, $x, $y1, $x1, $y, $color2); - imagerectangle($im, $x, $y1, $x1, $y, $color1); - if ($text) { - if ($placeindex>0) { - - if ($placeindex<16) - { - $px=5; - $py=$placeindex*12+6; - imagefilledrectangle($im, $px+90, $py+3, $px+90-4, $py-3, $color2); - imageline($im,$x,$y+$h/2,$px+90,$py,$color2); - imagestring($im,2,$px,$py-6,$text,$color1); - - } else { - if ($placeindex<31) { - $px=$x+40*2; - $py=($placeindex-15)*12+6; - } else { - $px=$x+40*2+100*intval(($placeindex-15)/15); - $py=($placeindex%15)*12+6; - } - imagefilledrectangle($im, $px, $py+3, $px-4, $py-3, $color2); - imageline($im,$x+$w,$y+$h/2,$px,$py,$color2); - imagestring($im,2,$px+2,$py-6,$text,$color1); - } - } else { - imagestring($im,4,$x+5,$y1-16,$text,$color1); - } - } - } - - - $size = GRAPH_SIZE; // image size - if ($MYREQUEST['IMG']==3) - $image = imagecreate(2*$size+150, $size+10); - else - $image = imagecreate($size+50, $size+10); - - $col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); - $col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30); - $col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60); - $col_black = imagecolorallocate($image, 0, 0, 0); - imagecolortransparent($image,$col_white); - - switch ($MYREQUEST['IMG']) { - - case 1: - $s=$mem['num_seg']*$mem['seg_size']; - $a=$mem['avail_mem']; - $x=$y=$size/2; - $fuzz = 0.000001; - - // This block of code creates the pie chart. It is a lot more complex than you - // would expect because we try to visualize any memory fragmentation as well. - $angle_from = 0; - $string_placement=array(); - for($i=0; $i<$mem['num_seg']; $i++) { - $ptr = 0; - $free = $mem['block_lists'][$i]; - uasort($free, 'block_sort'); - foreach($free as $block) { - if($block['offset']!=$ptr) { // Used block - $angle_to = $angle_from+($block['offset']-$ptr)/$s; - if(($angle_to+$fuzz)>1) $angle_to = 1; - if( ($angle_to*360) - ($angle_from*360) >= 1) { - fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red); - if (($angle_to-$angle_from)>0.05) { - array_push($string_placement, array($angle_from,$angle_to)); - } - } - $angle_from = $angle_to; - } - $angle_to = $angle_from+($block['size'])/$s; - if(($angle_to+$fuzz)>1) $angle_to = 1; - if( ($angle_to*360) - ($angle_from*360) >= 1) { - fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_green); - if (($angle_to-$angle_from)>0.05) { - array_push($string_placement, array($angle_from,$angle_to)); - } - } - $angle_from = $angle_to; - $ptr = $block['offset']+$block['size']; - } - if ($ptr < $mem['seg_size']) { // memory at the end - $angle_to = $angle_from + ($mem['seg_size'] - $ptr)/$s; - if(($angle_to+$fuzz)>1) $angle_to = 1; - fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red); - if (($angle_to-$angle_from)>0.05) { - array_push($string_placement, array($angle_from,$angle_to)); - } - } - } - foreach ($string_placement as $angle) { - text_arc($image,$x,$y,$size,$angle[0]*360,$angle[1]*360,$col_black,bsize($s*($angle[1]-$angle[0]))); - } - break; - - case 2: - $s=$cache['nhits']+$cache['nmisses']; - $a=$cache['nhits']; - - fill_box($image, 30,$size,50,$s ? (-$a*($size-21)/$s) : 0,$col_black,$col_green,sprintf("%.1f%%",$s ? $cache['nhits']*100/$s : 0)); - fill_box($image,130,$size,50,$s ? -max(4,($s-$a)*($size-21)/$s) : 0,$col_black,$col_red,sprintf("%.1f%%",$s ? $cache['nmisses']*100/$s : 0)); - break; - - case 3: - $s=$mem['num_seg']*$mem['seg_size']; - $a=$mem['avail_mem']; - $x=130; - $y=1; - $j=1; - - // This block of code creates the bar chart. It is a lot more complex than you - // would expect because we try to visualize any memory fragmentation as well. - for($i=0; $i<$mem['num_seg']; $i++) { - $ptr = 0; - $free = $mem['block_lists'][$i]; - uasort($free, 'block_sort'); - foreach($free as $block) { - if($block['offset']!=$ptr) { // Used block - $h=(GRAPH_SIZE-5)*($block['offset']-$ptr)/$s; - if ($h>0) { - $j++; - if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($block['offset']-$ptr),$j); - else fill_box($image,$x,$y,50,$h,$col_black,$col_red); - } - $y+=$h; - } - $h=(GRAPH_SIZE-5)*($block['size'])/$s; - if ($h>0) { - $j++; - if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_green,bsize($block['size']),$j); - else fill_box($image,$x,$y,50,$h,$col_black,$col_green); - } - $y+=$h; - $ptr = $block['offset']+$block['size']; - } - if ($ptr < $mem['seg_size']) { // memory at the end - $h = (GRAPH_SIZE-5) * ($mem['seg_size'] - $ptr) / $s; - if ($h > 0) { - fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($mem['seg_size']-$ptr),$j++); - } - } - } - break; - - case 4: - $s=$cache['nhits']+$cache['nmisses']; - $a=$cache['nhits']; - - fill_box($image, 30,$size,50,$s ? -$a*($size-21)/$s : 0,$col_black,$col_green,sprintf("%.1f%%", $s ? $cache['nhits']*100/$s : 0)); - fill_box($image,130,$size,50,$s ? -max(4,($s-$a)*($size-21)/$s) : 0,$col_black,$col_red,sprintf("%.1f%%", $s ? $cache['nmisses']*100/$s : 0)); - break; - } - - header("Content-type: image/png"); - imagepng($image); - exit; -} - -// pretty printer for byte values -// -function bsize($s) { - foreach (array('','K','M','G') as $i => $k) { - if ($s < 1024) break; - $s/=1024; - } - return sprintf("%5.1f %sBytes",$s,$k); -} - -// sortable table header in "scripts for this host" view -function sortheader($key,$name,$extra='') { - global $MYREQUEST, $MY_SELF_WO_SORT; - - if ($MYREQUEST['SORT1']==$key) { - $MYREQUEST['SORT2'] = $MYREQUEST['SORT2']=='A' ? 'D' : 'A'; - } - return "$name"; - -} - -// create menu entry -function menu_entry($ob,$title) { - global $MYREQUEST,$MY_SELF; - if ($MYREQUEST['OB']!=$ob) { - return "
  • $title
  • "; - } else if (empty($MYREQUEST['SH'])) { - return "
  • $title
  • "; - } else { - return "
  • $title
  • "; - } -} - -function put_login_link($s="Login") -{ - global $MY_SELF,$MYREQUEST,$AUTHENTICATED; - // needs ADMIN_PASSWORD to be changed! - // - if (!USE_AUTHENTICATION) { - return; - } else if (ADMIN_PASSWORD=='password') - { - print <<$s -EOB; - } else if ($AUTHENTICATED) { - print <<$s -EOB; - } -} - -function block_sort($array1, $array2) -{ - if ($array1['offset'] > $array2['offset']) { - return 1; - } else { - return -1; - } -} - - -?> - - -APCu INFO <?php echo $host ?> - - - -
    -

    - -
    User Cache
    -

    - -
    -
    - - -
  • Refresh Data
  • -EOB; -echo - menu_entry(OB_HOST_STATS,'View Host Stats'), - menu_entry(OB_USER_CACHE,'User Cache Entries'), - menu_entry(OB_VERSION_CHECK,'Version Check'); - -if ($AUTHENTICATED) { - echo <<Clear Cache -EOB; -} -echo << -EOB; - - -// CONTENT -echo << -EOB; - -// MAIN SWITCH STATEMENT - -switch ($MYREQUEST['OB']) { -// ----------------------------------------------- -// Host Stats -// ----------------------------------------------- -case OB_HOST_STATS: - $mem_size = $mem['num_seg']*$mem['seg_size']; - $mem_avail= $mem['avail_mem']; - $mem_used = $mem_size-$mem_avail; - $seg_size = bsize($mem['seg_size']); - $req_rate_user = sprintf("%.2f", $cache['nhits'] ? (($cache['nhits']+$cache['nmisses'])/($time-$cache['stime'])) : 0); - $hit_rate_user = sprintf("%.2f", $cache['nhits'] ? (($cache['nhits'])/($time-$cache['stime'])) : 0); - $miss_rate_user = sprintf("%.2f", $cache['nmisses'] ? (($cache['nmisses'])/($time-$cache['stime'])) : 0); - $insert_rate_user = sprintf("%.2f", $cache['ninserts'] ? (($cache['ninserts'])/($time-$cache['stime'])) : 0); - $apcversion = phpversion('apcu'); - $phpversion = phpversion(); - $number_vars = $cache['nentries']; - $size_vars = bsize($cache['mem_size']); - $i=0; - echo <<< EOB -

    General Cache Information

    - - - -EOB; - - if(!empty($_SERVER['SERVER_NAME'])) - echo "\n"; - if(!empty($_SERVER['SERVER_SOFTWARE'])) - echo "\n"; - - echo << -EOB; - echo ''; - echo ''; - echo ''; - echo <<
    APCu Version$apcversion
    PHP Version$phpversion
    APCu Host{$_SERVER['SERVER_NAME']} $host
    Server Software{$_SERVER['SERVER_SOFTWARE']}
    Shared Memory{$mem['num_seg']} Segment(s) with $seg_size -
    ({$cache['memory_type']} memory) -
    Start Time',date(DATE_FORMAT,$cache['stime']),'
    Uptime',duration($cache['stime']),'
    File Upload Support',$cache['file_upload_progress'],'
    -
    - -

    Cache Information

    - - - - - - - - - - - -
    Cached Variables$number_vars ($size_vars)
    Hits{$cache['nhits']}
    Misses{$cache['nmisses']}
    Request Rate (hits, misses)$req_rate_user cache requests/second
    Hit Rate$hit_rate_user cache requests/second
    Miss Rate$miss_rate_user cache requests/second
    Insert Rate$insert_rate_user cache requests/second
    Cache full count{$cache['nexpunges']}
    -
    - -

    Runtime Settings

    -EOB; - - $j = 0; - foreach (ini_get_all('apcu') as $k => $v) { - echo "\n"; - $j = 1 - $j; - } - - if($mem['num_seg']>1 || $mem['num_seg']==1 && count($mem['block_lists'][0])>1) - $mem_note = "Memory Usage
    (multiple slices indicate fragments)"; - else - $mem_note = "Memory Usage"; - - echo <<< EOB -
    ",$k,"",str_replace(',',',
    ',$v['local_value']),"
    -
    - -

    Host Status Diagrams

    - -EOB; - $size='width='.(GRAPH_SIZE+50).' height='.(GRAPH_SIZE+10); -echo << - - - -EOB; - - echo - graphics_avail() ? - ''. - "". - "\n" - : "", - '', - '\n", - '\n", - '', - '', - '\n", - '\n"; - echo <<< EOB - -
    $mem_noteHits & Misses
    \"\"\"\"
     Free: ',bsize($mem_avail).sprintf(" (%.1f%%)",$mem_avail*100/$mem_size)," Hits: ',$cache['nhits'].@sprintf(" (%.1f%%)",$cache['nhits']*100/($cache['nhits']+$cache['nmisses'])),"
     Used: ',bsize($mem_used ).sprintf(" (%.1f%%)",$mem_used *100/$mem_size)," Misses: ',$cache['nmisses'].@sprintf(" (%.1f%%)",$cache['nmisses']*100/($cache['nhits']+$cache['nmisses'])),"
    - -
    -

    Detailed Memory Usage and Fragmentation

    - - - - -EOB; - if(isset($mem['adist'])) { - foreach($mem['adist'] as $i=>$v) { - $cur = pow(2,$i); $nxt = pow(2,$i+1)-1; - if($i==0) $range = "1"; - else $range = "$cur - $nxt"; - echo "\n"; - } - } - echo <<

    -EOB; - - // Fragementation: (freeseg - 1) / total_seg - $nseg = $freeseg = $fragsize = $freetotal = 0; - for($i=0; $i<$mem['num_seg']; $i++) { - $ptr = 0; - foreach($mem['block_lists'][$i] as $block) { - if ($block['offset'] != $ptr) { - ++$nseg; - } - $ptr = $block['offset'] + $block['size']; - /* Only consider blocks <5M for the fragmentation % */ - if($block['size']<(5*1024*1024)) $fragsize+=$block['size']; - $freetotal+=$block['size']; - } - $freeseg += count($mem['block_lists'][$i]); - } - - if ($freeseg > 1) { - $frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize/$freetotal)*100,bsize($fragsize),bsize($freetotal),$freeseg); - } else { - $frag = "0%"; - } - - if (graphics_avail()) { - $size='width='.(2*GRAPH_SIZE+150).' height='.(GRAPH_SIZE+10); - echo << -EOB; - } - echo <<Fragmentation: $frag -
    $range$v
    -
    -EOB; - - break; - - -// ----------------------------------------------- -// User Cache Entries -// ----------------------------------------------- -case OB_USER_CACHE: - if (!$AUTHENTICATED) { - echo '
    You need to login to see the user values here!
     
    '; - put_login_link("Login now!"); - echo '
    '; - break; - } - $fieldname='key'; - $fieldheading='User Entry Label'; - $fieldkey='key'; - - $cols=6; - echo <<
    Scope: - - ", - ", Sorting:', - '', - '', - '  Search: ', - ' ', - '
    '; - - if (isset($MYREQUEST['SEARCH'])) { - // Don't use preg_quote because we want the user to be able to specify a - // regular expression subpattern. - $MYREQUEST['SEARCH'] = '/'.str_replace('/', '\\/', $MYREQUEST['SEARCH']).'/i'; - if (preg_match($MYREQUEST['SEARCH'], 'test') === false) { - echo '
    Error: enter a valid regular expression as a search query.
    '; - break; - } - } - - echo - '
    ', - '', - '', - '', - '', - '', - '', - ''; - - if($fieldname=='info') { - $cols+=2; - echo ''; - } - echo ''; - - // builds list with alpha numeric sortable keys - // - $list = array(); - - foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) { - switch($MYREQUEST['SORT1']) { - case 'A': $k=sprintf('%015d-',$entry['atime']); break; - case 'H': $k=sprintf('%015d-',$entry['nhits']); break; - case 'Z': $k=sprintf('%015d-',$entry['mem_size']); break; - case 'M': $k=sprintf('%015d-',$entry['mtime']); break; - case 'C': $k=sprintf('%015d-',$entry['ctime']); break; - case 'T': $k=sprintf('%015d-',$entry['ttl']); break; - case 'D': $k=sprintf('%015d-',$entry['dtime']); break; - case 'S': $k=$entry["key"]; break; - } - if (!$AUTHENTICATED) { - // hide all path entries if not logged in - $list[$k.$entry[$fieldname]]=preg_replace('/^.*(\\/|\\\\)/','*hidden*/',$entry); - } else { - $list[$k.$entry[$fieldname]]=$entry; - } - } - - if ($list) { - // sort list - // - switch ($MYREQUEST['SORT2']) { - case "A": krsort($list); break; - case "D": ksort($list); break; - } - - // output list - $i=0; - foreach($list as $k => $entry) { - if(!$MYREQUEST['SEARCH'] || preg_match($MYREQUEST['SEARCH'], $entry[$fieldname]) != 0) { - $sh=md5($entry["key"]); - $field_value = htmlentities(strip_tags($entry[$fieldname],''), ENT_QUOTES, 'UTF-8'); - echo - '', - "', - '', - '', - '', - '', - ''; - - if($fieldname=='info') { - if($entry['ttl']) - echo ''; - else - echo ''; - } - if ($entry['dtime']) { - - echo ''; - } else if ($MYREQUEST['OB'] == OB_USER_CACHE) { - - echo ''; - } else { - echo ''; - } - echo ''; - if ($sh == $MYREQUEST["SH"]) { - echo ''; - echo ''; - echo ''; - } - $i++; - if ($i == $MYREQUEST['COUNT']) - break; - } - } - - } else { - echo ''; - } - echo <<< EOB -
    ',sortheader('S',$fieldheading, "&OB=".$MYREQUEST['OB']),'',sortheader('H','Hits', "&OB=".$MYREQUEST['OB']),'',sortheader('Z','Size', "&OB=".$MYREQUEST['OB']),'',sortheader('A','Last accessed',"&OB=".$MYREQUEST['OB']),'',sortheader('M','Last modified',"&OB=".$MYREQUEST['OB']),'',sortheader('C','Created at', "&OB=".$MYREQUEST['OB']),'',sortheader('T','Timeout',"&OB=".$MYREQUEST['OB']),'',sortheader('D','Deleted at',"&OB=".$MYREQUEST['OB']),'
    ",$field_value,'',$entry['nhits'],'',$entry['mem_size'],'',date(DATE_FORMAT,$entry['atime']),'',date(DATE_FORMAT,$entry['mtime']),'',date(DATE_FORMAT,$entry['ctime']),''.$entry['ttl'].' secondsNone', date(DATE_FORMAT,$entry['dtime']), ''; - echo '[Delete Now]'; - echo '  
    '.htmlentities(print_r(apcu_fetch($entry['key']), 1)).'
    No data
    -EOB; - - if ($list && $i < count($list)) { - echo "",count($list)-$i,' more available...'; - } - - echo <<< EOB -
    -EOB; - break; - -// ----------------------------------------------- -// Version check -// ----------------------------------------------- -case OB_VERSION_CHECK: - echo <<

    APCu Version Information

    - - - - -EOB; - if (defined('PROXY')) { - $ctxt = stream_context_create( array( 'http' => array( 'proxy' => PROXY, 'request_fulluri' => True ) ) ); - $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss", False, $ctxt); - } else { - $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss"); - } - if (!$rss) { - echo ''; - } else { - $apcversion = phpversion('apc'); - - preg_match('!APCu ([0-9.]+)!', $rss, $match); - echo ''; - echo ''; - } - echo <<< EOB -
    Unable to fetch version information.
    '; - if (version_compare($apcversion, $match[1], '>=')) { - echo '
    You are running the latest version of APCu ('.$apcversion.')
    '; - $i = 3; - } else { - echo '
    You are running an older version of APCu ('.$apcversion.'), - newer version '.$match[1].' is available at - http://pecl.php.net/package/APCu/'.$match[1].' -
    '; - $i = -1; - } - echo '

    Change Log:


    '; - - preg_match_all('!<(title|description)>([^<]+)!', $rss, $match); - next($match[2]); next($match[2]); - - while (list(,$v) = each($match[2])) { - list(,$ver) = explode(' ', $v, 2); - if ($i < 0 && version_compare($apcversion, $ver, '>=')) { - break; - } else if (!$i--) { - break; - } - echo "".htmlspecialchars($v, ENT_QUOTES, 'UTF-8')."
    "; - echo nl2br(htmlspecialchars(current($match[2]), ENT_QUOTES, 'UTF-8'))."
    "; - next($match[2]); - } - echo '
    - -EOB; - break; - -} - -echo <<< EOB - -EOB; - -?> - - - - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_php.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_php.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_php.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_php.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | George Schlossnagle | - | Rasmus Lerdorf | - | Arun C. Murthy | - | Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - 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_php.h 328674 2012-12-05 09:58:27Z ab $ */ - -#ifndef APC_PHP_H -#define APC_PHP_H - -/* - * The purpose of this header file is to include all PHP and Zend headers that - * are typically needed elsewhere in APC. This makes it easy to insure that - * all required headers are available. - */ - -#include "php.h" -#include "zend.h" -#include "zend_API.h" -#include "zend_compile.h" -#include "zend_hash.h" -#include "zend_extensions.h" - -#if ZEND_MODULE_API_NO >= 20121204 -#define ZEND_ENGINE_2_5 -#endif -#if ZEND_MODULE_API_NO >= 20100409 -#define ZEND_ENGINE_2_4 -#endif -#if ZEND_MODULE_API_NO > 20060613 -#define ZEND_ENGINE_2_3 -#endif -#if ZEND_MODULE_API_NO > 20050922 -#define ZEND_ENGINE_2_2 -#endif -#if ZEND_MODULE_API_NO > 20050921 -#define ZEND_ENGINE_2_1 -#endif -#ifdef ZEND_ENGINE_2_1 -#include "zend_vm.h" -#endif - -#ifndef IS_CONSTANT_TYPE_MASK -#define IS_CONSTANT_TYPE_MASK (~IS_CONSTANT_INDEX) -#endif - -#include "rfc1867.h" - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_php_pcre.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_php_pcre.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_php_pcre.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_php_pcre.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC/PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 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. | - +----------------------------------------------------------------------+ - | Author: Andrei Zmievski | - +----------------------------------------------------------------------+ - */ - -/* $Id: apc_php_pcre.h 307048 2011-01-03 23:53:17Z kalle $ */ - -#ifndef PHP_PCRE_H -#define PHP_PCRE_H - -#if HAVE_PCRE || HAVE_BUNDLED_PCRE - -#if HAVE_BUNDLED_PCRE -#include "ext/pcre/pcrelib/pcre.h" -#else -#include "pcre.h" -#endif - -#if HAVE_LOCALE_H -#include -#endif - -PHP_FUNCTION(preg_match); -PHP_FUNCTION(preg_match_all); -PHP_FUNCTION(preg_replace); -PHP_FUNCTION(preg_replace_callback); -PHP_FUNCTION(preg_split); -PHP_FUNCTION(preg_quote); -PHP_FUNCTION(preg_grep); - -PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); -PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options TSRMLS_DC); -PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC); - -extern zend_module_entry pcre_module_entry; -#define pcre_module_ptr &pcre_module_entry - -typedef struct { - pcre *re; - pcre_extra *extra; - int preg_options; -#if HAVE_SETLOCALE - char *locale; - unsigned const char *tables; -#endif - int compile_options; - int refcount; -} pcre_cache_entry; - -PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC); - -PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, - zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC); - -PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, - int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); - -PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, - long limit_val, long flags TSRMLS_DC); - -PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value, - long flags TSRMLS_DC); - -ZEND_BEGIN_MODULE_GLOBALS(pcre) - HashTable pcre_cache; - long backtrack_limit; - long recursion_limit; - int error_code; -ZEND_END_MODULE_GLOBALS(pcre) - -#ifdef ZTS -# define PCRE_G(v) TSRMG(pcre_globals_id, zend_pcre_globals *, v) -#else -# define PCRE_G(v) (pcre_globals.v) -#endif - -#else - -#define pcre_module_ptr NULL - -#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */ - -#define phpext_pcre_ptr pcre_module_ptr - -#endif /* PHP_PCRE_H */ diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_pool_api.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_pool_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_pool_api.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_pool_api.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - This software was contributed to PHP by Yahoo! Inc. in 2008. - - Future revisions and derivatives of this source code must acknowledge - Yahoo! 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_pool.h 307048 2011-01-03 23:53:17Z kalle $ */ - -#ifndef APC_POOL_API_H -#define APC_POOL_API_H - -#if APC_POOL_DEBUG -#define APC_POOL_HAS_SIZEINFO(pool) ((pool->type & APC_POOL_SIZEINFO)!=0) -#define APC_POOL_HAS_REDZONES(pool) ((pool->type & APC_POOL_REDZONES)!=0) -#else -/* let gcc optimize away the optional features */ -#define APC_POOL_HAS_SIZEINFO(pool) (0) -#define APC_POOL_HAS_REDZONES(pool) (0) -#endif - -/* {{{ */ -typedef struct _apc_pool apc_pool; /* }}} */ - -/* {{{ functions */ -typedef void (*apc_pcleanup_t)(apc_pool *pool TSRMLS_DC); -typedef void* (*apc_palloc_t)(apc_pool *pool, size_t size TSRMLS_DC); -typedef void (*apc_pfree_t) (apc_pool *pool, void* p TSRMLS_DC); -typedef void* (*apc_protect_t) (void *p); -typedef void* (*apc_unprotect_t)(void *p); /* }}} */ - -/* {{{ enum definition: apc_pool_type */ -typedef enum { - APC_UNPOOL = 0x0, - APC_SMALL_POOL = 0x1, - APC_MEDIUM_POOL = 0x2, - APC_LARGE_POOL = 0x3, - APC_POOL_SIZE_MASK = 0x7, /* waste a bit */ -#if APC_POOL_DEBUG - APC_POOL_REDZONES = 0x08, - APC_POOL_SIZEINFO = 0x10, - APC_POOL_OPT_MASK = 0x18 -#endif -} apc_pool_type; /* }}} */ - -/* {{{ structure definition: apc_pool */ -struct _apc_pool { - /* denotes the size and debug flags for a pool */ - apc_pool_type type; - - /* handler functions */ - apc_malloc_t allocate; - apc_free_t deallocate; - - apc_palloc_t palloc; - apc_pfree_t pfree; - - apc_protect_t protect; - apc_unprotect_t unprotect; - - apc_pcleanup_t cleanup; - - /* total */ - size_t size; - /* remaining */ - size_t used; - - /* apc_realpool and apc_unpool add more here */ -}; /* }}} */ - -/* {{{ enum definition: apc_copy_type */ -/* APC_COPY_IN should be used when copying into APC - APC_COPY_OUT should be used when copying out of APC */ -typedef enum _apc_copy_type { - APC_NO_COPY = 0, - APC_COPY_IN, - APC_COPY_OUT, - APC_COPY_OTHER -} apc_copy_type; /* }}} */ - -/* {{{ enum definition: apc_context_type - APC_CONTEXT_SHARE should be used to create contexts using shared memory - APC_CONTEXT_NOSHARE should be used to create contexts using standard allocators */ -typedef enum _apc_context_type { - APC_CONTEXT_NONE = 0, - APC_CONTEXT_SHARE, - APC_CONTEXT_NOSHARE -} apc_context_type; /* }}} */ - -/* {{{ struct definition: apc_context_t */ -typedef struct _apc_context_t { - apc_pool* pool; /* pool of memory for context */ - apc_copy_type copy; /* copying type for context */ - unsigned int force_update:1; /* flag to force updates */ - HashTable copied; /* copied zvals for recursion support */ - apc_serializer_t* serializer; /* serializer */ - void* key; /* set before serializer API is invoked */ -} apc_context_t; /* }}} */ - -/* - apc_pool_create creates a pool of the specified type, setting the handlers passed on the pool, returns apc_pool* -*/ -PHP_APCU_API apc_pool* apc_pool_create(apc_pool_type pool_type, - apc_malloc_t allocate, - apc_free_t deallocate, - apc_protect_t protect, - apc_unprotect_t unprotect TSRMLS_DC); - -/* - apc_pool_destroy first calls apc_cleanup_t set during apc_pool_create, then apc_free_t -*/ -PHP_APCU_API void apc_pool_destroy(apc_pool* pool TSRMLS_DC); - -/* - apc_pmemcpy performs memcpy using resources provided by pool -*/ -PHP_APCU_API void* apc_pmemcpy(const void* p, - size_t n, - apc_pool* pool TSRMLS_DC); - -/* - apc_pstrdup performs strdup using resources provided by pool -*/ -PHP_APCU_API void* apc_pstrdup(const char* s, - apc_pool* pool TSRMLS_DC); - -#endif - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_pool.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_pool.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_pool.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_pool.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,517 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - This software was contributed to PHP by Yahoo! Inc. in 2008. - - Future revisions and derivatives of this source code must acknowledge - Yahoo! 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_pool.c 327069 2012-08-12 08:56:55Z laruence $ */ - - -#include "apc_pool.h" -#include - -#ifdef APC_POOL_DEBUG -# ifdef HAVE_VALGRIND_MEMCHECK_H -# include -# endif -#endif - -/* {{{ forward references */ -static apc_pool* apc_unpool_create(apc_pool_type type, apc_malloc_t, apc_free_t, apc_protect_t, apc_unprotect_t TSRMLS_DC); -static apc_pool* apc_realpool_create(apc_pool_type type, apc_malloc_t, apc_free_t, apc_protect_t, apc_unprotect_t TSRMLS_DC); -/* }}} */ - -/* {{{ apc_pool_create */ -PHP_APCU_API apc_pool* apc_pool_create(apc_pool_type pool_type, - apc_malloc_t allocate, - apc_free_t deallocate, - apc_protect_t protect, - apc_unprotect_t unprotect TSRMLS_DC) -{ - if(pool_type == APC_UNPOOL) { - return apc_unpool_create(pool_type, allocate, deallocate, protect, unprotect TSRMLS_CC); - } - - return apc_realpool_create(pool_type, allocate, deallocate, protect, unprotect TSRMLS_CC); -} -/* }}} */ - -/* {{{ apc_pool_destroy */ -PHP_APCU_API void apc_pool_destroy(apc_pool *pool TSRMLS_DC) -{ - apc_free_t deallocate = pool->deallocate; - apc_pcleanup_t cleanup = pool->cleanup; - - cleanup(pool TSRMLS_CC); - deallocate(pool TSRMLS_CC); -} -/* }}} */ - -/* {{{ apc_unpool implementation */ - -typedef struct _apc_unpool apc_unpool; - -struct _apc_unpool { - apc_pool parent; - /* apc_unpool is a lie! */ -}; - -static void* apc_unpool_alloc(apc_pool* pool, - size_t size TSRMLS_DC) -{ - apc_unpool *upool = (apc_unpool*)pool; - - apc_malloc_t allocate = upool->parent.allocate; - - upool->parent.size += size; - upool->parent.used += size; - - return allocate(size TSRMLS_CC); -} - -static void apc_unpool_free(apc_pool* pool, - void *ptr TSRMLS_DC) -{ - apc_unpool *upool = (apc_unpool*) pool; - - apc_free_t deallocate = upool->parent.deallocate; - - deallocate(ptr TSRMLS_CC); -} - -static void apc_unpool_cleanup(apc_pool* pool TSRMLS_DC) -{ -} - -static apc_pool* apc_unpool_create(apc_pool_type type, - apc_malloc_t allocate, - apc_free_t deallocate, - apc_protect_t protect, - apc_unprotect_t unprotect TSRMLS_DC) -{ - apc_unpool* upool = allocate(sizeof(apc_unpool) TSRMLS_CC); - - if (!upool) { - return NULL; - } - - upool->parent.type = type; - upool->parent.allocate = allocate; - upool->parent.deallocate = deallocate; - - upool->parent.protect = protect; - upool->parent.unprotect = unprotect; - - upool->parent.palloc = apc_unpool_alloc; - upool->parent.pfree = apc_unpool_free; - - upool->parent.cleanup = apc_unpool_cleanup; - - upool->parent.used = 0; - upool->parent.size = 0; - - return &(upool->parent); -} -/* }}} */ - -/*{{{ apc_realpool implementation */ - -/* {{{ typedefs */ -typedef struct _pool_block -{ - size_t avail; - size_t capacity; - unsigned char *mark; - struct _pool_block *next; - unsigned :0; /* this should align to word */ - /* data comes here */ -}pool_block; - -/* - parts in ? are optional and turned on for fun, memory loss, - and for something else that I forgot about ... ah, debugging - - |--------> data[] |<-- non word boundary (too) - +-------------+--------------+-----------+-------------+-------------->>> - | pool_block | ?sizeinfo<1> | block<1> | ?redzone<1> | ?sizeinfo<2> - | | (size_t) | | padded left | - +-------------+--------------+-----------+-------------+-------------->>> - */ - -typedef struct _apc_realpool apc_realpool; - -struct _apc_realpool -{ - struct _apc_pool parent; - - size_t dsize; - void *owner; - - unsigned long count; - - pool_block *head; - pool_block first; -}; - -/* }}} */ - -/* {{{ redzone code */ -static const unsigned char decaff[] = { - 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, - 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, - 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, - 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad -}; - -/* a redzone is at least 4 (0xde,0xca,0xc0,0xff) bytes */ -#define REDZONE_SIZE(size) \ - ((ALIGNWORD((size)) > ((size) + 4)) ? \ - (ALIGNWORD((size)) - (size)) : /* does not change realsize */\ - ALIGNWORD((size)) - (size) + ALIGNWORD((sizeof(char)))) /* adds 1 word to realsize */ - -#define SIZEINFO_SIZE ALIGNWORD(sizeof(size_t)) - -#define MARK_REDZONE(block, redsize) do {\ - memcpy(block, decaff, redsize );\ - } while(0) - -#define CHECK_REDZONE(block, redsize) (memcmp(block, decaff, redsize) == 0) - -/* }}} */ - -#define INIT_POOL_BLOCK(rpool, entry, size) do {\ - (entry)->avail = (entry)->capacity = (size);\ - (entry)->mark = ((unsigned char*)(entry)) + ALIGNWORD(sizeof(pool_block));\ - (entry)->next = (rpool)->head;\ - (rpool)->head = (entry);\ -} while(0) - -/* {{{ create_pool_block */ -static pool_block* create_pool_block(apc_realpool *rpool, - size_t size TSRMLS_DC) -{ - apc_malloc_t allocate = rpool->parent.allocate; - - size_t realsize = sizeof(pool_block) + ALIGNWORD(size); - - pool_block* entry = allocate(realsize TSRMLS_CC); - - if (!entry) { - return NULL; - } - - INIT_POOL_BLOCK(rpool, entry, size); - - rpool->parent.size += realsize; - - rpool->count++; - - return entry; -} -/* }}} */ - -/* {{{ apc_realpool_alloc */ -static void* apc_realpool_alloc(apc_pool *pool, - size_t size TSRMLS_DC) -{ - apc_realpool *rpool = (apc_realpool*)pool; - unsigned char *p = NULL; - size_t realsize = ALIGNWORD(size); - size_t poolsize; - unsigned char *redzone = NULL; - size_t redsize = 0; - size_t *sizeinfo= NULL; - pool_block *entry = NULL; - unsigned long i; - - if(APC_POOL_HAS_REDZONES(pool)) { - redsize = REDZONE_SIZE(size); /* redsize might be re-using word size padding */ - realsize = size + redsize; /* recalculating realsize */ - } else { - redsize = realsize - size; /* use padding space */ - } - - if(APC_POOL_HAS_SIZEINFO(pool)) { - realsize += ALIGNWORD(sizeof(size_t)); - } - - /* minimize look-back, a value of 8 seems to give similar fill-ratios (+2%) - * as looping through the entire list. And much faster in allocations. */ - for(entry = rpool->head, i = 0; entry != NULL && (i < 8); entry = entry->next, i++) { - if(entry->avail >= realsize) { - goto found; - } - } - - /* upgrade the pool type to reduce overhead */ - if(rpool->count > 4 && rpool->dsize < 4096) { - rpool->dsize = 4096; - } else if(rpool->count > 8 && rpool->dsize < 8192) { - rpool->dsize = 8192; - } - - poolsize = ALIGNSIZE(realsize, rpool->dsize); - - entry = create_pool_block(rpool, poolsize TSRMLS_CC); - - if(!entry) { - return NULL; - } - -found: - p = entry->mark; - - if(APC_POOL_HAS_SIZEINFO(pool)) { - sizeinfo = (size_t*)p; - p += SIZEINFO_SIZE; - *sizeinfo = size; - } - - redzone = p + size; - - if(APC_POOL_HAS_REDZONES(pool)) { - MARK_REDZONE(redzone, redsize); - } - -#ifdef VALGRIND_MAKE_MEM_NOACCESS - if(redsize != 0) { - VALGRIND_MAKE_MEM_NOACCESS(redzone, redsize); - } -#endif - - entry->avail -= realsize; - entry->mark += realsize; - pool->used += realsize; - -#ifdef VALGRIND_MAKE_MEM_UNDEFINED - /* need to write before reading data off this */ - VALGRIND_MAKE_MEM_UNDEFINED(p, size); -#endif - - return (void*)p; -} -/* }}} */ - -/* {{{ apc_realpool_check_integrity */ -/* - * Checking integrity at runtime, does an - * overwrite check only when the sizeinfo - * is set. - * - * Marked as used in gcc, so that this function - * is accessible from gdb, eventhough it is never - * used in code in non-debug builds. - */ -static APC_USED int apc_realpool_check_integrity(apc_realpool *rpool) -{ - apc_pool *pool = &(rpool->parent); - pool_block *entry; - size_t *sizeinfo = NULL; - unsigned char *start; - size_t realsize; - unsigned char *redzone; - size_t redsize; - - for(entry = rpool->head; entry != NULL; entry = entry->next) { - start = (unsigned char *)entry + ALIGNWORD(sizeof(pool_block)); - if((entry->mark - start) != (entry->capacity - entry->avail)) { - return 0; - } - } - - if(!APC_POOL_HAS_REDZONES(pool) || - !APC_POOL_HAS_SIZEINFO(pool)) { - (void)pool; /* remove unused warning */ - return 1; - } - - for(entry = rpool->head; entry != NULL; entry = entry->next) { - start = (unsigned char *)entry + ALIGNWORD(sizeof(pool_block)); - - while(start < entry->mark) { - sizeinfo = (size_t*)start; - /* redzone starts where real data ends, in a non-word boundary - * redsize is at least 4 bytes + whatever's needed to make it - * to another word boundary. - */ - redzone = start + SIZEINFO_SIZE + (*sizeinfo); - redsize = REDZONE_SIZE(*sizeinfo); -#ifdef VALGRIND_MAKE_MEM_DEFINED - VALGRIND_MAKE_MEM_DEFINED(redzone, redsize); -#endif - if(!CHECK_REDZONE(redzone, redsize)) - { - /* - fprintf(stderr, "Redzone check failed for %p\n", - start + ALIGNWORD(sizeof(size_t)));*/ - return 0; - } -#ifdef VALGRIND_MAKE_MEM_NOACCESS - VALGRIND_MAKE_MEM_NOACCESS(redzone, redsize); -#endif - realsize = SIZEINFO_SIZE + *sizeinfo + redsize; - start += realsize; - } - } - - return 1; -} -/* }}} */ - -/* {{{ apc_realpool_free */ -/* - * free does not do anything - */ -static void apc_realpool_free(apc_pool *pool, - void *p TSRMLS_DC) -{ -} -/* }}} */ - -/* {{{ apc_realpool_cleanup */ -static void apc_realpool_cleanup(apc_pool *pool TSRMLS_DC) -{ - pool_block *entry; - pool_block *tmp; - apc_realpool *rpool = (apc_realpool*)pool; - apc_free_t deallocate = pool->deallocate; - - assert(apc_realpool_check_integrity(rpool)!=0); - - entry = rpool->head; - - while(entry->next != NULL) { - tmp = entry->next; - deallocate(entry TSRMLS_CC); - entry = tmp; - } -} -/* }}} */ - -/* {{{ apc_realpool_create */ -static apc_pool* apc_realpool_create(apc_pool_type type, - apc_malloc_t allocate, - apc_free_t deallocate, - apc_protect_t protect, - apc_unprotect_t unprotect TSRMLS_DC) -{ - - size_t dsize = 0; - apc_realpool *rpool; - - switch(type & APC_POOL_SIZE_MASK) { - case APC_SMALL_POOL: - dsize = 512; - break; - - case APC_LARGE_POOL: - dsize = 8192; - break; - - case APC_MEDIUM_POOL: - dsize = 4096; - break; - - default: - return NULL; - } - - rpool = (apc_realpool*)allocate((sizeof(apc_realpool) + ALIGNWORD(dsize)) TSRMLS_CC); - - if(!rpool) { - return NULL; - } - - rpool->parent.type = type; - - rpool->parent.allocate = allocate; - rpool->parent.deallocate = deallocate; - - rpool->parent.size = sizeof(apc_realpool) + ALIGNWORD(dsize); - - rpool->parent.palloc = apc_realpool_alloc; - rpool->parent.pfree = apc_realpool_free; - - rpool->parent.protect = protect; - rpool->parent.unprotect = unprotect; - - rpool->parent.cleanup = apc_realpool_cleanup; - - rpool->dsize = dsize; - rpool->head = NULL; - rpool->count = 0; - - INIT_POOL_BLOCK(rpool, &(rpool->first), dsize); - - return &(rpool->parent); -} - - -/* }}} */ - -/* }}} */ - -/* {{{ apc_pool_init */ -PHP_APCU_API void apc_pool_init() -{ - /* put all ye sanity checks here */ - assert(sizeof(decaff) > REDZONE_SIZE(ALIGNWORD(sizeof(char)))); - assert(sizeof(pool_block) == ALIGNWORD(sizeof(pool_block))); -#if APC_POOL_DEBUG - assert((APC_POOL_SIZE_MASK & (APC_POOL_SIZEINFO | APC_POOL_REDZONES)) == 0); -#endif -} -/* }}} */ - -/* {{{ apc_pstrdup */ -PHP_APCU_API void* APC_ALLOC apc_pstrdup(const char* s, - apc_pool* pool TSRMLS_DC) -{ - return s != NULL ? apc_pmemcpy(s, (strlen(s) + 1), pool TSRMLS_CC) : NULL; -} -/* }}} */ - -/* {{{ apc_pmemcpy */ -PHP_APCU_API void* APC_ALLOC apc_pmemcpy(const void* p, - size_t n, - apc_pool* pool TSRMLS_DC) -{ - void* q; - - if (p != NULL && (q = pool->palloc(pool, n TSRMLS_CC)) != NULL) { - memcpy(q, p, n); - return q; - } - return NULL; -} -/* }}} */ - -/* - * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_pool.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_pool.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_pool.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_pool.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - This software was contributed to PHP by Yahoo! Inc. in 2008. - - Future revisions and derivatives of this source code must acknowledge - Yahoo! 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_pool.h 307048 2011-01-03 23:53:17Z kalle $ */ - -#ifndef APC_POOL_H -#define APC_POOL_H - -#include "apc.h" -#include "apc_sma.h" - -#ifndef APC_POOL_API_H -# include "apc_pool_api.h" -#endif - -/* - performs alignment checking on pool internals during MINIT -*/ -extern PHP_APCU_API void apc_pool_init(); -#endif - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_rfc1867.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_rfc1867.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_rfc1867.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_rfc1867.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,235 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: 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. - - */ - -/* $Id: apc_rfc1867.c 309694 2011-03-25 18:47:38Z rasmus $*/ - -#include "apc.h" -#include "apc_globals.h" -#include "rfc1867.h" - -#ifdef PHP_WIN32 -#include "win32/time.h" -#endif - -extern apc_cache_t* apc_user_cache; - -#ifdef MULTIPART_EVENT_FORMDATA -static zend_bool update_bytes_processed(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { - int *bytes_ptr = (int*)data; - zval* val = entry->val; - - if(Z_TYPE_P(val) == IS_ARRAY) { - HashTable *ht = val->value.ht; - Bucket* curr = NULL; - for (curr = ht->pListHead; curr != NULL; curr = curr->pListNext) { - if(curr->nKeyLength == 8 && - (!memcmp(curr->arKey, "current", curr->nKeyLength))) { - zval* current = ((zval**)curr->pData)[0]; - current->value.lval = *bytes_ptr; - return 1; - } - } - } - - return 0; -} - -static double my_time() { - struct timeval a; - double t; - gettimeofday(&a, NULL); - t = a.tv_sec + (a.tv_usec/1000000.00); - return t; -} - - -#define RFC1867_DATA(name) \ - ((request_data)->name) - -int apc_rfc1867_progress(uint event, void *event_data, void **extra TSRMLS_DC) { - apc_rfc1867_data *request_data = &APCG(rfc1867_data); - zval *track = NULL; - - switch (event) { - case MULTIPART_EVENT_START: - { - multipart_event_start *data = (multipart_event_start *) event_data; - - RFC1867_DATA(content_length) = data->content_length; - RFC1867_DATA(tracking_key)[0] = '\0'; - RFC1867_DATA(name)[0] = '\0'; - RFC1867_DATA(cancel_upload) = 0; - RFC1867_DATA(temp_filename) = NULL; - RFC1867_DATA(filename)[0] = '\0'; - RFC1867_DATA(key_length) = 0; - RFC1867_DATA(start_time) = my_time(); - RFC1867_DATA(bytes_processed) = 0; - RFC1867_DATA(prev_bytes_processed) = 0; - RFC1867_DATA(rate) = 0; - RFC1867_DATA(update_freq) = (int) APCG(rfc1867_freq); - RFC1867_DATA(started) = 0; - - if(RFC1867_DATA(update_freq) < 0) { // frequency is a percentage, not bytes - RFC1867_DATA(update_freq) = (int) (RFC1867_DATA(content_length) * APCG(rfc1867_freq) / 100); - } - } - break; - - case MULTIPART_EVENT_FORMDATA: - { - int prefix_len = strlen(APCG(rfc1867_prefix)); - multipart_event_formdata *data = (multipart_event_formdata *) event_data; - if(data->name && !strncasecmp(data->name, APCG(rfc1867_name), strlen(APCG(rfc1867_name))) - && data->value && data->length) { - - if(data->length >= sizeof(RFC1867_DATA(tracking_key)) - prefix_len) { - apc_warning("Key too long for '%s'. Maximum size is '%d' characters." TSRMLS_CC, - APCG(rfc1867_name), - sizeof(RFC1867_DATA(tracking_key)) - prefix_len); - break; - } - - if(RFC1867_DATA(started)) { - apc_warning("Upload progress key '%s' should be before the file upload entry in the form." TSRMLS_CC, - APCG(rfc1867_name)); - break; - } - - strlcat(RFC1867_DATA(tracking_key), APCG(rfc1867_prefix), 63); - strlcat(RFC1867_DATA(tracking_key), *data->value, 63); - RFC1867_DATA(key_length) = data->length + prefix_len; - RFC1867_DATA(bytes_processed) = data->post_bytes_processed; - } - } - break; - - case MULTIPART_EVENT_FILE_START: - { - RFC1867_DATA(started) = 1; - if(*RFC1867_DATA(tracking_key)) { - multipart_event_file_start *data = (multipart_event_file_start *) event_data; - - RFC1867_DATA(bytes_processed) = data->post_bytes_processed; - strlcpy(RFC1867_DATA(filename),*data->filename,128); - RFC1867_DATA(temp_filename) = NULL; - strlcpy(RFC1867_DATA(name),data->name,64); - ALLOC_INIT_ZVAL(track); - array_init(track); - add_assoc_long(track, "total", RFC1867_DATA(content_length)); - add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); - add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); - add_assoc_string(track, "name", RFC1867_DATA(name), 1); - add_assoc_long(track, "done", 0); - add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); - apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); - zval_ptr_dtor(&track); - } - } - break; - - case MULTIPART_EVENT_FILE_DATA: - if(*RFC1867_DATA(tracking_key)) { - multipart_event_file_data *data = (multipart_event_file_data *) event_data; - RFC1867_DATA(bytes_processed) = data->post_bytes_processed; - if(RFC1867_DATA(bytes_processed) - RFC1867_DATA(prev_bytes_processed) > (uint) RFC1867_DATA(update_freq)) { - if(!apc_cache_update(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length), update_bytes_processed, &RFC1867_DATA(bytes_processed) TSRMLS_CC)) { - ALLOC_INIT_ZVAL(track); - array_init(track); - add_assoc_long(track, "total", RFC1867_DATA(content_length)); - add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); - add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); - add_assoc_string(track, "name", RFC1867_DATA(name), 1); - add_assoc_long(track, "done", 0); - add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); - apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); - zval_ptr_dtor(&track); - } - RFC1867_DATA(prev_bytes_processed) = RFC1867_DATA(bytes_processed); - } - } - break; - - case MULTIPART_EVENT_FILE_END: - if(*RFC1867_DATA(tracking_key)) { - multipart_event_file_end *data = (multipart_event_file_end *) event_data; - RFC1867_DATA(bytes_processed) = data->post_bytes_processed; - RFC1867_DATA(cancel_upload) = data->cancel_upload; - if(data->temp_filename) { - RFC1867_DATA(temp_filename) = data->temp_filename; - } else { - RFC1867_DATA(temp_filename) = ""; - } - ALLOC_INIT_ZVAL(track); - array_init(track); - add_assoc_long(track, "total", RFC1867_DATA(content_length)); - add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); - add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); - add_assoc_string(track, "name", RFC1867_DATA(name), 1); - add_assoc_string(track, "temp_filename", RFC1867_DATA(temp_filename), 1); - add_assoc_long(track, "cancel_upload", RFC1867_DATA(cancel_upload)); - add_assoc_long(track, "done", 0); - add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); - apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); - zval_ptr_dtor(&track); - } - break; - - case MULTIPART_EVENT_END: - if(*RFC1867_DATA(tracking_key)) { - double now = my_time(); - multipart_event_end *data = (multipart_event_end *) event_data; - RFC1867_DATA(bytes_processed) = data->post_bytes_processed; - if(now>RFC1867_DATA(start_time)) RFC1867_DATA(rate) = 8.0*RFC1867_DATA(bytes_processed)/(now-RFC1867_DATA(start_time)); - else RFC1867_DATA(rate) = 8.0*RFC1867_DATA(bytes_processed); /* Too quick */ - ALLOC_INIT_ZVAL(track); - array_init(track); - add_assoc_long(track, "total", RFC1867_DATA(content_length)); - add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); - add_assoc_double(track, "rate", RFC1867_DATA(rate)); - add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); - add_assoc_string(track, "name", RFC1867_DATA(name), 1); - add_assoc_long(track, "cancel_upload", RFC1867_DATA(cancel_upload)); - add_assoc_long(track, "done", 1); - add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); - apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); - zval_ptr_dtor(&track); - } - break; - } - - return SUCCESS; -} - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_serializer.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_serializer.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_serializer.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_serializer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | - +----------------------------------------------------------------------+ - - */ - -/* $Id: $ */ - -#ifndef APC_SERIALIZER_H -#define APC_SERIALIZER_H - -/* this is a shipped .h file, do not include any other header in this file */ -#define APC_SERIALIZER_NAME(module) module##_apc_serializer -#define APC_UNSERIALIZER_NAME(module) module##_apc_unserializer - -#define APC_SERIALIZER_ARGS unsigned char **buf, size_t *buf_len, const zval *value, void *config TSRMLS_DC -#define APC_UNSERIALIZER_ARGS zval **value, unsigned char *buf, size_t buf_len, void *config TSRMLS_DC - -typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS); -typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS); - -typedef int (*apc_register_serializer_t)(const char* name, - apc_serialize_t serialize, - apc_unserialize_t unserialize, - void *config TSRMLS_DC); - -/* - * ABI version for constant hooks. Increment this any time you make any changes - * to any function in this file. - */ -#define APC_SERIALIZER_ABI "0" -#define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI - -#if !defined(APC_UNUSED) -# if defined(__GNUC__) -# define APC_UNUSED __attribute__((unused)) -# else -# define APC_UNUSED -# endif -#endif - -static APC_UNUSED int apc_register_serializer(const char* name, - apc_serialize_t serialize, - apc_unserialize_t unserialize, - void *config TSRMLS_DC) -{ - zval apc_magic_constant; - int retval = 0; - - /* zend_get_constant will return 1 on success, otherwise apc_magic_constant wouldn't be touched at all */ - if (zend_get_constant(APC_SERIALIZER_CONSTANT, sizeof(APC_SERIALIZER_CONSTANT)-1, &apc_magic_constant TSRMLS_CC)) { -#if defined(PHP_WIN32) && defined(_WIN64) - apc_register_serializer_t register_func = (apc_register_serializer_t)_atoi64(Z_STRVAL(apc_magic_constant)); -#else - apc_register_serializer_t register_func = (apc_register_serializer_t)(Z_LVAL(apc_magic_constant)); -#endif - if(register_func) { - retval = register_func(name, serialize, unserialize, NULL TSRMLS_CC); - } - zval_dtor(&apc_magic_constant); - } - - return retval; -} - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_shm.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_shm.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_shm.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_shm.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | 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. - - */ - -/* $Id: apc_shm.c 307259 2011-01-08 12:05:24Z gopalv $ */ - -#include "apc_shm.h" -#include "apc.h" -#ifdef PHP_WIN32 -/* shm functions are available in TSRM */ -#include -#define key_t long -#else -#include -#include -#include -#endif - -#ifndef SHM_R -# define SHM_R 0444 /* read permission */ -#endif -#ifndef SHM_A -# define SHM_A 0222 /* write permission */ -#endif - -int apc_shm_create(int proj, size_t size TSRMLS_DC) -{ - int shmid; /* shared memory id */ - int oflag; /* permissions on shm */ - key_t key = IPC_PRIVATE; /* shm key */ - - oflag = IPC_CREAT | SHM_R | SHM_A; - if ((shmid = shmget(key, size, oflag)) < 0) { - apc_error("apc_shm_create: shmget(%d, %d, %d) failed: %s. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment." TSRMLS_CC, key, size, oflag, strerror(errno)); - } - - return shmid; -} - -void apc_shm_destroy(int shmid) -{ - /* we expect this call to fail often, so we do not check */ - shmctl(shmid, IPC_RMID, 0); -} - -apc_segment_t apc_shm_attach(int shmid, size_t size TSRMLS_DC) -{ - apc_segment_t segment; /* shm segment */ - - if ((long)(segment.shmaddr = shmat(shmid, 0, 0)) == -1) { - apc_error("apc_shm_attach: shmat failed:" TSRMLS_CC); - } - -#ifdef APC_MEMPROTECT - - if ((long)(segment.roaddr = shmat(shmid, 0, SHM_RDONLY)) == -1) { - segment.roaddr = NULL; - } - -#endif - - segment.size = size; - - /* - * We set the shmid for removal immediately after attaching to it. The - * segment won't disappear until all processes have detached from it. - */ - apc_shm_destroy(shmid); - return segment; -} - -void apc_shm_detach(apc_segment_t* segment TSRMLS_DC) -{ - if (shmdt(segment->shmaddr) < 0) { - apc_error("apc_shm_detach: shmdt failed:" TSRMLS_CC); - } - -#ifdef APC_MEMPROTECT - if (segment->roaddr && shmdt(segment->roaddr) < 0) { - apc_error("apc_shm_detach: shmdt failed:" TSRMLS_CC); - } -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_shm.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_shm.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_shm.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_shm.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - 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_shm.h 307259 2011-01-08 12:05:24Z gopalv $ */ - -#ifndef APC_SHM_H -#define APC_SHM_H - -#include -#ifdef PHP_WIN32 -#include -#endif - -#include "apc_sma.h" - -/* Wrapper functions for unix shared memory */ - -extern int apc_shm_create(int proj, size_t size TSRMLS_DC); -extern void apc_shm_destroy(int shmid); -extern apc_segment_t apc_shm_attach(int shmid, size_t size TSRMLS_DC); -extern void apc_shm_detach(apc_segment_t* segment TSRMLS_DC); - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_signal.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_signal.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_signal.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_signal.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,229 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - 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 327066 2012-08-12 07:48:48Z laruence $ */ - - /* 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 "apc.h" - -#if HAVE_SIGACTION -#include -#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*) TSRMLS_DC); -static void apc_rehandle_signal(int signo, siginfo_t *siginfo, void *context); -static void apc_core_unmap(int signo, siginfo_t *siginfo, void *context); -#if defined(SIGUSR1) && defined(APC_SIGNAL_CLEAR) -static void apc_clear_cache(int signo, siginfo_t *siginfo, void *context); -#endif - -extern apc_cache_t* apc_user_cache; - -/* {{{ 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) -{ - TSRMLS_FETCH(); - - apc_sma_cleanup(TSRMLS_C); - apc_rehandle_signal(signo, siginfo, context); - -#if !defined(WIN32) && !defined(NETWARE) - kill(getpid(), signo); -#else - raise(signo); -#endif -} /* }}} */ - - -#if defined(SIGUSR1) && defined(APC_SIGNAL_CLEAR) -/* {{{ apc_reload_cache */ -static void apc_clear_cache(int signo, siginfo_t *siginfo, void *context) { - TSRMLS_FETCH(); - - if (apc_user_cache) { - apc_cache_clear( - apc_user_cache TSRMLS_CC); - } - - apc_rehandle_signal(signo, siginfo, context); - -#if !defined(WIN32) && !defined(NETWARE) - kill(getpid(), signo); -#else - raise(signo); -#endif -} /* }}} */ -#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*) TSRMLS_DC) -{ - 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 *) TSRMLS_CC); - apc_signal_info.prev[apc_signal_info.installed] = (apc_signal_entry_t *)apc_emalloc(sizeof(apc_signal_entry_t) TSRMLS_CC); - *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_warning("Error installing apc signal handler for %d" TSRMLS_CC, signo); - } - - return SUCCESS; - } - return FAILURE; -} /* }}} */ - -/* {{{ apc_set_signals - * Install our signal handlers */ -void apc_set_signals(TSRMLS_D) -{ - if (apc_signal_info.installed == 0) { -#if defined(SIGUSR1) && defined(APC_SIGNAL_CLEAR) - apc_register_signal(SIGUSR1, apc_clear_cache TSRMLS_CC); -#endif - if (APCG(coredump_unmap)) { - /* ISO C standard signals that coredump */ - apc_register_signal(SIGSEGV, apc_core_unmap TSRMLS_CC); - apc_register_signal(SIGABRT, apc_core_unmap TSRMLS_CC); - apc_register_signal(SIGFPE, apc_core_unmap TSRMLS_CC); - apc_register_signal(SIGILL, apc_core_unmap TSRMLS_CC); -/* extended signals that coredump */ -#ifdef SIGBUS - apc_register_signal(SIGBUS, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGABORT - apc_register_signal(SIGABORT, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGEMT - apc_register_signal(SIGEMT, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGIOT - apc_register_signal(SIGIOT, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGQUIT - apc_register_signal(SIGQUIT, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGSYS - apc_register_signal(SIGSYS, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGTRAP - apc_register_signal(SIGTRAP, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGXCPU - apc_register_signal(SIGXCPU, apc_core_unmap TSRMLS_CC); -#endif -#ifdef SIGXFSZ - apc_register_signal(SIGXFSZ, apc_core_unmap TSRMLS_CC); -#endif - } - } -} /* }}} */ - -/* {{{ apc_set_signals - * cleanup signals for shutdown */ -void apc_shutdown_signals(TSRMLS_D) -{ - int i=0; - if (apc_signal_info.installed > 0) { - for (i=0; (i < apc_signal_info.installed); i++) { - apc_efree(apc_signal_info.prev[i] TSRMLS_CC); - } - apc_efree(apc_signal_info.prev TSRMLS_CC); - apc_signal_info.installed = 0; /* just in case */ - } -} -/* }}} */ - -#endif /* HAVE_SIGACTION */ - -/* - * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_signal.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_signal.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_signal.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_signal.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - */ - -/* $Id: apc_signal.h 307048 2011-01-03 23:53:17Z kalle $ */ - -#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); -void apc_shutdown_signals(TSRMLS_D); - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_sma_api.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_sma_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_sma_api.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_sma_api.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,292 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APCu | - +----------------------------------------------------------------------+ - | Copyright (c) 2013 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. | - +----------------------------------------------------------------------+ - | Author: Joe Watkins | - +----------------------------------------------------------------------+ - - 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. - */ - -#ifndef HAVE_APC_SMA_API_H -#define HAVE_APC_SMA_API_H -/* {{{ SMA API - APC SMA API provides support for shared memory allocators to external libraries ( and to APC ) - Skip to the bottom macros for error free usage of the SMA API -*/ - -/* {{{ struct definition: apc_segment_t */ -typedef struct _apc_segment_t { - size_t size; /* size of this segment */ - void* shmaddr; /* address of shared memory */ -#ifdef APC_MEMPROTECT - void* roaddr; /* read only (mprotect'd) address */ -#endif -} apc_segment_t; /* }}} */ - -/* {{{ 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 segments */ - size_t seg_size; /* segment size */ - apc_sma_link_t** list; /* one list per segment of links */ -}; -/* }}} */ - -/* {{{ function definitions for SMA API objects */ -typedef void (*apc_sma_init_f) (zend_uint num, zend_ulong size, char *mask TSRMLS_DC); -typedef void (*apc_sma_cleanup_f) (TSRMLS_D); -typedef void* (*apc_sma_malloc_f) (zend_ulong size TSRMLS_DC); -typedef void* (*apc_sma_malloc_ex_f) (zend_ulong size, zend_ulong fragment, zend_ulong *allocated TSRMLS_DC); -typedef void* (*apc_sma_realloc_f) (void* p, zend_ulong size TSRMLS_DC); -typedef char* (*apc_sma_strdup_f) (const char* str TSRMLS_DC); -typedef void (*apc_sma_free_f) (void *p TSRMLS_DC); -typedef void* (*apc_sma_protect_f) (void* p); -typedef void* (*apc_sma_unprotect_f) (void* p); -typedef apc_sma_info_t* (*apc_sma_info_f) (zend_bool limited TSRMLS_DC); -typedef void (*apc_sma_free_info_f) (apc_sma_info_t *info TSRMLS_DC); -typedef zend_ulong (*apc_sma_get_avail_mem_f) (void); -typedef zend_bool (*apc_sma_get_avail_size_f) (zend_ulong size); -typedef void (*apc_sma_check_integrity_f) (void); -typedef void (*apc_sma_expunge_f)(void* pointer, zend_ulong size TSRMLS_DC); /* }}} */ - -/* {{{ struct definition: apc_sma_t */ -typedef struct _apc_sma_t { - zend_bool initialized; /* flag to indicate this sma has been intialized */ - - /* functions */ - apc_sma_init_f init; /* init */ - apc_sma_cleanup_f cleanup; /* cleanup */ - apc_sma_malloc_f smalloc; /* malloc */ - apc_sma_malloc_ex_f malloc_ex; /* malloc_ex */ - apc_sma_realloc_f realloc; /* realloc */ - apc_sma_strdup_f strdup; /* strdup */ - apc_sma_free_f sfree; /* free */ - apc_sma_protect_f protect; /* protect */ - apc_sma_unprotect_f unprotect; /* unprotect */ - apc_sma_info_f info; /* info */ - apc_sma_free_info_f free_info; /* free info */ - apc_sma_get_avail_mem_f get_avail_mem; /* get avail mem */ - apc_sma_get_avail_size_f get_avail_size; /* get avail size */ - apc_sma_check_integrity_f check_integrity; /* check integrity */ - - /* callback */ - apc_sma_expunge_f expunge; /* expunge */ - void** data; /* data */ - - /* info */ - zend_uint num; /* number of segments */ - zend_ulong size; /* segment size */ - zend_uint last; /* last segment */ - - /* segments */ - apc_segment_t* segs; /* segments */ -} apc_sma_t; /* }}} */ - -/* -* apc_sma_api_init will initialize a shared memory allocator with num segments of the given size -* -* should be called once per allocator per process -*/ -PHP_APCU_API void apc_sma_api_init(apc_sma_t* sma, - void** data, - apc_sma_expunge_f expunge, - zend_uint num, - zend_ulong size, - char *mask TSRMLS_DC); - -/* -* apc_sma_api_cleanup will free the sma allocator -*/ -PHP_APCU_API void apc_sma_api_cleanup(apc_sma_t* sma TSRMLS_DC); - -/* -* apc_smap_api_malloc will allocate a block from the sma of the given size -*/ -PHP_APCU_API void* apc_sma_api_malloc(apc_sma_t* sma, - zend_ulong size TSRMLS_DC); - -/* -* apc_sma_api_malloc_ex will allocate a block from the sma of the given size -*/ -PHP_APCU_API void* apc_sma_api_malloc_ex(apc_sma_t* sma, - zend_ulong size, - zend_ulong fragment, - zend_ulong* allocated TSRMLS_DC); - -/* -* apc_sma_api_realloc will reallocate p using a new block from sma (freeing the original p) -*/ -PHP_APCU_API void* apc_sma_api_realloc(apc_sma_t* sma, - void* p, - zend_ulong size TSRMLS_DC); - -/* -* apc_sma_api_strdup will duplicate the given string into a block from sma -*/ -PHP_APCU_API char* apc_sma_api_strdup(apc_sma_t* sma, - const char* s TSRMLS_DC); - -/* -* apc_sma_api_free will free p (which should be a pointer to a block allocated from sma) -*/ -PHP_APCU_API void apc_sma_api_free(apc_sma_t* sma, - void* p TSRMLS_DC); - -/* -* apc_sma_api_protect will protect p (which should be a pointer to a block allocated from sma) -*/ -PHP_APCU_API void* apc_sma_api_protect(apc_sma_t* sma, - void* p); - -/* -* apc_sma_api_protect will uprotect p (which should be a pointer to a block allocated from sma) -*/ -PHP_APCU_API void* apc_sma_api_unprotect(apc_sma_t* sma, - void *p); - -/* -* apc_sma_api_info returns information about the allocator -*/ -PHP_APCU_API apc_sma_info_t* apc_sma_api_info(apc_sma_t* sma, - zend_bool limited TSRMLS_DC); - -/* -* apc_sma_api_info_free_info is for freeing apc_sma_info_t* returned by apc_sma_api_info -*/ -PHP_APCU_API void apc_sma_api_free_info(apc_sma_t* sma, - apc_sma_info_t* info TSRMLS_DC); - -/* -* apc_sma_api_get_avail_mem will return the amount of memory available left to sma -*/ -PHP_APCU_API zend_ulong apc_sma_api_get_avail_mem(apc_sma_t* sma); - -/* -* apc_sma_api_get_avail_size will return true if at least size bytes are available to the sma -*/ -PHP_APCU_API zend_bool apc_sma_api_get_avail_size(apc_sma_t* sma, - size_t size); - -/* -* apc_sma_api_check_integrity will check the integrity of sma -*/ -PHP_APCU_API void apc_sma_api_check_integrity(apc_sma_t* sma); /* }}} */ - -/* {{{ ALIGNWORD: pad up x, aligned to the system's word boundary */ -typedef union { void* p; int i; long l; double d; void (*f)(void); } apc_word_t; -#define ALIGNSIZE(x, size) ((size) * (1 + (((x)-1)/(size)))) -#define ALIGNWORD(x) ALIGNSIZE(x, sizeof(apc_word_t)) -/* }}} */ - -/* -* The following macros help to implement APC SMA in a few easy steps: -* 1) call apc_sma_api_decl(name) to intialize an APC SMA by the given name in a global project header -* 2) call apc_sma_api_impl(name) to implement the APC SMA in a compilation unit -* 3) call apc_sma_api_extern(name) in any compilation unit without direct access to your SMA -* -* you can now call name.malloc, name.free etc from anywhere in your application, and there is no margin for error -* your extension should call name.init during MINIT and name.cleanup during MSHUTDOWN -*/ - -/* {{{ Implementor macros */ -#define apc_sma_api_name(name) name -#define apc_sma_api_ptr(name) &apc_sma_api_name(name) -#define apc_sma_api_func(name, func) name##_##func - -/* {{{ Call in a header somewhere to extern all sma functions */ -#define apc_sma_api_decl(name) \ - PHP_APCU_API void apc_sma_api_func(name, init)(zend_uint num, zend_ulong size, char* mask TSRMLS_DC); \ - PHP_APCU_API void apc_sma_api_func(name, cleanup)(TSRMLS_D); \ - PHP_APCU_API void* apc_sma_api_func(name, malloc)(zend_ulong size TSRMLS_DC); \ - PHP_APCU_API void* apc_sma_api_func(name, malloc_ex)(zend_ulong size, zend_ulong fragment, zend_ulong* allocated TSRMLS_DC); \ - PHP_APCU_API void* apc_sma_api_func(name, realloc)(void* p, zend_ulong size TSRMLS_DC); \ - PHP_APCU_API char* apc_sma_api_func(name, strdup)(const char* s TSRMLS_DC); \ - PHP_APCU_API void apc_sma_api_func(name, free)(void* p TSRMLS_DC); \ - PHP_APCU_API void* apc_sma_api_func(name, protect)(void* p); \ - PHP_APCU_API void* apc_sma_api_func(name, unprotect)(void* p); \ - PHP_APCU_API apc_sma_info_t* apc_sma_api_func(name, info)(zend_bool limited TSRMLS_DC); \ - PHP_APCU_API void apc_sma_api_func(name, free_info)(apc_sma_info_t* info TSRMLS_DC); \ - PHP_APCU_API zend_ulong apc_sma_api_func(name, get_avail_mem)(void); \ - PHP_APCU_API zend_bool apc_sma_api_func(name, get_avail_size)(zend_ulong size); \ - PHP_APCU_API void apc_sma_api_func(name, check_integrity)(void); /* }}} */ - -/* {{{ Call in a compilation unit */ -#define apc_sma_api_impl(name, data, expunge) \ - apc_sma_t apc_sma_api_name(name) = {0, \ - &apc_sma_api_func(name, init), \ - &apc_sma_api_func(name, cleanup), \ - &apc_sma_api_func(name, malloc), \ - &apc_sma_api_func(name, malloc_ex), \ - &apc_sma_api_func(name, realloc), \ - &apc_sma_api_func(name, strdup), \ - &apc_sma_api_func(name, free), \ - &apc_sma_api_func(name, protect), \ - &apc_sma_api_func(name, unprotect), \ - &apc_sma_api_func(name, info), \ - &apc_sma_api_func(name, free_info), \ - &apc_sma_api_func(name, get_avail_mem), \ - &apc_sma_api_func(name, get_avail_size), \ - &apc_sma_api_func(name, check_integrity), \ - }; \ - PHP_APCU_API void apc_sma_api_func(name, init)(zend_uint num, zend_ulong size, char* mask TSRMLS_DC) \ - { apc_sma_api_init(apc_sma_api_ptr(name), (void**) data, (apc_sma_expunge_f) expunge, num, size, mask TSRMLS_CC); } \ - PHP_APCU_API void apc_sma_api_func(name, cleanup)(TSRMLS_D) \ - { apc_sma_api_cleanup(apc_sma_api_ptr(name) TSRMLS_CC); } \ - PHP_APCU_API void* apc_sma_api_func(name, malloc)(zend_ulong size TSRMLS_DC) \ - { return apc_sma_api_malloc(apc_sma_api_ptr(name), size TSRMLS_CC); } \ - PHP_APCU_API void* apc_sma_api_func(name, malloc_ex)(zend_ulong size, zend_ulong fragment, zend_ulong* allocated TSRMLS_DC) \ - { return apc_sma_api_malloc_ex(apc_sma_api_ptr(name), size, fragment, allocated TSRMLS_CC); } \ - PHP_APCU_API void* apc_sma_api_func(name, realloc)(void* p, zend_ulong size TSRMLS_DC) \ - { return apc_sma_api_realloc(apc_sma_api_ptr(name), p, size TSRMLS_CC); } \ - PHP_APCU_API char* apc_sma_api_func(name, strdup)(const char* s TSRMLS_DC) \ - { return apc_sma_api_strdup(apc_sma_api_ptr(name), s TSRMLS_CC); } \ - PHP_APCU_API void apc_sma_api_func(name, free)(void* p TSRMLS_DC) \ - { apc_sma_api_free(apc_sma_api_ptr(name), p TSRMLS_CC); } \ - PHP_APCU_API void* apc_sma_api_func(name, protect)(void* p) \ - { return apc_sma_api_protect(apc_sma_api_ptr(name), p); } \ - PHP_APCU_API void* apc_sma_api_func(name, unprotect)(void* p) \ - { return apc_sma_api_unprotect(apc_sma_api_ptr(name), p); } \ - PHP_APCU_API apc_sma_info_t* apc_sma_api_func(name, info)(zend_bool limited TSRMLS_DC) \ - { return apc_sma_api_info(apc_sma_api_ptr(name), limited TSRMLS_CC); } \ - PHP_APCU_API void apc_sma_api_func(name, free_info)(apc_sma_info_t* info TSRMLS_DC) \ - { apc_sma_api_free_info(apc_sma_api_ptr(name), info TSRMLS_CC); } \ - PHP_APCU_API zend_ulong apc_sma_api_func(name, get_avail_mem)() \ - { return apc_sma_api_get_avail_mem(apc_sma_api_ptr(name)); } \ - PHP_APCU_API zend_bool apc_sma_api_func(name, get_avail_size)(zend_ulong size) \ - { return apc_sma_api_get_avail_size(apc_sma_api_ptr(name), size); } \ - PHP_APCU_API void apc_sma_api_func(name, check_integrity)() \ - { apc_sma_api_check_integrity(apc_sma_api_ptr(name)); } /* }}} */ - -/* {{{ Call wherever access to the SMA object is required */ -#define apc_sma_api_extern(name) extern apc_sma_t apc_sma_api_name(name) /* }}} */ - -/* }}} */ - -#endif - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_sma.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_sma.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_sma.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_sma.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,669 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | 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. - - */ - -/* $Id: apc_sma.c 328896 2012-12-26 05:28:14Z laruence $ */ - -#include "apc_sma.h" -#include "apc.h" -#include "apc_globals.h" -#include "apc_lock.h" -#include "apc_shm.h" -#include "apc_cache.h" - -#include -#include "apc_mmap.h" - -#ifdef APC_SMA_DEBUG -# ifdef HAVE_VALGRIND_MEMCHECK_H -# include -# endif -# define APC_SMA_CANARIES 1 -#endif - -enum { - DEFAULT_NUMSEG=1, - DEFAULT_SEGSIZE=30*1024*1024 }; - -typedef struct sma_header_t sma_header_t; -struct sma_header_t { - apc_lock_t sma_lock; /* segment lock */ - size_t segsize; /* size of entire segment */ - size_t avail; /* bytes available (not necessarily contiguous) */ -}; - -#define SMA_HDR(sma, i) ((sma_header_t*)((sma->segs[i]).shmaddr)) -#define SMA_ADDR(sma, i) ((char*)(SMA_HDR(sma, i))) -#define SMA_RO(sma, i) ((char*)(sma->segs[i]).roaddr) -#define SMA_LCK(sma, i) ((SMA_HDR(sma, i))->sma_lock) - -#if 0 -/* global counter for identifying blocks - * Technically it is possible to do the same - * using offsets, but double allocations of the - * same offset can happen. */ -static volatile size_t block_id = 0; -#endif - -typedef struct block_t block_t; -struct block_t { - size_t size; /* size of this block */ - size_t prev_size; /* size of sequentially previous block, 0 if prev is allocated */ - size_t fnext; /* offset in segment of next free block */ - size_t fprev; /* offset in segment of prev free block */ -#ifdef APC_SMA_CANARIES - size_t canary; /* canary to check for memory overwrites */ -#endif -#if 0 - size_t id; /* identifier for the memory block */ -#endif -}; - -/* The macros BLOCKAT and OFFSET are used for convenience throughout this - * module. Both assume the presence of a variable shmaddr that points to the - * beginning of the shared memory segment in question. */ - -#define BLOCKAT(offset) ((block_t*)((char *)shmaddr + offset)) -#define OFFSET(block) ((size_t)(((char*)block) - (char*)shmaddr)) - -/* macros for getting the next or previous sequential block */ -#define NEXT_SBLOCK(block) ((block_t*)((char*)block + block->size)) -#define PREV_SBLOCK(block) (block->prev_size ? ((block_t*)((char*)block - block->prev_size)) : NULL) - -/* Canary macros for setting, checking and resetting memory canaries */ -#ifdef APC_SMA_CANARIES - #define SET_CANARY(v) (v)->canary = 0x42424242 - #define CHECK_CANARY(v) assert((v)->canary == 0x42424242) - #define RESET_CANARY(v) (v)->canary = -42 -#else - #define SET_CANARY(v) - #define CHECK_CANARY(v) - #define RESET_CANARY(v) -#endif - -/* {{{ MINBLOCKSIZE */ -#define MINBLOCKSIZE (ALIGNWORD(1) + ALIGNWORD(sizeof(block_t))) -/* }}} */ - -/* {{{ sma_allocate: tries to allocate at least size bytes in a segment */ -static APC_HOTSPOT size_t sma_allocate(sma_header_t* header, zend_ulong size, zend_ulong fragment, zend_ulong *allocated) -{ - void* shmaddr; /* header of shared memory segment */ - block_t* prv; /* block prior to working block */ - block_t* cur; /* working block in list */ - block_t* prvnextfit; /* block before next fit */ - size_t realsize; /* actual size of block needed, including header */ - const size_t block_size = ALIGNWORD(sizeof(struct block_t)); - - realsize = ALIGNWORD(size + block_size); - - /* - * First, insure that the segment contains at least realsize free bytes, - * even if they are not contiguous. - */ - shmaddr = header; - - if (header->avail < realsize) { - return -1; - } - - prvnextfit = 0; /* initially null (no fit) */ - prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); - - CHECK_CANARY(prv); - - while (prv->fnext != 0) { - cur = BLOCKAT(prv->fnext); - - CHECK_CANARY(cur); - - /* If it can fit realsize bytes in cur block, stop searching */ - if (cur->size >= realsize) { - prvnextfit = prv; - break; - } - prv = cur; - } - - if (prvnextfit == 0) { - return -1; - } - - prv = prvnextfit; - cur = BLOCKAT(prv->fnext); - - CHECK_CANARY(prv); - CHECK_CANARY(cur); - - if (cur->size == realsize || (cur->size > realsize && cur->size < (realsize + (MINBLOCKSIZE + fragment)))) { - /* cur is big enough for realsize, but too small to split - unlink it */ - *(allocated) = cur->size - block_size; - prv->fnext = cur->fnext; - BLOCKAT(cur->fnext)->fprev = OFFSET(prv); - NEXT_SBLOCK(cur)->prev_size = 0; /* block is alloc'd */ - } else { - /* nextfit is too big; split it into two smaller blocks */ - block_t* nxt; /* the new block (chopped part of cur) */ - size_t oldsize; /* size of cur before split */ - - oldsize = cur->size; - cur->size = realsize; - *(allocated) = cur->size - block_size; - nxt = NEXT_SBLOCK(cur); - nxt->prev_size = 0; /* block is alloc'd */ - nxt->size = oldsize - realsize; /* and fix the size */ - NEXT_SBLOCK(nxt)->prev_size = nxt->size; /* adjust size */ - SET_CANARY(nxt); - - /* replace cur with next in free list */ - nxt->fnext = cur->fnext; - nxt->fprev = cur->fprev; - BLOCKAT(nxt->fnext)->fprev = OFFSET(nxt); - BLOCKAT(nxt->fprev)->fnext = OFFSET(nxt); -#if 0 - nxt->id = -1; -#endif - } - - cur->fnext = 0; - - /* update the block header */ - header->avail -= cur->size; - - SET_CANARY(cur); - -#if 0 - cur->id = ++block_id; - fprintf(stderr, "allocate(realsize=%d,size=%d,id=%d)\n", (int)(size), (int)(cur->size), cur->id); -#endif - - return OFFSET(cur) + block_size; -} -/* }}} */ - -/* {{{ sma_deallocate: deallocates the block at the given offset */ -static APC_HOTSPOT size_t sma_deallocate(void* shmaddr, size_t offset) -{ - sma_header_t* header; /* header of shared memory segment */ - block_t* cur; /* the new block to insert */ - block_t* prv; /* the block before cur */ - block_t* nxt; /* the block after cur */ - size_t size; /* size of deallocated block */ - - offset -= ALIGNWORD(sizeof(struct block_t)); - assert(offset >= 0); - - /* find position of new block in free list */ - cur = BLOCKAT(offset); - - /* update the block header */ - header = (sma_header_t*) shmaddr; - header->avail += cur->size; - size = cur->size; - - if (cur->prev_size != 0) { - /* remove prv from list */ - prv = PREV_SBLOCK(cur); - BLOCKAT(prv->fnext)->fprev = prv->fprev; - BLOCKAT(prv->fprev)->fnext = prv->fnext; - /* cur and prv share an edge, combine them */ - prv->size +=cur->size; - - RESET_CANARY(cur); - cur = prv; - } - - nxt = NEXT_SBLOCK(cur); - if (nxt->fnext != 0) { - assert(NEXT_SBLOCK(NEXT_SBLOCK(cur))->prev_size == nxt->size); - /* cur and nxt shared an edge, combine them */ - BLOCKAT(nxt->fnext)->fprev = nxt->fprev; - BLOCKAT(nxt->fprev)->fnext = nxt->fnext; - cur->size += nxt->size; - - CHECK_CANARY(nxt); - -#if 0 - nxt->id = -1; /* assert this or set it ? */ -#endif - - RESET_CANARY(nxt); - } - - NEXT_SBLOCK(cur)->prev_size = cur->size; - - /* insert new block after prv */ - prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); - cur->fnext = prv->fnext; - prv->fnext = OFFSET(cur); - cur->fprev = OFFSET(prv); - BLOCKAT(cur->fnext)->fprev = OFFSET(cur); - - return size; -} -/* }}} */ - -/* {{{ APC SMA API */ -PHP_APCU_API void apc_sma_api_init(apc_sma_t* sma, void** data, apc_sma_expunge_f expunge, zend_uint num, zend_ulong size, char *mask TSRMLS_DC) { - uint i; - - if (sma->initialized) { - return; - } - - sma->initialized = 1; - sma->expunge = expunge; - sma->data = data; - -#if APC_MMAP - /* - * I don't think multiple anonymous mmaps makes any sense - * so force sma_numseg to 1 in this case - */ - if(!mask || - (mask && !strlen(mask)) || - (mask && !strcmp(mask, "/dev/zero"))) { - sma->num = 1; - } else { - sma->num = num > 0 ? num : DEFAULT_NUMSEG; - } -#else - sma->num = num > 0 ? num : DEFAULT_NUMSEG; -#endif - - sma->size = size > 0 ? size : DEFAULT_SEGSIZE; - - sma->segs = (apc_segment_t*) apc_emalloc((sma->num * sizeof(apc_segment_t)) TSRMLS_CC); - - for (i = 0; i < sma->num; i++) { - sma_header_t* header; - block_t *first, *empty, *last; - void* shmaddr; - -#if APC_MMAP - sma->segs[i] = apc_mmap(mask, sma->size TSRMLS_CC); - if(sma->num != 1) - memcpy(&mask[strlen(mask)-6], "XXXXXX", 6); -#else - sma->segs[i] = apc_shm_attach( - apc_shm_create(i, sma->size TSRMLS_CC), - sma->size TSRMLS_CC - ); -#endif - - sma->segs[i].size = sma->size; - - shmaddr = sma->segs[i].shmaddr; - - header = (sma_header_t*) shmaddr; - CREATE_LOCK(&header->sma_lock); - header->segsize = sma->size; - header->avail = sma->size - ALIGNWORD(sizeof(sma_header_t)) - ALIGNWORD(sizeof(block_t)) - ALIGNWORD(sizeof(block_t)); - - first = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); - first->size = 0; - first->fnext = ALIGNWORD(sizeof(sma_header_t)) + ALIGNWORD(sizeof(block_t)); - first->fprev = 0; - first->prev_size = 0; - SET_CANARY(first); -#if 0 - first->id = -1; -#endif - empty = BLOCKAT(first->fnext); - empty->size = header->avail - ALIGNWORD(sizeof(block_t)); - empty->fnext = OFFSET(empty) + empty->size; - empty->fprev = ALIGNWORD(sizeof(sma_header_t)); - empty->prev_size = 0; - SET_CANARY(empty); -#if 0 - empty->id = -1; -#endif - last = BLOCKAT(empty->fnext); - last->size = 0; - last->fnext = 0; - last->fprev = OFFSET(empty); - last->prev_size = empty->size; - SET_CANARY(last); -#if 0 - last->id = -1; -#endif - } -} - -PHP_APCU_API void apc_sma_api_cleanup(apc_sma_t* sma TSRMLS_DC) { - uint i; - - assert(sma->initialized); - - for (i = 0; i < sma->num; i++) { - DESTROY_LOCK(&SMA_LCK(sma, i)); -#if APC_MMAP - apc_unmap(&sma->segs[i] TSRMLS_CC); -#else - apc_shm_detach(&sma->segs[i] TSRMLS_CC); -#endif - } - sma->initialized = 0; - - apc_efree(sma->segs TSRMLS_CC); -} - -PHP_APCU_API void* apc_sma_api_malloc_ex(apc_sma_t* sma, zend_ulong n, zend_ulong fragment, zend_ulong* allocated TSRMLS_DC) { - size_t off; - uint i; - int nuked = 0; - -restart: - assert(sma->initialized); - - WLOCK(&SMA_LCK(sma, sma->last)); - - off = sma_allocate(SMA_HDR(sma, sma->last), n, fragment, allocated); - - if(off == -1) { - /* retry failed allocation after we expunge */ - WUNLOCK(&SMA_LCK(sma, sma->last)); - sma->expunge( - *(sma->data), (n+fragment) TSRMLS_CC); - WLOCK(&SMA_LCK(sma, sma->last)); - off = sma_allocate(SMA_HDR(sma, sma->last), n, fragment, allocated); - } - - if (off != -1) { - void* p = (void *)(SMA_ADDR(sma, sma->last) + off); - WUNLOCK(&SMA_LCK(sma, sma->last)); -#ifdef VALGRIND_MALLOCLIKE_BLOCK - VALGRIND_MALLOCLIKE_BLOCK(p, n, 0, 0); -#endif - return p; - } - - WUNLOCK(&SMA_LCK(sma, sma->last)); - - for (i = 0; i < sma->num; i++) { - if (i == sma->last) { - continue; - } - WLOCK(&SMA_LCK(sma, i)); - off = sma_allocate(SMA_HDR(sma, i), n, fragment, allocated); - if(off == -1) { - /* retry failed allocation after we expunge */ - WUNLOCK(&SMA_LCK(sma, i)); - sma->expunge( - *(sma->data), (n+fragment) TSRMLS_CC); - WLOCK(&SMA_LCK(sma, i)); - off = sma_allocate(SMA_HDR(sma, i), n, fragment, allocated); - } - if (off != -1) { - void* p = (void *)(SMA_ADDR(sma, i) + off); - WUNLOCK(&SMA_LCK(sma, i)); - sma->last = i; -#ifdef VALGRIND_MALLOCLIKE_BLOCK - VALGRIND_MALLOCLIKE_BLOCK(p, n, 0, 0); -#endif - return p; - } - WUNLOCK(&SMA_LCK(sma, i)); - } - - /* I've tried being nice, but now you're just asking for it */ - if(!nuked) { - sma->expunge(*(sma->data), (n+fragment) TSRMLS_CC); - nuked = 1; - goto restart; - } - - /* now, I've truly and well given up */ - - return NULL; -} - -PHP_APCU_API void* apc_sma_api_malloc(apc_sma_t* sma, zend_ulong n TSRMLS_DC) -{ - zend_ulong allocated; - return apc_sma_api_malloc_ex( - sma, n, MINBLOCKSIZE, &allocated TSRMLS_CC); -} - -PHP_APCU_API void* apc_sma_api_realloc(apc_sma_t* sma, void* p, zend_ulong n TSRMLS_DC) { - apc_sma_api_free(sma, p TSRMLS_CC); - return apc_sma_api_malloc( - sma, n TSRMLS_CC); -} - -PHP_APCU_API char* apc_sma_api_strdup(apc_sma_t* sma, const char* s TSRMLS_DC) { - void* q; - int len; - - if(!s) { - return NULL; - } - - len = strlen(s)+1; - q = apc_sma_api_malloc( - sma, len TSRMLS_CC); - - if(!q) { - return NULL; - } - - memcpy(q, s, len); - return q; -} - -PHP_APCU_API void apc_sma_api_free(apc_sma_t* sma, void* p TSRMLS_DC) { - uint i; - size_t offset; - - if (p == NULL) { - return; - } - - assert(sma->initialized); - - for (i = 0; i < sma->num; i++) { - offset = (size_t)((char *)p - SMA_ADDR(sma, i)); - if (p >= (void*)SMA_ADDR(sma, i) && offset < sma->size) { - WLOCK(&SMA_LCK(sma, i)); - sma_deallocate(SMA_HDR(sma, i), offset); - WUNLOCK(&SMA_LCK(sma, i)); -#ifdef VALGRIND_FREELIKE_BLOCK - VALGRIND_FREELIKE_BLOCK(p, 0); -#endif - return; - } - } - - apc_error("apc_sma_free: could not locate address %p" TSRMLS_CC, p); -} - -#ifdef APC_MEMPROTECT -PHP_APCU_API void* apc_sma_api_protect(apc_sma_t* sma, void* p) { - unsigned int i = 0; - size_t offset; - - if (p == NULL) { - return NULL; - } - - if(SMA_RO(sma, sma->last) == NULL) return p; - - offset = (size_t)((char *)p - SMA_ADDR(sma, sma->last)); - - if(p >= (void*)SMA_ADDR(sma, sma->last) && offset < sma->size) { - return SMA_RO(sma, sma->last) + offset; - } - - for (i = 0; i < sma->num; i++) { - offset = (size_t)((char *)p - SMA_ADDR(sma, i)); - if (p >= (void*)SMA_ADDR(sma, i) && offset < sma->size) { - return SMA_RO(sma, i) + offset; - } - } - - return NULL; -} - -PHP_APCU_API void* apc_sma_api_unprotect(apc_sma_t* sma, void* p){ - unsigned int i = 0; - size_t offset; - - if (p == NULL) { - return NULL; - } - - if(SMA_RO(sma, sma->last) == NULL) return p; - - offset = (size_t)((char *)p - SMA_RO(sma, sma->last)); - - if(p >= (void*)SMA_RO(sma, sma->last) && offset < sma->size) { - return SMA_ADDR(sma, sma->last) + offset; - } - - for (i = 0; i < sma->num; i++) { - offset = (size_t)((char *)p - SMA_RO(sma, i)); - if (p >= (void*)SMA_RO(sma, i) && offset < sma->size) { - return SMA_ADDR(sma, i) + offset; - } - } - - return NULL; -} -#else -PHP_APCU_API void* apc_sma_api_protect(apc_sma_t* sma, void *p) { return p; } -PHP_APCU_API void* apc_sma_api_unprotect(apc_sma_t* sma, void *p) { return p; } -#endif - -PHP_APCU_API apc_sma_info_t* apc_sma_api_info(apc_sma_t* sma, zend_bool limited TSRMLS_DC) { - apc_sma_info_t* info; - apc_sma_link_t** link; - uint i; - char* shmaddr; - block_t* prv; - - if (!sma->initialized) { - return NULL; - } - - info = (apc_sma_info_t*) apc_emalloc(sizeof(apc_sma_info_t) TSRMLS_CC); - info->num_seg = sma->num; - info->seg_size = sma->size - (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*) TSRMLS_CC); - for (i = 0; i < sma->num; i++) { - info->list[i] = NULL; - } - - if(limited) { - return info; - } - - /* For each segment */ - for (i = 0; i < sma->num; i++) { - RLOCK(&SMA_LCK(sma, i)); - shmaddr = SMA_ADDR(sma, 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); - - CHECK_CANARY(cur); - - *link = apc_emalloc(sizeof(apc_sma_link_t) TSRMLS_CC); - (*link)->size = cur->size; - (*link)->offset = prv->fnext; - (*link)->next = NULL; - link = &(*link)->next; - - prv = cur; - } - RUNLOCK(&SMA_LCK(sma, i)); - } - - return info; -} - -PHP_APCU_API void apc_sma_api_free_info(apc_sma_t* sma, apc_sma_info_t* info TSRMLS_DC) { - 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 TSRMLS_CC); - } - } - apc_efree(info->list TSRMLS_CC); - apc_efree(info TSRMLS_CC); -} - -PHP_APCU_API zend_ulong apc_sma_api_get_avail_mem(apc_sma_t* sma) { - size_t avail_mem = 0; - uint i; - - for (i = 0; i < sma->num; i++) { - sma_header_t* header = SMA_HDR(sma, i); - avail_mem += header->avail; - } - return avail_mem; -} - -PHP_APCU_API zend_bool apc_sma_api_get_avail_size(apc_sma_t* sma, size_t size) { - uint i; - - for (i = 0; i < sma->num; i++) { - sma_header_t* header = SMA_HDR(sma, i); - if (header->avail > size) { - return 1; - } - } - return 0; -} - -PHP_APCU_API void apc_sma_api_check_integrity(apc_sma_t* sma) -{ - /* dummy */ -} - -/* {{{ APC SMA */ -apc_sma_api_impl(apc_sma, &apc_user_cache, apc_cache_default_expunge); -/* }}} */ - - /* }}} */ - -/* - * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_sma.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_sma.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_sma.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_sma.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - 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 307048 2011-01-03 23:53:17Z kalle $ */ - -#ifndef APC_SMA_H -#define APC_SMA_H - -#include "apc.h" -#include "apc_sma_api.h" - -/* {{{ SMA APC */ -apc_sma_api_decl(apc_sma); /* }}} */ -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_stack.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_stack.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_stack.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_stack.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - +----------------------------------------------------------------------+ - - 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 307048 2011-01-03 23:53:17Z kalle $ */ - -#include "apc.h" -#include "apc_stack.h" - -struct apc_stack_t { - void** data; - int capacity; - int size; -}; - -apc_stack_t* apc_stack_create(int size_hint TSRMLS_DC) -{ - apc_stack_t* stack = (apc_stack_t*) apc_emalloc(sizeof(apc_stack_t) TSRMLS_CC); - - stack->capacity = (size_hint > 0) ? size_hint : 10; - stack->size = 0; - stack->data = (void**) apc_emalloc(sizeof(void*) * stack->capacity TSRMLS_CC); - - return stack; -} - -void apc_stack_destroy(apc_stack_t* stack TSRMLS_DC) -{ - if (stack != NULL) { - apc_efree(stack->data TSRMLS_CC); - apc_efree(stack TSRMLS_CC); - } -} - -void apc_stack_clear(apc_stack_t* stack) -{ - assert(stack != NULL); - stack->size = 0; -} - -void apc_stack_push(apc_stack_t* stack, void* item TSRMLS_DC) -{ - assert(stack != NULL); - if (stack->size == stack->capacity) { - stack->capacity *= 2; - stack->data = apc_erealloc(stack->data, sizeof(void*)*stack->capacity TSRMLS_CC); - } - 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_stack.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_stack.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_stack.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_stack.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | George Schlossnagle | - +----------------------------------------------------------------------+ - - 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 307048 2011-01-03 23:53:17Z kalle $ */ - -#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 TSRMLS_DC); -extern void apc_stack_destroy(T stack TSRMLS_DC); -extern void apc_stack_clear(T stack); -extern void apc_stack_push(T stack, void* item TSRMLS_DC); -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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_windows_srwlock_kernel.c php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_windows_srwlock_kernel.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_windows_srwlock_kernel.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_windows_srwlock_kernel.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: Pierre Joye | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ -/* - These APIs are not actually exposed nor documented. But should work fine - from a binary as available since XP without signature changes. -*/ -/* -TODOs: -non blocking could be possible using the fWait argument (to 0). However -I'm not sure whether the wait handlers is actually implemented in all -supported platforms (xp+). could be enabled later once really tested. - */ -/* $Id: $ */ - -#include - -#ifdef APC_SRWLOCK_KERNEL -#include "apc_windows_srwlock_kernel.h" - -/* -For references: -void WINAPI RtlInitializeResource(LPRTL_RWLOCK rwl); -void WINAPI RtlDeleteResource(LPRTL_RWLOCK rwl); -BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK rwl, BYTE fWait); -BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK rwl, BYTE fWait); -void WINAPI RtlReleaseResource(LPRTL_RWLOCK rwl); -*/ -typedef void (WINAPI *tRtlInitializeResource)(LPRTL_RWLOCK rwl); -typedef void (WINAPI *tRtlDeleteResource)(LPRTL_RWLOCK rwl); -typedef BYTE (WINAPI *tRtlAcquireResourceExclusive)(LPRTL_RWLOCK rwl, BYTE fWait); -typedef BYTE (WINAPI *tRtlAcquireResourceShared)(LPRTL_RWLOCK rwl, BYTE fWait); -typedef void (WINAPI *tRtlReleaseResource)(LPRTL_RWLOCK rwl); -typedef void (WINAPI *tRtlDumpResource)(LPRTL_RWLOCK rwl); - -tRtlInitializeResource pRtlInitializeResource = 0; -tRtlDeleteResource pRtlDeleteResource = 0; -tRtlAcquireResourceExclusive pRtlAcquireResourceExclusive = 0; -tRtlAcquireResourceShared pRtlAcquireResourceShared = 0; -tRtlReleaseResource pRtlReleaseResource = 0; -tRtlDumpResource pRtlDumpResource = 0; - -HINSTANCE ntdll; - -void apc_windows_cs_status(apc_windows_cs_rwlock_t *lock ); -apc_windows_cs_rwlock_t *apc_windows_cs_create(apc_windows_cs_rwlock_t *lock TSRMLS_DC) -{ - ntdll = LoadLibrary("ntdll.dll"); - if (ntdll == 0) { - return NULL; - } - - pRtlInitializeResource = (tRtlInitializeResource) GetProcAddress(ntdll, "RtlInitializeResource"); - pRtlDeleteResource = (tRtlDeleteResource) GetProcAddress(ntdll, "RtlDeleteResource"); - pRtlAcquireResourceExclusive = (tRtlAcquireResourceExclusive) GetProcAddress(ntdll, "RtlAcquireResourceExclusive"); - pRtlAcquireResourceShared = (tRtlAcquireResourceShared) GetProcAddress(ntdll, "RtlAcquireResourceShared"); - pRtlReleaseResource = (tRtlReleaseResource) GetProcAddress(ntdll, "RtlReleaseResource"); - pRtlDumpResource = (tRtlReleaseResource) GetProcAddress(ntdll, "RtlDumpResource"); - if (pRtlInitializeResource == 0 || pRtlDeleteResource == 0 || pRtlAcquireResourceExclusive == 0 || - pRtlAcquireResourceShared == 0 || pRtlReleaseResource == 0 || pRtlDumpResource == 0) { - return NULL; - } - pRtlInitializeResource(lock); - return lock; -} - -void apc_windows_cs_destroy(apc_windows_cs_rwlock_t *lock) -{ - __try - { - pRtlDeleteResource(lock); - } - __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? - EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) - { - /* Ignore exception (resource was freed during shutdown of another thread) */ - } - FreeLibrary(ntdll); - return; -} - -void apc_windows_cs_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC) -{ - pRtlAcquireResourceExclusive(lock, 1); -} - -void apc_windows_cs_rdlock(apc_windows_cs_rwlock_t *lock TSRMLS_DC) -{ - pRtlAcquireResourceShared(lock, 1); -} - -void apc_windows_cs_unlock_rd(apc_windows_cs_rwlock_t *lock TSRMLS_DC) -{ - pRtlReleaseResource(lock); -} - -void apc_windows_cs_unlock_wr(apc_windows_cs_rwlock_t *lock TSRMLS_DC) -{ - pRtlReleaseResource(lock); -} - -/* debugging purposes, output using trace msgs */ -void apc_windows_cs_status(apc_windows_cs_rwlock_t *lock) -{ - pRtlDumpResource(lock); - return; -} - -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_windows_srwlock_kernel.h php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_windows_srwlock_kernel.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/apc_windows_srwlock_kernel.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/apc_windows_srwlock_kernel.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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: Pierre Joye | - +----------------------------------------------------------------------+ - */ -/* $Id$ */ - -#ifndef APC_WINDOWS_CS_RWLOCK_H -#define APC_WINDOWS_CS_RWLOCK_H - -#include "apc.h" - -#ifdef APC_SRWLOCK_KERNEL - -typedef struct _RTL_RWLOCK { - RTL_CRITICAL_SECTION rtlCS; - - HANDLE hSharedReleaseSemaphore; - UINT uSharedWaiters; - - HANDLE hExclusiveReleaseSemaphore; - UINT uExclusiveWaiters; - - INT iNumberActive; - HANDLE hOwningThreadId; - DWORD dwTimeoutBoost; - PVOID pDebugInfo; -} RTL_RWLOCK, *LPRTL_RWLOCK; - -#define apc_windows_cs_rwlock_t RTL_RWLOCK - -struct apc_windows_cs_rwlock_t { - CRITICAL_SECTION cs; - LONG writers_waiting_count; - LONG readers_waiting_count; - DWORD active_writers_readers_flag; - HANDLE ready_to_read; - HANDLE ready_to_write; - DWORD reader_races_lost; -}; - -apc_windows_cs_rwlock_t *apc_windows_cs_create(apc_windows_cs_rwlock_t *lock TSRMLS_DC); -void apc_windows_cs_destroy(apc_windows_cs_rwlock_t *lock); -void apc_windows_cs_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); -void apc_windows_cs_rdlock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); -void apc_windows_cs_unlock_rd(apc_windows_cs_rwlock_t *lock TSRMLS_DC); -void apc_windows_cs_unlock_wr(apc_windows_cs_rwlock_t *lock TSRMLS_DC); -# if NONBLOCKING_LOCK_AVAILABLE==1 /* Only in win7/2008 */ -zend_bool apc_pthreadrwlock_nonblocking_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); -# endif -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/config.m4 php5-easybib-apcu-4.0.7/apcu-4.0.6/config.m4 --- php5-easybib-apcu-4.0.6/apcu-4.0.6/config.m4 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/config.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,325 +0,0 @@ -dnl -dnl $Id: config.m4 327593 2012-09-10 11:50:58Z pajoye $ -dnl -PHP_ARG_ENABLE(apcu, whether to enable APCu support, -[ --enable-apcu Enable APCu support]) - -PHP_APC_BC=yes -AC_MSG_CHECKING(if APCu should provide APC full compatibility support) -AC_ARG_ENABLE(apc-bc, -[ --enable-apc-bc Enable APC full compatibility support], -[ if test "x$enableval" = "xno"; then - PHP_APC_BC=no - else - PHP_APC_BC=yes - fi -]) -AC_MSG_RESULT($PHP_APC_BC) - -AC_MSG_CHECKING(if APCu should be allowed to use rwlocks) -AC_ARG_ENABLE(apcu-rwlocks, -[ --disable-apcu-rwlocks Disable rwlocks in APCu], -[ - PHP_APCU_RWLOCKS=no - AC_MSG_RESULT(no) -], -[ - PHP_APCU_RWLOCKS=yes - AC_MSG_RESULT(yes) -]) - -AC_MSG_CHECKING(if APCu should be built in debug mode) -AC_ARG_ENABLE(apcu-debug, -[ --enable-apcu-debug Enable APCu debugging], -[ - PHP_APCU_DEBUG=$enableval -], -[ - PHP_APCU_DEBUG=no -]) -AC_MSG_RESULT($PHP_APCU_DEBUG) - -AC_MSG_CHECKING(if APCu should clear on SIGUSR1) -AC_ARG_ENABLE(apcu-clear-signal, -[ --enable-apcu-clear-signal Enable SIGUSR1 clearing handler], -[ - AC_DEFINE(APC_CLEAR_SIGNAL, 1, [ ]) - AC_MSG_RESULT(yes) -], -[ - AC_MSG_RESULT(no) -]) - -AC_MSG_CHECKING(if APCu will use mmap or shm) -AC_ARG_ENABLE(apcu-mmap, -[ --disable-apcu-mmap Disable mmap, falls back on shm], -[ - PHP_APCU_MMAP=no - AC_MSG_RESULT(shm) -], [ - PHP_APCU_MMAP=yes - AC_MSG_RESULT(mmap) -]) - -PHP_APCU_SPINLOCK=no -AC_MSG_CHECKING(if APCu should utilize spinlocks before flocks) -AC_ARG_ENABLE(apcu-spinlocks, -[ --enable-apcu-spinlocks Use spinlocks before flocks], -[ if test "x$enableval" = "xno"; then - PHP_APCU_SPINLOCK=no - else - PHP_APCU_SPINLOCK=yes - fi -]) -AC_MSG_RESULT($PHP_APCU_SPINLOCK) - -if test "$PHP_APCU" != "no"; then - if test "$PHP_APC_BC" != "no"; then - AC_DEFINE(APC_FULL_BC, 1, [APC full compatibility support]) - fi - if test "$PHP_APCU_DEBUG" != "no"; then - AC_DEFINE(APC_DEBUG, 1, [ ]) - fi - - if test "$PHP_APCU_MMAP" != "no"; then - AC_DEFINE(APC_MMAP, 1, [ ]) - fi - - if test "$PHP_APCU_RWLOCKS" != "no"; then - orig_LIBS="$LIBS" - LIBS="$LIBS -lpthread" - AC_TRY_RUN( - [ - #include - #include - main() { - pthread_rwlock_t rwlock; - pthread_rwlockattr_t attr; - - if(pthread_rwlockattr_init(&attr)) { - puts("Unable to initialize pthread attributes (pthread_rwlockattr_init)."); - return -1; - } - if(pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) { - puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_rwlockattr_setpshared), your system may not support shared rwlock's."); - return -1; - } - if(pthread_rwlock_init(&rwlock, &attr)) { - puts("Unable to initialize the rwlock (pthread_rwlock_init)."); - return -1; - } - if(pthread_rwlockattr_destroy(&attr)) { - puts("Unable to destroy rwlock attributes (pthread_rwlockattr_destroy)."); - return -1; - } - if(pthread_rwlock_destroy(&rwlock)) { - puts("Unable to destroy rwlock (pthread_rwlock_destroy)."); - return -1; - } - - return 0; - } - ], - [ dnl -Success- - APCU_CFLAGS="-D_GNU_SOURCE" - PHP_ADD_LIBRARY(pthread) - PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" - AC_DEFINE(APC_NATIVE_RWLOCK, 1, [ ]) - AC_MSG_WARN([APCu has access to native rwlocks]) - ], - [ dnl -Failure- - AC_MSG_WARN([It doesn't appear that pthread rwlocks are supported on your system]) - PHP_APCU_RWLOCKS=no - ], - [ - APCU_CFLAGS="-D_GNU_SOURCE" - PHP_ADD_LIBRARY(pthread) - PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" - ] - ) - LIBS="$orig_LIBS" - fi - - if test "$PHP_APCU_RWLOCKS" == "no"; then - orig_LIBS="$LIBS" - LIBS="$LIBS -lpthread" - AC_TRY_RUN( - [ - #include - #include - 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; - } - return 0; - } - ], - [ dnl -Success- - APCU_CFLAGS="-D_GNU_SOURCE" - PHP_ADD_LIBRARY(pthread) - PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" - AC_MSG_WARN([APCu has access to mutexes]) - ], - [ dnl -Failure- - AC_MSG_WARN([It doesn't appear that pthread mutexes are supported on your system]) - PHP_APCU_MUTEX=no - ], - [ - APCU_CFLAGS="-D_GNU_SOURCE" - PHP_ADD_LIBRARY(pthread) - PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" - ] - ) - LIBS="$orig_LIBS" - fi - - if test "$PHP_APCU_RWLOCKS" == "no"; then - if test "$PHP_APCU_MUTEX" == "no"; then - if test "$PHP_APCU_SPINLOCK" != "no"; then - AC_DEFINE(APC_SPIN_LOCK, 1, [ ]) - AC_MSG_WARN([APCu spin locking enabled]) - else - AC_DEFINE(APC_FCNTL_LOCK, 1, [ ]) - AC_MSG_WARN([APCu file locking enabled]) - fi - fi - fi - - AC_CHECK_FUNCS(sigaction) - AC_CACHE_CHECK(for union semun, php_cv_semun, - [ - AC_TRY_COMPILE([ -#include -#include -#include - ], [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_ARG_ENABLE(valgrind-checks, - [ --disable-valgrind-checks - Disable valgrind based memory checks], - [ - PHP_APCU_VALGRIND=no - ], [ - PHP_APCU_VALGRIND=yes - AC_CHECK_HEADER(valgrind/memcheck.h, - [AC_DEFINE([HAVE_VALGRIND_MEMCHECK_H],1, [enable valgrind memchecks])]) - ]) - - apc_sources="apc.c apc_lock.c php_apc.c \ - apc_cache.c \ - apc_mmap.c \ - apc_shm.c \ - apc_sma.c \ - apc_stack.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,,APCU_SHARED_LIBADD)]) - PHP_NEW_EXTENSION(apcu, $apc_sources, $ext_shared,, \\$(APCU_CFLAGS)) - PHP_SUBST(APCU_SHARED_LIBADD) - PHP_SUBST(APCU_CFLAGS) - PHP_SUBST(PHP_LDFLAGS) - PHP_INSTALL_HEADERS(ext/apcu, [apc.h apc_api.h apc_cache_api.h apc_lock_api.h apc_pool_api.h apc_sma_api.h apc_bin_api.h apc_serializer.h]) - AC_DEFINE(HAVE_APCU, 1, [ ]) -fi - -PHP_ARG_ENABLE(coverage, whether to include code coverage symbols, -[ --enable-coverage DEVELOPERS ONLY!!], no, no) - -if test "$PHP_COVERAGE" = "yes"; then - - if test "$GCC" != "yes"; then - AC_MSG_ERROR([GCC is required for --enable-coverage]) - fi - - dnl Check if ccache is being used - case `$php_shtool path $CC` in - *ccache*[)] gcc_ccache=yes;; - *[)] gcc_ccache=no;; - esac - - if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then - AC_MSG_ERROR([ccache must be disabled when --enable-coverage option is used. You can disable ccache by setting environment variable -CCACHE_DISABLE=1.]) - fi - - lcov_version_list="1.5 1.6 1.7 1.9" - - AC_CHECK_PROG(LCOV, lcov, lcov) - AC_CHECK_PROG(GENHTML, genhtml, genhtml) - PHP_SUBST(LCOV) - PHP_SUBST(GENHTML) - - if test "$LCOV"; then - AC_CACHE_CHECK([for lcov version], php_cv_lcov_version, [ - php_cv_lcov_version=invalid - lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` #' - for lcov_check_version in $lcov_version_list; do - if test "$lcov_version" = "$lcov_check_version"; then - php_cv_lcov_version="$lcov_check_version (ok)" - fi - done - ]) - else - lcov_msg="To enable code coverage reporting you must have one of the following LCOV versions installed: $lcov_version_list" - AC_MSG_ERROR([$lcov_msg]) - fi - - case $php_cv_lcov_version in - ""|invalid[)] - lcov_msg="You must have one of the following versions of LCOV: $lcov_version_list (found: $lcov_version)." - AC_MSG_ERROR([$lcov_msg]) - LCOV="exit 0;" - ;; - esac - - if test -z "$GENHTML"; then - AC_MSG_ERROR([Could not find genhtml from the LCOV package]) - fi - - PHP_ADD_MAKEFILE_FRAGMENT - - dnl Remove all optimization flags from CFLAGS - changequote({,}) - CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` - CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` - changequote([,]) - - dnl Add the special gcc flags - CFLAGS="$CFLAGS -O0 -ggdb -fprofile-arcs -ftest-coverage" - CXXFLAGS="$CXXFLAGS -ggdb -O0 -fprofile-arcs -ftest-coverage" -fi -dnl vim: set ts=2 diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/config.w32 php5-easybib-apcu-4.0.7/apcu-4.0.6/config.w32 --- php5-easybib-apcu-4.0.6/apcu-4.0.6/config.w32 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/config.w32 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -// $Id: config.w32 309203 2011-03-14 06:47:16Z pajoye $ -// vim:ft=javascript - -ARG_ENABLE('apcu', 'Whether to enable APCu support', 'no'); -ARG_ENABLE('apcu-debug', 'Whether to enable APCu debugging', 'no'); -ARG_ENABLE('apc-bc', 'Whether APCu should provide APC full compatibility support', 'yes'); - -if(PHP_APCU != 'no') -{ - var apc_sources = 'apc.c php_apc.c apc_cache.c ' + - 'apc_iterator.c apc_shm.c apc_lock.c ' + - 'apc_sma.c apc_stack.c apc_rfc1867.c apc_pool.c ' + - 'apc_bin.c apc_windows_srwlock_kernel.c'; - - if(PHP_APCU_DEBUG != 'no') - { - ADD_FLAG('CFLAGS_APC', '/D APC_DEBUG=1'); - } - - /* XXX srwlock kernel as most BC compatible for now */ - AC_DEFINE('APC_SRWLOCK_KERNEL', 1); - ADD_FLAG('CFLAGS_APC', '/D WIN32_ONLY_COMPILER=1'); - - AC_DEFINE('HAVE_APCU', 1); - - if (PHP_APC_BC != 'no') - { - AC_DEFINE('APC_FULL_BC', 1); - MESSAGE("APCu: full APC compatibility is enabled"); - } else { - WARNING("APCu: full APC compatibility is NOT enabled"); - } - - PHP_INSTALL_HEADERS("ext/apcu", "apc.h apc_api.h apc_cache_api.h apc_lock_api.h apc_pool_api.h apc_sma_api.h apc_bin_api.h apc_serializer.h"); - - EXTENSION('apcu', apc_sources); -} diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/INSTALL php5-easybib-apcu-4.0.7/apcu-4.0.6/INSTALL --- php5-easybib-apcu-4.0.6/apcu-4.0.6/INSTALL 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/INSTALL 1970-01-01 00:00:00.000000000 +0000 @@ -1,320 +0,0 @@ -Installation Instructions for APCu ---------------------------------- - -This version of APCu 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: - - git clone https://github.com/krakjoe/apcu - cd apcu - phpize - ./configure --with-php-config=/usr/local/php/bin/php-config - make - export TEST_PHP_ARGS='-n' - make test - make install - -Suggested Configuration (in your php.ini file) ----------------------------------------------- - extension=apcu.so - apc.enabled=1 - apc.shm_size=32M - apc.ttl=7200 - apc.enable_cli=1 - -These are fully described at the bottom of this file. - -+---------------------+ -| QUICK INSTALL (DSO) | -+---------------------+ - -These instructions assume your PHP installation is located in /usr/local/php and you -want Apache optimizations (--with-apxs). - -$ gunzip -c apcu_x.y.tar.gz | tar xf - -$ cd apcu_x.y -$ /path/to/phpize -$ ./configure [--with-php-config=/path/to/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="apcu.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 APCu, the installation was successful. - -+------------------------+ -| QUICK INSTALL (Static) | -+------------------------+ - -APCu 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 apcu_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 APCu. - -+-----------------+ -| 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 apcu_x.y.tar.gz. - Unzip this file with a command like - - gunzip apcu_x.y.tar.gz - - Next you have to untar it with - - tar xvf apcu_x.y.tar - - This will create an apcu_x.y directory. cd into this new directory: - - cd apcu_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-apcu [--with-php-config=/path/to/php-config] - -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="apcu.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: - - - - Request that file in a web browser. If there is an entry for APCu in the - list of installed modules, the installation was successful. - - If APCu is not listed, consult your web server error log. If it contains an - error message saying that it can't load the APCu extension, your system - might not be able to load shared libraries created with PHP's build - system. One alternative would be to compile APCu statically into PHP. See - the Quick Install (Static) instructions above. - - You should consult your error log anyway to see if APCu generated any - errors. On BSD-based platforms, it is typical for APCu to be unable to - allocate the default-sized shared memory segment. See below for hints on - raising your system's shared memory limitations. - - +------------------+ - | CONFIGURING APCu | - +------------------+ - - OPTION DESCRIPTION - ------------------ -------------------------------------------------- - apc.enabled This can be set to 0 to disable APCu. This is - primarily useful when APCu is statically compiled - into PHP, since there is no other way to disable - it (when compiled as a DSO, the extension - line can just be commented-out). - (Default: 1) - - apc.enable_cli Mostly for testing and debugging. Setting this enables APCu - for the CLI version of PHP. Normally you wouldn't want to - create, populate and tear down the APCu cache on every CLI - request, but for various test scenarios it is handy to be - able to enable APCu for the CLI version of APCu easily. - (Default: 0) - - apc.preload_path Sets the path to text files containing caches to load - from disk upon intiialization of APCu. - preload_path should be a directory where each file follows - $key.data - where $key should be used as the entry name and the contents - of the file contains serialized data to use as the value of - the entry. - (Default: null) - - 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. M/G suffixes must be used. - (Default: 32) - - apc.shm_segments The number of shared memory segments to allocate - for the compiler cache. If APCu 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.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.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.smart If you begin to get low on resources, an expunge of the cache - is performed if it is less than half full. This is not always - a suitable way of determining if an expunge of the cache - should be per - apc.smart allows you to set a runtime configuration value which - is used to determine if an expunge should be run - if (available_size < apc.smart * requested_size) - apc_cache_expunge() - (Default: 0) - - apc.entries_hint A "hint" about the number variables expected in the - cache. Set to zero or omit if you're not sure. - (Default: 4096) - - 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 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 data at the same time. - By default, APCu attempts to prevent "slamming" of a key. - A key is considered "slammed" if it was the last key set, - and a context other than the current one set it ( ie. it - was set by another process or thread ) - Note: - APCu does not store enough information to - catch every occurence, sufficient none the less. - (Default: 1) - - apc.serializer Defines which serializer should be used. Default is the - standard PHP serializer. Other can be used without having - to re compile apc, like igbinary for example. - (apc.serializer=igbinary) - - - /* The remaining entries concern file upload progress support */ - - - apc.rfc1867 RFC1867 File Upload Progress hook handler is only available - if you compiled APCu against PHP 5.2.0 or later. When enabled - any file uploads which includes a field called - APCu_UPLOAD_PROGRESS before the file field in an upload form - will cause APCu to automatically create an upload_ - user cache entry where is the value of the - APCu_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 APCu upload - progress and specifies the user cache key suffix. - (Default: "APCu_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) diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/LICENSE php5-easybib-apcu-4.0.7/apcu-4.0.6/LICENSE --- php5-easybib-apcu-4.0.6/apcu-4.0.6/LICENSE 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ --------------------------------------------------------------------- - The PHP License, version 3.01 -Copyright (c) 1999 - 2011 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 - ". - -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 . - -PHP includes the Zend Engine, freely available at -. diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/Makefile.frag php5-easybib-apcu-4.0.7/apcu-4.0.6/Makefile.frag --- php5-easybib-apcu-4.0.6/apcu-4.0.6/Makefile.frag 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/Makefile.frag 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -clean-coverage: - @rm -fr .coverage coverage - -coverage: test clean-coverage - @echo "Generating $@" - @$(LCOV) --directory . --capture --base-directory=. --output-file .coverage - @$(GENHTML) --legend --output-directory coverage/ --title "pecl/apc code coverage" .coverage - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/NOTICE php5-easybib-apcu-4.0.7/apcu-4.0.6/NOTICE --- php5-easybib-apcu-4.0.6/apcu-4.0.6/NOTICE 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/NOTICE 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/pgsql_s_lock.c php5-easybib-apcu-4.0.7/apcu-4.0.6/pgsql_s_lock.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/pgsql_s_lock.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/pgsql_s_lock.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,391 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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. | - +----------------------------------------------------------------------+ - | The following code was ported from the PostgreSQL project, please | - | see appropriate copyright notices that follow. | - | Initial conversion by Brian Shire | - +----------------------------------------------------------------------+ - - */ - -/* $Id: pgsql_s_lock.c 307048 2011-01-03 23:53:17Z kalle $ */ - -/*------------------------------------------------------------------------- - * - * s_lock.c - * Hardware-dependent implementation of spinlocks. - * - * - * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * - * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.47 2006/10/04 00:29:58 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -/* #include "postgres.h" -- Removed for APC */ - -/* -- Added for APC -- */ -#include "apc.h" -#ifdef APC_SPIN_LOCK - -#ifdef S_LOCK_TEST -#include -#endif -#ifndef WIN32 -#include -#endif -/* ---- */ - -#include -#ifdef WIN32 -#include "win32/unistd.h" -#else -#include -#endif - -/* #include "storage/s_lock.h" -- Removed for APC */ -#include "pgsql_s_lock.h" - -static int spins_per_delay = DEFAULT_SPINS_PER_DELAY; - - -/* -- APC specific additions ------------------------------*/ -/* The following dependencies have been copied from - * other pgsql source files. The original locations - * have been noted. - */ - -/* -- from include/c.h -- */ -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/* -- from include/pg_config_manual.h -- */ -#define MAX_RANDOM_VALUE (0x7FFFFFFF) - -/* - * Max - * Return the maximum of two numbers. - */ -#define Max(x, y) ((x) > (y) ? (x) : (y)) - -/* -- from include/c.h -- */ -/* - * Min - * Return the minimum of two numbers. - */ -#define Min(x, y) ((x) < (y) ? (x) : (y)) - - -/* -- from backend/port/win32/signal.c -- */ -/* - * pg_usleep --- delay the specified number of microseconds. - * - * NOTE: although the delay is specified in microseconds, the effective - * resolution is only 1/HZ, or 10 milliseconds, on most Unixen. Expect - * the requested delay to be rounded up to the next resolution boundary. - * - * On machines where "long" is 32 bits, the maximum delay is ~2000 seconds. - */ -void -pg_usleep(long microsec) -{ - if (microsec > 0) - { -#ifndef WIN32 - struct timeval delay; - - delay.tv_sec = microsec / 1000000L; - delay.tv_usec = microsec % 1000000L; - (void) select(0, NULL, NULL, NULL, &delay); -#else - SleepEx((microsec < 500 ? 1 : (microsec + 500) / 1000), FALSE); -#endif - } -} - -/* -- End APC specific additions ------------------------------*/ - - -/* - * s_lock_stuck() - complain about a stuck spinlock - */ -static void -s_lock_stuck(volatile slock_t *lock, const char *file, int line TSRMLS_DC) -{ -#if defined(S_LOCK_TEST) - fprintf(stderr, - "\nStuck spinlock (%p) detected at %s:%d.\n", - lock, file, line); - exit(1); -#else - /* -- Removed for APC - elog(PANIC, "stuck spinlock (%p) detected at %s:%d", - lock, file, line); - */ - apc_error("Stuck spinlock (%p) detected" TSRMLS_CC, lock); -#endif -} - - -/* - * s_lock(lock) - platform-independent portion of waiting for a spinlock. - */ -void -s_lock(volatile slock_t *lock, const char *file, int line TSRMLS_DC) -{ - /* - * We loop tightly for awhile, then delay using pg_usleep() and try again. - * Preferably, "awhile" should be a small multiple of the maximum time we - * expect a spinlock to be held. 100 iterations seems about right as an - * initial guess. However, on a uniprocessor the loop is a waste of - * cycles, while in a multi-CPU scenario it's usually better to spin a bit - * longer than to call the kernel, so we try to adapt the spin loop count - * depending on whether we seem to be in a uniprocessor or multiprocessor. - * - * Note: you might think MIN_SPINS_PER_DELAY should be just 1, but you'd - * be wrong; there are platforms where that can result in a "stuck - * spinlock" failure. This has been seen particularly on Alphas; it seems - * that the first TAS after returning from kernel space will always fail - * on that hardware. - * - * Once we do decide to block, we use randomly increasing pg_usleep() - * delays. The first delay is 1 msec, then the delay randomly increases to - * about one second, after which we reset to 1 msec and start again. The - * idea here is that in the presence of heavy contention we need to - * increase the delay, else the spinlock holder may never get to run and - * release the lock. (Consider situation where spinlock holder has been - * nice'd down in priority by the scheduler --- it will not get scheduled - * until all would-be acquirers are sleeping, so if we always use a 1-msec - * sleep, there is a real possibility of starvation.) But we can't just - * clamp the delay to an upper bound, else it would take a long time to - * make a reasonable number of tries. - * - * We time out and declare error after NUM_DELAYS delays (thus, exactly - * that many tries). With the given settings, this will usually take 2 or - * so minutes. It seems better to fix the total number of tries (and thus - * the probability of unintended failure) than to fix the total time - * spent. - * - * The pg_usleep() delays are measured in milliseconds because 1 msec is a - * common resolution limit at the OS level for newer platforms. On older - * platforms the resolution limit is usually 10 msec, in which case the - * total delay before timeout will be a bit more. - */ -#define MIN_SPINS_PER_DELAY 10 -#define MAX_SPINS_PER_DELAY 1000 -#define NUM_DELAYS 1000 -#define MIN_DELAY_MSEC 1 -#define MAX_DELAY_MSEC 1000 - - int spins = 0; - int delays = 0; - int cur_delay = 0; - - while (TAS(lock)) - { - /* CPU-specific delay each time through the loop */ - SPIN_DELAY(); - - /* Block the process every spins_per_delay tries */ - if (++spins >= spins_per_delay) - { - if (++delays > NUM_DELAYS) - s_lock_stuck(lock, file, line TSRMLS_CC); - - if (cur_delay == 0) /* first time to delay? */ - cur_delay = MIN_DELAY_MSEC; - - pg_usleep(cur_delay * 1000L); - -#if defined(S_LOCK_TEST) - fprintf(stdout, "*"); - fflush(stdout); -#endif - - /* increase delay by a random fraction between 1X and 2X */ - cur_delay += (int) (cur_delay * - ((double) rand() / (double) MAX_RANDOM_VALUE) + 0.5); - /* wrap back to minimum delay when max is exceeded */ - if (cur_delay > MAX_DELAY_MSEC) - cur_delay = MIN_DELAY_MSEC; - - spins = 0; - } - } - - /* - * If we were able to acquire the lock without delaying, it's a good - * indication we are in a multiprocessor. If we had to delay, it's a sign - * (but not a sure thing) that we are in a uniprocessor. Hence, we - * decrement spins_per_delay slowly when we had to delay, and increase it - * rapidly when we didn't. It's expected that spins_per_delay will - * converge to the minimum value on a uniprocessor and to the maximum - * value on a multiprocessor. - * - * Note: spins_per_delay is local within our current process. We want to - * average these observations across multiple backends, since it's - * relatively rare for this function to even get entered, and so a single - * backend might not live long enough to converge on a good value. That - * is handled by the two routines below. - */ - if (cur_delay == 0) - { - /* we never had to delay */ - if (spins_per_delay < MAX_SPINS_PER_DELAY) - spins_per_delay = Min(spins_per_delay + 100, MAX_SPINS_PER_DELAY); - } - else - { - if (spins_per_delay > MIN_SPINS_PER_DELAY) - spins_per_delay = Max(spins_per_delay - 1, MIN_SPINS_PER_DELAY); - } -} - - -#if 0 /* -- APC doesn't use the set_spins_per_delay or update_spins_per_delay -- */ -/* - * Set local copy of spins_per_delay during backend startup. - * - * NB: this has to be pretty fast as it is called while holding a spinlock - */ -void -set_spins_per_delay(int shared_spins_per_delay) -{ - spins_per_delay = shared_spins_per_delay; -} - -/* - * Update shared estimate of spins_per_delay during backend exit. - * - * NB: this has to be pretty fast as it is called while holding a spinlock - */ -int -update_spins_per_delay(int shared_spins_per_delay) -{ - /* - * We use an exponential moving average with a relatively slow adaption - * rate, so that noise in any one backend's result won't affect the shared - * value too much. As long as both inputs are within the allowed range, - * the result must be too, so we need not worry about clamping the result. - * - * We deliberately truncate rather than rounding; this is so that single - * adjustments inside a backend can affect the shared estimate (see the - * asymmetric adjustment rules above). - */ - return (shared_spins_per_delay * 15 + spins_per_delay) / 16; -} -#endif - -/* - * Various TAS implementations that cannot live in s_lock.h as no inline - * definition exists (yet). - * In the future, get rid of tas.[cso] and fold it into this file. - * - * If you change something here, you will likely need to modify s_lock.h too, - * because the definitions for these are split between this file and s_lock.h. - */ - - -#ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ - - -#if defined(__GNUC__) - -/* - * All the gcc flavors that are not inlined - */ - - -/* - * Note: all the if-tests here probably ought to be testing gcc version - * rather than platform, but I don't have adequate info to know what to - * write. Ideally we'd flush all this in favor of the inline version. - */ -#if defined(__m68k__) && !defined(__linux__) -/* really means: extern int tas(slock_t* **lock); */ -static void -tas_dummy() -{ - __asm__ __volatile__( -#if defined(__NetBSD__) && defined(__ELF__) -/* no underscore for label and % for registers */ - "\ -.global tas \n\ -tas: \n\ - movel %sp@(0x4),%a0 \n\ - tas %a0@ \n\ - beq _success \n\ - moveq #-128,%d0 \n\ - rts \n\ -_success: \n\ - moveq #0,%d0 \n\ - rts \n" -#else - "\ -.global _tas \n\ -_tas: \n\ - movel sp@(0x4),a0 \n\ - tas a0@ \n\ - beq _success \n\ - moveq #-128,d0 \n\ - rts \n\ -_success: \n\ - moveq #0,d0 \n\ - rts \n" -#endif /* __NetBSD__ && __ELF__ */ - ); -} -#endif /* __m68k__ && !__linux__ */ -#else /* not __GNUC__ */ - -/* - * All non gcc - */ - - -#if defined(sun3) -static void -tas_dummy() /* really means: extern int tas(slock_t - * *lock); */ -{ - asm("LLA0:"); - asm(" .data"); - asm(" .text"); - asm("|#PROC# 04"); - asm(" .globl _tas"); - asm("_tas:"); - asm("|#PROLOGUE# 1"); - asm(" movel sp@(0x4),a0"); - asm(" tas a0@"); - asm(" beq LLA1"); - asm(" moveq #-128,d0"); - asm(" rts"); - asm("LLA1:"); - asm(" moveq #0,d0"); - asm(" rts"); - asm(" .data"); -} -#endif /* sun3 */ -#endif /* not __GNUC__ */ -#endif /* HAVE_SPINLOCKS */ - -#endif /* APC_SPIN_LOCKS */ diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/pgsql_s_lock.h php5-easybib-apcu-4.0.7/apcu-4.0.6/pgsql_s_lock.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/pgsql_s_lock.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/pgsql_s_lock.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,929 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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. | - +----------------------------------------------------------------------+ - | The following code was ported from the PostgreSQL project, please | - | see appropriate copyright notices that follow. | - | Initial conversion by Brian Shire | - +----------------------------------------------------------------------+ - - */ - -/* $Id: pgsql_s_lock.h 307048 2011-01-03 23:53:17Z kalle $ */ - -/*------------------------------------------------------------------------- - * - * s_lock.h - * Hardware-dependent implementation of spinlocks. - * - * NOTE: none of the macros in this file are intended to be called directly. - * Call them through the hardware-independent macros in spin.h. - * - * The following hardware-dependent macros must be provided for each - * supported platform: - * - * void S_INIT_LOCK(slock_t *lock) - * Initialize a spinlock (to the unlocked state). - * - * void S_LOCK(slock_t *lock) - * Acquire a spinlock, waiting if necessary. - * Time out and abort() if unable to acquire the lock in a - * "reasonable" amount of time --- typically ~ 1 minute. - * - * void S_UNLOCK(slock_t *lock) - * Unlock a previously acquired lock. - * - * bool S_LOCK_FREE(slock_t *lock) - * Tests if the lock is free. Returns TRUE if free, FALSE if locked. - * This does *not* change the state of the lock. - * - * void SPIN_DELAY(void) - * Delay operation to occur inside spinlock wait loop. - * - * Note to implementors: there are default implementations for all these - * macros at the bottom of the file. Check if your platform can use - * these or needs to override them. - * - * Usually, S_LOCK() is implemented in terms of an even lower-level macro - * TAS(): - * - * int TAS(slock_t *lock) - * Atomic test-and-set instruction. Attempt to acquire the lock, - * but do *not* wait. Returns 0 if successful, nonzero if unable - * to acquire the lock. - * - * TAS() is NOT part of the API, and should never be called directly. - * - * CAUTION: on some platforms TAS() may sometimes report failure to acquire - * a lock even when the lock is not locked. For example, on Alpha TAS() - * will "fail" if interrupted. Therefore TAS() should always be invoked - * in a retry loop, even if you are certain the lock is free. - * - * ANOTHER CAUTION: be sure that TAS() and S_UNLOCK() represent sequence - * points, ie, loads and stores of other values must not be moved across - * a lock or unlock. In most cases it suffices to make the operation be - * done through a "volatile" pointer. - * - * On most supported platforms, TAS() uses a tas() function written - * in assembly language to execute a hardware atomic-test-and-set - * instruction. Equivalent OS-supplied mutex routines could be used too. - * - * If no system-specific TAS() is available (ie, HAVE_SPINLOCKS is not - * defined), then we fall back on an emulation that uses SysV semaphores - * (see spin.c). This emulation will be MUCH MUCH slower than a proper TAS() - * implementation, because of the cost of a kernel call per lock or unlock. - * An old report is that Postgres spends around 40% of its time in semop(2) - * when using the SysV semaphore code. - * - * - * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.157 2006/06/07 22:24:45 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef S_LOCK_H -#define S_LOCK_H - -/** APC namespace protection ************************************************/ -/* hack to protect against any possible runtime namespace collisions...*/ -#define pg_usleep apc_spin_pg_usleep -#define s_lock apc_spin_s_lock -#define spins_per_delay apc_spin_spins_per_delay -/****************************************************************************/ - - -/* #include "storage/pg_sema.h" -- Removed for APC */ - -#define HAVE_SPINLOCKS 1 /* -- Added for APC */ - -#ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ - - -#if defined(__GNUC__) || defined(__ICC) -/************************************************************************* - * All the gcc inlines - * Gcc consistently defines the CPU as __cpu__. - * Other compilers use __cpu or __cpu__ so we test for both in those cases. - */ - -/*---------- - * Standard gcc asm format (assuming "volatile slock_t *lock"): - - __asm__ __volatile__( - " instruction \n" - " instruction \n" - " instruction \n" -: "=r"(_res), "+m"(*lock) // return register, in/out lock value -: "r"(lock) // lock pointer, in input register -: "memory", "cc"); // show clobbered registers here - - * The output-operands list (after first colon) should always include - * "+m"(*lock), whether or not the asm code actually refers to this - * operand directly. This ensures that gcc believes the value in the - * lock variable is used and set by the asm code. Also, the clobbers - * list (after third colon) should always include "memory"; this prevents - * gcc from thinking it can cache the values of shared-memory fields - * across the asm code. Add "cc" if your asm code changes the condition - * code register, and also list any temp registers the code uses. - *---------- - */ - - -#ifdef __i386__ /* 32-bit i386 */ -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register slock_t _res = 1; - - /* - * Use a non-locking test before asserting the bus lock. Note that the - * extra test appears to be a small loss on some x86 platforms and a small - * win on others; it's by no means clear that we should keep it. - */ - __asm__ __volatile__( - " cmpb $0,%1 \n" - " jne 1f \n" - " lock \n" - " xchgb %0,%1 \n" - "1: \n" -: "+q"(_res), "+m"(*lock) -: -: "memory", "cc"); - return (int) _res; -} - -#define SPIN_DELAY() spin_delay() - -static __inline__ void -spin_delay(void) -{ - /* - * This sequence is equivalent to the PAUSE instruction ("rep" is - * ignored by old IA32 processors if the following instruction is - * not a string operation); the IA-32 Architecture Software - * Developer's Manual, Vol. 3, Section 7.7.2 describes why using - * PAUSE in the inner loop of a spin lock is necessary for good - * performance: - * - * The PAUSE instruction improves the performance of IA-32 - * processors supporting Hyper-Threading Technology when - * executing spin-wait loops and other routines where one - * thread is accessing a shared lock or semaphore in a tight - * polling loop. When executing a spin-wait loop, the - * processor can suffer a severe performance penalty when - * exiting the loop because it detects a possible memory order - * violation and flushes the core processor's pipeline. The - * PAUSE instruction provides a hint to the processor that the - * code sequence is a spin-wait loop. The processor uses this - * hint to avoid the memory order violation and prevent the - * pipeline flush. In addition, the PAUSE instruction - * de-pipelines the spin-wait loop to prevent it from - * consuming execution resources excessively. - */ - __asm__ __volatile__( - " rep; nop \n"); -} - -#endif /* __i386__ */ - - -#ifdef __x86_64__ /* AMD Opteron, Intel EM64T */ -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register slock_t _res = 1; - - /* - * On Opteron, using a non-locking test before the locking instruction - * is a huge loss. On EM64T, it appears to be a wash or small loss, - * so we needn't bother to try to distinguish the sub-architectures. - */ - __asm__ __volatile__( - " lock \n" - " xchgb %0,%1 \n" -: "+q"(_res), "+m"(*lock) -: -: "memory", "cc"); - return (int) _res; -} - -#define SPIN_DELAY() spin_delay() - -static __inline__ void -spin_delay(void) -{ - /* - * Adding a PAUSE in the spin delay loop is demonstrably a no-op on - * Opteron, but it may be of some use on EM64T, so we keep it. - */ - __asm__ __volatile__( - " rep; nop \n"); -} - -#endif /* __x86_64__ */ - - -#if defined(__ia64__) || defined(__ia64) /* Intel Itanium */ -#define HAS_TEST_AND_SET - -typedef unsigned int slock_t; - -#define TAS(lock) tas(lock) - -#ifndef __INTEL_COMPILER - -static __inline__ int -tas(volatile slock_t *lock) -{ - long int ret; - - __asm__ __volatile__( - " xchg4 %0=%1,%2 \n" -: "=r"(ret), "+m"(*lock) -: "r"(1) -: "memory"); - return (int) ret; -} - -#else /* __INTEL_COMPILER */ - -static __inline__ int -tas(volatile slock_t *lock) -{ - int ret; - - ret = _InterlockedExchange(lock,1); /* this is a xchg asm macro */ - - return ret; -} - -#endif /* __INTEL_COMPILER */ -#endif /* __ia64__ || __ia64 */ - - -#if defined(__arm__) || defined(__arm) -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register slock_t _res = 1; - - __asm__ __volatile__( - " swpb %0, %0, [%2] \n" -: "+r"(_res), "+m"(*lock) -: "r"(lock) -: "memory"); - return (int) _res; -} - -#endif /* __arm__ */ - - -/* S/390 and S/390x Linux (32- and 64-bit zSeries) */ -#if defined(__s390__) || defined(__s390x__) -#define HAS_TEST_AND_SET - -typedef unsigned int slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - int _res = 0; - - __asm__ __volatile__( - " cs %0,%3,0(%2) \n" -: "+d"(_res), "+m"(*lock) -: "a"(lock), "d"(1) -: "memory", "cc"); - return _res; -} - -#endif /* __s390__ || __s390x__ */ - - -#if defined(__sparc__) /* Sparc */ -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register slock_t _res; - - /* - * See comment in /pg/backend/port/tas/solaris_sparc.s for why this - * uses "ldstub", and that file uses "cas". gcc currently generates - * sparcv7-targeted binaries, so "cas" use isn't possible. - */ - __asm__ __volatile__( - " ldstub [%2], %0 \n" -: "=r"(_res), "+m"(*lock) -: "r"(lock) -: "memory"); - return (int) _res; -} - -#endif /* __sparc__ */ - - -/* PowerPC */ -#if defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__) || defined(__powerpc64__) -#define HAS_TEST_AND_SET - -#if defined(__ppc64__) || defined(__powerpc64__) -typedef unsigned long slock_t; -#else -typedef unsigned int slock_t; -#endif - -#define TAS(lock) tas(lock) -/* - * NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002, - * an isync is a sufficient synchronization barrier after a lwarx/stwcx loop. - */ -static __inline__ int -tas(volatile slock_t *lock) -{ - slock_t _t; - int _res; - - __asm__ __volatile__( -" lwarx %0,0,%3 \n" -" cmpwi %0,0 \n" -" bne 1f \n" -" addi %0,%0,1 \n" -" stwcx. %0,0,%3 \n" -" beq 2f \n" -"1: li %1,1 \n" -" b 3f \n" -"2: \n" -" isync \n" -" li %1,0 \n" -"3: \n" - -: "=&r"(_t), "=r"(_res), "+m"(*lock) -: "r"(lock) -: "memory", "cc"); - return _res; -} - -/* PowerPC S_UNLOCK is almost standard but requires a "sync" instruction */ -#define S_UNLOCK(lock) \ -do \ -{ \ - __asm__ __volatile__ (" sync \n"); \ - *((volatile slock_t *) (lock)) = 0; \ -} while (0) - -#endif /* powerpc */ - - -/* Linux Motorola 68k */ -#if (defined(__mc68000__) || defined(__m68k__)) && defined(__linux__) -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register int rv; - - __asm__ __volatile__( - " clrl %0 \n" - " tas %1 \n" - " sne %0 \n" -: "=d"(rv), "+m"(*lock) -: -: "memory", "cc"); - return rv; -} - -#endif /* (__mc68000__ || __m68k__) && __linux__ */ - - -/* - * VAXen -- even multiprocessor ones - * (thanks to Tom Ivar Helbekkmo) - */ -#if defined(__vax__) -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register int _res; - - __asm__ __volatile__( - " movl $1, %0 \n" - " bbssi $0, (%2), 1f \n" - " clrl %0 \n" - "1: \n" -: "=&r"(_res), "+m"(*lock) -: "r"(lock) -: "memory"); - return _res; -} - -#endif /* __vax__ */ - - -#if defined(__ns32k__) /* National Semiconductor 32K */ -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register int _res; - - __asm__ __volatile__( - " sbitb 0, %1 \n" - " sfsd %0 \n" -: "=r"(_res), "+m"(*lock) -: -: "memory"); - return _res; -} - -#endif /* __ns32k__ */ - - -#if defined(__alpha) || defined(__alpha__) /* Alpha */ -/* - * Correct multi-processor locking methods are explained in section 5.5.3 - * of the Alpha AXP Architecture Handbook, which at this writing can be - * found at ftp://ftp.netbsd.org/pub/NetBSD/misc/dec-docs/index.html. - * For gcc we implement the handbook's code directly with inline assembler. - */ -#define HAS_TEST_AND_SET - -typedef unsigned long slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register slock_t _res; - - __asm__ __volatile__( - " ldq $0, %1 \n" - " bne $0, 2f \n" - " ldq_l %0, %1 \n" - " bne %0, 2f \n" - " mov 1, $0 \n" - " stq_c $0, %1 \n" - " beq $0, 2f \n" - " mb \n" - " br 3f \n" - "2: mov 1, %0 \n" - "3: \n" -: "=&r"(_res), "+m"(*lock) -: -: "memory", "0"); - return (int) _res; -} - -#define S_UNLOCK(lock) \ -do \ -{\ - __asm__ __volatile__ (" mb \n"); \ - *((volatile slock_t *) (lock)) = 0; \ -} while (0) - -#endif /* __alpha || __alpha__ */ - - -#if defined(__mips__) && !defined(__sgi) /* non-SGI MIPS */ -/* Note: on SGI we use the OS' mutex ABI, see below */ -/* Note: R10000 processors require a separate SYNC */ -#define HAS_TEST_AND_SET - -typedef unsigned int slock_t; - -#define TAS(lock) tas(lock) - -static __inline__ int -tas(volatile slock_t *lock) -{ - register volatile slock_t *_l = lock; - register int _res; - register int _tmp; - - __asm__ __volatile__( - " .set push \n" - " .set mips2 \n" - " .set noreorder \n" - " .set nomacro \n" - " ll %0, %2 \n" - " or %1, %0, 1 \n" - " sc %1, %2 \n" - " xori %1, 1 \n" - " or %0, %0, %1 \n" - " sync \n" - " .set pop " -: "=&r" (_res), "=&r" (_tmp), "+R" (*_l) -: -: "memory"); - return _res; -} - -/* MIPS S_UNLOCK is almost standard but requires a "sync" instruction */ -#define S_UNLOCK(lock) \ -do \ -{ \ - __asm__ __volatile__( \ - " .set push \n" \ - " .set mips2 \n" \ - " .set noreorder \n" \ - " .set nomacro \n" \ - " sync \n" \ - " .set pop "); \ - *((volatile slock_t *) (lock)) = 0; \ -} while (0) - -#endif /* __mips__ && !__sgi */ - - -/* These live in s_lock.c, but only for gcc */ - - -#if defined(__m68k__) && !defined(__linux__) /* non-Linux Motorola 68k */ -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; -#endif - - -#endif /* __GNUC__ */ - - - -/* - * --------------------------------------------------------------------- - * Platforms that use non-gcc inline assembly: - * --------------------------------------------------------------------- - */ - -#if !defined(HAS_TEST_AND_SET) /* We didn't trigger above, let's try here */ - - -#if defined(USE_UNIVEL_CC) /* Unixware compiler */ -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; - -#define TAS(lock) tas(lock) - -asm int -tas(volatile slock_t *s_lock) -{ -/* UNIVEL wants %mem in column 1, so we don't pg_indent this file */ -%mem s_lock - pushl %ebx - movl s_lock, %ebx - movl $255, %eax - lock - xchgb %al, (%ebx) - popl %ebx -} - -#endif /* defined(USE_UNIVEL_CC) */ - - -#if defined(__alpha) || defined(__alpha__) /* Tru64 Unix Alpha compiler */ -/* - * The Tru64 compiler doesn't support gcc-style inline asm, but it does - * have some builtin functions that accomplish much the same results. - * For simplicity, slock_t is defined as long (ie, quadword) on Alpha - * regardless of the compiler in use. LOCK_LONG and UNLOCK_LONG only - * operate on an int (ie, longword), but that's OK as long as we define - * S_INIT_LOCK to zero out the whole quadword. - */ -#define HAS_TEST_AND_SET - -typedef unsigned long slock_t; - -#include -#define S_INIT_LOCK(lock) (*(lock) = 0) -#define TAS(lock) (__LOCK_LONG_RETRY((lock), 1) == 0) -#define S_UNLOCK(lock) __UNLOCK_LONG(lock) - -#endif /* __alpha || __alpha__ */ - - -#if defined(__hppa) || defined(__hppa__) /* HP PA-RISC, GCC and HP compilers */ -/* - * HP's PA-RISC - * - * See src/backend/port/hpux/tas.c.template for details about LDCWX. Because - * LDCWX requires a 16-byte-aligned address, we declare slock_t as a 16-byte - * struct. The active word in the struct is whichever has the aligned address; - * the other three words just sit at -1. - * - * When using gcc, we can inline the required assembly code. - */ -#define HAS_TEST_AND_SET - -typedef struct -{ - int sema[4]; -} slock_t; - -#define TAS_ACTIVE_WORD(lock) ((volatile int *) (((long) (lock) + 15) & ~15)) - -#if defined(__GNUC__) - -static __inline__ int -tas(volatile slock_t *lock) -{ - volatile int *lockword = TAS_ACTIVE_WORD(lock); - register int lockval; - - __asm__ __volatile__( - " ldcwx 0(0,%2),%0 \n" -: "=r"(lockval), "+m"(*lockword) -: "r"(lockword) -: "memory"); - return (lockval == 0); -} - -#endif /* __GNUC__ */ - -#define S_UNLOCK(lock) (*TAS_ACTIVE_WORD(lock) = -1) - -#define S_INIT_LOCK(lock) \ - do { \ - volatile slock_t *lock_ = (lock); \ - lock_->sema[0] = -1; \ - lock_->sema[1] = -1; \ - lock_->sema[2] = -1; \ - lock_->sema[3] = -1; \ - } while (0) - -#define S_LOCK_FREE(lock) (*TAS_ACTIVE_WORD(lock) != 0) - -#endif /* __hppa || __hppa__ */ - - -#if defined(__hpux) && defined(__ia64) && !defined(__GNUC__) - -#define HAS_TEST_AND_SET - -typedef unsigned int slock_t; - -#include -#define TAS(lock) _Asm_xchg(_SZ_W, lock, 1, _LDHINT_NONE) - -#endif /* HPUX on IA64, non gcc */ - - -#if defined(__sgi) /* SGI compiler */ -/* - * SGI IRIX 5 - * slock_t is defined as a unsigned long. We use the standard SGI - * mutex API. - * - * The following comment is left for historical reasons, but is probably - * not a good idea since the mutex ABI is supported. - * - * This stuff may be supplemented in the future with Masato Kataoka's MIPS-II - * assembly from his NECEWS SVR4 port, but we probably ought to retain this - * for the R3000 chips out there. - */ -#define HAS_TEST_AND_SET - -typedef unsigned long slock_t; - -#include "mutex.h" -#define TAS(lock) (test_and_set(lock,1)) -#define S_UNLOCK(lock) (test_then_and(lock,0)) -#define S_INIT_LOCK(lock) (test_then_and(lock,0)) -#define S_LOCK_FREE(lock) (test_then_add(lock,0) == 0) -#endif /* __sgi */ - - -#if defined(sinix) /* Sinix */ -/* - * SINIX / Reliant UNIX - * slock_t is defined as a struct abilock_t, which has a single unsigned long - * member. (Basically same as SGI) - */ -#define HAS_TEST_AND_SET - -#include "abi_mutex.h" -typedef abilock_t slock_t; - -#define TAS(lock) (!acquire_lock(lock)) -#define S_UNLOCK(lock) release_lock(lock) -#define S_INIT_LOCK(lock) init_lock(lock) -#define S_LOCK_FREE(lock) (stat_lock(lock) == UNLOCKED) -#endif /* sinix */ - - -#if defined(_AIX) /* AIX */ -/* - * AIX (POWER) - */ -#define HAS_TEST_AND_SET - -typedef unsigned int slock_t; - -#define TAS(lock) _check_lock(lock, 0, 1) -#define S_UNLOCK(lock) _clear_lock(lock, 0) -#endif /* _AIX */ - - -#if defined (nextstep) /* Nextstep */ -#define HAS_TEST_AND_SET - -typedef struct mutex slock_t; - -#define APC_SLOCK_NONBLOCKING_LOCK_AVAILABLE 0 /* -- APC: non-blocking lock not available in this case -- */ - -#define S_LOCK(lock) mutex_lock(lock) -#define S_UNLOCK(lock) mutex_unlock(lock) -#define S_INIT_LOCK(lock) mutex_init(lock) -/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */ -#define S_LOCK_FREE(alock) ((alock)->lock == 0) -#endif /* nextstep */ - - -/* These are in s_lock.c */ - - -#if defined(sun3) /* Sun3 */ -#define HAS_TEST_AND_SET - -typedef unsigned char slock_t; -#endif - - -#if defined(__sun) && (defined(__i386) || defined(__x86_64__) || defined(__sparc__) || defined(__sparc)) -#define HAS_TEST_AND_SET - -#if defined(__i386) || defined(__x86_64__) || defined(__sparcv9) || defined(__sparcv8plus) -typedef unsigned int slock_t; -#else -typedef unsigned char slock_t; -#endif - -extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with, - slock_t cmp); - -#define TAS(a) (pg_atomic_cas((a), 1, 0) != 0) -#endif - - -#ifdef WIN32_ONLY_COMPILER -typedef LONG slock_t; - -#define HAS_TEST_AND_SET -#define TAS(lock) (InterlockedCompareExchange(lock, 1, 0)) - -#define SPIN_DELAY() spin_delay() - -static __forceinline void -spin_delay(void) -{ - /* See comment for gcc code. Same code, MASM syntax */ - __asm rep nop; -} - -#endif - - -#endif /* !defined(HAS_TEST_AND_SET) */ - - -/* Blow up if we didn't have any way to do spinlocks */ -#ifndef HAS_TEST_AND_SET -/* -- APC: We have better options in APC than this, that should be specified explicitly so just fail out and notify the user -- */ -#error Spin locking is not available on your platform, please select another locking method (see ./configure --help). -/* #error PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. -However, performance will be poor. Please report this to pgsql-bugs@postgresql.org. */ -#endif - - -#else /* !HAVE_SPINLOCKS */ - - -/* - * Fake spinlock implementation using semaphores --- slow and prone - * to fall foul of kernel limits on number of semaphores, so don't use this - * unless you must! The subroutines appear in spin.c. - */ - -/* -- Removed for APC -typedef PGSemaphoreData slock_t; - -extern bool s_lock_free_sema(volatile slock_t *lock); -extern void s_unlock_sema(volatile slock_t *lock); -extern void s_init_lock_sema(volatile slock_t *lock); -extern int tas_sema(volatile slock_t *lock); - -#define S_LOCK_FREE(lock) s_lock_free_sema(lock) -#define S_UNLOCK(lock) s_unlock_sema(lock) -#define S_INIT_LOCK(lock) s_init_lock_sema(lock) -#define TAS(lock) tas_sema(lock) -*/ - -#endif /* HAVE_SPINLOCKS */ - - -/* - * Default Definitions - override these above as needed. - */ - -#define APC_SLOCK_NONBLOCKING_LOCK_AVAILABLE 1 /* -- APC: Non-blocking lock available for this case -- */ - -#if !defined(S_LOCK) -#define S_LOCK(lock) \ - do { \ - if (TAS(lock)) \ - s_lock((lock), __FILE__, __LINE__ TSRMLS_CC); \ - } while (0) -#endif /* S_LOCK */ - -#if !defined(S_LOCK_FREE) -#define S_LOCK_FREE(lock) (*(lock) == 0) -#endif /* S_LOCK_FREE */ - -#if !defined(S_UNLOCK) -#define S_UNLOCK(lock) (*((volatile slock_t *) (lock)) = 0) -#endif /* S_UNLOCK */ - -#if !defined(S_INIT_LOCK) -#define S_INIT_LOCK(lock) S_UNLOCK(lock) -#endif /* S_INIT_LOCK */ - -#if !defined(SPIN_DELAY) -#define SPIN_DELAY() ((void) 0) -#endif /* SPIN_DELAY */ - -#if !defined(TAS) -extern int tas(volatile slock_t *lock); /* in port/.../tas.s, or - * s_lock.c */ - -#define TAS(lock) tas(lock) -#endif /* TAS */ - - -/* - * Platform-independent out-of-line support routines - */ -extern void s_lock(volatile slock_t *lock, const char *file, int line TSRMLS_DC); - -/* Support for dynamic adjustment of spins_per_delay */ -#define DEFAULT_SPINS_PER_DELAY 100 - -#if 0 /* -- Removed from APC use -- */ -extern void set_spins_per_delay(int shared_spins_per_delay); -extern int update_spins_per_delay(int shared_spins_per_delay); -#endif - -#endif /* S_LOCK_H */ diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/php_apc.c php5-easybib-apcu-4.0.7/apcu-4.0.6/php_apc.c --- php5-easybib-apcu-4.0.6/apcu-4.0.6/php_apc.c 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/php_apc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1586 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | 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. - - */ - -/* $Id: php_apc.c 328290 2012-11-09 03:30:09Z laruence $ */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "apc_cache.h" -#include "apc_iterator.h" -#include "apc_sma.h" -#include "apc_lock.h" -#include "apc_bin.h" -#include "php_globals.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/standard/file.h" -#include "ext/standard/flock_compat.h" -#include "ext/standard/md5.h" -#include "ext/standard/php_var.h" - -#ifdef HAVE_SYS_FILE_H -#include -#endif - -#include "SAPI.h" -#include "rfc1867.h" -#include "php_apc.h" - -#if HAVE_SIGACTION -#include "apc_signal.h" -#endif - -/* {{{ PHP_FUNCTION declarations */ -PHP_FUNCTION(apcu_cache_info); -PHP_FUNCTION(apcu_clear_cache); -PHP_FUNCTION(apcu_sma_info); -PHP_FUNCTION(apcu_key_info); -PHP_FUNCTION(apcu_store); -PHP_FUNCTION(apcu_fetch); -PHP_FUNCTION(apcu_delete); -PHP_FUNCTION(apcu_add); -PHP_FUNCTION(apcu_inc); -PHP_FUNCTION(apcu_dec); -PHP_FUNCTION(apcu_cas); -PHP_FUNCTION(apcu_exists); - -PHP_FUNCTION(apcu_bin_dump); -PHP_FUNCTION(apcu_bin_load); -PHP_FUNCTION(apcu_bin_dumpfile); -PHP_FUNCTION(apcu_bin_loadfile); - -#ifdef APC_FULL_BC -PHP_FUNCTION(apc_bin_dumpfile); -PHP_FUNCTION(apc_bin_dump); -#endif -/* }}} */ - -/* {{{ ZEND_DECLARE_MODULE_GLOBALS(apcu) */ -ZEND_DECLARE_MODULE_GLOBALS(apcu) - -/* True globals */ -apc_cache_t* apc_user_cache = NULL; - -/* External APC SMA */ -apc_sma_api_extern(apc_sma); - -/* Global init functions */ -static void php_apc_init_globals(zend_apcu_globals* apcu_globals TSRMLS_DC) -{ - apcu_globals->initialized = 0; - apcu_globals->slam_defense = 1; - apcu_globals->smart = 0; - -#ifdef MULTIPART_EVENT_FORMDATA - apcu_globals->rfc1867 = 0; - memset(&(apcu_globals->rfc1867_data), 0, sizeof(apc_rfc1867_data)); -#endif - - apcu_globals->preload_path = NULL; - apcu_globals->coredump_unmap = 0; - apcu_globals->use_request_time = 1; - apcu_globals->serializer_name = NULL; -} -/* }}} */ - -/* {{{ PHP_INI */ - -static PHP_INI_MH(OnUpdateShmSegments) /* {{{ */ -{ -#if APC_MMAP - if (zend_atoi(new_value, new_value_length)!=1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "apc.shm_segments setting ignored in MMAP mode"); - } - APCG(shm_segments) = 1; -#else - APCG(shm_segments) = zend_atoi(new_value, new_value_length); -#endif - return SUCCESS; -} -/* }}} */ - -static PHP_INI_MH(OnUpdateShmSize) /* {{{ */ -{ - long s = zend_atol(new_value, new_value_length); - - if (s <= 0) { - return FAILURE; - } - - if (s < 1048576L) { - /* if it's less than 1Mb, they are probably using the old syntax */ - php_error_docref( - NULL TSRMLS_CC, E_WARNING, "apc.shm_size now uses M/G suffixes, please update your ini files"); - s = s * 1048576L; - } - - APCG(shm_size) = s; - - return SUCCESS; -} -/* }}} */ - -#ifdef MULTIPART_EVENT_FORMDATA -static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */ -{ - int tmp; - tmp = zend_atoi(new_value, new_value_length); - if (tmp < 0) { - apc_error("rfc1867_freq must be greater than or equal to zero." TSRMLS_CC); - return FAILURE; - } - if (new_value[new_value_length-1] == '%') { - if (tmp > 100) { - apc_error("rfc1867_freq cannot be over 100%%" TSRMLS_CC); - return FAILURE; - } - APCG(rfc1867_freq) = tmp / 100.0; - } else { - APCG(rfc1867_freq) = tmp; - } - return SUCCESS; -} -/* }}} */ -#endif - -PHP_INI_BEGIN() -STD_PHP_INI_BOOLEAN("apc.enabled", "1", PHP_INI_SYSTEM, OnUpdateBool, enabled, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.shm_segments", "1", PHP_INI_SYSTEM, OnUpdateShmSegments, shm_segments, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.shm_size", "32M", PHP_INI_SYSTEM, OnUpdateShmSize, shm_size, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.entries_hint", "4096", PHP_INI_SYSTEM, OnUpdateLong, entries_hint, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.gc_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, gc_ttl, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.ttl", "0", PHP_INI_SYSTEM, OnUpdateLong, ttl, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.smart", "0", PHP_INI_SYSTEM, OnUpdateLong, smart, zend_apcu_globals, apcu_globals) -#if APC_MMAP -STD_PHP_INI_ENTRY("apc.mmap_file_mask", NULL, PHP_INI_SYSTEM, OnUpdateString, mmap_file_mask, zend_apcu_globals, apcu_globals) -#endif -STD_PHP_INI_BOOLEAN("apc.enable_cli", "0", PHP_INI_SYSTEM, OnUpdateBool, enable_cli, zend_apcu_globals, apcu_globals) -STD_PHP_INI_BOOLEAN("apc.slam_defense", "1", PHP_INI_SYSTEM, OnUpdateBool, slam_defense, zend_apcu_globals, apcu_globals) -#ifdef MULTIPART_EVENT_FORMDATA -STD_PHP_INI_BOOLEAN("apc.rfc1867", "0", PHP_INI_SYSTEM, OnUpdateBool, rfc1867, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.rfc1867_prefix", "upload_", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_prefix, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.rfc1867_name", "APC_UPLOAD_PROGRESS", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_name, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.rfc1867_freq", "0", PHP_INI_SYSTEM, OnUpdateRfc1867Freq, rfc1867_freq, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.rfc1867_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, rfc1867_ttl, zend_apcu_globals, apcu_globals) -#endif -STD_PHP_INI_ENTRY("apc.preload_path", (char*)NULL, PHP_INI_SYSTEM, OnUpdateString, preload_path, zend_apcu_globals, apcu_globals) -STD_PHP_INI_BOOLEAN("apc.coredump_unmap", "0", PHP_INI_SYSTEM, OnUpdateBool, coredump_unmap, zend_apcu_globals, apcu_globals) -STD_PHP_INI_BOOLEAN("apc.use_request_time", "1", PHP_INI_ALL, OnUpdateBool, use_request_time, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.serializer", "php", PHP_INI_SYSTEM, OnUpdateStringUnempty, serializer_name, zend_apcu_globals, apcu_globals) -STD_PHP_INI_ENTRY("apc.writable", "/tmp", PHP_INI_SYSTEM, OnUpdateStringUnempty, writable, zend_apcu_globals, apcu_globals) -PHP_INI_END() - -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION(apcu) */ -static PHP_MINFO_FUNCTION(apcu) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "APCu Support", APCG(enabled) ? "Enabled" : "Disabled"); - php_info_print_table_row(2, "Version", PHP_APCU_VERSION); -#ifdef APC_DEBUG - php_info_print_table_row(2, "APCu Debugging", "Enabled"); -#else - php_info_print_table_row(2, "APCu Debugging", "Disabled"); -#endif -#if APC_MMAP - php_info_print_table_row(2, "MMAP Support", "Enabled"); - php_info_print_table_row(2, "MMAP File Mask", APCG(mmap_file_mask)); -#else - php_info_print_table_row(2, "MMAP Support", "Disabled"); -#endif - - if (APCG(enabled)) { - apc_serializer_t *serializer = NULL; - smart_str names = {0,}; - int i; - - for( i = 0, serializer = apc_get_serializers(TSRMLS_C); - serializer->name != NULL; - serializer++, i++) { - if (i != 0) { - smart_str_appends(&names, ", "); - } - smart_str_appends(&names, serializer->name); - } - - if (names.c) { - smart_str_0(&names); - php_info_print_table_row(2, "Serialization Support", names.c); - smart_str_free(&names); - } else { - php_info_print_table_row(2, "Serialization Support", "Broken"); - } - } else { - php_info_print_table_row(2, "Serialization Support", "Disabled"); - } - - php_info_print_table_row(2, "Revision", "$Revision: 328290 $"); - php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__); - php_info_print_table_end(); - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -#ifdef MULTIPART_EVENT_FORMDATA -extern int apc_rfc1867_progress(unsigned int event, void *event_data, void **extra TSRMLS_DC); -#endif - -#ifdef APC_FULL_BC -static void apc_init(INIT_FUNC_ARGS); -#endif - -/* {{{ PHP_MINIT_FUNCTION(apcu) */ -static PHP_MINIT_FUNCTION(apcu) -{ - ZEND_INIT_MODULE_GLOBALS(apcu, php_apc_init_globals, NULL); - - REGISTER_INI_ENTRIES(); - - /* locks initialized regardless of settings */ - apc_lock_init(TSRMLS_C); - - /* Disable APC in cli mode unless overridden by apc.enable_cli */ - if (!APCG(enable_cli) && !strcmp(sapi_module.name, "cli")) { - APCG(enabled) = 0; - } - - /* only run initialization if APC is enabled */ - if (APCG(enabled)) { - - if (!APCG(initialized)) { - /* ensure this runs only once */ - APCG(initialized) = 1; - - /* initialize shared memory allocator */ -#if APC_MMAP - apc_sma.init(APCG(shm_segments), APCG(shm_size), APCG(mmap_file_mask) TSRMLS_CC); -#else - apc_sma.init(APCG(shm_segments), APCG(shm_size), NULL TSRMLS_CC); -#endif - -/* XXX pack this into macros when there are more hooks to handle */ -#if defined(PHP_WIN32) && defined(_WIN64) - do { - char buf[65]; - - if (!_i64toa_s((__int64)_apc_register_serializer, buf, 65, 10)) { - REGISTER_STRING_CONSTANT(APC_SERIALIZER_CONSTANT, buf, CONST_PERSISTENT | CONST_CS); - } else { - /* subsequent apc_register_serializer() calls will be void */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serializer hook init failed"); - } - } while (0); -#else - REGISTER_LONG_CONSTANT(APC_SERIALIZER_CONSTANT, (long)&_apc_register_serializer, CONST_PERSISTENT | CONST_CS); -#endif - - /* register default serializer */ - _apc_register_serializer( - "php", APC_SERIALIZER_NAME(php), APC_UNSERIALIZER_NAME(php), NULL TSRMLS_CC); - - /* test out the constant function pointer */ - assert(apc_get_serializers(TSRMLS_C)->name != NULL); - - /* create user cache */ - apc_user_cache = apc_cache_create( - &apc_sma, - apc_find_serializer(APCG(serializer_name) TSRMLS_CC), - APCG(entries_hint), APCG(gc_ttl), APCG(ttl), APCG(smart), APCG(slam_defense) - TSRMLS_CC - ); - - /* initialize pooling */ - apc_pool_init(); - - /* preload data from path specified in configuration */ - if (APCG(preload_path)) { - apc_cache_preload( - apc_user_cache, APCG(preload_path) TSRMLS_CC); - } - -#ifdef MULTIPART_EVENT_FORMDATA - /* File upload progress tracking */ - if (APCG(rfc1867)) { - php_rfc1867_callback = apc_rfc1867_progress; - } -#endif - - /* initialize iterator object */ - apc_iterator_init(module_number TSRMLS_CC); - } - - REGISTER_LONG_CONSTANT("APC_BIN_VERIFY_MD5", APC_BIN_VERIFY_MD5, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("APC_BIN_VERIFY_CRC32", APC_BIN_VERIFY_CRC32, CONST_CS | CONST_PERSISTENT); - } - -#ifndef REGISTER_BOOL_CONSTANT - { - zend_constant apc_bc; - Z_TYPE(apc_bc.value) = IS_BOOL; -#if defined(APC_FULL_BC) && APC_FULL_BC - Z_LVAL(apc_bc.value) = 1; -#else - Z_LVAL(apc_bc.value) = 0; -#endif - apc_bc.flags = (CONST_CS | CONST_PERSISTENT); - apc_bc.name = zend_strndup(ZEND_STRL("APCU_APC_FULL_BC")); - apc_bc.name_len = sizeof("APCU_APC_FULL_BC"); - apc_bc.module_number = module_number; - zend_register_constant(&apc_bc TSRMLS_CC); - } -#else -#if defined(APC_FULL_BC) && APC_FULL_BC - REGISTER_BOOL_CONSTANT("APCU_APC_FULL_BC", 1, CONST_CS | CONST_PERSISTENT); -#else - REGISTER_BOOL_CONSTANT("APCU_APC_FULL_BC", 0, CONST_CS | CONST_PERSISTENT); -#endif -#endif - -#ifdef APC_FULL_BC - apc_init(INIT_FUNC_ARGS_PASSTHRU); -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION(apcu) */ -static PHP_MSHUTDOWN_FUNCTION(apcu) -{ - /* locks shutdown regardless of settings */ - apc_lock_cleanup(TSRMLS_C); - - /* only shut down if APC is enabled */ - if (APCG(enabled)) { - if (APCG(initialized)) { - - /* destroy cache pointer */ - apc_cache_destroy(apc_user_cache TSRMLS_CC); - /* cleanup shared memory */ - apc_sma.cleanup(TSRMLS_C); - - APCG(initialized) = 0; - } - -#if HAVE_SIGACTION - apc_shutdown_signals(TSRMLS_C); -#endif - } - -#ifdef ZTS - ts_free_id(apcu_globals_id); -#endif - - UNREGISTER_INI_ENTRIES(); - return SUCCESS; -} /* }}} */ - -/* {{{ PHP_RINIT_FUNCTION(apcu) */ -static PHP_RINIT_FUNCTION(apcu) -{ - if (APCG(enabled)) { - if (APCG(serializer_name)) { - /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ - apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC); - } - -#if HAVE_SIGACTION - apc_set_signals(TSRMLS_C); -#endif - } - return SUCCESS; -} -/* }}} */ - -#ifdef APC_FULL_BC -/* {{{ proto void apc_clear_cache([string cache]) */ -PHP_FUNCTION(apcu_clear_cache) -{ - char *ignored; - int ignlen = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ignored, &ignlen) == FAILURE) { - return; - } - - if (0 == ignlen || APC_CACHE_IS_USER(ignored, ignlen)) { - apc_cache_clear(apc_user_cache TSRMLS_CC); - } - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array apc_cache_info(string cache_type, [bool limited]) */ -PHP_FUNCTION(apcu_cache_info) -{ - zval* info; - zend_bool limited = 0; - char *ct; - ulong ctlen; - - if (ZEND_NUM_ARGS()) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &ct, &ctlen, &limited) == FAILURE) { - return; - } - } - - info = apc_cache_info(apc_user_cache, limited TSRMLS_CC); - - if (!info) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file"); - RETURN_FALSE; - } - - RETURN_ZVAL(info, 0, 1); - -} -/* }}} */ -#else -/* {{{ proto void apc_clear_cache() */ -PHP_FUNCTION(apcu_clear_cache) -{ - if (zend_parse_parameters_none() == FAILURE) { - return; - } - - apc_cache_clear( - apc_user_cache TSRMLS_CC); - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto array apc_cache_info([bool limited]) */ -PHP_FUNCTION(apcu_cache_info) -{ - zval* info; - zend_bool limited = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &limited) == FAILURE) { - return; - } - - info = apc_cache_info(apc_user_cache, limited TSRMLS_CC); - - if (!info) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file"); - RETURN_FALSE; - } - - RETURN_ZVAL(info, 0, 1); - -} -/* }}} */ -#endif - -PHP_FUNCTION(apcu_key_info) -{ - zval *stat; - char *strkey; - zend_uint keylen; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &strkey, &keylen) == FAILURE) { - return; - } - - stat = apc_cache_stat( - apc_user_cache, strkey, keylen+1 TSRMLS_CC); - - RETURN_ZVAL(stat, 0, 1); -} - -/* {{{ proto array apc_sma_info([bool limited]) */ -PHP_FUNCTION(apcu_sma_info) -{ - apc_sma_info_t* info; - zval* block_lists; - int i; - zend_bool limited = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &limited) == FAILURE) { - return; - } - - info = apc_sma.info(limited TSRMLS_CC); - - if (!info) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC SMA info available. Perhaps APC is disabled via apc.enabled?"); - RETURN_FALSE; - } - array_init(return_value); - - add_assoc_long(return_value, "num_seg", info->num_seg); - add_assoc_double(return_value, "seg_size", (double)info->seg_size); - add_assoc_double(return_value, "avail_mem", (double)apc_sma.get_avail_mem()); - - if (limited) { - apc_sma.free_info(info TSRMLS_CC); - return; - } - - ALLOC_INIT_ZVAL(block_lists); - array_init(block_lists); - - for (i = 0; i < info->num_seg; i++) { - apc_sma_link_t* p; - zval* list; - - ALLOC_INIT_ZVAL(list); - array_init(list); - - for (p = info->list[i]; p != NULL; p = p->next) { - zval* link; - - ALLOC_INIT_ZVAL(link); - array_init(link); - - add_assoc_long(link, "size", p->size); - add_assoc_long(link, "offset", p->offset); - add_next_index_zval(list, link); - } - add_next_index_zval(block_lists, list); - } - add_assoc_zval(return_value, "block_lists", block_lists); - apc_sma.free_info(info TSRMLS_CC); -} -/* }}} */ - -/* {{{ php_apc_update */ -int php_apc_update(char *strkey, int strkey_len, apc_cache_updater_t updater, void* data TSRMLS_DC) -{ - if (!APCG(enabled)) { - return 0; - } - - if (APCG(serializer_name)) { - /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ - apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC); - } - - HANDLE_BLOCK_INTERRUPTIONS(); - - if (!apc_cache_update(apc_user_cache, strkey, strkey_len + 1, updater, data TSRMLS_CC)) { - HANDLE_UNBLOCK_INTERRUPTIONS(); - return 0; - } - - HANDLE_UNBLOCK_INTERRUPTIONS(); - - return 1; -} -/* }}} */ - -/* {{{ apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const zend_bool exclusive) - */ -static void apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const zend_bool exclusive) -{ - zval *key = NULL; - zval *val = NULL; - long ttl = 0L; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zl", &key, &val, &ttl) == FAILURE) { - return; - } - - if (!key || !APCG(enabled)) { - /* cannot work without key */ - RETURN_FALSE; - } - - HANDLE_BLOCK_INTERRUPTIONS(); - - /* keep it tidy */ - { - if (APCG(serializer_name)) { - /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ - apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC); - } - - if (Z_TYPE_P(key) == IS_ARRAY) { - - zval **hentry; - char *hkey = NULL; - zend_uint hkey_len; - zend_ulong hkey_idx; - - HashPosition hpos; - HashTable* hash = Z_ARRVAL_P(key); - - /* note: only indicative of error */ - array_init(return_value); - zend_hash_internal_pointer_reset_ex(hash, &hpos); - while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) { - zend_hash_get_current_key_ex(hash, &hkey, &hkey_len, &hkey_idx, 0, &hpos); - if (hkey) { - if(!apc_cache_store(apc_user_cache, hkey, hkey_len, *hentry, (zend_uint) ttl, exclusive TSRMLS_CC)) { - add_assoc_long_ex(return_value, hkey, hkey_len, -1); /* -1: insertion error */ - } - /* reset key for next element */ - hkey = NULL; - } else { - add_index_long(return_value, hkey_idx, -1); /* -1: insertion error */ - } - zend_hash_move_forward_ex(hash, &hpos); - } - return; - } else { - if (Z_TYPE_P(key) == IS_STRING) { - if (!val) { - /* nothing to store */ - HANDLE_UNBLOCK_INTERRUPTIONS(); - RETURN_FALSE; - } - /* return true on success */ - if(apc_cache_store(apc_user_cache, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, val, (zend_uint) ttl, exclusive TSRMLS_CC)) { - HANDLE_UNBLOCK_INTERRUPTIONS(); - RETURN_TRUE; - } - } else { - apc_warning("apc_store expects key parameter to be a string or an array of key/value pairs." TSRMLS_CC); - } - } - } - - HANDLE_UNBLOCK_INTERRUPTIONS(); - - /* default */ - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto bool apcu_enabled(void) - returns true when apcu is usable in the current environment */ -PHP_FUNCTION(apcu_enabled) { - RETURN_BOOL(APCG(enabled)); -} /* }}} */ - -/* {{{ proto int apc_store(mixed key, mixed var [, long ttl ]) - */ -PHP_FUNCTION(apcu_store) { - apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - -/* {{{ proto int apc_add(mixed key, mixed var [, long ttl ]) - */ -PHP_FUNCTION(apcu_add) { - apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ php_inc_updater */ - -struct php_inc_updater_args { - long step; - long lval; -}; - -static zend_bool php_inc_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { - - struct php_inc_updater_args *args = (struct php_inc_updater_args*) data; - - zval* val = entry->val; - - if (Z_TYPE_P(val) == IS_LONG) { - Z_LVAL_P(val) += args->step; - args->lval = Z_LVAL_P(val); - return 1; - } - - return 0; -} -/* }}} */ - -/* {{{ proto long apc_inc(string key [, long step [, bool& success]]) - */ -PHP_FUNCTION(apcu_inc) { - char *strkey; - int strkey_len; - struct php_inc_updater_args args = {1L, -1}; - zval *success = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) { - return; - } - - if (success) { - zval_dtor(success); - } - - if (php_apc_update(strkey, strkey_len, php_inc_updater, &args TSRMLS_CC)) { - if (success) { - ZVAL_TRUE(success); - } - - RETURN_LONG(args.lval); - } - - if (success) { - ZVAL_FALSE(success); - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto long apc_dec(string key [, long step [, bool &success]]) - */ -PHP_FUNCTION(apcu_dec) { - char *strkey; - int strkey_len; - struct php_inc_updater_args args = {1L, -1}; - zval *success = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) { - return; - } - - if (success) { - zval_dtor(success); - } - - args.step = args.step * -1; - - if (php_apc_update(strkey, strkey_len, php_inc_updater, &args TSRMLS_CC)) { - if (success) ZVAL_TRUE(success); - RETURN_LONG(args.lval); - } - - if (success) { - ZVAL_FALSE(success); - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ php_cas_updater */ -static zend_bool php_cas_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { - long* vals = ((long*)data); - long old = vals[0]; - long new = vals[1]; - zval* val = entry->val; - - if (Z_TYPE_P(val) == IS_LONG) { - if (Z_LVAL_P(val) == old) { - Z_LVAL_P(val) = new; - return 1; - } - } - - return 0; -} -/* }}} */ - -/* {{{ proto int apc_cas(string key, int old, int new) - */ -PHP_FUNCTION(apcu_cas) { - char *strkey; - int strkey_len; - long vals[2]; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &strkey, &strkey_len, &vals[0], &vals[1]) == FAILURE) { - return; - } - - if (php_apc_update(strkey, strkey_len, php_cas_updater, &vals TSRMLS_CC)) { - RETURN_TRUE; - } - - RETURN_FALSE; -} -/* }}} */ - -void *apc_erealloc_wrapper(void *ptr, size_t size) { - return _erealloc(ptr, size, 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); -} - -/* {{{ proto mixed apc_fetch(mixed key[, bool &success]) - */ -PHP_FUNCTION(apcu_fetch) { - zval *key; - zval *success = NULL; - apc_cache_entry_t* entry; - time_t t; - apc_context_t ctxt = {0,}; - - if (!APCG(enabled)) { - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &key, &success) == FAILURE) { - return; - } - - t = apc_time(); - - if (success) { - ZVAL_BOOL(success, 0); - } - - if (Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) { - convert_to_string(key); - } - - /* check for a string, or array of strings */ - if (Z_TYPE_P(key) == IS_ARRAY || (Z_TYPE_P(key) == IS_STRING && Z_STRLEN_P(key) > 0)) { - - /* initialize a context */ - if (apc_cache_make_context(apc_user_cache, &ctxt, APC_CONTEXT_NOSHARE, APC_UNPOOL, APC_COPY_OUT, 0 TSRMLS_CC)) { - - if (Z_TYPE_P(key) == IS_STRING) { - - /* do find using string as key */ - if ((entry = apc_cache_find(apc_user_cache, Z_STRVAL_P(key), (Z_STRLEN_P(key) + 1), t TSRMLS_CC))) { - /* deep-copy returned shm zval to emalloc'ed return_value */ - apc_cache_fetch_zval( - &ctxt, return_value, entry->val TSRMLS_CC); - /* decrement refcount of entry */ - apc_cache_release( - apc_user_cache, entry TSRMLS_CC); - /* set success */ - if (success) { - ZVAL_BOOL(success, 1); - } - - } else { ZVAL_BOOL(return_value, 0); } - - } else if (Z_TYPE_P(key) == IS_ARRAY) { - - /* do find using key as array of strings */ - HashPosition hpos; - zval **hentry; - zval *result; - - MAKE_STD_ZVAL(result); - array_init(result); - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &hpos); - while(zend_hash_get_current_data_ex(Z_ARRVAL_P(key), (void**)&hentry, &hpos) == SUCCESS) { - - if (Z_TYPE_PP(hentry) == IS_STRING) { - - /* perform find using this index as key */ - if ((entry = apc_cache_find(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1), t TSRMLS_CC))) { - zval *result_entry; - - /* deep-copy returned shm zval to emalloc'ed return_value */ - MAKE_STD_ZVAL(result_entry); - apc_cache_fetch_zval( - &ctxt, result_entry, entry->val TSRMLS_CC); - /* decrement refcount of entry */ - apc_cache_release( - apc_user_cache, entry TSRMLS_CC); - /* add the emalloced value to return array */ - zend_hash_add( - Z_ARRVAL_P(result), Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1, &result_entry, sizeof(zval*), NULL); - } - } else { - - /* we do not break loop, we just skip the key */ - apc_warning( - "apc_fetch() expects a string or array of strings." TSRMLS_CC); - } - - /* don't set values we didn't find */ - zend_hash_move_forward_ex(Z_ARRVAL_P(key), &hpos); - } - - RETVAL_ZVAL(result, 0, 1); - - if (success) { - ZVAL_BOOL(success, 1); - } - } - - apc_cache_destroy_context(&ctxt TSRMLS_CC ); - } - - } else { - apc_warning("apc_fetch() expects a string or array of strings." TSRMLS_CC); - RETURN_FALSE; - } - return; -} -/* }}} */ - -/* {{{ proto mixed apc_exists(mixed key) - */ -PHP_FUNCTION(apcu_exists) { - zval *key; - time_t t; - - if (!APCG(enabled)) { - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &key) == FAILURE) { - return; - } - - t = apc_time(); - - if (Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) { - convert_to_string(key); - } - - if (Z_TYPE_P(key) == IS_STRING) { - if (Z_STRLEN_P(key)) { - if (apc_cache_exists(apc_user_cache, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, t TSRMLS_CC)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - } - } else if (Z_TYPE_P(key) == IS_ARRAY) { - HashPosition hpos; - zval **hentry; - zval *result; - - MAKE_STD_ZVAL(result); - array_init(result); - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &hpos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(key), (void**)&hentry, &hpos) == SUCCESS) { - if (Z_TYPE_PP(hentry) == IS_STRING) { - if (apc_cache_exists(apc_user_cache, Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) + 1, t TSRMLS_CC)) { - zval *result_entry; - - MAKE_STD_ZVAL(result_entry); - ZVAL_BOOL(result_entry, 1); - - zend_hash_add( - Z_ARRVAL_P(result), - Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1, - &result_entry, sizeof(zval*), NULL - ); - } - } else { - apc_warning( - "apc_exists() expects a string or array of strings." TSRMLS_CC); - } - - /* don't set values we didn't find */ - zend_hash_move_forward_ex(Z_ARRVAL_P(key), &hpos); - } - RETURN_ZVAL(result, 0, 1); - } else { - apc_warning("apc_exists() expects a string or array of strings." TSRMLS_CC); - } - - RETURN_FALSE; -} -/* }}} */ - -/* {{{ proto mixed apc_delete(mixed keys) - */ -PHP_FUNCTION(apcu_delete) { - zval *keys; - - if (!APCG(enabled)) { - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &keys) == FAILURE) { - return; - } - - if (Z_TYPE_P(keys) == IS_STRING) { - if (!Z_STRLEN_P(keys)) { - RETURN_FALSE; - } - - if (apc_cache_delete(apc_user_cache, Z_STRVAL_P(keys), (Z_STRLEN_P(keys) + 1) TSRMLS_CC)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - - } else if (Z_TYPE_P(keys) == IS_ARRAY) { - HashPosition hpos; - zval **hentry; - - array_init(return_value); - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &hpos); - - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), (void**)&hentry, &hpos) == SUCCESS) { - if (Z_TYPE_PP(hentry) != IS_STRING) { - apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); - add_next_index_zval(return_value, *hentry); - Z_ADDREF_PP(hentry); - } else if (apc_cache_delete(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1) TSRMLS_CC) != 1) { - add_next_index_zval(return_value, *hentry); - Z_ADDREF_PP(hentry); - } - zend_hash_move_forward_ex(Z_ARRVAL_P(keys), &hpos); - } - } else if (Z_TYPE_P(keys) == IS_OBJECT) { - - if (apc_iterator_delete(keys TSRMLS_CC)) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } - } else { - apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); - } -} -/* }}} */ - -/* {{{ proto mixed apcu_bin_dump([array vars]) - Returns a binary dump of the given user variables from the APC cache. - A NULL for vars signals a dump of every entry, while array() will dump nothing. - */ -PHP_FUNCTION(apcu_bin_dump) { - - zval *z_vars = NULL; - HashTable *h_vars; - apc_bd_t *bd; - - if (!APCG(enabled)) { - apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &z_vars) == FAILURE) { - return; - } - - h_vars = z_vars ? Z_ARRVAL_P(z_vars) : NULL; - bd = apc_bin_dump(apc_user_cache, h_vars TSRMLS_CC); - if (bd) { - RETVAL_STRINGL((char*)bd, bd->size-1, 0); - } else { - apc_error("Unknown error encountered during apc_bin_dump." TSRMLS_CC); - RETVAL_NULL(); - } - - return; -} -/* }}} */ - -#ifdef APC_FULL_BC -/* {{{ proto mixed apc_bin_dump([array files [, array user_vars]]) - Compatibility mode for old APC - */ -PHP_FUNCTION(apc_bin_dump) { - - zval *z_files = NULL, *z_user_vars = NULL; - HashTable *h_user_vars; - apc_bd_t *bd; - - if(!APCG(enabled)) { - apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &z_files, &z_user_vars) == FAILURE) { - return; - } - - h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL; - bd = apc_bin_dump(apc_user_cache, h_user_vars TSRMLS_CC); - if(bd) { - RETVAL_STRINGL((char*)bd, bd->size-1, 0); - } else { - apc_error("Unknown error encountered during apc_bin_dump." TSRMLS_CC); - RETVAL_NULL(); - } - - return; -} -/* }}} */ -#endif - -/* {{{ proto mixed apcu_bin_dumpfile(array vars, string filename, [int flags [, resource context]]) - Output a binary dump of the given user variables from the APC cache to the named file. - */ -PHP_FUNCTION(apcu_bin_dumpfile) { - - zval *z_vars = NULL; - HashTable *h_vars; - char *filename = NULL; - int filename_len; - long flags=0; - zval *zcontext = NULL; - php_stream_context *context = NULL; - php_stream *stream; - int numbytes = 0; - apc_bd_t *bd; - - if (!APCG(enabled)) { - apc_warning("APC is not enabled, apc_bin_dumpfile not available." TSRMLS_CC); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!s|lr!", &z_vars, &filename, &filename_len, &flags, &zcontext) == FAILURE) { - return; - } - - if (!filename_len) { - apc_error("apc_bin_dumpfile filename argument must be a valid filename." TSRMLS_CC); - RETURN_FALSE; - } - - h_vars = z_vars ? Z_ARRVAL_P(z_vars) : NULL; - bd = apc_bin_dump(apc_user_cache, h_vars TSRMLS_CC); - if (!bd) { - apc_error("Unknown error encountered during apc_bin_dumpfile." TSRMLS_CC); - RETURN_FALSE; - } - - - /* Most of the following has been taken from the file_get/put_contents functions */ - - context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); - stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb", - ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); - if (stream == NULL) { - efree(bd); - apc_error("Unable to write to file in apc_bin_dumpfile." TSRMLS_CC); - RETURN_FALSE; - } - - if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) { - php_stream_close(stream); - efree(bd); - apc_error("Unable to get a lock on file in apc_bin_dumpfile." TSRMLS_CC); - RETURN_FALSE; - } - - numbytes = php_stream_write(stream, (char*)bd, bd->size); - if (numbytes != bd->size) { - numbytes = -1; - } - - php_stream_close(stream); - efree(bd); - - if (numbytes < 0) { - apc_error("Only %d of %d bytes written, possibly out of free disk space" TSRMLS_CC, numbytes, bd->size); - RETURN_FALSE; - } - - RETURN_LONG(numbytes); -} -/* }}} */ - -#ifdef APC_FULL_BC -/* {{{ proto mixed apc_bin_dumpfile(array files, array user_vars, string filename, [int flags [, resource context]]) - Compatibility mode for old APC - */ -PHP_FUNCTION(apc_bin_dumpfile) { - - zval *z_files = NULL, *z_user_vars = NULL; - HashTable *h_user_vars; - char *filename = NULL; - int filename_len; - long flags=0; - zval *zcontext = NULL; - php_stream_context *context = NULL; - php_stream *stream; - int numbytes = 0; - apc_bd_t *bd; - - if(!APCG(enabled)) { - apc_warning("APC is not enabled, apc_bin_dumpfile not available." TSRMLS_CC); - RETURN_FALSE; - } - - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!s|lr!", &z_files, &z_user_vars, &filename, &filename_len, &flags, &zcontext) == -FAILURE) { - return; - } - - if(!filename_len) { - apc_error("apc_bin_dumpfile filename argument must be a valid filename." TSRMLS_CC); - RETURN_FALSE; - } - - h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL; - bd = apc_bin_dump(apc_user_cache, h_user_vars TSRMLS_CC); - if(!bd) { - apc_error("Unknown error encountered during apc_bin_dumpfile." TSRMLS_CC); - RETURN_FALSE; - } - - - /* Most of the following has been taken from the file_get/put_contents functions */ - - context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); - stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb", - ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); - if (stream == NULL) { - efree(bd); - apc_error("Unable to write to file in apc_bin_dumpfile." TSRMLS_CC); - RETURN_FALSE; - } - - if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) { - php_stream_close(stream); - efree(bd); - apc_error("Unable to get a lock on file in apc_bin_dumpfile." TSRMLS_CC); - RETURN_FALSE; - } - - numbytes = php_stream_write(stream, (char*)bd, bd->size); - if(numbytes != bd->size) { - numbytes = -1; - } - - php_stream_close(stream); - efree(bd); - - if(numbytes < 0) { - apc_error("Only %d of %d bytes written, possibly out of free disk space" TSRMLS_CC, numbytes, bd->size); - RETURN_FALSE; - } - - RETURN_LONG(numbytes); -} -/* }}} */ -#endif - -/* {{{ proto mixed apcu_bin_load(string data, [int flags]) - Load the given binary dump into the APC file/user cache. - */ -PHP_FUNCTION(apcu_bin_load) { - - int data_len; - char *data; - long flags = 0; - - if (!APCG(enabled)) { - apc_warning("APC is not enabled, apc_bin_load not available." TSRMLS_CC); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &flags) == FAILURE) { - return; - } - - if (!data_len || data_len != ((apc_bd_t*)data)->size -1) { - apc_error("apc_bin_load string argument does not appear to be a valid APC binary dump due to size (%d vs expected %d)." TSRMLS_CC, data_len, -((apc_bd_t*)data)->size -1); - RETURN_FALSE; - } - - apc_bin_load(apc_user_cache, (apc_bd_t*)data, (int)flags TSRMLS_CC); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ proto mixed apc_bin_loadfile(string filename, [resource context, [int flags]]) - Load the given binary dump from the named file into the APC file/user cache. - */ -PHP_FUNCTION(apcu_bin_loadfile) { - - char *filename; - int filename_len; - zval *zcontext = NULL; - long flags = 0; - php_stream_context *context = NULL; - php_stream *stream; - char *data; - int len; - - if (!APCG(enabled)) { - apc_warning("APC is not enabled, apc_bin_loadfile not available." TSRMLS_CC); - RETURN_FALSE; - } - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r!l", &filename, &filename_len, &zcontext, &flags) == FAILURE) { - return; - } - - if (!filename_len) { - apc_error("apc_bin_loadfile filename argument must be a valid filename." TSRMLS_CC); - RETURN_FALSE; - } - - context = php_stream_context_from_zval(zcontext, 0); - stream = php_stream_open_wrapper_ex(filename, "rb", - ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); - if (!stream) { - apc_error("Unable to read from file in apc_bin_loadfile." TSRMLS_CC); - RETURN_FALSE; - } - - len = php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0); - if (len == 0) { - apc_warning("File passed to apc_bin_loadfile was empty: %s." TSRMLS_CC, filename); - RETURN_FALSE; - } else if (len < 0) { - apc_warning("Error reading file passed to apc_bin_loadfile: %s." TSRMLS_CC, filename); - RETURN_FALSE; - } else if (len != ((apc_bd_t*)data)->size) { - apc_warning("file passed to apc_bin_loadfile does not appear to be valid due to size (%d vs expected %d)." TSRMLS_CC, len, -((apc_bd_t*)data)->size -1); - RETURN_FALSE; - } - php_stream_close(stream); - - apc_bin_load(apc_user_cache, (apc_bd_t*)data, (int)flags TSRMLS_CC); - efree(data); - - RETURN_TRUE; -} -/* }}} */ - -/* {{{ arginfo */ -#if (PHP_MAJOR_VERSION >= 6 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3)) -# define PHP_APC_ARGINFO -#else -# define PHP_APC_ARGINFO static -#endif - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_store, 0, 0, 2) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, var) - ZEND_ARG_INFO(0, ttl) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_enabled, 0, 0, 0) -ZEND_END_ARG_INFO() - -#ifdef APC_FULL_BC -PHP_APC_ARGINFO -/* this will generate different reflection but retains functional compatibility */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cache_info, 0, 0, 0) - ZEND_ARG_INFO(0, type) - ZEND_ARG_INFO(0, limited) -ZEND_END_ARG_INFO() -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_clear_cache, 0, 0, 0) - ZEND_ARG_INFO(0, cache) -ZEND_END_ARG_INFO() -#else -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cache_info, 0, 0, 0) - ZEND_ARG_INFO(0, limited) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_clear_cache, 0, 0, 0) -ZEND_END_ARG_INFO() -#endif - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_key_info, 0, 0, 1) - ZEND_ARG_INFO(0, key) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_sma_info, 0, 0, 0) - ZEND_ARG_INFO(0, limited) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO(arginfo_apcu_delete, 0) - ZEND_ARG_INFO(0, keys) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_fetch, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(1, success) -ZEND_END_ARG_INFO() - - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_inc, 0, 0, 1) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, step) - ZEND_ARG_INFO(1, success) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO(arginfo_apcu_cas, 0) - ZEND_ARG_INFO(0, key) - ZEND_ARG_INFO(0, old) - ZEND_ARG_INFO(0, new) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO(arginfo_apcu_exists, 0) - ZEND_ARG_INFO(0, keys) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_dump, 0, 0, 0) - ZEND_ARG_INFO(0, user_vars) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_dumpfile, 0, 0, 2) - ZEND_ARG_INFO(0, user_vars) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, flags) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_load, 0, 0, 1) - ZEND_ARG_INFO(0, data) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_loadfile, 0, 0, 1) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, context) - ZEND_ARG_INFO(0, flags) -ZEND_END_ARG_INFO() - - -#ifdef APC_FULL_BC -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dump, 0, 0, 0) - ZEND_ARG_INFO(0, files) - ZEND_ARG_INFO(0, user_vars) -ZEND_END_ARG_INFO() - -PHP_APC_ARGINFO -ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dumpfile, 0, 0, 3) - ZEND_ARG_INFO(0, files) - ZEND_ARG_INFO(0, user_vars) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, flags) - ZEND_ARG_INFO(0, context) -ZEND_END_ARG_INFO() -#endif -/* }}} */ - -/* {{{ apcu_functions[] */ -zend_function_entry apcu_functions[] = { - PHP_FE(apcu_cache_info, arginfo_apcu_cache_info) - PHP_FE(apcu_clear_cache, arginfo_apcu_clear_cache) - PHP_FE(apcu_sma_info, arginfo_apcu_sma_info) - PHP_FE(apcu_key_info, arginfo_apcu_key_info) - PHP_FE(apcu_enabled, arginfo_apcu_enabled) - PHP_FE(apcu_store, arginfo_apcu_store) - PHP_FE(apcu_fetch, arginfo_apcu_fetch) - PHP_FE(apcu_delete, arginfo_apcu_delete) - PHP_FE(apcu_add, arginfo_apcu_store) - PHP_FE(apcu_inc, arginfo_apcu_inc) - PHP_FE(apcu_dec, arginfo_apcu_inc) - PHP_FE(apcu_cas, arginfo_apcu_cas) - PHP_FE(apcu_exists, arginfo_apcu_exists) - PHP_FE(apcu_bin_dump, arginfo_apcu_bin_dump) - PHP_FE(apcu_bin_load, arginfo_apcu_bin_load) - PHP_FE(apcu_bin_dumpfile, arginfo_apcu_bin_dumpfile) - PHP_FE(apcu_bin_loadfile, arginfo_apcu_bin_loadfile) - {NULL, NULL, NULL} -}; -/* }}} */ - -/* {{{ module definition structure */ - -zend_module_entry apcu_module_entry = { - STANDARD_MODULE_HEADER, - PHP_APCU_EXTNAME, - apcu_functions, - PHP_MINIT(apcu), - PHP_MSHUTDOWN(apcu), - PHP_RINIT(apcu), - NULL, - PHP_MINFO(apcu), - PHP_APCU_VERSION, - STANDARD_MODULE_PROPERTIES -}; - -#ifdef APC_FULL_BC - -PHP_MINFO_FUNCTION(apc) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "APC support", "Emulated"); - php_info_print_table_end(); -} - -/* {{{ apc_functions[] */ -zend_function_entry apc_functions[] = { - PHP_FALIAS(apc_cache_info, apcu_cache_info, arginfo_apcu_cache_info) - PHP_FALIAS(apc_clear_cache, apcu_clear_cache, arginfo_apcu_clear_cache) - PHP_FALIAS(apc_sma_info, apcu_sma_info, arginfo_apcu_sma_info) - PHP_FALIAS(apc_store, apcu_store, arginfo_apcu_store) - PHP_FALIAS(apc_fetch, apcu_fetch, arginfo_apcu_fetch) - PHP_FALIAS(apc_delete, apcu_delete, arginfo_apcu_delete) - PHP_FALIAS(apc_add, apcu_add, arginfo_apcu_store) - PHP_FALIAS(apc_inc, apcu_inc, arginfo_apcu_inc) - PHP_FALIAS(apc_dec, apcu_dec, arginfo_apcu_inc) - PHP_FALIAS(apc_cas, apcu_cas, arginfo_apcu_cas) - PHP_FALIAS(apc_exists, apcu_exists, arginfo_apcu_exists) - PHP_FE(apc_bin_dump, arginfo_apc_bin_dump) - PHP_FE(apc_bin_dumpfile, arginfo_apc_bin_dumpfile) - PHP_FALIAS(apc_bin_load, apcu_bin_load, arginfo_apcu_bin_load) - PHP_FALIAS(apc_bin_loadfile, apcu_bin_loadfile, arginfo_apcu_bin_loadfile) - {NULL, NULL, NULL} -}; - -zend_module_entry apc_module_entry = { - STANDARD_MODULE_HEADER, - "apc", - apc_functions, - NULL, - NULL, - NULL, - NULL, - PHP_MINFO(apc), - PHP_APCU_VERSION, - STANDARD_MODULE_PROPERTIES, -}; - -static void apc_init(INIT_FUNC_ARGS) -{ - zend_register_internal_module(&apc_module_entry TSRMLS_CC); -} - -#endif - - -#ifdef COMPILE_DL_APCU -ZEND_GET_MODULE(apcu) -#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/php_apc.h php5-easybib-apcu-4.0.7/apcu-4.0.6/php_apc.h --- php5-easybib-apcu-4.0.6/apcu-4.0.6/php_apc.h 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/php_apc.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | APC | - +----------------------------------------------------------------------+ - | Copyright (c) 2006-2011 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 | - | George Schlossnagle | - | 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. - - */ - -/* $Id: php_apc.h 328953 2013-01-03 02:19:19Z rasmus $ */ - -#ifndef PHP_APC_H -#define PHP_APC_H - -#include "apc_php.h" -#include "apc_globals.h" - -#define PHP_APCU_VERSION "4.0.6" -#define PHP_APCU_EXTNAME "apcu" - -extern zend_module_entry apcu_module_entry; -#define apcu_module_ptr &apcu_module_entry - -#define phpext_apcu_ptr apcu_module_ptr - -#endif /* PHP_APC_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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/README.md php5-easybib-apcu-4.0.7/apcu-4.0.6/README.md --- php5-easybib-apcu-4.0.6/apcu-4.0.6/README.md 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ - -APCu -==== - -APCu is userland caching: APC stripped of opcode caching in preparation for the deployment of Zend Optimizer+ as the primary solution to opcode caching in future versions of PHP. - -APCu has a revised and simplified codebase, by the time the PECL release is available, every part of APCu being used will have received review and where necessary or appropriate, changes. - -Simplifying and documenting the API of APCu completely removes the barrier to maintenance and development of APCu in the future, and additionally allows us to make optimizations not possible previously because of APC's inherent complexity. - -APCu only supports userland caching (and dumping) of variables, providing an upgrade path for the future. When O+ takes over, many will be tempted to use 3rd party solutions to userland caching, possibly even distributed solutions; this would be a grave error. The tried and tested APC codebase provides far superior support for local storage of PHP variables. - -Specific Changes -================ - - * appropriate changes (removals) to configuration parameters (complete) - * appropriate changes to userspace management script (complete) - * revision of APC locking (complete) - * revision of APC's caching API (complete) - * revision of APC's PHP internals (complete) - * revision of APC's userspace API (complete) - * revision of APC's shared memory allocator (complete) - * revision of APC's pooling API (complete, no functional changes, documented) - * installation of SIGUSR1 handler (where possible) to clear cache (complete) - * format API headers so they can be referenced externally (complete, see apcue) - * apc.smart allows runtime adjustable control over how the cache is purged (complete) - * documentation of all associated API's (ongoing, mostly complete, all headers and source file documented and commented) - -Still to Do: -============ - - * test/stabilize - -The C api does not retain backward compatibility, anyone relying on APC that will rely on APCu in the future should review the changes as soon as possible and continue to track them. -The PHP api will retain compatibility with APC, as will common configuration options, providing a drop in replacement. diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/TECHNOTES.txt php5-easybib-apcu-4.0.7/apcu-4.0.6/TECHNOTES.txt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/TECHNOTES.txt 2014-06-12 13:39:04.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/TECHNOTES.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,293 +0,0 @@ -APC Quick-Start Braindump - -This is a rapidly written braindump of how APC currently works in the -form of a quick-start guide to start hacking on APC. - -1. Install and use APC a bit so you know what it does from the end-user's - perspective. - user-space functions are all explained here: - -2. Grab the current APC code from CVS: - - cvs -d:pserver:cvsread@cvs.php.net:/repository login - Password: phpfi - cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/apc - - apc/php_apc.c has most of the code for the user-visible stuff. It is - also a regular PHP extension in the sense that there are MINIT, MINFO, - MSHUTDOWN, RSHUTDOWN, etc. functions. - -3. Build it. - - cd pecl/apc - phpize - ./configure --enable-apcu - make - cp modules/apcu.so /usr/local/lib/php - apachectl restart - -4. Debugging Hints - - apachectl stop - gdb /usr/bin/httpd - break ?? - run -X - - Grab the .gdbinit from the PHP source tree and have a look at the macros. - -5. The basics of APCu - - APCu has three main component parts: - 1) shared memory allocator - 2) pooling - 3) user land cache - -5.1) APCu SMA - - It is a pretty standard memory allocator, now supporting third party extensions. - - apc_sma_malloc, apc_sma_realloc, apc_sma_strdup and apc_sma_free - behave to the caller just like malloc, realloc, strdup and free, they are - generated from macros in apc_sma_api.h - - Note: apc_sma_api.h is formatted and designed such that the SMA APCu - uses can be used by third parties in their own extensions without - interfering with, or consuming the resources of APCu itself - - apc_sma is a structure of type apc_sma_t, it is statically allocated at runtime, - appropriate handlers are generated and set, and the structure made ready for initialization. - - MINIT then initializes apc_sma with apc_sma_api_init(). - APCu SMA then takes care of mmaping the shared memory. - ( which you can obtain in any compilation unit with apc_sma_api_extern(apc_sma) ) - - At this point, we have a completely useless 32MB chunk of memory at our disposal, before - it can be used, an apc_cache_header_t is initialized at the beginning of the reigon of - mmapp'ed memory. - - The header serves as a place to store, among other things, statistical information and a lock. - - Immediately after the header comes a zero sized block, immediately after that a single - block the remaining size of the shared memory. - - At this point, the shared memory looks like this: - - +--------+--------+----------------------------------+ - | header | 0-size | shared | - +--------+--------+----------------------------------+ - - The blocks are just a simple offset-based linked list (so no pointers): - - typedef struct block_t block_t; - struct block_t { - 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: - - #define BLOCKAT(offset) ((block_t*)((char *)shmaddr + offset)) - - where shmaddr = sma->shaddrs[0] - - And the OFFSET macro goes the other way: - - #define OFFSET(block) ((int)(((char*)block) - (char*)shmaddr)) - - Allocating a block walks through the linked list of blocks until it finds one that is >= - to the requested size. The first call to allocate will hit the second block. We then - chop up that block so it looks like this: - - +--------+-------+-------+-------------------------+ - | header | block | block | block | - +--------+-------+-------+-------------------------+ - - Then we unlink that block from the linked list so it won't show up - as an available block on the next allocate. So we actually have: - - +--------+-------+ +-------------------------+ - | header | block |------>| block | - +--------+-------+ +-------------------------+ - - And header->avail along with block->size of the remaining large - block are updated accordingly. The arrow there representing the - link which now points to a block with an offset further along in - the segment. - - When the block is freed the steps are basically just reversed. - The block is put back and then the deallocate code looks at the block before and after to see - if the block immediately before and after are free and if so the blocks are combined. So you never - have 2 free blocks next to each other, apart from at the front with that - 0-sized dummy block. This mostly prevents fragmentation. I have been - toying with the idea of always allocating block at 2^n boundaries to make - it more likely that they will be re-used to cut down on fragmentation further. - That's what the POWER_OF_TWO_BLOCKSIZE you see in apc_sma.c is all about. - -5.2) APCu Pooling - - Pooling serves as a means to provide operations with a context: without context, managing memory within - APCu would become near impossible, and very error prone. - - Whenever APCu is instructed to undertake an operation that requires relinquishing the owner of some memory - a struct of type apc_cache_context_t is passed, among other things, the context contains a pool, - the pool provides references to handlers that are appropriate for the current operation. - - For example: To copy data into the shared area, APCu will require the use of allocators that return blocks - from shared memory. To copy data out of the shared area and hand over ownership to PHP, normal - allocators must be used. - - For more information about pooling, see apc_pool.h/apc_pool.c in the source distribution. - -5.3) APCu Cache - - The caching functionality of APCu is provided by a modified version of the APC source code - - Some simple tweaks have been applied: - Locking is written to use the best kind of locking available, and emulate it where it is not to simplify logic. - Extension of the SMA to support multiple instances, such that additional caches using APCu do not - increase contention of the main APCu cache. - The possibility to control more finely what happens when resources become low for APCu. - An exposed, coherent, and documented API and example included in the distribution. - - There's probably some of my blood in it, if you look real close ... - - The remainder of the document goes on to explain in some detail the cache itself, functionally unchanged by APCu - -6. Next up is apc_cache.c which implements the cache logic. - - Having initialized a suitable allocator, MINIT must call apc_cache_create, using the allocator provided - APCu will create a cache. The parameters to apc_cache_create for APCu are defined by various INI settings. - API users can provide the same options from anywhere ( their globals for example ). - - The cache is stored in/described by this struct allocated locally: - - /* {{{ struct definition: apc_cache_t */ - typedef struct _apc_cache_t { - void* shmaddr; /* process (local) address of shared cache */ - apc_cache_header_t* header; /* cache header (stored in SHM) */ - apc_cache_slot_t** slots; /* array of cache slots (stored in SHM) */ - apc_sma_t* sma; /* set during creation of cache */ - apc_serializer_t* serializer; /* serializer */ - zend_ulong nslots; /* number of slots in cache */ - zend_ulong gc_ttl; /* maximum time on GC list for a slot */ - zend_ulong ttl; /* if slot is needed and entry's access time is older than this ttl, remove it */ - zend_ulong smart; /* smart parameter for gc */ - zend_bool defend; /* defense parameter for runtime */ - } apc_cache_t; /* }}} */ - - Whenever you see functions that take a 'cache' argument, this is what they - take. - - At the beginning of the cache we have a header. The header looks like this: - - /* {{{ struct definition: apc_cache_header_t - Any values that must be shared among processes should go in here. */ - typedef struct _apc_cache_header_t { - apc_lock_t lock; /* header lock */ - zend_ulong nhits; /* hit count */ - zend_ulong nmisses; /* miss count */ - zend_ulong ninserts; /* insert count */ - zend_ulong nexpunges; /* expunge count */ - zend_ulong nentries; /* entry count */ - zend_ulong mem_size; /* used */ - time_t stime; /* start time */ - volatile zend_ushort state; /* cache state */ - apc_cache_key_t lastkey; /* last key inserted (not necessarily without error) */ - apc_cache_slot_t* gc; /* gc list */ - } apc_cache_header_t; /* }}} */ - - Since this is at the start of the shared memory segment, these values are accessible - across all processes / threads and hence access to them has to be locked. - - After the header we have an array of slots. The number of slots is user-defined - through the apc.entries_hint ini hint. Each slot is described by: - - /* {{{ struct definition: apc_cache_slot_t */ - typedef struct apc_cache_slot_t apc_cache_slot_t; - struct apc_cache_slot_t { - apc_cache_key_t key; /* slot key */ - apc_cache_entry_t* value; /* slot value */ - apc_cache_slot_t* next; /* next slot in linked list */ - zend_ulong nhits; /* number of hits to this slot */ - time_t ctime; /* time slot was initialized */ - time_t dtime; /* time slot was removed from cache */ - time_t atime; /* time slot was last accessed */ - }; - /* }}} */ - - The apc_cache_slot_t *next there is a linked list to other slots that happened to hash to the - same array position. - - apc_cache_insert() shows what happens on a new cache insert. - - slot = &cache->slots[zend_inline_hash_func(key, keylen) % cache->nslots]; - - cache->slots is our array of slots in the segment. - - So, on an insert we find the array position in the slots array by hashing the key provided. - If there are currently no other slots there, we just create the slot and stick it into - the array: - - *slot = make_slot(cache, key, value, *slot, t TSRMLS_CC) - - If there are other slots already at this position we walk the link list to get to - the end. - - While walking the linked list we also check to see if the cache has a TTL defined. - If while walking the linked list we see a slot that has expired, we remove it - since we are right there looking at it. This is the only place we remove stale - entries unless the shared memory segment fills up and we force a full expunge via - apc_cache_expunge(). apc_cache_expunge() walks all slots attempting deletion, how - deletion occurs depends on runtime parameters, see INSTALL for runtime parameter - configuration details. - - apc_cache_find() simply hashes and returns the entry if it is there. If it is there - but older than the mtime in the entry we are looking for, we delete the one that is - there and return indicating we didn't find it. - - API users are advised to use apc_cache_fetch over find for simplicity, this ensures - correct operation, fetch sets up the call to find and takes care of copying and releasing - the entry from the cache to a zval* provided. - - Next we need to understand what an actual cache entry looks like. Have a look at - apc_cache.h for the structs. Here is the definition of apc_cache_key_t: - - /* {{{ struct definition: apc_cache_key_t */ - typedef struct _apc_cache_key_t { - const char *str; /* pointer to constant string key */ - zend_uint len; /* length of data at str */ - zend_ulong h; /* pre-computed hash of key */ - time_t mtime; /* the mtime of this cached entry */ - apc_cache_owner_t owner; /* the context that created this key */ - } apc_cache_key_t; /* }}} */ - - To create a apc_cache_key_t structure, call apc_cache_make_key(), see apc_cache.h - - Ok, on to the actual cache entry, here is the definition of apc_cache_entry_t: - - /* {{{ struct definition: apc_cache_entry_t */ - typedef struct _apc_cache_entry_t { - zval *val; /* the zval copied at store time */ - zend_uint ttl; /* the ttl on this specific entry */ - int ref_count; /* the reference count of this entry */ - size_t mem_size; /* memory used */ - apc_pool *pool; /* pool which allocated the value */ - } apc_cache_entry_t; - /* }}} */ - - To create an apc_cache_entry_t, call apc_cache_make_entry(), see apc_cache.h - - Any of the structures taken by apc_cache_* functions have their equivalent apc_cache_make_* - - If an insertion of an entry should fail, it falls to the caller of insert to free - the pooled resources used to create the entry. - - - -If you made it to the end of this, you should have a pretty good idea of where things are in -the code. There is much more reading to do in headers ... good luck ... - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/023-2.inc php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/023-2.inc --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/023-2.inc 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/023-2.inc 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. - - - diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/024.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/024.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/024.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/024.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,11627 +0,0 @@ ---TEST-- -Looped regression test (may take a while) (from tests/lang/024.phpt) ---INI-- -apc.enabled=1 -apc.cache_by_default=1 -apc.enable_cli=1 ---FILE-- - - - -*** Testing assignments and variable aliasing: *** - -This should read "blah": -This should read "this is nifty": -************************************************* - -*** Testing integer operators *** - -Correct result - 8: - -Correct result - 8: - -Correct result - 2: - -Correct result - -2: - -Correct result - 15: - -Correct result - 15: - -Correct result - 2: - -Correct result - 3: - -********************************* - -*** Testing real operators *** - -Correct result - 8: - -Correct result - 8: - -Correct result - 2: - -Correct result - -2: - -Correct result - 15: - -Correct result - 15: - -Correct result - 2: - -Correct result - 3: - -********************************* - -*** Testing if/elseif/else control *** - - - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -0) { - $j--; - } - } -} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ - $i = ++$j; - echo "hmm, this shouldn't be displayed #2\n"; - if (1) { - $j = ++$i; - if (0) { - $j = $i*2+$j*($i++); - if (1) { - $i++; - echo "damn, this shouldn't be displayed\n"; - } else { - $j++; - echo "this shouldn't be displayed either\n"; - } - } else if (1) { - ++$j; - echo "this isn't supposed to be displayed\n"; - } - } elseif (0) { - $j++; - echo "this definitely shouldn't be displayed\n"; - } else { - $i++; - echo "and this too shouldn't be displayed\n"; - } -} else { - $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ - echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j\n"; - if (1) { - $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ - if (0) { - $j += 40; - if (1) { - $i += 50; - echo "damn, this shouldn't be displayed\n"; - } else { - $j += 20; - echo "this shouldn't be displayed either\n"; - } - } else if (1) { - $j *= $i; /* $j *= 2 --> $j == 4 */ - echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j\n"; - echo "3 loop iterations should follow:\n"; - while ($i<=$j) { - echo $i++." $j\n"; - } - } - } elseif (0) { - echo "this definitely shouldn't be displayed\n"; - } else { - echo "and this too shouldn't be displayed\n"; - } - echo "**********************************\n"; -} -?> - -*** C-style else-if's *** - -************************* - -*** WHILE tests *** -$j) { - echo "$i is greater than $j\n"; - } else if ($i==$j) { - echo "$i equals $j\n"; - } else { - echo "$i is smaller than $j\n"; - } - $i++; -} -?> -******************* - - -*** Nested WHILEs *** - -********************* - -*** hash test... *** - - -************************** - -*** Hash resizing test *** - 0) { - $a = $a . "a"; - echo "$a\n"; - $resize[$a] = $i; - $i--; -} -$i = 10; -$a = "b"; -while ($i > 0) { - $a = $a . "a"; - echo "$a\n"; - echo $resize[$a]."\n"; - $i--; -} -?> -************************** - - -*** break/continue test *** -2) { - break; - } - $j=0; - echo "\$j should go from 3 to 4, and \$q should go from 3 to 4\n"; - while ($j<5) { - if ($j<=2) { - $j++; - continue; - } - echo " \$j=$j\n"; - for ($q=0; $q<=10; $q++) { - if ($q<3) { - continue; - } - if ($q>4) { - break; - } - echo " \$q=$q\n"; - } - $j++; - } - $j=0; - echo "\$j should go from 0 to 2\n"; - while ($j<5) { - if ($j>2) { - $k=0; - echo "\$k should go from 0 to 2\n"; - while ($k<5) { - if ($k>2) { - break 2; - } - echo " \$k=$k\n"; - $k++; - } - } - echo " \$j=$j\n"; - $j++; - } - echo "\$i=$i\n"; - $i++; -} -?> -*********************** - -*** Nested file include test *** - -******************************** - - ---EXPECT-- - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. - - -*** Testing assignments and variable aliasing: *** -This should read "blah": blah -This should read "this is nifty": this is nifty -************************************************* - -*** Testing integer operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing real operators *** -Correct result - 8: 8 -Correct result - 8: 8 -Correct result - 2: 2 -Correct result - -2: -2 -Correct result - 15: 15 -Correct result - 15: 15 -Correct result - 2: 2 -Correct result - 3: 3 -********************************* - -*** Testing if/elseif/else control *** - -This works -this_still_works -should_print - - -*** Seriously nested if's test *** -** spelling correction by kluzz ** -Only two lines of text should follow: -this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 -this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 -3 loop iterations should follow: -2 4 -3 4 -4 4 -********************************** - -*** C-style else-if's *** -This should be displayed -************************* - -*** WHILE tests *** -0 is smaller than 20 -1 is smaller than 20 -2 is smaller than 20 -3 is smaller than 20 -4 is smaller than 20 -5 is smaller than 20 -6 is smaller than 20 -7 is smaller than 20 -8 is smaller than 20 -9 is smaller than 20 -10 is smaller than 20 -11 is smaller than 20 -12 is smaller than 20 -13 is smaller than 20 -14 is smaller than 20 -15 is smaller than 20 -16 is smaller than 20 -17 is smaller than 20 -18 is smaller than 20 -19 is smaller than 20 -20 equals 20 -21 is greater than 20 -22 is greater than 20 -23 is greater than 20 -24 is greater than 20 -25 is greater than 20 -26 is greater than 20 -27 is greater than 20 -28 is greater than 20 -29 is greater than 20 -30 is greater than 20 -31 is greater than 20 -32 is greater than 20 -33 is greater than 20 -34 is greater than 20 -35 is greater than 20 -36 is greater than 20 -37 is greater than 20 -38 is greater than 20 -39 is greater than 20 -******************* - - -*** Nested WHILEs *** -Each array variable should be equal to the sum of its indices: -${test00}[0] = 0 -${test00}[1] = 1 -${test00}[2] = 2 -${test01}[0] = 1 -${test01}[1] = 2 -${test01}[2] = 3 -${test02}[0] = 2 -${test02}[1] = 3 -${test02}[2] = 4 -${test10}[0] = 1 -${test10}[1] = 2 -${test10}[2] = 3 -${test11}[0] = 2 -${test11}[1] = 3 -${test11}[2] = 4 -${test12}[0] = 3 -${test12}[1] = 4 -${test12}[2] = 5 -${test20}[0] = 2 -${test20}[1] = 3 -${test20}[2] = 4 -${test21}[0] = 3 -${test21}[1] = 4 -${test21}[2] = 5 -${test22}[0] = 4 -${test22}[1] = 5 -${test22}[2] = 6 -********************* - -*** hash test... *** -commented out... -************************** - -*** Hash resizing test *** -ba -baa -baaa -baaaa -baaaaa -baaaaaa -baaaaaaa -baaaaaaaa -baaaaaaaaa -baaaaaaaaaa -ba -10 -baa -9 -baaa -8 -baaaa -7 -baaaaa -6 -baaaaaa -5 -baaaaaaa -4 -baaaaaaaa -3 -baaaaaaaaa -2 -baaaaaaaaaa -1 -************************** - - -*** break/continue test *** -$i should go from 0 to 2 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=0 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=1 -$j should go from 3 to 4, and $q should go from 3 to 4 - $j=3 - $q=3 - $q=4 - $j=4 - $q=3 - $q=4 -$j should go from 0 to 2 - $j=0 - $j=1 - $j=2 -$k should go from 0 to 2 - $k=0 - $k=1 - $k=2 -$i=2 -*********************** - -*** Nested file include test *** - -This is Finish.phtml. This file is supposed to be included -from regression_test.phtml. This is normal HTML. -and this is PHP code, 2+2=4 - -******************************** - -Tests completed. diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_001.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_001.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_001.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_001.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ ---TEST-- -APC: apc_store/fetch with strings ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -string(11) "hello world" -string(11) "hello world" -string(4) "nice" -string(11) "hello world" -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_002.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_002.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_002.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_002.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ ---TEST-- -APC: apc_store/fetch with objects ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- -a = true; -var_dump($bar); - -?> -===DONE=== - ---EXPECTF-- -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -object(foo)#%d (1) { - ["a"]=> - bool(true) -} -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_003b.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_003b.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_003b.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_003b.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ ---TEST-- -APC: apc_store/fetch with objects (php 5.3) ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- -a = true; -var_dump($bar); - -class bar extends foo -{ - public $pub = 'bar'; - protected $pro = 'bar'; - private $pri = 'bar'; // we don't see this, we'd need php 5.1 new serialization - - function __construct() - { - $this->bar = true; - } - - function change() - { - $this->pri = 'mod'; - } -} - -class baz extends bar -{ - private $pri = 'baz'; - - function __construct() - { - parent::__construct(); - $this->baz = true; - } -} - -$baz = new baz; -var_dump($baz); -$baz->change(); -var_dump($baz); -apc_store('baz', $baz); -unset($baz); -var_dump(apc_fetch('baz')); - -?> -===DONE=== - ---EXPECTF-- -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -object(foo)#%d (1) { - ["a"]=> - bool(true) -} -object(baz)#%d (6) { - ["pri":"baz":private]=> - string(3) "baz" - ["pub"]=> - string(3) "bar" - ["pro":protected]=> - string(3) "bar" - ["pri":"bar":private]=> - string(3) "bar" - ["bar"]=> - bool(true) - ["baz"]=> - bool(true) -} -object(baz)#%d (6) { - ["pri":"baz":private]=> - string(3) "baz" - ["pub"]=> - string(3) "bar" - ["pro":protected]=> - string(3) "bar" - ["pri":"bar":private]=> - string(3) "mod" - ["bar"]=> - bool(true) - ["baz"]=> - bool(true) -} -object(baz)#%d (6) { - ["pri":"baz":private]=> - string(3) "baz" - ["pub"]=> - string(3) "bar" - ["pro":protected]=> - string(3) "bar" - ["pri":"bar":private]=> - string(3) "mod" - ["bar"]=> - bool(true) - ["baz"]=> - bool(true) -} -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_003.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_003.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_003.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_003.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ ---TEST-- -APC: apc_store/fetch with objects (php pre-5.3) ---SKIPIF-- -= 0) { - echo "skip\n"; - } -?> ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- -a = true; -var_dump($bar); - -class bar extends foo -{ - public $pub = 'bar'; - protected $pro = 'bar'; - private $pri = 'bar'; // we don't see this, we'd need php 5.1 new serialization - - function __construct() - { - $this->bar = true; - } - - function change() - { - $this->pri = 'mod'; - } -} - -class baz extends bar -{ - private $pri = 'baz'; - - function __construct() - { - parent::__construct(); - $this->baz = true; - } -} - -$baz = new baz; -var_dump($baz); -$baz->change(); -var_dump($baz); -apc_store('baz', $baz); -unset($baz); -var_dump(apc_fetch('baz')); - -?> -===DONE=== - ---EXPECTF-- -object(foo)#%d (0) { -} -object(foo)#%d (0) { -} -object(foo)#%d (1) { - ["a"]=> - bool(true) -} -object(baz)#%d (6) { - ["pri:private"]=> - string(3) "baz" - ["pub"]=> - string(3) "bar" - ["pro:protected"]=> - string(3) "bar" - ["pri:private"]=> - string(3) "bar" - ["bar"]=> - bool(true) - ["baz"]=> - bool(true) -} -object(baz)#%d (6) { - ["pri:private"]=> - string(3) "baz" - ["pub"]=> - string(3) "bar" - ["pro:protected"]=> - string(3) "bar" - ["pri:private"]=> - string(3) "mod" - ["bar"]=> - bool(true) - ["baz"]=> - bool(true) -} -object(baz)#%d (6) { - ["pri:private"]=> - string(3) "baz" - ["pub"]=> - string(3) "bar" - ["pro:protected"]=> - string(3) "bar" - ["pri:private"]=> - string(3) "mod" - ["bar"]=> - bool(true) - ["baz"]=> - bool(true) -} -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_004.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_004.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_004.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_004.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ ---TEST-- -APC: apc_store/fetch with bools ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -bool(false) -bool(false) -bool(false) -bool(true) -bool(false) -bool(false) -bool(false) -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_005.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_005.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_005.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_005.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ ---TEST-- -APC: apc_store/fetch with arrays of objects ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -array(2) { - [0]=> - object(stdClass)#1 (0) { - } - [1]=> - object(stdClass)#2 (0) { - } -} -array(2) { - [0]=> - object(stdClass)#1 (0) { - } - [1]=> - object(stdClass)#2 (0) { - } -} -array(2) { - [0]=> - object(stdClass)#3 (0) { - } - [1]=> - object(stdClass)#4 (0) { - } -} -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_006.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_006.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_006.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_006.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ ---TEST-- -APC: apc_store/fetch reference test ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 -apc.serializer=default -report_memleaks=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -array(9) refcount(2){ - [0]=> - string(1) "a" refcount(1) - [1]=> - &array(1) refcount(2){ - [0]=> - string(1) "c" refcount(1) - } - [2]=> - &array(1) refcount(2){ - [0]=> - string(1) "c" refcount(1) - } - [3]=> - &string(1) "d" refcount(3) - [4]=> - &string(1) "d" refcount(3) - [5]=> - &string(1) "d" refcount(3) - [6]=> - string(1) "e" refcount(2) - [7]=> - string(1) "e" refcount(2) - [8]=> - &array(2) refcount(2){ - [0]=> - string(1) "f" refcount(1) - [1]=> - &array(2) refcount(2){ - [0]=> - string(1) "f" refcount(1) - [1]=> - *RECURSION* - } - } -} -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_007.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_007.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_007.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_007.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ ---TEST-- -APC: apc_inc/apc_dec test ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -$foobar = 2 -$foobar += 1 = 3 -$foobar += 10 = 13 -$foobar -= 1 = 12 -$foobar -= 10 = 2 -$f__bar += 1 = fail -$perfection -= 1 = epic fail -$foobar += 1 = 3 -pass by ref success 1 -$foobar -= 1 = 2 -pass by ref success 1 -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_008.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_008.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_008.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_008.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ ---TEST-- -APC: apc_cas test ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -$foobar = 2 -$foobar == 1 ? 2 : 1 = fail -$foobar == 2 ? 1 : 2 = ok -$foobar = 1 -$f__bar == 1 ? 2 : 1 = fail -$perfection == 2 ? 1 : 2 = epic fail -$foobar = 1 -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_010.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_010.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_010.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_010.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ ---TEST-- -APC: apc_store/fetch/add with array of key/value pairs. ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -array(0) { -} -array(4) { - ["key1"]=> - string(6) "value1" - ["key2"]=> - string(6) "value2" - ["key3"]=> - array(2) { - [0]=> - string(7) "value3a" - [1]=> - string(7) "value3b" - } - ["key4"]=> - int(4) -} -array(2) { - ["key1"]=> - string(6) "value1" - ["key3"]=> - array(2) { - [0]=> - string(7) "value3a" - [1]=> - string(7) "value3b" - } -} -array(2) { - ["key1"]=> - int(-1) - ["key3"]=> - int(-1) -} -array(4) { - ["key1"]=> - string(6) "value1" - ["key2"]=> - string(6) "value2" - ["key3"]=> - array(2) { - [0]=> - string(7) "value3a" - [1]=> - string(7) "value3b" - } - ["key4"]=> - int(4) -} -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_011.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_011.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_011.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_011.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ ---TEST-- -APC: apc_fetch resets array pointers ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 -apc.file_update_protection=0 ---FILE-- - -===DONE=== - ---EXPECTF-- -string(3) "bar" -string(3) "bar" -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc54_014.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc54_014.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc54_014.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc54_014.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ ---TEST-- -APC: Bug #61742 preload_path does not work due to incorrect string length (variant 1) (php 5.4) ---SKIPIF-- -getTotalCount()); //returns 50000 -var_dump(\$it->current()); //returns false on error -FL; - -$args = array( - 'apc.enabled=1', - 'apc.enable_cli=1', - 'apc.shm_size=256M', -); - -server_start($file, $args); - -for ($i = 0; $i < 3; $i++) { - run_test_simple(); -} -echo 'done'; - ---EXPECTF-- -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -int(50000) -array(11) { - ["type"]=> - string(4) "user" - ["key"]=> - string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" - ["value"]=> - string(%d) "%s" - ["num_hits"]=> - int(0) - ["modified_time"]=> - int(%d) - ["creation_time"]=> - int(%d) - ["deletion_time"]=> - int(0) - ["access_time"]=> - int(%d) - ["ref_count"]=> - int(0) - ["mem_size"]=> - int(%d) - ["ttl"]=> - int(0) -} -done diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_bin_001.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_bin_001.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_bin_001.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_bin_001.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ ---TEST-- -APC: bindump user cache, variation 1 ---SKIPIF-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 ---FILE-- - -===DONE=== - ---EXPECTF-- -bool(false) -int(42) -===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_bin_002.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_bin_002.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/apc_bin_002.phpt 2014-06-12 13:39:03.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/apc_bin_002.phpt 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ ---TEST-- -APC: bindump user cache, variation 2 ---SKIPIF-- - - -===DONE=== - ---CLEAN-- - - -===DONE=== - ---CLEAN-- - ---INI-- -apc.enabled=1 -apc.enable_cli=1 ---FILE-- - -===DONE=== - ---CLEAN-- -b->f(); - return array('b'); - } -} - - -class B{ - const A_CONSTANT = 1; - public \$var; - - public function f(){ - \$this->var = self::A_CONSTANT; - } -} - - -if(isset(\$_SESSION['lalala'])){ - echo "
    ";
    -	\$a = \$_SESSION['lalala'];
    -	print_r(\$a);
    -} else {
    -	echo "no session yet, first run\n";
    -}
    -
    -//	another file
    -//	class A and B use autoload
    -\$b = new B();
    -\$a = new A();
    -\$a->b = \$b;
    -
    -\$_SESSION['lalala'] = \$a;
    -session_write_close();
    -FL;
    -
    -$args = array(
    -	'apc.enabled=1',
    -	'apc.cache_by_default=1',
    -	'apc.enable_cli=1',
    -);
    -
    -server_start($file, $args);
    -
    -$sid = md5(uniqid("call me maybe", true));
    -for ($i = 0; $i < 10; $i++) {
    -	$send = "GET / HTTP/1.1\n" .
    -			"Host: " . PHP_CLI_SERVER_HOSTNAME . "\n" .
    -			"Cookie: PHPSESSID=$sid;" .
    -			"\r\n\r\n";
    -	for ($j = 0; $j < $num_servers; $j++) {
    -		run_test(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT+$j, $send);
    -	}
    -}
    -echo 'done';
    ---EXPECT--
    -no session yet, first run
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -
    A Object
    -(
    -    [b] => B Object
    -        (
    -            [var] => 1
    -        )
    -
    -)
    -done
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/data/abc.data php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/data/abc.data
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/data/abc.data	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/data/abc.data	1970-01-01 00:00:00.000000000 +0000
    @@ -1 +0,0 @@
    -s:3:"123"
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/get_included_files_inc1.inc php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/get_included_files_inc1.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/get_included_files_inc1.inc	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/get_included_files_inc1.inc	1970-01-01 00:00:00.000000000 +0000
    @@ -1,3 +0,0 @@
    -
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/get_included_files_inc2.inc php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/get_included_files_inc2.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/get_included_files_inc2.inc	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/get_included_files_inc2.inc	1970-01-01 00:00:00.000000000 +0000
    @@ -1,4 +0,0 @@
    -
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/get_included_files_inc3.inc php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/get_included_files_inc3.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/get_included_files_inc3.inc	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/get_included_files_inc3.inc	1970-01-01 00:00:00.000000000 +0000
    @@ -1,4 +0,0 @@
    -
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_001.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_001.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_001.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_001.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,111 +0,0 @@
    ---TEST--
    -APC: APCIterator general
    ---SKIPIF--
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    ---FILE--
    -$value) {
    -  $keys[$key] = $value['key'];
    -}
    -ksort($keys);
    -var_dump($keys);
    -?>
    -===DONE===
    -
    ---EXPECT--
    -array(41) {
    -  ["key0"]=>
    -  string(4) "key0"
    -  ["key1"]=>
    -  string(4) "key1"
    -  ["key10"]=>
    -  string(5) "key10"
    -  ["key11"]=>
    -  string(5) "key11"
    -  ["key12"]=>
    -  string(5) "key12"
    -  ["key13"]=>
    -  string(5) "key13"
    -  ["key14"]=>
    -  string(5) "key14"
    -  ["key15"]=>
    -  string(5) "key15"
    -  ["key16"]=>
    -  string(5) "key16"
    -  ["key17"]=>
    -  string(5) "key17"
    -  ["key18"]=>
    -  string(5) "key18"
    -  ["key19"]=>
    -  string(5) "key19"
    -  ["key2"]=>
    -  string(4) "key2"
    -  ["key20"]=>
    -  string(5) "key20"
    -  ["key21"]=>
    -  string(5) "key21"
    -  ["key22"]=>
    -  string(5) "key22"
    -  ["key23"]=>
    -  string(5) "key23"
    -  ["key24"]=>
    -  string(5) "key24"
    -  ["key25"]=>
    -  string(5) "key25"
    -  ["key26"]=>
    -  string(5) "key26"
    -  ["key27"]=>
    -  string(5) "key27"
    -  ["key28"]=>
    -  string(5) "key28"
    -  ["key29"]=>
    -  string(5) "key29"
    -  ["key3"]=>
    -  string(4) "key3"
    -  ["key30"]=>
    -  string(5) "key30"
    -  ["key31"]=>
    -  string(5) "key31"
    -  ["key32"]=>
    -  string(5) "key32"
    -  ["key33"]=>
    -  string(5) "key33"
    -  ["key34"]=>
    -  string(5) "key34"
    -  ["key35"]=>
    -  string(5) "key35"
    -  ["key36"]=>
    -  string(5) "key36"
    -  ["key37"]=>
    -  string(5) "key37"
    -  ["key38"]=>
    -  string(5) "key38"
    -  ["key39"]=>
    -  string(5) "key39"
    -  ["key4"]=>
    -  string(4) "key4"
    -  ["key40"]=>
    -  string(5) "key40"
    -  ["key5"]=>
    -  string(4) "key5"
    -  ["key6"]=>
    -  string(4) "key6"
    -  ["key7"]=>
    -  string(4) "key7"
    -  ["key8"]=>
    -  string(4) "key8"
    -  ["key9"]=>
    -  string(4) "key9"
    -}
    -===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_002.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_002.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_002.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_002.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,40 +0,0 @@
    ---TEST--
    -APC: APCIterator regex
    ---SKIPIF--
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    -apc.file_update_protection=0
    ---FILE--
    -$value) {
    -  $vals[$key] = $value['key'];
    -}
    -ksort($vals);
    -var_dump($vals);
    -
    -?>
    -===DONE===
    -
    ---EXPECT--
    -array(4) {
    -  ["key10"]=>
    -  string(5) "key10"
    -  ["key20"]=>
    -  string(5) "key20"
    -  ["key30"]=>
    -  string(5) "key30"
    -  ["key40"]=>
    -  string(5) "key40"
    -}
    -===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_003.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_003.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_003.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_003.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,114 +0,0 @@
    ---TEST--
    -APC: APCIterator chunk size
    ---SKIPIF--
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    -apc.file_update_protection=0
    ---FILE--
    -$value) {
    -  $vals[$key] = $value['key'];
    -}
    -ksort($vals);
    -var_dump($vals);
    -
    -?>
    -===DONE===
    -
    ---EXPECT--
    -array(41) {
    -  ["key0"]=>
    -  string(4) "key0"
    -  ["key1"]=>
    -  string(4) "key1"
    -  ["key10"]=>
    -  string(5) "key10"
    -  ["key11"]=>
    -  string(5) "key11"
    -  ["key12"]=>
    -  string(5) "key12"
    -  ["key13"]=>
    -  string(5) "key13"
    -  ["key14"]=>
    -  string(5) "key14"
    -  ["key15"]=>
    -  string(5) "key15"
    -  ["key16"]=>
    -  string(5) "key16"
    -  ["key17"]=>
    -  string(5) "key17"
    -  ["key18"]=>
    -  string(5) "key18"
    -  ["key19"]=>
    -  string(5) "key19"
    -  ["key2"]=>
    -  string(4) "key2"
    -  ["key20"]=>
    -  string(5) "key20"
    -  ["key21"]=>
    -  string(5) "key21"
    -  ["key22"]=>
    -  string(5) "key22"
    -  ["key23"]=>
    -  string(5) "key23"
    -  ["key24"]=>
    -  string(5) "key24"
    -  ["key25"]=>
    -  string(5) "key25"
    -  ["key26"]=>
    -  string(5) "key26"
    -  ["key27"]=>
    -  string(5) "key27"
    -  ["key28"]=>
    -  string(5) "key28"
    -  ["key29"]=>
    -  string(5) "key29"
    -  ["key3"]=>
    -  string(4) "key3"
    -  ["key30"]=>
    -  string(5) "key30"
    -  ["key31"]=>
    -  string(5) "key31"
    -  ["key32"]=>
    -  string(5) "key32"
    -  ["key33"]=>
    -  string(5) "key33"
    -  ["key34"]=>
    -  string(5) "key34"
    -  ["key35"]=>
    -  string(5) "key35"
    -  ["key36"]=>
    -  string(5) "key36"
    -  ["key37"]=>
    -  string(5) "key37"
    -  ["key38"]=>
    -  string(5) "key38"
    -  ["key39"]=>
    -  string(5) "key39"
    -  ["key4"]=>
    -  string(4) "key4"
    -  ["key40"]=>
    -  string(5) "key40"
    -  ["key5"]=>
    -  string(4) "key5"
    -  ["key6"]=>
    -  string(4) "key6"
    -  ["key7"]=>
    -  string(4) "key7"
    -  ["key8"]=>
    -  string(4) "key8"
    -  ["key9"]=>
    -  string(4) "key9"
    -}
    -===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_004.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_004.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_004.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_004.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,40 +0,0 @@
    ---TEST--
    -APC: APCIterator regex & chunk size & list
    ---SKIPIF--
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    -apc.file_update_protection=0
    ---FILE--
    -$value) {
    -  $vals[$key] = $value['key'];
    -}
    -ksort($vals);
    -var_dump($vals);
    -
    -?>
    -===DONE===
    -
    ---EXPECT--
    -array(4) {
    -  ["key10"]=>
    -  string(5) "key10"
    -  ["key20"]=>
    -  string(5) "key20"
    -  ["key30"]=>
    -  string(5) "key30"
    -  ["key40"]=>
    -  string(5) "key40"
    -}
    -===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_005.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_005.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_005.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_005.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,118 +0,0 @@
    ---TEST--
    -APC: APCIterator delete
    ---SKIPIF--
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    ---FILE--
    -$value) {
    -  $vals[$key] = $value['key'];
    -}
    -foreach($it2 as $key=>$value) {
    -  $vals2[$key] = $value['key'];
    -}
    -ksort($vals2);
    -var_dump($vals);
    -var_dump($vals2);
    -
    -?>
    -===DONE===
    -
    ---EXPECT--
    -array(0) {
    -}
    -array(37) {
    -  ["key0"]=>
    -  string(4) "key0"
    -  ["key1"]=>
    -  string(4) "key1"
    -  ["key11"]=>
    -  string(5) "key11"
    -  ["key12"]=>
    -  string(5) "key12"
    -  ["key13"]=>
    -  string(5) "key13"
    -  ["key14"]=>
    -  string(5) "key14"
    -  ["key15"]=>
    -  string(5) "key15"
    -  ["key16"]=>
    -  string(5) "key16"
    -  ["key17"]=>
    -  string(5) "key17"
    -  ["key18"]=>
    -  string(5) "key18"
    -  ["key19"]=>
    -  string(5) "key19"
    -  ["key2"]=>
    -  string(4) "key2"
    -  ["key21"]=>
    -  string(5) "key21"
    -  ["key22"]=>
    -  string(5) "key22"
    -  ["key23"]=>
    -  string(5) "key23"
    -  ["key24"]=>
    -  string(5) "key24"
    -  ["key25"]=>
    -  string(5) "key25"
    -  ["key26"]=>
    -  string(5) "key26"
    -  ["key27"]=>
    -  string(5) "key27"
    -  ["key28"]=>
    -  string(5) "key28"
    -  ["key29"]=>
    -  string(5) "key29"
    -  ["key3"]=>
    -  string(4) "key3"
    -  ["key31"]=>
    -  string(5) "key31"
    -  ["key32"]=>
    -  string(5) "key32"
    -  ["key33"]=>
    -  string(5) "key33"
    -  ["key34"]=>
    -  string(5) "key34"
    -  ["key35"]=>
    -  string(5) "key35"
    -  ["key36"]=>
    -  string(5) "key36"
    -  ["key37"]=>
    -  string(5) "key37"
    -  ["key38"]=>
    -  string(5) "key38"
    -  ["key39"]=>
    -  string(5) "key39"
    -  ["key4"]=>
    -  string(4) "key4"
    -  ["key5"]=>
    -  string(4) "key5"
    -  ["key6"]=>
    -  string(4) "key6"
    -  ["key7"]=>
    -  string(4) "key7"
    -  ["key8"]=>
    -  string(4) "key8"
    -  ["key9"]=>
    -  string(4) "key9"
    -}
    -===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_006.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_006.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_006.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_006.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,1284 +0,0 @@
    ---TEST--
    -APC: APCIterator formats 
    ---SKIPIF--
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    -apc.file_update_protection=0
    -apc.user_entries_hint=4096
    ---FILE--
    - $format) {
    -	if (APCU_APC_FULL_BC) {
    -		$it_array[$idx] = new APCIterator('user', NULL, $format);
    -	} else {
    -		$it_array[$idx] = new APCIterator(NULL, $format);
    -	}
    -}
    -
    -for($i = 0; $i < 11; $i++) {
    -  apc_store("key$i", "value$i");
    -}
    -
    -foreach ($it_array as $idx => $it) {
    -  print_it($it, $idx);
    -}
    -
    -function print_it($it, $idx) {
    -  echo "IT #$idx\n";
    -  echo "============================\n";
    -  foreach ($it as $key=>$value) {
    -    var_dump($key);
    -    var_dump($value);
    -  }
    -  echo "============================\n\n";
    -}
    -
    -?>
    -===DONE===
    -
    ---EXPECTF--
    -IT #0
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["key"]=>
    -  string(5) "key10"
    -}
    -string(4) "key0"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key0"
    -}
    -string(4) "key1"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key1"
    -}
    -string(4) "key2"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key2"
    -}
    -string(4) "key3"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key3"
    -}
    -string(4) "key4"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key4"
    -}
    -string(4) "key5"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key5"
    -}
    -string(4) "key6"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key6"
    -}
    -string(4) "key7"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key7"
    -}
    -string(4) "key8"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key8"
    -}
    -string(4) "key9"
    -array(1) {
    -  ["key"]=>
    -  string(4) "key9"
    -}
    -============================
    -
    -IT #1
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["value"]=>
    -  string(7) "value10"
    -}
    -string(4) "key0"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value0"
    -}
    -string(4) "key1"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value1"
    -}
    -string(4) "key2"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value2"
    -}
    -string(4) "key3"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value3"
    -}
    -string(4) "key4"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value4"
    -}
    -string(4) "key5"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value5"
    -}
    -string(4) "key6"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value6"
    -}
    -string(4) "key7"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value7"
    -}
    -string(4) "key8"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value8"
    -}
    -string(4) "key9"
    -array(1) {
    -  ["value"]=>
    -  string(6) "value9"
    -}
    -============================
    -
    -IT #2
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["num_hits"]=>
    -  int(0)
    -}
    -============================
    -
    -IT #3
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["modified_time"]=>
    -  int(%d)
    -}
    -============================
    -
    -IT #4
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["creation_time"]=>
    -  int(%d)
    -}
    -============================
    -
    -IT #5
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["deletion_time"]=>
    -  int(0)
    -}
    -============================
    -
    -IT #6
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["access_time"]=>
    -  int(%d)
    -}
    -============================
    -
    -IT #7
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["ref_count"]=>
    -  int(0)
    -}
    -============================
    -
    -IT #8
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -============================
    -
    -IT #9
    -============================
    -string(5) "key10"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key0"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key1"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key2"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key3"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key4"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key5"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key6"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key7"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key8"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key9"
    -array(1) {
    -  ["ttl"]=>
    -  int(0)
    -}
    -============================
    -
    -IT #10
    -============================
    -string(5) "key10"
    -array(0) {
    -}
    -string(4) "key0"
    -array(0) {
    -}
    -string(4) "key1"
    -array(0) {
    -}
    -string(4) "key2"
    -array(0) {
    -}
    -string(4) "key3"
    -array(0) {
    -}
    -string(4) "key4"
    -array(0) {
    -}
    -string(4) "key5"
    -array(0) {
    -}
    -string(4) "key6"
    -array(0) {
    -}
    -string(4) "key7"
    -array(0) {
    -}
    -string(4) "key8"
    -array(0) {
    -}
    -string(4) "key9"
    -array(0) {
    -}
    -============================
    -
    -IT #11
    -============================
    -string(5) "key10"
    -array(10) {
    -  ["key"]=>
    -  string(5) "key10"
    -  ["value"]=>
    -  string(7) "value10"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key0"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key0"
    -  ["value"]=>
    -  string(6) "value0"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key1"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key1"
    -  ["value"]=>
    -  string(6) "value1"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key2"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key2"
    -  ["value"]=>
    -  string(6) "value2"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key3"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key3"
    -  ["value"]=>
    -  string(6) "value3"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key4"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key4"
    -  ["value"]=>
    -  string(6) "value4"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key5"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key5"
    -  ["value"]=>
    -  string(6) "value5"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key6"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key6"
    -  ["value"]=>
    -  string(6) "value6"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key7"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key7"
    -  ["value"]=>
    -  string(6) "value7"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key8"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key8"
    -  ["value"]=>
    -  string(6) "value8"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -string(4) "key9"
    -array(10) {
    -  ["key"]=>
    -  string(4) "key9"
    -  ["value"]=>
    -  string(6) "value9"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -  ["ttl"]=>
    -  int(0)
    -}
    -============================
    -
    -IT #12
    -============================
    -string(5) "key10"
    -array(9) {
    -  ["key"]=>
    -  string(5) "key10"
    -  ["value"]=>
    -  string(7) "value10"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key0"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key0"
    -  ["value"]=>
    -  string(6) "value0"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key1"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key1"
    -  ["value"]=>
    -  string(6) "value1"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key2"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key2"
    -  ["value"]=>
    -  string(6) "value2"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key3"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key3"
    -  ["value"]=>
    -  string(6) "value3"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key4"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key4"
    -  ["value"]=>
    -  string(6) "value4"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key5"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key5"
    -  ["value"]=>
    -  string(6) "value5"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key6"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key6"
    -  ["value"]=>
    -  string(6) "value6"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key7"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key7"
    -  ["value"]=>
    -  string(6) "value7"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key8"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key8"
    -  ["value"]=>
    -  string(6) "value8"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key9"
    -array(9) {
    -  ["key"]=>
    -  string(4) "key9"
    -  ["value"]=>
    -  string(6) "value9"
    -  ["num_hits"]=>
    -  int(0)
    -  ["modified_time"]=>
    -  int(%d)
    -  ["creation_time"]=>
    -  int(%d)
    -  ["deletion_time"]=>
    -  int(0)
    -  ["access_time"]=>
    -  int(%d)
    -  ["ref_count"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -============================
    -
    -IT #13
    -============================
    -string(5) "key10"
    -array(3) {
    -  ["key"]=>
    -  string(5) "key10"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key0"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key0"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key1"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key1"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key2"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key2"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key3"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key3"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key4"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key4"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key5"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key5"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key6"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key6"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key7"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key7"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key8"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key8"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -string(4) "key9"
    -array(3) {
    -  ["key"]=>
    -  string(4) "key9"
    -  ["num_hits"]=>
    -  int(0)
    -  ["mem_size"]=>
    -  int(%d)
    -}
    -============================
    -
    -===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_007.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_007.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_007.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_007.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,37 +0,0 @@
    ---TEST--
    -APC: APCIterator Overwriting the ctor
    ---SKIPIF--
    -
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    ---FILE--
    -rewind(),
    -	$obj->current(),
    -	$obj->key(),
    -	$obj->next(),
    -	$obj->valid(),
    -	$obj->getTotalHits(),
    -	$obj->getTotalSize(),
    -	$obj->getTotalCount(),
    -	apc_delete($obj)
    -);
    -?>
    ---EXPECTF--
    -bool(false)
    -bool(false)
    -bool(false)
    -bool(false)
    -bool(false)
    -bool(false)
    -bool(false)
    -bool(false)
    -bool(false)
    -
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_008.phpt php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_008.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/iterator_008.phpt	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/iterator_008.phpt	1970-01-01 00:00:00.000000000 +0000
    @@ -1,19 +0,0 @@
    ---TEST--
    -APC: APCIterator::__construct() signature compatibility
    ---SKIPIF--
    -
    -
    ---INI--
    -apc.enabled=1
    -apc.enable_cli=1
    ---FILE--
    -
    -==DONE==
    ---EXPECTF--
    -==DONE==
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/php_5_3_ns.inc php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/php_5_3_ns.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/php_5_3_ns.inc	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/php_5_3_ns.inc	1970-01-01 00:00:00.000000000 +0000
    @@ -1,18 +0,0 @@
    - STDIN,
    -		1 => STDOUT,
    -		2 => STDERR,
    -	);
    -
    -	$php_args = getenv('TEST_PHP_ARGS');
    -	if (empty($php_args)) {
    -		$ext = (substr(PHP_OS, 0, 3) == 'WIN') ? 'php_apcu.dll' : 'apcu.so';
    -		$php_args = "-d extension_dir=$doc_root/../modules -d extension=$ext";
    -	}
    -	if ($php_opts) {
    -		$php_args = "$php_args -d " . implode(' -d ', $php_opts);;
    -	}
    -
    -	if (substr(PHP_OS, 0, 3) == 'WIN') {
    -		$cmd = "{$php_executable} -n $php_args -t {$doc_root} -S $host:$port";
    -		if (!$no_router) {
    -			$cmd .= " {$router}";
    -		}
    -
    -		$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true,  "suppress_errors" => true));
    -	} else {
    -		$cmd = "exec {$php_executable} -n $php_args -t {$doc_root} -S $host:$port";
    -		if (!$no_router) {
    -			$cmd .= " {$doc_root}/{$router}";
    -		}
    -		$cmd .= " 2>/dev/null";
    -
    -		$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
    -	}
    -	
    -	// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
    -	//       it might not be listening yet...need to wait until fsockopen() call returns
    -    $i = 0;
    -    while (($i++ < 10) && !connection_test($host, $port)) {
    -        usleep(100000);
    -    }
    -
    -	return $handle;
    -}
    -
    -function server_start($code = 'echo "Hello world";', $php_opts = array(), $no_router = FALSE)
    -{
    -	global $doc_root, $router, $handles, $ports, $num_servers;
    -
    -
    -	if ($code) {
    -		file_put_contents($doc_root . '/' . $router, '');
    -	}
    -
    -	for ($i = 0; $i < $num_servers; $i++) {
    -		$h = server_start_one(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT+$i, $code, $php_opts, $no_router);
    -		$handles[] = $h;
    -	}	
    -
    -	register_shutdown_function(
    -		function($handles) use($router) {
    -			foreach ($handles as $handle) {
    -				proc_terminate($handle);
    -			}
    -			@unlink(__DIR__ . "/{$router}");
    -		},
    -			$handles
    -		);
    -	// don't bother sleeping, server is already up
    -	// server can take a variable amount of time to be up, so just sleeping a guessed amount of time
    -	// does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass
    -	// sleeping doesn't work.
    -}
    -
    -function get_response($fp, $data_only = true)
    -{
    -	$s = '';
    -
    -	while (!feof($fp)) {
    -		$s .= fgets($fp);
    -	}
    -
    -	if ($data_only) {
    -		$parts = explode("\r\n\r\n", $s);
    -		$s = $parts[1];
    -	}
    -
    -	return $s;
    -}
    -
    -
    -function connection_test($host, $port)
    -{
    -	$port = intval($port)?:80;
    -
    -	$fp = @fsockopen($host, $port, $errno, $errstr, 2);
    -	if (!$fp) {
    -		return false;
    -	}
    -
    -	$send = "GET / HTTP/1.1\nHost: {$host}\r\n\r\n";
    -
    -	/* will not out here, just test if the connection has worked*/
    -	if(@fwrite($fp, $send)) {
    -		get_response($fp);
    -		fclose($fp);
    -
    -		return true;
    -	}
    -
    -	@fclose($fp);
    -
    -	return false;
    -}
    -
    -function run_test_simple($request_uri = NULL)
    -{
    -    global $num_servers;
    -	$send = "GET /" . $request_uri ." HTTP/1.1\nHost: " . PHP_CLI_SERVER_HOSTNAME . "\r\n\r\n";
    -
    -	for ($i = 0; $i < $num_servers; $i++) {
    -		run_test(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT+$i, $send);
    -	}
    -}
    -
    -function run_test($host, $port, $send)
    -{
    -	$fp = fsockopen($host, $port, $errno, $errstr, 3);
    -	if (!$fp) {
    -	  die(sprintf("connect failed errno=%d errstr='%s'", $errno, $errstr));
    -	}
    -
    -	if(fwrite($fp, $send)) {
    -		echo get_response($fp);
    -	}
    -
    -	fclose($fp);
    -}
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/skipif.inc php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/skipif.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/tests/skipif.inc	2014-06-12 13:39:03.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/tests/skipif.inc	1970-01-01 00:00:00.000000000 +0000
    @@ -1,3 +0,0 @@
    -
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.6/TODO php5-easybib-apcu-4.0.7/apcu-4.0.6/TODO
    --- php5-easybib-apcu-4.0.6/apcu-4.0.6/TODO	2014-06-12 13:39:04.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.6/TODO	1970-01-01 00:00:00.000000000 +0000
    @@ -1,35 +0,0 @@
    -Known Bugs
    - 
    -1.   Gallery2 doesn't work with PHP5+APC.  There is something wrong
    -     with the way methods are restored in some edge case I haven't
    -     been able to figure out yet.
    -     To reproduce install gallery2 and click down to an individual photo.
    -
    -2.   apc_store() probably needs some checks to skip trying to store
    -     internal classes.  Something along the lines of:
    -
    -     if(Z_TYPE_P(val) == IS_OBJECT) {
    -        zend_class_entry *ce = Z_OBJCE_P(val);
    -        if(ce->type == ZEND_INTERNAL_CLASS) {
    -            php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot cache internal objects");
    -            RETURN_FALSE;
    -        }
    -     }
    -
    -     in the apc_store() function in php_apc.c but I am wondering if it needs to do more
    -     than that.
    -
    -Windows
    -
    -1.   The following configurations (build arguments) have not been implemented yet
    -
    -          (*) --enable-apc-mmap         	Memory mapping support
    -          (*) --enable-apc-sem         		Semaphore locking support (FCNTL replacement)
    -          (*) --enable-apc-phreadmutex		Thread mutexes, while implemented we should probably rename the internals to thread
    -	  (*) --enable-apc-pthreadrwlocks	Thread mutexes, read/write locking
    -
    -2.   Non-blocking locks is not supported either
    -
    -3.   Update fileinfo to support stat info in a more portable way (see PECL #17903)
    -
    -4.   Check whether the signal handling needs to be enabled, and if it makes sense on Windows
    \ No newline at end of file
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_api.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_api.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_api.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_api.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,29 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APCu                                                                 |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2013 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.               |
    +  +----------------------------------------------------------------------+
    +  | Author: Joe Watkins                          |
    +  +----------------------------------------------------------------------+
    + */
    +
    +#ifndef APC_API_H
    +#define APC_API_H
    +
    +#include "apc.h"
    +#include "apc_lock_api.h"
    +#include "apc_pool_api.h"
    +#include "apc_sma_api.h"
    +#include "apc_cache_api.h"
    +#include "apc_bin_api.h"
    +
    +#endif
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_bin_api.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_bin_api.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_bin_api.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_bin_api.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,65 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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                                  |
    +  +----------------------------------------------------------------------+
    +
    + */
    +
    +/* $Id: apc_bin_api.h 328743 2012-12-12 07:58:32Z ab $ */
    +
    +#ifndef APC_BIN_API_H
    +#define APC_BIN_API_H
    +
    +#include "ext/standard/basic_functions.h"
    +
    +/* APC binload flags */
    +#define APC_BIN_VERIFY_MD5    1 << 0
    +#define APC_BIN_VERIFY_CRC32  1 << 1
    +
    +typedef struct _apc_bd_entry_t {
    +    unsigned char type;
    +    uint num_functions;
    +    uint num_classes;
    +	struct {
    +		char*  str;
    +		uint   len;
    +	} key;
    +    apc_cache_entry_t val;
    +} apc_bd_entry_t;
    +
    +typedef struct _apc_bd_t {
    +    unsigned int size;
    +    int swizzled;
    +    unsigned char md5[16];
    +    php_uint32 crc;
    +    unsigned int num_entries;
    +    apc_bd_entry_t *entries;
    +    int num_swizzled_ptrs;
    +    void ***swizzled_ptrs;
    +} apc_bd_t;
    +
    +PHP_APCU_API apc_bd_t* apc_bin_dump(apc_cache_t* cache, HashTable *user_vars TSRMLS_DC);
    +PHP_APCU_API int apc_bin_load(apc_cache_t* cache, apc_bd_t *bd, int flags TSRMLS_DC);
    +
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_bin.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_bin.c
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_bin.c	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_bin.c	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,557 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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                                  |
    +  |          Xinchen Hui                               |
    +  +----------------------------------------------------------------------+
    +
    + */
    +
    +/* $Id: apc_bin.c 328828 2012-12-18 15:18:39Z remi $ */
    +
    +/* Creates an architecture specific binary output to a string or file containing
    + * the current cache contents.  This is accomplished via the apc_copy_* functions and 
    + * "swizzling" pointers to achieve position independence.
    + */
    +
    +#include "apc_globals.h"
    +#include "apc_bin.h"
    +#include "apc_php.h"
    +#include "apc_sma.h"
    +#include "apc_pool.h"
    +#include "apc_cache.h"
    +
    +#include "ext/standard/md5.h"
    +
    +/* in apc_cache.c */
    +extern zval* apc_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC);
    +
    +#define APC_BINDUMP_DEBUG 0
    +
    +#if APC_BINDUMP_DEBUG
    +
    +#define SWIZZLE(bd, ptr)  \
    +    do { \
    +        if((ptrdiff_t)bd < (ptrdiff_t)ptr && (size_t)ptr < ((size_t)bd + bd->size)) { \
    +            printf("SWIZZLE: %x ~> ", ptr); \
    +            ptr = (void*)((ptrdiff_t)(ptr) - (ptrdiff_t)(bd)); \
    +            printf("%x in %s on line %d", ptr, __FILE__, __LINE__); \
    +        } else if((ptrdiff_t)ptr > bd->size) { /* not swizzled */ \
    +            apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (ptrdiff_t)bd, ptr, ((size_t)bd + bd->size), __FILE__, __LINE__); \
    +            return; \
    +        } \
    +        printf("\n"); \
    +    } while(0);
    +
    +#define UNSWIZZLE(bd, ptr)  \
    +    do { \
    +      printf("UNSWIZZLE: %x -> ", ptr); \
    +      ptr = (void*)((ptrdiff_t)(ptr) + (ptrdiff_t)(bd)); \
    +      printf("%x in %s on line %d \n", ptr, __FILE__, __LINE__); \
    +    } while(0);
    +
    +#else    /* !APC_BINDUMP_DEBUG */
    +
    +#define SWIZZLE(bd, ptr) \
    +    do { \
    +        if((ptrdiff_t)bd < (ptrdiff_t)ptr && (size_t)ptr < ((size_t)bd + bd->size)) { \
    +            ptr = (void*)((ptrdiff_t)(ptr) - (ptrdiff_t)(bd)); \
    +        } else if((size_t)ptr > bd->size) { /* not swizzled */ \
    +            apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (ptrdiff_t)bd, ptr, ((size_t)bd + bd->size), __FILE__, __LINE__); \
    +            return NULL; \
    +        } \
    +    } while(0);
    +
    +#define UNSWIZZLE(bd, ptr) \
    +    do { \
    +      ptr = (void*)((ptrdiff_t)(ptr) + (ptrdiff_t)(bd)); \
    +    } while(0);
    +
    +#endif
    +
    +static void *apc_bd_alloc(size_t size TSRMLS_DC);
    +static void apc_bd_free(void *ptr TSRMLS_DC);
    +static void *apc_bd_alloc_ex(void *ptr_new, size_t size TSRMLS_DC);
    +
    +typedef void (*apc_swizzle_cb_t)(apc_bd_t *bd, zend_llist *ll, void *ptr TSRMLS_DC);
    +
    +#if APC_BINDUMP_DEBUG
    +#define apc_swizzle_ptr(bd, ctxt, ll, ptr) _apc_swizzle_ptr(bd, ctxt, ll, (void*)ptr, __FILE__, __LINE__ TSRMLS_CC)
    +#else
    +#define apc_swizzle_ptr(bd, ctxt, ll, ptr) _apc_swizzle_ptr(bd, ctxt, ll, (void*)ptr, NULL, 0 TSRMLS_CC)
    +#endif
    +
    +static void _apc_swizzle_ptr(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, void **ptr, const char* file, int line TSRMLS_DC);
    +static void apc_swizzle_hashtable(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, HashTable *ht, apc_swizzle_cb_t swizzle_cb, int is_ptr TSRMLS_DC);
    +static void apc_swizzle_zval(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, zval *zv TSRMLS_DC);
    +
    +static apc_bd_t* apc_swizzle_bd(apc_bd_t* bd, zend_llist *ll TSRMLS_DC);
    +static int apc_unswizzle_bd(apc_bd_t *bd, int flags TSRMLS_DC);
    +
    +/* {{{ apc_bd_alloc
    + *  callback for copy_* functions */
    +static void *apc_bd_alloc(size_t size TSRMLS_DC) {
    +    return apc_bd_alloc_ex(NULL, size TSRMLS_CC);
    +} /* }}} */
    +
    +/* {{{ apc_bd_free
    + *  callback for copy_* functions */
    +static void apc_bd_free(void *ptr TSRMLS_DC) {
    +    size_t *size;
    +    if(zend_hash_index_find(&APCG(apc_bd_alloc_list), (ulong)ptr, (void**)&size) == FAILURE) {
    +        apc_error("apc_bd_free could not free pointer (not found in list: %x)" TSRMLS_CC, ptr);
    +        return;
    +    }
    +    APCG(apc_bd_alloc_ptr) = (void*)((size_t)APCG(apc_bd_alloc_ptr) - *size);
    +    zend_hash_index_del(&APCG(apc_bd_alloc_list), (ulong)ptr);
    +} /* }}} */
    +
    +/* {{{ apc_bd_alloc_ex
    + *  set ranges or allocate a block of data from an already (e)malloc'd range.
    + *  if ptr_new is not NULL, it will reset the pointer to start at ptr_new,
    + *  with a range of size.  If ptr_new is NULL, returns the next available
    + *  block of given size.
    + */
    +static void *apc_bd_alloc_ex(void *ptr_new, size_t size TSRMLS_DC) {
    +    void *rval;
    +
    +    rval = APCG(apc_bd_alloc_ptr);
    +    if(ptr_new != NULL) {  /* reset ptrs */
    +      APCG(apc_bd_alloc_ptr) = ptr_new;
    +      APCG(apc_bd_alloc_ubptr) = (void*)((unsigned char *) ptr_new + size);
    +    } else {  /* alloc block */
    +      APCG(apc_bd_alloc_ptr) = (void*)((size_t)APCG(apc_bd_alloc_ptr) + size);
    +#if APC_BINDUMP_DEBUG
    +      apc_notice("apc_bd_alloc: rval: 0x%x  ptr: 0x%x  ubptr: 0x%x  size: %d" TSRMLS_CC, rval, APCG(apc_bd_alloc_ptr), APCG(apc_bd_alloc_ubptr), size);
    +#endif
    +      if(APCG(apc_bd_alloc_ptr) > APCG(apc_bd_alloc_ubptr)) {
    +          apc_error("Exceeded bounds check in apc_bd_alloc_ex by %d bytes." TSRMLS_CC, (unsigned char *) APCG(apc_bd_alloc_ptr) - (unsigned char *) APCG(apc_bd_alloc_ubptr));
    +          return NULL;
    +      }
    +      zend_hash_index_update(&APCG(apc_bd_alloc_list), (ulong)rval, &size, sizeof(size_t), NULL);
    +    }
    +
    +    return rval;
    +} /* }}} */
    +
    +/* {{{ _apc_swizzle_ptr */
    +static void _apc_swizzle_ptr(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, void **ptr, const char* file, int line TSRMLS_DC) {
    +    if(*ptr) {
    +        if((ptrdiff_t)bd < (ptrdiff_t)*ptr && (size_t)*ptr < ((size_t)bd + bd->size)) {
    +            zend_llist_add_element(ll, &ptr);
    +#if APC_BINDUMP_DEBUG
    +            printf("[%06d] apc_swizzle_ptr: %x -> %x ", zend_llist_count(ll), ptr, *ptr);
    +            printf(" in %s on line %d \n", file, line);
    +#endif
    +        } else if((size_t)ptr > bd->size) {
    +            apc_error("pointer to be swizzled is not within allowed memory range! (%x < %x < %x) in %s on %d" TSRMLS_CC, (ptrdiff_t)bd, *ptr, ((ptrdiff_t)bd + bd->size), file, line); \
    +            return;
    +        }
    +    }
    +} /* }}} */
    +
    +/* {{{ apc_swizzle_hashtable */
    +static void apc_swizzle_hashtable(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, HashTable *ht, apc_swizzle_cb_t swizzle_cb, int is_ptr TSRMLS_DC) {
    +    uint i;
    +    Bucket **bp, **bp_prev;
    +
    +    bp = &ht->pListHead;
    +    while(*bp) {
    +        bp_prev = bp;
    +        bp = &(*bp)->pListNext;
    +        if(is_ptr) {
    +            swizzle_cb(bd, ll, *(void**)(*bp_prev)->pData TSRMLS_CC);
    +            apc_swizzle_ptr(bd, ctxt, ll, (*bp_prev)->pData);
    +        } else {
    +            swizzle_cb(bd, ll, (void**)(*bp_prev)->pData TSRMLS_CC);
    +        }
    +#ifdef ZEND_ENGINE_2_4
    +        if ((*bp_prev)->nKeyLength) {
    +            if (IS_INTERNED((*bp_prev)->arKey)) {
    +                /* we should dump that internal string out */
    +                char *tmp = apc_bd_alloc((*bp_prev)->nKeyLength TSRMLS_CC);
    +                memcpy(tmp, (*bp_prev)->arKey, (*bp_prev)->nKeyLength);
    +                (*bp_prev)->arKey = tmp;
    +            }
    +            apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->arKey);
    +        }
    +#endif
    +        apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pData);
    +        if((*bp_prev)->pDataPtr) {
    +            apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pDataPtr);
    +        }
    +        if((*bp_prev)->pListLast) {
    +            apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pListLast);
    +        }
    +        if((*bp_prev)->pNext) {
    +            apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pNext);
    +        }
    +        if((*bp_prev)->pLast) {
    +            apc_swizzle_ptr(bd, ctxt, ll, &(*bp_prev)->pLast);
    +        }
    +        apc_swizzle_ptr(bd, ctxt, ll, bp_prev);
    +    }
    +    for(i=0; i < ht->nTableSize; i++) {
    +        if(ht->arBuckets[i]) {
    +            apc_swizzle_ptr(bd, ctxt, ll, &ht->arBuckets[i]);
    +        }
    +    }
    +    apc_swizzle_ptr(bd, ctxt, ll, &ht->pListTail);
    +
    +    apc_swizzle_ptr(bd, ctxt, ll, &ht->arBuckets);
    +} /* }}} */
    +
    +/* {{{ apc_swizzle_zval */
    +static void apc_swizzle_zval(apc_bd_t *bd, apc_context_t* ctxt, zend_llist *ll, zval *zv TSRMLS_DC) {
    +
    +    if(ctxt->copied.nTableSize) {
    +        if(zend_hash_index_exists(&ctxt->copied, (ulong)zv)) {
    +          return;
    +        }
    +        zend_hash_index_update(&ctxt->copied, (ulong)zv, (void**)&zv, sizeof(zval*), NULL);
    +    }
    +
    +    switch(Z_TYPE_P(zv) & IS_CONSTANT_TYPE_MASK) {
    +        case IS_NULL:
    +        case IS_LONG:
    +        case IS_DOUBLE:
    +        case IS_BOOL:
    +        case IS_RESOURCE:
    +            /* nothing to do */
    +            break;
    +        case IS_CONSTANT:
    +        case IS_STRING:
    +            apc_swizzle_ptr(bd, ctxt, ll, &zv->value.str.val);
    +            break;
    +        case IS_ARRAY:
    +            apc_swizzle_hashtable(bd, ctxt, ll, zv->value.ht, (apc_swizzle_cb_t)apc_swizzle_zval, 1 TSRMLS_CC);
    +            apc_swizzle_ptr(bd, ctxt, ll, &zv->value.ht);
    +            break;
    +        case IS_OBJECT:
    +            break;
    +        default:
    +            assert(0); /* shouldn't happen */
    +    }
    +} /* }}} */
    +
    +/* {{{ apc_swizzle_bd */
    +static apc_bd_t* apc_swizzle_bd(apc_bd_t* bd, zend_llist *ll TSRMLS_DC) {
    +    unsigned int i;
    +    int count;
    +    PHP_MD5_CTX context;
    +    unsigned char digest[16];
    +    register php_uint32 crc;
    +    void ***ptr;
    +    void ***ptr_list;
    +
    +    count = zend_llist_count(ll);
    +    ptr_list = emalloc(count * sizeof(void**));
    +    ptr = zend_llist_get_first(ll);
    +    for(i=0; i < count; i++) {
    +#if APC_BINDUMP_DEBUG
    +        printf("[%06d] ", i+1);
    +#endif
    +        SWIZZLE(bd, **ptr); /* swizzle ptr */
    +        if((ptrdiff_t)bd < (ptrdiff_t)*ptr && (size_t)*ptr < ((size_t)bd + bd->size)) {  /* exclude ptrs that aren't actually included in the ptr list */
    +#if APC_BINDUMP_DEBUG
    +            printf("[------] ");
    +#endif
    +            SWIZZLE(bd, *ptr);  /* swizzle ptr list */
    +            ptr_list[i] = *ptr;
    +        }
    +        ptr = zend_llist_get_next(ll);
    +    }
    +    SWIZZLE(bd, bd->entries);
    +
    +    if(count > 0) {
    +        bd = erealloc(bd, bd->size + (count * sizeof(void**)));
    +        bd->num_swizzled_ptrs = count;
    +        bd->swizzled_ptrs = (void***)((unsigned char *)bd + bd->size -2);   /* extra -1 for null termination */
    +        bd->size += count * sizeof(void**);
    +        memcpy(bd->swizzled_ptrs, ptr_list, count * sizeof(void**));
    +        SWIZZLE(bd, bd->swizzled_ptrs);
    +    } else {
    +        bd->num_swizzled_ptrs = 0;
    +        bd->swizzled_ptrs = NULL;
    +    }
    +    ((unsigned char*)bd)[((bd->size >= 1) ? (bd->size-1) : 0)] = 0;  /* silence null termination for zval strings */
    +    efree(ptr_list);
    +    bd->swizzled = 1;
    +
    +    /* Generate MD5/CRC32 checksum */
    +    memset(bd->md5, 0, 16);
    +    bd->crc=0;
    +
    +    PHP_MD5Init(&context);
    +    PHP_MD5Update(&context, (const unsigned char*)bd, bd->size);
    +    PHP_MD5Final(digest, &context);
    +    crc = apc_crc32((unsigned char*)bd, bd->size);
    +
    +    memmove(bd->md5, digest, 16);
    +    bd->crc = crc;
    +
    +    return bd;
    +} /* }}} */
    +
    +/* {{{ apc_unswizzle_bd */
    +static int apc_unswizzle_bd(apc_bd_t *bd, int flags TSRMLS_DC) {
    +    unsigned int i;
    +    unsigned char md5_orig[16];
    +    unsigned char digest[16];
    +    PHP_MD5_CTX context;
    +    register php_uint32 crc;
    +    php_uint32 crc_orig;
    +
    +    /* Verify the md5 or crc32 before we unswizzle */
    +    memmove(md5_orig, bd->md5, 16);
    +    memset(bd->md5, 0, 16);
    +    crc_orig = bd->crc;
    +    bd->crc=0;
    +
    +    if(flags & APC_BIN_VERIFY_MD5) {
    +        PHP_MD5Init(&context);
    +        PHP_MD5Update(&context, (const unsigned char*)bd, bd->size);
    +        PHP_MD5Final(digest, &context);
    +        if(memcmp(md5_orig, digest, 16)) {
    +            apc_error("MD5 checksum of binary dump failed." TSRMLS_CC);
    +            return -1;
    +        }
    +    }
    +    if(flags & APC_BIN_VERIFY_CRC32) {
    +        crc = apc_crc32((unsigned char*)bd, bd->size);
    +        if(crc_orig != crc) {
    +            apc_error("CRC32 checksum of binary dump failed." TSRMLS_CC);
    +            return -1;
    +        }
    +    }
    +    memcpy(bd->md5, md5_orig, 16); /* add back md5 checksum */
    +    bd->crc = crc_orig;
    +
    +    UNSWIZZLE(bd, bd->entries);
    +    UNSWIZZLE(bd, bd->swizzled_ptrs);
    +    for(i=0; i < bd->num_swizzled_ptrs; i++) {
    +        if(bd->swizzled_ptrs[i]) {
    +            UNSWIZZLE(bd, bd->swizzled_ptrs[i]);
    +            if(*bd->swizzled_ptrs[i] && (*bd->swizzled_ptrs[i] < (void*)bd)) {
    +                UNSWIZZLE(bd, *bd->swizzled_ptrs[i]);
    +            }
    +        }
    +    }
    +
    +    bd->swizzled=0;
    +
    +    return 0;
    +} /* }}} */
    +
    +/* {{{ apc_bin_checkfilter */
    +static int apc_bin_checkfilter(HashTable *filter, const char *key, uint key_len) {
    +    zval **zptr;
    +
    +    if(filter == NULL) {
    +        return 1;
    +    }
    +
    +    if(zend_hash_find(filter, (char*)key, key_len, (void**)&zptr) == SUCCESS) {
    +        if(Z_TYPE_PP(zptr) == IS_LONG && Z_LVAL_PP(zptr) == 0) {
    +            return 0;
    +        }
    +    } else {
    +        return 0;
    +    }
    +
    +
    +    return 1;
    +} /* }}} */
    +
    +/* {{{ apc_bin_dump */
    +PHP_APCU_API apc_bd_t* apc_bin_dump(apc_cache_t* cache, HashTable *user_vars TSRMLS_DC) {
    +    apc_cache_slot_t *sp;
    +    apc_bd_entry_t *ep;
    +    int i, count=0;
    +    apc_bd_t *bd;
    +    zend_llist ll;
    +    size_t size=0;
    +    apc_context_t ctxt;
    +    void *pool_ptr;
    +
    +    zend_llist_init(&ll, sizeof(void*), NULL, 0);
    +    zend_hash_init(&APCG(apc_bd_alloc_list), 0, NULL, NULL, 0);
    +
    +    /* flip the hash for faster filter checking */
    +    user_vars = apc_flip_hash(user_vars);
    +
    +    APC_RLOCK(cache->header);
    +
    +    /* get size and entry counts */
    +    for(i=0; i < cache->nslots; i++) {
    +        sp = cache->slots[i];
    +        for(; sp != NULL; sp = sp->next) {
    +            if(apc_bin_checkfilter(user_vars, sp->key.str, sp->key.len)) {
    +                size += sizeof(apc_bd_entry_t*) + sizeof(apc_bd_entry_t);
    +                size += sp->value->mem_size - (sizeof(apc_cache_entry_t));
    +                count++;
    +            }
    +        }
    +    }
    +
    +    size += sizeof(apc_bd_t) +1;  /* +1 for null termination */
    +    bd = emalloc(size);
    +    bd->size = (unsigned int)size;
    +    pool_ptr = emalloc(sizeof(apc_pool));
    +    apc_bd_alloc_ex(pool_ptr, sizeof(apc_pool) TSRMLS_CC);
    +
    +	ctxt.serializer = cache->serializer;
    +    ctxt.pool = apc_pool_create(APC_UNPOOL, apc_bd_alloc, apc_bd_free, NULL, NULL TSRMLS_CC);  /* ideally the pool wouldn't be alloc'd as part of this */
    +    if (!ctxt.pool) { /* TODO need to cleanup */
    +        apc_warning("Unable to allocate memory for pool." TSRMLS_CC);
    +        return NULL;
    +    }
    +
    +    ctxt.copy = APC_COPY_OTHER; /* avoid stupid ALLOC_ZVAL calls here, hack */
    +    apc_bd_alloc_ex((void*)((size_t)bd + sizeof(apc_bd_t)), bd->size - sizeof(apc_bd_t) -1 TSRMLS_CC);
    +    bd->num_entries = count;
    +    bd->entries = apc_bd_alloc_ex(NULL, sizeof(apc_bd_entry_t) * count TSRMLS_CC);
    +
    +    /* User entries */
    +    zend_hash_init(&ctxt.copied, 0, NULL, NULL, 0);
    +    count = 0;
    +    for(i=0; i < cache->nslots; i++) {
    +        sp = cache->slots[i];
    +        for(; sp != NULL; sp = sp->next) {
    +            if(apc_bin_checkfilter(user_vars, sp->key.str, sp->key.len)) {
    +                ep = &bd->entries[count];
    +				
    +				/* copy key with current pool */
    +				ep->key.str = apc_pmemcpy(sp->key.str, sp->key.len, ctxt.pool TSRMLS_CC);
    +				ep->key.len = sp->key.len;
    +
    +                if ((Z_TYPE_P(sp->value->val) == IS_ARRAY && cache->serializer)
    +                        || Z_TYPE_P(sp->value->val) == IS_OBJECT) {
    +                    /* avoiding hash copy, hack */
    +                    uint type = Z_TYPE_P(sp->value->val);
    +                    Z_TYPE_P(sp->value->val) = IS_STRING;
    +                    ep->val.val = apc_copy_zval(NULL, sp->value->val, &ctxt TSRMLS_CC);
    +					
    +                    Z_TYPE_P(ep->val.val) = IS_OBJECT;
    +                    sp->value->val->type = type;
    +                } else if (Z_TYPE_P(sp->value->val) == IS_ARRAY && !cache->serializer) {
    +                    /* this is a little complicated, we have to unserialize it first, then serialize it again */
    +                    zval *garbage;
    +                    ctxt.copy = APC_COPY_OUT;
    +                    garbage = apc_copy_zval(NULL, sp->value->val, &ctxt TSRMLS_CC);
    +                    ctxt.copy = APC_COPY_IN;
    +                    ep->val.val = apc_copy_zval(NULL, garbage, &ctxt TSRMLS_CC);
    +                    ep->val.val->type = IS_OBJECT;
    +                    /* a memleak can not be avoided: zval_ptr_dtor(&garbage); */
    +                    ctxt.copy = APC_COPY_OTHER;
    +                } else {
    +                    ep->val.val = apc_copy_zval(NULL, sp->value->val, &ctxt TSRMLS_CC);
    +                }
    +                ep->val.ttl = sp->value->ttl;
    +
    +                /* swizzle pointers */
    +                zend_hash_clean(&ctxt.copied);
    +                if (ep->val.val->type == IS_OBJECT) {
    +                    apc_swizzle_ptr(bd, &ctxt, &ll, &bd->entries[count].val.val->value.str.val);
    +                } else {
    +                    apc_swizzle_zval(bd, &ctxt, &ll, bd->entries[count].val.val TSRMLS_CC);
    +                }
    +                apc_swizzle_ptr(bd, &ctxt, &ll, &bd->entries[count].val.val);
    +                apc_swizzle_ptr(bd, &ctxt, &ll, &bd->entries[count].key.str);
    +
    +                count++;
    +            }
    +        }
    +    }
    +    zend_hash_destroy(&ctxt.copied);
    +    ctxt.copied.nTableSize=0;
    +
    +    /* append swizzle pointer list to bd */
    +    bd = apc_swizzle_bd(bd, &ll TSRMLS_CC);
    +    zend_llist_destroy(&ll);
    +    zend_hash_destroy(&APCG(apc_bd_alloc_list));
    +
    +    APC_RUNLOCK(cache->header);
    +
    +    if(user_vars) {
    +        zend_hash_destroy(user_vars);
    +        efree(user_vars);
    +    }
    +
    +    efree(pool_ptr);
    +
    +    return bd;
    +} /* }}} */
    +
    +/* {{{ apc_bin_load */
    +PHP_APCU_API int apc_bin_load(apc_cache_t* cache, apc_bd_t *bd, int flags TSRMLS_DC) {
    +    apc_bd_entry_t *ep;
    +    uint i;
    +    apc_context_t ctxt;
    +
    +    if (bd->swizzled) {
    +        if(apc_unswizzle_bd(bd, flags TSRMLS_CC) < 0) {
    +            return -1;
    +        }
    +    }
    +
    +    for(i = 0; i < bd->num_entries; i++) {
    +        ctxt.pool = apc_pool_create(APC_SMALL_POOL, (apc_malloc_t) apc_sma_malloc, (apc_free_t) apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC);
    +        if (!ctxt.pool) { /* TODO need to cleanup previous pools */
    +            apc_warning("Unable to allocate memory for pool." TSRMLS_CC);
    +            goto failure;
    +        }
    +        ep = &bd->entries[i];
    +        {
    +            zval *data;
    +            uint use_copy = 0;
    +            switch (Z_TYPE_P(ep->val.val)) {
    +                case IS_OBJECT:
    +                    ctxt.copy = APC_COPY_OUT;
    +                    data = apc_copy_zval(NULL, ep->val.val, &ctxt TSRMLS_CC);
    +                    use_copy = 1;
    +                break;
    +                default:
    +                    data = ep->val.val;
    +                break;
    +            }
    +            ctxt.copy = APC_COPY_IN;
    +
    +            apc_cache_store(
    +				cache, ep->key.str, ep->key.len, data, ep->val.ttl, 0 TSRMLS_CC);
    +
    +            if (use_copy) {
    +                zval_ptr_dtor(&data);
    +            }
    +        }
    +    }
    +
    +    return 0;
    +
    +failure:
    +    apc_pool_destroy(ctxt.pool TSRMLS_CC);
    +    apc_warning("Unable to allocate memory for apc binary load/dump functionality." TSRMLS_CC);
    +
    +    HANDLE_UNBLOCK_INTERRUPTIONS();
    +    return -1;
    +} /* }}} */
    +
    +/*
    + * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_bin.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_bin.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_bin.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_bin.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,40 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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                                  |
    +  +----------------------------------------------------------------------+
    +
    + */
    +
    +/* $Id: apc_bin.h 328743 2012-12-12 07:58:32Z ab $ */
    +
    +#ifndef APC_BIN_H
    +#define APC_BIN_H
    +
    +#include "apc.h"
    +
    +#ifndef APC_BIN_API_H
    +# include "apc_bin_api.h"
    +#endif
    +
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc.c
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc.c	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc.c	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,440 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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               |
    +  |          George Schlossnagle                      |
    +  |          Rasmus Lerdorf                              |
    +  |          Arun C. Murthy                         |
    +  |          Gopal Vijayaraghavan                  |
    +  +----------------------------------------------------------------------+
    +
    +   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.c 328941 2012-12-31 18:41:07Z ab $ */
    +
    +#include "apc.h"
    +#include "apc_cache.h"
    +#include "apc_globals.h"
    +#include "php.h"
    +
    +#if HAVE_PCRE || HAVE_BUNDLED_PCRE
    +/*  Deal with problem present until php-5.2.2 where php_pcre.h was not installed correctly */
    +#   if !HAVE_BUNDLED_PCRE && PHP_MAJOR_VERSION == 5 && (PHP_MINOR_VERSION < 2 || (PHP_MINOR_VERSION == 2 && PHP_RELEASE_VERSION < 2))
    +#       include "apc_php_pcre.h"
    +#   else
    +#       include "ext/pcre/php_pcre.h"
    +#   endif
    +#   include "ext/standard/php_smart_str.h"
    +#endif
    +
    +#define NELEMS(a) (sizeof(a)/sizeof((a)[0]))
    +
    +/* {{{ memory allocation wrappers */
    +
    +PHP_APCU_API void* apc_emalloc(size_t n TSRMLS_DC)
    +{
    +    void* p = malloc(n);
    +    if (p == NULL) {
    +        apc_error("apc_emalloc: malloc failed to allocate %u bytes:" TSRMLS_CC, n);
    +        return NULL;
    +    }
    +    return p;
    +}
    +
    +PHP_APCU_API void* apc_erealloc(void* p, size_t n TSRMLS_DC)
    +{
    +    void *new;
    +    new = realloc(p, n);
    +    if (new == NULL) {
    +        apc_error("apc_erealloc: realloc failed to allocate %u bytes:" TSRMLS_CC, n);
    +        return NULL;
    +    }
    +    return new;
    +}
    +
    +PHP_APCU_API void apc_efree(void* p TSRMLS_DC)
    +{
    +    if (p == NULL) {
    +        apc_error("apc_efree: attempt to free null pointer" TSRMLS_CC);
    +        return;
    +    }
    +    free(p);
    +}
    +
    +PHP_APCU_API void* apc_php_malloc(size_t n TSRMLS_DC)
    +{
    +    return emalloc(n);
    +}
    +
    +PHP_APCU_API void apc_php_free(void* p TSRMLS_DC)
    +{
    +    efree(p);
    +}
    +
    +PHP_APCU_API char* APC_ALLOC apc_estrdup(const char* s TSRMLS_DC)
    +{
    +    int len;
    +    char* dup;
    +
    +    if (s == NULL) {
    +        return NULL;
    +    }
    +    len = strlen(s);
    +    dup = (char*) malloc(len+1);
    +    if (dup == NULL) {
    +        apc_error("apc_estrdup: malloc failed to allocate %u bytes:" TSRMLS_CC, len+1);
    +        return NULL;
    +    }
    +    memcpy(dup, s, len);
    +    dup[len] = '\0';
    +    return dup;
    +}
    +
    +PHP_APCU_API void* APC_ALLOC apc_xstrdup(const char* s, apc_malloc_t f TSRMLS_DC)
    +{
    +    return s != NULL ? apc_xmemcpy(s, strlen(s)+1, f TSRMLS_CC) : NULL;
    +}
    +
    +PHP_APCU_API void* APC_ALLOC apc_xmemcpy(const void* p, size_t n, apc_malloc_t f TSRMLS_DC)
    +{
    +    void* q;
    +
    +    if (p != NULL && (q = f(n TSRMLS_CC)) != NULL) {
    +        memcpy(q, p, n);
    +        return q;
    +    }
    +    return NULL;
    +}
    +
    +/* }}} */
    +
    +/* {{{ console display functions */
    +#ifdef ZTS
    +# define APC_PRINT_FUNCTION_PARAMETER TSRMLS_C
    +#else
    +# define APC_PRINT_FUNCTION_PARAMETER format
    +#endif
    +
    +#define APC_PRINT_FUNCTION(name, verbosity)					\
    +	void apc_##name(const char *format TSRMLS_DC, ...)			\
    +	{									\
    +		va_list args;							\
    +										\
    +		va_start(args, APC_PRINT_FUNCTION_PARAMETER);			\
    +		php_verror(NULL, "", verbosity, format, args TSRMLS_CC);	\
    +		va_end(args);							\
    +	}
    +
    +APC_PRINT_FUNCTION(error, E_ERROR)
    +APC_PRINT_FUNCTION(warning, E_WARNING)
    +APC_PRINT_FUNCTION(notice, E_NOTICE)
    +
    +#ifdef APC_DEBUG
    +APC_PRINT_FUNCTION(debug, E_NOTICE)
    +#else
    +void apc_debug(const char *format TSRMLS_DC, ...) {}
    +#endif
    +/* }}} */
    +
    +/* {{{ string and text manipulation */
    +
    +char* apc_append(const char* s, const char* t TSRMLS_DC)
    +{
    +    int slen;
    +    int tlen;
    +    char* p;
    +
    +    slen = strlen(s);
    +    tlen = strlen(t);
    +
    +    p = (char*) apc_emalloc((slen + tlen + 1) * sizeof(char) TSRMLS_CC);
    +    memcpy(p, s, slen);
    +    memcpy(p + slen, t, tlen + 1);
    +
    +    return p;
    +}
    +
    +char* apc_substr(const char* s, int start, int length TSRMLS_DC)
    +{
    +    char* substr;
    +    int src_len = strlen(s);
    +
    +    /* bring start into range */
    +    if (start < 0) {
    +        start = 0;
    +    }
    +    else if (start >= src_len) {
    +        start = src_len - 1;
    +    }
    +
    +    /* bring length into range */
    +    if (length < 0 || src_len - start < length) {
    +        length = src_len - start;
    +    }
    +
    +    /* create the substring */
    +    substr = apc_xmemcpy(s + start, length + 1, apc_emalloc TSRMLS_CC);
    +    substr[length] = '\0';
    +    return substr;
    +}
    +
    +char** apc_tokenize(const char* s, char delim TSRMLS_DC)
    +{
    +    char** tokens;      /* array of tokens, NULL terminated */
    +    int size;           /* size of tokens array */
    +    int n;              /* index of next token in tokens array */
    +    int cur;            /* current position in input string */
    +    int end;            /* final legal position in input string */
    +    int next;           /* position of next delimiter in input */
    +
    +    if (!s) {
    +        return NULL;
    +    }
    +
    +    size = 2;
    +    n    = 0;
    +    cur  = 0;
    +    end  = strlen(s) - 1;
    +
    +    tokens = (char**) apc_emalloc(size * sizeof(char*) TSRMLS_CC);
    +    tokens[n] = NULL;
    +
    +    while (cur <= end) {
    +        /* search for the next delimiter */
    +        char* p = strchr(s + cur, delim);
    +        next = p ? p-s : end+1;
    +
    +        /* resize token array if necessary */
    +        if (n == size-1) {
    +            size *= 2;
    +            tokens = (char**) apc_erealloc(tokens, size * sizeof(char*) TSRMLS_CC);
    +        }
    +
    +        /* save the current token */
    +        tokens[n] = apc_substr(s, cur, next-cur TSRMLS_CC);
    +
    +        tokens[++n] = NULL;
    +        cur = next + 1;
    +    }
    +
    +    return tokens;
    +}
    +
    +/* }}} */
    +
    +/* {{{ crc32 implementation */
    +
    +/* this table was generated by crc32gen() */
    +static unsigned int crc32tab[] = {
    +    /*   0 */  0x00000000, 0x3b83984b, 0x77073096, 0x4c84a8dd,
    +    /*   4 */  0xee0e612c, 0xd58df967, 0x990951ba, 0xa28ac9f1,
    +    /*   8 */  0x076dc419, 0x3cee5c52, 0x706af48f, 0x4be96cc4,
    +    /*  12 */  0xe963a535, 0xd2e03d7e, 0x9e6495a3, 0xa5e70de8,
    +    /*  16 */  0x0edb8832, 0x35581079, 0x79dcb8a4, 0x425f20ef,
    +    /*  20 */  0xe0d5e91e, 0xdb567155, 0x97d2d988, 0xac5141c3,
    +    /*  24 */  0x09b64c2b, 0x3235d460, 0x7eb17cbd, 0x4532e4f6,
    +    /*  28 */  0xe7b82d07, 0xdc3bb54c, 0x90bf1d91, 0xab3c85da,
    +    /*  32 */  0x1db71064, 0x2634882f, 0x6ab020f2, 0x5133b8b9,
    +    /*  36 */  0xf3b97148, 0xc83ae903, 0x84be41de, 0xbf3dd995,
    +    /*  40 */  0x1adad47d, 0x21594c36, 0x6ddde4eb, 0x565e7ca0,
    +    /*  44 */  0xf4d4b551, 0xcf572d1a, 0x83d385c7, 0xb8501d8c,
    +    /*  48 */  0x136c9856, 0x28ef001d, 0x646ba8c0, 0x5fe8308b,
    +    /*  52 */  0xfd62f97a, 0xc6e16131, 0x8a65c9ec, 0xb1e651a7,
    +    /*  56 */  0x14015c4f, 0x2f82c404, 0x63066cd9, 0x5885f492,
    +    /*  60 */  0xfa0f3d63, 0xc18ca528, 0x8d080df5, 0xb68b95be,
    +    /*  64 */  0x3b6e20c8, 0x00edb883, 0x4c69105e, 0x77ea8815,
    +    /*  68 */  0xd56041e4, 0xeee3d9af, 0xa2677172, 0x99e4e939,
    +    /*  72 */  0x3c03e4d1, 0x07807c9a, 0x4b04d447, 0x70874c0c,
    +    /*  76 */  0xd20d85fd, 0xe98e1db6, 0xa50ab56b, 0x9e892d20,
    +    /*  80 */  0x35b5a8fa, 0x0e3630b1, 0x42b2986c, 0x79310027,
    +    /*  84 */  0xdbbbc9d6, 0xe038519d, 0xacbcf940, 0x973f610b,
    +    /*  88 */  0x32d86ce3, 0x095bf4a8, 0x45df5c75, 0x7e5cc43e,
    +    /*  92 */  0xdcd60dcf, 0xe7559584, 0xabd13d59, 0x9052a512,
    +    /*  96 */  0x26d930ac, 0x1d5aa8e7, 0x51de003a, 0x6a5d9871,
    +    /* 100 */  0xc8d75180, 0xf354c9cb, 0xbfd06116, 0x8453f95d,
    +    /* 104 */  0x21b4f4b5, 0x1a376cfe, 0x56b3c423, 0x6d305c68,
    +    /* 108 */  0xcfba9599, 0xf4390dd2, 0xb8bda50f, 0x833e3d44,
    +    /* 112 */  0x2802b89e, 0x138120d5, 0x5f058808, 0x64861043,
    +    /* 116 */  0xc60cd9b2, 0xfd8f41f9, 0xb10be924, 0x8a88716f,
    +    /* 120 */  0x2f6f7c87, 0x14ece4cc, 0x58684c11, 0x63ebd45a,
    +    /* 124 */  0xc1611dab, 0xfae285e0, 0xb6662d3d, 0x8de5b576,
    +    /* 128 */  0x76dc4190, 0x4d5fd9db, 0x01db7106, 0x3a58e94d,
    +    /* 132 */  0x98d220bc, 0xa351b8f7, 0xefd5102a, 0xd4568861,
    +    /* 136 */  0x71b18589, 0x4a321dc2, 0x06b6b51f, 0x3d352d54,
    +    /* 140 */  0x9fbfe4a5, 0xa43c7cee, 0xe8b8d433, 0xd33b4c78,
    +    /* 144 */  0x7807c9a2, 0x438451e9, 0x0f00f934, 0x3483617f,
    +    /* 148 */  0x9609a88e, 0xad8a30c5, 0xe10e9818, 0xda8d0053,
    +    /* 152 */  0x7f6a0dbb, 0x44e995f0, 0x086d3d2d, 0x33eea566,
    +    /* 156 */  0x91646c97, 0xaae7f4dc, 0xe6635c01, 0xdde0c44a,
    +    /* 160 */  0x6b6b51f4, 0x50e8c9bf, 0x1c6c6162, 0x27eff929,
    +    /* 164 */  0x856530d8, 0xbee6a893, 0xf262004e, 0xc9e19805,
    +    /* 168 */  0x6c0695ed, 0x57850da6, 0x1b01a57b, 0x20823d30,
    +    /* 172 */  0x8208f4c1, 0xb98b6c8a, 0xf50fc457, 0xce8c5c1c,
    +    /* 176 */  0x65b0d9c6, 0x5e33418d, 0x12b7e950, 0x2934711b,
    +    /* 180 */  0x8bbeb8ea, 0xb03d20a1, 0xfcb9887c, 0xc73a1037,
    +    /* 184 */  0x62dd1ddf, 0x595e8594, 0x15da2d49, 0x2e59b502,
    +    /* 188 */  0x8cd37cf3, 0xb750e4b8, 0xfbd44c65, 0xc057d42e,
    +    /* 192 */  0x4db26158, 0x7631f913, 0x3ab551ce, 0x0136c985,
    +    /* 196 */  0xa3bc0074, 0x983f983f, 0xd4bb30e2, 0xef38a8a9,
    +    /* 200 */  0x4adfa541, 0x715c3d0a, 0x3dd895d7, 0x065b0d9c,
    +    /* 204 */  0xa4d1c46d, 0x9f525c26, 0xd3d6f4fb, 0xe8556cb0,
    +    /* 208 */  0x4369e96a, 0x78ea7121, 0x346ed9fc, 0x0fed41b7,
    +    /* 212 */  0xad678846, 0x96e4100d, 0xda60b8d0, 0xe1e3209b,
    +    /* 216 */  0x44042d73, 0x7f87b538, 0x33031de5, 0x088085ae,
    +    /* 220 */  0xaa0a4c5f, 0x9189d414, 0xdd0d7cc9, 0xe68ee482,
    +    /* 224 */  0x5005713c, 0x6b86e977, 0x270241aa, 0x1c81d9e1,
    +    /* 228 */  0xbe0b1010, 0x8588885b, 0xc90c2086, 0xf28fb8cd,
    +    /* 232 */  0x5768b525, 0x6ceb2d6e, 0x206f85b3, 0x1bec1df8,
    +    /* 236 */  0xb966d409, 0x82e54c42, 0xce61e49f, 0xf5e27cd4,
    +    /* 240 */  0x5edef90e, 0x655d6145, 0x29d9c998, 0x125a51d3,
    +    /* 244 */  0xb0d09822, 0x8b530069, 0xc7d7a8b4, 0xfc5430ff,
    +    /* 248 */  0x59b33d17, 0x6230a55c, 0x2eb40d81, 0x153795ca,
    +    /* 252 */  0xb7bd5c3b, 0x8c3ec470, 0xc0ba6cad, 0xfb39f4e6,
    +};
    +
    +unsigned int apc_crc32(const unsigned char* buf, unsigned int len)
    +{
    +    unsigned int i;
    +    int k;
    +    unsigned int crc;
    +
    +    /* preconditioning */
    +    crc = 0xFFFFFFFF;
    +
    +    for (i = 0; i < len; i++) {
    +        k = (crc ^ buf[i]) & 0x000000FF;
    +        assert(k >= 0 && k <= 255);
    +        crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[k];
    +    }
    +
    +    /* postconditioning */
    +    return ~crc;
    +} /* }}} */
    +
    +/* {{{ apc_flip_hash */
    +HashTable* apc_flip_hash(HashTable *hash) {
    +#if PHP_VERSION_ID >= 50700
    +    zval *entry, *data;
    +#else
    +    zval **entry, *data;
    +#endif
    +    HashTable *new_hash;
    +    HashPosition pos;
    +
    +    if(hash == NULL) return hash;
    +
    +    MAKE_STD_ZVAL(data);
    +    ZVAL_LONG(data, 1);
    +    
    +    new_hash = emalloc(sizeof(HashTable));
    +    zend_hash_init(new_hash, hash->nTableSize, NULL, ZVAL_PTR_DTOR, 0);
    +
    +    zend_hash_internal_pointer_reset_ex(hash, &pos);
    +#if PHP_VERSION_ID >= 50700
    +    while ((entry = zend_hash_get_current_data_ex(hash, &pos)) != NULL) {
    +        if(Z_TYPE_P(entry) == IS_STRING) {
    +            zend_hash_update(new_hash, Z_STRVAL_P(entry), &data);
    +        } else {
    +            zend_hash_index_update(new_hash, Z_LVAL_P(entry), &data);
    +        }
    +        Z_ADDREF_P(data);
    +        zend_hash_move_forward_ex(hash, &pos);
    +    }
    +#else
    +    while (zend_hash_get_current_data_ex(hash, (void **)&entry, &pos) == SUCCESS) {
    +        if(Z_TYPE_PP(entry) == IS_STRING) {
    +            zend_hash_update(new_hash, Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) +1, &data, sizeof(data), NULL);
    +        } else {
    +            zend_hash_index_update(new_hash, Z_LVAL_PP(entry), &data, sizeof(data), NULL);
    +        }
    +        Z_ADDREF_P(data);
    +        zend_hash_move_forward_ex(hash, &pos);
    +    }
    +#endif
    +    zval_ptr_dtor(&data);
    +
    +    return new_hash;
    +}
    +/* }}} */
    +
    +/*
    +* Serializer API
    +*/
    +#define APC_MAX_SERIALIZERS 16
    +
    +/* pointer to the list of serializers */
    +static apc_serializer_t apc_serializers[APC_MAX_SERIALIZERS] = {{0,}};
    +/* }}} */
    +
    +/* {{{ apc_register_serializer */
    +PHP_APCU_API int _apc_register_serializer(const char* name,
    +                                  apc_serialize_t serialize,
    +                                  apc_unserialize_t unserialize,
    +                                  void *config TSRMLS_DC) {
    +    int i;
    +    apc_serializer_t *serializer;
    +
    +    for(i = 0; i < APC_MAX_SERIALIZERS; i++) {
    +        serializer = &apc_serializers[i];
    +        if(!serializer->name) {
    +            /* empty entry */
    +            serializer->name = name;
    +            serializer->serialize = serialize;
    +            serializer->unserialize = unserialize;
    +            serializer->config = config;
    +            if (i < APC_MAX_SERIALIZERS - 1) {
    +                apc_serializers[i+1].name = NULL;
    +            }
    +            return 1;
    +        }
    +    }
    +
    +    return 0;
    +} /* }}} */
    +
    +/* {{{ apc_get_serializers */
    +PHP_APCU_API apc_serializer_t* apc_get_serializers(TSRMLS_D)  {
    +	return &(apc_serializers[0]);
    +} /* }}} */
    +
    +/* {{{ apc_find_serializer */
    +PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name TSRMLS_DC) {
    +	int i;
    +    apc_serializer_t *serializer;
    +
    +    for(i = 0; i < APC_MAX_SERIALIZERS; i++) {
    +        serializer = &apc_serializers[i];
    +        if(serializer->name && (strcmp(serializer->name, name) == 0)) {
    +            return serializer;
    +        }
    +    }
    +    return NULL;
    +} /* }}} */
    +
    +/*
    + * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_cache_api.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_cache_api.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_cache_api.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_cache_api.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,421 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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               |
    +  |          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.
    +
    + */
    +
    +/* $Id: apc_cache.h 328172 2012-10-28 21:44:47Z rasmus $ */
    +
    +#ifndef APC_CACHE_API_H
    +#define APC_CACHE_API_H
    +
    +/* {{{ used for slam defense to determine the context which created any key */
    +#ifdef ZTS
    +typedef void*** apc_cache_owner_t;
    +#else
    +typedef pid_t apc_cache_owner_t;
    +#endif /* }}} */
    +
    +/* {{{ struct definition: apc_cache_key_t */
    +typedef struct apc_cache_key_t apc_cache_key_t;
    +struct apc_cache_key_t {
    +    const char *str;		      /* pointer to constant string key */
    +    zend_uint len;                /* length of data at str */
    +    zend_ulong h;                 /* pre-computed hash of key */
    +    time_t mtime;                 /* the mtime of this cached entry */
    +    apc_cache_owner_t owner;      /* the context that created this key */
    +}; /* }}} */
    +
    +/* {{{ struct definition: apc_cache_entry_t */
    +typedef struct apc_cache_entry_t apc_cache_entry_t;
    +struct apc_cache_entry_t {
    +    zval *val;                    /* the zval copied at store time */
    +    zend_uint ttl;                /* the ttl on this specific entry */
    +    int ref_count;                /* the reference count of this entry */
    +    size_t mem_size;              /* memory used */
    +    apc_pool *pool;               /* pool which allocated the value */
    +};
    +/* }}} */
    +
    +/* {{{ struct definition: apc_cache_slot_t */
    +typedef struct apc_cache_slot_t apc_cache_slot_t;
    +struct apc_cache_slot_t {
    +    apc_cache_key_t key;        /* slot key */
    +    apc_cache_entry_t* value;   /* slot value */
    +    apc_cache_slot_t* next;     /* next slot in linked list */
    +    zend_ulong nhits;           /* number of hits to this slot */
    +    time_t ctime;               /* time slot was initialized */
    +    time_t dtime;               /* time slot was removed from cache */
    +    time_t atime;               /* time slot was last accessed */
    +};
    +/* }}} */
    +
    +/* {{{ state constants */
    +#define APC_CACHE_ST_NONE  0
    +#define APC_CACHE_ST_BUSY  0x00000001 /* }}} */
    +
    +/* {{{ struct definition: apc_cache_header_t
    +   Any values that must be shared among processes should go in here. */
    +typedef struct _apc_cache_header_t {
    +    apc_lock_t lock;                 /* header lock */
    +    zend_ulong nhits;                /* hit count */
    +    zend_ulong nmisses;              /* miss count */
    +    zend_ulong ninserts;             /* insert count */
    +    zend_ulong nexpunges;            /* expunge count */
    +    zend_ulong nentries;             /* entry count */
    +    zend_ulong mem_size;             /* used */
    +    time_t stime;                    /* start time */
    +    zend_ushort state;               /* cache state */
    +    apc_cache_key_t lastkey;         /* last key inserted (not necessarily without error) */
    +    apc_cache_slot_t* gc;            /* gc list */
    +} apc_cache_header_t; /* }}} */
    +
    +/* {{{ struct definition: apc_cache_t */
    +typedef struct _apc_cache_t {
    +    void* shmaddr;                /* process (local) address of shared cache */
    +    apc_cache_header_t* header;   /* cache header (stored in SHM) */
    +    apc_cache_slot_t** slots;     /* array of cache slots (stored in SHM) */
    +    apc_sma_t* sma;               /* shared memory allocator */
    +    apc_serializer_t* serializer; /* serializer */
    +    zend_ulong nslots;            /* number of slots in cache */
    +    zend_ulong gc_ttl;            /* maximum time on GC list for a slot */
    +    zend_ulong ttl;               /* if slot is needed and entry's access time is older than this ttl, remove it */
    +    zend_ulong smart;             /* smart parameter for gc */
    +    zend_bool defend;             /* defense parameter for runtime */
    +} apc_cache_t; /* }}} */
    +
    +/* {{{ typedef: apc_cache_updater_t */
    +typedef zend_bool (*apc_cache_updater_t)(apc_cache_t*, apc_cache_entry_t*, void* data); /* }}} */
    +
    +/*
    + * apc_cache_create creates the shared memory cache. 
    + *
    + * This function should be called once per process per cache
    + * 
    + * serializer for APCu is set by globals on MINIT and ensured with apc_cache_serializer
    + * during execution. Using apc_cache_serializer avoids race conditions between MINIT/RINIT of
    + * APCU and the third party serializer. API users can choose to leave this null to use default
    + * PHP serializers, or search the list of serializers for the preferred serializer
    + *
    + * size_hint is a "hint" at the total number entries that will be expected. 
    + * It determines the physical size of the hash table. Passing 0 for
    + * this argument will use a reasonable default value
    + * 
    + * gc_ttl is the maximum time a cache entry may speed on the garbage
    + * collection list. This is basically a work around for the inherent
    + * unreliability of our reference counting mechanism (see apc_cache_release).
    + *
    + * ttl is the maximum time a cache entry can idle in a slot in case the slot
    + * is needed.  This helps in cleaning up the cache and ensuring that entries 
    + * hit frequently stay cached and ones not hit very often eventually disappear.
    + * 
    + * for an explanation of smart, see apc_cache_default_expunge
    + *
    + * defend enables/disables slam defense for this particular cache
    + */
    +PHP_APCU_API apc_cache_t* apc_cache_create(apc_sma_t* sma,
    +                                           apc_serializer_t* serializer,
    +                                           int size_hint,
    +                                           int gc_ttl,
    +                                           int ttl,
    +                                           long smart,
    +                                           zend_bool defend TSRMLS_DC);
    +/*
    +* apc_cache_preload preloads the data at path into the specified cache
    +*/
    +PHP_APCU_API zend_bool apc_cache_preload(apc_cache_t* cache,
    +                                         const char* path TSRMLS_DC);
    +
    +/*
    + * apc_cache_destroy releases any OS resources associated with a cache object.
    + * Under apache, this function can be safely called by the child processes
    + * when they exit.
    + */
    +PHP_APCU_API void apc_cache_destroy(apc_cache_t* cache TSRMLS_DC);
    +
    +/*
    + * apc_cache_clear empties a cache. This can safely be called at any time.
    + */
    +PHP_APCU_API void apc_cache_clear(apc_cache_t* cache TSRMLS_DC);
    +
    +/*
    +* apc_cache_make_context initializes a context with an appropriate pool and options provided
    +*
    +* Some of the APC API requires a context in which to operate
    +*
    +* The type of context required depends on the operation being performed, for example
    +* an insert should happen in a shared context, a fetch should happen in a nonshared context
    +*/
    +PHP_APCU_API zend_bool apc_cache_make_context(apc_cache_t* cache,
    +                                              apc_context_t* context, 
    +                                              apc_context_type context_type, 
    +                                              apc_pool_type pool_type,
    +                                              apc_copy_type copy_type,
    +                                              uint force_update TSRMLS_DC);
    +
    +/*
    +* apc_cache_make_context_ex is an advanced/external version of make_context
    +*/
    +PHP_APCU_API zend_bool apc_cache_make_context_ex(apc_context_t* context,
    +                                                 apc_serializer_t* serializer,
    +                                                 apc_malloc_t _malloc, 
    +                                                 apc_free_t _free, 
    +                                                 apc_protect_t _protect, 
    +                                                 apc_unprotect_t _unprotect, 
    +                                                 apc_pool_type pool_type, 
    +                                                 apc_copy_type copy_type, 
    +                                                 uint force_update TSRMLS_DC);
    +/*
    +* apc_context_destroy should be called when a context is finished being used 
    +*/
    +PHP_APCU_API zend_bool apc_cache_destroy_context(apc_context_t* context TSRMLS_DC);
    +
    +/*
    + * apc_cache_insert adds an entry to the cache.
    + * Returns true if the entry was successfully inserted, false otherwise. 
    + * If false is returned, the caller must free the cache entry by calling
    + * apc_cache_free_entry (see below).
    + *
    + * key is the value created by apc_cache_make_key
    + *
    + * value is a cache entry returned by apc_cache_make_entry (see below).
    + *
    + * an easier API exists in the form of apc_cache_store
    + */
    +PHP_APCU_API zend_bool apc_cache_insert(apc_cache_t* cache,
    +                                        apc_cache_key_t key,
    +                                        apc_cache_entry_t* value,
    +                                        apc_context_t* ctxt,
    +                                        time_t t,
    +                                        zend_bool exclusive TSRMLS_DC);
    +
    +/*
    + * apc_cache_store creates key, entry and context in which to make an insertion of val into the specified cache
    + */
    +PHP_APCU_API zend_bool apc_cache_store(apc_cache_t* cache,
    +                                       char *strkey,
    +                                       zend_uint keylen,
    +                                       const zval *val,
    +                                       const zend_uint ttl,
    +                                       const zend_bool exclusive TSRMLS_DC);
    +/*
    +* apc_cache_update updates an entry in place, this is used for rfc1867 and inc/dec/cas
    +*/
    +PHP_APCU_API zend_bool apc_cache_update(apc_cache_t* cache,
    +                                        char *strkey,
    +                                        zend_uint keylen,
    +                                        apc_cache_updater_t updater,
    +                                        void* data TSRMLS_DC);
    +
    +/*
    + * apc_cache_find searches for a cache entry by its hashed identifier,
    + * and returns a pointer to the entry if found, NULL otherwise.
    + *
    + */
    +PHP_APCU_API apc_cache_entry_t* apc_cache_find(apc_cache_t* cache,
    +                                               char* strkey,
    +                                               zend_uint keylen,
    +                                               time_t t TSRMLS_DC);
    +
    +/*
    + * apc_cache_fetch fetches an entry from the cache directly into dst
    + *
    + */
    +PHP_APCU_API zend_bool apc_cache_fetch(apc_cache_t* cache,
    +                                       char* strkey,
    +                                       zend_uint keylen,
    +                                       time_t t,
    +                                       zval **dst TSRMLS_DC);
    +
    +/*
    + * apc_cache_exists searches for a cache entry by its hashed identifier,
    + * and returns a pointer to the entry if found, NULL otherwise.  This is a
    + * quick non-locking version of apc_cache_find that does not modify the
    + * shared memory segment in any way.
    + *
    + */
    +PHP_APCU_API apc_cache_entry_t* apc_cache_exists(apc_cache_t* cache,
    +                                                 char* strkey,
    +                                                 zend_uint keylen,
    +                                                 time_t t TSRMLS_DC);
    +
    +/*
    + * apc_cache_delete and apc_cache_delete finds an entry in the cache and deletes it.
    + */
    +PHP_APCU_API zend_bool apc_cache_delete(apc_cache_t* cache,
    +                                        char *strkey,
    +                                        zend_uint keylen TSRMLS_DC);
    +
    +/* apc_cach_fetch_zval takes a zval in the cache and reconstructs a runtime
    + * zval from it.
    + *
    + */
    +PHP_APCU_API zval* apc_cache_fetch_zval(apc_context_t* ctxt,
    +                                        zval* dst,
    +                                        const zval* src TSRMLS_DC);
    +
    +/*
    + * apc_cache_release decrements the reference count associated with a cache
    + * entry. Calling apc_cache_find automatically increments the reference count,
    + * and this function must be called post-execution to return the count to its
    + * original value. Failing to do so will prevent the entry from being
    + * garbage-collected.
    + *
    + * entry is the cache entry whose ref count you want to decrement.
    + */
    +PHP_APCU_API void apc_cache_release(apc_cache_t* cache,
    +                                    apc_cache_entry_t* entry TSRMLS_DC);
    +
    +/*
    +* apc_cache_make_key creates an apc_cache_key_t from an identifier, it's length and the current time
    +*/
    +PHP_APCU_API zend_bool apc_cache_make_key(apc_cache_key_t* key,
    +                                          char* str,
    +                                          zend_ulong len TSRMLS_DC);
    +
    +/*
    + * apc_cache_make_entry creates an apc_cache_entry_t given a zval, context and ttl
    + */
    +PHP_APCU_API apc_cache_entry_t* apc_cache_make_entry(apc_context_t* ctxt,
    +                                                     apc_cache_key_t* key,
    +                                                     const zval *val,
    +                                                     const zend_uint ttl TSRMLS_DC);
    +
    +/*
    + fetches information about the cache provided for userland status functions
    +*/
    +PHP_APCU_API zval* apc_cache_info(apc_cache_t* cache,
    +                                  zend_bool limited TSRMLS_DC);
    +                                  
    +/*
    + fetches information about the key provided
    +*/
    +PHP_APCU_API zval* apc_cache_stat(apc_cache_t* cache,
    +                                  char *strkey,
    +                                  zend_uint keylen TSRMLS_DC);
    +
    +/*
    +* apc_cache_busy returns true while the cache is busy
    +*
    +* a cache is considered busy when any of the following occur:
    +*  a) the cache becomes busy when the allocator beneath it is running out of resources
    +*  b) a clear of the cache was requested
    +*  c) garbage collection is in progress
    +*
    +* Note: garbage collection can be invoked by the SMA and is invoked on insert
    +*/
    +PHP_APCU_API zend_bool apc_cache_busy(apc_cache_t* cache TSRMLS_DC);
    +
    +/*
    +* apc_cache_defense: guard against slamming a key
    +*  will return true if the following conditions are met:
    +*	the key provided has a matching hash and length to the last key inserted into cache
    +*   the last key has a different owner
    +* in ZTS mode, TSRM determines owner
    +* in non-ZTS mode, PID determines owner
    +* Note: this function sets the owner of key during execution
    +*/
    +PHP_APCU_API zend_bool apc_cache_defense(apc_cache_t* cache,
    +                                         apc_cache_key_t* key TSRMLS_DC);
    +
    +/*
    +* apc_cache_serializer
    +* sets the serializer for a cache, and by proxy contexts created for the cache
    +* Note: this avoids race conditions between third party serializers and APCu
    +*/
    +PHP_APCU_API void apc_cache_serializer(apc_cache_t* cache, const char* name TSRMLS_DC);
    +
    +/*
    +* The remaining functions allow a third party to reimplement expunge
    +* 
    +* Look at the source of apc_cache_default_expunge for what is expected of this function
    +*
    +* The default behaviour of expunge is explained below, should no combination of those options
    +* be suitable, you will need to reimplement apc_cache_default_expunge and pass it to your
    +* call to apc_sma_api_impl, this will replace the default functionality.
    +* The functions below you can use during your own implementation of expunge to gain more
    +* control over how the expunge process works ...
    +* 
    +* Note: beware of locking (copy it exactly), setting states is also important
    +*/
    +
    +/* {{{ apc_cache_default_expunge
    +* Where smart is not set:
    +*  Where no ttl is set on cache:
    +*   1) Perform cleanup of stale entries
    +*   2) Expunge if available memory is less than sma->size/2
    +*  Where ttl is set on cache:
    +*   1) Perform cleanup of stale entries
    +*   2) If available memory if less than the size requested, run full expunge
    +*
    +* Where smart is set:
    +*  Where no ttl is set on cache:
    +*   1) Perform cleanup of stale entries
    +*   2) Expunge is available memory is less than size * smart
    +*  Where ttl is set on cache:
    +*   1) Perform cleanup of stale entries
    +*   2) If available memory if less than the size requested, run full expunge
    +*
    +* The TTL of an entry takes precedence over the TTL of a cache
    +*/
    +PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size TSRMLS_DC);
    +
    +/*
    +* The remaining functions are used during the APCu implementation of expunge
    +*/
    +
    +/*
    +* apc_cache_real_expunge: trashes the whole cache
    +*
    +* Note: it is assumed you have a write lock on the header when you enter real expunge
    +*/
    +PHP_APCU_API void apc_cache_real_expunge(apc_cache_t* cache TSRMLS_DC);
    +
    +/*
    +* apc_cache_gc: runs garbage collection on cache
    +*
    +* Note: it is assumed you have a write lock on the header when you enter gc
    +*/
    +PHP_APCU_API void apc_cache_gc(apc_cache_t* cache TSRMLS_DC);
    +
    +/*
    +* apc_cache_remove_slot: removes slot
    +*
    +* if no references remain, the slot is free'd immediately
    +* if there are references remaining, the slot is trashed
    +*
    +* Note: it is assumed you have a write lock on the header when you remove slots
    +*/
    +PHP_APCU_API void apc_cache_remove_slot(apc_cache_t* cache, apc_cache_slot_t** slot TSRMLS_DC);
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_cache.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_cache.c
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_cache.c	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_cache.c	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,1721 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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               |
    +  |          Rasmus Lerdorf                              |
    +  |          Arun C. Murthy                         |
    +  |          Gopal Vijayaraghavan                  |
    +  +----------------------------------------------------------------------+
    +
    +   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_cache.c 328743 2012-12-12 07:58:32Z ab $ */
    +
    +#include "apc_cache.h"
    +#include "apc_sma.h"
    +#include "apc_globals.h"
    +#include "php_scandir.h"
    +#include "SAPI.h"
    +#include "TSRM.h"
    +#include "php_main.h"
    +#include "ext/standard/md5.h"
    +#include "ext/standard/php_var.h"
    +#include "ext/standard/php_smart_str.h"
    +
    +typedef void* (*ht_copy_fun_t)(void*, void*, apc_context_t* TSRMLS_DC);
    +typedef int (*ht_check_copy_fun_t)(Bucket*, va_list);
    +
    +#define CHECK(p) { if ((p) == NULL) return NULL; }
    +
    +static APC_HOTSPOT zval* my_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC);
    +static HashTable* my_copy_hashtable_ex(HashTable*, HashTable* TSRMLS_DC, ht_copy_fun_t, int, apc_context_t*, ht_check_copy_fun_t, ...);
    +#define my_copy_hashtable( dst, src, copy_fn, holds_ptr, ctxt) \
    +    my_copy_hashtable_ex(dst, src TSRMLS_CC, copy_fn, holds_ptr, ctxt, NULL)
    +
    +/* {{{ make_prime */
    +static int const primes[] = {
    +  257, /*   256 */
    +  521, /*   512 */
    + 1031, /*  1024 */
    + 2053, /*  2048 */
    + 3079, /*  3072 */
    + 4099, /*  4096 */
    + 5147, /*  5120 */
    + 6151, /*  6144 */
    + 7177, /*  7168 */
    + 8209, /*  8192 */
    + 9221, /*  9216 */
    +10243, /* 10240 */
    +11273, /* 11264 */
    +12289, /* 12288 */
    +13313, /* 13312 */
    +14341, /* 14336 */
    +15361, /* 15360 */
    +16411, /* 16384 */
    +17417, /* 17408 */
    +18433, /* 18432 */
    +19457, /* 19456 */
    +20483, /* 20480 */
    +30727, /* 30720 */
    +40961, /* 40960 */
    +61441, /* 61440 */
    +81929, /* 81920 */
    +122887,/* 122880 */
    +163841,/* 163840 */
    +245771,/* 245760 */
    +327689,/* 327680 */
    +491527,/* 491520 */
    +655373,/* 655360 */
    +983063,/* 983040 */
    +0      /* sentinel */
    +};
    +
    +static int make_prime(int n)
    +{
    +    int *k = (int*)primes; 
    +    while(*k) {
    +        if((*k) > n) return *k;
    +        k++;
    +    }
    +    return *(k-1);
    +}
    +/* }}} */
    +
    +/* {{{ make_slot */
    +apc_cache_slot_t* make_slot(apc_cache_t* cache, apc_cache_key_t *key, apc_cache_entry_t* value, apc_cache_slot_t* next, time_t t TSRMLS_DC)
    +{
    +	apc_cache_slot_t* p = NULL;
    +	
    +	/* allocate slot */
    +	if ((p = value->pool->palloc(value->pool, sizeof(apc_cache_slot_t) TSRMLS_CC))) {	
    +		
    +		/* copy identifier */
    +		char* strkey = (char*) apc_pmemcpy(
    +			key->str, key->len, 
    +			value->pool TSRMLS_CC
    +		);
    +
    +		if (strkey) {
    +			/* set idenfieir */
    +			key->str = strkey;
    +			
    +			/* set slot data */
    +			p->key = key[0];
    +			p->value = value;
    +			
    +			/* set slot relation */
    +			p->next = next;
    +			
    +			/* set slot defaults */
    +			p->nhits = 0;
    +			p->ctime = t;
    +			p->atime = t;
    +			p->dtime = 0;
    +		}
    +	}
    +
    +    return p;
    +}
    +/* }}} */
    +
    +/* {{{ free_slot */
    +static void free_slot(apc_cache_slot_t* slot TSRMLS_DC)
    +{
    +	/* destroy slot pool */
    +    apc_pool_destroy(
    +		slot->value->pool TSRMLS_CC);
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_hash_slot
    + Note: These calculations can and should be done outside of a lock */
    +static void apc_cache_hash_slot(apc_cache_t* cache, 
    +                                char *str,
    +                                zend_uint len, 
    +                                zend_ulong* hash, 
    +                                zend_ulong* slot) {
    +	(*hash) = zend_inline_hash_func(str, len);
    +	(*slot) = (*hash) % (cache->nslots);
    +} /* }}} */
    +
    +/* {{{ apc_cache_remove_slot  */
    +PHP_APCU_API void apc_cache_remove_slot(apc_cache_t* cache, apc_cache_slot_t** slot TSRMLS_DC)
    +{
    +    apc_cache_slot_t* dead = *slot;
    +    
    +    /* think here is safer */
    +	*slot = (*slot)->next;
    +
    +	/* adjust header info */
    +	if (cache->header->mem_size)
    +    	cache->header->mem_size -= dead->value->mem_size;
    +
    +    if (cache->header->nentries)
    +		cache->header->nentries--;
    +	
    +	/* remove if there are no references */
    +    if (dead->value->ref_count <= 0) {
    +        free_slot(dead TSRMLS_CC);
    +    } else {
    +		/* add to gc if there are still refs */
    +        dead->next = cache->header->gc;
    +        dead->dtime = time(0);
    +        cache->header->gc = dead;
    +    }
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_gc */
    +PHP_APCU_API void apc_cache_gc(apc_cache_t* cache TSRMLS_DC)
    +{
    +    /* This function scans the list of removed cache entries and deletes any
    +     * entry whose reference count is zero  or that has been on the gc 
    +	 * list for more than cache->gc_ttl seconds 
    +	 *   (we issue a warning in the latter case).
    +     */
    +	if (!cache || !cache->header->gc) {
    +		return;
    +	}
    +
    +    {
    +		apc_cache_slot_t** slot = &cache->header->gc;
    +
    +		while (*slot != NULL) {
    +			time_t now = time(0);
    +			time_t gc_sec = cache->gc_ttl ? (now - (*slot)->dtime) : 0;
    +
    +			if (!(*slot)->value->ref_count || gc_sec > (time_t)cache->gc_ttl) {
    +                apc_cache_slot_t* dead = *slot;
    +
    +				/* good ol' whining */
    +			    if (dead->value->ref_count > 0) {
    +			        apc_debug(
    +						"GC cache entry '%s' was on gc-list for %d seconds" TSRMLS_CC, 
    +						dead->key.str, gc_sec
    +					);
    +			    }
    +
    +				/* set next slot */
    +			    *slot = dead->next;
    +			
    +				/* free slot */
    +			    free_slot(
    +					dead TSRMLS_CC);
    +			
    +				/* next */
    +				continue;
    +
    +			} else {
    +				slot = &(*slot)->next;
    +			}
    +		}
    +	}
    +}
    +/* }}} */
    +
    +/* {{{ php serializer */
    +PHP_APCU_API int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS) 
    +{
    +    smart_str strbuf = {0};
    +    php_serialize_data_t var_hash;
    +    PHP_VAR_SERIALIZE_INIT(var_hash);
    +    php_var_serialize(&strbuf, (zval**)&value, &var_hash TSRMLS_CC);
    +    PHP_VAR_SERIALIZE_DESTROY(var_hash);
    +    if(strbuf.c) {
    +        *buf = (unsigned char*)strbuf.c;
    +        *buf_len = strbuf.len;
    +        smart_str_0(&strbuf);
    +        return 1; 
    +    }
    +    return 0;
    +} /* }}} */
    +
    +/* {{{ php unserializer */
    +PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS) 
    +{
    +    const unsigned char *tmp = buf;
    +    php_unserialize_data_t var_hash;
    +    PHP_VAR_UNSERIALIZE_INIT(var_hash);
    +    if(!php_var_unserialize(value, &tmp, buf + buf_len, &var_hash TSRMLS_CC)) {
    +        PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
    +        zval_dtor(*value);
    +        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %ld bytes", (long)(tmp - buf), (long)buf_len);
    +        (*value)->type = IS_NULL;
    +        return 0;
    +    }
    +    PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
    +    return 1;
    +} /* }}} */
    +
    +/* {{{ apc_cache_create */
    +PHP_APCU_API apc_cache_t* apc_cache_create(apc_sma_t* sma, apc_serializer_t* serializer, int size_hint, int gc_ttl, int ttl, long smart, zend_bool defend TSRMLS_DC) {
    +	apc_cache_t* cache;
    +    int cache_size;
    +    int nslots;
    +
    +	/* calculate number of slots */
    +    nslots = make_prime(size_hint > 0 ? size_hint : 2000);
    +
    +	/* allocate pointer by normal means */
    +    cache = (apc_cache_t*) apc_emalloc(sizeof(apc_cache_t) TSRMLS_CC);
    +	
    +	/* calculate cache size for shm allocation */
    +    cache_size = sizeof(apc_cache_header_t) + nslots*sizeof(apc_cache_slot_t*);
    +
    +	/* allocate shm */
    +    cache->shmaddr = sma->smalloc(cache_size TSRMLS_CC);
    +    if(!cache->shmaddr) {
    +        apc_error("Unable to allocate shared memory for cache structures.  (Perhaps your shared memory size isn't large enough?). " TSRMLS_CC);
    +        return NULL;
    +    }
    +	
    +	/* zero shm */
    +    memset(cache->shmaddr, 0, cache_size);
    +
    +	/* set default header */
    +    cache->header = (apc_cache_header_t*) cache->shmaddr;
    +	
    +    cache->header->nhits = 0;
    +    cache->header->nmisses = 0;
    +	cache->header->nentries = 0;
    +    cache->header->nexpunges = 0;
    +    cache->header->gc = NULL;
    +    cache->header->stime = time(NULL);
    +	cache->header->state |= APC_CACHE_ST_NONE;
    +	
    +	/* set cache options */
    +    cache->slots = (apc_cache_slot_t**) (((char*) cache->shmaddr) + sizeof(apc_cache_header_t));
    +    cache->sma = sma;
    +	cache->serializer = serializer;
    +	cache->nslots = nslots;
    +    cache->gc_ttl = gc_ttl;
    +    cache->ttl = ttl;
    +	cache->smart = smart;
    +	cache->defend = defend;
    +	
    +	/* header lock */
    +	CREATE_LOCK(&cache->header->lock);
    +
    +	/* zero slots */
    +    memset(cache->slots, 0, sizeof(apc_cache_slot_t*)*nslots);
    +
    +    return cache;
    +} /* }}} */
    +
    +/* {{{ apc_cache_store */
    +PHP_APCU_API zend_bool apc_cache_store(apc_cache_t* cache, char *strkey, zend_uint keylen, const zval *val, const zend_uint ttl, const zend_bool exclusive TSRMLS_DC) {
    +    apc_cache_entry_t *entry;
    +    apc_cache_key_t key;
    +    time_t t;
    +    apc_context_t ctxt={0,};
    +    zend_bool ret = 0;
    +
    +    t = apc_time();
    +
    +	/* initialize a context suitable for making an insert */
    +    if (apc_cache_make_context(cache, &ctxt, APC_CONTEXT_SHARE, APC_SMALL_POOL, APC_COPY_IN, 0 TSRMLS_CC)) {
    +
    +        /* initialize the key for insertion */
    +        if (apc_cache_make_key(&key, strkey, keylen TSRMLS_CC)) {
    +
    +            /* run cache defense */
    +            if (!apc_cache_defense(cache, &key TSRMLS_CC)) {
    +                
    +                /* initialize the entry for insertion */
    +                if ((entry = apc_cache_make_entry(&ctxt, &key, val, ttl TSRMLS_CC))) {
    +                
    +                    /* execute an insertion */
    +                    if (apc_cache_insert(cache, key, entry, &ctxt, t, exclusive TSRMLS_CC)) {
    +                        ret = 1;
    +                    }
    +                }
    +            }
    +        }
    +
    +        /* in any case of failure the context should be destroyed */
    +        if (!ret) {
    +            apc_cache_destroy_context(&ctxt TSRMLS_CC);
    +        }
    +    }
    +
    +    return ret;
    +} /* }}} */
    +
    +/* {{{ data_unserialize */
    +static zval* data_unserialize(const char *filename TSRMLS_DC)
    +{
    +    zval* retval;
    +    long len = 0;
    +    struct stat sb;
    +    char *contents, *tmp;
    +    FILE *fp;
    +    php_unserialize_data_t var_hash = {0,};
    +
    +    if(VCWD_STAT(filename, &sb) == -1) {
    +        return NULL;
    +    }
    +
    +    fp = fopen(filename, "rb");
    +
    +    len = sizeof(char)*sb.st_size;
    +
    +    tmp = contents = malloc(len);
    +
    +    if(!contents) {
    +        fclose(fp);
    +        return NULL;
    +    }
    +
    +    if(fread(contents, 1, len, fp) < 1) {	
    +        fclose(fp);
    +        free(contents);
    +        return NULL;
    +    }
    +
    +    MAKE_STD_ZVAL(retval);
    +
    +    PHP_VAR_UNSERIALIZE_INIT(var_hash);
    +    
    +    /* I wish I could use json */
    +    if(!php_var_unserialize(&retval, (const unsigned char**)&tmp, (const unsigned char*)(contents+len), &var_hash TSRMLS_CC)) {
    +        fclose(fp);
    +        zval_ptr_dtor(&retval);
    +        return NULL;
    +    }
    +
    +    PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
    +
    +    free(contents);
    +    fclose(fp);
    +
    +    return retval;
    +}
    +
    +static int apc_load_data(apc_cache_t* cache, const char *data_file TSRMLS_DC)
    +{
    +    char *p;
    +    char key[MAXPATHLEN] = {0,};
    +    unsigned int key_len;
    +    zval *data;
    +
    +    p = strrchr(data_file, DEFAULT_SLASH);
    +
    +    if(p && p[1]) {
    +        strlcpy(key, p+1, sizeof(key));
    +        p = strrchr(key, '.');
    +
    +        if(p) {
    +            p[0] = '\0';
    +            key_len = strlen(key)+1;
    +
    +            data = data_unserialize(data_file TSRMLS_CC);
    +            if(data) {
    +                apc_cache_store(cache, key, key_len, data, 0, 1 TSRMLS_CC);
    +            }
    +            return 1;
    +        }
    +    }
    +
    +    return 0;
    +}
    +
    +/* {{{ apc_cache_preload shall load the prepared data files in path into the specified cache */
    +PHP_APCU_API zend_bool apc_cache_preload(apc_cache_t* cache, const char *path TSRMLS_DC)
    +{
    +#ifndef ZTS	
    +	zend_bool result = 0;
    +	char file[MAXPATHLEN]={0,};
    +	int ndir, i;
    +	char *p = NULL;
    +	struct dirent **namelist = NULL;
    +
    +	if ((ndir = php_scandir(path, &namelist, 0, php_alphasort)) > 0) {
    +		for (i = 0; i < ndir; i++) {
    +			/* check for extension */
    +			if (!(p = strrchr(namelist[i]->d_name, '.'))
    +				    || (p && strcmp(p, ".data"))) {
    +				free(namelist[i]);
    +				continue;
    +			}
    +
    +			snprintf(file, MAXPATHLEN, "%s%c%s",
    +				    path, DEFAULT_SLASH, namelist[i]->d_name);
    +
    +			if(apc_load_data(cache, file TSRMLS_CC)) {
    +				result = 1;
    +			}
    +			free(namelist[i]);
    +		}
    +		free(namelist);
    +	}
    +	return result;
    +#else 
    +	apc_error("Cannot load data from apc.preload_path=%s in thread-safe mode" TSRMLS_CC, path);
    +	return 0;
    +#endif	
    +} /* }}} */
    +
    +/* {{{ apc_cache_release */
    +PHP_APCU_API void apc_cache_release(apc_cache_t* cache, apc_cache_entry_t* entry TSRMLS_DC)
    +{
    +    entry->ref_count--;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_destroy */
    +PHP_APCU_API void apc_cache_destroy(apc_cache_t* cache TSRMLS_DC)
    +{
    +	if (!cache) {
    +		return;
    +	}
    +
    +	/* destroy lock */
    +	DESTROY_LOCK(&cache->header->lock);
    +
    +	/* XXX this is definitely a leak, but freeing this causes all the apache
    +		children to freeze. It might be because the segment is shared between
    +		several processes. To figure out is how to free this safely. */
    +    /*apc_sma_free(cache->shmaddr);*/
    +    apc_efree(cache TSRMLS_CC);
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_real_expunge */
    +PHP_APCU_API void apc_cache_real_expunge(apc_cache_t* cache TSRMLS_DC) {
    +	/* increment counter */	
    +	cache->header->nexpunges++;
    +    
    +	/* expunge */
    +    {
    +		zend_ulong i;
    +
    +		for (i = 0; i < cache->nslots; i++) {
    +		    apc_cache_slot_t* p = cache->slots[i];
    +		    while (p) {
    +		        apc_cache_remove_slot(cache, &p TSRMLS_CC);
    +		    }
    +		    cache->slots[i] = NULL;
    +		}
    +	}
    +	
    +	/* set new time so counters make sense */
    +	cache->header->stime = apc_time();
    +
    +	/* reset counters */
    +	cache->header->ninserts = 0;
    +	cache->header->nentries = 0;
    +    cache->header->nhits = 0;
    +    cache->header->nmisses = 0;
    +	
    +	/* resets lastkey */
    +	memset(&cache->header->lastkey, 0, sizeof(apc_cache_key_t));
    +} /* }}} */
    +
    +/* {{{ apc_cache_clear */
    +PHP_APCU_API void apc_cache_clear(apc_cache_t* cache TSRMLS_DC)
    +{
    +	/* check there is a cache and it is not busy */
    +    if(!cache || apc_cache_busy(cache TSRMLS_CC)) {
    +		return;
    +	}
    +	
    +	/* lock header */
    +	APC_LOCK(cache->header);
    +	
    +	/* set busy */
    +	cache->header->state |= APC_CACHE_ST_BUSY;
    +	
    +	/* expunge cache */
    +	apc_cache_real_expunge(cache TSRMLS_CC);
    +
    +	/* set info */
    +    cache->header->stime = apc_time();
    +    cache->header->nexpunges = 0;
    +	
    +	/* unset busy */
    +    cache->header->state &= ~APC_CACHE_ST_BUSY;
    +	
    +	/* unlock header */
    +	APC_UNLOCK(cache->header);
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_default_expunge */
    +PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size TSRMLS_DC)
    +{
    +    time_t t;
    +	size_t suitable = 0L;
    +    size_t available = 0L;
    +
    +    t = apc_time();
    +
    +	/* check there is a cache, and it is not busy */
    +    if(!cache || apc_cache_busy(cache TSRMLS_CC)) {
    +		return;
    +	}
    +	
    +	/* get the lock for header */
    +	APC_LOCK(cache->header);
    +
    +	/* update state in header */
    +	cache->header->state |= APC_CACHE_ST_BUSY;
    +
    +	/* make suitable selection */
    +	suitable = (cache->smart > 0L) ? (size_t) (cache->smart * size) : (size_t) (cache->sma->size/2);
    +
    +	/* gc */
    +    apc_cache_gc(cache TSRMLS_CC);
    +
    +    /* get available */
    +	available = cache->sma->get_avail_mem();
    +
    +	/* perform expunge processing */
    +    if(!cache->ttl) {
    +
    +		/* check it is necessary to expunge */
    +		if (available < suitable) {
    +			apc_cache_real_expunge(cache TSRMLS_CC);
    +		}
    +    } else {
    +		apc_cache_slot_t **slot;
    +
    +		/* check that expunge is necessary */
    +        if (available < suitable) {
    +			zend_ulong i;
    +
    +			/* look for junk */
    +		    for (i = 0; i < cache->nslots; i++) {
    +		        slot = &cache->slots[i];
    +		        while (*slot) {
    +		            /*
    +		             * Entry TTL has precedence over cache TTL
    +		             */
    +		            if((*slot)->value->ttl) {
    +		                if((time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) {
    +		                    apc_cache_remove_slot(cache, slot TSRMLS_CC);
    +		                    continue;
    +		                }
    +		            } else if(cache->ttl) {
    +		                if((time_t) ((*slot)->ctime + cache->ttl) < t) {
    +		                    apc_cache_remove_slot(cache, slot TSRMLS_CC);
    +		                    continue;
    +		                }
    +		            }
    +					
    +					/* grab next slot */
    +					slot = &(*slot)->next;	            
    +		        }
    +		    }
    +
    +			/* if the cache now has space, then reset last key */
    +		    if (cache->sma->get_avail_size(size)) {
    +		        /* wipe lastkey */
    +				memset(&cache->header->lastkey, 0, sizeof(apc_cache_key_t));
    +		    } else {
    +				/* with not enough space left in cache, we are forced to expunge */
    +				apc_cache_real_expunge(cache TSRMLS_CC);
    +			}
    +        }
    +    }
    +
    +	/* we are done */
    +	cache->header->state &= ~APC_CACHE_ST_BUSY;
    +
    +	/* unlock header */
    +	APC_UNLOCK(cache->header);
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_make_context */
    +PHP_APCU_API zend_bool apc_cache_make_context(apc_cache_t* cache,
    +                                              apc_context_t* context,
    +                                              apc_context_type context_type,
    +                                              apc_pool_type pool_type,
    +                                              apc_copy_type copy_type,
    +                                              uint force_update TSRMLS_DC) {
    +	switch (context_type) {
    +		case APC_CONTEXT_SHARE: {
    +			return apc_cache_make_context_ex(
    +				context,
    +                cache->serializer,
    +				(apc_malloc_t) cache->sma->smalloc,
    +                cache->sma->sfree,
    +                cache->sma->protect,
    +                cache->sma->unprotect,
    +				pool_type, copy_type, force_update TSRMLS_CC
    +			);
    +		} break;
    +		
    +		case APC_CONTEXT_NOSHARE: {
    +			return apc_cache_make_context_ex(
    +				context,
    +                cache->serializer,
    +				apc_php_malloc, apc_php_free, NULL, NULL,
    +				pool_type, copy_type, force_update TSRMLS_CC
    +			);
    +		} break;
    +
    +		case APC_CONTEXT_NONE:
    +			/* never used, just to make gcc warning free */
    +			break;
    +	}
    +
    +	return 0;
    +} /* }}} */
    +
    +/* {{{ apc_cache_make_context_ex */
    +PHP_APCU_API zend_bool apc_cache_make_context_ex(apc_context_t* context,
    +                                                 apc_serializer_t* serializer,
    +                                                 apc_malloc_t _malloc, 
    +                                                 apc_free_t _free, 
    +                                                 apc_protect_t _protect, 
    +                                                 apc_unprotect_t _unprotect, 
    +                                                 apc_pool_type pool_type, 
    +                                                 apc_copy_type copy_type, 
    +                                                 uint force_update TSRMLS_DC) {
    +	/* attempt to create the pool */
    +	context->pool = apc_pool_create(
    +		pool_type, _malloc, _free, _protect, _unprotect TSRMLS_CC
    +	);
    +
    +	if (!context->pool) {
    +		apc_warning("Unable to allocate memory for pool." TSRMLS_CC);
    +		return 0;
    +	}
    +
    +	/* set context information */
    +	context->serializer = serializer;
    +	context->copy = copy_type;
    +	context->force_update = force_update;
    +
    +	/* set this to avoid memory errors */
    +	memset(&context->copied, 0, sizeof(HashTable));
    +
    +	return 1;
    +} /* }}} */
    +
    +/* {{{ apc_context_destroy */
    +PHP_APCU_API zend_bool apc_cache_destroy_context(apc_context_t* context TSRMLS_DC) {
    +    if (!context->pool) {
    +        return 0;
    +    }
    +
    +    apc_pool_destroy(context->pool TSRMLS_CC);
    +
    +    return 1;
    +} /* }}} */
    +
    +/* {{{ apc_cache_insert */
    +PHP_APCU_API zend_bool apc_cache_insert(apc_cache_t* cache, 
    +                                        apc_cache_key_t key, 
    +                                        apc_cache_entry_t* value, 
    +                                        apc_context_t* ctxt, 
    +                                        time_t t, 
    +                                        zend_bool exclusive TSRMLS_DC)
    +{
    +    zend_bool result = 0;
    +
    +	/* at least */
    +	if (!value) {
    +		return result;
    +	}
    +	
    +	/* check we are able to deal with this request */
    +	if (!cache || apc_cache_busy(cache TSRMLS_CC)) {
    +		return result;
    +	}
    +
    +	/* lock header */
    +	APC_LOCK(cache->header);
    +	
    +	/* process deleted list  */
    +    apc_cache_gc(cache TSRMLS_CC);
    +
    +	/* make the insertion */	
    +	{
    +		apc_cache_slot_t** slot;
    +
    +		/*
    +		* select appropriate slot ...
    +		*/
    +		slot = &cache->slots[key.h % cache->nslots];
    +
    +		while (*slot) {
    +			
    +			/* check for a match by hash and string */
    +		    if (((*slot)->key.h == key.h) && (!memcmp((*slot)->key.str, key.str, key.len))) {
    +
    +		        /* 
    +		         * At this point we have found the user cache entry.  If we are doing 
    +		         * an exclusive insert (apc_add) we are going to bail right away if
    +		         * the user entry already exists and it has no ttl, or
    +		         * there is a ttl and the entry has not timed out yet.
    +		         */
    +		        if(exclusive) {
    +                    if (!(*slot)->value->ttl || (time_t) ((*slot)->ctime + (*slot)->value->ttl) >= t) {
    +                        goto nothing;
    +                    }
    +		        }
    +                apc_cache_remove_slot(cache, slot TSRMLS_CC);
    +		        break;
    +		    } else 
    +
    +		    /* 
    +		     * This is a bit nasty.  The idea here is to do runtime cleanup of the linked list of
    +		     * slot entries so we don't always have to skip past a bunch of stale entries.  We check
    +		     * for staleness here and get rid of them by first checking to see if the cache has a global
    +		     * access ttl on it and removing entries that haven't been accessed for ttl seconds and secondly
    +		     * we see if the entry has a hard ttl on it and remove it if it has been around longer than its ttl
    +		     */
    +		    if((cache->ttl && (time_t)(*slot)->atime < (t - (time_t)cache->ttl)) || 
    +		       ((*slot)->value->ttl && (time_t) ((*slot)->ctime + (*slot)->value->ttl) < t)) {
    +                apc_cache_remove_slot(cache, slot TSRMLS_CC);
    +		        continue;
    +		    }
    +		
    +			/* set next slot */
    +            slot = &(*slot)->next;      
    +		}
    +
    +		if ((*slot = make_slot(cache, &key, value, *slot, t TSRMLS_CC)) != NULL) {
    +            /* set value size from pool size */
    +            value->mem_size = ctxt->pool->size;
    +
    +            cache->header->mem_size += ctxt->pool->size;
    +            cache->header->nentries++;
    +            cache->header->ninserts++;
    +		} else {
    +			goto nothing;
    +		}
    +	}
    +
    +    /* unlock and return succesfull */	
    +    APC_UNLOCK(cache->header);
    +
    +    return 1;
    +
    +    /* bail */
    +nothing:
    +    APC_UNLOCK(cache->header);
    +
    +    return 0;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_find */
    +PHP_APCU_API apc_cache_entry_t* apc_cache_find(apc_cache_t* cache, char *strkey, zend_uint keylen, time_t t TSRMLS_DC)
    +{
    +	/* check we are able to deal with the request */
    +    if(!cache || apc_cache_busy(cache TSRMLS_CC)) {
    +        return NULL;
    +    }
    +
    +	/* we only declare a volatile we need */
    +    {
    +        apc_cache_slot_t** slot;
    +		zend_ulong h, s;
    +
    +        volatile apc_cache_entry_t* value = NULL;
    +        
    +		/* calculate hash and slot */
    +		apc_cache_hash_slot(cache, strkey, keylen, &h, &s);
    +
    +        /* read lock header */
    +		APC_RLOCK(cache->header);
    +
    +		/* find head */
    +		slot = &cache->slots[s];
    +
    +		while (*slot) {
    +			/* check for a matching key by has and identifier */
    +		    if ((h == (*slot)->key.h) && !memcmp((*slot)->key.str, strkey, keylen)) {
    +
    +		        /* Check to make sure this entry isn't expired by a hard TTL */
    +		        if((*slot)->value->ttl && (time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) {
    +					/* increment misses on cache */
    +					cache->header->nmisses++;
    +
    +					/* unlock header */			
    +					APC_RUNLOCK(cache->header);
    +		            
    +		            return NULL;
    +		        }
    +
    +		        /* Otherwise we are fine, increase counters and return the cache entry */
    +		        (*slot)->nhits++;
    +		        (*slot)->value->ref_count++;
    +		        (*slot)->atime = t;
    +			
    +				/* set cache num hits */
    +				cache->header->nhits++;
    +		        
    +				/* grab value */
    +		        value = (*slot)->value;
    +
    +				/* unlock header */			
    +				APC_RUNLOCK(cache->header);
    +			
    +		        return (apc_cache_entry_t*)value;
    +		    }
    +
    +			/* next */
    +		    slot = &(*slot)->next;		
    +		}
    +	 	
    +		/* not found, so increment misses */
    +		cache->header->nmisses++;
    +
    +		/* unlock header */
    +		APC_RUNLOCK(cache->header);
    +    }
    +
    +    return NULL;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_fetch */
    +PHP_APCU_API zend_bool apc_cache_fetch(apc_cache_t* cache, char* strkey, zend_uint keylen, time_t t, zval **dst TSRMLS_DC) 
    +{
    +	apc_cache_entry_t *entry;
    +	zend_bool ret = 0;
    +	
    +	/* find the entry */
    +	if ((entry = apc_cache_find(cache, strkey, keylen, t TSRMLS_CC))) {
    +        /* context for copying out */
    +		apc_context_t ctxt = {0, };
    +
    +		/* create unpool context */
    +		if (apc_cache_make_context(cache, &ctxt, APC_CONTEXT_NOSHARE, APC_UNPOOL, APC_COPY_OUT, 0 TSRMLS_CC)) {
    +
    +			/* copy to destination */
    +			apc_cache_fetch_zval(&ctxt, *dst, entry->val TSRMLS_CC);
    +
    +			/* release entry */
    +			apc_cache_release(
    +				cache, entry TSRMLS_CC);
    +
    +			/* destroy context */
    +			apc_cache_destroy_context(&ctxt TSRMLS_CC );
    +
    +			/* set result */
    +			ret = 1;
    +		}
    +	}
    +	
    +	return ret;
    +} /* }}} */
    +
    +/* {{{ apc_cache_exists */
    +PHP_APCU_API apc_cache_entry_t* apc_cache_exists(apc_cache_t* cache, char *strkey, zend_uint keylen, time_t t TSRMLS_DC)
    +{
    +    if(apc_cache_busy(cache TSRMLS_CC))
    +    {
    +        /* cache cleanup in progress */ 
    +        return NULL;
    +    }
    +
    +	/* we only declare volatiles we need */
    +	{
    +		apc_cache_slot_t** slot;
    +	
    +		volatile apc_cache_entry_t* value = NULL;
    +		zend_ulong h, s;
    +
    +        /* get hash and slot */
    +		apc_cache_hash_slot(cache, strkey, keylen, &h, &s);
    +
    +        /* read lock header */
    +		APC_RLOCK(cache->header);	
    +
    +		/* find head */
    +		slot = &cache->slots[s];
    +
    +		while (*slot) {
    +			/* check for match by hash and identifier */
    +		    if ((h == (*slot)->key.h) &&
    +		        !memcmp((*slot)->key.str, strkey, keylen)) {
    +
    +		        /* Check to make sure this entry isn't expired by a hard TTL */
    +		        if((*slot)->value->ttl && (time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) {
    +                    /* marked as a miss */
    +                    cache->header->nmisses++;
    +
    +					/* unlock header */
    +					APC_RUNLOCK(cache->header);
    +
    +		            return NULL;
    +		        }
    +
    +		        /* Return the cache entry ptr */
    +		        value = (*slot)->value;
    +			
    +				/* unlock header */
    +				APC_RUNLOCK(cache->header);
    +					
    +		        return (apc_cache_entry_t*)value;
    +		    }
    +
    +			slot = &(*slot)->next;  
    +		}
    +
    +		/* unlock header */
    +		APC_RUNLOCK(cache->header);
    +	}
    +
    +    return NULL;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_update */
    +PHP_APCU_API zend_bool apc_cache_update(apc_cache_t* cache, char *strkey, zend_uint keylen, apc_cache_updater_t updater, void* data TSRMLS_DC)
    +{
    +    apc_cache_slot_t** slot;
    +	
    +    zend_bool retval = 0;
    +    zend_ulong h, s;
    +
    +    if(apc_cache_busy(cache TSRMLS_CC))
    +    {
    +        /* cannot service request right now */ 
    +        return 0;
    +    }
    +
    +    /* calculate hash */
    +    apc_cache_hash_slot(cache, strkey, keylen, &h, &s);
    +	
    +	/* lock header */
    +	APC_LOCK(cache->header);
    +
    +	/* find head */
    +    slot = &cache->slots[s];
    +
    +    while (*slot) {
    +		/* check for a match by hash and identifier */
    +        if ((h == (*slot)->key.h) &&
    +            !memcmp((*slot)->key.str, strkey, keylen)) {
    +			/* attempt to perform update */
    +            switch(Z_TYPE_P((*slot)->value->val) & ~IS_CONSTANT_TYPE_MASK) {
    +                case IS_ARRAY:
    +                case IS_OBJECT:
    +                {
    +                    if(cache->serializer) {
    +                        retval = 0;
    +                        break;
    +                    } else {
    +                        /* fall through */
    +                    }
    +                }
    +                /* fall through */
    +                default:
    +                {
    +					/* executing update */
    +                    retval = updater(
    +						cache, (*slot)->value, data);
    +
    +					/* set modified time */
    +                    (*slot)->key.mtime = apc_time();
    +                }
    +                break;
    +            }
    +			/* unlock header */
    +			APC_UNLOCK(cache->header);
    +
    +            return retval;
    +        }
    +
    +		/* set next slot */
    +        slot = &(*slot)->next;
    +	}
    +	
    +	/* unlock header */
    +	APC_UNLOCK(cache->header);
    +
    +    return 0;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_delete */
    +PHP_APCU_API zend_bool apc_cache_delete(apc_cache_t* cache, char *strkey, zend_uint keylen TSRMLS_DC)
    +{
    +    apc_cache_slot_t** slot;
    +	
    +    zend_ulong h, s;
    +
    +	if (!cache) {
    +		return 1;
    +	}
    +
    +    /* calculate hash and slot */
    +    apc_cache_hash_slot(cache, strkey, keylen, &h, &s);
    +
    +	/* lock cache */
    +	APC_LOCK(cache->header);	
    +	
    +	/* find head */
    +    slot = &cache->slots[s];
    +
    +    while (*slot) {
    +		/* check for a match by hash and identifier */
    +        if ((h == (*slot)->key.h) && 
    +            !memcmp((*slot)->key.str, strkey, keylen)) {
    +			/* executing removal */
    +            apc_cache_remove_slot(
    +				cache, slot TSRMLS_CC);
    +			goto deleted;
    +        }
    +		
    +		/* continue locking */
    +		slot = &(*slot)->next;      
    +    }
    +	
    +	/* unlock header */
    +	APC_UNLOCK(cache->header);
    +	
    +	return 0;
    +
    +deleted:
    +	/* unlock deleted */
    +	APC_UNLOCK(cache->header);
    +
    +	return 1;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_make_key */
    +PHP_APCU_API zend_bool apc_cache_make_key(apc_cache_key_t* key, char* str, zend_ulong len TSRMLS_DC)
    +{
    +    assert(key != NULL);
    +
    +    if (!str) {
    +	    return 0;
    +    }
    +    
    +	if (!len)
    +	    len = strlen(str) + 1;
    +	
    +    key->str = str;
    +    key->len = len;
    +    key->h = zend_inline_hash_func((char *)key->str, key->len);
    +    key->mtime = apc_time();
    +
    +    return 1;
    +}
    +/* }}} */
    +
    +/* {{{ my_serialize_object */
    +static zval* my_serialize_object(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC)
    +{
    +    smart_str buf = {0};
    +    apc_pool* pool = ctxt->pool;
    +    apc_serialize_t serialize = APC_SERIALIZER_NAME(php);
    +    void *config = NULL;
    +
    +    if(ctxt->serializer) {
    +        serialize = ctxt->serializer->serialize;
    +        config = (ctxt->serializer->config != NULL) ? ctxt->serializer->config : ctxt;
    +    }
    +
    +    if(serialize((unsigned char**)&buf.c, &buf.len, src, config TSRMLS_CC)) {
    +        dst->type = src->type & ~IS_CONSTANT; 
    +        dst->value.str.len = buf.len;
    +        CHECK(dst->value.str.val = apc_pmemcpy(buf.c, (buf.len + 1), pool TSRMLS_CC));
    +    }
    +
    +    if(buf.c) {
    +		smart_str_free(&buf);
    +	}
    +
    +    return dst;
    +}
    +/* }}} */
    +
    +/* {{{ my_unserialize_object */
    +static zval* my_unserialize_object(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC)
    +{
    +    apc_unserialize_t unserialize = APC_UNSERIALIZER_NAME(php);
    +    unsigned char *p = (unsigned char*)Z_STRVAL_P(src);
    +    void *config = NULL;
    +
    +    if(ctxt->serializer) {
    +        unserialize = ctxt->serializer->unserialize;
    +        config = (ctxt->serializer->config != NULL) ? ctxt->serializer->config : ctxt;
    +    }
    +
    +    if(unserialize(&dst, p, Z_STRLEN_P(src), config TSRMLS_CC)) {
    +        return dst;
    +    } else {
    +        zval_dtor(dst);
    +        dst->type = IS_NULL;
    +    }
    +    return dst;
    +}
    +/* }}} */
    +
    +
    +/* {{{ my_copy_hashtable_ex */
    +static APC_HOTSPOT HashTable* my_copy_hashtable_ex(HashTable* dst,
    +                                    HashTable* src TSRMLS_DC,
    +                                    ht_copy_fun_t copy_fn,
    +                                    int holds_ptrs,
    +                                    apc_context_t* ctxt,
    +                                    ht_check_copy_fun_t check_fn,
    +                                    ...)
    +{
    +    Bucket* curr = NULL;
    +    Bucket* prev = NULL;
    +    Bucket* newp = NULL;
    +    int first = 1;
    +    apc_pool* pool = ctxt->pool;
    +
    +    assert(src != NULL);
    +
    +    if (!dst) {
    +        CHECK(dst = (HashTable*) pool->palloc(pool, sizeof(src[0]) TSRMLS_CC));
    +    }
    +
    +    memcpy(dst, src, sizeof(src[0]));
    +
    +    /* allocate buckets for the new hashtable */
    +    CHECK((dst->arBuckets = pool->palloc(pool, (dst->nTableSize * sizeof(Bucket*)) TSRMLS_CC)));
    +
    +    memset(dst->arBuckets, 0, dst->nTableSize * sizeof(Bucket*));
    +    dst->pInternalPointer = NULL;
    +    dst->pListHead = NULL;
    +
    +    for (curr = src->pListHead; curr != NULL; curr = curr->pListNext) {
    +        int n = curr->h % dst->nTableSize;
    +
    +        if(check_fn) {
    +            va_list args;
    +            va_start(args, check_fn);
    +
    +            /* Call the check_fn to see if the current bucket
    +             * needs to be copied out
    +             */
    +            if(!check_fn(curr, args)) {
    +                dst->nNumOfElements--;
    +                va_end(args);
    +                continue;
    +            }
    +
    +            va_end(args);
    +        }
    +
    +        /* create a copy of the bucket 'curr' */
    +#ifdef ZEND_ENGINE_2_4
    +        if (!curr->nKeyLength) {
    +            CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
    +        } else if (IS_INTERNED(curr->arKey)) {
    +            CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
    +        } else {
    +            /* I repeat, this is ugly */
    +            CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket) + curr->nKeyLength, pool TSRMLS_CC)));
    +            newp->arKey = (const char*)(newp+1);
    +        }
    +#else
    +        CHECK((newp = (Bucket*) apc_pmemcpy(curr,
    +                                  (sizeof(Bucket) + curr->nKeyLength - 1),
    +                                  pool TSRMLS_CC)));
    +#endif
    +
    +        /* insert 'newp' into the linked list at its hashed index */
    +        if (dst->arBuckets[n]) {
    +            newp->pNext = dst->arBuckets[n];
    +            newp->pLast = NULL;
    +            newp->pNext->pLast = newp;
    +        } else {
    +            newp->pNext = newp->pLast = NULL;
    +        }
    +
    +        dst->arBuckets[n] = newp;
    +
    +        /* copy the bucket data using our 'copy_fn' callback function */
    +        CHECK((newp->pData = copy_fn(NULL, curr->pData, ctxt TSRMLS_CC)));
    +
    +        if (holds_ptrs) {
    +            memcpy(&newp->pDataPtr, newp->pData, sizeof(void*));
    +        }
    +        else {
    +            newp->pDataPtr = NULL;
    +        }
    +
    +        /* insert 'newp' into the table-thread linked list */
    +        newp->pListLast = prev;
    +        newp->pListNext = NULL;
    +
    +        if (prev) {
    +            prev->pListNext = newp;
    +        }
    +
    +        if (first) {
    +            dst->pListHead = newp;
    +            first = 0;
    +        }
    +
    +        prev = newp;
    +    }
    +
    +    dst->pListTail = newp;
    +
    +    zend_hash_internal_pointer_reset(dst);
    +
    +    return dst;
    +}
    +/* }}} */
    +
    +
    +/* {{{ my_copy_zval_ptr */
    +static zval** my_copy_zval_ptr(zval** dst, const zval** src, apc_context_t* ctxt TSRMLS_DC)
    +{
    +    zval* dst_new;
    +    apc_pool* pool = ctxt->pool;
    +    int usegc = (ctxt->copy == APC_COPY_OUT);
    +
    +    assert(src != NULL);
    +
    +    if (!dst) {
    +        CHECK(dst = (zval**) pool->palloc(pool, sizeof(zval*) TSRMLS_CC));
    +    }
    +
    +    if(usegc) {
    +        ALLOC_ZVAL(dst[0]);
    +        CHECK(dst[0]);
    +    } else {
    +        CHECK((dst[0] = (zval*) pool->palloc(pool, sizeof(zval) TSRMLS_CC)));
    +    }
    +
    +    CHECK((dst_new = my_copy_zval(*dst, *src, ctxt TSRMLS_CC)));
    +
    +    if(dst_new != *dst) {
    +        if(usegc) {
    +            FREE_ZVAL(dst[0]);
    +        }
    +        *dst = dst_new;
    +    }
    +
    +    return dst;
    +}
    +/* }}} */
    +
    +/* {{{ my_copy_zval */
    +static APC_HOTSPOT zval* my_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC)
    +{
    +    zval **tmp;
    +    apc_pool* pool = ctxt->pool;
    +
    +    assert(dst != NULL);
    +    assert(src != NULL);
    +
    +    memcpy(dst, src, sizeof(src[0]));
    +
    +    if(ctxt->copied.nTableSize) {
    +        if(zend_hash_index_find(&ctxt->copied, (ulong)src, (void**)&tmp) == SUCCESS) {
    +            if(Z_ISREF_P((zval*)src)) {
    +                Z_SET_ISREF_PP(tmp);
    +            }
    +            Z_ADDREF_PP(tmp);
    +            return *tmp;
    +        }
    +
    +        zend_hash_index_update(&ctxt->copied, (ulong)src, (void**)&dst, sizeof(zval*), NULL);
    +    }
    +
    +    if(ctxt->copy == APC_COPY_OUT || ctxt->copy == APC_COPY_IN) {
    +        /* deep copies are refcount(1), but moved up for recursive 
    +         * arrays,  which end up being add_ref'd during its copy. */
    +        Z_SET_REFCOUNT_P(dst, 1);
    +        Z_UNSET_ISREF_P(dst);
    +    } else {
    +        /* code uses refcount=2 for consts */
    +        Z_SET_REFCOUNT_P(dst, Z_REFCOUNT_P((zval*)src));
    +        Z_SET_ISREF_TO_P(dst, Z_ISREF_P((zval*)src));
    +    }
    +
    +    switch (src->type & IS_CONSTANT_TYPE_MASK) {
    +    case IS_RESOURCE:
    +    case IS_BOOL:
    +    case IS_LONG:
    +    case IS_DOUBLE:
    +    case IS_NULL:
    +        break;
    +
    +    case IS_CONSTANT:
    +    case IS_STRING:
    +        if (src->value.str.val) {
    +            CHECK(dst->value.str.val = apc_pmemcpy(src->value.str.val,
    +                                                   src->value.str.len+1,
    +                                                   pool TSRMLS_CC));
    +        }
    +        break;
    +
    +    case IS_ARRAY:
    +        if(ctxt->serializer == NULL) {
    +
    +            CHECK(dst->value.ht =
    +                my_copy_hashtable(NULL,
    +                                  src->value.ht,
    +                                  (ht_copy_fun_t) my_copy_zval_ptr,
    +                                  1,
    +                                  ctxt));
    +            break;
    +        } else {
    +            /* fall through to object case */
    +        }
    +
    +    case IS_OBJECT:
    +    
    +        dst->type = IS_NULL;
    +        if(ctxt->copy == APC_COPY_IN) {
    +            dst = my_serialize_object(dst, src, ctxt TSRMLS_CC);
    +        } else if(ctxt->copy == APC_COPY_OUT) {
    +            dst = my_unserialize_object(dst, src, ctxt TSRMLS_CC);
    +        }
    +        break;
    +#ifdef ZEND_ENGINE_2_4
    +    case IS_CALLABLE:
    +        /* XXX implement this */
    +        assert(0);
    +        break;
    +#endif
    +
    +    default:
    +        assert(0);
    +    }
    +
    +    return dst;
    +}
    +/* }}} */
    +
    +/* {{{ apc_copy_zval */
    +PHP_APCU_API zval* apc_copy_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC)
    +{
    +    apc_pool* pool = ctxt->pool;
    +    
    +    assert(src != NULL);
    +
    +    if (!dst) {
    +        if(ctxt->copy == APC_COPY_OUT) {
    +            ALLOC_ZVAL(dst);
    +            CHECK(dst);
    +        } else {
    +            CHECK(dst = (zval*) pool->palloc(pool, sizeof(zval) TSRMLS_CC));
    +        }
    +    }
    +
    +    CHECK(dst = my_copy_zval(dst, src, ctxt TSRMLS_CC));
    +    return dst;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_store_zval */
    +PHP_APCU_API zval* apc_cache_store_zval(zval* dst, const zval* src, apc_context_t* ctxt TSRMLS_DC)
    +{
    +    if (Z_TYPE_P(src) == IS_ARRAY) {
    +        /* Maintain a list of zvals we've copied to properly handle recursive structures */
    +        zend_hash_init(&ctxt->copied, 0, NULL, NULL, 0);
    +        dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC);
    +        zend_hash_destroy(&ctxt->copied);
    +        ctxt->copied.nTableSize=0;
    +    } else {
    +        dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC);
    +    }
    +
    +
    +    return dst;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_fetch_zval */
    +PHP_APCU_API zval* apc_cache_fetch_zval(apc_context_t* ctxt, zval* dst, const zval* src TSRMLS_DC)
    +{
    +    if (Z_TYPE_P(src) == IS_ARRAY) {
    +        /* Maintain a list of zvals we've copied to properly handle recursive structures */
    +        zend_hash_init(&ctxt->copied, 0, NULL, NULL, 0);
    +        dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC);
    +        zend_hash_destroy(&ctxt->copied);
    +        ctxt->copied.nTableSize=0;
    +    } else {
    +        dst = apc_copy_zval(dst, src, ctxt TSRMLS_CC);
    +    }
    +
    +
    +    return dst;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_make_entry */
    +PHP_APCU_API apc_cache_entry_t* apc_cache_make_entry(apc_context_t* ctxt, apc_cache_key_t *key, const zval* val, const unsigned int ttl TSRMLS_DC)
    +{
    +    apc_cache_entry_t* entry;
    +    apc_pool* pool = ctxt->pool;
    +
    +    entry = (apc_cache_entry_t*) pool->palloc(pool, sizeof(apc_cache_entry_t) TSRMLS_CC);
    +    if (!entry) {
    +		return NULL;
    +	}
    +	
    +	/* set key for serializer */
    +	ctxt->key = key;
    +	
    +    entry->val = apc_cache_store_zval(NULL, val, ctxt TSRMLS_CC);
    +    if(!entry->val) {
    +        return NULL;
    +    }
    +
    +    INIT_PZVAL(entry->val);
    +    entry->ttl = ttl;
    +    entry->ref_count = 0;
    +    entry->mem_size = 0;
    +    entry->pool = pool;
    +    return entry;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_link_info */
    +static zval* apc_cache_link_info(apc_cache_t *cache, apc_cache_slot_t* p TSRMLS_DC)
    +{
    +    zval *link = NULL;
    +
    +    ALLOC_INIT_ZVAL(link);
    +
    +    if(!link) {
    +        return NULL;
    +    }
    +
    +    array_init(link);
    +
    +    add_assoc_stringl(link, "info", (char*) p->key.str, p->key.len-1, 1);
    +    add_assoc_long(link, "ttl", (long)p->value->ttl);
    +
    +    add_assoc_double(link, "num_hits", (double)p->nhits);
    +    add_assoc_long(link, "modification_time", p->key.mtime);
    +    add_assoc_long(link, "creation_time", p->ctime);
    +    add_assoc_long(link, "deletion_time", p->dtime);
    +    add_assoc_long(link, "access_time", p->atime);
    +    add_assoc_long(link, "ref_count", p->value->ref_count);
    +    add_assoc_long(link, "mem_size", p->value->mem_size);
    +
    +    return link;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_info */
    +PHP_APCU_API zval* apc_cache_info(apc_cache_t* cache, zend_bool limited TSRMLS_DC)
    +{
    +    zval *info = NULL;
    +    zval *list = NULL;
    +    zval *gc = NULL;
    +    zval *slots = NULL;
    +    apc_cache_slot_t* p;
    +    zend_ulong i, j;
    +
    +    if (!cache) {
    +        return NULL;
    +    }
    +
    +    ALLOC_INIT_ZVAL(info);
    +
    +    /* read lock header */
    +    APC_RLOCK(cache->header);
    +
    +    array_init(info);
    +    add_assoc_long(info, "num_slots", cache->nslots);
    +    add_assoc_long(info, "ttl", cache->ttl);
    +    add_assoc_double(info, "num_hits", (double)cache->header->nhits);
    +    add_assoc_double(info, "num_misses", (double)cache->header->nmisses);
    +    add_assoc_double(info, "num_inserts", (double)cache->header->ninserts);
    +    add_assoc_long(info,   "num_entries", cache->header->nentries);
    +    add_assoc_double(info, "num_expunges", (double)cache->header->nexpunges);
    +    add_assoc_long(info, "start_time", cache->header->stime);
    +    add_assoc_double(info, "mem_size", (double)cache->header->mem_size);
    +
    +#ifdef MULTIPART_EVENT_FORMDATA
    +    add_assoc_long(info, "file_upload_progress", 1);
    +#else
    +    add_assoc_long(info, "file_upload_progress", 0);
    +#endif
    +#if APC_MMAP
    +    add_assoc_stringl(info, "memory_type", "mmap", sizeof("mmap")-1, 1);
    +#else
    +    add_assoc_stringl(info, "memory_type", "IPC shared", sizeof("IPC shared")-1, 1);
    +#endif
    +
    +    if (!limited) {
    +        /* For each hashtable slot */
    +        ALLOC_INIT_ZVAL(list);
    +        array_init(list);
    +
    +        ALLOC_INIT_ZVAL(slots);
    +        array_init(slots);
    +
    +        for (i = 0; i < cache->nslots; i++) {
    +            p = cache->slots[i];
    +            j = 0;
    +            for (; p != NULL; p = p->next) {
    +                zval *link = apc_cache_link_info(cache, p TSRMLS_CC);
    +                add_next_index_zval(list, link);
    +                j++;
    +            }
    +            if(j != 0) {
    +                add_index_long(slots, (ulong)i, j);
    +            }
    +        }
    +
    +        /* For each slot pending deletion */
    +        ALLOC_INIT_ZVAL(gc);
    +        array_init(gc);
    +
    +        for (p = cache->header->gc; p != NULL; p = p->next) {
    +            zval *link = apc_cache_link_info(cache, p TSRMLS_CC);
    +            add_next_index_zval(gc, link);
    +        }
    +        
    +        add_assoc_zval(info, "cache_list", list);
    +        add_assoc_zval(info, "deleted_list", gc);
    +        add_assoc_zval(info, "slot_distribution", slots);
    +    }
    +	
    +	/* unlock header */
    +	APC_RUNLOCK(cache->header);
    +
    +    return info;
    +}
    +/* }}} */
    +
    +/*
    + fetches information about the key provided
    +*/
    +PHP_APCU_API zval* apc_cache_stat(apc_cache_t* cache,
    +                                  char *strkey,
    +                                  zend_uint keylen TSRMLS_DC) {
    +    zval *stat;
    +    apc_cache_slot_t** slot;
    +	zend_ulong h, s;
    +    
    +	/* calculate hash and slot */
    +	apc_cache_hash_slot(cache, strkey, keylen, &h, &s);
    +	
    +	/* allocate stat buffer */
    +	ALLOC_INIT_ZVAL(stat);
    +
    +    /* read lock header */
    +	APC_RLOCK(cache->header);
    +
    +	/* find head */
    +	slot = &cache->slots[s];
    +
    +	while (*slot) {
    +		/* check for a matching key by has and identifier */
    +	    if ((h == (*slot)->key.h) && !memcmp((*slot)->key.str, strkey, keylen)) {
    +            array_init(stat);
    +            
    +            add_assoc_long(stat, "hits",  (*slot)->nhits);
    +            add_assoc_long(stat, "access_time", (*slot)->atime);
    +            add_assoc_long(stat, "modification_time", (*slot)->key.mtime);
    +            add_assoc_long(stat, "creation_time", (*slot)->ctime);
    +            add_assoc_long(stat, "deletion_time", (*slot)->dtime);
    +	        add_assoc_long(stat, "ttl",   (*slot)->value->ttl);
    +	        add_assoc_long(stat, "refs",  (*slot)->value->ref_count);
    +	        
    +	        break;
    +	    }
    +
    +		/* next */
    +	    slot = &(*slot)->next;		
    +	}
    +    
    +    APC_RUNLOCK(cache->header);
    +    
    +    return stat;
    +}
    +
    +/* {{{ apc_cache_busy */
    +PHP_APCU_API zend_bool apc_cache_busy(apc_cache_t* cache TSRMLS_DC)
    +{	
    +	return (cache->header->state & APC_CACHE_ST_BUSY);
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_defense */
    +PHP_APCU_API zend_bool apc_cache_defense(apc_cache_t* cache, apc_cache_key_t* key TSRMLS_DC)
    +{
    +	zend_bool result = 0;
    +
    +	/* in ZTS mode, we use the current TSRM context to determine the owner */
    +#ifdef ZTS
    +# define FROM_DIFFERENT_THREAD(k) ((key->owner = TSRMLS_C) != (k)->owner) 
    +#else
    +# define FROM_DIFFERENT_THREAD(k) ((key->owner = getpid()) != (k)->owner) 
    +#endif
    +
    +	/* only continue if slam defense is enabled */
    +	if (cache->defend) {
    +
    +		/* for copy of locking key struct */
    +		apc_cache_key_t *last = &cache->header->lastkey;
    +
    +		/* check the hash and length match */
    +		if(last->h == key->h && last->len == key->len) {
    +
    +			/* check the time ( last second considered slam ) and context */
    +			if(last->mtime == key->mtime && 
    +			   FROM_DIFFERENT_THREAD(last)) {
    +
    +			    /* potential cache slam */
    +			    apc_debug(
    +					"Potential cache slam averted for key '%s'" TSRMLS_CC, key->str);
    +			    result = 1;
    +			} else {
    +				/* sets enough information for an educated guess, but is not exact */
    +				last->h = key->h;
    +				last->len = key->len;
    +				last->mtime = apc_time();
    +
    +				/* required to tell contexts apart */
    +#ifdef ZTS
    +				last->owner = TSRMLS_C;
    +#else
    +				last->owner = getpid();
    +#endif				
    +			}
    +		}
    +	}
    +
    +    return result;
    +}
    +/* }}} */
    +
    +/* {{{ apc_cache_serializer */
    +PHP_APCU_API void apc_cache_serializer(apc_cache_t* cache, const char* name TSRMLS_DC) {
    +	if (cache && !cache->serializer) {
    +		cache->serializer = apc_find_serializer(name TSRMLS_CC);
    +	}
    +} /* }}} */
    +
    +/*
    + * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_cache.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_cache.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_cache.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_cache.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,56 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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               |
    +  |          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.
    +
    + */
    +
    +/* $Id: apc_cache.h 328172 2012-10-28 21:44:47Z rasmus $ */
    +
    +#ifndef APC_CACHE_H
    +#define APC_CACHE_H
    +
    +#include "apc.h"
    +#include "apc_lock.h"
    +#include "apc_pool.h"
    +#include "TSRM.h"
    +
    +#ifndef APC_CACHE_API_H
    +# include "apc_cache_api.h"
    +#endif
    +
    +#ifdef APC_FULL_BC
    +# define APC_CACHE_IS_USER(ct, ct_len) ((ct_len) == 4 && !strncasecmp("user", (ct), 4))
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_globals.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_globals.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_globals.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_globals.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,123 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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               |
    +  |          George Schlossnagle                      |
    +  |          Rasmus Lerdorf                              |
    +  |          Arun C. Murthy                         |
    +  |          Gopal Vijayaraghavan                  |
    +  +----------------------------------------------------------------------+
    +
    +   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_globals.h 328290 2012-11-09 03:30:09Z laruence $ */
    +
    +#ifndef APC_GLOBALS_H
    +#define APC_GLOBALS_H
    +
    +#include "apc.h"
    +#include "apc_cache.h"
    +#include "apc_stack.h"
    +#include "apc_php.h"
    +
    +/* {{{ struct apc_rfc1867_data */
    +
    +typedef struct _apc_rfc1867_data apc_rfc1867_data;
    +
    +struct _apc_rfc1867_data {
    +    char tracking_key[64];
    +    int  key_length;
    +    size_t content_length;
    +    char filename[128];
    +    char name[64];
    +    char *temp_filename;
    +    int cancel_upload;
    +    double start_time;
    +    size_t bytes_processed;
    +    size_t prev_bytes_processed;
    +    int update_freq;
    +    double rate;
    +    int started;
    +};
    +/* }}} */
    +
    +
    +ZEND_BEGIN_MODULE_GLOBALS(apcu)
    +    /* configuration parameters */
    +    zend_bool enabled;      /* if true, apc is enabled (defaults to true) */
    +    long shm_segments;      /* number of shared memory segments to use */
    +    long shm_size;          /* size of each shared memory segment (in MB) */
    +    long entries_hint;      /* hint at the number of entries expected */
    +    long gc_ttl;            /* parameter to apc_cache_create */
    +    long ttl;               /* parameter to apc_cache_create */
    +	long smart;             /* smart value */
    +
    +#if APC_MMAP
    +    char *mmap_file_mask;   /* mktemp-style file-mask to pass to mmap */
    +#endif
    +
    +    /* module variables */
    +    zend_bool initialized;       /* true if module was initialized */
    +    zend_bool enable_cli;        /* Flag to override turning APC off for CLI */
    +    zend_bool slam_defense;      /* true for user cache slam defense */ 
    +
    +#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 */
    +    long rfc1867_ttl;             /* TTL for rfc1867 entries */
    +    apc_rfc1867_data rfc1867_data;/* Per-request data */
    +#endif
    +
    +	void *apc_bd_alloc_ptr;      /* bindump alloc() ptr */
    +    void *apc_bd_alloc_ubptr;    /* bindump alloc() upper bound ptr */
    +    HashTable apc_bd_alloc_list; /* bindump alloc() ptr list */
    +	char *preload_path;          /* preload path */
    +    zend_bool coredump_unmap;    /* trap signals that coredump and unmap shared memory */
    +    zend_bool use_request_time;  /* use the SAPI request start time for TTL */
    +
    +    char *serializer_name;       /* the serializer config option */
    +    char *writable;              /* writable path for general use */
    +ZEND_END_MODULE_GLOBALS(apcu)
    +
    +/* (the following declaration is defined in php_apc.c) */
    +ZEND_EXTERN_MODULE_GLOBALS(apcu)
    +
    +#ifdef ZTS
    +# define APCG(v) TSRMG(apcu_globals_id, zend_apcu_globals *, v)
    +#else
    +# define APCG(v) (apcu_globals.v)
    +#endif
    +
    +/* True globals */
    +extern apc_cache_t* apc_user_cache;  /* the global cache */
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,181 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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               |
    +  |          George Schlossnagle                      |
    +  |          Rasmus Lerdorf                              |
    +  |          Arun C. Murthy                         |
    +  |          Gopal Vijayaraghavan                  |
    +  +----------------------------------------------------------------------+
    +
    +   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.h 328292 2012-11-09 07:05:17Z laruence $ */
    +
    +#ifndef APC_H
    +#define APC_H
    +
    +/*
    + * This module defines utilities and helper functions used elsewhere in APC.
    + */
    +#ifdef PHP_WIN32
    +# define PHP_APCU_API __declspec(dllexport)
    +#elif defined(__GNUC__) && __GNUC__ >= 4
    +# define PHP_APCU_API __attribute__ ((visibility("default")))
    +#else
    +# define PHP_APCU_API
    +#endif
    +
    +/* Commonly needed C library headers. */
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +#include 
    +
    +/* UNIX headers (needed for struct stat) */
    +#include 
    +#include 
    +#ifndef PHP_WIN32
    +#include 
    +#endif
    +
    +#ifdef HAVE_CONFIG_H
    +#include 
    +#endif
    +
    +#include "php.h"
    +#include "main/php_streams.h"
    +
    +/* typedefs for extensible memory allocators */
    +typedef void* (*apc_malloc_t)(size_t TSRMLS_DC);
    +typedef void  (*apc_free_t)  (void * TSRMLS_DC);
    +
    +/* wrappers for memory allocation routines */
    +PHP_APCU_API void* apc_emalloc(size_t n TSRMLS_DC);
    +PHP_APCU_API void* apc_erealloc(void* p, size_t n TSRMLS_DC);
    +PHP_APCU_API void* apc_php_malloc(size_t n TSRMLS_DC);
    +PHP_APCU_API void  apc_php_free(void* p TSRMLS_DC);
    +PHP_APCU_API void  apc_efree(void* p TSRMLS_DC);
    +PHP_APCU_API char* apc_estrdup(const char* s TSRMLS_DC);
    +PHP_APCU_API void* apc_xstrdup(const char* s, apc_malloc_t f TSRMLS_DC);
    +PHP_APCU_API void* apc_xmemcpy(const void* p, size_t n, apc_malloc_t f TSRMLS_DC);
    +
    +/* console display functions */
    +PHP_APCU_API void apc_error(const char *format TSRMLS_DC, ...);
    +PHP_APCU_API void apc_warning(const char *format TSRMLS_DC, ...);
    +PHP_APCU_API void apc_notice(const char *format TSRMLS_DC, ...);
    +PHP_APCU_API void apc_debug(const char *format TSRMLS_DC, ...);
    +
    +/* string and text manipulation */
    +PHP_APCU_API char* apc_append(const char* s, const char* t TSRMLS_DC);
    +PHP_APCU_API char* apc_substr(const char* s, int start, int length TSRMLS_DC);
    +PHP_APCU_API char** apc_tokenize(const char* s, char delim TSRMLS_DC);
    +
    +/* apc_crc32: returns the CRC-32 checksum of the first len bytes in buf */
    +PHP_APCU_API unsigned int apc_crc32(const unsigned char* buf, unsigned int len);
    +
    +/* apc_flip_hash flips keys and values for faster searching */
    +PHP_APCU_API HashTable* apc_flip_hash(HashTable *hash);
    +
    +#define APC_NEGATIVE_MATCH 1
    +#define APC_POSITIVE_MATCH 2
    +
    +#define apc_time() \
    +    (APCG(use_request_time) ? (time_t) sapi_get_request_time(TSRMLS_C) : time(0));
    +
    +#if defined(__GNUC__)
    +# define APC_UNUSED __attribute__((unused))
    +# define APC_USED __attribute__((used))
    +# define APC_ALLOC __attribute__((malloc))
    +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__  > 2)
    +#  define APC_HOTSPOT __attribute__((hot))
    +# else 
    +#  define APC_HOTSPOT
    +# endif
    +#else 
    +# define APC_UNUSED
    +# define APC_USED
    +# define APC_ALLOC 
    +# define APC_HOTSPOT 
    +#endif
    +
    +/*
    +* Serializer API
    +*/
    +#define APC_SERIALIZER_ABI "0"
    +#define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI
    +
    +#define APC_SERIALIZER_NAME(module) module##_apc_serializer
    +#define APC_UNSERIALIZER_NAME(module) module##_apc_unserializer
    +
    +#define APC_SERIALIZER_ARGS unsigned char **buf, size_t *buf_len, const zval *value, void *config TSRMLS_DC
    +#define APC_UNSERIALIZER_ARGS zval **value, unsigned char *buf, size_t buf_len, void *config TSRMLS_DC
    +
    +typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS);
    +typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS);
    +
    +/* {{{ struct definition: apc_serializer_t */
    +typedef struct apc_serializer_t {
    +    const char*        name;
    +    apc_serialize_t    serialize;
    +    apc_unserialize_t  unserialize;
    +    void*              config;
    +} apc_serializer_t;
    +/* }}} */
    +
    +/* {{{ _apc_register_serializer
    + registers the serializer using the given name and paramters */
    +PHP_APCU_API int _apc_register_serializer(const char* name,
    +                                               apc_serialize_t serialize,
    +                                               apc_unserialize_t unserialize,
    +                                               void *config TSRMLS_DC); /* }}} */
    +
    +/* {{{ apc_get_serializers 
    + fetches the list of serializers */
    +PHP_APCU_API apc_serializer_t* apc_get_serializers(TSRMLS_D); /* }}} */
    +
    +/* {{{ apc_find_serializer
    + finds a previously registered serializer by name */
    +PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name TSRMLS_DC); /* }}} */
    +
    +/* {{{ default serializers */
    +PHP_APCU_API int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS);
    +PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS); /* }}} */
    +
    +/* {{{ eval serializers */
    +PHP_APCU_API int APC_SERIALIZER_NAME(eval) (APC_SERIALIZER_ARGS);
    +PHP_APCU_API int APC_UNSERIALIZER_NAME(eval) (APC_UNSERIALIZER_ARGS); /* }}} */
    +
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_iterator.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_iterator.c
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_iterator.c	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_iterator.c	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,675 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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                                  |
    +  +----------------------------------------------------------------------+
    +
    + */
    +
    +/* $Id: apc_iterator.c 327134 2012-08-15 14:21:28Z ab $ */
    +
    +#include "php_apc.h"
    +#include "apc_iterator.h"
    +#include "apc_cache.h"
    +
    +#include "ext/standard/md5.h"
    +
    +#include "zend_interfaces.h"
    +
    +zend_class_entry *apc_iterator_ce;
    +zend_object_handlers apc_iterator_object_handlers;
    +
    +/* {{{ apc_iterator_item */
    +static apc_iterator_item_t* apc_iterator_item_ctor(apc_iterator_t *iterator, apc_cache_slot_t **slot_pp TSRMLS_DC) {
    +    zval *zvalue;
    +    apc_cache_slot_t *slot = *slot_pp;
    +    apc_context_t ctxt = {0, };
    +    apc_iterator_item_t *item = ecalloc(1, sizeof(apc_iterator_item_t));
    +
    +    ALLOC_INIT_ZVAL(item->value);
    +    array_init(item->value);
    +
    +	item->key = estrndup(
    +		slot->key.str, slot->key.len);
    +	item->key_len = slot->key.len;
    +	
    +	/* for bc, in any mode */
    +	if (APC_ITER_TYPE & iterator->format) {
    +		add_assoc_string(item->value, "type", "user", 1);
    +    }
    +	
    +    if (APC_ITER_KEY & iterator->format) {
    +        add_assoc_stringl(item->value, "key", item->key, (item->key_len - 1), 1);
    +    }
    +
    +    if (APC_ITER_VALUE & iterator->format) {
    +    	apc_cache_make_context(
    +    		apc_user_cache, &ctxt, APC_CONTEXT_NOSHARE, APC_UNPOOL, APC_COPY_OUT, 0 TSRMLS_CC);
    +    	
    +        MAKE_STD_ZVAL(zvalue);
    +        apc_cache_fetch_zval(&ctxt, zvalue, slot->value->val TSRMLS_CC);
    +        apc_pool_destroy(ctxt.pool TSRMLS_CC);
    +        add_assoc_zval(item->value, "value", zvalue);
    +    }
    +    if (APC_ITER_NUM_HITS & iterator->format) {
    +        add_assoc_long(item->value, "num_hits", slot->nhits);
    +    }
    +    if (APC_ITER_MTIME & iterator->format) {
    +        add_assoc_long(item->value, "modified_time", slot->key.mtime);
    +    }
    +    if (APC_ITER_CTIME & iterator->format) {
    +        add_assoc_long(item->value, "creation_time", slot->ctime);
    +    }
    +    if (APC_ITER_DTIME & iterator->format) {
    +        add_assoc_long(item->value, "deletion_time", slot->dtime);
    +    }
    +    if (APC_ITER_ATIME & iterator->format) {
    +        add_assoc_long(item->value, "access_time", slot->atime);
    +    }
    +    if (APC_ITER_REFCOUNT & iterator->format) {
    +        add_assoc_long(item->value, "ref_count", slot->value->ref_count);
    +    }
    +    if (APC_ITER_MEM_SIZE & iterator->format) {
    +        add_assoc_long(item->value, "mem_size", slot->value->mem_size);
    +    }
    +    if (APC_ITER_TTL & iterator->format) {
    +        add_assoc_long(item->value, "ttl", slot->value->ttl);
    +    }
    +
    +    return item;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_clone */
    +static zend_object_value apc_iterator_clone(zval *zobject TSRMLS_DC) {
    +    zend_object_value value = {0};
    +    apc_error("APCIterator object cannot be cloned." TSRMLS_CC);
    +    return value;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_item_dtor */
    +static void apc_iterator_item_dtor(apc_iterator_item_t *item) {
    +	if (item->key) {
    +		efree(item->key);
    +	}
    +
    +    if (item->value) {
    +        zval_ptr_dtor(&item->value);
    +    }
    +    efree(item);
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_destroy */
    +static void apc_iterator_destroy(void *object, zend_object_handle handle TSRMLS_DC) {
    +    apc_iterator_t *iterator = (apc_iterator_t*)object;
    +
    +    if (iterator->initialized == 0) {
    +        return;
    +    }
    +
    +    while (apc_stack_size(iterator->stack) > 0) {
    +        apc_iterator_item_dtor(apc_stack_pop(iterator->stack));
    +    }
    +    apc_stack_destroy(iterator->stack TSRMLS_CC);
    +
    +#ifdef ITERATOR_PCRE
    +    if (iterator->regex) {
    +        efree(iterator->regex);
    +    }
    +#endif
    +    if (iterator->search_hash) {
    +        zend_hash_destroy(iterator->search_hash);
    +        efree(iterator->search_hash);
    +    }
    +    iterator->initialized = 0;
    +
    +}
    +/* }}} */
    +
    +/* {{{ acp_iterator_free */
    +static void apc_iterator_free(void *object TSRMLS_DC) {
    +    zend_object_std_dtor(object TSRMLS_CC);
    +    efree(object);
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_create */
    +static zend_object_value apc_iterator_create(zend_class_entry *ce TSRMLS_DC) {
    +    zend_object_value retval;
    +    apc_iterator_t *iterator;
    +
    +    iterator = emalloc(sizeof(apc_iterator_t));
    +    iterator->obj.ce = ce;
    +    ALLOC_HASHTABLE(iterator->obj.properties);
    +    zend_hash_init(iterator->obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
    +#ifdef ZEND_ENGINE_2_4
    +    iterator->obj.properties_table = NULL;
    +#endif
    +    iterator->obj.guards = NULL;
    +    iterator->initialized = 0;
    +    iterator->stack = NULL;
    +    iterator->regex_len = 0;
    +    iterator->search_hash = NULL;
    +    retval.handle = zend_objects_store_put(iterator, apc_iterator_destroy, apc_iterator_free, NULL TSRMLS_CC);
    +    retval.handlers = &apc_iterator_object_handlers;
    +
    +    return retval;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_search_match
    + *       Verify if the key matches our search parameters
    + */
    +static int apc_iterator_search_match(apc_iterator_t *iterator, apc_cache_slot_t **slot) {
    +    char *key;
    +    int key_len;
    +    char *fname_key = NULL;
    +    int fname_key_len = 0;
    +    int rval = 1;
    +
    +    key = (char*)(*slot)->key.str;
    +    key_len = (*slot)->key.len;
    +
    +#ifdef ITERATOR_PCRE
    +    if (iterator->regex) {
    +        rval = (pcre_exec(iterator->re, NULL, key, strlen(key), 0, 0, NULL, 0) >= 0);
    +    }
    +#endif
    +            
    +    if (iterator->search_hash) {
    +        rval = zend_hash_exists(iterator->search_hash, key, key_len);
    +        if (!rval && fname_key) {
    +            rval = zend_hash_exists(iterator->search_hash, fname_key, fname_key_len+1);
    +        }
    +    }
    +
    +    if (fname_key) {
    +        efree(fname_key);
    +    }
    +
    +    return rval;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_check_expiry */
    +static int apc_iterator_check_expiry(apc_cache_t* cache, apc_cache_slot_t **slot, time_t t)
    +{
    +    if((*slot)->value->ttl) {
    +        if((time_t) ((*slot)->ctime + (*slot)->value->ttl) < t) {
    +            return 0;
    +        }
    +    } else if(cache->ttl) {
    +        if((*slot)->ctime + cache->ttl < t) {
    +            return 0;
    +        }
    +    }
    +
    +    return 1;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_fetch_active */
    +static int apc_iterator_fetch_active(apc_iterator_t *iterator TSRMLS_DC) {
    +    int count=0;
    +    apc_cache_slot_t **slot;
    +    apc_iterator_item_t *item;
    +    time_t t;
    +
    +    t = apc_time();
    +
    +    while (apc_stack_size(iterator->stack) > 0) {
    +        apc_iterator_item_dtor(apc_stack_pop(iterator->stack));
    +    }
    +
    +    while(count <= iterator->chunk_size && iterator->slot_idx < apc_user_cache->nslots) {
    +        slot = &apc_user_cache->slots[iterator->slot_idx];
    +        while(*slot) {
    +            if (apc_iterator_check_expiry(apc_user_cache, slot, t)) {
    +                if (apc_iterator_search_match(iterator, slot)) {
    +                    count++;
    +                    item = apc_iterator_item_ctor(iterator, slot TSRMLS_CC);
    +                    if (item) {
    +                        apc_stack_push(iterator->stack, item TSRMLS_CC);
    +                    }
    +                }
    +            }
    +            slot = &(*slot)->next;
    +        }
    +        iterator->slot_idx++;
    +    }
    +
    +    iterator->stack_idx = 0;
    +    return count;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_fetch_deleted */
    +static int apc_iterator_fetch_deleted(apc_iterator_t *iterator TSRMLS_DC) {
    +    int count=0;
    +    apc_cache_slot_t **slot;
    +    apc_iterator_item_t *item;
    +
    +	APC_RLOCK(apc_user_cache->header);
    +    slot = &apc_user_cache->header->gc;
    +    while ((*slot) && count <= iterator->slot_idx) {
    +        count++;
    +        slot = &(*slot)->next;
    +    }
    +    count = 0;
    +    while ((*slot) && count < iterator->chunk_size) {
    +        if (apc_iterator_search_match(iterator, slot)) {
    +            count++;
    +            item = apc_iterator_item_ctor(iterator, slot TSRMLS_CC);
    +            if (item) {
    +                apc_stack_push(iterator->stack, item TSRMLS_CC);
    +            }
    +        }
    +        slot = &(*slot)->next;
    +    }
    +
    +    iterator->slot_idx += count;
    +    iterator->stack_idx = 0;
    +	APC_RUNLOCK(apc_user_cache->header);
    +
    +    return count;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_totals */
    +static void apc_iterator_totals(apc_iterator_t *iterator TSRMLS_DC) {
    +    apc_cache_slot_t **slot;
    +    int i;
    +
    +    for (i=0; i < apc_user_cache->nslots; i++) {
    +        slot = &apc_user_cache->slots[i];
    +        while((*slot)) {
    +            if (apc_iterator_search_match(iterator, slot)) {
    +                iterator->size += (*slot)->value->mem_size;
    +                iterator->hits += (*slot)->nhits;
    +                iterator->count++;
    +            }
    +            slot = &(*slot)->next;
    +        }
    +    }
    +
    +    iterator->totals_flag = 1;
    +}
    +/* }}} */
    +
    +/* {{{ proto object APCIterator::__costruct([ mixed search [, long format [, long chunk_size [, long list ]]]]) */
    +PHP_METHOD(apc_iterator, __construct) {
    +    zval *object = getThis();
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(object TSRMLS_CC);
    +    long format = APC_ITER_ALL;
    +    long chunk_size=0;
    +    zval *search = NULL;
    +    long list = APC_LIST_ACTIVE;
    +#if defined(APC_FULL_BC) && APC_FULL_BC
    +    /* these are ignored */
    +    char *cache_type;
    +    int cache_type_len;
    +#endif
    +
    +#if defined(APC_FULL_BC) && APC_FULL_BC
    +    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zlll", &cache_type, &cache_type_len, &search, &format, &chunk_size, &list) == FAILURE) {
    +        return;
    +    }
    +#else
    +    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zlll", &search, &format, &chunk_size, &list) == FAILURE) {
    +        return;
    +    }
    +#endif
    +
    +    if (!APCG(enabled)) {
    +        apc_error("APC must be enabled to use APCIterator." TSRMLS_CC);
    +    }
    +
    +    if (chunk_size < 0) {
    +        apc_error("APCIterator chunk size must be 0 or greater." TSRMLS_CC);
    +        return;
    +    }
    +
    +    if (format > APC_ITER_ALL) {
    +        apc_error("APCIterator format is invalid." TSRMLS_CC);
    +        return;
    +    }
    +
    +    if (list == APC_LIST_ACTIVE) {
    +        iterator->fetch = apc_iterator_fetch_active;
    +    } else if (list == APC_LIST_DELETED) {
    +        iterator->fetch = apc_iterator_fetch_deleted;
    +    } else {
    +        apc_warning("APCIterator invalid list type." TSRMLS_CC);
    +        return;
    +    }
    +#if defined(APC_FULL_BC) && APC_FULL_BC
    +    if (!APC_CACHE_IS_USER(cache_type, cache_type_len)) {
    +        iterator->initialized = 0;
    +        return;
    +    }
    +#endif
    +	
    +    iterator->slot_idx = 0;
    +    iterator->stack_idx = 0;
    +    iterator->key_idx = 0;
    +    iterator->chunk_size = chunk_size == 0 ? APC_DEFAULT_CHUNK_SIZE : chunk_size;
    +    iterator->stack = apc_stack_create(chunk_size TSRMLS_CC);
    +    iterator->format = format;
    +    iterator->totals_flag = 0;
    +    iterator->count = 0;
    +    iterator->size = 0;
    +    iterator->hits = 0;
    +    iterator->regex = NULL;
    +    iterator->regex_len = 0;
    +    iterator->search_hash = NULL;
    +    if (search && Z_TYPE_P(search) == IS_STRING && Z_STRLEN_P(search)) {
    +#ifdef ITERATOR_PCRE
    +        iterator->regex = estrndup(Z_STRVAL_P(search), Z_STRLEN_P(search));
    +        iterator->regex_len = Z_STRLEN_P(search);
    +        iterator->re = pcre_get_compiled_regex(Z_STRVAL_P(search), NULL, NULL TSRMLS_CC);
    +
    +        if(!iterator->re) {
    +            apc_error("Could not compile regular expression: %s" TSRMLS_CC, Z_STRVAL_P(search));
    +        }
    +#else
    +        apc_error("Regular expressions support is not enabled, please enable PCRE for APCIterator regex support" TSRMLS_CC);
    +#endif
    +    } else if (search && Z_TYPE_P(search) == IS_ARRAY) {
    +        Z_ADDREF_P(search);
    +        iterator->search_hash = apc_flip_hash(Z_ARRVAL_P(search));
    +    }
    +    iterator->initialized = 1;
    +}
    +/* }}} */
    +
    +/* {{{ proto APCIterator::rewind() */
    +PHP_METHOD(apc_iterator, rewind) {
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    iterator->slot_idx = 0;
    +    iterator->stack_idx = 0;
    +    iterator->key_idx = 0;
    +    iterator->fetch(iterator TSRMLS_CC);
    +}
    +/* }}} */
    +
    +/* {{{ proto boolean APCIterator::valid() */
    +PHP_METHOD(apc_iterator, valid) {
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    if (apc_stack_size(iterator->stack) == iterator->stack_idx) {
    +        iterator->fetch(iterator TSRMLS_CC);
    +    }
    +
    +    RETURN_BOOL(apc_stack_size(iterator->stack) == 0 ? 0 : 1);
    +}
    +/* }}} */
    +
    +/* {{{ proto mixed APCIterator::current() */
    +PHP_METHOD(apc_iterator, current) {
    +    apc_iterator_item_t *item;
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    if (apc_stack_size(iterator->stack) == iterator->stack_idx) {
    +        if (iterator->fetch(iterator TSRMLS_CC) == 0) {
    +            RETURN_FALSE;
    +        }
    +    }
    +
    +    item = apc_stack_get(iterator->stack, iterator->stack_idx);
    +    RETURN_ZVAL(item->value, 1, 0);
    +}
    +/* }}} */
    +
    +/* {{{ proto string APCIterator::key() */
    +PHP_METHOD(apc_iterator, key) {
    +    apc_iterator_item_t *item;
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0 || apc_stack_size(iterator->stack) == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    if (apc_stack_size(iterator->stack) == iterator->stack_idx) {
    +        if (iterator->fetch(iterator TSRMLS_CC) == 0) {
    +            RETURN_FALSE;
    +        }
    +    }
    +
    +    item = apc_stack_get(iterator->stack, iterator->stack_idx);
    +
    +    if (item->key) {
    +        RETURN_STRINGL(item->key, (item->key_len-1), 1);
    +    } else {
    +        RETURN_LONG(iterator->key_idx);
    +    }
    +}
    +/* }}} */
    +
    +/* {{{ proto APCIterator::next() */
    +PHP_METHOD(apc_iterator, next) {
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0 || apc_stack_size(iterator->stack) == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    iterator->stack_idx++;
    +    iterator->key_idx++;
    +
    +    RETURN_TRUE;
    +}
    +/* }}} */
    +
    +/* {{{ proto long APCIterator::getTotalHits() */
    +PHP_METHOD(apc_iterator, getTotalHits) {
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    if (iterator->totals_flag == 0) {
    +        apc_iterator_totals(iterator TSRMLS_CC);
    +    }
    +
    +    RETURN_LONG(iterator->hits);
    +}
    +/* }}} */
    +
    +/* {{{ proto long APCIterator::getTotalSize() */
    +PHP_METHOD(apc_iterator, getTotalSize) {
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    if (iterator->totals_flag == 0) {
    +        apc_iterator_totals(iterator TSRMLS_CC);
    +    }
    +
    +    RETURN_LONG(iterator->size);
    +}
    +/* }}} */
    +
    +/* {{{ proto long APCIterator::getTotalCount() */
    +PHP_METHOD(apc_iterator, getTotalCount) {
    +    apc_iterator_t *iterator = (apc_iterator_t*)zend_object_store_get_object(getThis() TSRMLS_CC);
    +
    +    if (zend_parse_parameters_none() == FAILURE) {
    +        return;
    +    }
    +
    +    if (iterator->initialized == 0) {
    +        RETURN_FALSE;
    +    }
    +
    +    if (iterator->totals_flag == 0) {
    +        apc_iterator_totals(iterator TSRMLS_CC);
    +    }
    +
    +    RETURN_LONG(iterator->count);
    +}
    +/* }}} */
    +
    +/* {{{ arginfo */
    +#if (PHP_MAJOR_VERSION >= 6 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3))
    +# define PHP_APC_ARGINFO
    +#else
    +# define PHP_APC_ARGINFO static
    +#endif
    +
    +PHP_APC_ARGINFO
    +ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_iterator___construct, 0, 0, 1)
    +#if defined(APC_FULL_BC) && APC_FULL_BC
    +	ZEND_ARG_INFO(0, cache)
    +#endif
    +	ZEND_ARG_INFO(0, search)
    +	ZEND_ARG_INFO(0, format)
    +	ZEND_ARG_INFO(0, chunk_size)
    +	ZEND_ARG_INFO(0, list)
    +ZEND_END_ARG_INFO()
    +
    +PHP_APC_ARGINFO
    +ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_iterator_void, 0, 0, 0)
    +ZEND_END_ARG_INFO()
    +/* }}} */
    +
    +/* {{{ apc_iterator_functions */
    +static zend_function_entry apc_iterator_functions[] = {
    +    PHP_ME(apc_iterator, __construct, arginfo_apc_iterator___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
    +    PHP_ME(apc_iterator, rewind, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    PHP_ME(apc_iterator, current, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    PHP_ME(apc_iterator, key, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    PHP_ME(apc_iterator, next, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    PHP_ME(apc_iterator, valid, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    PHP_ME(apc_iterator, getTotalHits, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    PHP_ME(apc_iterator, getTotalSize, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    PHP_ME(apc_iterator, getTotalCount, arginfo_apc_iterator_void, ZEND_ACC_PUBLIC)
    +    {NULL, NULL, NULL}
    +};
    +/* }}} */
    +
    +/* {{{ apc_iterator_init */
    +int apc_iterator_init(int module_number TSRMLS_DC) {
    +    zend_class_entry ce;
    +
    +    INIT_CLASS_ENTRY(ce, APC_ITERATOR_NAME, apc_iterator_functions);
    +    apc_iterator_ce = zend_register_internal_class(&ce TSRMLS_CC);
    +    apc_iterator_ce->create_object = apc_iterator_create;
    +    zend_class_implements(apc_iterator_ce TSRMLS_CC, 1, zend_ce_iterator);
    +
    +    REGISTER_LONG_CONSTANT("APC_LIST_ACTIVE", APC_LIST_ACTIVE, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_LIST_DELETED", APC_LIST_DELETED, CONST_PERSISTENT | CONST_CS);
    +	REGISTER_LONG_CONSTANT("APC_ITER_TYPE", APC_ITER_TYPE, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_KEY", APC_ITER_KEY, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_VALUE", APC_ITER_VALUE, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_NUM_HITS", APC_ITER_NUM_HITS, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_MTIME", APC_ITER_MTIME, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_CTIME", APC_ITER_CTIME, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_DTIME", APC_ITER_DTIME, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_ATIME", APC_ITER_ATIME, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_REFCOUNT", APC_ITER_REFCOUNT, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_MEM_SIZE", APC_ITER_MEM_SIZE, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_TTL", APC_ITER_TTL, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_NONE", APC_ITER_NONE, CONST_PERSISTENT | CONST_CS);
    +    REGISTER_LONG_CONSTANT("APC_ITER_ALL", APC_ITER_ALL, CONST_PERSISTENT | CONST_CS);
    +
    +    memcpy(&apc_iterator_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
    +    apc_iterator_object_handlers.clone_obj = apc_iterator_clone;
    +
    +    return SUCCESS;
    +}
    +/* }}} */
    +
    +/* {{{ apc_iterator_delete */
    +int apc_iterator_delete(zval *zobj TSRMLS_DC) {
    +    apc_iterator_t *iterator;
    +    zend_class_entry *ce = Z_OBJCE_P(zobj);
    +    apc_iterator_item_t *item;
    +
    +    if (!ce || !instanceof_function(ce, apc_iterator_ce TSRMLS_CC)) {
    +        apc_error("apc_delete object argument must be instance of APCIterator" TSRMLS_CC);
    +        return 0;
    +    }
    +    iterator = (apc_iterator_t*)zend_object_store_get_object(zobj TSRMLS_CC);
    +
    +    if (iterator->initialized == 0) {
    +        return 0;
    +    }
    +
    +    while (iterator->fetch(iterator TSRMLS_CC)) {
    +        while (iterator->stack_idx < apc_stack_size(iterator->stack)) {
    +            item = apc_stack_get(iterator->stack, iterator->stack_idx++);
    +            apc_cache_delete(
    +				apc_user_cache, item->key, item->key_len TSRMLS_CC);
    +        }
    +    }
    +
    +    return 1;
    +}
    +/* }}} */
    +
    +
    +/*
    + * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_iterator.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_iterator.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_iterator.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_iterator.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,111 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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                                 |
    +  +----------------------------------------------------------------------+
    +
    + */
    +
    +/* $Id: apc_iterator.h 307048 2011-01-03 23:53:17Z kalle $ */
    +
    +#ifndef APC_ITERATOR_H
    +#define APC_ITERATOR_H
    +
    +#include "apc.h"
    +#include "apc_stack.h"
    +
    +#if HAVE_PCRE || HAVE_BUNDLED_PCRE
    +/*  Deal with problem present until php-5.2.2 where php_pcre.h was not installed correctly */
    +#   if !HAVE_BUNDLED_PCRE && PHP_MAJOR_VERSION == 5 && (PHP_MINOR_VERSION < 2 || (PHP_MINOR_VERSION == 2 && PHP_RELEASE_VERSION < 2))
    +#       include "apc_php_pcre.h"
    +#   else
    +#       include "ext/pcre/php_pcre.h"
    +#   endif
    +#   include "ext/standard/php_smart_str.h"
    +#   define ITERATOR_PCRE 1
    +#endif
    +
    +
    +#define APC_ITERATOR_NAME "APCIterator"
    +
    +#define APC_DEFAULT_CHUNK_SIZE 100
    +
    +#define APC_LIST_ACTIVE   0x1
    +#define APC_LIST_DELETED  0x2
    +
    +#define APC_ITER_TYPE		(1L << 0)
    +#define APC_ITER_KEY        (1L << 1)
    +#define APC_ITER_VALUE      (1L << 2)
    +#define APC_ITER_NUM_HITS   (1L << 3) 
    +#define APC_ITER_MTIME      (1L << 4) 
    +#define APC_ITER_CTIME      (1L << 5) 
    +#define APC_ITER_DTIME      (1L << 6) 
    +#define APC_ITER_ATIME      (1L << 7) 
    +#define APC_ITER_REFCOUNT   (1L << 8) 
    +#define APC_ITER_MEM_SIZE   (1L << 9) 
    +#define APC_ITER_TTL        (1L << 10)
    +
    +#define APC_ITER_NONE       (0x00000000L)
    +#define APC_ITER_ALL        (0xffffffffL)
    +
    +typedef void* (*apc_iterator_item_cb_t)(apc_cache_slot_t **slot);
    +
    +
    +/* {{{ apc_iterator_t */
    +typedef struct _apc_iterator_t {
    +    zend_object obj;         /* must always be first */
    +    short int initialized;   /* sanity check in case __construct failed */
    +    long format;             /* format bitmask of the return values ie: key, value, info */
    +    int (*fetch)(struct _apc_iterator_t *iterator TSRMLS_DC);
    +                             /* fetch callback to fetch items from cache slots or lists */
    +    long slot_idx;           /* index to the slot array or linked list */
    +    long chunk_size;         /* number of entries to pull down per fetch */
    +    apc_stack_t *stack;      /* stack of entries pulled from cache */
    +    int stack_idx;           /* index into the current stack */
    +#ifdef ITERATOR_PCRE
    +    pcre *re;                /* regex filter on entry identifiers */
    +#endif
    +    char *regex;             /* original regex expression or NULL */
    +    int regex_len;           /* regex length */
    +    HashTable *search_hash;  /* hash of keys to iterate over */
    +    long key_idx;            /* incrementing index for numerical keys */
    +    short int totals_flag;   /* flag if totals have been calculated */
    +    long hits;               /* hit total */
    +    size_t size;             /* size total */
    +    long count;              /* count total */
    +} apc_iterator_t;
    +/* }}} */
    +
    +/* {{{ apc_iterator_item */
    +typedef struct _apc_iterator_item_t {
    +    char *key;              /* string key */
    +    long key_len;           /* strlen of key */
    +    zval *value;
    +} apc_iterator_item_t;
    +/* }}} */
    +
    +
    +extern int apc_iterator_init(int module_number TSRMLS_DC);
    +extern int apc_iterator_delete(zval *zobj TSRMLS_DC);
    +
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_lock_api.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_lock_api.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_lock_api.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_lock_api.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,105 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APCu                                                                 |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2013 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.               |
    +  +----------------------------------------------------------------------+
    +  | Author: Joe Watkins                          |
    +  +----------------------------------------------------------------------+
    + */
    +
    +#ifndef APC_LOCK_API_H
    +#define APC_LOCK_API_H
    +
    +/*
    + APCu works most efficiently where there is access to native read/write locks
    + If the current system has native rwlocks present they will be used, if they are
    +	not present, APCu will emulate their behavior with standard mutex.
    + While APCu is emulating read/write locks, reads and writes are exclusive,
    +	additionally the write lock prefers readers, as is the default behaviour of
    +	the majority of Posix rwlock implementations
    +*/
    +
    +#ifndef PHP_WIN32
    +# ifndef __USE_UNIX98
    +#  define __USE_UNIX98
    +# endif
    +# include "pthread.h"
    +# ifndef APC_SPIN_LOCK
    +#   ifndef APC_FCNTL_LOCK
    +#       ifdef APC_NATIVE_RWLOCK
    +        typedef pthread_rwlock_t apc_lock_t;
    +#       else
    +        typedef struct _apc_lock_t {
    +	        pthread_mutex_t read;
    +	        pthread_mutex_t write;
    +        } apc_lock_t;
    +#       endif
    +#   else
    +        typedef int apc_lock_t;
    +#   endif
    +# else
    +# define APC_LOCK_NICE 1
    +typedef struct {
    +    unsigned long state;
    +} apc_lock_t;
    +
    +PHP_APCU_API int apc_lock_init(apc_lock_t* lock);
    +PHP_APCU_API int apc_lock_try(apc_lock_t* lock);
    +PHP_APCU_API int apc_lock_get(apc_lock_t* lock);
    +PHP_APCU_API int apc_lock_release(apc_lock_t* lock);
    +# endif
    +#else
    +/* XXX kernel lock mode only for now, compatible through all the wins, add more ifdefs for others */
    +# include "apc_windows_srwlock_kernel.h"
    +typedef apc_windows_cs_rwlock_t apc_lock_t;
    +#endif
    +
    +/* {{{ functions */
    +/*
    +  The following functions should be called once per process:
    +	apc_lock_init initializes attributes suitable for all locks
    +	apc_lock_cleanup destroys those attributes
    +  This saves us from having to create and destroy attributes for
    +  every lock we use at runtime */
    +PHP_APCU_API zend_bool apc_lock_init(TSRMLS_D);
    +PHP_APCU_API void      apc_lock_cleanup(TSRMLS_D);
    +/*
    +  The following functions should be self explanitory:
    +*/
    +PHP_APCU_API zend_bool apc_lock_create(apc_lock_t *lock TSRMLS_DC);
    +PHP_APCU_API zend_bool apc_lock_rlock(apc_lock_t *lock TSRMLS_DC);
    +PHP_APCU_API zend_bool apc_lock_wlock(apc_lock_t *lock TSRMLS_DC);
    +PHP_APCU_API zend_bool apc_lock_runlock(apc_lock_t *lock TSRMLS_DC);
    +PHP_APCU_API zend_bool apc_lock_wunlock(apc_lock_t *lock TSRMLS_DC);
    +PHP_APCU_API void apc_lock_destroy(apc_lock_t *lock TSRMLS_DC); /* }}} */
    +
    +/* {{{ generic locking macros */
    +#define CREATE_LOCK(lock)     apc_lock_create(lock TSRMLS_CC)
    +#define DESTROY_LOCK(lock)    apc_lock_destroy(lock TSRMLS_CC)
    +#define WLOCK(lock)           { HANDLE_BLOCK_INTERRUPTIONS(); apc_lock_wlock(lock TSRMLS_CC); }
    +#define WUNLOCK(lock)         { apc_lock_wunlock(lock TSRMLS_CC); HANDLE_UNBLOCK_INTERRUPTIONS(); }
    +#define RLOCK(lock)           { HANDLE_BLOCK_INTERRUPTIONS(); apc_lock_rlock(lock TSRMLS_CC); }
    +#define RUNLOCK(lock)         { apc_lock_runlock(lock TSRMLS_CC); HANDLE_UNBLOCK_INTERRUPTIONS(); }
    +#define LOCK                  WLOCK
    +#define UNLOCK                WUNLOCK
    +/* }}} */
    +
    +/* {{{ object locking macros */
    +#define APC_WLOCK(o)          WLOCK(&(o)->lock)
    +#define APC_LOCK              APC_WLOCK
    +#define APC_WUNLOCK(o)        WUNLOCK(&(o)->lock)
    +#define APC_UNLOCK            APC_WUNLOCK
    +#define APC_RLOCK(o)          RLOCK(&(o)->lock)
    +#define APC_RUNLOCK(o)        RUNLOCK(&(o)->lock) /* }}} */
    +
    +#endif
    +
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_lock.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_lock.c
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_lock.c	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_lock.c	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,353 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APCu                                                                 |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2013 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.               |
    +  +----------------------------------------------------------------------+
    +  | Author: Joe Watkins                         |
    +  +----------------------------------------------------------------------+
    + */
    +#ifndef HAVE_APC_LOCK
    +#define HAVE_APC_LOCK
    +
    +#ifndef HAVE_APC_LOCK_H
    +# include "apc_lock.h"
    +#endif
    +
    +/*
    + APCu never checks the return value of a locking call, it assumes it should not fail
    + and execution continues regardless, therefore it is pointless to check the return
    + values of calls to locking functions, lets save ourselves the comparison.
    +*/
    +
    +/* {{{ There's very little point in initializing a billion sets of attributes */
    +#ifndef PHP_WIN32
    +# ifndef APC_SPIN_LOCK
    +#   ifndef APC_FCNTL_LOCK
    +#       ifndef APC_NATIVE_RWLOCK
    +	        static pthread_mutexattr_t apc_lock_attr;
    +#       else
    +	        static pthread_rwlockattr_t apc_lock_attr;
    +#       endif
    +#   else
    +#       include 
    +#       include 
    +    
    +        static int apc_fcntl_call(int fd, int cmd, int type, off_t offset, int whence, off_t len) {
    +            int ret;
    +            struct flock lock;
    +
    +            lock.l_type = type;
    +            lock.l_start = offset;
    +            lock.l_whence = whence;
    +            lock.l_len = len;
    +            lock.l_pid = 0;
    +
    +            do { 
    +                ret = fcntl(fd, cmd, &lock) ; 
    +            } while(ret < 0 && errno == EINTR);
    +            
    +            return(ret);
    +        }
    +#   endif
    +# else
    +PHP_APCU_API int apc_lock_init(apc_lock_t* lock)
    +{
    +    lock->state = 0;
    +}
    +
    +PHP_APCU_API int apc_lock_try(apc_lock_t* lock)
    +{
    +    int failed = 1;
    +    
    +    asm volatile
    +    (
    +        "xchgl %0, 0(%1)" :
    +        "=r" (failed) : "r" (&lock->state), 
    +        "0" (failed)    
    +    );
    +    
    +    return failed;   
    +}
    +
    +PHP_APCU_API int apc_lock_get(apc_lock_t* lock)
    +{
    +    int failed = 1;
    +    
    +    do {
    +        failed = apc_lock_try(
    +            lock);
    +#ifdef APC_LOCK_NICE
    +        usleep(0);
    +#endif
    +    } while (failed);
    +    
    +    return failed;
    +}
    +
    +PHP_APCU_API int apc_lock_release(apc_lock_t* lock)
    +{
    +    int released = 0;
    +    
    +    asm volatile (
    +        "xchg %0, 0(%1)" : "=r" (released) : "r" (&lock->state),
    +        "0" (released)
    +    );
    +    
    +    return !released;
    +}
    +# endif
    +static zend_bool apc_lock_ready = 0;
    +#endif /* }}} */
    +
    +/* {{{ Initialize the global lock attributes */
    +PHP_APCU_API zend_bool apc_lock_init(TSRMLS_D) {
    +#ifndef PHP_WIN32
    +	if (apc_lock_ready)
    +		return 1;
    +
    +	/* once per process please */
    +	apc_lock_ready = 1;
    +
    +#ifndef APC_SPIN_LOCK
    +# ifndef APC_FCNTL_LOCK
    +#   ifndef APC_NATIVE_RWLOCK
    +	    if (pthread_mutexattr_init(&apc_lock_attr) == SUCCESS) {
    +		    if (pthread_mutexattr_setpshared(&apc_lock_attr, PTHREAD_PROCESS_SHARED) == SUCCESS) {
    +			    pthread_mutexattr_settype(&apc_lock_attr, PTHREAD_MUTEX_RECURSIVE);
    +			    return 1;
    +		    }
    +	    }
    +#   else
    +	    if (pthread_rwlockattr_init(&apc_lock_attr) == SUCCESS) {
    +		    if (pthread_rwlockattr_setpshared(&apc_lock_attr, PTHREAD_PROCESS_SHARED) == SUCCESS) {
    +			    return 1;
    +		    }
    +	    }
    +#   endif
    +# endif
    +#endif
    +	return 0;
    +#else
    +	return 1;
    +#endif
    +} /* }}} */
    +
    +/* {{{ Cleanup attributes and statics */
    +PHP_APCU_API void apc_lock_cleanup(TSRMLS_D) {
    +#ifndef PHP_WIN32
    +	if (!apc_lock_ready)
    +		return;
    +
    +	/* once per process please */
    +	apc_lock_ready = 0;
    +
    +#ifndef APC_SPIN_LOCK
    +# ifndef APC_FCNTL_LOCK
    +#   ifndef APC_NATIVE_RWLOCK
    +	    pthread_mutexattr_destroy(&apc_lock_attr);
    +#   else
    +	    pthread_rwlockattr_destroy(&apc_lock_attr);
    +#   endif
    +# endif
    +#endif
    +#endif
    +} /* }}} */
    +
    +PHP_APCU_API zend_bool apc_lock_create(apc_lock_t *lock TSRMLS_DC) {
    +#ifndef PHP_WIN32
    +# ifndef APC_SPIN_LOCK
    +#   ifndef APC_FCNTL_LOCK
    +#       ifndef APC_NATIVE_RWLOCK
    +	        {
    +		        /* Emulated */
    +		        pthread_mutex_init(&lock->read, &apc_lock_attr);
    +		        pthread_mutex_init(&lock->write, &apc_lock_attr);
    +
    +		        return 1;
    +	        }
    +#       else
    +	        {
    +		        /* Native */
    +		        return (pthread_rwlock_init(lock, &apc_lock_attr)==SUCCESS);
    +	        }
    +#       endif
    +# else
    +    {
    +        /* FCNTL */
    +        char lock_path[] = "/tmp/.apc.XXXXXX";
    +        mktemp(
    +            lock_path);
    +        (*lock) = open(lock_path, O_RDWR|O_CREAT, 0666);
    +        if((*lock) > 0 ) {
    +            unlink(
    +                lock_path);
    +            return 1;
    +        } else {
    +            return 0;
    +        }
    +    }
    +# endif
    +#else
    +    {
    +        /* SPIN */
    +        lock->state = 0;
    +        return 1;
    +    }
    +    
    +#endif
    +#else
    +	lock = (apc_lock_t *)apc_windows_cs_create((apc_windows_cs_rwlock_t *)lock TSRMLS_CC);
    +
    +	return (NULL != lock);
    +#endif
    +}
    +
    +PHP_APCU_API zend_bool apc_lock_rlock(apc_lock_t *lock TSRMLS_DC) {
    +#ifndef PHP_WIN32
    +    HANDLE_BLOCK_INTERRUPTIONS();
    +#ifndef APC_SPIN_LOCK
    +# ifndef APC_FCNTL_LOCK
    +#   ifndef APC_NATIVE_RWLOCK
    +	    pthread_mutex_lock(&lock->read);
    +#   else
    +	    pthread_rwlock_rdlock(lock);
    +#   endif    
    +# else
    +    {
    +        /* FCNTL */
    +        apc_fcntl_call((*lock), F_SETLKW, F_RDLCK, 0, SEEK_SET, 0);
    +    }
    +# endif
    +#else
    +    {
    +        /* SPIN */
    +        apc_lock_get(lock);
    +    }
    +#endif
    +    HANDLE_UNBLOCK_INTERRUPTIONS();
    +#else
    +	apc_windows_cs_rdlock((apc_windows_cs_rwlock_t *)lock TSRMLS_CC);
    +#endif
    +	return 1;
    +}
    +
    +PHP_APCU_API zend_bool apc_lock_wlock(apc_lock_t *lock TSRMLS_DC) {
    +#ifndef PHP_WIN32
    +    HANDLE_BLOCK_INTERRUPTIONS();
    +#ifndef APC_SPIN_LOCK
    +# ifndef APC_FCNTL_LOCK
    +#   ifndef APC_NATIVE_RWLOCK
    +	    pthread_mutex_lock(&lock->read);
    +	    pthread_mutex_lock(&lock->write);
    +#   else	
    +	    pthread_rwlock_wrlock(lock);
    +#   endif
    +# else
    +    {
    +        /* FCNTL */
    +        apc_fcntl_call((*lock), F_SETLKW, F_WRLCK, 0, SEEK_SET, 0);
    +    }
    +# endif
    +#else
    +    {
    +        /* SPIN */
    +        apc_lock_get(lock);
    +    }
    +#endif
    +    HANDLE_UNBLOCK_INTERRUPTIONS();
    +#else
    +	apc_windows_cs_lock((apc_windows_cs_rwlock_t *)lock TSRMLS_CC);
    +#endif
    +	return 1;
    +}
    +
    +PHP_APCU_API zend_bool apc_lock_wunlock(apc_lock_t *lock TSRMLS_DC) {
    +#ifndef PHP_WIN32
    +    HANDLE_BLOCK_INTERRUPTIONS();
    +#ifndef APC_SPIN_LOCK
    +# ifndef APC_FCNTL_LOCK
    +#   ifndef APC_NATIVE_RWLOCK
    +	    pthread_mutex_unlock(&lock->read);
    +	    pthread_mutex_unlock(&lock->write);
    +#   else
    +	    pthread_rwlock_unlock(lock);
    +#   endif
    +# else
    +    {
    +        /* FCNTL */
    +        apc_fcntl_call((*lock), F_SETLKW, F_UNLCK, 0, SEEK_SET, 0);
    +    }
    +# endif
    +#else
    +    {
    +        /* SPIN */
    +        apc_lock_release(lock);
    +    }
    +#endif
    +    HANDLE_UNBLOCK_INTERRUPTIONS();
    +#else
    +	apc_windows_cs_unlock_wr((apc_windows_cs_rwlock_t *)lock TSRMLS_CC);
    +#endif
    +	return 1;
    +}
    +
    +PHP_APCU_API zend_bool apc_lock_runlock(apc_lock_t *lock TSRMLS_DC) {
    +#ifndef PHP_WIN32
    +    HANDLE_BLOCK_INTERRUPTIONS();
    +#ifndef APC_SPIN_LOCK
    +# ifndef APC_FCNTL_LOCK
    +#   ifndef APC_NATIVE_RWLOCK
    +	    pthread_mutex_unlock(&lock->read);
    +#   else
    +	    pthread_rwlock_unlock(lock);
    +#   endif
    +# else
    +    {
    +        /* FCNTL */
    +        apc_fcntl_call((*lock), F_SETLKW, F_UNLCK, 0, SEEK_SET, 0);
    +    }
    +# endif
    +#else
    +    {
    +        /* SPIN */
    +        apc_lock_release(lock);
    +    }
    +#endif
    +    HANDLE_UNBLOCK_INTERRUPTIONS();
    +#else
    +	apc_windows_cs_unlock_rd((apc_windows_cs_rwlock_t *)lock TSRMLS_CC);
    +#endif
    +	return 1;
    +}
    +
    +PHP_APCU_API void apc_lock_destroy(apc_lock_t *lock TSRMLS_DC) {
    +#ifndef PHP_WIN32
    +#ifndef APC_SPIN_LOCK
    +# ifndef APC_FCNTL_LOCK
    +#   ifndef APC_NATIVE_RWLOCK
    +	    /* nothing */
    +#   else
    +        /* nothing */
    +#   endif
    +# else
    +    {
    +        /* FCNTL */
    +        close ((*lock));
    +    }
    +# endif
    +#endif
    +#else
    +	apc_windows_cs_destroy((apc_windows_cs_rwlock_t *)lock);
    +#endif
    +} 
    +#endif
    +
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_lock.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_lock.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_lock.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_lock.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,32 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APCu                                                                 |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2013 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.               |
    +  +----------------------------------------------------------------------+
    +  | Author: Joe Watkins                         |
    +  +----------------------------------------------------------------------+
    + */
    +
    +#ifndef APC_LOCK_H
    +#define APC_LOCK_H
    +
    +#ifdef HAVE_CONFIG_H
    +# include 
    +#endif
    +
    +#include "apc.h"
    +
    +#ifndef APC_LOCK_API_H
    +# include "apc_lock_api.h"
    +#endif
    +
    +#endif
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_mmap.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_mmap.c
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_mmap.c	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_mmap.c	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,183 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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: 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.
    +
    + */
    +
    +/* $Id: apc_mmap.c 328964 2013-01-03 12:38:55Z remi $ */
    +
    +#include "apc.h"
    +#include "apc_mmap.h"
    +#include "apc_lock.h"
    +
    +#if APC_MMAP
    +
    +#include 
    +#include 
    +#include 
    +
    +/*
    + * Some operating systems (like FreeBSD) have a MAP_NOSYNC flag that
    + * tells whatever update daemons might be running to not flush dirty
    + * vm pages to disk unless absolutely necessary.  My guess is that
    + * most systems that don't have this probably default to only synching
    + * to disk when absolutely necessary.
    + */
    +#ifndef MAP_NOSYNC
    +#define MAP_NOSYNC 0
    +#endif
    +
    +/* support for systems where MAP_ANONYMOUS is defined but not MAP_ANON, ie: HP-UX bug #14615 */
    +#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
    +# define MAP_ANON MAP_ANONYMOUS
    +#endif
    +
    +apc_segment_t apc_mmap(char *file_mask, size_t size TSRMLS_DC)
    +{
    +    apc_segment_t segment; 
    +
    +    int fd = -1;
    +    int flags = MAP_SHARED | MAP_NOSYNC;
    +#ifdef APC_MEMPROTECT
    +    int remap = 1;
    +#endif
    +
    +    /* If no filename was provided, do an anonymous mmap */
    +    if(!file_mask || (file_mask && !strlen(file_mask))) {
    +#if !defined(MAP_ANON)
    +        apc_error("Anonymous mmap does not apear to be available on this system (MAP_ANON/MAP_ANONYMOUS).  Please see the apc.mmap_file_mask INI option." TSRMLS_CC);
    +#else
    +        fd = -1;
    +        flags = MAP_SHARED | MAP_ANON;
    +#ifdef APC_MEMPROTECT
    +        remap = 0;
    +#endif
    +#endif
    +    } else if(!strcmp(file_mask,"/dev/zero")) { 
    +        fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
    +        if(fd == -1) {
    +            apc_error("apc_mmap: open on /dev/zero failed:" TSRMLS_CC);
    +            goto error;
    +        }
    +#ifdef APC_MEMPROTECT
    +        remap = 0; /* cannot remap */
    +#endif
    +    } else if(strstr(file_mask,".shm")) {
    +        /*
    +         * If the filemask contains .shm we try to do a POSIX-compliant shared memory
    +         * backed mmap which should avoid synchs on some platforms.  At least on
    +         * FreeBSD this implies MAP_NOSYNC and on Linux it is equivalent of mmap'ing
    +         * a file in a mounted shmfs.  For this to work on Linux you need to make sure
    +         * you actually have shmfs mounted.  Also on Linux, make sure the file_mask you
    +         * pass in has a leading / and no other /'s.  eg.  /apc.shm.XXXXXX
    +         * On FreeBSD these are mapped onto the regular filesystem so you can put whatever
    +         * path you want here.
    +         */
    +        if(!mktemp(file_mask)) {
    +            apc_error("apc_mmap: mktemp on %s failed:" TSRMLS_CC, file_mask);
    +            goto error;
    +        }
    +        fd = shm_open(file_mask, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR);
    +        if(fd == -1) {
    +            apc_error("apc_mmap: shm_open on %s failed:" TSRMLS_CC, file_mask);
    +            goto error;
    +        }
    +        if (ftruncate(fd, size) < 0) {
    +            close(fd);
    +            shm_unlink(file_mask);
    +            apc_error("apc_mmap: ftruncate failed:" TSRMLS_CC);
    +            goto error;
    +        }
    +        shm_unlink(file_mask);
    +    } else {
    +        /*
    +         * Otherwise we do a normal filesystem mmap
    +         */
    +        fd = mkstemp(file_mask);
    +        if(fd == -1) {
    +            apc_error("apc_mmap: mkstemp on %s failed:" TSRMLS_CC, file_mask);
    +            goto error;
    +        }
    +        if (ftruncate(fd, size) < 0) {
    +            close(fd);
    +            unlink(file_mask);
    +            apc_error("apc_mmap: ftruncate failed:" TSRMLS_CC);
    +            goto error;
    +        }
    +        unlink(file_mask);
    +    }
    +
    +    segment.shmaddr = (void *)mmap(NULL, size, PROT_READ | PROT_WRITE, flags, fd, 0);
    +    segment.size = size;
    +
    +#ifdef APC_MEMPROTECT
    +    if(remap) {
    +        segment.roaddr = (void *)mmap(NULL, size, PROT_READ, flags, fd, 0);
    +    } else {
    +        segment.roaddr = NULL;
    +    }
    +#endif
    +
    +    if((long)segment.shmaddr == -1) {
    +        apc_error("apc_mmap: mmap failed:" TSRMLS_CC);
    +    }
    +
    +    if(fd != -1) close(fd);
    +    
    +    return segment;
    +
    +error:
    +
    +    segment.shmaddr = (void*)-1;
    +    segment.size = 0;
    +#ifdef APC_MEMPROTECT
    +    segment.roaddr = NULL;
    +#endif
    +    return segment;
    +}
    +
    +void apc_unmap(apc_segment_t *segment TSRMLS_DC)
    +{
    +    if (munmap(segment->shmaddr, segment->size) < 0) {
    +        apc_warning("apc_unmap: munmap failed:" TSRMLS_CC);
    +    }
    +
    +#ifdef APC_MEMPROTECT
    +    if (segment->roaddr && munmap(segment->roaddr, segment->size) < 0) {
    +        apc_warning("apc_unmap: munmap failed:" TSRMLS_CC);
    +    }
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_mmap.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_mmap.h
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_mmap.h	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_mmap.h	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,54 @@
    +/*
    +  +----------------------------------------------------------------------+
    +  | APC                                                                  |
    +  +----------------------------------------------------------------------+
    +  | Copyright (c) 2006-2011 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: Gopal V                                     |
    +  +----------------------------------------------------------------------+
    +
    +   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_mmap.h 307048 2011-01-03 23:53:17Z kalle $ */
    +
    +#ifndef APC_MMAP_H
    +#define APC_MMAP_H
    +
    +#include 
    +
    +#include "apc.h"
    +#include "apc_sma.h"
    +
    +/* Wrapper functions for shared memory mapped files */
    +
    +#if APC_MMAP
    +apc_segment_t apc_mmap(char *file_mask, size_t size TSRMLS_DC);
    +void apc_unmap(apc_segment_t* segment TSRMLS_DC);
    +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc.php php5-easybib-apcu-4.0.7/apcu-4.0.7/apc.php
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc.php	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc.php	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,1146 @@
    +                               |
    +  |          Rasmus Lerdorf                              |
    +  |          Ilia Alshanetsky                          |
    +  +----------------------------------------------------------------------+
    +
    +   All other licensing and usage conditions are those of the PHP Group.
    +
    + */
    +
    +$VERSION='$Id$';
    +
    +////////// READ OPTIONAL CONFIGURATION FILE ////////////
    +if (file_exists("apc.conf.php")) include("apc.conf.php");
    +////////////////////////////////////////////////////////
    +
    +////////// BEGIN OF DEFAULT CONFIG AREA ///////////////////////////////////////////////////////////
    +
    +defaults('USE_AUTHENTICATION',1);			// Use (internal) authentication - best choice if
    +											// no other authentication is available
    +											// If set to 0:
    +											//  There will be no further authentication. You
    +											//  will have to handle this by yourself!
    +											// If set to 1:
    +											//  You need to change ADMIN_PASSWORD to make
    +											//  this work!
    +defaults('ADMIN_USERNAME','apc'); 			// Admin Username
    +defaults('ADMIN_PASSWORD','password');  	// Admin Password - CHANGE THIS TO ENABLE!!!
    +
    +// (beckerr) I'm using a clear text password here, because I've no good idea how to let
    +//           users generate a md5 or crypt password in a easy way to fill it in above
    +
    +//defaults('DATE_FORMAT', "d.m.Y H:i:s");	// German
    +defaults('DATE_FORMAT', 'Y/m/d H:i:s'); 	// US
    +
    +defaults('GRAPH_SIZE',200);					// Image size
    +
    +//defaults('PROXY', 'tcp://127.0.0.1:8080');
    +
    +////////// END OF DEFAULT CONFIG AREA /////////////////////////////////////////////////////////////
    +
    +
    +// "define if not defined"
    +function defaults($d,$v) {
    +	if (!defined($d)) define($d,$v); // or just @define(...)
    +}
    +
    +// rewrite $PHP_SELF to block XSS attacks
    +//
    +$PHP_SELF= isset($_SERVER['PHP_SELF']) ? htmlentities(strip_tags($_SERVER['PHP_SELF'],''), ENT_QUOTES, 'UTF-8') : '';
    +$time = time();
    +$host = php_uname('n');
    +if($host) { $host = '('.$host.')'; }
    +if (isset($_SERVER['SERVER_ADDR'])) {
    +  $host .= ' ('.$_SERVER['SERVER_ADDR'].')';
    +}
    +
    +// operation constants
    +define('OB_HOST_STATS',1);
    +define('OB_USER_CACHE',2);
    +define('OB_VERSION_CHECK',3);
    +
    +// check validity of input variables
    +$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
    +	'LO'	=> '/^1$/',				// login requested
    +
    +	'COUNT'	=> '/^\d+$/',			// number of line displayed in list
    +	'SCOPE'	=> '/^[AD]$/',			// list view scope
    +	'SORT1'	=> '/^[AHSMCDTZ]$/',	// first sort key
    +	'SORT2'	=> '/^[DA]$/',			// second sort key
    +	'AGGR'	=> '/^\d+$/',			// aggregation by dir level
    +	'SEARCH'	=> '~^[a-zA-Z0-9/_.-]*$~'			// aggregation by dir level
    +);
    +
    +// cache scope
    +$scope_list=array(
    +	'A' => 'cache_list',
    +	'D' => 'deleted_list'
    +);
    +
    +// handle POST and GET requests
    +if (empty($_REQUEST)) {
    +	if (!empty($_GET) && !empty($_POST)) {
    +		$_REQUEST = array_merge($_GET, $_POST);
    +	} else if (!empty($_GET)) {
    +		$_REQUEST = $_GET;
    +	} else if (!empty($_POST)) {
    +		$_REQUEST = $_POST;
    +	} else {
    +		$_REQUEST = array();
    +	}
    +}
    +
    +// check parameter syntax
    +foreach($vardom as $var => $dom) {
    +	if (!isset($_REQUEST[$var])) {
    +		$MYREQUEST[$var]=NULL;
    +	} else if (!is_array($_REQUEST[$var]) && preg_match($dom.'D',$_REQUEST[$var])) {
    +		$MYREQUEST[$var]=$_REQUEST[$var];
    +	} else {
    +		$MYREQUEST[$var]=$_REQUEST[$var]=NULL;
    +	}
    +}
    +
    +// check parameter sematics
    +if (empty($MYREQUEST['SCOPE'])) $MYREQUEST['SCOPE']="A";
    +if (empty($MYREQUEST['SORT1'])) $MYREQUEST['SORT1']="H";
    +if (empty($MYREQUEST['SORT2'])) $MYREQUEST['SORT2']="D";
    +if (empty($MYREQUEST['OB']))	$MYREQUEST['OB']=OB_HOST_STATS;
    +if (!isset($MYREQUEST['COUNT'])) $MYREQUEST['COUNT']=20;
    +if (!isset($scope_list[$MYREQUEST['SCOPE']])) $MYREQUEST['SCOPE']='A';
    +
    +$MY_SELF=
    +	"$PHP_SELF".
    +	"?SCOPE=".$MYREQUEST['SCOPE'].
    +	"&SORT1=".$MYREQUEST['SORT1'].
    +	"&SORT2=".$MYREQUEST['SORT2'].
    +	"&COUNT=".$MYREQUEST['COUNT'];
    +$MY_SELF_WO_SORT=
    +	"$PHP_SELF".
    +	"?SCOPE=".$MYREQUEST['SCOPE'].
    +	"&COUNT=".$MYREQUEST['COUNT'];
    +
    +// authentication needed?
    +//
    +if (!USE_AUTHENTICATION) {
    +	$AUTHENTICATED=1;
    +} else {
    +	$AUTHENTICATED=0;
    +	if (ADMIN_PASSWORD!='password' && ($MYREQUEST['LO'] == 1 || isset($_SERVER['PHP_AUTH_USER']))) {
    +
    +		if (!isset($_SERVER['PHP_AUTH_USER']) ||
    +			!isset($_SERVER['PHP_AUTH_PW']) ||
    +			$_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME ||
    +			$_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) {
    +			Header("WWW-Authenticate: Basic realm=\"APC Login\"");
    +			Header("HTTP/1.0 401 Unauthorized");
    +
    +			echo <<
    +				

    Rejected!

    + Wrong Username or Password!
     
      + Continue... + +EOB; + exit; + + } else { + $AUTHENTICATED=1; + } + } +} + +// clear cache +if ($AUTHENTICATED && isset($MYREQUEST['CC']) && $MYREQUEST['CC']) { + apcu_clear_cache(); +} + +if ($AUTHENTICATED && !empty($MYREQUEST['DU'])) { + apcu_delete($MYREQUEST['DU']); +} + +if(!function_exists('apcu_cache_info')) { + echo "No cache info available. APC does not appear to be running."; + exit; +} + +$cache = apcu_cache_info(); + +$mem=apcu_sma_info(); + +// don't cache this page +// +header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); // HTTP/1.0 + +function duration($ts) { + global $time; + $years = (int)((($time - $ts)/(7*86400))/52.177457); + $rem = (int)(($time-$ts)-($years * 52.177457 * 7 * 86400)); + $weeks = (int)(($rem)/(7*86400)); + $days = (int)(($rem)/86400) - $weeks*7; + $hours = (int)(($rem)/3600) - $days*24 - $weeks*7*24; + $mins = (int)(($rem)/60) - $hours*60 - $days*24*60 - $weeks*7*24*60; + $str = ''; + if($years==1) $str .= "$years year, "; + if($years>1) $str .= "$years years, "; + if($weeks==1) $str .= "$weeks week, "; + if($weeks>1) $str .= "$weeks weeks, "; + if($days==1) $str .= "$days day,"; + if($days>1) $str .= "$days days,"; + if($hours == 1) $str .= " $hours hour and"; + if($hours>1) $str .= " $hours hours and"; + if($mins == 1) $str .= " 1 minute"; + else $str .= " $mins minutes"; + return $str; +} + +// create graphics +// +function graphics_avail() { + return extension_loaded('gd'); +} +if (isset($MYREQUEST['IMG'])) +{ + if (!graphics_avail()) { + exit(0); + } + + function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$color2,$text='',$placeindex=0) { + $r=$diameter/2; + $w=deg2rad((360+$start+($end-$start)/2)%360); + + + if (function_exists("imagefilledarc")) { + // exists only if GD 2.0.1 is avaliable + imagefilledarc($im, $centerX+1, $centerY+1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE); + imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE); + imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL|IMG_ARC_EDGED); + } else { + imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2); + imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); + imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start+1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); + imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end-1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); + imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); + imagefill($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2, $color2); + } + if ($text) { + if ($placeindex>0) { + imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); + imagestring($im,4,$diameter, $placeindex*12,$text,$color1); + + } else { + imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); + } + } + } + + function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$text,$placeindex=0) { + $r=$diameter/2; + $w=deg2rad((360+$start+($end-$start)/2)%360); + + if ($placeindex>0) { + imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); + imagestring($im,4,$diameter, $placeindex*12,$text,$color1); + + } else { + imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); + } + } + + function fill_box($im, $x, $y, $w, $h, $color1, $color2,$text='',$placeindex='') { + global $col_black; + $x1=$x+$w-1; + $y1=$y+$h-1; + + imagerectangle($im, $x, $y1, $x1+1, $y+1, $col_black); + if($y1>$y) imagefilledrectangle($im, $x, $y, $x1, $y1, $color2); + else imagefilledrectangle($im, $x, $y1, $x1, $y, $color2); + imagerectangle($im, $x, $y1, $x1, $y, $color1); + if ($text) { + if ($placeindex>0) { + + if ($placeindex<16) + { + $px=5; + $py=$placeindex*12+6; + imagefilledrectangle($im, $px+90, $py+3, $px+90-4, $py-3, $color2); + imageline($im,$x,$y+$h/2,$px+90,$py,$color2); + imagestring($im,2,$px,$py-6,$text,$color1); + + } else { + if ($placeindex<31) { + $px=$x+40*2; + $py=($placeindex-15)*12+6; + } else { + $px=$x+40*2+100*intval(($placeindex-15)/15); + $py=($placeindex%15)*12+6; + } + imagefilledrectangle($im, $px, $py+3, $px-4, $py-3, $color2); + imageline($im,$x+$w,$y+$h/2,$px,$py,$color2); + imagestring($im,2,$px+2,$py-6,$text,$color1); + } + } else { + imagestring($im,4,$x+5,$y1-16,$text,$color1); + } + } + } + + + $size = GRAPH_SIZE; // image size + if ($MYREQUEST['IMG']==3) + $image = imagecreate(2*$size+150, $size+10); + else + $image = imagecreate($size+50, $size+10); + + $col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); + $col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30); + $col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60); + $col_black = imagecolorallocate($image, 0, 0, 0); + imagecolortransparent($image,$col_white); + + switch ($MYREQUEST['IMG']) { + + case 1: + $s=$mem['num_seg']*$mem['seg_size']; + $a=$mem['avail_mem']; + $x=$y=$size/2; + $fuzz = 0.000001; + + // This block of code creates the pie chart. It is a lot more complex than you + // would expect because we try to visualize any memory fragmentation as well. + $angle_from = 0; + $string_placement=array(); + for($i=0; $i<$mem['num_seg']; $i++) { + $ptr = 0; + $free = $mem['block_lists'][$i]; + uasort($free, 'block_sort'); + foreach($free as $block) { + if($block['offset']!=$ptr) { // Used block + $angle_to = $angle_from+($block['offset']-$ptr)/$s; + if(($angle_to+$fuzz)>1) $angle_to = 1; + if( ($angle_to*360) - ($angle_from*360) >= 1) { + fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red); + if (($angle_to-$angle_from)>0.05) { + array_push($string_placement, array($angle_from,$angle_to)); + } + } + $angle_from = $angle_to; + } + $angle_to = $angle_from+($block['size'])/$s; + if(($angle_to+$fuzz)>1) $angle_to = 1; + if( ($angle_to*360) - ($angle_from*360) >= 1) { + fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_green); + if (($angle_to-$angle_from)>0.05) { + array_push($string_placement, array($angle_from,$angle_to)); + } + } + $angle_from = $angle_to; + $ptr = $block['offset']+$block['size']; + } + if ($ptr < $mem['seg_size']) { // memory at the end + $angle_to = $angle_from + ($mem['seg_size'] - $ptr)/$s; + if(($angle_to+$fuzz)>1) $angle_to = 1; + fill_arc($image,$x,$y,$size,$angle_from*360,$angle_to*360,$col_black,$col_red); + if (($angle_to-$angle_from)>0.05) { + array_push($string_placement, array($angle_from,$angle_to)); + } + } + } + foreach ($string_placement as $angle) { + text_arc($image,$x,$y,$size,$angle[0]*360,$angle[1]*360,$col_black,bsize($s*($angle[1]-$angle[0]))); + } + break; + + case 2: + $s=$cache['num_hits']+$cache['num_misses']; + $a=$cache['num_hits']; + + fill_box($image, 30,$size,50,$s ? (-$a*($size-21)/$s) : 0,$col_black,$col_green,sprintf("%.1f%%",$s ? $cache['num_hits']*100/$s : 0)); + fill_box($image,130,$size,50,$s ? -max(4,($s-$a)*($size-21)/$s) : 0,$col_black,$col_red,sprintf("%.1f%%",$s ? $cache['num_misses']*100/$s : 0)); + break; + + case 3: + $s=$mem['num_seg']*$mem['seg_size']; + $a=$mem['avail_mem']; + $x=130; + $y=1; + $j=1; + + // This block of code creates the bar chart. It is a lot more complex than you + // would expect because we try to visualize any memory fragmentation as well. + for($i=0; $i<$mem['num_seg']; $i++) { + $ptr = 0; + $free = $mem['block_lists'][$i]; + uasort($free, 'block_sort'); + foreach($free as $block) { + if($block['offset']!=$ptr) { // Used block + $h=(GRAPH_SIZE-5)*($block['offset']-$ptr)/$s; + if ($h>0) { + $j++; + if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($block['offset']-$ptr),$j); + else fill_box($image,$x,$y,50,$h,$col_black,$col_red); + } + $y+=$h; + } + $h=(GRAPH_SIZE-5)*($block['size'])/$s; + if ($h>0) { + $j++; + if($j<75) fill_box($image,$x,$y,50,$h,$col_black,$col_green,bsize($block['size']),$j); + else fill_box($image,$x,$y,50,$h,$col_black,$col_green); + } + $y+=$h; + $ptr = $block['offset']+$block['size']; + } + if ($ptr < $mem['seg_size']) { // memory at the end + $h = (GRAPH_SIZE-5) * ($mem['seg_size'] - $ptr) / $s; + if ($h > 0) { + fill_box($image,$x,$y,50,$h,$col_black,$col_red,bsize($mem['seg_size']-$ptr),$j++); + } + } + } + break; + + case 4: + $s=$cache['num_hits']+$cache['num_misses']; + $a=$cache['num_hits']; + + fill_box($image, 30,$size,50,$s ? -$a*($size-21)/$s : 0,$col_black,$col_green,sprintf("%.1f%%", $s ? $cache['num_hits']*100/$s : 0)); + fill_box($image,130,$size,50,$s ? -max(4,($s-$a)*($size-21)/$s) : 0,$col_black,$col_red,sprintf("%.1f%%", $s ? $cache['num_misses']*100/$s : 0)); + break; + } + + header("Content-type: image/png"); + imagepng($image); + exit; +} + +// pretty printer for byte values +// +function bsize($s) { + foreach (array('','K','M','G') as $i => $k) { + if ($s < 1024) break; + $s/=1024; + } + return sprintf("%5.1f %sBytes",$s,$k); +} + +// sortable table header in "scripts for this host" view +function sortheader($key,$name,$extra='') { + global $MYREQUEST, $MY_SELF_WO_SORT; + + if ($MYREQUEST['SORT1']==$key) { + $MYREQUEST['SORT2'] = $MYREQUEST['SORT2']=='A' ? 'D' : 'A'; + } + return "$name"; + +} + +// create menu entry +function menu_entry($ob,$title) { + global $MYREQUEST,$MY_SELF; + if ($MYREQUEST['OB']!=$ob) { + return "
  • $title
  • "; + } else if (empty($MYREQUEST['SH'])) { + return "
  • $title
  • "; + } else { + return "
  • $title
  • "; + } +} + +function put_login_link($s="Login") +{ + global $MY_SELF,$MYREQUEST,$AUTHENTICATED; + // needs ADMIN_PASSWORD to be changed! + // + if (!USE_AUTHENTICATION) { + return; + } else if (ADMIN_PASSWORD=='password') + { + print <<$s +EOB; + } else if ($AUTHENTICATED) { + print <<$s +EOB; + } +} + +function block_sort($array1, $array2) +{ + if ($array1['offset'] > $array2['offset']) { + return 1; + } else { + return -1; + } +} + + +?> + + +APCu INFO <?php echo $host ?> + + + +
    +

    + +
    User Cache
    +

    + +
    +
    + + +
  • Refresh Data
  • +EOB; +echo + menu_entry(OB_HOST_STATS,'View Host Stats'), + menu_entry(OB_USER_CACHE,'User Cache Entries'), + menu_entry(OB_VERSION_CHECK,'Version Check'); + +if ($AUTHENTICATED) { + echo <<Clear Cache +EOB; +} +echo << +EOB; + + +// CONTENT +echo << +EOB; + +// MAIN SWITCH STATEMENT + +switch ($MYREQUEST['OB']) { +// ----------------------------------------------- +// Host Stats +// ----------------------------------------------- +case OB_HOST_STATS: + $mem_size = $mem['num_seg']*$mem['seg_size']; + $mem_avail= $mem['avail_mem']; + $mem_used = $mem_size-$mem_avail; + $seg_size = bsize($mem['seg_size']); + $req_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits']+$cache['num_misses'])/($time-$cache['start_time'])) : 0); + $hit_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits'])/($time-$cache['start_time'])) : 0); + $miss_rate_user = sprintf("%.2f", $cache['num_misses'] ? (($cache['num_misses'])/($time-$cache['start_time'])) : 0); + $insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? (($cache['num_inserts'])/($time-$cache['start_time'])) : 0); + $apcversion = phpversion('apcu'); + $phpversion = phpversion(); + $number_vars = $cache['num_entries']; + $size_vars = bsize($cache['mem_size']); + $i=0; + echo <<< EOB +

    General Cache Information

    + + + +EOB; + + if(!empty($_SERVER['SERVER_NAME'])) + echo "\n"; + if(!empty($_SERVER['SERVER_SOFTWARE'])) + echo "\n"; + + echo << +EOB; + echo ''; + echo ''; + echo ''; + echo <<
    APCu Version$apcversion
    PHP Version$phpversion
    APCu Host{$_SERVER['SERVER_NAME']} $host
    Server Software{$_SERVER['SERVER_SOFTWARE']}
    Shared Memory{$mem['num_seg']} Segment(s) with $seg_size +
    ({$cache['memory_type']} memory) +
    Start Time',date(DATE_FORMAT,$cache['start_time']),'
    Uptime',duration($cache['start_time']),'
    File Upload Support',$cache['file_upload_progress'],'
    +
    + +

    Cache Information

    + + + + + + + + + + + +
    Cached Variables$number_vars ($size_vars)
    Hits{$cache['num_hits']}
    Misses{$cache['num_misses']}
    Request Rate (hits, misses)$req_rate_user cache requests/second
    Hit Rate$hit_rate_user cache requests/second
    Miss Rate$miss_rate_user cache requests/second
    Insert Rate$insert_rate_user cache requests/second
    Cache full count{$cache['num_expunges']}
    +
    + +

    Runtime Settings

    +EOB; + + $j = 0; + foreach (ini_get_all('apcu') as $k => $v) { + echo "\n"; + $j = 1 - $j; + } + + if($mem['num_seg']>1 || $mem['num_seg']==1 && count($mem['block_lists'][0])>1) + $mem_note = "Memory Usage
    (multiple slices indicate fragments)"; + else + $mem_note = "Memory Usage"; + + echo <<< EOB +
    ",$k,"",str_replace(',',',
    ',$v['local_value']),"
    +
    + +

    Host Status Diagrams

    + +EOB; + $size='width='.(GRAPH_SIZE+50).' height='.(GRAPH_SIZE+10); +echo << + + + +EOB; + + echo + graphics_avail() ? + ''. + "". + "\n" + : "", + '', + '\n", + '\n", + '', + '', + '\n", + '\n"; + echo <<< EOB + +
    $mem_noteHits & Misses
    \"\"\"\"
     Free: ',bsize($mem_avail).sprintf(" (%.1f%%)",$mem_avail*100/$mem_size)," Hits: ',$cache['num_hits'].@sprintf(" (%.1f%%)",$cache['num_hits']*100/($cache['num_hits']+$cache['num_misses'])),"
     Used: ',bsize($mem_used).sprintf(" (%.1f%%)",$mem_used *100/$mem_size)," Misses: ',$cache['num_misses'].@sprintf(" (%.1f%%)",$cache['num_misses']*100/($cache['num_hits']+$cache['num_misses'])),"
    + +
    +

    Detailed Memory Usage and Fragmentation

    + + + + +EOB; + if(isset($mem['adist'])) { + foreach($mem['adist'] as $i=>$v) { + $cur = pow(2,$i); $nxt = pow(2,$i+1)-1; + if($i==0) $range = "1"; + else $range = "$cur - $nxt"; + echo "\n"; + } + } + echo <<

    +EOB; + + // Fragementation: (freeseg - 1) / total_seg + $nseg = $freeseg = $fragsize = $freetotal = 0; + for($i=0; $i<$mem['num_seg']; $i++) { + $ptr = 0; + foreach($mem['block_lists'][$i] as $block) { + if ($block['offset'] != $ptr) { + ++$nseg; + } + $ptr = $block['offset'] + $block['size']; + /* Only consider blocks <5M for the fragmentation % */ + if($block['size']<(5*1024*1024)) $fragsize+=$block['size']; + $freetotal+=$block['size']; + } + $freeseg += count($mem['block_lists'][$i]); + } + + if ($freeseg > 1) { + $frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize/$freetotal)*100,bsize($fragsize),bsize($freetotal),$freeseg); + } else { + $frag = "0%"; + } + + if (graphics_avail()) { + $size='width='.(2*GRAPH_SIZE+150).' height='.(GRAPH_SIZE+10); + echo << +EOB; + } + echo <<Fragmentation: $frag +
    $range$v
    +
    +EOB; + + break; + + +// ----------------------------------------------- +// User Cache Entries +// ----------------------------------------------- +case OB_USER_CACHE: + if (!$AUTHENTICATED) { + echo '
    You need to login to see the user values here!
     
    '; + put_login_link("Login now!"); + echo '
    '; + break; + } + $fieldname='info'; + $fieldheading='User Entry Label'; + $fieldkey='key'; + + $cols=6; + echo <<
    Scope: + + ", + ", Sorting:', + '', + '', + '  Search: ', + ' ', + '
    '; + + if (isset($MYREQUEST['SEARCH'])) { + // Don't use preg_quote because we want the user to be able to specify a + // regular expression subpattern. + $MYREQUEST['SEARCH'] = '/'.str_replace('/', '\\/', $MYREQUEST['SEARCH']).'/i'; + if (preg_match($MYREQUEST['SEARCH'], 'test') === false) { + echo '
    Error: enter a valid regular expression as a search query.
    '; + break; + } + } + + echo + '
    ', + '', + '', + '', + '', + '', + '', + ''; + + if($fieldname=='info') { + $cols+=2; + echo ''; + } + echo ''; + + // builds list with alpha numeric sortable keys + // + $list = array(); + + foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) { + switch($MYREQUEST['SORT1']) { + case 'A': $k=sprintf('%015d-',$entry['access_time']); break; + case 'H': $k=sprintf('%015d-',$entry['num_hits']); break; + case 'Z': $k=sprintf('%015d-',$entry['mem_size']); break; + case 'M': $k=sprintf('%015d-',$entry['modification_time']); break; + case 'C': $k=sprintf('%015d-',$entry['creation_time']); break; + case 'T': $k=sprintf('%015d-',$entry['ttl']); break; + case 'D': $k=sprintf('%015d-',$entry['deletion_time']); break; + case 'S': $k=$entry["info"]; break; + } + if (!$AUTHENTICATED) { + // hide all path entries if not logged in + $list[$k.$entry[$fieldname]]=preg_replace('/^.*(\\/|\\\\)/','*hidden*/',$entry); + } else { + $list[$k.$entry[$fieldname]]=$entry; + } + } + + if ($list) { + // sort list + // + switch ($MYREQUEST['SORT2']) { + case "A": krsort($list); break; + case "D": ksort($list); break; + } + + // output list + $i=0; + foreach($list as $k => $entry) { + if(!$MYREQUEST['SEARCH'] || preg_match($MYREQUEST['SEARCH'], $entry[$fieldname]) != 0) { + $sh=md5($entry["info"]); + $field_value = htmlentities(strip_tags($entry[$fieldname],''), ENT_QUOTES, 'UTF-8'); + echo + '', + "', + '', + '', + '', + '', + ''; + + if($fieldname=='info') { + if($entry['ttl']) + echo ''; + else + echo ''; + } + if ($entry['deletion_time']) { + + echo ''; + } else if ($MYREQUEST['OB'] == OB_USER_CACHE) { + + echo ''; + } else { + echo ''; + } + echo ''; + if ($sh == $MYREQUEST["SH"]) { + echo ''; + echo ''; + echo ''; + } + $i++; + if ($i == $MYREQUEST['COUNT']) + break; + } + } + + } else { + echo ''; + } + echo <<< EOB +
    ',sortheader('S',$fieldheading, "&OB=".$MYREQUEST['OB']),'',sortheader('H','Hits', "&OB=".$MYREQUEST['OB']),'',sortheader('Z','Size', "&OB=".$MYREQUEST['OB']),'',sortheader('A','Last accessed',"&OB=".$MYREQUEST['OB']),'',sortheader('M','Last modified',"&OB=".$MYREQUEST['OB']),'',sortheader('C','Created at', "&OB=".$MYREQUEST['OB']),'',sortheader('T','Timeout',"&OB=".$MYREQUEST['OB']),'',sortheader('D','Deleted at',"&OB=".$MYREQUEST['OB']),'
    ",$field_value,'',$entry['num_hits'],'',$entry['mem_size'],'',date(DATE_FORMAT,$entry['access_time']),'',date(DATE_FORMAT,$entry['modification_time']),'',date(DATE_FORMAT,$entry['creation_time']),''.$entry['ttl'].' secondsNone', date(DATE_FORMAT,$entry['deletion_time']), ''; + echo '[Delete Now]'; + echo '  
    '.htmlentities(print_r(apcu_fetch($entry['info']), 1)).'
    No data
    +EOB; + + if ($list && $i < count($list)) { + echo "",count($list)-$i,' more available...'; + } + + echo <<< EOB +
    +EOB; + break; + +// ----------------------------------------------- +// Version check +// ----------------------------------------------- +case OB_VERSION_CHECK: + echo <<

    APCu Version Information

    + + + + +EOB; + if (defined('PROXY')) { + $ctxt = stream_context_create( array( 'http' => array( 'proxy' => PROXY, 'request_fulluri' => True ) ) ); + $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss", False, $ctxt); + } else { + $rss = @file_get_contents("http://pecl.php.net/feeds/pkg_apcu.rss"); + } + if (!$rss) { + echo ''; + } else { + $apcversion = phpversion('apc'); + + preg_match('!APCu ([0-9.]+)!', $rss, $match); + echo ''; + echo ''; + } + echo <<< EOB +
    Unable to fetch version information.
    '; + if (version_compare($apcversion, $match[1], '>=')) { + echo '
    You are running the latest version of APCu ('.$apcversion.')
    '; + $i = 3; + } else { + echo '
    You are running an older version of APCu ('.$apcversion.'), + newer version '.$match[1].' is available at + http://pecl.php.net/package/APCu/'.$match[1].' +
    '; + $i = -1; + } + echo '

    Change Log:


    '; + + preg_match_all('!<(title|description)>([^<]+)!', $rss, $match); + next($match[2]); next($match[2]); + + while (list(,$v) = each($match[2])) { + list(,$ver) = explode(' ', $v, 2); + if ($i < 0 && version_compare($apcversion, $ver, '>=')) { + break; + } else if (!$i--) { + break; + } + echo "".htmlspecialchars($v, ENT_QUOTES, 'UTF-8')."
    "; + echo nl2br(htmlspecialchars(current($match[2]), ENT_QUOTES, 'UTF-8'))."
    "; + next($match[2]); + } + echo '
    + +EOB; + break; + +} + +echo <<< EOB + +EOB; + +?> + + + + diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_php.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_php.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_php.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_php.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,84 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + | George Schlossnagle | + | Rasmus Lerdorf | + | Arun C. Murthy | + | Gopal Vijayaraghavan | + +----------------------------------------------------------------------+ + + 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_php.h 328674 2012-12-05 09:58:27Z ab $ */ + +#ifndef APC_PHP_H +#define APC_PHP_H + +/* + * The purpose of this header file is to include all PHP and Zend headers that + * are typically needed elsewhere in APC. This makes it easy to insure that + * all required headers are available. + */ + +#include "php.h" +#include "zend.h" +#include "zend_API.h" +#include "zend_compile.h" +#include "zend_hash.h" +#include "zend_extensions.h" + +#if ZEND_MODULE_API_NO >= 20121204 +#define ZEND_ENGINE_2_5 +#endif +#if ZEND_MODULE_API_NO >= 20100409 +#define ZEND_ENGINE_2_4 +#endif +#if ZEND_MODULE_API_NO > 20060613 +#define ZEND_ENGINE_2_3 +#endif +#if ZEND_MODULE_API_NO > 20050922 +#define ZEND_ENGINE_2_2 +#endif +#if ZEND_MODULE_API_NO > 20050921 +#define ZEND_ENGINE_2_1 +#endif +#ifdef ZEND_ENGINE_2_1 +#include "zend_vm.h" +#endif + +#ifndef IS_CONSTANT_TYPE_MASK +#define IS_CONSTANT_TYPE_MASK (~IS_CONSTANT_INDEX) +#endif + +#include "rfc1867.h" + +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_php_pcre.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_php_pcre.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_php_pcre.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_php_pcre.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,98 @@ +/* + +----------------------------------------------------------------------+ + | APC/PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2011 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. | + +----------------------------------------------------------------------+ + | Author: Andrei Zmievski | + +----------------------------------------------------------------------+ + */ + +/* $Id: apc_php_pcre.h 307048 2011-01-03 23:53:17Z kalle $ */ + +#ifndef PHP_PCRE_H +#define PHP_PCRE_H + +#if HAVE_PCRE || HAVE_BUNDLED_PCRE + +#if HAVE_BUNDLED_PCRE +#include "ext/pcre/pcrelib/pcre.h" +#else +#include "pcre.h" +#endif + +#if HAVE_LOCALE_H +#include +#endif + +PHP_FUNCTION(preg_match); +PHP_FUNCTION(preg_match_all); +PHP_FUNCTION(preg_replace); +PHP_FUNCTION(preg_replace_callback); +PHP_FUNCTION(preg_split); +PHP_FUNCTION(preg_quote); +PHP_FUNCTION(preg_grep); + +PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); +PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options TSRMLS_DC); +PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC); + +extern zend_module_entry pcre_module_entry; +#define pcre_module_ptr &pcre_module_entry + +typedef struct { + pcre *re; + pcre_extra *extra; + int preg_options; +#if HAVE_SETLOCALE + char *locale; + unsigned const char *tables; +#endif + int compile_options; + int refcount; +} pcre_cache_entry; + +PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC); + +PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, + zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC); + +PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, + int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); + +PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, + long limit_val, long flags TSRMLS_DC); + +PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value, + long flags TSRMLS_DC); + +ZEND_BEGIN_MODULE_GLOBALS(pcre) + HashTable pcre_cache; + long backtrack_limit; + long recursion_limit; + int error_code; +ZEND_END_MODULE_GLOBALS(pcre) + +#ifdef ZTS +# define PCRE_G(v) TSRMG(pcre_globals_id, zend_pcre_globals *, v) +#else +# define PCRE_G(v) (pcre_globals.v) +#endif + +#else + +#define pcre_module_ptr NULL + +#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */ + +#define phpext_pcre_ptr pcre_module_ptr + +#endif /* PHP_PCRE_H */ diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_pool_api.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_pool_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_pool_api.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_pool_api.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,148 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | + +----------------------------------------------------------------------+ + + This software was contributed to PHP by Yahoo! Inc. in 2008. + + Future revisions and derivatives of this source code must acknowledge + Yahoo! 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_pool.h 307048 2011-01-03 23:53:17Z kalle $ */ + +#ifndef APC_POOL_API_H +#define APC_POOL_API_H + +#if APC_POOL_DEBUG +#define APC_POOL_HAS_SIZEINFO(pool) ((pool->type & APC_POOL_SIZEINFO)!=0) +#define APC_POOL_HAS_REDZONES(pool) ((pool->type & APC_POOL_REDZONES)!=0) +#else +/* let gcc optimize away the optional features */ +#define APC_POOL_HAS_SIZEINFO(pool) (0) +#define APC_POOL_HAS_REDZONES(pool) (0) +#endif + +/* {{{ */ +typedef struct _apc_pool apc_pool; /* }}} */ + +/* {{{ functions */ +typedef void (*apc_pcleanup_t)(apc_pool *pool TSRMLS_DC); +typedef void* (*apc_palloc_t)(apc_pool *pool, size_t size TSRMLS_DC); +typedef void (*apc_pfree_t) (apc_pool *pool, void* p TSRMLS_DC); +typedef void* (*apc_protect_t) (void *p); +typedef void* (*apc_unprotect_t)(void *p); /* }}} */ + +/* {{{ enum definition: apc_pool_type */ +typedef enum { + APC_UNPOOL = 0x0, + APC_SMALL_POOL = 0x1, + APC_MEDIUM_POOL = 0x2, + APC_LARGE_POOL = 0x3, + APC_POOL_SIZE_MASK = 0x7, /* waste a bit */ +#if APC_POOL_DEBUG + APC_POOL_REDZONES = 0x08, + APC_POOL_SIZEINFO = 0x10, + APC_POOL_OPT_MASK = 0x18 +#endif +} apc_pool_type; /* }}} */ + +/* {{{ structure definition: apc_pool */ +struct _apc_pool { + /* denotes the size and debug flags for a pool */ + apc_pool_type type; + + /* handler functions */ + apc_malloc_t allocate; + apc_free_t deallocate; + + apc_palloc_t palloc; + apc_pfree_t pfree; + + apc_protect_t protect; + apc_unprotect_t unprotect; + + apc_pcleanup_t cleanup; + + /* total */ + size_t size; + /* remaining */ + size_t used; + + /* apc_realpool and apc_unpool add more here */ +}; /* }}} */ + +/* {{{ enum definition: apc_copy_type */ +/* APC_COPY_IN should be used when copying into APC + APC_COPY_OUT should be used when copying out of APC */ +typedef enum _apc_copy_type { + APC_NO_COPY = 0, + APC_COPY_IN, + APC_COPY_OUT, + APC_COPY_OTHER +} apc_copy_type; /* }}} */ + +/* {{{ enum definition: apc_context_type + APC_CONTEXT_SHARE should be used to create contexts using shared memory + APC_CONTEXT_NOSHARE should be used to create contexts using standard allocators */ +typedef enum _apc_context_type { + APC_CONTEXT_NONE = 0, + APC_CONTEXT_SHARE, + APC_CONTEXT_NOSHARE +} apc_context_type; /* }}} */ + +/* {{{ struct definition: apc_context_t */ +typedef struct _apc_context_t { + apc_pool* pool; /* pool of memory for context */ + apc_copy_type copy; /* copying type for context */ + unsigned int force_update:1; /* flag to force updates */ + HashTable copied; /* copied zvals for recursion support */ + apc_serializer_t* serializer; /* serializer */ + void* key; /* set before serializer API is invoked */ +} apc_context_t; /* }}} */ + +/* + apc_pool_create creates a pool of the specified type, setting the handlers passed on the pool, returns apc_pool* +*/ +PHP_APCU_API apc_pool* apc_pool_create(apc_pool_type pool_type, + apc_malloc_t allocate, + apc_free_t deallocate, + apc_protect_t protect, + apc_unprotect_t unprotect TSRMLS_DC); + +/* + apc_pool_destroy first calls apc_cleanup_t set during apc_pool_create, then apc_free_t +*/ +PHP_APCU_API void apc_pool_destroy(apc_pool* pool TSRMLS_DC); + +/* + apc_pmemcpy performs memcpy using resources provided by pool +*/ +PHP_APCU_API void* apc_pmemcpy(const void* p, + size_t n, + apc_pool* pool TSRMLS_DC); + +/* + apc_pstrdup performs strdup using resources provided by pool +*/ +PHP_APCU_API void* apc_pstrdup(const char* s, + apc_pool* pool TSRMLS_DC); + +#endif + diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_pool.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_pool.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_pool.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_pool.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,517 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | + +----------------------------------------------------------------------+ + + This software was contributed to PHP by Yahoo! Inc. in 2008. + + Future revisions and derivatives of this source code must acknowledge + Yahoo! 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_pool.c 327069 2012-08-12 08:56:55Z laruence $ */ + + +#include "apc_pool.h" +#include + +#ifdef APC_POOL_DEBUG +# ifdef HAVE_VALGRIND_MEMCHECK_H +# include +# endif +#endif + +/* {{{ forward references */ +static apc_pool* apc_unpool_create(apc_pool_type type, apc_malloc_t, apc_free_t, apc_protect_t, apc_unprotect_t TSRMLS_DC); +static apc_pool* apc_realpool_create(apc_pool_type type, apc_malloc_t, apc_free_t, apc_protect_t, apc_unprotect_t TSRMLS_DC); +/* }}} */ + +/* {{{ apc_pool_create */ +PHP_APCU_API apc_pool* apc_pool_create(apc_pool_type pool_type, + apc_malloc_t allocate, + apc_free_t deallocate, + apc_protect_t protect, + apc_unprotect_t unprotect TSRMLS_DC) +{ + if(pool_type == APC_UNPOOL) { + return apc_unpool_create(pool_type, allocate, deallocate, protect, unprotect TSRMLS_CC); + } + + return apc_realpool_create(pool_type, allocate, deallocate, protect, unprotect TSRMLS_CC); +} +/* }}} */ + +/* {{{ apc_pool_destroy */ +PHP_APCU_API void apc_pool_destroy(apc_pool *pool TSRMLS_DC) +{ + apc_free_t deallocate = pool->deallocate; + apc_pcleanup_t cleanup = pool->cleanup; + + cleanup(pool TSRMLS_CC); + deallocate(pool TSRMLS_CC); +} +/* }}} */ + +/* {{{ apc_unpool implementation */ + +typedef struct _apc_unpool apc_unpool; + +struct _apc_unpool { + apc_pool parent; + /* apc_unpool is a lie! */ +}; + +static void* apc_unpool_alloc(apc_pool* pool, + size_t size TSRMLS_DC) +{ + apc_unpool *upool = (apc_unpool*)pool; + + apc_malloc_t allocate = upool->parent.allocate; + + upool->parent.size += size; + upool->parent.used += size; + + return allocate(size TSRMLS_CC); +} + +static void apc_unpool_free(apc_pool* pool, + void *ptr TSRMLS_DC) +{ + apc_unpool *upool = (apc_unpool*) pool; + + apc_free_t deallocate = upool->parent.deallocate; + + deallocate(ptr TSRMLS_CC); +} + +static void apc_unpool_cleanup(apc_pool* pool TSRMLS_DC) +{ +} + +static apc_pool* apc_unpool_create(apc_pool_type type, + apc_malloc_t allocate, + apc_free_t deallocate, + apc_protect_t protect, + apc_unprotect_t unprotect TSRMLS_DC) +{ + apc_unpool* upool = allocate(sizeof(apc_unpool) TSRMLS_CC); + + if (!upool) { + return NULL; + } + + upool->parent.type = type; + upool->parent.allocate = allocate; + upool->parent.deallocate = deallocate; + + upool->parent.protect = protect; + upool->parent.unprotect = unprotect; + + upool->parent.palloc = apc_unpool_alloc; + upool->parent.pfree = apc_unpool_free; + + upool->parent.cleanup = apc_unpool_cleanup; + + upool->parent.used = 0; + upool->parent.size = 0; + + return &(upool->parent); +} +/* }}} */ + +/*{{{ apc_realpool implementation */ + +/* {{{ typedefs */ +typedef struct _pool_block +{ + size_t avail; + size_t capacity; + unsigned char *mark; + struct _pool_block *next; + unsigned :0; /* this should align to word */ + /* data comes here */ +}pool_block; + +/* + parts in ? are optional and turned on for fun, memory loss, + and for something else that I forgot about ... ah, debugging + + |--------> data[] |<-- non word boundary (too) + +-------------+--------------+-----------+-------------+-------------->>> + | pool_block | ?sizeinfo<1> | block<1> | ?redzone<1> | ?sizeinfo<2> + | | (size_t) | | padded left | + +-------------+--------------+-----------+-------------+-------------->>> + */ + +typedef struct _apc_realpool apc_realpool; + +struct _apc_realpool +{ + struct _apc_pool parent; + + size_t dsize; + void *owner; + + unsigned long count; + + pool_block *head; + pool_block first; +}; + +/* }}} */ + +/* {{{ redzone code */ +static const unsigned char decaff[] = { + 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, + 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, + 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad, + 0xde, 0xca, 0xff, 0xc0, 0xff, 0xee, 0xba, 0xad +}; + +/* a redzone is at least 4 (0xde,0xca,0xc0,0xff) bytes */ +#define REDZONE_SIZE(size) \ + ((ALIGNWORD((size)) > ((size) + 4)) ? \ + (ALIGNWORD((size)) - (size)) : /* does not change realsize */\ + ALIGNWORD((size)) - (size) + ALIGNWORD((sizeof(char)))) /* adds 1 word to realsize */ + +#define SIZEINFO_SIZE ALIGNWORD(sizeof(size_t)) + +#define MARK_REDZONE(block, redsize) do {\ + memcpy(block, decaff, redsize );\ + } while(0) + +#define CHECK_REDZONE(block, redsize) (memcmp(block, decaff, redsize) == 0) + +/* }}} */ + +#define INIT_POOL_BLOCK(rpool, entry, size) do {\ + (entry)->avail = (entry)->capacity = (size);\ + (entry)->mark = ((unsigned char*)(entry)) + ALIGNWORD(sizeof(pool_block));\ + (entry)->next = (rpool)->head;\ + (rpool)->head = (entry);\ +} while(0) + +/* {{{ create_pool_block */ +static pool_block* create_pool_block(apc_realpool *rpool, + size_t size TSRMLS_DC) +{ + apc_malloc_t allocate = rpool->parent.allocate; + + size_t realsize = sizeof(pool_block) + ALIGNWORD(size); + + pool_block* entry = allocate(realsize TSRMLS_CC); + + if (!entry) { + return NULL; + } + + INIT_POOL_BLOCK(rpool, entry, size); + + rpool->parent.size += realsize; + + rpool->count++; + + return entry; +} +/* }}} */ + +/* {{{ apc_realpool_alloc */ +static void* apc_realpool_alloc(apc_pool *pool, + size_t size TSRMLS_DC) +{ + apc_realpool *rpool = (apc_realpool*)pool; + unsigned char *p = NULL; + size_t realsize = ALIGNWORD(size); + size_t poolsize; + unsigned char *redzone = NULL; + size_t redsize = 0; + size_t *sizeinfo= NULL; + pool_block *entry = NULL; + unsigned long i; + + if(APC_POOL_HAS_REDZONES(pool)) { + redsize = REDZONE_SIZE(size); /* redsize might be re-using word size padding */ + realsize = size + redsize; /* recalculating realsize */ + } else { + redsize = realsize - size; /* use padding space */ + } + + if(APC_POOL_HAS_SIZEINFO(pool)) { + realsize += ALIGNWORD(sizeof(size_t)); + } + + /* minimize look-back, a value of 8 seems to give similar fill-ratios (+2%) + * as looping through the entire list. And much faster in allocations. */ + for(entry = rpool->head, i = 0; entry != NULL && (i < 8); entry = entry->next, i++) { + if(entry->avail >= realsize) { + goto found; + } + } + + /* upgrade the pool type to reduce overhead */ + if(rpool->count > 4 && rpool->dsize < 4096) { + rpool->dsize = 4096; + } else if(rpool->count > 8 && rpool->dsize < 8192) { + rpool->dsize = 8192; + } + + poolsize = ALIGNSIZE(realsize, rpool->dsize); + + entry = create_pool_block(rpool, poolsize TSRMLS_CC); + + if(!entry) { + return NULL; + } + +found: + p = entry->mark; + + if(APC_POOL_HAS_SIZEINFO(pool)) { + sizeinfo = (size_t*)p; + p += SIZEINFO_SIZE; + *sizeinfo = size; + } + + redzone = p + size; + + if(APC_POOL_HAS_REDZONES(pool)) { + MARK_REDZONE(redzone, redsize); + } + +#ifdef VALGRIND_MAKE_MEM_NOACCESS + if(redsize != 0) { + VALGRIND_MAKE_MEM_NOACCESS(redzone, redsize); + } +#endif + + entry->avail -= realsize; + entry->mark += realsize; + pool->used += realsize; + +#ifdef VALGRIND_MAKE_MEM_UNDEFINED + /* need to write before reading data off this */ + VALGRIND_MAKE_MEM_UNDEFINED(p, size); +#endif + + return (void*)p; +} +/* }}} */ + +/* {{{ apc_realpool_check_integrity */ +/* + * Checking integrity at runtime, does an + * overwrite check only when the sizeinfo + * is set. + * + * Marked as used in gcc, so that this function + * is accessible from gdb, eventhough it is never + * used in code in non-debug builds. + */ +static APC_USED int apc_realpool_check_integrity(apc_realpool *rpool) +{ + apc_pool *pool = &(rpool->parent); + pool_block *entry; + size_t *sizeinfo = NULL; + unsigned char *start; + size_t realsize; + unsigned char *redzone; + size_t redsize; + + for(entry = rpool->head; entry != NULL; entry = entry->next) { + start = (unsigned char *)entry + ALIGNWORD(sizeof(pool_block)); + if((entry->mark - start) != (entry->capacity - entry->avail)) { + return 0; + } + } + + if(!APC_POOL_HAS_REDZONES(pool) || + !APC_POOL_HAS_SIZEINFO(pool)) { + (void)pool; /* remove unused warning */ + return 1; + } + + for(entry = rpool->head; entry != NULL; entry = entry->next) { + start = (unsigned char *)entry + ALIGNWORD(sizeof(pool_block)); + + while(start < entry->mark) { + sizeinfo = (size_t*)start; + /* redzone starts where real data ends, in a non-word boundary + * redsize is at least 4 bytes + whatever's needed to make it + * to another word boundary. + */ + redzone = start + SIZEINFO_SIZE + (*sizeinfo); + redsize = REDZONE_SIZE(*sizeinfo); +#ifdef VALGRIND_MAKE_MEM_DEFINED + VALGRIND_MAKE_MEM_DEFINED(redzone, redsize); +#endif + if(!CHECK_REDZONE(redzone, redsize)) + { + /* + fprintf(stderr, "Redzone check failed for %p\n", + start + ALIGNWORD(sizeof(size_t)));*/ + return 0; + } +#ifdef VALGRIND_MAKE_MEM_NOACCESS + VALGRIND_MAKE_MEM_NOACCESS(redzone, redsize); +#endif + realsize = SIZEINFO_SIZE + *sizeinfo + redsize; + start += realsize; + } + } + + return 1; +} +/* }}} */ + +/* {{{ apc_realpool_free */ +/* + * free does not do anything + */ +static void apc_realpool_free(apc_pool *pool, + void *p TSRMLS_DC) +{ +} +/* }}} */ + +/* {{{ apc_realpool_cleanup */ +static void apc_realpool_cleanup(apc_pool *pool TSRMLS_DC) +{ + pool_block *entry; + pool_block *tmp; + apc_realpool *rpool = (apc_realpool*)pool; + apc_free_t deallocate = pool->deallocate; + + assert(apc_realpool_check_integrity(rpool)!=0); + + entry = rpool->head; + + while(entry->next != NULL) { + tmp = entry->next; + deallocate(entry TSRMLS_CC); + entry = tmp; + } +} +/* }}} */ + +/* {{{ apc_realpool_create */ +static apc_pool* apc_realpool_create(apc_pool_type type, + apc_malloc_t allocate, + apc_free_t deallocate, + apc_protect_t protect, + apc_unprotect_t unprotect TSRMLS_DC) +{ + + size_t dsize = 0; + apc_realpool *rpool; + + switch(type & APC_POOL_SIZE_MASK) { + case APC_SMALL_POOL: + dsize = 512; + break; + + case APC_LARGE_POOL: + dsize = 8192; + break; + + case APC_MEDIUM_POOL: + dsize = 4096; + break; + + default: + return NULL; + } + + rpool = (apc_realpool*)allocate((sizeof(apc_realpool) + ALIGNWORD(dsize)) TSRMLS_CC); + + if(!rpool) { + return NULL; + } + + rpool->parent.type = type; + + rpool->parent.allocate = allocate; + rpool->parent.deallocate = deallocate; + + rpool->parent.size = sizeof(apc_realpool) + ALIGNWORD(dsize); + + rpool->parent.palloc = apc_realpool_alloc; + rpool->parent.pfree = apc_realpool_free; + + rpool->parent.protect = protect; + rpool->parent.unprotect = unprotect; + + rpool->parent.cleanup = apc_realpool_cleanup; + + rpool->dsize = dsize; + rpool->head = NULL; + rpool->count = 0; + + INIT_POOL_BLOCK(rpool, &(rpool->first), dsize); + + return &(rpool->parent); +} + + +/* }}} */ + +/* }}} */ + +/* {{{ apc_pool_init */ +PHP_APCU_API void apc_pool_init() +{ + /* put all ye sanity checks here */ + assert(sizeof(decaff) > REDZONE_SIZE(ALIGNWORD(sizeof(char)))); + assert(sizeof(pool_block) == ALIGNWORD(sizeof(pool_block))); +#if APC_POOL_DEBUG + assert((APC_POOL_SIZE_MASK & (APC_POOL_SIZEINFO | APC_POOL_REDZONES)) == 0); +#endif +} +/* }}} */ + +/* {{{ apc_pstrdup */ +PHP_APCU_API void* APC_ALLOC apc_pstrdup(const char* s, + apc_pool* pool TSRMLS_DC) +{ + return s != NULL ? apc_pmemcpy(s, (strlen(s) + 1), pool TSRMLS_CC) : NULL; +} +/* }}} */ + +/* {{{ apc_pmemcpy */ +PHP_APCU_API void* APC_ALLOC apc_pmemcpy(const void* p, + size_t n, + apc_pool* pool TSRMLS_DC) +{ + void* q; + + if (p != NULL && (q = pool->palloc(pool, n TSRMLS_CC)) != NULL) { + memcpy(q, p, n); + return q; + } + return NULL; +} +/* }}} */ + +/* + * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_pool.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_pool.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_pool.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_pool.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,44 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | + +----------------------------------------------------------------------+ + + This software was contributed to PHP by Yahoo! Inc. in 2008. + + Future revisions and derivatives of this source code must acknowledge + Yahoo! 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_pool.h 307048 2011-01-03 23:53:17Z kalle $ */ + +#ifndef APC_POOL_H +#define APC_POOL_H + +#include "apc.h" +#include "apc_sma.h" + +#ifndef APC_POOL_API_H +# include "apc_pool_api.h" +#endif + +/* + performs alignment checking on pool internals during MINIT +*/ +extern PHP_APCU_API void apc_pool_init(); +#endif + diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_rfc1867.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_rfc1867.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_rfc1867.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_rfc1867.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,235 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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: 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. + + */ + +/* $Id: apc_rfc1867.c 309694 2011-03-25 18:47:38Z rasmus $*/ + +#include "apc.h" +#include "apc_globals.h" +#include "rfc1867.h" + +#ifdef PHP_WIN32 +#include "win32/time.h" +#endif + +extern apc_cache_t* apc_user_cache; + +#ifdef MULTIPART_EVENT_FORMDATA +static zend_bool update_bytes_processed(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { + int *bytes_ptr = (int*)data; + zval* val = entry->val; + + if(Z_TYPE_P(val) == IS_ARRAY) { + HashTable *ht = val->value.ht; + Bucket* curr = NULL; + for (curr = ht->pListHead; curr != NULL; curr = curr->pListNext) { + if(curr->nKeyLength == 8 && + (!memcmp(curr->arKey, "current", curr->nKeyLength))) { + zval* current = ((zval**)curr->pData)[0]; + current->value.lval = *bytes_ptr; + return 1; + } + } + } + + return 0; +} + +static double my_time() { + struct timeval a; + double t; + gettimeofday(&a, NULL); + t = a.tv_sec + (a.tv_usec/1000000.00); + return t; +} + + +#define RFC1867_DATA(name) \ + ((request_data)->name) + +int apc_rfc1867_progress(uint event, void *event_data, void **extra TSRMLS_DC) { + apc_rfc1867_data *request_data = &APCG(rfc1867_data); + zval *track = NULL; + + switch (event) { + case MULTIPART_EVENT_START: + { + multipart_event_start *data = (multipart_event_start *) event_data; + + RFC1867_DATA(content_length) = data->content_length; + RFC1867_DATA(tracking_key)[0] = '\0'; + RFC1867_DATA(name)[0] = '\0'; + RFC1867_DATA(cancel_upload) = 0; + RFC1867_DATA(temp_filename) = NULL; + RFC1867_DATA(filename)[0] = '\0'; + RFC1867_DATA(key_length) = 0; + RFC1867_DATA(start_time) = my_time(); + RFC1867_DATA(bytes_processed) = 0; + RFC1867_DATA(prev_bytes_processed) = 0; + RFC1867_DATA(rate) = 0; + RFC1867_DATA(update_freq) = (int) APCG(rfc1867_freq); + RFC1867_DATA(started) = 0; + + if(RFC1867_DATA(update_freq) < 0) { // frequency is a percentage, not bytes + RFC1867_DATA(update_freq) = (int) (RFC1867_DATA(content_length) * APCG(rfc1867_freq) / 100); + } + } + break; + + case MULTIPART_EVENT_FORMDATA: + { + int prefix_len = strlen(APCG(rfc1867_prefix)); + multipart_event_formdata *data = (multipart_event_formdata *) event_data; + if(data->name && !strncasecmp(data->name, APCG(rfc1867_name), strlen(APCG(rfc1867_name))) + && data->value && data->length) { + + if(data->length >= sizeof(RFC1867_DATA(tracking_key)) - prefix_len) { + apc_warning("Key too long for '%s'. Maximum size is '%d' characters." TSRMLS_CC, + APCG(rfc1867_name), + sizeof(RFC1867_DATA(tracking_key)) - prefix_len); + break; + } + + if(RFC1867_DATA(started)) { + apc_warning("Upload progress key '%s' should be before the file upload entry in the form." TSRMLS_CC, + APCG(rfc1867_name)); + break; + } + + strlcat(RFC1867_DATA(tracking_key), APCG(rfc1867_prefix), 63); + strlcat(RFC1867_DATA(tracking_key), *data->value, 63); + RFC1867_DATA(key_length) = data->length + prefix_len; + RFC1867_DATA(bytes_processed) = data->post_bytes_processed; + } + } + break; + + case MULTIPART_EVENT_FILE_START: + { + RFC1867_DATA(started) = 1; + if(*RFC1867_DATA(tracking_key)) { + multipart_event_file_start *data = (multipart_event_file_start *) event_data; + + RFC1867_DATA(bytes_processed) = data->post_bytes_processed; + strlcpy(RFC1867_DATA(filename),*data->filename,128); + RFC1867_DATA(temp_filename) = NULL; + strlcpy(RFC1867_DATA(name),data->name,64); + ALLOC_INIT_ZVAL(track); + array_init(track); + add_assoc_long(track, "total", RFC1867_DATA(content_length)); + add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); + add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); + add_assoc_string(track, "name", RFC1867_DATA(name), 1); + add_assoc_long(track, "done", 0); + add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); + apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); + zval_ptr_dtor(&track); + } + } + break; + + case MULTIPART_EVENT_FILE_DATA: + if(*RFC1867_DATA(tracking_key)) { + multipart_event_file_data *data = (multipart_event_file_data *) event_data; + RFC1867_DATA(bytes_processed) = data->post_bytes_processed; + if(RFC1867_DATA(bytes_processed) - RFC1867_DATA(prev_bytes_processed) > (uint) RFC1867_DATA(update_freq)) { + if(!apc_cache_update(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length), update_bytes_processed, &RFC1867_DATA(bytes_processed) TSRMLS_CC)) { + ALLOC_INIT_ZVAL(track); + array_init(track); + add_assoc_long(track, "total", RFC1867_DATA(content_length)); + add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); + add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); + add_assoc_string(track, "name", RFC1867_DATA(name), 1); + add_assoc_long(track, "done", 0); + add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); + apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); + zval_ptr_dtor(&track); + } + RFC1867_DATA(prev_bytes_processed) = RFC1867_DATA(bytes_processed); + } + } + break; + + case MULTIPART_EVENT_FILE_END: + if(*RFC1867_DATA(tracking_key)) { + multipart_event_file_end *data = (multipart_event_file_end *) event_data; + RFC1867_DATA(bytes_processed) = data->post_bytes_processed; + RFC1867_DATA(cancel_upload) = data->cancel_upload; + if(data->temp_filename) { + RFC1867_DATA(temp_filename) = data->temp_filename; + } else { + RFC1867_DATA(temp_filename) = ""; + } + ALLOC_INIT_ZVAL(track); + array_init(track); + add_assoc_long(track, "total", RFC1867_DATA(content_length)); + add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); + add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); + add_assoc_string(track, "name", RFC1867_DATA(name), 1); + add_assoc_string(track, "temp_filename", RFC1867_DATA(temp_filename), 1); + add_assoc_long(track, "cancel_upload", RFC1867_DATA(cancel_upload)); + add_assoc_long(track, "done", 0); + add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); + apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); + zval_ptr_dtor(&track); + } + break; + + case MULTIPART_EVENT_END: + if(*RFC1867_DATA(tracking_key)) { + double now = my_time(); + multipart_event_end *data = (multipart_event_end *) event_data; + RFC1867_DATA(bytes_processed) = data->post_bytes_processed; + if(now>RFC1867_DATA(start_time)) RFC1867_DATA(rate) = 8.0*RFC1867_DATA(bytes_processed)/(now-RFC1867_DATA(start_time)); + else RFC1867_DATA(rate) = 8.0*RFC1867_DATA(bytes_processed); /* Too quick */ + ALLOC_INIT_ZVAL(track); + array_init(track); + add_assoc_long(track, "total", RFC1867_DATA(content_length)); + add_assoc_long(track, "current", RFC1867_DATA(bytes_processed)); + add_assoc_double(track, "rate", RFC1867_DATA(rate)); + add_assoc_string(track, "filename", RFC1867_DATA(filename), 1); + add_assoc_string(track, "name", RFC1867_DATA(name), 1); + add_assoc_long(track, "cancel_upload", RFC1867_DATA(cancel_upload)); + add_assoc_long(track, "done", 1); + add_assoc_double(track, "start_time", RFC1867_DATA(start_time)); + apc_cache_store(apc_user_cache, RFC1867_DATA(tracking_key), RFC1867_DATA(key_length)+1, track, APCG(rfc1867_ttl), 0 TSRMLS_CC); + zval_ptr_dtor(&track); + } + break; + } + + return SUCCESS; +} + +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_serializer.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_serializer.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_serializer.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_serializer.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,88 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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: Gopal Vijayaraghavan | + +----------------------------------------------------------------------+ + + */ + +/* $Id: $ */ + +#ifndef APC_SERIALIZER_H +#define APC_SERIALIZER_H + +/* this is a shipped .h file, do not include any other header in this file */ +#define APC_SERIALIZER_NAME(module) module##_apc_serializer +#define APC_UNSERIALIZER_NAME(module) module##_apc_unserializer + +#define APC_SERIALIZER_ARGS unsigned char **buf, size_t *buf_len, const zval *value, void *config TSRMLS_DC +#define APC_UNSERIALIZER_ARGS zval **value, unsigned char *buf, size_t buf_len, void *config TSRMLS_DC + +typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS); +typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS); + +typedef int (*apc_register_serializer_t)(const char* name, + apc_serialize_t serialize, + apc_unserialize_t unserialize, + void *config TSRMLS_DC); + +/* + * ABI version for constant hooks. Increment this any time you make any changes + * to any function in this file. + */ +#define APC_SERIALIZER_ABI "0" +#define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI + +#if !defined(APC_UNUSED) +# if defined(__GNUC__) +# define APC_UNUSED __attribute__((unused)) +# else +# define APC_UNUSED +# endif +#endif + +static APC_UNUSED int apc_register_serializer(const char* name, + apc_serialize_t serialize, + apc_unserialize_t unserialize, + void *config TSRMLS_DC) +{ + zval apc_magic_constant; + int retval = 0; + + /* zend_get_constant will return 1 on success, otherwise apc_magic_constant wouldn't be touched at all */ + if (zend_get_constant(APC_SERIALIZER_CONSTANT, sizeof(APC_SERIALIZER_CONSTANT)-1, &apc_magic_constant TSRMLS_CC)) { +#if defined(PHP_WIN32) && defined(_WIN64) + apc_register_serializer_t register_func = (apc_register_serializer_t)_atoi64(Z_STRVAL(apc_magic_constant)); +#else + apc_register_serializer_t register_func = (apc_register_serializer_t)(Z_LVAL(apc_magic_constant)); +#endif + if(register_func) { + retval = register_func(name, serialize, unserialize, NULL TSRMLS_CC); + } + zval_dtor(&apc_magic_constant); + } + + return retval; +} + +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_shm.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_shm.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_shm.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_shm.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,116 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + | 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. + + */ + +/* $Id: apc_shm.c 307259 2011-01-08 12:05:24Z gopalv $ */ + +#include "apc_shm.h" +#include "apc.h" +#ifdef PHP_WIN32 +/* shm functions are available in TSRM */ +#include +#define key_t long +#else +#include +#include +#include +#endif + +#ifndef SHM_R +# define SHM_R 0444 /* read permission */ +#endif +#ifndef SHM_A +# define SHM_A 0222 /* write permission */ +#endif + +int apc_shm_create(int proj, size_t size TSRMLS_DC) +{ + int shmid; /* shared memory id */ + int oflag; /* permissions on shm */ + key_t key = IPC_PRIVATE; /* shm key */ + + oflag = IPC_CREAT | SHM_R | SHM_A; + if ((shmid = shmget(key, size, oflag)) < 0) { + apc_error("apc_shm_create: shmget(%d, %d, %d) failed: %s. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment." TSRMLS_CC, key, size, oflag, strerror(errno)); + } + + return shmid; +} + +void apc_shm_destroy(int shmid) +{ + /* we expect this call to fail often, so we do not check */ + shmctl(shmid, IPC_RMID, 0); +} + +apc_segment_t apc_shm_attach(int shmid, size_t size TSRMLS_DC) +{ + apc_segment_t segment; /* shm segment */ + + if ((long)(segment.shmaddr = shmat(shmid, 0, 0)) == -1) { + apc_error("apc_shm_attach: shmat failed:" TSRMLS_CC); + } + +#ifdef APC_MEMPROTECT + + if ((long)(segment.roaddr = shmat(shmid, 0, SHM_RDONLY)) == -1) { + segment.roaddr = NULL; + } + +#endif + + segment.size = size; + + /* + * We set the shmid for removal immediately after attaching to it. The + * segment won't disappear until all processes have detached from it. + */ + apc_shm_destroy(shmid); + return segment; +} + +void apc_shm_detach(apc_segment_t* segment TSRMLS_DC) +{ + if (shmdt(segment->shmaddr) < 0) { + apc_error("apc_shm_detach: shmdt failed:" TSRMLS_CC); + } + +#ifdef APC_MEMPROTECT + if (segment->roaddr && shmdt(segment->roaddr) < 0) { + apc_error("apc_shm_detach: shmdt failed:" TSRMLS_CC); + } +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_shm.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_shm.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_shm.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_shm.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,56 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + +----------------------------------------------------------------------+ + + 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_shm.h 307259 2011-01-08 12:05:24Z gopalv $ */ + +#ifndef APC_SHM_H +#define APC_SHM_H + +#include +#ifdef PHP_WIN32 +#include +#endif + +#include "apc_sma.h" + +/* Wrapper functions for unix shared memory */ + +extern int apc_shm_create(int proj, size_t size TSRMLS_DC); +extern void apc_shm_destroy(int shmid); +extern apc_segment_t apc_shm_attach(int shmid, size_t size TSRMLS_DC); +extern void apc_shm_detach(apc_segment_t* segment TSRMLS_DC); + +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_signal.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_signal.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_signal.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_signal.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,229 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + +----------------------------------------------------------------------+ + + 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 327066 2012-08-12 07:48:48Z laruence $ */ + + /* 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 "apc.h" + +#if HAVE_SIGACTION +#include +#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*) TSRMLS_DC); +static void apc_rehandle_signal(int signo, siginfo_t *siginfo, void *context); +static void apc_core_unmap(int signo, siginfo_t *siginfo, void *context); +#if defined(SIGUSR1) && defined(APC_SIGNAL_CLEAR) +static void apc_clear_cache(int signo, siginfo_t *siginfo, void *context); +#endif + +extern apc_cache_t* apc_user_cache; + +/* {{{ 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) +{ + TSRMLS_FETCH(); + + apc_sma_cleanup(TSRMLS_C); + apc_rehandle_signal(signo, siginfo, context); + +#if !defined(WIN32) && !defined(NETWARE) + kill(getpid(), signo); +#else + raise(signo); +#endif +} /* }}} */ + + +#if defined(SIGUSR1) && defined(APC_SIGNAL_CLEAR) +/* {{{ apc_reload_cache */ +static void apc_clear_cache(int signo, siginfo_t *siginfo, void *context) { + TSRMLS_FETCH(); + + if (apc_user_cache) { + apc_cache_clear( + apc_user_cache TSRMLS_CC); + } + + apc_rehandle_signal(signo, siginfo, context); + +#if !defined(WIN32) && !defined(NETWARE) + kill(getpid(), signo); +#else + raise(signo); +#endif +} /* }}} */ +#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*) TSRMLS_DC) +{ + 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 *) TSRMLS_CC); + apc_signal_info.prev[apc_signal_info.installed] = (apc_signal_entry_t *)apc_emalloc(sizeof(apc_signal_entry_t) TSRMLS_CC); + *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_warning("Error installing apc signal handler for %d" TSRMLS_CC, signo); + } + + return SUCCESS; + } + return FAILURE; +} /* }}} */ + +/* {{{ apc_set_signals + * Install our signal handlers */ +void apc_set_signals(TSRMLS_D) +{ + if (apc_signal_info.installed == 0) { +#if defined(SIGUSR1) && defined(APC_SIGNAL_CLEAR) + apc_register_signal(SIGUSR1, apc_clear_cache TSRMLS_CC); +#endif + if (APCG(coredump_unmap)) { + /* ISO C standard signals that coredump */ + apc_register_signal(SIGSEGV, apc_core_unmap TSRMLS_CC); + apc_register_signal(SIGABRT, apc_core_unmap TSRMLS_CC); + apc_register_signal(SIGFPE, apc_core_unmap TSRMLS_CC); + apc_register_signal(SIGILL, apc_core_unmap TSRMLS_CC); +/* extended signals that coredump */ +#ifdef SIGBUS + apc_register_signal(SIGBUS, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGABORT + apc_register_signal(SIGABORT, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGEMT + apc_register_signal(SIGEMT, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGIOT + apc_register_signal(SIGIOT, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGQUIT + apc_register_signal(SIGQUIT, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGSYS + apc_register_signal(SIGSYS, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGTRAP + apc_register_signal(SIGTRAP, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGXCPU + apc_register_signal(SIGXCPU, apc_core_unmap TSRMLS_CC); +#endif +#ifdef SIGXFSZ + apc_register_signal(SIGXFSZ, apc_core_unmap TSRMLS_CC); +#endif + } + } +} /* }}} */ + +/* {{{ apc_set_signals + * cleanup signals for shutdown */ +void apc_shutdown_signals(TSRMLS_D) +{ + int i=0; + if (apc_signal_info.installed > 0) { + for (i=0; (i < apc_signal_info.installed); i++) { + apc_efree(apc_signal_info.prev[i] TSRMLS_CC); + } + apc_efree(apc_signal_info.prev TSRMLS_CC); + apc_signal_info.installed = 0; /* just in case */ + } +} +/* }}} */ + +#endif /* HAVE_SIGACTION */ + +/* + * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_signal.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_signal.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_signal.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_signal.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,51 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + +----------------------------------------------------------------------+ + + */ + +/* $Id: apc_signal.h 307048 2011-01-03 23:53:17Z kalle $ */ + +#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); +void apc_shutdown_signals(TSRMLS_D); + +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_sma_api.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_sma_api.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_sma_api.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_sma_api.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,292 @@ +/* + +----------------------------------------------------------------------+ + | APCu | + +----------------------------------------------------------------------+ + | Copyright (c) 2013 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. | + +----------------------------------------------------------------------+ + | Author: Joe Watkins | + +----------------------------------------------------------------------+ + + 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. + */ + +#ifndef HAVE_APC_SMA_API_H +#define HAVE_APC_SMA_API_H +/* {{{ SMA API + APC SMA API provides support for shared memory allocators to external libraries ( and to APC ) + Skip to the bottom macros for error free usage of the SMA API +*/ + +/* {{{ struct definition: apc_segment_t */ +typedef struct _apc_segment_t { + size_t size; /* size of this segment */ + void* shmaddr; /* address of shared memory */ +#ifdef APC_MEMPROTECT + void* roaddr; /* read only (mprotect'd) address */ +#endif +} apc_segment_t; /* }}} */ + +/* {{{ 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 segments */ + size_t seg_size; /* segment size */ + apc_sma_link_t** list; /* one list per segment of links */ +}; +/* }}} */ + +/* {{{ function definitions for SMA API objects */ +typedef void (*apc_sma_init_f) (zend_uint num, zend_ulong size, char *mask TSRMLS_DC); +typedef void (*apc_sma_cleanup_f) (TSRMLS_D); +typedef void* (*apc_sma_malloc_f) (zend_ulong size TSRMLS_DC); +typedef void* (*apc_sma_malloc_ex_f) (zend_ulong size, zend_ulong fragment, zend_ulong *allocated TSRMLS_DC); +typedef void* (*apc_sma_realloc_f) (void* p, zend_ulong size TSRMLS_DC); +typedef char* (*apc_sma_strdup_f) (const char* str TSRMLS_DC); +typedef void (*apc_sma_free_f) (void *p TSRMLS_DC); +typedef void* (*apc_sma_protect_f) (void* p); +typedef void* (*apc_sma_unprotect_f) (void* p); +typedef apc_sma_info_t* (*apc_sma_info_f) (zend_bool limited TSRMLS_DC); +typedef void (*apc_sma_free_info_f) (apc_sma_info_t *info TSRMLS_DC); +typedef zend_ulong (*apc_sma_get_avail_mem_f) (void); +typedef zend_bool (*apc_sma_get_avail_size_f) (zend_ulong size); +typedef void (*apc_sma_check_integrity_f) (void); +typedef void (*apc_sma_expunge_f)(void* pointer, zend_ulong size TSRMLS_DC); /* }}} */ + +/* {{{ struct definition: apc_sma_t */ +typedef struct _apc_sma_t { + zend_bool initialized; /* flag to indicate this sma has been intialized */ + + /* functions */ + apc_sma_init_f init; /* init */ + apc_sma_cleanup_f cleanup; /* cleanup */ + apc_sma_malloc_f smalloc; /* malloc */ + apc_sma_malloc_ex_f malloc_ex; /* malloc_ex */ + apc_sma_realloc_f realloc; /* realloc */ + apc_sma_strdup_f strdup; /* strdup */ + apc_sma_free_f sfree; /* free */ + apc_sma_protect_f protect; /* protect */ + apc_sma_unprotect_f unprotect; /* unprotect */ + apc_sma_info_f info; /* info */ + apc_sma_free_info_f free_info; /* free info */ + apc_sma_get_avail_mem_f get_avail_mem; /* get avail mem */ + apc_sma_get_avail_size_f get_avail_size; /* get avail size */ + apc_sma_check_integrity_f check_integrity; /* check integrity */ + + /* callback */ + apc_sma_expunge_f expunge; /* expunge */ + void** data; /* data */ + + /* info */ + zend_uint num; /* number of segments */ + zend_ulong size; /* segment size */ + zend_uint last; /* last segment */ + + /* segments */ + apc_segment_t* segs; /* segments */ +} apc_sma_t; /* }}} */ + +/* +* apc_sma_api_init will initialize a shared memory allocator with num segments of the given size +* +* should be called once per allocator per process +*/ +PHP_APCU_API void apc_sma_api_init(apc_sma_t* sma, + void** data, + apc_sma_expunge_f expunge, + zend_uint num, + zend_ulong size, + char *mask TSRMLS_DC); + +/* +* apc_sma_api_cleanup will free the sma allocator +*/ +PHP_APCU_API void apc_sma_api_cleanup(apc_sma_t* sma TSRMLS_DC); + +/* +* apc_smap_api_malloc will allocate a block from the sma of the given size +*/ +PHP_APCU_API void* apc_sma_api_malloc(apc_sma_t* sma, + zend_ulong size TSRMLS_DC); + +/* +* apc_sma_api_malloc_ex will allocate a block from the sma of the given size +*/ +PHP_APCU_API void* apc_sma_api_malloc_ex(apc_sma_t* sma, + zend_ulong size, + zend_ulong fragment, + zend_ulong* allocated TSRMLS_DC); + +/* +* apc_sma_api_realloc will reallocate p using a new block from sma (freeing the original p) +*/ +PHP_APCU_API void* apc_sma_api_realloc(apc_sma_t* sma, + void* p, + zend_ulong size TSRMLS_DC); + +/* +* apc_sma_api_strdup will duplicate the given string into a block from sma +*/ +PHP_APCU_API char* apc_sma_api_strdup(apc_sma_t* sma, + const char* s TSRMLS_DC); + +/* +* apc_sma_api_free will free p (which should be a pointer to a block allocated from sma) +*/ +PHP_APCU_API void apc_sma_api_free(apc_sma_t* sma, + void* p TSRMLS_DC); + +/* +* apc_sma_api_protect will protect p (which should be a pointer to a block allocated from sma) +*/ +PHP_APCU_API void* apc_sma_api_protect(apc_sma_t* sma, + void* p); + +/* +* apc_sma_api_protect will uprotect p (which should be a pointer to a block allocated from sma) +*/ +PHP_APCU_API void* apc_sma_api_unprotect(apc_sma_t* sma, + void *p); + +/* +* apc_sma_api_info returns information about the allocator +*/ +PHP_APCU_API apc_sma_info_t* apc_sma_api_info(apc_sma_t* sma, + zend_bool limited TSRMLS_DC); + +/* +* apc_sma_api_info_free_info is for freeing apc_sma_info_t* returned by apc_sma_api_info +*/ +PHP_APCU_API void apc_sma_api_free_info(apc_sma_t* sma, + apc_sma_info_t* info TSRMLS_DC); + +/* +* apc_sma_api_get_avail_mem will return the amount of memory available left to sma +*/ +PHP_APCU_API zend_ulong apc_sma_api_get_avail_mem(apc_sma_t* sma); + +/* +* apc_sma_api_get_avail_size will return true if at least size bytes are available to the sma +*/ +PHP_APCU_API zend_bool apc_sma_api_get_avail_size(apc_sma_t* sma, + size_t size); + +/* +* apc_sma_api_check_integrity will check the integrity of sma +*/ +PHP_APCU_API void apc_sma_api_check_integrity(apc_sma_t* sma); /* }}} */ + +/* {{{ ALIGNWORD: pad up x, aligned to the system's word boundary */ +typedef union { void* p; int i; long l; double d; void (*f)(void); } apc_word_t; +#define ALIGNSIZE(x, size) ((size) * (1 + (((x)-1)/(size)))) +#define ALIGNWORD(x) ALIGNSIZE(x, sizeof(apc_word_t)) +/* }}} */ + +/* +* The following macros help to implement APC SMA in a few easy steps: +* 1) call apc_sma_api_decl(name) to intialize an APC SMA by the given name in a global project header +* 2) call apc_sma_api_impl(name) to implement the APC SMA in a compilation unit +* 3) call apc_sma_api_extern(name) in any compilation unit without direct access to your SMA +* +* you can now call name.malloc, name.free etc from anywhere in your application, and there is no margin for error +* your extension should call name.init during MINIT and name.cleanup during MSHUTDOWN +*/ + +/* {{{ Implementor macros */ +#define apc_sma_api_name(name) name +#define apc_sma_api_ptr(name) &apc_sma_api_name(name) +#define apc_sma_api_func(name, func) name##_##func + +/* {{{ Call in a header somewhere to extern all sma functions */ +#define apc_sma_api_decl(name) \ + PHP_APCU_API void apc_sma_api_func(name, init)(zend_uint num, zend_ulong size, char* mask TSRMLS_DC); \ + PHP_APCU_API void apc_sma_api_func(name, cleanup)(TSRMLS_D); \ + PHP_APCU_API void* apc_sma_api_func(name, malloc)(zend_ulong size TSRMLS_DC); \ + PHP_APCU_API void* apc_sma_api_func(name, malloc_ex)(zend_ulong size, zend_ulong fragment, zend_ulong* allocated TSRMLS_DC); \ + PHP_APCU_API void* apc_sma_api_func(name, realloc)(void* p, zend_ulong size TSRMLS_DC); \ + PHP_APCU_API char* apc_sma_api_func(name, strdup)(const char* s TSRMLS_DC); \ + PHP_APCU_API void apc_sma_api_func(name, free)(void* p TSRMLS_DC); \ + PHP_APCU_API void* apc_sma_api_func(name, protect)(void* p); \ + PHP_APCU_API void* apc_sma_api_func(name, unprotect)(void* p); \ + PHP_APCU_API apc_sma_info_t* apc_sma_api_func(name, info)(zend_bool limited TSRMLS_DC); \ + PHP_APCU_API void apc_sma_api_func(name, free_info)(apc_sma_info_t* info TSRMLS_DC); \ + PHP_APCU_API zend_ulong apc_sma_api_func(name, get_avail_mem)(void); \ + PHP_APCU_API zend_bool apc_sma_api_func(name, get_avail_size)(zend_ulong size); \ + PHP_APCU_API void apc_sma_api_func(name, check_integrity)(void); /* }}} */ + +/* {{{ Call in a compilation unit */ +#define apc_sma_api_impl(name, data, expunge) \ + apc_sma_t apc_sma_api_name(name) = {0, \ + &apc_sma_api_func(name, init), \ + &apc_sma_api_func(name, cleanup), \ + &apc_sma_api_func(name, malloc), \ + &apc_sma_api_func(name, malloc_ex), \ + &apc_sma_api_func(name, realloc), \ + &apc_sma_api_func(name, strdup), \ + &apc_sma_api_func(name, free), \ + &apc_sma_api_func(name, protect), \ + &apc_sma_api_func(name, unprotect), \ + &apc_sma_api_func(name, info), \ + &apc_sma_api_func(name, free_info), \ + &apc_sma_api_func(name, get_avail_mem), \ + &apc_sma_api_func(name, get_avail_size), \ + &apc_sma_api_func(name, check_integrity), \ + }; \ + PHP_APCU_API void apc_sma_api_func(name, init)(zend_uint num, zend_ulong size, char* mask TSRMLS_DC) \ + { apc_sma_api_init(apc_sma_api_ptr(name), (void**) data, (apc_sma_expunge_f) expunge, num, size, mask TSRMLS_CC); } \ + PHP_APCU_API void apc_sma_api_func(name, cleanup)(TSRMLS_D) \ + { apc_sma_api_cleanup(apc_sma_api_ptr(name) TSRMLS_CC); } \ + PHP_APCU_API void* apc_sma_api_func(name, malloc)(zend_ulong size TSRMLS_DC) \ + { return apc_sma_api_malloc(apc_sma_api_ptr(name), size TSRMLS_CC); } \ + PHP_APCU_API void* apc_sma_api_func(name, malloc_ex)(zend_ulong size, zend_ulong fragment, zend_ulong* allocated TSRMLS_DC) \ + { return apc_sma_api_malloc_ex(apc_sma_api_ptr(name), size, fragment, allocated TSRMLS_CC); } \ + PHP_APCU_API void* apc_sma_api_func(name, realloc)(void* p, zend_ulong size TSRMLS_DC) \ + { return apc_sma_api_realloc(apc_sma_api_ptr(name), p, size TSRMLS_CC); } \ + PHP_APCU_API char* apc_sma_api_func(name, strdup)(const char* s TSRMLS_DC) \ + { return apc_sma_api_strdup(apc_sma_api_ptr(name), s TSRMLS_CC); } \ + PHP_APCU_API void apc_sma_api_func(name, free)(void* p TSRMLS_DC) \ + { apc_sma_api_free(apc_sma_api_ptr(name), p TSRMLS_CC); } \ + PHP_APCU_API void* apc_sma_api_func(name, protect)(void* p) \ + { return apc_sma_api_protect(apc_sma_api_ptr(name), p); } \ + PHP_APCU_API void* apc_sma_api_func(name, unprotect)(void* p) \ + { return apc_sma_api_unprotect(apc_sma_api_ptr(name), p); } \ + PHP_APCU_API apc_sma_info_t* apc_sma_api_func(name, info)(zend_bool limited TSRMLS_DC) \ + { return apc_sma_api_info(apc_sma_api_ptr(name), limited TSRMLS_CC); } \ + PHP_APCU_API void apc_sma_api_func(name, free_info)(apc_sma_info_t* info TSRMLS_DC) \ + { apc_sma_api_free_info(apc_sma_api_ptr(name), info TSRMLS_CC); } \ + PHP_APCU_API zend_ulong apc_sma_api_func(name, get_avail_mem)() \ + { return apc_sma_api_get_avail_mem(apc_sma_api_ptr(name)); } \ + PHP_APCU_API zend_bool apc_sma_api_func(name, get_avail_size)(zend_ulong size) \ + { return apc_sma_api_get_avail_size(apc_sma_api_ptr(name), size); } \ + PHP_APCU_API void apc_sma_api_func(name, check_integrity)() \ + { apc_sma_api_check_integrity(apc_sma_api_ptr(name)); } /* }}} */ + +/* {{{ Call wherever access to the SMA object is required */ +#define apc_sma_api_extern(name) extern apc_sma_t apc_sma_api_name(name) /* }}} */ + +/* }}} */ + +#endif + diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_sma.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_sma.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_sma.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_sma.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,669 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + | 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. + + */ + +/* $Id: apc_sma.c 328896 2012-12-26 05:28:14Z laruence $ */ + +#include "apc_sma.h" +#include "apc.h" +#include "apc_globals.h" +#include "apc_lock.h" +#include "apc_shm.h" +#include "apc_cache.h" + +#include +#include "apc_mmap.h" + +#ifdef APC_SMA_DEBUG +# ifdef HAVE_VALGRIND_MEMCHECK_H +# include +# endif +# define APC_SMA_CANARIES 1 +#endif + +enum { + DEFAULT_NUMSEG=1, + DEFAULT_SEGSIZE=30*1024*1024 }; + +typedef struct sma_header_t sma_header_t; +struct sma_header_t { + apc_lock_t sma_lock; /* segment lock */ + size_t segsize; /* size of entire segment */ + size_t avail; /* bytes available (not necessarily contiguous) */ +}; + +#define SMA_HDR(sma, i) ((sma_header_t*)((sma->segs[i]).shmaddr)) +#define SMA_ADDR(sma, i) ((char*)(SMA_HDR(sma, i))) +#define SMA_RO(sma, i) ((char*)(sma->segs[i]).roaddr) +#define SMA_LCK(sma, i) ((SMA_HDR(sma, i))->sma_lock) + +#if 0 +/* global counter for identifying blocks + * Technically it is possible to do the same + * using offsets, but double allocations of the + * same offset can happen. */ +static volatile size_t block_id = 0; +#endif + +typedef struct block_t block_t; +struct block_t { + size_t size; /* size of this block */ + size_t prev_size; /* size of sequentially previous block, 0 if prev is allocated */ + size_t fnext; /* offset in segment of next free block */ + size_t fprev; /* offset in segment of prev free block */ +#ifdef APC_SMA_CANARIES + size_t canary; /* canary to check for memory overwrites */ +#endif +#if 0 + size_t id; /* identifier for the memory block */ +#endif +}; + +/* The macros BLOCKAT and OFFSET are used for convenience throughout this + * module. Both assume the presence of a variable shmaddr that points to the + * beginning of the shared memory segment in question. */ + +#define BLOCKAT(offset) ((block_t*)((char *)shmaddr + offset)) +#define OFFSET(block) ((size_t)(((char*)block) - (char*)shmaddr)) + +/* macros for getting the next or previous sequential block */ +#define NEXT_SBLOCK(block) ((block_t*)((char*)block + block->size)) +#define PREV_SBLOCK(block) (block->prev_size ? ((block_t*)((char*)block - block->prev_size)) : NULL) + +/* Canary macros for setting, checking and resetting memory canaries */ +#ifdef APC_SMA_CANARIES + #define SET_CANARY(v) (v)->canary = 0x42424242 + #define CHECK_CANARY(v) assert((v)->canary == 0x42424242) + #define RESET_CANARY(v) (v)->canary = -42 +#else + #define SET_CANARY(v) + #define CHECK_CANARY(v) + #define RESET_CANARY(v) +#endif + +/* {{{ MINBLOCKSIZE */ +#define MINBLOCKSIZE (ALIGNWORD(1) + ALIGNWORD(sizeof(block_t))) +/* }}} */ + +/* {{{ sma_allocate: tries to allocate at least size bytes in a segment */ +static APC_HOTSPOT size_t sma_allocate(sma_header_t* header, zend_ulong size, zend_ulong fragment, zend_ulong *allocated) +{ + void* shmaddr; /* header of shared memory segment */ + block_t* prv; /* block prior to working block */ + block_t* cur; /* working block in list */ + block_t* prvnextfit; /* block before next fit */ + size_t realsize; /* actual size of block needed, including header */ + const size_t block_size = ALIGNWORD(sizeof(struct block_t)); + + realsize = ALIGNWORD(size + block_size); + + /* + * First, insure that the segment contains at least realsize free bytes, + * even if they are not contiguous. + */ + shmaddr = header; + + if (header->avail < realsize) { + return -1; + } + + prvnextfit = 0; /* initially null (no fit) */ + prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); + + CHECK_CANARY(prv); + + while (prv->fnext != 0) { + cur = BLOCKAT(prv->fnext); + + CHECK_CANARY(cur); + + /* If it can fit realsize bytes in cur block, stop searching */ + if (cur->size >= realsize) { + prvnextfit = prv; + break; + } + prv = cur; + } + + if (prvnextfit == 0) { + return -1; + } + + prv = prvnextfit; + cur = BLOCKAT(prv->fnext); + + CHECK_CANARY(prv); + CHECK_CANARY(cur); + + if (cur->size == realsize || (cur->size > realsize && cur->size < (realsize + (MINBLOCKSIZE + fragment)))) { + /* cur is big enough for realsize, but too small to split - unlink it */ + *(allocated) = cur->size - block_size; + prv->fnext = cur->fnext; + BLOCKAT(cur->fnext)->fprev = OFFSET(prv); + NEXT_SBLOCK(cur)->prev_size = 0; /* block is alloc'd */ + } else { + /* nextfit is too big; split it into two smaller blocks */ + block_t* nxt; /* the new block (chopped part of cur) */ + size_t oldsize; /* size of cur before split */ + + oldsize = cur->size; + cur->size = realsize; + *(allocated) = cur->size - block_size; + nxt = NEXT_SBLOCK(cur); + nxt->prev_size = 0; /* block is alloc'd */ + nxt->size = oldsize - realsize; /* and fix the size */ + NEXT_SBLOCK(nxt)->prev_size = nxt->size; /* adjust size */ + SET_CANARY(nxt); + + /* replace cur with next in free list */ + nxt->fnext = cur->fnext; + nxt->fprev = cur->fprev; + BLOCKAT(nxt->fnext)->fprev = OFFSET(nxt); + BLOCKAT(nxt->fprev)->fnext = OFFSET(nxt); +#if 0 + nxt->id = -1; +#endif + } + + cur->fnext = 0; + + /* update the block header */ + header->avail -= cur->size; + + SET_CANARY(cur); + +#if 0 + cur->id = ++block_id; + fprintf(stderr, "allocate(realsize=%d,size=%d,id=%d)\n", (int)(size), (int)(cur->size), cur->id); +#endif + + return OFFSET(cur) + block_size; +} +/* }}} */ + +/* {{{ sma_deallocate: deallocates the block at the given offset */ +static APC_HOTSPOT size_t sma_deallocate(void* shmaddr, size_t offset) +{ + sma_header_t* header; /* header of shared memory segment */ + block_t* cur; /* the new block to insert */ + block_t* prv; /* the block before cur */ + block_t* nxt; /* the block after cur */ + size_t size; /* size of deallocated block */ + + offset -= ALIGNWORD(sizeof(struct block_t)); + assert(offset >= 0); + + /* find position of new block in free list */ + cur = BLOCKAT(offset); + + /* update the block header */ + header = (sma_header_t*) shmaddr; + header->avail += cur->size; + size = cur->size; + + if (cur->prev_size != 0) { + /* remove prv from list */ + prv = PREV_SBLOCK(cur); + BLOCKAT(prv->fnext)->fprev = prv->fprev; + BLOCKAT(prv->fprev)->fnext = prv->fnext; + /* cur and prv share an edge, combine them */ + prv->size +=cur->size; + + RESET_CANARY(cur); + cur = prv; + } + + nxt = NEXT_SBLOCK(cur); + if (nxt->fnext != 0) { + assert(NEXT_SBLOCK(NEXT_SBLOCK(cur))->prev_size == nxt->size); + /* cur and nxt shared an edge, combine them */ + BLOCKAT(nxt->fnext)->fprev = nxt->fprev; + BLOCKAT(nxt->fprev)->fnext = nxt->fnext; + cur->size += nxt->size; + + CHECK_CANARY(nxt); + +#if 0 + nxt->id = -1; /* assert this or set it ? */ +#endif + + RESET_CANARY(nxt); + } + + NEXT_SBLOCK(cur)->prev_size = cur->size; + + /* insert new block after prv */ + prv = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); + cur->fnext = prv->fnext; + prv->fnext = OFFSET(cur); + cur->fprev = OFFSET(prv); + BLOCKAT(cur->fnext)->fprev = OFFSET(cur); + + return size; +} +/* }}} */ + +/* {{{ APC SMA API */ +PHP_APCU_API void apc_sma_api_init(apc_sma_t* sma, void** data, apc_sma_expunge_f expunge, zend_uint num, zend_ulong size, char *mask TSRMLS_DC) { + uint i; + + if (sma->initialized) { + return; + } + + sma->initialized = 1; + sma->expunge = expunge; + sma->data = data; + +#if APC_MMAP + /* + * I don't think multiple anonymous mmaps makes any sense + * so force sma_numseg to 1 in this case + */ + if(!mask || + (mask && !strlen(mask)) || + (mask && !strcmp(mask, "/dev/zero"))) { + sma->num = 1; + } else { + sma->num = num > 0 ? num : DEFAULT_NUMSEG; + } +#else + sma->num = num > 0 ? num : DEFAULT_NUMSEG; +#endif + + sma->size = size > 0 ? size : DEFAULT_SEGSIZE; + + sma->segs = (apc_segment_t*) apc_emalloc((sma->num * sizeof(apc_segment_t)) TSRMLS_CC); + + for (i = 0; i < sma->num; i++) { + sma_header_t* header; + block_t *first, *empty, *last; + void* shmaddr; + +#if APC_MMAP + sma->segs[i] = apc_mmap(mask, sma->size TSRMLS_CC); + if(sma->num != 1) + memcpy(&mask[strlen(mask)-6], "XXXXXX", 6); +#else + sma->segs[i] = apc_shm_attach( + apc_shm_create(i, sma->size TSRMLS_CC), + sma->size TSRMLS_CC + ); +#endif + + sma->segs[i].size = sma->size; + + shmaddr = sma->segs[i].shmaddr; + + header = (sma_header_t*) shmaddr; + CREATE_LOCK(&header->sma_lock); + header->segsize = sma->size; + header->avail = sma->size - ALIGNWORD(sizeof(sma_header_t)) - ALIGNWORD(sizeof(block_t)) - ALIGNWORD(sizeof(block_t)); + + first = BLOCKAT(ALIGNWORD(sizeof(sma_header_t))); + first->size = 0; + first->fnext = ALIGNWORD(sizeof(sma_header_t)) + ALIGNWORD(sizeof(block_t)); + first->fprev = 0; + first->prev_size = 0; + SET_CANARY(first); +#if 0 + first->id = -1; +#endif + empty = BLOCKAT(first->fnext); + empty->size = header->avail - ALIGNWORD(sizeof(block_t)); + empty->fnext = OFFSET(empty) + empty->size; + empty->fprev = ALIGNWORD(sizeof(sma_header_t)); + empty->prev_size = 0; + SET_CANARY(empty); +#if 0 + empty->id = -1; +#endif + last = BLOCKAT(empty->fnext); + last->size = 0; + last->fnext = 0; + last->fprev = OFFSET(empty); + last->prev_size = empty->size; + SET_CANARY(last); +#if 0 + last->id = -1; +#endif + } +} + +PHP_APCU_API void apc_sma_api_cleanup(apc_sma_t* sma TSRMLS_DC) { + uint i; + + assert(sma->initialized); + + for (i = 0; i < sma->num; i++) { + DESTROY_LOCK(&SMA_LCK(sma, i)); +#if APC_MMAP + apc_unmap(&sma->segs[i] TSRMLS_CC); +#else + apc_shm_detach(&sma->segs[i] TSRMLS_CC); +#endif + } + sma->initialized = 0; + + apc_efree(sma->segs TSRMLS_CC); +} + +PHP_APCU_API void* apc_sma_api_malloc_ex(apc_sma_t* sma, zend_ulong n, zend_ulong fragment, zend_ulong* allocated TSRMLS_DC) { + size_t off; + uint i; + int nuked = 0; + +restart: + assert(sma->initialized); + + WLOCK(&SMA_LCK(sma, sma->last)); + + off = sma_allocate(SMA_HDR(sma, sma->last), n, fragment, allocated); + + if(off == -1) { + /* retry failed allocation after we expunge */ + WUNLOCK(&SMA_LCK(sma, sma->last)); + sma->expunge( + *(sma->data), (n+fragment) TSRMLS_CC); + WLOCK(&SMA_LCK(sma, sma->last)); + off = sma_allocate(SMA_HDR(sma, sma->last), n, fragment, allocated); + } + + if (off != -1) { + void* p = (void *)(SMA_ADDR(sma, sma->last) + off); + WUNLOCK(&SMA_LCK(sma, sma->last)); +#ifdef VALGRIND_MALLOCLIKE_BLOCK + VALGRIND_MALLOCLIKE_BLOCK(p, n, 0, 0); +#endif + return p; + } + + WUNLOCK(&SMA_LCK(sma, sma->last)); + + for (i = 0; i < sma->num; i++) { + if (i == sma->last) { + continue; + } + WLOCK(&SMA_LCK(sma, i)); + off = sma_allocate(SMA_HDR(sma, i), n, fragment, allocated); + if(off == -1) { + /* retry failed allocation after we expunge */ + WUNLOCK(&SMA_LCK(sma, i)); + sma->expunge( + *(sma->data), (n+fragment) TSRMLS_CC); + WLOCK(&SMA_LCK(sma, i)); + off = sma_allocate(SMA_HDR(sma, i), n, fragment, allocated); + } + if (off != -1) { + void* p = (void *)(SMA_ADDR(sma, i) + off); + WUNLOCK(&SMA_LCK(sma, i)); + sma->last = i; +#ifdef VALGRIND_MALLOCLIKE_BLOCK + VALGRIND_MALLOCLIKE_BLOCK(p, n, 0, 0); +#endif + return p; + } + WUNLOCK(&SMA_LCK(sma, i)); + } + + /* I've tried being nice, but now you're just asking for it */ + if(!nuked) { + sma->expunge(*(sma->data), (n+fragment) TSRMLS_CC); + nuked = 1; + goto restart; + } + + /* now, I've truly and well given up */ + + return NULL; +} + +PHP_APCU_API void* apc_sma_api_malloc(apc_sma_t* sma, zend_ulong n TSRMLS_DC) +{ + zend_ulong allocated; + return apc_sma_api_malloc_ex( + sma, n, MINBLOCKSIZE, &allocated TSRMLS_CC); +} + +PHP_APCU_API void* apc_sma_api_realloc(apc_sma_t* sma, void* p, zend_ulong n TSRMLS_DC) { + apc_sma_api_free(sma, p TSRMLS_CC); + return apc_sma_api_malloc( + sma, n TSRMLS_CC); +} + +PHP_APCU_API char* apc_sma_api_strdup(apc_sma_t* sma, const char* s TSRMLS_DC) { + void* q; + int len; + + if(!s) { + return NULL; + } + + len = strlen(s)+1; + q = apc_sma_api_malloc( + sma, len TSRMLS_CC); + + if(!q) { + return NULL; + } + + memcpy(q, s, len); + return q; +} + +PHP_APCU_API void apc_sma_api_free(apc_sma_t* sma, void* p TSRMLS_DC) { + uint i; + size_t offset; + + if (p == NULL) { + return; + } + + assert(sma->initialized); + + for (i = 0; i < sma->num; i++) { + offset = (size_t)((char *)p - SMA_ADDR(sma, i)); + if (p >= (void*)SMA_ADDR(sma, i) && offset < sma->size) { + WLOCK(&SMA_LCK(sma, i)); + sma_deallocate(SMA_HDR(sma, i), offset); + WUNLOCK(&SMA_LCK(sma, i)); +#ifdef VALGRIND_FREELIKE_BLOCK + VALGRIND_FREELIKE_BLOCK(p, 0); +#endif + return; + } + } + + apc_error("apc_sma_free: could not locate address %p" TSRMLS_CC, p); +} + +#ifdef APC_MEMPROTECT +PHP_APCU_API void* apc_sma_api_protect(apc_sma_t* sma, void* p) { + unsigned int i = 0; + size_t offset; + + if (p == NULL) { + return NULL; + } + + if(SMA_RO(sma, sma->last) == NULL) return p; + + offset = (size_t)((char *)p - SMA_ADDR(sma, sma->last)); + + if(p >= (void*)SMA_ADDR(sma, sma->last) && offset < sma->size) { + return SMA_RO(sma, sma->last) + offset; + } + + for (i = 0; i < sma->num; i++) { + offset = (size_t)((char *)p - SMA_ADDR(sma, i)); + if (p >= (void*)SMA_ADDR(sma, i) && offset < sma->size) { + return SMA_RO(sma, i) + offset; + } + } + + return NULL; +} + +PHP_APCU_API void* apc_sma_api_unprotect(apc_sma_t* sma, void* p){ + unsigned int i = 0; + size_t offset; + + if (p == NULL) { + return NULL; + } + + if(SMA_RO(sma, sma->last) == NULL) return p; + + offset = (size_t)((char *)p - SMA_RO(sma, sma->last)); + + if(p >= (void*)SMA_RO(sma, sma->last) && offset < sma->size) { + return SMA_ADDR(sma, sma->last) + offset; + } + + for (i = 0; i < sma->num; i++) { + offset = (size_t)((char *)p - SMA_RO(sma, i)); + if (p >= (void*)SMA_RO(sma, i) && offset < sma->size) { + return SMA_ADDR(sma, i) + offset; + } + } + + return NULL; +} +#else +PHP_APCU_API void* apc_sma_api_protect(apc_sma_t* sma, void *p) { return p; } +PHP_APCU_API void* apc_sma_api_unprotect(apc_sma_t* sma, void *p) { return p; } +#endif + +PHP_APCU_API apc_sma_info_t* apc_sma_api_info(apc_sma_t* sma, zend_bool limited TSRMLS_DC) { + apc_sma_info_t* info; + apc_sma_link_t** link; + uint i; + char* shmaddr; + block_t* prv; + + if (!sma->initialized) { + return NULL; + } + + info = (apc_sma_info_t*) apc_emalloc(sizeof(apc_sma_info_t) TSRMLS_CC); + info->num_seg = sma->num; + info->seg_size = sma->size - (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*) TSRMLS_CC); + for (i = 0; i < sma->num; i++) { + info->list[i] = NULL; + } + + if(limited) { + return info; + } + + /* For each segment */ + for (i = 0; i < sma->num; i++) { + RLOCK(&SMA_LCK(sma, i)); + shmaddr = SMA_ADDR(sma, 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); + + CHECK_CANARY(cur); + + *link = apc_emalloc(sizeof(apc_sma_link_t) TSRMLS_CC); + (*link)->size = cur->size; + (*link)->offset = prv->fnext; + (*link)->next = NULL; + link = &(*link)->next; + + prv = cur; + } + RUNLOCK(&SMA_LCK(sma, i)); + } + + return info; +} + +PHP_APCU_API void apc_sma_api_free_info(apc_sma_t* sma, apc_sma_info_t* info TSRMLS_DC) { + 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 TSRMLS_CC); + } + } + apc_efree(info->list TSRMLS_CC); + apc_efree(info TSRMLS_CC); +} + +PHP_APCU_API zend_ulong apc_sma_api_get_avail_mem(apc_sma_t* sma) { + size_t avail_mem = 0; + uint i; + + for (i = 0; i < sma->num; i++) { + sma_header_t* header = SMA_HDR(sma, i); + avail_mem += header->avail; + } + return avail_mem; +} + +PHP_APCU_API zend_bool apc_sma_api_get_avail_size(apc_sma_t* sma, size_t size) { + uint i; + + for (i = 0; i < sma->num; i++) { + sma_header_t* header = SMA_HDR(sma, i); + if (header->avail > size) { + return 1; + } + } + return 0; +} + +PHP_APCU_API void apc_sma_api_check_integrity(apc_sma_t* sma) +{ + /* dummy */ +} + +/* {{{ APC SMA */ +apc_sma_api_impl(apc_sma, &apc_user_cache, apc_cache_default_expunge); +/* }}} */ + + /* }}} */ + +/* + * 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_sma.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_sma.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_sma.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_sma.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,47 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + +----------------------------------------------------------------------+ + + 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 307048 2011-01-03 23:53:17Z kalle $ */ + +#ifndef APC_SMA_H +#define APC_SMA_H + +#include "apc.h" +#include "apc_sma_api.h" + +/* {{{ SMA APC */ +apc_sma_api_decl(apc_sma); /* }}} */ +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_stack.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_stack.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_stack.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_stack.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,106 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + +----------------------------------------------------------------------+ + + 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 307048 2011-01-03 23:53:17Z kalle $ */ + +#include "apc.h" +#include "apc_stack.h" + +struct apc_stack_t { + void** data; + int capacity; + int size; +}; + +apc_stack_t* apc_stack_create(int size_hint TSRMLS_DC) +{ + apc_stack_t* stack = (apc_stack_t*) apc_emalloc(sizeof(apc_stack_t) TSRMLS_CC); + + stack->capacity = (size_hint > 0) ? size_hint : 10; + stack->size = 0; + stack->data = (void**) apc_emalloc(sizeof(void*) * stack->capacity TSRMLS_CC); + + return stack; +} + +void apc_stack_destroy(apc_stack_t* stack TSRMLS_DC) +{ + if (stack != NULL) { + apc_efree(stack->data TSRMLS_CC); + apc_efree(stack TSRMLS_CC); + } +} + +void apc_stack_clear(apc_stack_t* stack) +{ + assert(stack != NULL); + stack->size = 0; +} + +void apc_stack_push(apc_stack_t* stack, void* item TSRMLS_DC) +{ + assert(stack != NULL); + if (stack->size == stack->capacity) { + stack->capacity *= 2; + stack->data = apc_erealloc(stack->data, sizeof(void*)*stack->capacity TSRMLS_CC); + } + 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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_stack.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_stack.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_stack.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_stack.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,58 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + | George Schlossnagle | + +----------------------------------------------------------------------+ + + 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 307048 2011-01-03 23:53:17Z kalle $ */ + +#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 TSRMLS_DC); +extern void apc_stack_destroy(T stack TSRMLS_DC); +extern void apc_stack_clear(T stack); +extern void apc_stack_push(T stack, void* item TSRMLS_DC); +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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_windows_srwlock_kernel.c php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_windows_srwlock_kernel.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_windows_srwlock_kernel.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_windows_srwlock_kernel.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,133 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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: Pierre Joye | + +----------------------------------------------------------------------+ + */ +/* $Id$ */ +/* + These APIs are not actually exposed nor documented. But should work fine + from a binary as available since XP without signature changes. +*/ +/* +TODOs: +non blocking could be possible using the fWait argument (to 0). However +I'm not sure whether the wait handlers is actually implemented in all +supported platforms (xp+). could be enabled later once really tested. + */ +/* $Id: $ */ + +#include + +#ifdef APC_SRWLOCK_KERNEL +#include "apc_windows_srwlock_kernel.h" + +/* +For references: +void WINAPI RtlInitializeResource(LPRTL_RWLOCK rwl); +void WINAPI RtlDeleteResource(LPRTL_RWLOCK rwl); +BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK rwl, BYTE fWait); +BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK rwl, BYTE fWait); +void WINAPI RtlReleaseResource(LPRTL_RWLOCK rwl); +*/ +typedef void (WINAPI *tRtlInitializeResource)(LPRTL_RWLOCK rwl); +typedef void (WINAPI *tRtlDeleteResource)(LPRTL_RWLOCK rwl); +typedef BYTE (WINAPI *tRtlAcquireResourceExclusive)(LPRTL_RWLOCK rwl, BYTE fWait); +typedef BYTE (WINAPI *tRtlAcquireResourceShared)(LPRTL_RWLOCK rwl, BYTE fWait); +typedef void (WINAPI *tRtlReleaseResource)(LPRTL_RWLOCK rwl); +typedef void (WINAPI *tRtlDumpResource)(LPRTL_RWLOCK rwl); + +tRtlInitializeResource pRtlInitializeResource = 0; +tRtlDeleteResource pRtlDeleteResource = 0; +tRtlAcquireResourceExclusive pRtlAcquireResourceExclusive = 0; +tRtlAcquireResourceShared pRtlAcquireResourceShared = 0; +tRtlReleaseResource pRtlReleaseResource = 0; +tRtlDumpResource pRtlDumpResource = 0; + +HINSTANCE ntdll; + +void apc_windows_cs_status(apc_windows_cs_rwlock_t *lock ); +apc_windows_cs_rwlock_t *apc_windows_cs_create(apc_windows_cs_rwlock_t *lock TSRMLS_DC) +{ + ntdll = LoadLibrary("ntdll.dll"); + if (ntdll == 0) { + return NULL; + } + + pRtlInitializeResource = (tRtlInitializeResource) GetProcAddress(ntdll, "RtlInitializeResource"); + pRtlDeleteResource = (tRtlDeleteResource) GetProcAddress(ntdll, "RtlDeleteResource"); + pRtlAcquireResourceExclusive = (tRtlAcquireResourceExclusive) GetProcAddress(ntdll, "RtlAcquireResourceExclusive"); + pRtlAcquireResourceShared = (tRtlAcquireResourceShared) GetProcAddress(ntdll, "RtlAcquireResourceShared"); + pRtlReleaseResource = (tRtlReleaseResource) GetProcAddress(ntdll, "RtlReleaseResource"); + pRtlDumpResource = (tRtlReleaseResource) GetProcAddress(ntdll, "RtlDumpResource"); + if (pRtlInitializeResource == 0 || pRtlDeleteResource == 0 || pRtlAcquireResourceExclusive == 0 || + pRtlAcquireResourceShared == 0 || pRtlReleaseResource == 0 || pRtlDumpResource == 0) { + return NULL; + } + pRtlInitializeResource(lock); + return lock; +} + +void apc_windows_cs_destroy(apc_windows_cs_rwlock_t *lock) +{ + __try + { + pRtlDeleteResource(lock); + } + __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + /* Ignore exception (resource was freed during shutdown of another thread) */ + } + FreeLibrary(ntdll); + return; +} + +void apc_windows_cs_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC) +{ + pRtlAcquireResourceExclusive(lock, 1); +} + +void apc_windows_cs_rdlock(apc_windows_cs_rwlock_t *lock TSRMLS_DC) +{ + pRtlAcquireResourceShared(lock, 1); +} + +void apc_windows_cs_unlock_rd(apc_windows_cs_rwlock_t *lock TSRMLS_DC) +{ + pRtlReleaseResource(lock); +} + +void apc_windows_cs_unlock_wr(apc_windows_cs_rwlock_t *lock TSRMLS_DC) +{ + pRtlReleaseResource(lock); +} + +/* debugging purposes, output using trace msgs */ +void apc_windows_cs_status(apc_windows_cs_rwlock_t *lock) +{ + pRtlDumpResource(lock); + return; +} + +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_windows_srwlock_kernel.h php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_windows_srwlock_kernel.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/apc_windows_srwlock_kernel.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/apc_windows_srwlock_kernel.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,74 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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: Pierre Joye | + +----------------------------------------------------------------------+ + */ +/* $Id$ */ + +#ifndef APC_WINDOWS_CS_RWLOCK_H +#define APC_WINDOWS_CS_RWLOCK_H + +#include "apc.h" + +#ifdef APC_SRWLOCK_KERNEL + +typedef struct _RTL_RWLOCK { + RTL_CRITICAL_SECTION rtlCS; + + HANDLE hSharedReleaseSemaphore; + UINT uSharedWaiters; + + HANDLE hExclusiveReleaseSemaphore; + UINT uExclusiveWaiters; + + INT iNumberActive; + HANDLE hOwningThreadId; + DWORD dwTimeoutBoost; + PVOID pDebugInfo; +} RTL_RWLOCK, *LPRTL_RWLOCK; + +#define apc_windows_cs_rwlock_t RTL_RWLOCK + +struct apc_windows_cs_rwlock_t { + CRITICAL_SECTION cs; + LONG writers_waiting_count; + LONG readers_waiting_count; + DWORD active_writers_readers_flag; + HANDLE ready_to_read; + HANDLE ready_to_write; + DWORD reader_races_lost; +}; + +apc_windows_cs_rwlock_t *apc_windows_cs_create(apc_windows_cs_rwlock_t *lock TSRMLS_DC); +void apc_windows_cs_destroy(apc_windows_cs_rwlock_t *lock); +void apc_windows_cs_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); +void apc_windows_cs_rdlock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); +void apc_windows_cs_unlock_rd(apc_windows_cs_rwlock_t *lock TSRMLS_DC); +void apc_windows_cs_unlock_wr(apc_windows_cs_rwlock_t *lock TSRMLS_DC); +# if NONBLOCKING_LOCK_AVAILABLE==1 /* Only in win7/2008 */ +zend_bool apc_pthreadrwlock_nonblocking_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC); +# endif +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/config.m4 php5-easybib-apcu-4.0.7/apcu-4.0.7/config.m4 --- php5-easybib-apcu-4.0.6/apcu-4.0.7/config.m4 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/config.m4 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,325 @@ +dnl +dnl $Id: config.m4 327593 2012-09-10 11:50:58Z pajoye $ +dnl +PHP_ARG_ENABLE(apcu, whether to enable APCu support, +[ --enable-apcu Enable APCu support]) + +PHP_APC_BC=yes +AC_MSG_CHECKING(if APCu should provide APC full compatibility support) +AC_ARG_ENABLE(apc-bc, +[ --enable-apc-bc Enable APC full compatibility support], +[ if test "x$enableval" = "xno"; then + PHP_APC_BC=no + else + PHP_APC_BC=yes + fi +]) +AC_MSG_RESULT($PHP_APC_BC) + +AC_MSG_CHECKING(if APCu should be allowed to use rwlocks) +AC_ARG_ENABLE(apcu-rwlocks, +[ --disable-apcu-rwlocks Disable rwlocks in APCu], +[ + PHP_APCU_RWLOCKS=no + AC_MSG_RESULT(no) +], +[ + PHP_APCU_RWLOCKS=yes + AC_MSG_RESULT(yes) +]) + +AC_MSG_CHECKING(if APCu should be built in debug mode) +AC_ARG_ENABLE(apcu-debug, +[ --enable-apcu-debug Enable APCu debugging], +[ + PHP_APCU_DEBUG=$enableval +], +[ + PHP_APCU_DEBUG=no +]) +AC_MSG_RESULT($PHP_APCU_DEBUG) + +AC_MSG_CHECKING(if APCu should clear on SIGUSR1) +AC_ARG_ENABLE(apcu-clear-signal, +[ --enable-apcu-clear-signal Enable SIGUSR1 clearing handler], +[ + AC_DEFINE(APC_CLEAR_SIGNAL, 1, [ ]) + AC_MSG_RESULT(yes) +], +[ + AC_MSG_RESULT(no) +]) + +AC_MSG_CHECKING(if APCu will use mmap or shm) +AC_ARG_ENABLE(apcu-mmap, +[ --disable-apcu-mmap Disable mmap, falls back on shm], +[ + PHP_APCU_MMAP=no + AC_MSG_RESULT(shm) +], [ + PHP_APCU_MMAP=yes + AC_MSG_RESULT(mmap) +]) + +PHP_APCU_SPINLOCK=no +AC_MSG_CHECKING(if APCu should utilize spinlocks before flocks) +AC_ARG_ENABLE(apcu-spinlocks, +[ --enable-apcu-spinlocks Use spinlocks before flocks], +[ if test "x$enableval" = "xno"; then + PHP_APCU_SPINLOCK=no + else + PHP_APCU_SPINLOCK=yes + fi +]) +AC_MSG_RESULT($PHP_APCU_SPINLOCK) + +if test "$PHP_APCU" != "no"; then + if test "$PHP_APC_BC" != "no"; then + AC_DEFINE(APC_FULL_BC, 1, [APC full compatibility support]) + fi + if test "$PHP_APCU_DEBUG" != "no"; then + AC_DEFINE(APC_DEBUG, 1, [ ]) + fi + + if test "$PHP_APCU_MMAP" != "no"; then + AC_DEFINE(APC_MMAP, 1, [ ]) + fi + + if test "$PHP_APCU_RWLOCKS" != "no"; then + orig_LIBS="$LIBS" + LIBS="$LIBS -lpthread" + AC_TRY_RUN( + [ + #include + #include + main() { + pthread_rwlock_t rwlock; + pthread_rwlockattr_t attr; + + if(pthread_rwlockattr_init(&attr)) { + puts("Unable to initialize pthread attributes (pthread_rwlockattr_init)."); + return -1; + } + if(pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) { + puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_rwlockattr_setpshared), your system may not support shared rwlock's."); + return -1; + } + if(pthread_rwlock_init(&rwlock, &attr)) { + puts("Unable to initialize the rwlock (pthread_rwlock_init)."); + return -1; + } + if(pthread_rwlockattr_destroy(&attr)) { + puts("Unable to destroy rwlock attributes (pthread_rwlockattr_destroy)."); + return -1; + } + if(pthread_rwlock_destroy(&rwlock)) { + puts("Unable to destroy rwlock (pthread_rwlock_destroy)."); + return -1; + } + + return 0; + } + ], + [ dnl -Success- + APCU_CFLAGS="-D_GNU_SOURCE" + PHP_ADD_LIBRARY(pthread) + PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" + AC_DEFINE(APC_NATIVE_RWLOCK, 1, [ ]) + AC_MSG_WARN([APCu has access to native rwlocks]) + ], + [ dnl -Failure- + AC_MSG_WARN([It doesn't appear that pthread rwlocks are supported on your system]) + PHP_APCU_RWLOCKS=no + ], + [ + APCU_CFLAGS="-D_GNU_SOURCE" + PHP_ADD_LIBRARY(pthread) + PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" + ] + ) + LIBS="$orig_LIBS" + fi + + if test "$PHP_APCU_RWLOCKS" == "no"; then + orig_LIBS="$LIBS" + LIBS="$LIBS -lpthread" + AC_TRY_RUN( + [ + #include + #include + 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; + } + return 0; + } + ], + [ dnl -Success- + APCU_CFLAGS="-D_GNU_SOURCE" + PHP_ADD_LIBRARY(pthread) + PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" + AC_MSG_WARN([APCu has access to mutexes]) + ], + [ dnl -Failure- + AC_MSG_WARN([It doesn't appear that pthread mutexes are supported on your system]) + PHP_APCU_MUTEX=no + ], + [ + APCU_CFLAGS="-D_GNU_SOURCE" + PHP_ADD_LIBRARY(pthread) + PHP_LDFLAGS="$PHP_LDFLAGS -lpthread" + ] + ) + LIBS="$orig_LIBS" + fi + + if test "$PHP_APCU_RWLOCKS" == "no"; then + if test "$PHP_APCU_MUTEX" == "no"; then + if test "$PHP_APCU_SPINLOCK" != "no"; then + AC_DEFINE(APC_SPIN_LOCK, 1, [ ]) + AC_MSG_WARN([APCu spin locking enabled]) + else + AC_DEFINE(APC_FCNTL_LOCK, 1, [ ]) + AC_MSG_WARN([APCu file locking enabled]) + fi + fi + fi + + AC_CHECK_FUNCS(sigaction) + AC_CACHE_CHECK(for union semun, php_cv_semun, + [ + AC_TRY_COMPILE([ +#include +#include +#include + ], [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_ARG_ENABLE(valgrind-checks, + [ --disable-valgrind-checks + Disable valgrind based memory checks], + [ + PHP_APCU_VALGRIND=no + ], [ + PHP_APCU_VALGRIND=yes + AC_CHECK_HEADER(valgrind/memcheck.h, + [AC_DEFINE([HAVE_VALGRIND_MEMCHECK_H],1, [enable valgrind memchecks])]) + ]) + + apc_sources="apc.c apc_lock.c php_apc.c \ + apc_cache.c \ + apc_mmap.c \ + apc_shm.c \ + apc_sma.c \ + apc_stack.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,,APCU_SHARED_LIBADD)]) + PHP_NEW_EXTENSION(apcu, $apc_sources, $ext_shared,, \\$(APCU_CFLAGS)) + PHP_SUBST(APCU_SHARED_LIBADD) + PHP_SUBST(APCU_CFLAGS) + PHP_SUBST(PHP_LDFLAGS) + PHP_INSTALL_HEADERS(ext/apcu, [apc.h apc_api.h apc_cache_api.h apc_lock_api.h apc_pool_api.h apc_sma_api.h apc_bin_api.h apc_serializer.h]) + AC_DEFINE(HAVE_APCU, 1, [ ]) +fi + +PHP_ARG_ENABLE(coverage, whether to include code coverage symbols, +[ --enable-coverage DEVELOPERS ONLY!!], no, no) + +if test "$PHP_COVERAGE" = "yes"; then + + if test "$GCC" != "yes"; then + AC_MSG_ERROR([GCC is required for --enable-coverage]) + fi + + dnl Check if ccache is being used + case `$php_shtool path $CC` in + *ccache*[)] gcc_ccache=yes;; + *[)] gcc_ccache=no;; + esac + + if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then + AC_MSG_ERROR([ccache must be disabled when --enable-coverage option is used. You can disable ccache by setting environment variable +CCACHE_DISABLE=1.]) + fi + + lcov_version_list="1.5 1.6 1.7 1.9" + + AC_CHECK_PROG(LCOV, lcov, lcov) + AC_CHECK_PROG(GENHTML, genhtml, genhtml) + PHP_SUBST(LCOV) + PHP_SUBST(GENHTML) + + if test "$LCOV"; then + AC_CACHE_CHECK([for lcov version], php_cv_lcov_version, [ + php_cv_lcov_version=invalid + lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` #' + for lcov_check_version in $lcov_version_list; do + if test "$lcov_version" = "$lcov_check_version"; then + php_cv_lcov_version="$lcov_check_version (ok)" + fi + done + ]) + else + lcov_msg="To enable code coverage reporting you must have one of the following LCOV versions installed: $lcov_version_list" + AC_MSG_ERROR([$lcov_msg]) + fi + + case $php_cv_lcov_version in + ""|invalid[)] + lcov_msg="You must have one of the following versions of LCOV: $lcov_version_list (found: $lcov_version)." + AC_MSG_ERROR([$lcov_msg]) + LCOV="exit 0;" + ;; + esac + + if test -z "$GENHTML"; then + AC_MSG_ERROR([Could not find genhtml from the LCOV package]) + fi + + PHP_ADD_MAKEFILE_FRAGMENT + + dnl Remove all optimization flags from CFLAGS + changequote({,}) + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` + CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` + changequote([,]) + + dnl Add the special gcc flags + CFLAGS="$CFLAGS -O0 -ggdb -fprofile-arcs -ftest-coverage" + CXXFLAGS="$CXXFLAGS -ggdb -O0 -fprofile-arcs -ftest-coverage" +fi +dnl vim: set ts=2 diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/config.w32 php5-easybib-apcu-4.0.7/apcu-4.0.7/config.w32 --- php5-easybib-apcu-4.0.6/apcu-4.0.7/config.w32 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/config.w32 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,37 @@ +// $Id: config.w32 309203 2011-03-14 06:47:16Z pajoye $ +// vim:ft=javascript + +ARG_ENABLE('apcu', 'Whether to enable APCu support', 'no'); +ARG_ENABLE('apcu-debug', 'Whether to enable APCu debugging', 'no'); +ARG_ENABLE('apc-bc', 'Whether APCu should provide APC full compatibility support', 'yes'); + +if(PHP_APCU != 'no') +{ + var apc_sources = 'apc.c php_apc.c apc_cache.c ' + + 'apc_iterator.c apc_shm.c apc_lock.c ' + + 'apc_sma.c apc_stack.c apc_rfc1867.c apc_pool.c ' + + 'apc_bin.c apc_windows_srwlock_kernel.c'; + + if(PHP_APCU_DEBUG != 'no') + { + ADD_FLAG('CFLAGS_APC', '/D APC_DEBUG=1'); + } + + /* XXX srwlock kernel as most BC compatible for now */ + AC_DEFINE('APC_SRWLOCK_KERNEL', 1); + ADD_FLAG('CFLAGS_APC', '/D WIN32_ONLY_COMPILER=1'); + + AC_DEFINE('HAVE_APCU', 1); + + if (PHP_APC_BC != 'no') + { + AC_DEFINE('APC_FULL_BC', 1); + MESSAGE("APCu: full APC compatibility is enabled"); + } else { + WARNING("APCu: full APC compatibility is NOT enabled"); + } + + PHP_INSTALL_HEADERS("ext/apcu", "apc.h apc_api.h apc_cache_api.h apc_lock_api.h apc_pool_api.h apc_sma_api.h apc_bin_api.h apc_serializer.h"); + + EXTENSION('apcu', apc_sources); +} diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/INSTALL php5-easybib-apcu-4.0.7/apcu-4.0.7/INSTALL --- php5-easybib-apcu-4.0.6/apcu-4.0.7/INSTALL 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/INSTALL 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,320 @@ +Installation Instructions for APCu +--------------------------------- + +This version of APCu 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: + + git clone https://github.com/krakjoe/apcu + cd apcu + phpize + ./configure --with-php-config=/usr/local/php/bin/php-config + make + export TEST_PHP_ARGS='-n' + make test + make install + +Suggested Configuration (in your php.ini file) +---------------------------------------------- + extension=apcu.so + apc.enabled=1 + apc.shm_size=32M + apc.ttl=7200 + apc.enable_cli=1 + +These are fully described at the bottom of this file. + ++---------------------+ +| QUICK INSTALL (DSO) | ++---------------------+ + +These instructions assume your PHP installation is located in /usr/local/php and you +want Apache optimizations (--with-apxs). + +$ gunzip -c apcu_x.y.tar.gz | tar xf - +$ cd apcu_x.y +$ /path/to/phpize +$ ./configure [--with-php-config=/path/to/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="apcu.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 APCu, the installation was successful. + ++------------------------+ +| QUICK INSTALL (Static) | ++------------------------+ + +APCu 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 apcu_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 APCu. + ++-----------------+ +| 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 apcu_x.y.tar.gz. + Unzip this file with a command like + + gunzip apcu_x.y.tar.gz + + Next you have to untar it with + + tar xvf apcu_x.y.tar + + This will create an apcu_x.y directory. cd into this new directory: + + cd apcu_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-apcu [--with-php-config=/path/to/php-config] + +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="apcu.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: + + + + Request that file in a web browser. If there is an entry for APCu in the + list of installed modules, the installation was successful. + + If APCu is not listed, consult your web server error log. If it contains an + error message saying that it can't load the APCu extension, your system + might not be able to load shared libraries created with PHP's build + system. One alternative would be to compile APCu statically into PHP. See + the Quick Install (Static) instructions above. + + You should consult your error log anyway to see if APCu generated any + errors. On BSD-based platforms, it is typical for APCu to be unable to + allocate the default-sized shared memory segment. See below for hints on + raising your system's shared memory limitations. + + +------------------+ + | CONFIGURING APCu | + +------------------+ + + OPTION DESCRIPTION + ------------------ -------------------------------------------------- + apc.enabled This can be set to 0 to disable APCu. This is + primarily useful when APCu is statically compiled + into PHP, since there is no other way to disable + it (when compiled as a DSO, the extension + line can just be commented-out). + (Default: 1) + + apc.enable_cli Mostly for testing and debugging. Setting this enables APCu + for the CLI version of PHP. Normally you wouldn't want to + create, populate and tear down the APCu cache on every CLI + request, but for various test scenarios it is handy to be + able to enable APCu for the CLI version of APCu easily. + (Default: 0) + + apc.preload_path Sets the path to text files containing caches to load + from disk upon intiialization of APCu. + preload_path should be a directory where each file follows + $key.data + where $key should be used as the entry name and the contents + of the file contains serialized data to use as the value of + the entry. + (Default: null) + + 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. M/G suffixes must be used. + (Default: 32) + + apc.shm_segments The number of shared memory segments to allocate + for the compiler cache. If APCu 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.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.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.smart If you begin to get low on resources, an expunge of the cache + is performed if it is less than half full. This is not always + a suitable way of determining if an expunge of the cache + should be per + apc.smart allows you to set a runtime configuration value which + is used to determine if an expunge should be run + if (available_size < apc.smart * requested_size) + apc_cache_expunge() + (Default: 0) + + apc.entries_hint A "hint" about the number variables expected in the + cache. Set to zero or omit if you're not sure. + (Default: 4096) + + 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 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 data at the same time. + By default, APCu attempts to prevent "slamming" of a key. + A key is considered "slammed" if it was the last key set, + and a context other than the current one set it ( ie. it + was set by another process or thread ) + Note: + APCu does not store enough information to + catch every occurence, sufficient none the less. + (Default: 1) + + apc.serializer Defines which serializer should be used. Default is the + standard PHP serializer. Other can be used without having + to re compile apc, like igbinary for example. + (apc.serializer=igbinary) + + + /* The remaining entries concern file upload progress support */ + + + apc.rfc1867 RFC1867 File Upload Progress hook handler is only available + if you compiled APCu against PHP 5.2.0 or later. When enabled + any file uploads which includes a field called + APCu_UPLOAD_PROGRESS before the file field in an upload form + will cause APCu to automatically create an upload_ + user cache entry where is the value of the + APCu_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 APCu upload + progress and specifies the user cache key suffix. + (Default: "APCu_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) diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/LICENSE php5-easybib-apcu-4.0.7/apcu-4.0.7/LICENSE --- php5-easybib-apcu-4.0.6/apcu-4.0.7/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/LICENSE 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,2 @@ +This package is under the following license(s): +PHP License \ No newline at end of file diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/Makefile.frag php5-easybib-apcu-4.0.7/apcu-4.0.7/Makefile.frag --- php5-easybib-apcu-4.0.6/apcu-4.0.7/Makefile.frag 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/Makefile.frag 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,8 @@ +clean-coverage: + @rm -fr .coverage coverage + +coverage: test clean-coverage + @echo "Generating $@" + @$(LCOV) --directory . --capture --base-directory=. --output-file .coverage + @$(GENHTML) --legend --output-directory coverage/ --title "pecl/apc code coverage" .coverage + diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/NOTICE php5-easybib-apcu-4.0.7/apcu-4.0.7/NOTICE --- php5-easybib-apcu-4.0.6/apcu-4.0.7/NOTICE 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/NOTICE 2014-10-11 17:02:21.000000000 +0000 @@ -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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/pgsql_s_lock.c php5-easybib-apcu-4.0.7/apcu-4.0.7/pgsql_s_lock.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/pgsql_s_lock.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/pgsql_s_lock.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,391 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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. | + +----------------------------------------------------------------------+ + | The following code was ported from the PostgreSQL project, please | + | see appropriate copyright notices that follow. | + | Initial conversion by Brian Shire | + +----------------------------------------------------------------------+ + + */ + +/* $Id: pgsql_s_lock.c 307048 2011-01-03 23:53:17Z kalle $ */ + +/*------------------------------------------------------------------------- + * + * s_lock.c + * Hardware-dependent implementation of spinlocks. + * + * + * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.47 2006/10/04 00:29:58 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +/* #include "postgres.h" -- Removed for APC */ + +/* -- Added for APC -- */ +#include "apc.h" +#ifdef APC_SPIN_LOCK + +#ifdef S_LOCK_TEST +#include +#endif +#ifndef WIN32 +#include +#endif +/* ---- */ + +#include +#ifdef WIN32 +#include "win32/unistd.h" +#else +#include +#endif + +/* #include "storage/s_lock.h" -- Removed for APC */ +#include "pgsql_s_lock.h" + +static int spins_per_delay = DEFAULT_SPINS_PER_DELAY; + + +/* -- APC specific additions ------------------------------*/ +/* The following dependencies have been copied from + * other pgsql source files. The original locations + * have been noted. + */ + +/* -- from include/c.h -- */ +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +/* -- from include/pg_config_manual.h -- */ +#define MAX_RANDOM_VALUE (0x7FFFFFFF) + +/* + * Max + * Return the maximum of two numbers. + */ +#define Max(x, y) ((x) > (y) ? (x) : (y)) + +/* -- from include/c.h -- */ +/* + * Min + * Return the minimum of two numbers. + */ +#define Min(x, y) ((x) < (y) ? (x) : (y)) + + +/* -- from backend/port/win32/signal.c -- */ +/* + * pg_usleep --- delay the specified number of microseconds. + * + * NOTE: although the delay is specified in microseconds, the effective + * resolution is only 1/HZ, or 10 milliseconds, on most Unixen. Expect + * the requested delay to be rounded up to the next resolution boundary. + * + * On machines where "long" is 32 bits, the maximum delay is ~2000 seconds. + */ +void +pg_usleep(long microsec) +{ + if (microsec > 0) + { +#ifndef WIN32 + struct timeval delay; + + delay.tv_sec = microsec / 1000000L; + delay.tv_usec = microsec % 1000000L; + (void) select(0, NULL, NULL, NULL, &delay); +#else + SleepEx((microsec < 500 ? 1 : (microsec + 500) / 1000), FALSE); +#endif + } +} + +/* -- End APC specific additions ------------------------------*/ + + +/* + * s_lock_stuck() - complain about a stuck spinlock + */ +static void +s_lock_stuck(volatile slock_t *lock, const char *file, int line TSRMLS_DC) +{ +#if defined(S_LOCK_TEST) + fprintf(stderr, + "\nStuck spinlock (%p) detected at %s:%d.\n", + lock, file, line); + exit(1); +#else + /* -- Removed for APC + elog(PANIC, "stuck spinlock (%p) detected at %s:%d", + lock, file, line); + */ + apc_error("Stuck spinlock (%p) detected" TSRMLS_CC, lock); +#endif +} + + +/* + * s_lock(lock) - platform-independent portion of waiting for a spinlock. + */ +void +s_lock(volatile slock_t *lock, const char *file, int line TSRMLS_DC) +{ + /* + * We loop tightly for awhile, then delay using pg_usleep() and try again. + * Preferably, "awhile" should be a small multiple of the maximum time we + * expect a spinlock to be held. 100 iterations seems about right as an + * initial guess. However, on a uniprocessor the loop is a waste of + * cycles, while in a multi-CPU scenario it's usually better to spin a bit + * longer than to call the kernel, so we try to adapt the spin loop count + * depending on whether we seem to be in a uniprocessor or multiprocessor. + * + * Note: you might think MIN_SPINS_PER_DELAY should be just 1, but you'd + * be wrong; there are platforms where that can result in a "stuck + * spinlock" failure. This has been seen particularly on Alphas; it seems + * that the first TAS after returning from kernel space will always fail + * on that hardware. + * + * Once we do decide to block, we use randomly increasing pg_usleep() + * delays. The first delay is 1 msec, then the delay randomly increases to + * about one second, after which we reset to 1 msec and start again. The + * idea here is that in the presence of heavy contention we need to + * increase the delay, else the spinlock holder may never get to run and + * release the lock. (Consider situation where spinlock holder has been + * nice'd down in priority by the scheduler --- it will not get scheduled + * until all would-be acquirers are sleeping, so if we always use a 1-msec + * sleep, there is a real possibility of starvation.) But we can't just + * clamp the delay to an upper bound, else it would take a long time to + * make a reasonable number of tries. + * + * We time out and declare error after NUM_DELAYS delays (thus, exactly + * that many tries). With the given settings, this will usually take 2 or + * so minutes. It seems better to fix the total number of tries (and thus + * the probability of unintended failure) than to fix the total time + * spent. + * + * The pg_usleep() delays are measured in milliseconds because 1 msec is a + * common resolution limit at the OS level for newer platforms. On older + * platforms the resolution limit is usually 10 msec, in which case the + * total delay before timeout will be a bit more. + */ +#define MIN_SPINS_PER_DELAY 10 +#define MAX_SPINS_PER_DELAY 1000 +#define NUM_DELAYS 1000 +#define MIN_DELAY_MSEC 1 +#define MAX_DELAY_MSEC 1000 + + int spins = 0; + int delays = 0; + int cur_delay = 0; + + while (TAS(lock)) + { + /* CPU-specific delay each time through the loop */ + SPIN_DELAY(); + + /* Block the process every spins_per_delay tries */ + if (++spins >= spins_per_delay) + { + if (++delays > NUM_DELAYS) + s_lock_stuck(lock, file, line TSRMLS_CC); + + if (cur_delay == 0) /* first time to delay? */ + cur_delay = MIN_DELAY_MSEC; + + pg_usleep(cur_delay * 1000L); + +#if defined(S_LOCK_TEST) + fprintf(stdout, "*"); + fflush(stdout); +#endif + + /* increase delay by a random fraction between 1X and 2X */ + cur_delay += (int) (cur_delay * + ((double) rand() / (double) MAX_RANDOM_VALUE) + 0.5); + /* wrap back to minimum delay when max is exceeded */ + if (cur_delay > MAX_DELAY_MSEC) + cur_delay = MIN_DELAY_MSEC; + + spins = 0; + } + } + + /* + * If we were able to acquire the lock without delaying, it's a good + * indication we are in a multiprocessor. If we had to delay, it's a sign + * (but not a sure thing) that we are in a uniprocessor. Hence, we + * decrement spins_per_delay slowly when we had to delay, and increase it + * rapidly when we didn't. It's expected that spins_per_delay will + * converge to the minimum value on a uniprocessor and to the maximum + * value on a multiprocessor. + * + * Note: spins_per_delay is local within our current process. We want to + * average these observations across multiple backends, since it's + * relatively rare for this function to even get entered, and so a single + * backend might not live long enough to converge on a good value. That + * is handled by the two routines below. + */ + if (cur_delay == 0) + { + /* we never had to delay */ + if (spins_per_delay < MAX_SPINS_PER_DELAY) + spins_per_delay = Min(spins_per_delay + 100, MAX_SPINS_PER_DELAY); + } + else + { + if (spins_per_delay > MIN_SPINS_PER_DELAY) + spins_per_delay = Max(spins_per_delay - 1, MIN_SPINS_PER_DELAY); + } +} + + +#if 0 /* -- APC doesn't use the set_spins_per_delay or update_spins_per_delay -- */ +/* + * Set local copy of spins_per_delay during backend startup. + * + * NB: this has to be pretty fast as it is called while holding a spinlock + */ +void +set_spins_per_delay(int shared_spins_per_delay) +{ + spins_per_delay = shared_spins_per_delay; +} + +/* + * Update shared estimate of spins_per_delay during backend exit. + * + * NB: this has to be pretty fast as it is called while holding a spinlock + */ +int +update_spins_per_delay(int shared_spins_per_delay) +{ + /* + * We use an exponential moving average with a relatively slow adaption + * rate, so that noise in any one backend's result won't affect the shared + * value too much. As long as both inputs are within the allowed range, + * the result must be too, so we need not worry about clamping the result. + * + * We deliberately truncate rather than rounding; this is so that single + * adjustments inside a backend can affect the shared estimate (see the + * asymmetric adjustment rules above). + */ + return (shared_spins_per_delay * 15 + spins_per_delay) / 16; +} +#endif + +/* + * Various TAS implementations that cannot live in s_lock.h as no inline + * definition exists (yet). + * In the future, get rid of tas.[cso] and fold it into this file. + * + * If you change something here, you will likely need to modify s_lock.h too, + * because the definitions for these are split between this file and s_lock.h. + */ + + +#ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ + + +#if defined(__GNUC__) + +/* + * All the gcc flavors that are not inlined + */ + + +/* + * Note: all the if-tests here probably ought to be testing gcc version + * rather than platform, but I don't have adequate info to know what to + * write. Ideally we'd flush all this in favor of the inline version. + */ +#if defined(__m68k__) && !defined(__linux__) +/* really means: extern int tas(slock_t* **lock); */ +static void +tas_dummy() +{ + __asm__ __volatile__( +#if defined(__NetBSD__) && defined(__ELF__) +/* no underscore for label and % for registers */ + "\ +.global tas \n\ +tas: \n\ + movel %sp@(0x4),%a0 \n\ + tas %a0@ \n\ + beq _success \n\ + moveq #-128,%d0 \n\ + rts \n\ +_success: \n\ + moveq #0,%d0 \n\ + rts \n" +#else + "\ +.global _tas \n\ +_tas: \n\ + movel sp@(0x4),a0 \n\ + tas a0@ \n\ + beq _success \n\ + moveq #-128,d0 \n\ + rts \n\ +_success: \n\ + moveq #0,d0 \n\ + rts \n" +#endif /* __NetBSD__ && __ELF__ */ + ); +} +#endif /* __m68k__ && !__linux__ */ +#else /* not __GNUC__ */ + +/* + * All non gcc + */ + + +#if defined(sun3) +static void +tas_dummy() /* really means: extern int tas(slock_t + * *lock); */ +{ + asm("LLA0:"); + asm(" .data"); + asm(" .text"); + asm("|#PROC# 04"); + asm(" .globl _tas"); + asm("_tas:"); + asm("|#PROLOGUE# 1"); + asm(" movel sp@(0x4),a0"); + asm(" tas a0@"); + asm(" beq LLA1"); + asm(" moveq #-128,d0"); + asm(" rts"); + asm("LLA1:"); + asm(" moveq #0,d0"); + asm(" rts"); + asm(" .data"); +} +#endif /* sun3 */ +#endif /* not __GNUC__ */ +#endif /* HAVE_SPINLOCKS */ + +#endif /* APC_SPIN_LOCKS */ diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/pgsql_s_lock.h php5-easybib-apcu-4.0.7/apcu-4.0.7/pgsql_s_lock.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/pgsql_s_lock.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/pgsql_s_lock.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,929 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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. | + +----------------------------------------------------------------------+ + | The following code was ported from the PostgreSQL project, please | + | see appropriate copyright notices that follow. | + | Initial conversion by Brian Shire | + +----------------------------------------------------------------------+ + + */ + +/* $Id: pgsql_s_lock.h 307048 2011-01-03 23:53:17Z kalle $ */ + +/*------------------------------------------------------------------------- + * + * s_lock.h + * Hardware-dependent implementation of spinlocks. + * + * NOTE: none of the macros in this file are intended to be called directly. + * Call them through the hardware-independent macros in spin.h. + * + * The following hardware-dependent macros must be provided for each + * supported platform: + * + * void S_INIT_LOCK(slock_t *lock) + * Initialize a spinlock (to the unlocked state). + * + * void S_LOCK(slock_t *lock) + * Acquire a spinlock, waiting if necessary. + * Time out and abort() if unable to acquire the lock in a + * "reasonable" amount of time --- typically ~ 1 minute. + * + * void S_UNLOCK(slock_t *lock) + * Unlock a previously acquired lock. + * + * bool S_LOCK_FREE(slock_t *lock) + * Tests if the lock is free. Returns TRUE if free, FALSE if locked. + * This does *not* change the state of the lock. + * + * void SPIN_DELAY(void) + * Delay operation to occur inside spinlock wait loop. + * + * Note to implementors: there are default implementations for all these + * macros at the bottom of the file. Check if your platform can use + * these or needs to override them. + * + * Usually, S_LOCK() is implemented in terms of an even lower-level macro + * TAS(): + * + * int TAS(slock_t *lock) + * Atomic test-and-set instruction. Attempt to acquire the lock, + * but do *not* wait. Returns 0 if successful, nonzero if unable + * to acquire the lock. + * + * TAS() is NOT part of the API, and should never be called directly. + * + * CAUTION: on some platforms TAS() may sometimes report failure to acquire + * a lock even when the lock is not locked. For example, on Alpha TAS() + * will "fail" if interrupted. Therefore TAS() should always be invoked + * in a retry loop, even if you are certain the lock is free. + * + * ANOTHER CAUTION: be sure that TAS() and S_UNLOCK() represent sequence + * points, ie, loads and stores of other values must not be moved across + * a lock or unlock. In most cases it suffices to make the operation be + * done through a "volatile" pointer. + * + * On most supported platforms, TAS() uses a tas() function written + * in assembly language to execute a hardware atomic-test-and-set + * instruction. Equivalent OS-supplied mutex routines could be used too. + * + * If no system-specific TAS() is available (ie, HAVE_SPINLOCKS is not + * defined), then we fall back on an emulation that uses SysV semaphores + * (see spin.c). This emulation will be MUCH MUCH slower than a proper TAS() + * implementation, because of the cost of a kernel call per lock or unlock. + * An old report is that Postgres spends around 40% of its time in semop(2) + * when using the SysV semaphore code. + * + * + * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.157 2006/06/07 22:24:45 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef S_LOCK_H +#define S_LOCK_H + +/** APC namespace protection ************************************************/ +/* hack to protect against any possible runtime namespace collisions...*/ +#define pg_usleep apc_spin_pg_usleep +#define s_lock apc_spin_s_lock +#define spins_per_delay apc_spin_spins_per_delay +/****************************************************************************/ + + +/* #include "storage/pg_sema.h" -- Removed for APC */ + +#define HAVE_SPINLOCKS 1 /* -- Added for APC */ + +#ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ + + +#if defined(__GNUC__) || defined(__ICC) +/************************************************************************* + * All the gcc inlines + * Gcc consistently defines the CPU as __cpu__. + * Other compilers use __cpu or __cpu__ so we test for both in those cases. + */ + +/*---------- + * Standard gcc asm format (assuming "volatile slock_t *lock"): + + __asm__ __volatile__( + " instruction \n" + " instruction \n" + " instruction \n" +: "=r"(_res), "+m"(*lock) // return register, in/out lock value +: "r"(lock) // lock pointer, in input register +: "memory", "cc"); // show clobbered registers here + + * The output-operands list (after first colon) should always include + * "+m"(*lock), whether or not the asm code actually refers to this + * operand directly. This ensures that gcc believes the value in the + * lock variable is used and set by the asm code. Also, the clobbers + * list (after third colon) should always include "memory"; this prevents + * gcc from thinking it can cache the values of shared-memory fields + * across the asm code. Add "cc" if your asm code changes the condition + * code register, and also list any temp registers the code uses. + *---------- + */ + + +#ifdef __i386__ /* 32-bit i386 */ +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register slock_t _res = 1; + + /* + * Use a non-locking test before asserting the bus lock. Note that the + * extra test appears to be a small loss on some x86 platforms and a small + * win on others; it's by no means clear that we should keep it. + */ + __asm__ __volatile__( + " cmpb $0,%1 \n" + " jne 1f \n" + " lock \n" + " xchgb %0,%1 \n" + "1: \n" +: "+q"(_res), "+m"(*lock) +: +: "memory", "cc"); + return (int) _res; +} + +#define SPIN_DELAY() spin_delay() + +static __inline__ void +spin_delay(void) +{ + /* + * This sequence is equivalent to the PAUSE instruction ("rep" is + * ignored by old IA32 processors if the following instruction is + * not a string operation); the IA-32 Architecture Software + * Developer's Manual, Vol. 3, Section 7.7.2 describes why using + * PAUSE in the inner loop of a spin lock is necessary for good + * performance: + * + * The PAUSE instruction improves the performance of IA-32 + * processors supporting Hyper-Threading Technology when + * executing spin-wait loops and other routines where one + * thread is accessing a shared lock or semaphore in a tight + * polling loop. When executing a spin-wait loop, the + * processor can suffer a severe performance penalty when + * exiting the loop because it detects a possible memory order + * violation and flushes the core processor's pipeline. The + * PAUSE instruction provides a hint to the processor that the + * code sequence is a spin-wait loop. The processor uses this + * hint to avoid the memory order violation and prevent the + * pipeline flush. In addition, the PAUSE instruction + * de-pipelines the spin-wait loop to prevent it from + * consuming execution resources excessively. + */ + __asm__ __volatile__( + " rep; nop \n"); +} + +#endif /* __i386__ */ + + +#ifdef __x86_64__ /* AMD Opteron, Intel EM64T */ +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register slock_t _res = 1; + + /* + * On Opteron, using a non-locking test before the locking instruction + * is a huge loss. On EM64T, it appears to be a wash or small loss, + * so we needn't bother to try to distinguish the sub-architectures. + */ + __asm__ __volatile__( + " lock \n" + " xchgb %0,%1 \n" +: "+q"(_res), "+m"(*lock) +: +: "memory", "cc"); + return (int) _res; +} + +#define SPIN_DELAY() spin_delay() + +static __inline__ void +spin_delay(void) +{ + /* + * Adding a PAUSE in the spin delay loop is demonstrably a no-op on + * Opteron, but it may be of some use on EM64T, so we keep it. + */ + __asm__ __volatile__( + " rep; nop \n"); +} + +#endif /* __x86_64__ */ + + +#if defined(__ia64__) || defined(__ia64) /* Intel Itanium */ +#define HAS_TEST_AND_SET + +typedef unsigned int slock_t; + +#define TAS(lock) tas(lock) + +#ifndef __INTEL_COMPILER + +static __inline__ int +tas(volatile slock_t *lock) +{ + long int ret; + + __asm__ __volatile__( + " xchg4 %0=%1,%2 \n" +: "=r"(ret), "+m"(*lock) +: "r"(1) +: "memory"); + return (int) ret; +} + +#else /* __INTEL_COMPILER */ + +static __inline__ int +tas(volatile slock_t *lock) +{ + int ret; + + ret = _InterlockedExchange(lock,1); /* this is a xchg asm macro */ + + return ret; +} + +#endif /* __INTEL_COMPILER */ +#endif /* __ia64__ || __ia64 */ + + +#if defined(__arm__) || defined(__arm) +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register slock_t _res = 1; + + __asm__ __volatile__( + " swpb %0, %0, [%2] \n" +: "+r"(_res), "+m"(*lock) +: "r"(lock) +: "memory"); + return (int) _res; +} + +#endif /* __arm__ */ + + +/* S/390 and S/390x Linux (32- and 64-bit zSeries) */ +#if defined(__s390__) || defined(__s390x__) +#define HAS_TEST_AND_SET + +typedef unsigned int slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + int _res = 0; + + __asm__ __volatile__( + " cs %0,%3,0(%2) \n" +: "+d"(_res), "+m"(*lock) +: "a"(lock), "d"(1) +: "memory", "cc"); + return _res; +} + +#endif /* __s390__ || __s390x__ */ + + +#if defined(__sparc__) /* Sparc */ +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register slock_t _res; + + /* + * See comment in /pg/backend/port/tas/solaris_sparc.s for why this + * uses "ldstub", and that file uses "cas". gcc currently generates + * sparcv7-targeted binaries, so "cas" use isn't possible. + */ + __asm__ __volatile__( + " ldstub [%2], %0 \n" +: "=r"(_res), "+m"(*lock) +: "r"(lock) +: "memory"); + return (int) _res; +} + +#endif /* __sparc__ */ + + +/* PowerPC */ +#if defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__) || defined(__powerpc64__) +#define HAS_TEST_AND_SET + +#if defined(__ppc64__) || defined(__powerpc64__) +typedef unsigned long slock_t; +#else +typedef unsigned int slock_t; +#endif + +#define TAS(lock) tas(lock) +/* + * NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002, + * an isync is a sufficient synchronization barrier after a lwarx/stwcx loop. + */ +static __inline__ int +tas(volatile slock_t *lock) +{ + slock_t _t; + int _res; + + __asm__ __volatile__( +" lwarx %0,0,%3 \n" +" cmpwi %0,0 \n" +" bne 1f \n" +" addi %0,%0,1 \n" +" stwcx. %0,0,%3 \n" +" beq 2f \n" +"1: li %1,1 \n" +" b 3f \n" +"2: \n" +" isync \n" +" li %1,0 \n" +"3: \n" + +: "=&r"(_t), "=r"(_res), "+m"(*lock) +: "r"(lock) +: "memory", "cc"); + return _res; +} + +/* PowerPC S_UNLOCK is almost standard but requires a "sync" instruction */ +#define S_UNLOCK(lock) \ +do \ +{ \ + __asm__ __volatile__ (" sync \n"); \ + *((volatile slock_t *) (lock)) = 0; \ +} while (0) + +#endif /* powerpc */ + + +/* Linux Motorola 68k */ +#if (defined(__mc68000__) || defined(__m68k__)) && defined(__linux__) +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register int rv; + + __asm__ __volatile__( + " clrl %0 \n" + " tas %1 \n" + " sne %0 \n" +: "=d"(rv), "+m"(*lock) +: +: "memory", "cc"); + return rv; +} + +#endif /* (__mc68000__ || __m68k__) && __linux__ */ + + +/* + * VAXen -- even multiprocessor ones + * (thanks to Tom Ivar Helbekkmo) + */ +#if defined(__vax__) +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register int _res; + + __asm__ __volatile__( + " movl $1, %0 \n" + " bbssi $0, (%2), 1f \n" + " clrl %0 \n" + "1: \n" +: "=&r"(_res), "+m"(*lock) +: "r"(lock) +: "memory"); + return _res; +} + +#endif /* __vax__ */ + + +#if defined(__ns32k__) /* National Semiconductor 32K */ +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register int _res; + + __asm__ __volatile__( + " sbitb 0, %1 \n" + " sfsd %0 \n" +: "=r"(_res), "+m"(*lock) +: +: "memory"); + return _res; +} + +#endif /* __ns32k__ */ + + +#if defined(__alpha) || defined(__alpha__) /* Alpha */ +/* + * Correct multi-processor locking methods are explained in section 5.5.3 + * of the Alpha AXP Architecture Handbook, which at this writing can be + * found at ftp://ftp.netbsd.org/pub/NetBSD/misc/dec-docs/index.html. + * For gcc we implement the handbook's code directly with inline assembler. + */ +#define HAS_TEST_AND_SET + +typedef unsigned long slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register slock_t _res; + + __asm__ __volatile__( + " ldq $0, %1 \n" + " bne $0, 2f \n" + " ldq_l %0, %1 \n" + " bne %0, 2f \n" + " mov 1, $0 \n" + " stq_c $0, %1 \n" + " beq $0, 2f \n" + " mb \n" + " br 3f \n" + "2: mov 1, %0 \n" + "3: \n" +: "=&r"(_res), "+m"(*lock) +: +: "memory", "0"); + return (int) _res; +} + +#define S_UNLOCK(lock) \ +do \ +{\ + __asm__ __volatile__ (" mb \n"); \ + *((volatile slock_t *) (lock)) = 0; \ +} while (0) + +#endif /* __alpha || __alpha__ */ + + +#if defined(__mips__) && !defined(__sgi) /* non-SGI MIPS */ +/* Note: on SGI we use the OS' mutex ABI, see below */ +/* Note: R10000 processors require a separate SYNC */ +#define HAS_TEST_AND_SET + +typedef unsigned int slock_t; + +#define TAS(lock) tas(lock) + +static __inline__ int +tas(volatile slock_t *lock) +{ + register volatile slock_t *_l = lock; + register int _res; + register int _tmp; + + __asm__ __volatile__( + " .set push \n" + " .set mips2 \n" + " .set noreorder \n" + " .set nomacro \n" + " ll %0, %2 \n" + " or %1, %0, 1 \n" + " sc %1, %2 \n" + " xori %1, 1 \n" + " or %0, %0, %1 \n" + " sync \n" + " .set pop " +: "=&r" (_res), "=&r" (_tmp), "+R" (*_l) +: +: "memory"); + return _res; +} + +/* MIPS S_UNLOCK is almost standard but requires a "sync" instruction */ +#define S_UNLOCK(lock) \ +do \ +{ \ + __asm__ __volatile__( \ + " .set push \n" \ + " .set mips2 \n" \ + " .set noreorder \n" \ + " .set nomacro \n" \ + " sync \n" \ + " .set pop "); \ + *((volatile slock_t *) (lock)) = 0; \ +} while (0) + +#endif /* __mips__ && !__sgi */ + + +/* These live in s_lock.c, but only for gcc */ + + +#if defined(__m68k__) && !defined(__linux__) /* non-Linux Motorola 68k */ +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; +#endif + + +#endif /* __GNUC__ */ + + + +/* + * --------------------------------------------------------------------- + * Platforms that use non-gcc inline assembly: + * --------------------------------------------------------------------- + */ + +#if !defined(HAS_TEST_AND_SET) /* We didn't trigger above, let's try here */ + + +#if defined(USE_UNIVEL_CC) /* Unixware compiler */ +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; + +#define TAS(lock) tas(lock) + +asm int +tas(volatile slock_t *s_lock) +{ +/* UNIVEL wants %mem in column 1, so we don't pg_indent this file */ +%mem s_lock + pushl %ebx + movl s_lock, %ebx + movl $255, %eax + lock + xchgb %al, (%ebx) + popl %ebx +} + +#endif /* defined(USE_UNIVEL_CC) */ + + +#if defined(__alpha) || defined(__alpha__) /* Tru64 Unix Alpha compiler */ +/* + * The Tru64 compiler doesn't support gcc-style inline asm, but it does + * have some builtin functions that accomplish much the same results. + * For simplicity, slock_t is defined as long (ie, quadword) on Alpha + * regardless of the compiler in use. LOCK_LONG and UNLOCK_LONG only + * operate on an int (ie, longword), but that's OK as long as we define + * S_INIT_LOCK to zero out the whole quadword. + */ +#define HAS_TEST_AND_SET + +typedef unsigned long slock_t; + +#include +#define S_INIT_LOCK(lock) (*(lock) = 0) +#define TAS(lock) (__LOCK_LONG_RETRY((lock), 1) == 0) +#define S_UNLOCK(lock) __UNLOCK_LONG(lock) + +#endif /* __alpha || __alpha__ */ + + +#if defined(__hppa) || defined(__hppa__) /* HP PA-RISC, GCC and HP compilers */ +/* + * HP's PA-RISC + * + * See src/backend/port/hpux/tas.c.template for details about LDCWX. Because + * LDCWX requires a 16-byte-aligned address, we declare slock_t as a 16-byte + * struct. The active word in the struct is whichever has the aligned address; + * the other three words just sit at -1. + * + * When using gcc, we can inline the required assembly code. + */ +#define HAS_TEST_AND_SET + +typedef struct +{ + int sema[4]; +} slock_t; + +#define TAS_ACTIVE_WORD(lock) ((volatile int *) (((long) (lock) + 15) & ~15)) + +#if defined(__GNUC__) + +static __inline__ int +tas(volatile slock_t *lock) +{ + volatile int *lockword = TAS_ACTIVE_WORD(lock); + register int lockval; + + __asm__ __volatile__( + " ldcwx 0(0,%2),%0 \n" +: "=r"(lockval), "+m"(*lockword) +: "r"(lockword) +: "memory"); + return (lockval == 0); +} + +#endif /* __GNUC__ */ + +#define S_UNLOCK(lock) (*TAS_ACTIVE_WORD(lock) = -1) + +#define S_INIT_LOCK(lock) \ + do { \ + volatile slock_t *lock_ = (lock); \ + lock_->sema[0] = -1; \ + lock_->sema[1] = -1; \ + lock_->sema[2] = -1; \ + lock_->sema[3] = -1; \ + } while (0) + +#define S_LOCK_FREE(lock) (*TAS_ACTIVE_WORD(lock) != 0) + +#endif /* __hppa || __hppa__ */ + + +#if defined(__hpux) && defined(__ia64) && !defined(__GNUC__) + +#define HAS_TEST_AND_SET + +typedef unsigned int slock_t; + +#include +#define TAS(lock) _Asm_xchg(_SZ_W, lock, 1, _LDHINT_NONE) + +#endif /* HPUX on IA64, non gcc */ + + +#if defined(__sgi) /* SGI compiler */ +/* + * SGI IRIX 5 + * slock_t is defined as a unsigned long. We use the standard SGI + * mutex API. + * + * The following comment is left for historical reasons, but is probably + * not a good idea since the mutex ABI is supported. + * + * This stuff may be supplemented in the future with Masato Kataoka's MIPS-II + * assembly from his NECEWS SVR4 port, but we probably ought to retain this + * for the R3000 chips out there. + */ +#define HAS_TEST_AND_SET + +typedef unsigned long slock_t; + +#include "mutex.h" +#define TAS(lock) (test_and_set(lock,1)) +#define S_UNLOCK(lock) (test_then_and(lock,0)) +#define S_INIT_LOCK(lock) (test_then_and(lock,0)) +#define S_LOCK_FREE(lock) (test_then_add(lock,0) == 0) +#endif /* __sgi */ + + +#if defined(sinix) /* Sinix */ +/* + * SINIX / Reliant UNIX + * slock_t is defined as a struct abilock_t, which has a single unsigned long + * member. (Basically same as SGI) + */ +#define HAS_TEST_AND_SET + +#include "abi_mutex.h" +typedef abilock_t slock_t; + +#define TAS(lock) (!acquire_lock(lock)) +#define S_UNLOCK(lock) release_lock(lock) +#define S_INIT_LOCK(lock) init_lock(lock) +#define S_LOCK_FREE(lock) (stat_lock(lock) == UNLOCKED) +#endif /* sinix */ + + +#if defined(_AIX) /* AIX */ +/* + * AIX (POWER) + */ +#define HAS_TEST_AND_SET + +typedef unsigned int slock_t; + +#define TAS(lock) _check_lock(lock, 0, 1) +#define S_UNLOCK(lock) _clear_lock(lock, 0) +#endif /* _AIX */ + + +#if defined (nextstep) /* Nextstep */ +#define HAS_TEST_AND_SET + +typedef struct mutex slock_t; + +#define APC_SLOCK_NONBLOCKING_LOCK_AVAILABLE 0 /* -- APC: non-blocking lock not available in this case -- */ + +#define S_LOCK(lock) mutex_lock(lock) +#define S_UNLOCK(lock) mutex_unlock(lock) +#define S_INIT_LOCK(lock) mutex_init(lock) +/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */ +#define S_LOCK_FREE(alock) ((alock)->lock == 0) +#endif /* nextstep */ + + +/* These are in s_lock.c */ + + +#if defined(sun3) /* Sun3 */ +#define HAS_TEST_AND_SET + +typedef unsigned char slock_t; +#endif + + +#if defined(__sun) && (defined(__i386) || defined(__x86_64__) || defined(__sparc__) || defined(__sparc)) +#define HAS_TEST_AND_SET + +#if defined(__i386) || defined(__x86_64__) || defined(__sparcv9) || defined(__sparcv8plus) +typedef unsigned int slock_t; +#else +typedef unsigned char slock_t; +#endif + +extern slock_t pg_atomic_cas(volatile slock_t *lock, slock_t with, + slock_t cmp); + +#define TAS(a) (pg_atomic_cas((a), 1, 0) != 0) +#endif + + +#ifdef WIN32_ONLY_COMPILER +typedef LONG slock_t; + +#define HAS_TEST_AND_SET +#define TAS(lock) (InterlockedCompareExchange(lock, 1, 0)) + +#define SPIN_DELAY() spin_delay() + +static __forceinline void +spin_delay(void) +{ + /* See comment for gcc code. Same code, MASM syntax */ + __asm rep nop; +} + +#endif + + +#endif /* !defined(HAS_TEST_AND_SET) */ + + +/* Blow up if we didn't have any way to do spinlocks */ +#ifndef HAS_TEST_AND_SET +/* -- APC: We have better options in APC than this, that should be specified explicitly so just fail out and notify the user -- */ +#error Spin locking is not available on your platform, please select another locking method (see ./configure --help). +/* #error PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. +However, performance will be poor. Please report this to pgsql-bugs@postgresql.org. */ +#endif + + +#else /* !HAVE_SPINLOCKS */ + + +/* + * Fake spinlock implementation using semaphores --- slow and prone + * to fall foul of kernel limits on number of semaphores, so don't use this + * unless you must! The subroutines appear in spin.c. + */ + +/* -- Removed for APC +typedef PGSemaphoreData slock_t; + +extern bool s_lock_free_sema(volatile slock_t *lock); +extern void s_unlock_sema(volatile slock_t *lock); +extern void s_init_lock_sema(volatile slock_t *lock); +extern int tas_sema(volatile slock_t *lock); + +#define S_LOCK_FREE(lock) s_lock_free_sema(lock) +#define S_UNLOCK(lock) s_unlock_sema(lock) +#define S_INIT_LOCK(lock) s_init_lock_sema(lock) +#define TAS(lock) tas_sema(lock) +*/ + +#endif /* HAVE_SPINLOCKS */ + + +/* + * Default Definitions - override these above as needed. + */ + +#define APC_SLOCK_NONBLOCKING_LOCK_AVAILABLE 1 /* -- APC: Non-blocking lock available for this case -- */ + +#if !defined(S_LOCK) +#define S_LOCK(lock) \ + do { \ + if (TAS(lock)) \ + s_lock((lock), __FILE__, __LINE__ TSRMLS_CC); \ + } while (0) +#endif /* S_LOCK */ + +#if !defined(S_LOCK_FREE) +#define S_LOCK_FREE(lock) (*(lock) == 0) +#endif /* S_LOCK_FREE */ + +#if !defined(S_UNLOCK) +#define S_UNLOCK(lock) (*((volatile slock_t *) (lock)) = 0) +#endif /* S_UNLOCK */ + +#if !defined(S_INIT_LOCK) +#define S_INIT_LOCK(lock) S_UNLOCK(lock) +#endif /* S_INIT_LOCK */ + +#if !defined(SPIN_DELAY) +#define SPIN_DELAY() ((void) 0) +#endif /* SPIN_DELAY */ + +#if !defined(TAS) +extern int tas(volatile slock_t *lock); /* in port/.../tas.s, or + * s_lock.c */ + +#define TAS(lock) tas(lock) +#endif /* TAS */ + + +/* + * Platform-independent out-of-line support routines + */ +extern void s_lock(volatile slock_t *lock, const char *file, int line TSRMLS_DC); + +/* Support for dynamic adjustment of spins_per_delay */ +#define DEFAULT_SPINS_PER_DELAY 100 + +#if 0 /* -- Removed from APC use -- */ +extern void set_spins_per_delay(int shared_spins_per_delay); +extern int update_spins_per_delay(int shared_spins_per_delay); +#endif + +#endif /* S_LOCK_H */ diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/php_apc.c php5-easybib-apcu-4.0.7/apcu-4.0.7/php_apc.c --- php5-easybib-apcu-4.0.6/apcu-4.0.7/php_apc.c 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/php_apc.c 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,1586 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + | 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. + + */ + +/* $Id: php_apc.c 328290 2012-11-09 03:30:09Z laruence $ */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "apc_cache.h" +#include "apc_iterator.h" +#include "apc_sma.h" +#include "apc_lock.h" +#include "apc_bin.h" +#include "php_globals.h" +#include "php_ini.h" +#include "ext/standard/info.h" +#include "ext/standard/file.h" +#include "ext/standard/flock_compat.h" +#include "ext/standard/md5.h" +#include "ext/standard/php_var.h" + +#ifdef HAVE_SYS_FILE_H +#include +#endif + +#include "SAPI.h" +#include "rfc1867.h" +#include "php_apc.h" + +#if HAVE_SIGACTION +#include "apc_signal.h" +#endif + +/* {{{ PHP_FUNCTION declarations */ +PHP_FUNCTION(apcu_cache_info); +PHP_FUNCTION(apcu_clear_cache); +PHP_FUNCTION(apcu_sma_info); +PHP_FUNCTION(apcu_key_info); +PHP_FUNCTION(apcu_store); +PHP_FUNCTION(apcu_fetch); +PHP_FUNCTION(apcu_delete); +PHP_FUNCTION(apcu_add); +PHP_FUNCTION(apcu_inc); +PHP_FUNCTION(apcu_dec); +PHP_FUNCTION(apcu_cas); +PHP_FUNCTION(apcu_exists); + +PHP_FUNCTION(apcu_bin_dump); +PHP_FUNCTION(apcu_bin_load); +PHP_FUNCTION(apcu_bin_dumpfile); +PHP_FUNCTION(apcu_bin_loadfile); + +#ifdef APC_FULL_BC +PHP_FUNCTION(apc_bin_dumpfile); +PHP_FUNCTION(apc_bin_dump); +#endif +/* }}} */ + +/* {{{ ZEND_DECLARE_MODULE_GLOBALS(apcu) */ +ZEND_DECLARE_MODULE_GLOBALS(apcu) + +/* True globals */ +apc_cache_t* apc_user_cache = NULL; + +/* External APC SMA */ +apc_sma_api_extern(apc_sma); + +/* Global init functions */ +static void php_apc_init_globals(zend_apcu_globals* apcu_globals TSRMLS_DC) +{ + apcu_globals->initialized = 0; + apcu_globals->slam_defense = 1; + apcu_globals->smart = 0; + +#ifdef MULTIPART_EVENT_FORMDATA + apcu_globals->rfc1867 = 0; + memset(&(apcu_globals->rfc1867_data), 0, sizeof(apc_rfc1867_data)); +#endif + + apcu_globals->preload_path = NULL; + apcu_globals->coredump_unmap = 0; + apcu_globals->use_request_time = 1; + apcu_globals->serializer_name = NULL; +} +/* }}} */ + +/* {{{ PHP_INI */ + +static PHP_INI_MH(OnUpdateShmSegments) /* {{{ */ +{ +#if APC_MMAP + if (zend_atoi(new_value, new_value_length)!=1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "apc.shm_segments setting ignored in MMAP mode"); + } + APCG(shm_segments) = 1; +#else + APCG(shm_segments) = zend_atoi(new_value, new_value_length); +#endif + return SUCCESS; +} +/* }}} */ + +static PHP_INI_MH(OnUpdateShmSize) /* {{{ */ +{ + long s = zend_atol(new_value, new_value_length); + + if (s <= 0) { + return FAILURE; + } + + if (s < 1048576L) { + /* if it's less than 1Mb, they are probably using the old syntax */ + php_error_docref( + NULL TSRMLS_CC, E_WARNING, "apc.shm_size now uses M/G suffixes, please update your ini files"); + s = s * 1048576L; + } + + APCG(shm_size) = s; + + return SUCCESS; +} +/* }}} */ + +#ifdef MULTIPART_EVENT_FORMDATA +static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */ +{ + int tmp; + tmp = zend_atoi(new_value, new_value_length); + if (tmp < 0) { + apc_error("rfc1867_freq must be greater than or equal to zero." TSRMLS_CC); + return FAILURE; + } + if (new_value[new_value_length-1] == '%') { + if (tmp > 100) { + apc_error("rfc1867_freq cannot be over 100%%" TSRMLS_CC); + return FAILURE; + } + APCG(rfc1867_freq) = tmp / 100.0; + } else { + APCG(rfc1867_freq) = tmp; + } + return SUCCESS; +} +/* }}} */ +#endif + +PHP_INI_BEGIN() +STD_PHP_INI_BOOLEAN("apc.enabled", "1", PHP_INI_SYSTEM, OnUpdateBool, enabled, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.shm_segments", "1", PHP_INI_SYSTEM, OnUpdateShmSegments, shm_segments, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.shm_size", "32M", PHP_INI_SYSTEM, OnUpdateShmSize, shm_size, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.entries_hint", "4096", PHP_INI_SYSTEM, OnUpdateLong, entries_hint, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.gc_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, gc_ttl, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.ttl", "0", PHP_INI_SYSTEM, OnUpdateLong, ttl, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.smart", "0", PHP_INI_SYSTEM, OnUpdateLong, smart, zend_apcu_globals, apcu_globals) +#if APC_MMAP +STD_PHP_INI_ENTRY("apc.mmap_file_mask", NULL, PHP_INI_SYSTEM, OnUpdateString, mmap_file_mask, zend_apcu_globals, apcu_globals) +#endif +STD_PHP_INI_BOOLEAN("apc.enable_cli", "0", PHP_INI_SYSTEM, OnUpdateBool, enable_cli, zend_apcu_globals, apcu_globals) +STD_PHP_INI_BOOLEAN("apc.slam_defense", "1", PHP_INI_SYSTEM, OnUpdateBool, slam_defense, zend_apcu_globals, apcu_globals) +#ifdef MULTIPART_EVENT_FORMDATA +STD_PHP_INI_BOOLEAN("apc.rfc1867", "0", PHP_INI_SYSTEM, OnUpdateBool, rfc1867, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.rfc1867_prefix", "upload_", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_prefix, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.rfc1867_name", "APC_UPLOAD_PROGRESS", PHP_INI_SYSTEM, OnUpdateStringUnempty, rfc1867_name, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.rfc1867_freq", "0", PHP_INI_SYSTEM, OnUpdateRfc1867Freq, rfc1867_freq, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.rfc1867_ttl", "3600", PHP_INI_SYSTEM, OnUpdateLong, rfc1867_ttl, zend_apcu_globals, apcu_globals) +#endif +STD_PHP_INI_ENTRY("apc.preload_path", (char*)NULL, PHP_INI_SYSTEM, OnUpdateString, preload_path, zend_apcu_globals, apcu_globals) +STD_PHP_INI_BOOLEAN("apc.coredump_unmap", "0", PHP_INI_SYSTEM, OnUpdateBool, coredump_unmap, zend_apcu_globals, apcu_globals) +STD_PHP_INI_BOOLEAN("apc.use_request_time", "1", PHP_INI_ALL, OnUpdateBool, use_request_time, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.serializer", "php", PHP_INI_SYSTEM, OnUpdateStringUnempty, serializer_name, zend_apcu_globals, apcu_globals) +STD_PHP_INI_ENTRY("apc.writable", "/tmp", PHP_INI_SYSTEM, OnUpdateStringUnempty, writable, zend_apcu_globals, apcu_globals) +PHP_INI_END() + +/* }}} */ + +/* {{{ PHP_MINFO_FUNCTION(apcu) */ +static PHP_MINFO_FUNCTION(apcu) +{ + php_info_print_table_start(); + php_info_print_table_header(2, "APCu Support", APCG(enabled) ? "Enabled" : "Disabled"); + php_info_print_table_row(2, "Version", PHP_APCU_VERSION); +#ifdef APC_DEBUG + php_info_print_table_row(2, "APCu Debugging", "Enabled"); +#else + php_info_print_table_row(2, "APCu Debugging", "Disabled"); +#endif +#if APC_MMAP + php_info_print_table_row(2, "MMAP Support", "Enabled"); + php_info_print_table_row(2, "MMAP File Mask", APCG(mmap_file_mask)); +#else + php_info_print_table_row(2, "MMAP Support", "Disabled"); +#endif + + if (APCG(enabled)) { + apc_serializer_t *serializer = NULL; + smart_str names = {0,}; + int i; + + for( i = 0, serializer = apc_get_serializers(TSRMLS_C); + serializer->name != NULL; + serializer++, i++) { + if (i != 0) { + smart_str_appends(&names, ", "); + } + smart_str_appends(&names, serializer->name); + } + + if (names.c) { + smart_str_0(&names); + php_info_print_table_row(2, "Serialization Support", names.c); + smart_str_free(&names); + } else { + php_info_print_table_row(2, "Serialization Support", "Broken"); + } + } else { + php_info_print_table_row(2, "Serialization Support", "Disabled"); + } + + php_info_print_table_row(2, "Revision", "$Revision: 328290 $"); + php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__); + php_info_print_table_end(); + DISPLAY_INI_ENTRIES(); +} +/* }}} */ + +#ifdef MULTIPART_EVENT_FORMDATA +extern int apc_rfc1867_progress(unsigned int event, void *event_data, void **extra TSRMLS_DC); +#endif + +#ifdef APC_FULL_BC +static void apc_init(INIT_FUNC_ARGS); +#endif + +/* {{{ PHP_MINIT_FUNCTION(apcu) */ +static PHP_MINIT_FUNCTION(apcu) +{ + ZEND_INIT_MODULE_GLOBALS(apcu, php_apc_init_globals, NULL); + + REGISTER_INI_ENTRIES(); + + /* locks initialized regardless of settings */ + apc_lock_init(TSRMLS_C); + + /* Disable APC in cli mode unless overridden by apc.enable_cli */ + if (!APCG(enable_cli) && !strcmp(sapi_module.name, "cli")) { + APCG(enabled) = 0; + } + + /* only run initialization if APC is enabled */ + if (APCG(enabled)) { + + if (!APCG(initialized)) { + /* ensure this runs only once */ + APCG(initialized) = 1; + + /* initialize shared memory allocator */ +#if APC_MMAP + apc_sma.init(APCG(shm_segments), APCG(shm_size), APCG(mmap_file_mask) TSRMLS_CC); +#else + apc_sma.init(APCG(shm_segments), APCG(shm_size), NULL TSRMLS_CC); +#endif + +/* XXX pack this into macros when there are more hooks to handle */ +#if defined(PHP_WIN32) && defined(_WIN64) + do { + char buf[65]; + + if (!_i64toa_s((__int64)_apc_register_serializer, buf, 65, 10)) { + REGISTER_STRING_CONSTANT(APC_SERIALIZER_CONSTANT, buf, CONST_PERSISTENT | CONST_CS); + } else { + /* subsequent apc_register_serializer() calls will be void */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serializer hook init failed"); + } + } while (0); +#else + REGISTER_LONG_CONSTANT(APC_SERIALIZER_CONSTANT, (long)&_apc_register_serializer, CONST_PERSISTENT | CONST_CS); +#endif + + /* register default serializer */ + _apc_register_serializer( + "php", APC_SERIALIZER_NAME(php), APC_UNSERIALIZER_NAME(php), NULL TSRMLS_CC); + + /* test out the constant function pointer */ + assert(apc_get_serializers(TSRMLS_C)->name != NULL); + + /* create user cache */ + apc_user_cache = apc_cache_create( + &apc_sma, + apc_find_serializer(APCG(serializer_name) TSRMLS_CC), + APCG(entries_hint), APCG(gc_ttl), APCG(ttl), APCG(smart), APCG(slam_defense) + TSRMLS_CC + ); + + /* initialize pooling */ + apc_pool_init(); + + /* preload data from path specified in configuration */ + if (APCG(preload_path)) { + apc_cache_preload( + apc_user_cache, APCG(preload_path) TSRMLS_CC); + } + +#ifdef MULTIPART_EVENT_FORMDATA + /* File upload progress tracking */ + if (APCG(rfc1867)) { + php_rfc1867_callback = apc_rfc1867_progress; + } +#endif + + /* initialize iterator object */ + apc_iterator_init(module_number TSRMLS_CC); + } + + REGISTER_LONG_CONSTANT("APC_BIN_VERIFY_MD5", APC_BIN_VERIFY_MD5, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("APC_BIN_VERIFY_CRC32", APC_BIN_VERIFY_CRC32, CONST_CS | CONST_PERSISTENT); + } + +#ifndef REGISTER_BOOL_CONSTANT + { + zend_constant apc_bc; + Z_TYPE(apc_bc.value) = IS_BOOL; +#if defined(APC_FULL_BC) && APC_FULL_BC + Z_LVAL(apc_bc.value) = 1; +#else + Z_LVAL(apc_bc.value) = 0; +#endif + apc_bc.flags = (CONST_CS | CONST_PERSISTENT); + apc_bc.name = zend_strndup(ZEND_STRL("APCU_APC_FULL_BC")); + apc_bc.name_len = sizeof("APCU_APC_FULL_BC"); + apc_bc.module_number = module_number; + zend_register_constant(&apc_bc TSRMLS_CC); + } +#else +#if defined(APC_FULL_BC) && APC_FULL_BC + REGISTER_BOOL_CONSTANT("APCU_APC_FULL_BC", 1, CONST_CS | CONST_PERSISTENT); +#else + REGISTER_BOOL_CONSTANT("APCU_APC_FULL_BC", 0, CONST_CS | CONST_PERSISTENT); +#endif +#endif + +#ifdef APC_FULL_BC + apc_init(INIT_FUNC_ARGS_PASSTHRU); +#endif + + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_MSHUTDOWN_FUNCTION(apcu) */ +static PHP_MSHUTDOWN_FUNCTION(apcu) +{ + /* locks shutdown regardless of settings */ + apc_lock_cleanup(TSRMLS_C); + + /* only shut down if APC is enabled */ + if (APCG(enabled)) { + if (APCG(initialized)) { + + /* destroy cache pointer */ + apc_cache_destroy(apc_user_cache TSRMLS_CC); + /* cleanup shared memory */ + apc_sma.cleanup(TSRMLS_C); + + APCG(initialized) = 0; + } + +#if HAVE_SIGACTION + apc_shutdown_signals(TSRMLS_C); +#endif + } + +#ifdef ZTS + ts_free_id(apcu_globals_id); +#endif + + UNREGISTER_INI_ENTRIES(); + return SUCCESS; +} /* }}} */ + +/* {{{ PHP_RINIT_FUNCTION(apcu) */ +static PHP_RINIT_FUNCTION(apcu) +{ + if (APCG(enabled)) { + if (APCG(serializer_name)) { + /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ + apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC); + } + +#if HAVE_SIGACTION + apc_set_signals(TSRMLS_C); +#endif + } + return SUCCESS; +} +/* }}} */ + +#ifdef APC_FULL_BC +/* {{{ proto void apc_clear_cache([string cache]) */ +PHP_FUNCTION(apcu_clear_cache) +{ + char *ignored; + int ignlen = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &ignored, &ignlen) == FAILURE) { + return; + } + + if (0 == ignlen || APC_CACHE_IS_USER(ignored, ignlen)) { + apc_cache_clear(apc_user_cache TSRMLS_CC); + } + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto array apc_cache_info(string cache_type, [bool limited]) */ +PHP_FUNCTION(apcu_cache_info) +{ + zval* info; + zend_bool limited = 0; + char *ct; + ulong ctlen; + + if (ZEND_NUM_ARGS()) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &ct, &ctlen, &limited) == FAILURE) { + return; + } + } + + info = apc_cache_info(apc_user_cache, limited TSRMLS_CC); + + if (!info) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file"); + RETURN_FALSE; + } + + RETURN_ZVAL(info, 0, 1); + +} +/* }}} */ +#else +/* {{{ proto void apc_clear_cache() */ +PHP_FUNCTION(apcu_clear_cache) +{ + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + apc_cache_clear( + apc_user_cache TSRMLS_CC); + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto array apc_cache_info([bool limited]) */ +PHP_FUNCTION(apcu_cache_info) +{ + zval* info; + zend_bool limited = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &limited) == FAILURE) { + return; + } + + info = apc_cache_info(apc_user_cache, limited TSRMLS_CC); + + if (!info) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC info available. Perhaps APC is not enabled? Check apc.enabled in your ini file"); + RETURN_FALSE; + } + + RETURN_ZVAL(info, 0, 1); + +} +/* }}} */ +#endif + +PHP_FUNCTION(apcu_key_info) +{ + zval *stat; + char *strkey; + zend_uint keylen; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &strkey, &keylen) == FAILURE) { + return; + } + + stat = apc_cache_stat( + apc_user_cache, strkey, keylen+1 TSRMLS_CC); + + RETURN_ZVAL(stat, 0, 1); +} + +/* {{{ proto array apc_sma_info([bool limited]) */ +PHP_FUNCTION(apcu_sma_info) +{ + apc_sma_info_t* info; + zval* block_lists; + int i; + zend_bool limited = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &limited) == FAILURE) { + return; + } + + info = apc_sma.info(limited TSRMLS_CC); + + if (!info) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No APC SMA info available. Perhaps APC is disabled via apc.enabled?"); + RETURN_FALSE; + } + array_init(return_value); + + add_assoc_long(return_value, "num_seg", info->num_seg); + add_assoc_double(return_value, "seg_size", (double)info->seg_size); + add_assoc_double(return_value, "avail_mem", (double)apc_sma.get_avail_mem()); + + if (limited) { + apc_sma.free_info(info TSRMLS_CC); + return; + } + + ALLOC_INIT_ZVAL(block_lists); + array_init(block_lists); + + for (i = 0; i < info->num_seg; i++) { + apc_sma_link_t* p; + zval* list; + + ALLOC_INIT_ZVAL(list); + array_init(list); + + for (p = info->list[i]; p != NULL; p = p->next) { + zval* link; + + ALLOC_INIT_ZVAL(link); + array_init(link); + + add_assoc_long(link, "size", p->size); + add_assoc_long(link, "offset", p->offset); + add_next_index_zval(list, link); + } + add_next_index_zval(block_lists, list); + } + add_assoc_zval(return_value, "block_lists", block_lists); + apc_sma.free_info(info TSRMLS_CC); +} +/* }}} */ + +/* {{{ php_apc_update */ +int php_apc_update(char *strkey, int strkey_len, apc_cache_updater_t updater, void* data TSRMLS_DC) +{ + if (!APCG(enabled)) { + return 0; + } + + if (APCG(serializer_name)) { + /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ + apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC); + } + + HANDLE_BLOCK_INTERRUPTIONS(); + + if (!apc_cache_update(apc_user_cache, strkey, strkey_len + 1, updater, data TSRMLS_CC)) { + HANDLE_UNBLOCK_INTERRUPTIONS(); + return 0; + } + + HANDLE_UNBLOCK_INTERRUPTIONS(); + + return 1; +} +/* }}} */ + +/* {{{ apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const zend_bool exclusive) + */ +static void apc_store_helper(INTERNAL_FUNCTION_PARAMETERS, const zend_bool exclusive) +{ + zval *key = NULL; + zval *val = NULL; + long ttl = 0L; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zl", &key, &val, &ttl) == FAILURE) { + return; + } + + if (!key || !APCG(enabled)) { + /* cannot work without key */ + RETURN_FALSE; + } + + HANDLE_BLOCK_INTERRUPTIONS(); + + /* keep it tidy */ + { + if (APCG(serializer_name)) { + /* Avoid race conditions between MINIT of apc and serializer exts like igbinary */ + apc_cache_serializer(apc_user_cache, APCG(serializer_name) TSRMLS_CC); + } + + if (Z_TYPE_P(key) == IS_ARRAY) { + + zval **hentry; + char *hkey = NULL; + zend_uint hkey_len; + zend_ulong hkey_idx; + + HashPosition hpos; + HashTable* hash = Z_ARRVAL_P(key); + + /* note: only indicative of error */ + array_init(return_value); + zend_hash_internal_pointer_reset_ex(hash, &hpos); + while(zend_hash_get_current_data_ex(hash, (void**)&hentry, &hpos) == SUCCESS) { + zend_hash_get_current_key_ex(hash, &hkey, &hkey_len, &hkey_idx, 0, &hpos); + if (hkey) { + if(!apc_cache_store(apc_user_cache, hkey, hkey_len, *hentry, (zend_uint) ttl, exclusive TSRMLS_CC)) { + add_assoc_long_ex(return_value, hkey, hkey_len, -1); /* -1: insertion error */ + } + /* reset key for next element */ + hkey = NULL; + } else { + add_index_long(return_value, hkey_idx, -1); /* -1: insertion error */ + } + zend_hash_move_forward_ex(hash, &hpos); + } + return; + } else { + if (Z_TYPE_P(key) == IS_STRING) { + if (!val) { + /* nothing to store */ + HANDLE_UNBLOCK_INTERRUPTIONS(); + RETURN_FALSE; + } + /* return true on success */ + if(apc_cache_store(apc_user_cache, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, val, (zend_uint) ttl, exclusive TSRMLS_CC)) { + HANDLE_UNBLOCK_INTERRUPTIONS(); + RETURN_TRUE; + } + } else { + apc_warning("apc_store expects key parameter to be a string or an array of key/value pairs." TSRMLS_CC); + } + } + } + + HANDLE_UNBLOCK_INTERRUPTIONS(); + + /* default */ + RETURN_FALSE; +} +/* }}} */ + +/* {{{ proto bool apcu_enabled(void) + returns true when apcu is usable in the current environment */ +PHP_FUNCTION(apcu_enabled) { + RETURN_BOOL(APCG(enabled)); +} /* }}} */ + +/* {{{ proto int apc_store(mixed key, mixed var [, long ttl ]) + */ +PHP_FUNCTION(apcu_store) { + apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); +} +/* }}} */ + +/* {{{ proto int apc_add(mixed key, mixed var [, long ttl ]) + */ +PHP_FUNCTION(apcu_add) { + apc_store_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); +} +/* }}} */ + +/* {{{ php_inc_updater */ + +struct php_inc_updater_args { + long step; + long lval; +}; + +static zend_bool php_inc_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { + + struct php_inc_updater_args *args = (struct php_inc_updater_args*) data; + + zval* val = entry->val; + + if (Z_TYPE_P(val) == IS_LONG) { + Z_LVAL_P(val) += args->step; + args->lval = Z_LVAL_P(val); + return 1; + } + + return 0; +} +/* }}} */ + +/* {{{ proto long apc_inc(string key [, long step [, bool& success]]) + */ +PHP_FUNCTION(apcu_inc) { + char *strkey; + int strkey_len; + struct php_inc_updater_args args = {1L, -1}; + zval *success = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) { + return; + } + + if (success) { + zval_dtor(success); + } + + if (php_apc_update(strkey, strkey_len, php_inc_updater, &args TSRMLS_CC)) { + if (success) { + ZVAL_TRUE(success); + } + + RETURN_LONG(args.lval); + } + + if (success) { + ZVAL_FALSE(success); + } + + RETURN_FALSE; +} +/* }}} */ + +/* {{{ proto long apc_dec(string key [, long step [, bool &success]]) + */ +PHP_FUNCTION(apcu_dec) { + char *strkey; + int strkey_len; + struct php_inc_updater_args args = {1L, -1}; + zval *success = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) { + return; + } + + if (success) { + zval_dtor(success); + } + + args.step = args.step * -1; + + if (php_apc_update(strkey, strkey_len, php_inc_updater, &args TSRMLS_CC)) { + if (success) ZVAL_TRUE(success); + RETURN_LONG(args.lval); + } + + if (success) { + ZVAL_FALSE(success); + } + + RETURN_FALSE; +} +/* }}} */ + +/* {{{ php_cas_updater */ +static zend_bool php_cas_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { + long* vals = ((long*)data); + long old = vals[0]; + long new = vals[1]; + zval* val = entry->val; + + if (Z_TYPE_P(val) == IS_LONG) { + if (Z_LVAL_P(val) == old) { + Z_LVAL_P(val) = new; + return 1; + } + } + + return 0; +} +/* }}} */ + +/* {{{ proto int apc_cas(string key, int old, int new) + */ +PHP_FUNCTION(apcu_cas) { + char *strkey; + int strkey_len; + long vals[2]; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll", &strkey, &strkey_len, &vals[0], &vals[1]) == FAILURE) { + return; + } + + if (php_apc_update(strkey, strkey_len, php_cas_updater, &vals TSRMLS_CC)) { + RETURN_TRUE; + } + + RETURN_FALSE; +} +/* }}} */ + +void *apc_erealloc_wrapper(void *ptr, size_t size) { + return _erealloc(ptr, size, 0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC); +} + +/* {{{ proto mixed apc_fetch(mixed key[, bool &success]) + */ +PHP_FUNCTION(apcu_fetch) { + zval *key; + zval *success = NULL; + apc_cache_entry_t* entry; + time_t t; + apc_context_t ctxt = {0,}; + + if (!APCG(enabled)) { + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &key, &success) == FAILURE) { + return; + } + + t = apc_time(); + + if (success) { + ZVAL_BOOL(success, 0); + } + + if (Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) { + convert_to_string(key); + } + + /* check for a string, or array of strings */ + if (Z_TYPE_P(key) == IS_ARRAY || (Z_TYPE_P(key) == IS_STRING && Z_STRLEN_P(key) > 0)) { + + /* initialize a context */ + if (apc_cache_make_context(apc_user_cache, &ctxt, APC_CONTEXT_NOSHARE, APC_UNPOOL, APC_COPY_OUT, 0 TSRMLS_CC)) { + + if (Z_TYPE_P(key) == IS_STRING) { + + /* do find using string as key */ + if ((entry = apc_cache_find(apc_user_cache, Z_STRVAL_P(key), (Z_STRLEN_P(key) + 1), t TSRMLS_CC))) { + /* deep-copy returned shm zval to emalloc'ed return_value */ + apc_cache_fetch_zval( + &ctxt, return_value, entry->val TSRMLS_CC); + /* decrement refcount of entry */ + apc_cache_release( + apc_user_cache, entry TSRMLS_CC); + /* set success */ + if (success) { + ZVAL_BOOL(success, 1); + } + + } else { ZVAL_BOOL(return_value, 0); } + + } else if (Z_TYPE_P(key) == IS_ARRAY) { + + /* do find using key as array of strings */ + HashPosition hpos; + zval **hentry; + zval *result; + + MAKE_STD_ZVAL(result); + array_init(result); + + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &hpos); + while(zend_hash_get_current_data_ex(Z_ARRVAL_P(key), (void**)&hentry, &hpos) == SUCCESS) { + + if (Z_TYPE_PP(hentry) == IS_STRING) { + + /* perform find using this index as key */ + if ((entry = apc_cache_find(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1), t TSRMLS_CC))) { + zval *result_entry; + + /* deep-copy returned shm zval to emalloc'ed return_value */ + MAKE_STD_ZVAL(result_entry); + apc_cache_fetch_zval( + &ctxt, result_entry, entry->val TSRMLS_CC); + /* decrement refcount of entry */ + apc_cache_release( + apc_user_cache, entry TSRMLS_CC); + /* add the emalloced value to return array */ + zend_hash_add( + Z_ARRVAL_P(result), Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1, &result_entry, sizeof(zval*), NULL); + } + } else { + + /* we do not break loop, we just skip the key */ + apc_warning( + "apc_fetch() expects a string or array of strings." TSRMLS_CC); + } + + /* don't set values we didn't find */ + zend_hash_move_forward_ex(Z_ARRVAL_P(key), &hpos); + } + + RETVAL_ZVAL(result, 0, 1); + + if (success) { + ZVAL_BOOL(success, 1); + } + } + + apc_cache_destroy_context(&ctxt TSRMLS_CC ); + } + + } else { + apc_warning("apc_fetch() expects a string or array of strings." TSRMLS_CC); + RETURN_FALSE; + } + return; +} +/* }}} */ + +/* {{{ proto mixed apc_exists(mixed key) + */ +PHP_FUNCTION(apcu_exists) { + zval *key; + time_t t; + + if (!APCG(enabled)) { + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &key) == FAILURE) { + return; + } + + t = apc_time(); + + if (Z_TYPE_P(key) != IS_STRING && Z_TYPE_P(key) != IS_ARRAY) { + convert_to_string(key); + } + + if (Z_TYPE_P(key) == IS_STRING) { + if (Z_STRLEN_P(key)) { + if (apc_cache_exists(apc_user_cache, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, t TSRMLS_CC)) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } + } + } else if (Z_TYPE_P(key) == IS_ARRAY) { + HashPosition hpos; + zval **hentry; + zval *result; + + MAKE_STD_ZVAL(result); + array_init(result); + + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &hpos); + while (zend_hash_get_current_data_ex(Z_ARRVAL_P(key), (void**)&hentry, &hpos) == SUCCESS) { + if (Z_TYPE_PP(hentry) == IS_STRING) { + if (apc_cache_exists(apc_user_cache, Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) + 1, t TSRMLS_CC)) { + zval *result_entry; + + MAKE_STD_ZVAL(result_entry); + ZVAL_BOOL(result_entry, 1); + + zend_hash_add( + Z_ARRVAL_P(result), + Z_STRVAL_PP(hentry), Z_STRLEN_PP(hentry) +1, + &result_entry, sizeof(zval*), NULL + ); + } + } else { + apc_warning( + "apc_exists() expects a string or array of strings." TSRMLS_CC); + } + + /* don't set values we didn't find */ + zend_hash_move_forward_ex(Z_ARRVAL_P(key), &hpos); + } + RETURN_ZVAL(result, 0, 1); + } else { + apc_warning("apc_exists() expects a string or array of strings." TSRMLS_CC); + } + + RETURN_FALSE; +} +/* }}} */ + +/* {{{ proto mixed apc_delete(mixed keys) + */ +PHP_FUNCTION(apcu_delete) { + zval *keys; + + if (!APCG(enabled)) { + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &keys) == FAILURE) { + return; + } + + if (Z_TYPE_P(keys) == IS_STRING) { + if (!Z_STRLEN_P(keys)) { + RETURN_FALSE; + } + + if (apc_cache_delete(apc_user_cache, Z_STRVAL_P(keys), (Z_STRLEN_P(keys) + 1) TSRMLS_CC)) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } + + } else if (Z_TYPE_P(keys) == IS_ARRAY) { + HashPosition hpos; + zval **hentry; + + array_init(return_value); + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &hpos); + + while (zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), (void**)&hentry, &hpos) == SUCCESS) { + if (Z_TYPE_PP(hentry) != IS_STRING) { + apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); + add_next_index_zval(return_value, *hentry); + Z_ADDREF_PP(hentry); + } else if (apc_cache_delete(apc_user_cache, Z_STRVAL_PP(hentry), (Z_STRLEN_PP(hentry) + 1) TSRMLS_CC) != 1) { + add_next_index_zval(return_value, *hentry); + Z_ADDREF_PP(hentry); + } + zend_hash_move_forward_ex(Z_ARRVAL_P(keys), &hpos); + } + } else if (Z_TYPE_P(keys) == IS_OBJECT) { + + if (apc_iterator_delete(keys TSRMLS_CC)) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } + } else { + apc_warning("apc_delete() expects a string, array of strings, or APCIterator instance." TSRMLS_CC); + } +} +/* }}} */ + +/* {{{ proto mixed apcu_bin_dump([array vars]) + Returns a binary dump of the given user variables from the APC cache. + A NULL for vars signals a dump of every entry, while array() will dump nothing. + */ +PHP_FUNCTION(apcu_bin_dump) { + + zval *z_vars = NULL; + HashTable *h_vars; + apc_bd_t *bd; + + if (!APCG(enabled)) { + apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC); + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &z_vars) == FAILURE) { + return; + } + + h_vars = z_vars ? Z_ARRVAL_P(z_vars) : NULL; + bd = apc_bin_dump(apc_user_cache, h_vars TSRMLS_CC); + if (bd) { + RETVAL_STRINGL((char*)bd, bd->size-1, 0); + } else { + apc_error("Unknown error encountered during apc_bin_dump." TSRMLS_CC); + RETVAL_NULL(); + } + + return; +} +/* }}} */ + +#ifdef APC_FULL_BC +/* {{{ proto mixed apc_bin_dump([array files [, array user_vars]]) + Compatibility mode for old APC + */ +PHP_FUNCTION(apc_bin_dump) { + + zval *z_files = NULL, *z_user_vars = NULL; + HashTable *h_user_vars; + apc_bd_t *bd; + + if(!APCG(enabled)) { + apc_warning("APC is not enabled, apc_bin_dump not available." TSRMLS_CC); + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &z_files, &z_user_vars) == FAILURE) { + return; + } + + h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL; + bd = apc_bin_dump(apc_user_cache, h_user_vars TSRMLS_CC); + if(bd) { + RETVAL_STRINGL((char*)bd, bd->size-1, 0); + } else { + apc_error("Unknown error encountered during apc_bin_dump." TSRMLS_CC); + RETVAL_NULL(); + } + + return; +} +/* }}} */ +#endif + +/* {{{ proto mixed apcu_bin_dumpfile(array vars, string filename, [int flags [, resource context]]) + Output a binary dump of the given user variables from the APC cache to the named file. + */ +PHP_FUNCTION(apcu_bin_dumpfile) { + + zval *z_vars = NULL; + HashTable *h_vars; + char *filename = NULL; + int filename_len; + long flags=0; + zval *zcontext = NULL; + php_stream_context *context = NULL; + php_stream *stream; + int numbytes = 0; + apc_bd_t *bd; + + if (!APCG(enabled)) { + apc_warning("APC is not enabled, apc_bin_dumpfile not available." TSRMLS_CC); + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!s|lr!", &z_vars, &filename, &filename_len, &flags, &zcontext) == FAILURE) { + return; + } + + if (!filename_len) { + apc_error("apc_bin_dumpfile filename argument must be a valid filename." TSRMLS_CC); + RETURN_FALSE; + } + + h_vars = z_vars ? Z_ARRVAL_P(z_vars) : NULL; + bd = apc_bin_dump(apc_user_cache, h_vars TSRMLS_CC); + if (!bd) { + apc_error("Unknown error encountered during apc_bin_dumpfile." TSRMLS_CC); + RETURN_FALSE; + } + + + /* Most of the following has been taken from the file_get/put_contents functions */ + + context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); + stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb", + ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); + if (stream == NULL) { + efree(bd); + apc_error("Unable to write to file in apc_bin_dumpfile." TSRMLS_CC); + RETURN_FALSE; + } + + if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) { + php_stream_close(stream); + efree(bd); + apc_error("Unable to get a lock on file in apc_bin_dumpfile." TSRMLS_CC); + RETURN_FALSE; + } + + numbytes = php_stream_write(stream, (char*)bd, bd->size); + if (numbytes != bd->size) { + numbytes = -1; + } + + php_stream_close(stream); + efree(bd); + + if (numbytes < 0) { + apc_error("Only %d of %d bytes written, possibly out of free disk space" TSRMLS_CC, numbytes, bd->size); + RETURN_FALSE; + } + + RETURN_LONG(numbytes); +} +/* }}} */ + +#ifdef APC_FULL_BC +/* {{{ proto mixed apc_bin_dumpfile(array files, array user_vars, string filename, [int flags [, resource context]]) + Compatibility mode for old APC + */ +PHP_FUNCTION(apc_bin_dumpfile) { + + zval *z_files = NULL, *z_user_vars = NULL; + HashTable *h_user_vars; + char *filename = NULL; + int filename_len; + long flags=0; + zval *zcontext = NULL; + php_stream_context *context = NULL; + php_stream *stream; + int numbytes = 0; + apc_bd_t *bd; + + if(!APCG(enabled)) { + apc_warning("APC is not enabled, apc_bin_dumpfile not available." TSRMLS_CC); + RETURN_FALSE; + } + + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!s|lr!", &z_files, &z_user_vars, &filename, &filename_len, &flags, &zcontext) == +FAILURE) { + return; + } + + if(!filename_len) { + apc_error("apc_bin_dumpfile filename argument must be a valid filename." TSRMLS_CC); + RETURN_FALSE; + } + + h_user_vars = z_user_vars ? Z_ARRVAL_P(z_user_vars) : NULL; + bd = apc_bin_dump(apc_user_cache, h_user_vars TSRMLS_CC); + if(!bd) { + apc_error("Unknown error encountered during apc_bin_dumpfile." TSRMLS_CC); + RETURN_FALSE; + } + + + /* Most of the following has been taken from the file_get/put_contents functions */ + + context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); + stream = php_stream_open_wrapper_ex(filename, (flags & PHP_FILE_APPEND) ? "ab" : "wb", + ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); + if (stream == NULL) { + efree(bd); + apc_error("Unable to write to file in apc_bin_dumpfile." TSRMLS_CC); + RETURN_FALSE; + } + + if (flags & LOCK_EX && php_stream_lock(stream, LOCK_EX)) { + php_stream_close(stream); + efree(bd); + apc_error("Unable to get a lock on file in apc_bin_dumpfile." TSRMLS_CC); + RETURN_FALSE; + } + + numbytes = php_stream_write(stream, (char*)bd, bd->size); + if(numbytes != bd->size) { + numbytes = -1; + } + + php_stream_close(stream); + efree(bd); + + if(numbytes < 0) { + apc_error("Only %d of %d bytes written, possibly out of free disk space" TSRMLS_CC, numbytes, bd->size); + RETURN_FALSE; + } + + RETURN_LONG(numbytes); +} +/* }}} */ +#endif + +/* {{{ proto mixed apcu_bin_load(string data, [int flags]) + Load the given binary dump into the APC file/user cache. + */ +PHP_FUNCTION(apcu_bin_load) { + + int data_len; + char *data; + long flags = 0; + + if (!APCG(enabled)) { + apc_warning("APC is not enabled, apc_bin_load not available." TSRMLS_CC); + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &flags) == FAILURE) { + return; + } + + if (!data_len || data_len != ((apc_bd_t*)data)->size -1) { + apc_error("apc_bin_load string argument does not appear to be a valid APC binary dump due to size (%d vs expected %d)." TSRMLS_CC, data_len, +((apc_bd_t*)data)->size -1); + RETURN_FALSE; + } + + apc_bin_load(apc_user_cache, (apc_bd_t*)data, (int)flags TSRMLS_CC); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ proto mixed apc_bin_loadfile(string filename, [resource context, [int flags]]) + Load the given binary dump from the named file into the APC file/user cache. + */ +PHP_FUNCTION(apcu_bin_loadfile) { + + char *filename; + int filename_len; + zval *zcontext = NULL; + long flags = 0; + php_stream_context *context = NULL; + php_stream *stream; + char *data; + int len; + + if (!APCG(enabled)) { + apc_warning("APC is not enabled, apc_bin_loadfile not available." TSRMLS_CC); + RETURN_FALSE; + } + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r!l", &filename, &filename_len, &zcontext, &flags) == FAILURE) { + return; + } + + if (!filename_len) { + apc_error("apc_bin_loadfile filename argument must be a valid filename." TSRMLS_CC); + RETURN_FALSE; + } + + context = php_stream_context_from_zval(zcontext, 0); + stream = php_stream_open_wrapper_ex(filename, "rb", + ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context); + if (!stream) { + apc_error("Unable to read from file in apc_bin_loadfile." TSRMLS_CC); + RETURN_FALSE; + } + + len = php_stream_copy_to_mem(stream, &data, PHP_STREAM_COPY_ALL, 0); + if (len == 0) { + apc_warning("File passed to apc_bin_loadfile was empty: %s." TSRMLS_CC, filename); + RETURN_FALSE; + } else if (len < 0) { + apc_warning("Error reading file passed to apc_bin_loadfile: %s." TSRMLS_CC, filename); + RETURN_FALSE; + } else if (len != ((apc_bd_t*)data)->size) { + apc_warning("file passed to apc_bin_loadfile does not appear to be valid due to size (%d vs expected %d)." TSRMLS_CC, len, +((apc_bd_t*)data)->size -1); + RETURN_FALSE; + } + php_stream_close(stream); + + apc_bin_load(apc_user_cache, (apc_bd_t*)data, (int)flags TSRMLS_CC); + efree(data); + + RETURN_TRUE; +} +/* }}} */ + +/* {{{ arginfo */ +#if (PHP_MAJOR_VERSION >= 6 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3)) +# define PHP_APC_ARGINFO +#else +# define PHP_APC_ARGINFO static +#endif + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_store, 0, 0, 2) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, var) + ZEND_ARG_INFO(0, ttl) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_enabled, 0, 0, 0) +ZEND_END_ARG_INFO() + +#ifdef APC_FULL_BC +PHP_APC_ARGINFO +/* this will generate different reflection but retains functional compatibility */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cache_info, 0, 0, 0) + ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, limited) +ZEND_END_ARG_INFO() +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_clear_cache, 0, 0, 0) + ZEND_ARG_INFO(0, cache) +ZEND_END_ARG_INFO() +#else +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cache_info, 0, 0, 0) + ZEND_ARG_INFO(0, limited) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_clear_cache, 0, 0, 0) +ZEND_END_ARG_INFO() +#endif + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_key_info, 0, 0, 1) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_sma_info, 0, 0, 0) + ZEND_ARG_INFO(0, limited) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO(arginfo_apcu_delete, 0) + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_fetch, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(1, success) +ZEND_END_ARG_INFO() + + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_inc, 0, 0, 1) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, step) + ZEND_ARG_INFO(1, success) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO(arginfo_apcu_cas, 0) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, old) + ZEND_ARG_INFO(0, new) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO(arginfo_apcu_exists, 0) + ZEND_ARG_INFO(0, keys) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_dump, 0, 0, 0) + ZEND_ARG_INFO(0, user_vars) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_dumpfile, 0, 0, 2) + ZEND_ARG_INFO(0, user_vars) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, flags) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_load, 0, 0, 1) + ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_bin_loadfile, 0, 0, 1) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, context) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + + +#ifdef APC_FULL_BC +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dump, 0, 0, 0) + ZEND_ARG_INFO(0, files) + ZEND_ARG_INFO(0, user_vars) +ZEND_END_ARG_INFO() + +PHP_APC_ARGINFO +ZEND_BEGIN_ARG_INFO_EX(arginfo_apc_bin_dumpfile, 0, 0, 3) + ZEND_ARG_INFO(0, files) + ZEND_ARG_INFO(0, user_vars) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, flags) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() +#endif +/* }}} */ + +/* {{{ apcu_functions[] */ +zend_function_entry apcu_functions[] = { + PHP_FE(apcu_cache_info, arginfo_apcu_cache_info) + PHP_FE(apcu_clear_cache, arginfo_apcu_clear_cache) + PHP_FE(apcu_sma_info, arginfo_apcu_sma_info) + PHP_FE(apcu_key_info, arginfo_apcu_key_info) + PHP_FE(apcu_enabled, arginfo_apcu_enabled) + PHP_FE(apcu_store, arginfo_apcu_store) + PHP_FE(apcu_fetch, arginfo_apcu_fetch) + PHP_FE(apcu_delete, arginfo_apcu_delete) + PHP_FE(apcu_add, arginfo_apcu_store) + PHP_FE(apcu_inc, arginfo_apcu_inc) + PHP_FE(apcu_dec, arginfo_apcu_inc) + PHP_FE(apcu_cas, arginfo_apcu_cas) + PHP_FE(apcu_exists, arginfo_apcu_exists) + PHP_FE(apcu_bin_dump, arginfo_apcu_bin_dump) + PHP_FE(apcu_bin_load, arginfo_apcu_bin_load) + PHP_FE(apcu_bin_dumpfile, arginfo_apcu_bin_dumpfile) + PHP_FE(apcu_bin_loadfile, arginfo_apcu_bin_loadfile) + {NULL, NULL, NULL} +}; +/* }}} */ + +/* {{{ module definition structure */ + +zend_module_entry apcu_module_entry = { + STANDARD_MODULE_HEADER, + PHP_APCU_EXTNAME, + apcu_functions, + PHP_MINIT(apcu), + PHP_MSHUTDOWN(apcu), + PHP_RINIT(apcu), + NULL, + PHP_MINFO(apcu), + PHP_APCU_VERSION, + STANDARD_MODULE_PROPERTIES +}; + +#ifdef APC_FULL_BC + +PHP_MINFO_FUNCTION(apc) +{ + php_info_print_table_start(); + php_info_print_table_row(2, "APC support", "Emulated"); + php_info_print_table_end(); +} + +/* {{{ apc_functions[] */ +zend_function_entry apc_functions[] = { + PHP_FALIAS(apc_cache_info, apcu_cache_info, arginfo_apcu_cache_info) + PHP_FALIAS(apc_clear_cache, apcu_clear_cache, arginfo_apcu_clear_cache) + PHP_FALIAS(apc_sma_info, apcu_sma_info, arginfo_apcu_sma_info) + PHP_FALIAS(apc_store, apcu_store, arginfo_apcu_store) + PHP_FALIAS(apc_fetch, apcu_fetch, arginfo_apcu_fetch) + PHP_FALIAS(apc_delete, apcu_delete, arginfo_apcu_delete) + PHP_FALIAS(apc_add, apcu_add, arginfo_apcu_store) + PHP_FALIAS(apc_inc, apcu_inc, arginfo_apcu_inc) + PHP_FALIAS(apc_dec, apcu_dec, arginfo_apcu_inc) + PHP_FALIAS(apc_cas, apcu_cas, arginfo_apcu_cas) + PHP_FALIAS(apc_exists, apcu_exists, arginfo_apcu_exists) + PHP_FE(apc_bin_dump, arginfo_apc_bin_dump) + PHP_FE(apc_bin_dumpfile, arginfo_apc_bin_dumpfile) + PHP_FALIAS(apc_bin_load, apcu_bin_load, arginfo_apcu_bin_load) + PHP_FALIAS(apc_bin_loadfile, apcu_bin_loadfile, arginfo_apcu_bin_loadfile) + {NULL, NULL, NULL} +}; + +zend_module_entry apc_module_entry = { + STANDARD_MODULE_HEADER, + "apc", + apc_functions, + NULL, + NULL, + NULL, + NULL, + PHP_MINFO(apc), + PHP_APCU_VERSION, + STANDARD_MODULE_PROPERTIES, +}; + +static void apc_init(INIT_FUNC_ARGS) +{ + zend_register_internal_module(&apc_module_entry TSRMLS_CC); +} + +#endif + + +#ifdef COMPILE_DL_APCU +ZEND_GET_MODULE(apcu) +#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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/php_apc.h php5-easybib-apcu-4.0.7/apcu-4.0.7/php_apc.h --- php5-easybib-apcu-4.0.6/apcu-4.0.7/php_apc.h 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/php_apc.h 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,55 @@ +/* + +----------------------------------------------------------------------+ + | APC | + +----------------------------------------------------------------------+ + | Copyright (c) 2006-2011 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 | + | George Schlossnagle | + | 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. + + */ + +/* $Id: php_apc.h 328953 2013-01-03 02:19:19Z rasmus $ */ + +#ifndef PHP_APC_H +#define PHP_APC_H + +#include "apc_php.h" +#include "apc_globals.h" + +#define PHP_APCU_VERSION "4.0.7" +#define PHP_APCU_EXTNAME "apcu" + +extern zend_module_entry apcu_module_entry; +#define apcu_module_ptr &apcu_module_entry + +#define phpext_apcu_ptr apcu_module_ptr + +#endif /* PHP_APC_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 -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/README.md php5-easybib-apcu-4.0.7/apcu-4.0.7/README.md --- php5-easybib-apcu-4.0.6/apcu-4.0.7/README.md 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/README.md 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,37 @@ + +APCu +==== + +APCu is userland caching: APC stripped of opcode caching in preparation for the deployment of Zend Optimizer+ as the primary solution to opcode caching in future versions of PHP. + +APCu has a revised and simplified codebase, by the time the PECL release is available, every part of APCu being used will have received review and where necessary or appropriate, changes. + +Simplifying and documenting the API of APCu completely removes the barrier to maintenance and development of APCu in the future, and additionally allows us to make optimizations not possible previously because of APC's inherent complexity. + +APCu only supports userland caching (and dumping) of variables, providing an upgrade path for the future. When O+ takes over, many will be tempted to use 3rd party solutions to userland caching, possibly even distributed solutions; this would be a grave error. The tried and tested APC codebase provides far superior support for local storage of PHP variables. + +[![Build Status](https://travis-ci.org/krakjoe/apcu.svg?branch=simplify)](https://travis-ci.org/krakjoe/apcu) + +Specific Changes +================ + + * appropriate changes (removals) to configuration parameters (complete) + * appropriate changes to userspace management script (complete) + * revision of APC locking (complete) + * revision of APC's caching API (complete) + * revision of APC's PHP internals (complete) + * revision of APC's userspace API (complete) + * revision of APC's shared memory allocator (complete) + * revision of APC's pooling API (complete, no functional changes, documented) + * installation of SIGUSR1 handler (where possible) to clear cache (complete) + * format API headers so they can be referenced externally (complete, see apcue) + * apc.smart allows runtime adjustable control over how the cache is purged (complete) + * documentation of all associated API's (ongoing, mostly complete, all headers and source file documented and commented) + +Still to Do: +============ + + * test/stabilize + +The C api does not retain backward compatibility, anyone relying on APC that will rely on APCu in the future should review the changes as soon as possible and continue to track them. +The PHP api will retain compatibility with APC, as will common configuration options, providing a drop in replacement. diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/TECHNOTES.txt php5-easybib-apcu-4.0.7/apcu-4.0.7/TECHNOTES.txt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/TECHNOTES.txt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/TECHNOTES.txt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,293 @@ +APC Quick-Start Braindump + +This is a rapidly written braindump of how APC currently works in the +form of a quick-start guide to start hacking on APC. + +1. Install and use APC a bit so you know what it does from the end-user's + perspective. + user-space functions are all explained here: + +2. Grab the current APC code from CVS: + + cvs -d:pserver:cvsread@cvs.php.net:/repository login + Password: phpfi + cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/apc + + apc/php_apc.c has most of the code for the user-visible stuff. It is + also a regular PHP extension in the sense that there are MINIT, MINFO, + MSHUTDOWN, RSHUTDOWN, etc. functions. + +3. Build it. + + cd pecl/apc + phpize + ./configure --enable-apcu + make + cp modules/apcu.so /usr/local/lib/php + apachectl restart + +4. Debugging Hints + + apachectl stop + gdb /usr/bin/httpd + break ?? + run -X + + Grab the .gdbinit from the PHP source tree and have a look at the macros. + +5. The basics of APCu + + APCu has three main component parts: + 1) shared memory allocator + 2) pooling + 3) user land cache + +5.1) APCu SMA + + It is a pretty standard memory allocator, now supporting third party extensions. + + apc_sma_malloc, apc_sma_realloc, apc_sma_strdup and apc_sma_free + behave to the caller just like malloc, realloc, strdup and free, they are + generated from macros in apc_sma_api.h + + Note: apc_sma_api.h is formatted and designed such that the SMA APCu + uses can be used by third parties in their own extensions without + interfering with, or consuming the resources of APCu itself + + apc_sma is a structure of type apc_sma_t, it is statically allocated at runtime, + appropriate handlers are generated and set, and the structure made ready for initialization. + + MINIT then initializes apc_sma with apc_sma_api_init(). + APCu SMA then takes care of mmaping the shared memory. + ( which you can obtain in any compilation unit with apc_sma_api_extern(apc_sma) ) + + At this point, we have a completely useless 32MB chunk of memory at our disposal, before + it can be used, an apc_cache_header_t is initialized at the beginning of the reigon of + mmapp'ed memory. + + The header serves as a place to store, among other things, statistical information and a lock. + + Immediately after the header comes a zero sized block, immediately after that a single + block the remaining size of the shared memory. + + At this point, the shared memory looks like this: + + +--------+--------+----------------------------------+ + | header | 0-size | shared | + +--------+--------+----------------------------------+ + + The blocks are just a simple offset-based linked list (so no pointers): + + typedef struct block_t block_t; + struct block_t { + 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: + + #define BLOCKAT(offset) ((block_t*)((char *)shmaddr + offset)) + + where shmaddr = sma->shaddrs[0] + + And the OFFSET macro goes the other way: + + #define OFFSET(block) ((int)(((char*)block) - (char*)shmaddr)) + + Allocating a block walks through the linked list of blocks until it finds one that is >= + to the requested size. The first call to allocate will hit the second block. We then + chop up that block so it looks like this: + + +--------+-------+-------+-------------------------+ + | header | block | block | block | + +--------+-------+-------+-------------------------+ + + Then we unlink that block from the linked list so it won't show up + as an available block on the next allocate. So we actually have: + + +--------+-------+ +-------------------------+ + | header | block |------>| block | + +--------+-------+ +-------------------------+ + + And header->avail along with block->size of the remaining large + block are updated accordingly. The arrow there representing the + link which now points to a block with an offset further along in + the segment. + + When the block is freed the steps are basically just reversed. + The block is put back and then the deallocate code looks at the block before and after to see + if the block immediately before and after are free and if so the blocks are combined. So you never + have 2 free blocks next to each other, apart from at the front with that + 0-sized dummy block. This mostly prevents fragmentation. I have been + toying with the idea of always allocating block at 2^n boundaries to make + it more likely that they will be re-used to cut down on fragmentation further. + That's what the POWER_OF_TWO_BLOCKSIZE you see in apc_sma.c is all about. + +5.2) APCu Pooling + + Pooling serves as a means to provide operations with a context: without context, managing memory within + APCu would become near impossible, and very error prone. + + Whenever APCu is instructed to undertake an operation that requires relinquishing the owner of some memory + a struct of type apc_cache_context_t is passed, among other things, the context contains a pool, + the pool provides references to handlers that are appropriate for the current operation. + + For example: To copy data into the shared area, APCu will require the use of allocators that return blocks + from shared memory. To copy data out of the shared area and hand over ownership to PHP, normal + allocators must be used. + + For more information about pooling, see apc_pool.h/apc_pool.c in the source distribution. + +5.3) APCu Cache + + The caching functionality of APCu is provided by a modified version of the APC source code + + Some simple tweaks have been applied: + Locking is written to use the best kind of locking available, and emulate it where it is not to simplify logic. + Extension of the SMA to support multiple instances, such that additional caches using APCu do not + increase contention of the main APCu cache. + The possibility to control more finely what happens when resources become low for APCu. + An exposed, coherent, and documented API and example included in the distribution. + + There's probably some of my blood in it, if you look real close ... + + The remainder of the document goes on to explain in some detail the cache itself, functionally unchanged by APCu + +6. Next up is apc_cache.c which implements the cache logic. + + Having initialized a suitable allocator, MINIT must call apc_cache_create, using the allocator provided + APCu will create a cache. The parameters to apc_cache_create for APCu are defined by various INI settings. + API users can provide the same options from anywhere ( their globals for example ). + + The cache is stored in/described by this struct allocated locally: + + /* {{{ struct definition: apc_cache_t */ + typedef struct _apc_cache_t { + void* shmaddr; /* process (local) address of shared cache */ + apc_cache_header_t* header; /* cache header (stored in SHM) */ + apc_cache_slot_t** slots; /* array of cache slots (stored in SHM) */ + apc_sma_t* sma; /* set during creation of cache */ + apc_serializer_t* serializer; /* serializer */ + zend_ulong nslots; /* number of slots in cache */ + zend_ulong gc_ttl; /* maximum time on GC list for a slot */ + zend_ulong ttl; /* if slot is needed and entry's access time is older than this ttl, remove it */ + zend_ulong smart; /* smart parameter for gc */ + zend_bool defend; /* defense parameter for runtime */ + } apc_cache_t; /* }}} */ + + Whenever you see functions that take a 'cache' argument, this is what they + take. + + At the beginning of the cache we have a header. The header looks like this: + + /* {{{ struct definition: apc_cache_header_t + Any values that must be shared among processes should go in here. */ + typedef struct _apc_cache_header_t { + apc_lock_t lock; /* header lock */ + zend_ulong nhits; /* hit count */ + zend_ulong nmisses; /* miss count */ + zend_ulong ninserts; /* insert count */ + zend_ulong nexpunges; /* expunge count */ + zend_ulong nentries; /* entry count */ + zend_ulong mem_size; /* used */ + time_t stime; /* start time */ + volatile zend_ushort state; /* cache state */ + apc_cache_key_t lastkey; /* last key inserted (not necessarily without error) */ + apc_cache_slot_t* gc; /* gc list */ + } apc_cache_header_t; /* }}} */ + + Since this is at the start of the shared memory segment, these values are accessible + across all processes / threads and hence access to them has to be locked. + + After the header we have an array of slots. The number of slots is user-defined + through the apc.entries_hint ini hint. Each slot is described by: + + /* {{{ struct definition: apc_cache_slot_t */ + typedef struct apc_cache_slot_t apc_cache_slot_t; + struct apc_cache_slot_t { + apc_cache_key_t key; /* slot key */ + apc_cache_entry_t* value; /* slot value */ + apc_cache_slot_t* next; /* next slot in linked list */ + zend_ulong nhits; /* number of hits to this slot */ + time_t ctime; /* time slot was initialized */ + time_t dtime; /* time slot was removed from cache */ + time_t atime; /* time slot was last accessed */ + }; + /* }}} */ + + The apc_cache_slot_t *next there is a linked list to other slots that happened to hash to the + same array position. + + apc_cache_insert() shows what happens on a new cache insert. + + slot = &cache->slots[zend_inline_hash_func(key, keylen) % cache->nslots]; + + cache->slots is our array of slots in the segment. + + So, on an insert we find the array position in the slots array by hashing the key provided. + If there are currently no other slots there, we just create the slot and stick it into + the array: + + *slot = make_slot(cache, key, value, *slot, t TSRMLS_CC) + + If there are other slots already at this position we walk the link list to get to + the end. + + While walking the linked list we also check to see if the cache has a TTL defined. + If while walking the linked list we see a slot that has expired, we remove it + since we are right there looking at it. This is the only place we remove stale + entries unless the shared memory segment fills up and we force a full expunge via + apc_cache_expunge(). apc_cache_expunge() walks all slots attempting deletion, how + deletion occurs depends on runtime parameters, see INSTALL for runtime parameter + configuration details. + + apc_cache_find() simply hashes and returns the entry if it is there. If it is there + but older than the mtime in the entry we are looking for, we delete the one that is + there and return indicating we didn't find it. + + API users are advised to use apc_cache_fetch over find for simplicity, this ensures + correct operation, fetch sets up the call to find and takes care of copying and releasing + the entry from the cache to a zval* provided. + + Next we need to understand what an actual cache entry looks like. Have a look at + apc_cache.h for the structs. Here is the definition of apc_cache_key_t: + + /* {{{ struct definition: apc_cache_key_t */ + typedef struct _apc_cache_key_t { + const char *str; /* pointer to constant string key */ + zend_uint len; /* length of data at str */ + zend_ulong h; /* pre-computed hash of key */ + time_t mtime; /* the mtime of this cached entry */ + apc_cache_owner_t owner; /* the context that created this key */ + } apc_cache_key_t; /* }}} */ + + To create a apc_cache_key_t structure, call apc_cache_make_key(), see apc_cache.h + + Ok, on to the actual cache entry, here is the definition of apc_cache_entry_t: + + /* {{{ struct definition: apc_cache_entry_t */ + typedef struct _apc_cache_entry_t { + zval *val; /* the zval copied at store time */ + zend_uint ttl; /* the ttl on this specific entry */ + int ref_count; /* the reference count of this entry */ + size_t mem_size; /* memory used */ + apc_pool *pool; /* pool which allocated the value */ + } apc_cache_entry_t; + /* }}} */ + + To create an apc_cache_entry_t, call apc_cache_make_entry(), see apc_cache.h + + Any of the structures taken by apc_cache_* functions have their equivalent apc_cache_make_* + + If an insertion of an entry should fail, it falls to the caller of insert to free + the pooled resources used to create the entry. + + + +If you made it to the end of this, you should have a pretty good idea of where things are in +the code. There is much more reading to do in headers ... good luck ... + diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/023-2.inc php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/023-2.inc --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/023-2.inc 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/023-2.inc 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,6 @@ + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. + + + diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/024.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/024.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/024.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/024.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,11627 @@ +--TEST-- +Looped regression test (may take a while) (from tests/lang/024.phpt) +--INI-- +apc.enabled=1 +apc.cache_by_default=1 +apc.enable_cli=1 +--FILE-- + + + +*** Testing assignments and variable aliasing: *** + +This should read "blah": +This should read "this is nifty": +************************************************* + +*** Testing integer operators *** + +Correct result - 8: + +Correct result - 8: + +Correct result - 2: + +Correct result - -2: + +Correct result - 15: + +Correct result - 15: + +Correct result - 2: + +Correct result - 3: + +********************************* + +*** Testing real operators *** + +Correct result - 8: + +Correct result - 8: + +Correct result - 2: + +Correct result - -2: + +Correct result - 15: + +Correct result - 15: + +Correct result - 2: + +Correct result - 3: + +********************************* + +*** Testing if/elseif/else control *** + + + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +0) { + $j--; + } + } +} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ + $i = ++$j; + echo "hmm, this shouldn't be displayed #2\n"; + if (1) { + $j = ++$i; + if (0) { + $j = $i*2+$j*($i++); + if (1) { + $i++; + echo "damn, this shouldn't be displayed\n"; + } else { + $j++; + echo "this shouldn't be displayed either\n"; + } + } else if (1) { + ++$j; + echo "this isn't supposed to be displayed\n"; + } + } elseif (0) { + $j++; + echo "this definitely shouldn't be displayed\n"; + } else { + $i++; + echo "and this too shouldn't be displayed\n"; + } +} else { + $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ + echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j\n"; + if (1) { + $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ + if (0) { + $j += 40; + if (1) { + $i += 50; + echo "damn, this shouldn't be displayed\n"; + } else { + $j += 20; + echo "this shouldn't be displayed either\n"; + } + } else if (1) { + $j *= $i; /* $j *= 2 --> $j == 4 */ + echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j\n"; + echo "3 loop iterations should follow:\n"; + while ($i<=$j) { + echo $i++." $j\n"; + } + } + } elseif (0) { + echo "this definitely shouldn't be displayed\n"; + } else { + echo "and this too shouldn't be displayed\n"; + } + echo "**********************************\n"; +} +?> + +*** C-style else-if's *** + +************************* + +*** WHILE tests *** +$j) { + echo "$i is greater than $j\n"; + } else if ($i==$j) { + echo "$i equals $j\n"; + } else { + echo "$i is smaller than $j\n"; + } + $i++; +} +?> +******************* + + +*** Nested WHILEs *** + +********************* + +*** hash test... *** + + +************************** + +*** Hash resizing test *** + 0) { + $a = $a . "a"; + echo "$a\n"; + $resize[$a] = $i; + $i--; +} +$i = 10; +$a = "b"; +while ($i > 0) { + $a = $a . "a"; + echo "$a\n"; + echo $resize[$a]."\n"; + $i--; +} +?> +************************** + + +*** break/continue test *** +2) { + break; + } + $j=0; + echo "\$j should go from 3 to 4, and \$q should go from 3 to 4\n"; + while ($j<5) { + if ($j<=2) { + $j++; + continue; + } + echo " \$j=$j\n"; + for ($q=0; $q<=10; $q++) { + if ($q<3) { + continue; + } + if ($q>4) { + break; + } + echo " \$q=$q\n"; + } + $j++; + } + $j=0; + echo "\$j should go from 0 to 2\n"; + while ($j<5) { + if ($j>2) { + $k=0; + echo "\$k should go from 0 to 2\n"; + while ($k<5) { + if ($k>2) { + break 2; + } + echo " \$k=$k\n"; + $k++; + } + } + echo " \$j=$j\n"; + $j++; + } + echo "\$i=$i\n"; + $i++; +} +?> +*********************** + +*** Nested file include test *** + +******************************** + + +--EXPECT-- + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_001.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_001.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_001.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,32 @@ +--TEST-- +APC: apc_store/fetch with strings +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +string(11) "hello world" +string(11) "hello world" +string(4) "nice" +string(11) "hello world" +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_002.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_002.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_002.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,34 @@ +--TEST-- +APC: apc_store/fetch with objects +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- +a = true; +var_dump($bar); + +?> +===DONE=== + +--EXPECTF-- +object(foo)#%d (0) { +} +object(foo)#%d (0) { +} +object(foo)#%d (1) { + ["a"]=> + bool(true) +} +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_003b.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_003b.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_003b.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_003b.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,117 @@ +--TEST-- +APC: apc_store/fetch with objects (php 5.3) +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- +a = true; +var_dump($bar); + +class bar extends foo +{ + public $pub = 'bar'; + protected $pro = 'bar'; + private $pri = 'bar'; // we don't see this, we'd need php 5.1 new serialization + + function __construct() + { + $this->bar = true; + } + + function change() + { + $this->pri = 'mod'; + } +} + +class baz extends bar +{ + private $pri = 'baz'; + + function __construct() + { + parent::__construct(); + $this->baz = true; + } +} + +$baz = new baz; +var_dump($baz); +$baz->change(); +var_dump($baz); +apc_store('baz', $baz); +unset($baz); +var_dump(apc_fetch('baz')); + +?> +===DONE=== + +--EXPECTF-- +object(foo)#%d (0) { +} +object(foo)#%d (0) { +} +object(foo)#%d (1) { + ["a"]=> + bool(true) +} +object(baz)#%d (6) { + ["pri":"baz":private]=> + string(3) "baz" + ["pub"]=> + string(3) "bar" + ["pro":protected]=> + string(3) "bar" + ["pri":"bar":private]=> + string(3) "bar" + ["bar"]=> + bool(true) + ["baz"]=> + bool(true) +} +object(baz)#%d (6) { + ["pri":"baz":private]=> + string(3) "baz" + ["pub"]=> + string(3) "bar" + ["pro":protected]=> + string(3) "bar" + ["pri":"bar":private]=> + string(3) "mod" + ["bar"]=> + bool(true) + ["baz"]=> + bool(true) +} +object(baz)#%d (6) { + ["pri":"baz":private]=> + string(3) "baz" + ["pub"]=> + string(3) "bar" + ["pro":protected]=> + string(3) "bar" + ["pri":"bar":private]=> + string(3) "mod" + ["bar"]=> + bool(true) + ["baz"]=> + bool(true) +} +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_003.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_003.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_003.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_003.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,117 @@ +--TEST-- +APC: apc_store/fetch with objects (php pre-5.3) +--SKIPIF-- += 0) { + echo "skip\n"; + } +?> +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- +a = true; +var_dump($bar); + +class bar extends foo +{ + public $pub = 'bar'; + protected $pro = 'bar'; + private $pri = 'bar'; // we don't see this, we'd need php 5.1 new serialization + + function __construct() + { + $this->bar = true; + } + + function change() + { + $this->pri = 'mod'; + } +} + +class baz extends bar +{ + private $pri = 'baz'; + + function __construct() + { + parent::__construct(); + $this->baz = true; + } +} + +$baz = new baz; +var_dump($baz); +$baz->change(); +var_dump($baz); +apc_store('baz', $baz); +unset($baz); +var_dump(apc_fetch('baz')); + +?> +===DONE=== + +--EXPECTF-- +object(foo)#%d (0) { +} +object(foo)#%d (0) { +} +object(foo)#%d (1) { + ["a"]=> + bool(true) +} +object(baz)#%d (6) { + ["pri:private"]=> + string(3) "baz" + ["pub"]=> + string(3) "bar" + ["pro:protected"]=> + string(3) "bar" + ["pri:private"]=> + string(3) "bar" + ["bar"]=> + bool(true) + ["baz"]=> + bool(true) +} +object(baz)#%d (6) { + ["pri:private"]=> + string(3) "baz" + ["pub"]=> + string(3) "bar" + ["pro:protected"]=> + string(3) "bar" + ["pri:private"]=> + string(3) "mod" + ["bar"]=> + bool(true) + ["baz"]=> + bool(true) +} +object(baz)#%d (6) { + ["pri:private"]=> + string(3) "baz" + ["pub"]=> + string(3) "bar" + ["pro:protected"]=> + string(3) "bar" + ["pri:private"]=> + string(3) "mod" + ["bar"]=> + bool(true) + ["baz"]=> + bool(true) +} +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_004.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_004.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_004.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_004.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,38 @@ +--TEST-- +APC: apc_store/fetch with bools +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +bool(false) +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_005.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_005.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_005.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_005.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,50 @@ +--TEST-- +APC: apc_store/fetch with arrays of objects +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +array(2) { + [0]=> + object(stdClass)#1 (0) { + } + [1]=> + object(stdClass)#2 (0) { + } +} +array(2) { + [0]=> + object(stdClass)#1 (0) { + } + [1]=> + object(stdClass)#2 (0) { + } +} +array(2) { + [0]=> + object(stdClass)#3 (0) { + } + [1]=> + object(stdClass)#4 (0) { + } +} +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_006.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_006.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_006.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_006.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,73 @@ +--TEST-- +APC: apc_store/fetch reference test +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +apc.serializer=default +report_memleaks=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +array(9) refcount(2){ + [0]=> + string(1) "a" refcount(1) + [1]=> + &array(1) refcount(2){ + [0]=> + string(1) "c" refcount(1) + } + [2]=> + &array(1) refcount(2){ + [0]=> + string(1) "c" refcount(1) + } + [3]=> + &string(1) "d" refcount(3) + [4]=> + &string(1) "d" refcount(3) + [5]=> + &string(1) "d" refcount(3) + [6]=> + string(1) "e" refcount(2) + [7]=> + string(1) "e" refcount(2) + [8]=> + &array(2) refcount(2){ + [0]=> + string(1) "f" refcount(1) + [1]=> + &array(2) refcount(2){ + [0]=> + string(1) "f" refcount(1) + [1]=> + *RECURSION* + } + } +} +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_007.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_007.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_007.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_007.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,46 @@ +--TEST-- +APC: apc_inc/apc_dec test +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +$foobar = 2 +$foobar += 1 = 3 +$foobar += 10 = 13 +$foobar -= 1 = 12 +$foobar -= 10 = 2 +$f__bar += 1 = fail +$perfection -= 1 = epic fail +$foobar += 1 = 3 +pass by ref success 1 +$foobar -= 1 = 2 +pass by ref success 1 +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_008.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_008.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_008.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_008.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,34 @@ +--TEST-- +APC: apc_cas test +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +$foobar = 2 +$foobar == 1 ? 2 : 1 = fail +$foobar == 2 ? 1 : 2 = ok +$foobar = 1 +$f__bar == 1 ? 2 : 1 = fail +$perfection == 2 ? 1 : 2 = epic fail +$foobar = 1 +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_010.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_010.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_010.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_010.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,83 @@ +--TEST-- +APC: apc_store/fetch/add with array of key/value pairs. +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +array(0) { +} +array(4) { + ["key1"]=> + string(6) "value1" + ["key2"]=> + string(6) "value2" + ["key3"]=> + array(2) { + [0]=> + string(7) "value3a" + [1]=> + string(7) "value3b" + } + ["key4"]=> + int(4) +} +array(2) { + ["key1"]=> + string(6) "value1" + ["key3"]=> + array(2) { + [0]=> + string(7) "value3a" + [1]=> + string(7) "value3b" + } +} +array(2) { + ["key1"]=> + int(-1) + ["key3"]=> + int(-1) +} +array(4) { + ["key1"]=> + string(6) "value1" + ["key2"]=> + string(6) "value2" + ["key3"]=> + array(2) { + [0]=> + string(7) "value3a" + [1]=> + string(7) "value3b" + } + ["key4"]=> + int(4) +} +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_011.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_011.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_011.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_011.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,26 @@ +--TEST-- +APC: apc_fetch resets array pointers +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +apc.file_update_protection=0 +--FILE-- + +===DONE=== + +--EXPECTF-- +string(3) "bar" +string(3) "bar" +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc54_014.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc54_014.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc54_014.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc54_014.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,100 @@ +--TEST-- +APC: Bug #61742 preload_path does not work due to incorrect string length (variant 1) (php 5.4) +--SKIPIF-- +getTotalCount()); //returns 50000 +var_dump(\$it->current()); //returns false on error +FL; + +$args = array( + 'apc.enabled=1', + 'apc.enable_cli=1', + 'apc.shm_size=256M', +); + +server_start($file, $args); + +for ($i = 0; $i < 3; $i++) { + run_test_simple(); +} +echo 'done'; + +--EXPECTF-- +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +int(50000) +array(11) { + ["type"]=> + string(4) "user" + ["key"]=> + string(42) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" + ["value"]=> + string(%d) "%s" + ["num_hits"]=> + int(0) + ["modified_time"]=> + int(%d) + ["creation_time"]=> + int(%d) + ["deletion_time"]=> + int(0) + ["access_time"]=> + int(%d) + ["ref_count"]=> + int(0) + ["mem_size"]=> + int(%d) + ["ttl"]=> + int(0) +} +done diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_bin_001.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_bin_001.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_bin_001.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_bin_001.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,23 @@ +--TEST-- +APC: bindump user cache, variation 1 +--SKIPIF-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +--FILE-- + +===DONE=== + +--EXPECTF-- +bool(false) +int(42) +===DONE=== diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_bin_002.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_bin_002.phpt --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/apc_bin_002.phpt 1970-01-01 00:00:00.000000000 +0000 +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/apc_bin_002.phpt 2014-10-11 17:02:21.000000000 +0000 @@ -0,0 +1,29 @@ +--TEST-- +APC: bindump user cache, variation 2 +--SKIPIF-- + + +===DONE=== + +--CLEAN-- + + +===DONE=== + +--CLEAN-- + +--INI-- +apc.enabled=1 +apc.enable_cli=1 +--FILE-- + +===DONE=== + +--CLEAN-- +b->f(); + return array('b'); + } +} + + +class B{ + const A_CONSTANT = 1; + public \$var; + + public function f(){ + \$this->var = self::A_CONSTANT; + } +} + + +if(isset(\$_SESSION['lalala'])){ + echo "
    ";
    +	\$a = \$_SESSION['lalala'];
    +	print_r(\$a);
    +} else {
    +	echo "no session yet, first run\n";
    +}
    +
    +//	another file
    +//	class A and B use autoload
    +\$b = new B();
    +\$a = new A();
    +\$a->b = \$b;
    +
    +\$_SESSION['lalala'] = \$a;
    +session_write_close();
    +FL;
    +
    +$args = array(
    +	'apc.enabled=1',
    +	'apc.cache_by_default=1',
    +	'apc.enable_cli=1',
    +);
    +
    +server_start($file, $args);
    +
    +$sid = md5(uniqid("call me maybe", true));
    +for ($i = 0; $i < 10; $i++) {
    +	$send = "GET / HTTP/1.1\n" .
    +			"Host: " . PHP_CLI_SERVER_HOSTNAME . "\n" .
    +			"Cookie: PHPSESSID=$sid;" .
    +			"\r\n\r\n";
    +	for ($j = 0; $j < $num_servers; $j++) {
    +		run_test(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT+$j, $send);
    +	}
    +}
    +echo 'done';
    +--EXPECT--
    +no session yet, first run
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +
    A Object
    +(
    +    [b] => B Object
    +        (
    +            [var] => 1
    +        )
    +
    +)
    +done
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/data/abc.data php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/data/abc.data
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/data/abc.data	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/data/abc.data	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1 @@
    +s:3:"123"
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/get_included_files_inc1.inc php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/get_included_files_inc1.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/get_included_files_inc1.inc	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/get_included_files_inc1.inc	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,3 @@
    +
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/get_included_files_inc2.inc php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/get_included_files_inc2.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/get_included_files_inc2.inc	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/get_included_files_inc2.inc	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,4 @@
    +
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/get_included_files_inc3.inc php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/get_included_files_inc3.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/get_included_files_inc3.inc	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/get_included_files_inc3.inc	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,4 @@
    +
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_001.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_001.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_001.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_001.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,111 @@
    +--TEST--
    +APC: APCIterator general
    +--SKIPIF--
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +--FILE--
    +$value) {
    +  $keys[$key] = $value['key'];
    +}
    +ksort($keys);
    +var_dump($keys);
    +?>
    +===DONE===
    +
    +--EXPECT--
    +array(41) {
    +  ["key0"]=>
    +  string(4) "key0"
    +  ["key1"]=>
    +  string(4) "key1"
    +  ["key10"]=>
    +  string(5) "key10"
    +  ["key11"]=>
    +  string(5) "key11"
    +  ["key12"]=>
    +  string(5) "key12"
    +  ["key13"]=>
    +  string(5) "key13"
    +  ["key14"]=>
    +  string(5) "key14"
    +  ["key15"]=>
    +  string(5) "key15"
    +  ["key16"]=>
    +  string(5) "key16"
    +  ["key17"]=>
    +  string(5) "key17"
    +  ["key18"]=>
    +  string(5) "key18"
    +  ["key19"]=>
    +  string(5) "key19"
    +  ["key2"]=>
    +  string(4) "key2"
    +  ["key20"]=>
    +  string(5) "key20"
    +  ["key21"]=>
    +  string(5) "key21"
    +  ["key22"]=>
    +  string(5) "key22"
    +  ["key23"]=>
    +  string(5) "key23"
    +  ["key24"]=>
    +  string(5) "key24"
    +  ["key25"]=>
    +  string(5) "key25"
    +  ["key26"]=>
    +  string(5) "key26"
    +  ["key27"]=>
    +  string(5) "key27"
    +  ["key28"]=>
    +  string(5) "key28"
    +  ["key29"]=>
    +  string(5) "key29"
    +  ["key3"]=>
    +  string(4) "key3"
    +  ["key30"]=>
    +  string(5) "key30"
    +  ["key31"]=>
    +  string(5) "key31"
    +  ["key32"]=>
    +  string(5) "key32"
    +  ["key33"]=>
    +  string(5) "key33"
    +  ["key34"]=>
    +  string(5) "key34"
    +  ["key35"]=>
    +  string(5) "key35"
    +  ["key36"]=>
    +  string(5) "key36"
    +  ["key37"]=>
    +  string(5) "key37"
    +  ["key38"]=>
    +  string(5) "key38"
    +  ["key39"]=>
    +  string(5) "key39"
    +  ["key4"]=>
    +  string(4) "key4"
    +  ["key40"]=>
    +  string(5) "key40"
    +  ["key5"]=>
    +  string(4) "key5"
    +  ["key6"]=>
    +  string(4) "key6"
    +  ["key7"]=>
    +  string(4) "key7"
    +  ["key8"]=>
    +  string(4) "key8"
    +  ["key9"]=>
    +  string(4) "key9"
    +}
    +===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_002.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_002.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_002.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_002.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,40 @@
    +--TEST--
    +APC: APCIterator regex
    +--SKIPIF--
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +apc.file_update_protection=0
    +--FILE--
    +$value) {
    +  $vals[$key] = $value['key'];
    +}
    +ksort($vals);
    +var_dump($vals);
    +
    +?>
    +===DONE===
    +
    +--EXPECT--
    +array(4) {
    +  ["key10"]=>
    +  string(5) "key10"
    +  ["key20"]=>
    +  string(5) "key20"
    +  ["key30"]=>
    +  string(5) "key30"
    +  ["key40"]=>
    +  string(5) "key40"
    +}
    +===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_003.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_003.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_003.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_003.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,114 @@
    +--TEST--
    +APC: APCIterator chunk size
    +--SKIPIF--
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +apc.file_update_protection=0
    +--FILE--
    +$value) {
    +  $vals[$key] = $value['key'];
    +}
    +ksort($vals);
    +var_dump($vals);
    +
    +?>
    +===DONE===
    +
    +--EXPECT--
    +array(41) {
    +  ["key0"]=>
    +  string(4) "key0"
    +  ["key1"]=>
    +  string(4) "key1"
    +  ["key10"]=>
    +  string(5) "key10"
    +  ["key11"]=>
    +  string(5) "key11"
    +  ["key12"]=>
    +  string(5) "key12"
    +  ["key13"]=>
    +  string(5) "key13"
    +  ["key14"]=>
    +  string(5) "key14"
    +  ["key15"]=>
    +  string(5) "key15"
    +  ["key16"]=>
    +  string(5) "key16"
    +  ["key17"]=>
    +  string(5) "key17"
    +  ["key18"]=>
    +  string(5) "key18"
    +  ["key19"]=>
    +  string(5) "key19"
    +  ["key2"]=>
    +  string(4) "key2"
    +  ["key20"]=>
    +  string(5) "key20"
    +  ["key21"]=>
    +  string(5) "key21"
    +  ["key22"]=>
    +  string(5) "key22"
    +  ["key23"]=>
    +  string(5) "key23"
    +  ["key24"]=>
    +  string(5) "key24"
    +  ["key25"]=>
    +  string(5) "key25"
    +  ["key26"]=>
    +  string(5) "key26"
    +  ["key27"]=>
    +  string(5) "key27"
    +  ["key28"]=>
    +  string(5) "key28"
    +  ["key29"]=>
    +  string(5) "key29"
    +  ["key3"]=>
    +  string(4) "key3"
    +  ["key30"]=>
    +  string(5) "key30"
    +  ["key31"]=>
    +  string(5) "key31"
    +  ["key32"]=>
    +  string(5) "key32"
    +  ["key33"]=>
    +  string(5) "key33"
    +  ["key34"]=>
    +  string(5) "key34"
    +  ["key35"]=>
    +  string(5) "key35"
    +  ["key36"]=>
    +  string(5) "key36"
    +  ["key37"]=>
    +  string(5) "key37"
    +  ["key38"]=>
    +  string(5) "key38"
    +  ["key39"]=>
    +  string(5) "key39"
    +  ["key4"]=>
    +  string(4) "key4"
    +  ["key40"]=>
    +  string(5) "key40"
    +  ["key5"]=>
    +  string(4) "key5"
    +  ["key6"]=>
    +  string(4) "key6"
    +  ["key7"]=>
    +  string(4) "key7"
    +  ["key8"]=>
    +  string(4) "key8"
    +  ["key9"]=>
    +  string(4) "key9"
    +}
    +===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_004.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_004.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_004.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_004.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,40 @@
    +--TEST--
    +APC: APCIterator regex & chunk size & list
    +--SKIPIF--
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +apc.file_update_protection=0
    +--FILE--
    +$value) {
    +  $vals[$key] = $value['key'];
    +}
    +ksort($vals);
    +var_dump($vals);
    +
    +?>
    +===DONE===
    +
    +--EXPECT--
    +array(4) {
    +  ["key10"]=>
    +  string(5) "key10"
    +  ["key20"]=>
    +  string(5) "key20"
    +  ["key30"]=>
    +  string(5) "key30"
    +  ["key40"]=>
    +  string(5) "key40"
    +}
    +===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_005.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_005.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_005.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_005.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,118 @@
    +--TEST--
    +APC: APCIterator delete
    +--SKIPIF--
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +--FILE--
    +$value) {
    +  $vals[$key] = $value['key'];
    +}
    +foreach($it2 as $key=>$value) {
    +  $vals2[$key] = $value['key'];
    +}
    +ksort($vals2);
    +var_dump($vals);
    +var_dump($vals2);
    +
    +?>
    +===DONE===
    +
    +--EXPECT--
    +array(0) {
    +}
    +array(37) {
    +  ["key0"]=>
    +  string(4) "key0"
    +  ["key1"]=>
    +  string(4) "key1"
    +  ["key11"]=>
    +  string(5) "key11"
    +  ["key12"]=>
    +  string(5) "key12"
    +  ["key13"]=>
    +  string(5) "key13"
    +  ["key14"]=>
    +  string(5) "key14"
    +  ["key15"]=>
    +  string(5) "key15"
    +  ["key16"]=>
    +  string(5) "key16"
    +  ["key17"]=>
    +  string(5) "key17"
    +  ["key18"]=>
    +  string(5) "key18"
    +  ["key19"]=>
    +  string(5) "key19"
    +  ["key2"]=>
    +  string(4) "key2"
    +  ["key21"]=>
    +  string(5) "key21"
    +  ["key22"]=>
    +  string(5) "key22"
    +  ["key23"]=>
    +  string(5) "key23"
    +  ["key24"]=>
    +  string(5) "key24"
    +  ["key25"]=>
    +  string(5) "key25"
    +  ["key26"]=>
    +  string(5) "key26"
    +  ["key27"]=>
    +  string(5) "key27"
    +  ["key28"]=>
    +  string(5) "key28"
    +  ["key29"]=>
    +  string(5) "key29"
    +  ["key3"]=>
    +  string(4) "key3"
    +  ["key31"]=>
    +  string(5) "key31"
    +  ["key32"]=>
    +  string(5) "key32"
    +  ["key33"]=>
    +  string(5) "key33"
    +  ["key34"]=>
    +  string(5) "key34"
    +  ["key35"]=>
    +  string(5) "key35"
    +  ["key36"]=>
    +  string(5) "key36"
    +  ["key37"]=>
    +  string(5) "key37"
    +  ["key38"]=>
    +  string(5) "key38"
    +  ["key39"]=>
    +  string(5) "key39"
    +  ["key4"]=>
    +  string(4) "key4"
    +  ["key5"]=>
    +  string(4) "key5"
    +  ["key6"]=>
    +  string(4) "key6"
    +  ["key7"]=>
    +  string(4) "key7"
    +  ["key8"]=>
    +  string(4) "key8"
    +  ["key9"]=>
    +  string(4) "key9"
    +}
    +===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_006.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_006.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_006.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_006.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,1284 @@
    +--TEST--
    +APC: APCIterator formats 
    +--SKIPIF--
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +apc.file_update_protection=0
    +apc.user_entries_hint=4096
    +--FILE--
    + $format) {
    +	if (APCU_APC_FULL_BC) {
    +		$it_array[$idx] = new APCIterator('user', NULL, $format);
    +	} else {
    +		$it_array[$idx] = new APCIterator(NULL, $format);
    +	}
    +}
    +
    +for($i = 0; $i < 11; $i++) {
    +  apc_store("key$i", "value$i");
    +}
    +
    +foreach ($it_array as $idx => $it) {
    +  print_it($it, $idx);
    +}
    +
    +function print_it($it, $idx) {
    +  echo "IT #$idx\n";
    +  echo "============================\n";
    +  foreach ($it as $key=>$value) {
    +    var_dump($key);
    +    var_dump($value);
    +  }
    +  echo "============================\n\n";
    +}
    +
    +?>
    +===DONE===
    +
    +--EXPECTF--
    +IT #0
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["key"]=>
    +  string(5) "key10"
    +}
    +string(4) "key0"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key0"
    +}
    +string(4) "key1"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key1"
    +}
    +string(4) "key2"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key2"
    +}
    +string(4) "key3"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key3"
    +}
    +string(4) "key4"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key4"
    +}
    +string(4) "key5"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key5"
    +}
    +string(4) "key6"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key6"
    +}
    +string(4) "key7"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key7"
    +}
    +string(4) "key8"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key8"
    +}
    +string(4) "key9"
    +array(1) {
    +  ["key"]=>
    +  string(4) "key9"
    +}
    +============================
    +
    +IT #1
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["value"]=>
    +  string(7) "value10"
    +}
    +string(4) "key0"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value0"
    +}
    +string(4) "key1"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value1"
    +}
    +string(4) "key2"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value2"
    +}
    +string(4) "key3"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value3"
    +}
    +string(4) "key4"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value4"
    +}
    +string(4) "key5"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value5"
    +}
    +string(4) "key6"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value6"
    +}
    +string(4) "key7"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value7"
    +}
    +string(4) "key8"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value8"
    +}
    +string(4) "key9"
    +array(1) {
    +  ["value"]=>
    +  string(6) "value9"
    +}
    +============================
    +
    +IT #2
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["num_hits"]=>
    +  int(0)
    +}
    +============================
    +
    +IT #3
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["modified_time"]=>
    +  int(%d)
    +}
    +============================
    +
    +IT #4
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["creation_time"]=>
    +  int(%d)
    +}
    +============================
    +
    +IT #5
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["deletion_time"]=>
    +  int(0)
    +}
    +============================
    +
    +IT #6
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["access_time"]=>
    +  int(%d)
    +}
    +============================
    +
    +IT #7
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["ref_count"]=>
    +  int(0)
    +}
    +============================
    +
    +IT #8
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +============================
    +
    +IT #9
    +============================
    +string(5) "key10"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key0"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key1"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key2"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key3"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key4"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key5"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key6"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key7"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key8"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key9"
    +array(1) {
    +  ["ttl"]=>
    +  int(0)
    +}
    +============================
    +
    +IT #10
    +============================
    +string(5) "key10"
    +array(0) {
    +}
    +string(4) "key0"
    +array(0) {
    +}
    +string(4) "key1"
    +array(0) {
    +}
    +string(4) "key2"
    +array(0) {
    +}
    +string(4) "key3"
    +array(0) {
    +}
    +string(4) "key4"
    +array(0) {
    +}
    +string(4) "key5"
    +array(0) {
    +}
    +string(4) "key6"
    +array(0) {
    +}
    +string(4) "key7"
    +array(0) {
    +}
    +string(4) "key8"
    +array(0) {
    +}
    +string(4) "key9"
    +array(0) {
    +}
    +============================
    +
    +IT #11
    +============================
    +string(5) "key10"
    +array(10) {
    +  ["key"]=>
    +  string(5) "key10"
    +  ["value"]=>
    +  string(7) "value10"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key0"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key0"
    +  ["value"]=>
    +  string(6) "value0"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key1"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key1"
    +  ["value"]=>
    +  string(6) "value1"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key2"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key2"
    +  ["value"]=>
    +  string(6) "value2"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key3"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key3"
    +  ["value"]=>
    +  string(6) "value3"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key4"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key4"
    +  ["value"]=>
    +  string(6) "value4"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key5"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key5"
    +  ["value"]=>
    +  string(6) "value5"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key6"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key6"
    +  ["value"]=>
    +  string(6) "value6"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key7"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key7"
    +  ["value"]=>
    +  string(6) "value7"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key8"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key8"
    +  ["value"]=>
    +  string(6) "value8"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +string(4) "key9"
    +array(10) {
    +  ["key"]=>
    +  string(4) "key9"
    +  ["value"]=>
    +  string(6) "value9"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +  ["ttl"]=>
    +  int(0)
    +}
    +============================
    +
    +IT #12
    +============================
    +string(5) "key10"
    +array(9) {
    +  ["key"]=>
    +  string(5) "key10"
    +  ["value"]=>
    +  string(7) "value10"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key0"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key0"
    +  ["value"]=>
    +  string(6) "value0"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key1"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key1"
    +  ["value"]=>
    +  string(6) "value1"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key2"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key2"
    +  ["value"]=>
    +  string(6) "value2"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key3"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key3"
    +  ["value"]=>
    +  string(6) "value3"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key4"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key4"
    +  ["value"]=>
    +  string(6) "value4"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key5"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key5"
    +  ["value"]=>
    +  string(6) "value5"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key6"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key6"
    +  ["value"]=>
    +  string(6) "value6"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key7"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key7"
    +  ["value"]=>
    +  string(6) "value7"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key8"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key8"
    +  ["value"]=>
    +  string(6) "value8"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key9"
    +array(9) {
    +  ["key"]=>
    +  string(4) "key9"
    +  ["value"]=>
    +  string(6) "value9"
    +  ["num_hits"]=>
    +  int(0)
    +  ["modified_time"]=>
    +  int(%d)
    +  ["creation_time"]=>
    +  int(%d)
    +  ["deletion_time"]=>
    +  int(0)
    +  ["access_time"]=>
    +  int(%d)
    +  ["ref_count"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +============================
    +
    +IT #13
    +============================
    +string(5) "key10"
    +array(3) {
    +  ["key"]=>
    +  string(5) "key10"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key0"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key0"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key1"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key1"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key2"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key2"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key3"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key3"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key4"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key4"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key5"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key5"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key6"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key6"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key7"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key7"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key8"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key8"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +string(4) "key9"
    +array(3) {
    +  ["key"]=>
    +  string(4) "key9"
    +  ["num_hits"]=>
    +  int(0)
    +  ["mem_size"]=>
    +  int(%d)
    +}
    +============================
    +
    +===DONE===
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_007.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_007.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_007.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_007.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,37 @@
    +--TEST--
    +APC: APCIterator Overwriting the ctor
    +--SKIPIF--
    +
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +--FILE--
    +rewind(),
    +	$obj->current(),
    +	$obj->key(),
    +	$obj->next(),
    +	$obj->valid(),
    +	$obj->getTotalHits(),
    +	$obj->getTotalSize(),
    +	$obj->getTotalCount(),
    +	apc_delete($obj)
    +);
    +?>
    +--EXPECTF--
    +bool(false)
    +bool(false)
    +bool(false)
    +bool(false)
    +bool(false)
    +bool(false)
    +bool(false)
    +bool(false)
    +bool(false)
    +
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_008.phpt php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_008.phpt
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/iterator_008.phpt	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/iterator_008.phpt	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,19 @@
    +--TEST--
    +APC: APCIterator::__construct() signature compatibility
    +--SKIPIF--
    +
    +
    +--INI--
    +apc.enabled=1
    +apc.enable_cli=1
    +--FILE--
    +
    +==DONE==
    +--EXPECTF--
    +==DONE==
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/php_5_3_ns.inc php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/php_5_3_ns.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/php_5_3_ns.inc	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/php_5_3_ns.inc	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,18 @@
    + STDIN,
    +		1 => STDOUT,
    +		2 => STDERR,
    +	);
    +
    +	$php_args = getenv('TEST_PHP_ARGS');
    +	if (empty($php_args)) {
    +		$ext = (substr(PHP_OS, 0, 3) == 'WIN') ? 'php_apcu.dll' : 'apcu.so';
    +		$php_args = "-d extension_dir=$doc_root/../modules -d extension=$ext";
    +	}
    +	if ($php_opts) {
    +		$php_args = "$php_args -d " . implode(' -d ', $php_opts);;
    +	}
    +
    +	if (substr(PHP_OS, 0, 3) == 'WIN') {
    +		$cmd = "{$php_executable} -n $php_args -t {$doc_root} -S $host:$port";
    +		if (!$no_router) {
    +			$cmd .= " {$router}";
    +		}
    +
    +		$handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true,  "suppress_errors" => true));
    +	} else {
    +		$cmd = "exec {$php_executable} -n $php_args -t {$doc_root} -S $host:$port";
    +		if (!$no_router) {
    +			$cmd .= " {$doc_root}/{$router}";
    +		}
    +		$cmd .= " 2>/dev/null";
    +
    +		$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
    +	}
    +	
    +	// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
    +	//       it might not be listening yet...need to wait until fsockopen() call returns
    +    $i = 0;
    +    while (($i++ < 10) && !connection_test($host, $port)) {
    +        usleep(100000);
    +    }
    +
    +	return $handle;
    +}
    +
    +function server_start($code = 'echo "Hello world";', $php_opts = array(), $no_router = FALSE)
    +{
    +	global $doc_root, $router, $handles, $ports, $num_servers;
    +
    +
    +	if ($code) {
    +		file_put_contents($doc_root . '/' . $router, '');
    +	}
    +
    +	for ($i = 0; $i < $num_servers; $i++) {
    +		$h = server_start_one(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT+$i, $code, $php_opts, $no_router);
    +		$handles[] = $h;
    +	}	
    +
    +	register_shutdown_function(
    +		function($handles) use($router) {
    +			foreach ($handles as $handle) {
    +				proc_terminate($handle);
    +			}
    +			@unlink(__DIR__ . "/{$router}");
    +		},
    +			$handles
    +		);
    +	// don't bother sleeping, server is already up
    +	// server can take a variable amount of time to be up, so just sleeping a guessed amount of time
    +	// does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass
    +	// sleeping doesn't work.
    +}
    +
    +function get_response($fp, $data_only = true)
    +{
    +	$s = '';
    +
    +	while (!feof($fp)) {
    +		$s .= fgets($fp);
    +	}
    +
    +	if ($data_only) {
    +		$parts = explode("\r\n\r\n", $s);
    +		$s = $parts[1];
    +	}
    +
    +	return $s;
    +}
    +
    +
    +function connection_test($host, $port)
    +{
    +	$port = intval($port)?:80;
    +
    +	$fp = @fsockopen($host, $port, $errno, $errstr, 2);
    +	if (!$fp) {
    +		return false;
    +	}
    +
    +	$send = "GET / HTTP/1.1\nHost: {$host}\r\n\r\n";
    +
    +	/* will not out here, just test if the connection has worked*/
    +	if(@fwrite($fp, $send)) {
    +		get_response($fp);
    +		fclose($fp);
    +
    +		return true;
    +	}
    +
    +	@fclose($fp);
    +
    +	return false;
    +}
    +
    +function run_test_simple($request_uri = NULL)
    +{
    +    global $num_servers;
    +	$send = "GET /" . $request_uri ." HTTP/1.1\nHost: " . PHP_CLI_SERVER_HOSTNAME . "\r\n\r\n";
    +
    +	for ($i = 0; $i < $num_servers; $i++) {
    +		run_test(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT+$i, $send);
    +	}
    +}
    +
    +function run_test($host, $port, $send)
    +{
    +	$fp = fsockopen($host, $port, $errno, $errstr, 3);
    +	if (!$fp) {
    +	  die(sprintf("connect failed errno=%d errstr='%s'", $errno, $errstr));
    +	}
    +
    +	if(fwrite($fp, $send)) {
    +		echo get_response($fp);
    +	}
    +
    +	fclose($fp);
    +}
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/skipif.inc php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/skipif.inc
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/tests/skipif.inc	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/tests/skipif.inc	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,3 @@
    +
    diff -Nru php5-easybib-apcu-4.0.6/apcu-4.0.7/TODO php5-easybib-apcu-4.0.7/apcu-4.0.7/TODO
    --- php5-easybib-apcu-4.0.6/apcu-4.0.7/TODO	1970-01-01 00:00:00.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/apcu-4.0.7/TODO	2014-10-11 17:02:21.000000000 +0000
    @@ -0,0 +1,35 @@
    +Known Bugs
    + 
    +1.   Gallery2 doesn't work with PHP5+APC.  There is something wrong
    +     with the way methods are restored in some edge case I haven't
    +     been able to figure out yet.
    +     To reproduce install gallery2 and click down to an individual photo.
    +
    +2.   apc_store() probably needs some checks to skip trying to store
    +     internal classes.  Something along the lines of:
    +
    +     if(Z_TYPE_P(val) == IS_OBJECT) {
    +        zend_class_entry *ce = Z_OBJCE_P(val);
    +        if(ce->type == ZEND_INTERNAL_CLASS) {
    +            php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot cache internal objects");
    +            RETURN_FALSE;
    +        }
    +     }
    +
    +     in the apc_store() function in php_apc.c but I am wondering if it needs to do more
    +     than that.
    +
    +Windows
    +
    +1.   The following configurations (build arguments) have not been implemented yet
    +
    +          (*) --enable-apc-mmap         	Memory mapping support
    +          (*) --enable-apc-sem         		Semaphore locking support (FCNTL replacement)
    +          (*) --enable-apc-phreadmutex		Thread mutexes, while implemented we should probably rename the internals to thread
    +	  (*) --enable-apc-pthreadrwlocks	Thread mutexes, read/write locking
    +
    +2.   Non-blocking locks is not supported either
    +
    +3.   Update fileinfo to support stat info in a more portable way (see PECL #17903)
    +
    +4.   Check whether the signal handling needs to be enabled, and if it makes sense on Windows
    \ No newline at end of file
    diff -Nru php5-easybib-apcu-4.0.6/debian/changelog php5-easybib-apcu-4.0.7/debian/changelog
    --- php5-easybib-apcu-4.0.6/debian/changelog	2015-07-02 06:54:18.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/debian/changelog	2015-07-02 06:54:18.000000000 +0000
    @@ -1,3 +1,9 @@
    +php5-easybib-apcu (4.0.7-0easybib0~trustyppa) trusty; urgency=medium
    +
    +  * apcu 4.0.7
    +
    + -- Florian Holzhauer (For packaging only, do not use for mail)   Thu, 02 Jul 2015 10:11:12 +0200
    +
     php5-easybib-apcu (4.0.6-0easybib0~trustyppa) trusty; urgency=medium
     
       * apcu 4.0.6
    diff -Nru php5-easybib-apcu-4.0.6/debian/changelog.precise php5-easybib-apcu-4.0.7/debian/changelog.precise
    --- php5-easybib-apcu-4.0.6/debian/changelog.precise	2015-07-02 06:54:18.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/debian/changelog.precise	1970-01-01 00:00:00.000000000 +0000
    @@ -1,12 +0,0 @@
    -php5-easybib-apcu (4.0.6-0easybib0~preciseppa) precise; urgency=medium
    -
    -  * apcu 4.0.6
    -
    - -- Florian Holzhauer (For packaging only, do not use for mail)   Fri, 15 Aug 2014 10:11:12 +0200
    -
    -php5-easybib-apcu (4.0.2-0easybib0~preciseppa) precise; urgency=medium
    -
    -  * apcu 4.0.2
    -
    - -- Florian Holzhauer (For packaging only, do not use for mail)   Mon, 04 Nov 2013 10:11:12 +0200
    - 
    diff -Nru php5-easybib-apcu-4.0.6/debian/changelog.trusty php5-easybib-apcu-4.0.7/debian/changelog.trusty
    --- php5-easybib-apcu-4.0.6/debian/changelog.trusty	2015-07-02 06:54:18.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/debian/changelog.trusty	2015-07-02 06:54:18.000000000 +0000
    @@ -1,3 +1,9 @@
    +php5-easybib-apcu (4.0.6-0easybib0~trustyppa) trusty; urgency=medium
    +
    +  * apcu 4.0.6
    +
    + -- Florian Holzhauer (For packaging only, do not use for mail)   Mon, 10 Nov 2014 10:11:12 +0200
    +
     php5-easybib-apcu (4.0.2-0easybib0~trustyppa) trusty; urgency=medium
     
       * apcu 4.0.2
    diff -Nru php5-easybib-apcu-4.0.6/package.xml php5-easybib-apcu-4.0.7/package.xml
    --- php5-easybib-apcu-4.0.6/package.xml	2014-06-12 13:39:04.000000000 +0000
    +++ php5-easybib-apcu-4.0.7/package.xml	2014-10-11 17:02:21.000000000 +0000
    @@ -16,11 +16,11 @@
       ab@php.net
       yes
      
    - 2014-06-12
    - 
    + 2014-10-11
    + 
      
    -  4.0.6
    -  4.0.6
    +  4.0.7
    +  4.0.7
      
      
       beta
    @@ -28,7 +28,7 @@
      
      PHP License
      
    -- fix issues with stddef inclusion causing compilation issue
    +- fix inconsistent member names for entries in userland
      
      
       
    @@ -71,9 +71,9 @@
        
        
        
    -   
    +   
        
    -   
    +   
        
        
        
    @@ -84,7 +84,7 @@
        
        
        
    -   
    +   
        
        
        
    @@ -108,12 +108,12 @@
        
        
        
    -   
    +   
        
        
        
    -   
    -   
    +   
    +