Skip to content

Instantly share code, notes, and snippets.

@krakjoe
Created March 26, 2013 08:13
Show Gist options
  • Select an option

  • Save krakjoe/5243813 to your computer and use it in GitHub Desktop.

Select an option

Save krakjoe/5243813 to your computer and use it in GitHub Desktop.
igbinary apcu patch
diff -uNr igbinary-1.1.1/apc_serializer.h igbinary-1.1.1-apcu-patched/apc_serializer.h
--- igbinary-1.1.1/apc_serializer.h 2011-03-14 12:32:48.000000000 +0000
+++ igbinary-1.1.1-apcu-patched/apc_serializer.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,81 +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 <gopalv@php.net> |
- +----------------------------------------------------------------------+
-
- */
-
-/* $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
-
-static int apc_register_serializer(const char* name,
- apc_serialize_t serialize,
- apc_unserialize_t unserialize,
- void *config TSRMLS_DC)
-{
- zval *apc_magic_constant = NULL;
- (void)config;
-
- ALLOC_INIT_ZVAL(apc_magic_constant);
-
- if (zend_get_constant(APC_SERIALIZER_CONSTANT, sizeof(APC_SERIALIZER_CONSTANT)-1, apc_magic_constant)) {
- if(apc_magic_constant) {
- apc_register_serializer_t register_func = (apc_register_serializer_t)(Z_LVAL_P(apc_magic_constant));
- if(register_func) {
- zval_dtor(apc_magic_constant);
- return register_func(name, serialize, unserialize, NULL TSRMLS_CC);
- }
- }
- }
-
- zval_dtor(apc_magic_constant);
-
- return 0;
-}
-
-#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 -uNr igbinary-1.1.1/igbinary.c igbinary-1.1.1-apcu-patched/igbinary.c
--- igbinary-1.1.1/igbinary.c 2011-03-14 12:32:48.000000000 +0000
+++ igbinary-1.1.1-apcu-patched/igbinary.c 2013-03-26 08:07:53.434651027 +0000
@@ -23,11 +23,7 @@
#include "ext/session/php_session.h"
#include "ext/standard/php_incomplete_class.h"
#ifdef HAVE_APC_SUPPORT
-# if USE_BUNDLED_APC
-# include "apc_serializer.h"
-# else
-# include "ext/apc/apc_serializer.h"
-# endif
+# include "ext/apcu/apc_api.h"
#endif /* HAVE_APC_SUPPORT */
#include "php_igbinary.h"
@@ -307,7 +303,7 @@
php_info_print_table_row(2, "igbinary support", "enabled");
php_info_print_table_row(2, "igbinary version", IGBINARY_VERSION);
#ifdef HAVE_APC_SUPPORT
- php_info_print_table_row(2, "igbinary APC serializer ABI", APC_SERIALIZER_ABI);
+ php_info_print_table_row(2, "igbinary APC serializer ABI", "yes");
#else
php_info_print_table_row(2, "igbinary APC serializer ABI", "no");
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment