php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #67529
Patch patch.c revision 2014-06-27 04:32 UTC by zaets28rus at gmail dot com

Patch patch.c for memcache Bug #67529

Patch version 2014-06-27 04:32 UTC

Return to Bug #67529 | Download this patch
Patch Revisions:

Developer: zaets28rus@gmail.com

diff --git a/memcache.c b/memcache.c
index 6a7576d..f9b79bd 100644
--- a/memcache.c
+++ b/memcache.c
@@ -59,49 +59,49 @@ ZEND_DECLARE_MODULE_GLOBALS(memcache)
 /* {{{ memcache_functions[]
  */
 zend_function_entry memcache_functions[] = {
-	PHP_FE(memcache_connect,		NULL)
-	PHP_FE(memcache_pconnect,		NULL)
-	PHP_FE(memcache_add_server,		NULL)
+	PHP_FE(memcache_connect,		arginfo_memcache_connect)
+	PHP_FE(memcache_pconnect,		arginfo_memcache_pconnect)
+	PHP_FE(memcache_add_server,		arginfo_memcache_add_server)
 	PHP_FE(memcache_set_server_params,		NULL)
 	PHP_FE(memcache_get_server_status,		NULL)
 	PHP_FE(memcache_get_version,	NULL)
-	PHP_FE(memcache_add,			NULL)
-	PHP_FE(memcache_set,			NULL)
-	PHP_FE(memcache_replace,		NULL)
-	PHP_FE(memcache_get,			NULL)
-	PHP_FE(memcache_delete,			NULL)
+	PHP_FE(memcache_add,			arginfo_memcache_add)
+	PHP_FE(memcache_set,			arginfo_memcache_set)
+	PHP_FE(memcache_replace,		arginfo_memcache_replace)
+	PHP_FE(memcache_get,			arginfo_memcache_get)
+	PHP_FE(memcache_delete,			arginfo_memcache_delete)
 	PHP_FE(memcache_debug,			NULL)
-	PHP_FE(memcache_get_stats,		NULL)
+	PHP_FE(memcache_get_stats,		arginfo_memcache_get_stats)
 	PHP_FE(memcache_get_extended_stats,		NULL)
 	PHP_FE(memcache_set_compress_threshold,	NULL)
-	PHP_FE(memcache_increment,		NULL)
-	PHP_FE(memcache_decrement,		NULL)
+	PHP_FE(memcache_increment,		arginfo_memcache_increment)
+	PHP_FE(memcache_decrement,		arginfo_memcache_decrement)
 	PHP_FE(memcache_close,			NULL)
 	PHP_FE(memcache_flush,			NULL)
-	PHP_FE(memcache_setoptimeout,	NULL)
+	PHP_FE(memcache_setoptimeout,	arginfo_memcache_setoptimeout)
 	{NULL, NULL, NULL}
 };
 
 static zend_function_entry php_memcache_class_functions[] = {
-	PHP_FALIAS(connect,			memcache_connect,			NULL)
-	PHP_FALIAS(pconnect,		memcache_pconnect,			NULL)
-	PHP_FALIAS(addserver,		memcache_add_server,		NULL)
+	PHP_FALIAS(connect,			memcache_connect,			arginfo_memcache_connect)
+	PHP_FALIAS(pconnect,		memcache_pconnect,			arginfo_memcache_pconnect)
+	PHP_FALIAS(addserver,		memcache_add_server,		arginfo_memcache_add_server)
 	PHP_FALIAS(setserverparams,		memcache_set_server_params,		NULL)
 	PHP_FALIAS(getserverstatus,		memcache_get_server_status,		NULL)
 	PHP_FALIAS(getversion,		memcache_get_version,		NULL)
-	PHP_FALIAS(add,				memcache_add,				NULL)
-	PHP_FALIAS(set,				memcache_set,				NULL)
-	PHP_FALIAS(replace,			memcache_replace,			NULL)
-	PHP_FALIAS(get,				memcache_get,				NULL)
-	PHP_FALIAS(delete,			memcache_delete,			NULL)
-	PHP_FALIAS(getstats,		memcache_get_stats,			NULL)
+	PHP_FALIAS(add,				memcache_add,				arginfo_memcache_add)
+	PHP_FALIAS(set,				memcache_set,				arginfo_memcache_set)
+	PHP_FALIAS(replace,			memcache_replace,			arginfo_memcache_replace)
+	PHP_FALIAS(get,				memcache_get,				arginfo_memcache_get)
+	PHP_FALIAS(delete,			memcache_delete,			arginfo_memcache_delete)
+	PHP_FALIAS(getstats,		memcache_get_stats,			arginfo_memcache_get_stats)
 	PHP_FALIAS(getextendedstats,		memcache_get_extended_stats,		NULL)
 	PHP_FALIAS(setcompressthreshold,	memcache_set_compress_threshold,	NULL)
-	PHP_FALIAS(increment,		memcache_increment,			NULL)
-	PHP_FALIAS(decrement,		memcache_decrement,			NULL)
+	PHP_FALIAS(increment,		memcache_increment,			arginfo_memcache_increment)
+	PHP_FALIAS(decrement,		memcache_decrement,			arginfo_memcache_decrement)
 	PHP_FALIAS(close,			memcache_close,				NULL)
 	PHP_FALIAS(flush,			memcache_flush,				NULL)
-	PHP_FALIAS(setoptimeout,	memcache_setoptimeout,		NULL)
+	PHP_FALIAS(setoptimeout,	memcache_setoptimeout,		arginfo_memcache_setoptimeout)
 	{NULL, NULL, NULL}
 };
 
diff --git a/php_memcache.h b/php_memcache.h
index 7e6ac4e..8e936e2 100644
--- a/php_memcache.h
+++ b/php_memcache.h
@@ -63,6 +63,81 @@ PHP_FUNCTION(memcache_close);
 PHP_FUNCTION(memcache_flush);
 PHP_FUNCTION(memcache_setoptimeout);
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_connect, 0, 0, 2)
+	ZEND_ARG_INFO(0, host)
+	ZEND_ARG_INFO(0, port)
+	ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_pconnect, 0, 0, 2)
+	ZEND_ARG_INFO(0, host)
+	ZEND_ARG_INFO(0, port)
+	ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_add, 0, 0, 4)
+	ZEND_ARG_INFO(0, key)
+	ZEND_ARG_INFO(0, var)
+	ZEND_ARG_INFO(0, flag)
+	ZEND_ARG_INFO(0, expire)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_add_server, 0, 0, 2)
+	ZEND_ARG_INFO(0, host)
+	ZEND_ARG_INFO(0, port)
+	ZEND_ARG_INFO(0, persistent)
+	ZEND_ARG_INFO(0, weight)
+	ZEND_ARG_INFO(0, timeout)
+	ZEND_ARG_INFO(0, retry_interval)
+	ZEND_ARG_INFO(0, status)
+	ZEND_ARG_INFO(0, failure_callback)
+	ZEND_ARG_INFO(0, timeoutms)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_set, 0, 0, 2)
+	ZEND_ARG_INFO(0, key)
+	ZEND_ARG_INFO(0, var)
+	ZEND_ARG_INFO(0, flags)
+	ZEND_ARG_INFO(0, expire)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_replace, 0, 0, 2)
+	ZEND_ARG_INFO(0, key)
+	ZEND_ARG_INFO(0, var)
+	ZEND_ARG_INFO(0, flags)
+	ZEND_ARG_INFO(0, expire)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_get, 0, 0, 1)
+	ZEND_ARG_INFO(0, key)
+	ZEND_ARG_INFO(0, flags)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_delete, 0, 0, 1)
+	ZEND_ARG_INFO(0, key)
+	ZEND_ARG_INFO(0, timeout)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_get_stats, 0, 0, 0)
+	ZEND_ARG_INFO(0, type)
+	ZEND_ARG_INFO(0, slabid)
+	ZEND_ARG_INFO(0, limit)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_increment, 0, 0, 1)
+	ZEND_ARG_INFO(0, key)
+	ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_decrement, 0, 0, 1)
+	ZEND_ARG_INFO(0, key)
+	ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_memcache_setoptimeout, 0, 0, 1)
+	ZEND_ARG_INFO(0, timeoutms)
+ZEND_END_ARG_INFO()
+
 #define PHP_MEMCACHE_VERSION "2.2.7"
 
 #define MMC_BUF_SIZE 4096
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 28 11:01:24 2023 UTC