summarylogtreecommitdiffstats
path: root/php7-support.patch
blob: 618903b0cefa32b452e0fdb2b1c793c631d1b712 (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
diff --git a/systemd.c b/systemd.c
index 9479556..6a0d573 100644
--- a/systemd.c
+++ b/systemd.c
@@ -30,7 +30,11 @@ ZEND_GET_MODULE(systemd)
 PHP_FUNCTION(sd_journal_send)
 {
     struct iovec *iov = NULL;
+#if ZEND_MODULE_API_NO >= 20151012
+    zval *args;
+#else
     zval ***args;
+#endif
     int argc, len, i;
     char *val;
     
@@ -47,9 +51,15 @@ PHP_FUNCTION(sd_journal_send)
 
     // Iterate through the PHP arguments and fill the iovector.
     for (i = 0; i < ZEND_NUM_ARGS() TSRMLS_CC; ++i) {
+#if ZEND_MODULE_API_NO >= 20151012
+        convert_to_string_ex(&args[i]);
+        val = Z_STRVAL(args[i]);
+        len = Z_STRLEN(args[i]);
+#else
         convert_to_string_ex(args[i]);
         val = Z_STRVAL_PP(args[i]);
         len = Z_STRLEN_PP(args[i]);
+#endif
         iov[i].iov_base = val;
         iov[i].iov_len = len;
     }