Просмотр исходного кода

fixing required # of params for add server(s) function for client

GearmanClient::addServer and GearmanClient::addServer(s) along with their
functional equivalents had an incorrect # set for required params, which led to
issues when reflected classes were using these values
Will Gallego 6 лет назад
Родитель
Сommit
c091685eef
4 измененных файлов с 13 добавлено и 7 удалено
  1. 5 0
      ChangeLog
  2. 4 4
      php_gearman.c
  3. 1 1
      php_gearman.h
  4. 3 2
      php_gearman_client.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Version 2.0.5
+-------------
+- fixing incorrect number of required parameters for GearmanClient::addServer
+and GearmanClient::addServers, along with proceduralequivalents
+
 Version 2.0.4
 -------------
 - bug fix for issue #59, Param to skip exception handling setup in addServer/addServers

+ 4 - 4
php_gearman.c

@@ -349,26 +349,26 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_set_timeout, 0, 0, 1)
 	ZEND_ARG_INFO(0, timeout)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_client_add_server, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_client_add_server, 0, 0, 1)
 	ZEND_ARG_INFO(0, client_object)
 	ZEND_ARG_INFO(0, host)
 	ZEND_ARG_INFO(0, port)
 	ZEND_ARG_INFO(0, enableExceptionHandler)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_server, 0, 0, 3)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_server, 0, 0, 0)
 	ZEND_ARG_INFO(0, host)
 	ZEND_ARG_INFO(0, port)
 	ZEND_ARG_INFO(0, enableExceptionHandler)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_client_add_servers, 0, 0, 3)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gearman_client_add_servers, 0, 0, 1)
 	ZEND_ARG_INFO(0, client_object)
 	ZEND_ARG_INFO(0, servers)
 	ZEND_ARG_INFO(0, setupExceptionHandler)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_servers, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oo_gearman_client_add_servers, 0, 0, 0)
 	ZEND_ARG_INFO(0, servers)
 	ZEND_ARG_INFO(0, setupExceptionHandler)
 ZEND_END_ARG_INFO()

+ 1 - 1
php_gearman.h

@@ -24,7 +24,7 @@
 #include <libgearman-1.0/status.h>
 
 /* module version */
-#define PHP_GEARMAN_VERSION "2.0.4"
+#define PHP_GEARMAN_VERSION "2.0.5"
 
 extern zend_module_entry gearman_module_entry;
 #define phpext_gearman_ptr &gearman_module_entry

+ 3 - 2
php_gearman_client.c

@@ -255,7 +255,8 @@ PHP_FUNCTION(gearman_client_set_timeout) {
 }
 /* }}} */
 
-/* {{{ proto bool gearman_client_add_server(object client [, string host [, int port ]])
+/* {{{ proto bool gearman_client_add_server(object client [, string host [, int
+ * port [, bool setupExceptionHandler ]]])
    Add a job server to a client. This goes into a list of servers than can be used to run tasks. No socket I/O happens here, it is just added to a list. */
 PHP_FUNCTION(gearman_client_add_server) {
         char *host = NULL;
@@ -292,7 +293,7 @@ PHP_FUNCTION(gearman_client_add_server) {
 }
 /* }}} */
 
-/* {{{ proto bool gearman_client_add_servers(object client [, string servers [, bool setupExceptionHandler = true]])
+/* {{{ proto bool gearman_client_add_servers(object client [, string servers [, bool setupExceptionHandler ]])
    Add a list of job servers to a client. This goes into a list of servers that can be used to run tasks. No socket I/O happens here, it is just added to a list. */
 PHP_FUNCTION(gearman_client_add_servers) {
         char *servers = NULL;