summaryrefslogtreecommitdiff
blob: af8e3d560d7b72977d11a73dd5f49dde0d62a229 (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
62
63
64
Origin: Based on patch from Petr Písař <ppisar@redhat.com>
Date: Tue, 13 Jun 2017 15:29:15 +0200

--- a/php/redland-post.i
+++ b/php/redland-post.i
@@ -132,8 +132,11 @@ librdf_php_world_init(void)
     exception_ce = zend_exception_get_default();
     INIT_CLASS_ENTRY(ee_ce, "RedlandException", NULL);
     redland_exception_ptr = zend_register_internal_class_ex(&ee_ce, 
-                                                            exception_ce, 
-                                                            NULL TSRMLS_CC);
+                                                            exception_ce
+#if PHP_MAJOR_VERSION < 7
+                                                            ,NULL TSRMLS_CC
+#endif
+                                                            );
 #endif
 
     memset(&librdf_php_locator, '\0', sizeof(raptor_locator));
--- a/php/redland-typemap.i
+++ b/php/redland-typemap.i
@@ -1,17 +1,17 @@
-%typemap(in) librdf_uri* %{
-  if(SWIG_ConvertPtr(*$input, (void **) &$1, SWIGTYPE_p_librdf_uri_s, 0) < 0) {
+%typemap(in) librdf_uri %{
+  if(SWIG_ConvertPtr($input, (void **) &$1, SWIGTYPE_p_librdf_uri_s, 0) < 0) {
     /* Allow NULL from php for librdf_uri* */
-    if ((*$input)->type==IS_NULL)
+    if ($input->type==IS_NULL)
       $1=NULL;
    else
       SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor");
   }
 %}
 
-%typemap(in) librdf_node* %{
-  if(SWIG_ConvertPtr(*$input, (void **) &$1, SWIGTYPE_p_librdf_node_s, 0) < 0) {
+%typemap(in) librdf_node %{
+  if(SWIG_ConvertPtr($input, (void **) &$1, SWIGTYPE_p_librdf_node_s, 0) < 0) {
     /* Allow NULL from php for librdf_node* */
-    if ((*$input)->type==IS_NULL)
+    if ($input->type==IS_NULL)
       $1=NULL;
    else
       SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor");
 
--- a/php/test.php
+++ b/php/test.php
@@ -26,11 +26,9 @@
 /* ------------------------------------------------------------------------ */

 print "Testing Redland...\n";
-$dlls = array("redland.so", "php_redland.dll", "redland.dylib", "redland.bundle");
-foreach ($dlls as $dll) {
-  if(file_exists($dll)) {
-    dl($dll);
-  }
+if (extension_loaded('redland') !== true) {
+    print "Redland extension not loaded. Cannot run tests!" . PHP_EOL;
+    exit(1);
 }

 $world=librdf_php_get_world();