summaryrefslogtreecommitdiffstats
path: root/c8bf723822ef48f722b78cff240e886cb5907edd.patch
blob: 37efc3c08d20cd46eabca25c1e7a4b8fa0092f6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From c8bf723822ef48f722b78cff240e886cb5907edd Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 7 Nov 2018 14:28:11 +0100
Subject: [PATCH] add missing arginfo

---
 ext/maxminddb.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/ext/maxminddb.c b/ext/maxminddb.c
index c0177df..428ec65 100644
--- a/ext/maxminddb.c
+++ b/ext/maxminddb.c
@@ -115,6 +115,10 @@ static inline maxminddb_obj *php_maxminddb_fetch_object(zend_object *obj TSRMLS_
 #endif
 }
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_construct, 0, 0, 1)
+    ZEND_ARG_INFO(0, db_file)
+ZEND_END_ARG_INFO()
+
 PHP_METHOD(MaxMind_Db_Reader, __construct){
     char *db_file = NULL;
     strsize_t name_len;
@@ -150,6 +154,10 @@ PHP_METHOD(MaxMind_Db_Reader, __construct){
     mmdb_obj->mmdb = mmdb;
 }
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_get, 0, 0, 1)
+    ZEND_ARG_INFO(0, ip_address)
+ZEND_END_ARG_INFO()
+
 PHP_METHOD(MaxMind_Db_Reader, get){
     char *ip_address = NULL;
     strsize_t name_len;
@@ -225,6 +233,9 @@ PHP_METHOD(MaxMind_Db_Reader, get){
     MMDB_free_entry_data_list(entry_data_list);
 }
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_maxmindbreader_void, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
 PHP_METHOD(MaxMind_Db_Reader, metadata){
     if (ZEND_NUM_ARGS() != 0) {
         THROW_EXCEPTION("InvalidArgumentException",
@@ -520,11 +531,11 @@ static zend_object_value maxminddb_create_handler(
 
 /* *INDENT-OFF* */
 static zend_function_entry maxminddb_methods[] = {
-    PHP_ME(MaxMind_Db_Reader, __construct, NULL,
+    PHP_ME(MaxMind_Db_Reader, __construct, arginfo_maxmindbreader_construct,
            ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
-    PHP_ME(MaxMind_Db_Reader, close,    NULL, ZEND_ACC_PUBLIC)
-    PHP_ME(MaxMind_Db_Reader, get,      NULL, ZEND_ACC_PUBLIC)
-    PHP_ME(MaxMind_Db_Reader, metadata, NULL, ZEND_ACC_PUBLIC)
+    PHP_ME(MaxMind_Db_Reader, close,    arginfo_maxmindbreader_void, ZEND_ACC_PUBLIC)
+    PHP_ME(MaxMind_Db_Reader, get,      arginfo_maxmindbreader_get,  ZEND_ACC_PUBLIC)
+    PHP_ME(MaxMind_Db_Reader, metadata, arginfo_maxmindbreader_void, ZEND_ACC_PUBLIC)
     { NULL, NULL, NULL }
 };
 /* *INDENT-ON* */