Update for PHP 7.
[itkacl] / php7-itkacl-2.0 / itkacl.i
similarity index 81%
rename from php5-itkacl-2.0/itkacl.i
rename to php7-itkacl-2.0/itkacl.i
index 18ae21cf56a4cc33f0cf2d477272a8ec9021e5fd..06eef1e77fc83b4656983ec3fe2e03a75bcd8c21 100644 (file)
@@ -10,9 +10,6 @@
  * restrictions.
  */
 %inline %{
-       /* This is due to Swig forgetting one file */
-       #include <php5/Zend/zend_exceptions.h>
-
        extern "C" int itkacl_check(char *realm, char *user, char *errmsg, size_t errmsgsize);
        
        class itkaclwrap {
                int ret = itkacl_check(realm, user, itkacl_errmsg, 1024);
                if (ret == -1) {
                        SWIG_exception(SWIG_RuntimeError,itkacl_errmsg);
+thrown: return -1;
                } else {
                        return ret == 0;
                }
        }
 %}
 
+%pragma(php) code="
+class itkacl {
+      static function check($realm,$user) {
+              return itkaclwrap_check($realm,$user);
+      }
+} "
+