summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--REFLECTION89
-rw-r--r--luasandbox_compat.h36
-rw-r--r--php-pecl-luasandbox.spec47
3 files changed, 97 insertions, 75 deletions
diff --git a/REFLECTION b/REFLECTION
index ef6748f..28fc5f7 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,12 +1,12 @@
-Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
+Extension [ <persistent> extension #80 luasandbox version 4.0.0 ] {
- Classes [10] {
Class [ <internal:luasandbox> class LuaSandbox ] {
- Constants [3] {
- Constant [ public integer SAMPLES ] { 0 }
- Constant [ public integer SECONDS ] { 1 }
- Constant [ public integer PERCENT ] { 2 }
+ Constant [ public int SAMPLES ] { 0 }
+ Constant [ public int SECONDS ] { 1 }
+ Constant [ public int PERCENT ] { 2 }
}
- Static properties [0] {
@@ -28,7 +28,7 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
- Parameters [2] {
Parameter #0 [ <required> $code ]
- Parameter #1 [ <required> $chunkName ]
+ Parameter #1 [ <optional> $chunkName ]
}
}
@@ -36,7 +36,7 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
- Parameters [2] {
Parameter #0 [ <required> $code ]
- Parameter #1 [ <required> $chunkName ]
+ Parameter #1 [ <optional> $chunkName ]
}
}
@@ -87,7 +87,7 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Method [ <internal:luasandbox> public method enableProfiler ] {
- Parameters [1] {
- Parameter #0 [ <required> $period ]
+ Parameter #0 [ <optional> $period ]
}
}
@@ -100,7 +100,7 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Method [ <internal:luasandbox> public method getProfilerFunctionReport ] {
- Parameters [1] {
- Parameter #0 [ <required> $units ]
+ Parameter #0 [ <optional> $units ]
}
}
@@ -108,15 +108,14 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
- Parameters [2] {
Parameter #0 [ <required> $name ]
- Parameter #1 [ <required> $... ]
+ Parameter #1 [ <optional> ...$args ]
}
}
Method [ <internal:luasandbox> public method wrapPhpFunction ] {
- - Parameters [2] {
- Parameter #0 [ <required> $name ]
- Parameter #1 [ <required> $function ]
+ - Parameters [1] {
+ Parameter #0 [ <required> $function ]
}
}
@@ -133,10 +132,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxError extends Exception implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -194,10 +193,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxRuntimeError extends LuaSandboxError implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -255,10 +254,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxFatalError extends LuaSandboxError implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -316,10 +315,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxSyntaxError extends LuaSandboxFatalError implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -377,10 +376,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxMemoryError extends LuaSandboxFatalError implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -438,10 +437,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxErrorError extends LuaSandboxFatalError implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -499,10 +498,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxTimeoutError extends LuaSandboxFatalError implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -560,10 +559,10 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Class [ <internal:luasandbox> class LuaSandboxEmergencyTimeoutError extends LuaSandboxFatalError implements Throwable ] {
- Constants [4] {
- Constant [ public integer RUN ] { 2 }
- Constant [ public integer SYNTAX ] { 3 }
- Constant [ public integer MEM ] { 4 }
- Constant [ public integer ERR ] { 5 }
+ Constant [ public int RUN ] { 2 }
+ Constant [ public int SYNTAX ] { 3 }
+ Constant [ public int MEM ] { 4 }
+ Constant [ public int ERR ] { 5 }
}
- Static properties [0] {
@@ -642,7 +641,7 @@ Extension [ <persistent> extension #107 luasandbox version 3.0.3 ] {
Method [ <internal:luasandbox> public method call ] {
- Parameters [1] {
- Parameter #0 [ <required> $... ]
+ Parameter #0 [ <optional> ...$args ]
}
}
diff --git a/luasandbox_compat.h b/luasandbox_compat.h
new file mode 100644
index 0000000..b0a13c2
--- /dev/null
+++ b/luasandbox_compat.h
@@ -0,0 +1,36 @@
+// Macros to hide the differences between PHP versions
+// Implementation details, include only from .c files
+#ifndef LUASANDBOX_COMPAT_H
+#define LUASANDBOX_COMPAT_H
+
+#if PHP_VERSION_ID < 80000
+
+ #define luasandbox_update_property(scope, object, name, name_length, value) \
+ zend_update_property(scope, object, name, name_length, value)
+
+ #define luasandbox_update_property_string(scope, object, name, name_length, value) \
+ zend_update_property_string(scope, object, name, name_length, value)
+
+ #define luasandbox_update_property_long(scope, object, name, name_length, value) \
+ zend_update_property_long(scope, object, name, name_length, value)
+
+ #define luasandbox_read_property(scope, object, name, name_length, silent, rv) \
+ zend_read_property(scope, object, name, name_length, silent, rv)
+
+#else
+
+ #define luasandbox_update_property(scope, object, name, name_length, value) \
+ zend_update_property(scope, Z_OBJ_P(object), name, name_length, value)
+
+ #define luasandbox_update_property_string(scope, object, name, name_length, value) \
+ zend_update_property_string(scope, Z_OBJ_P(object), name, name_length, value)
+
+ #define luasandbox_update_property_long(scope, object, name, name_length, value) \
+ zend_update_property_long(scope, Z_OBJ_P(object), name, name_length, value)
+
+ #define luasandbox_read_property(scope, object, name, name_length, silent, rv) \
+ zend_read_property(scope, Z_OBJ_P(object), name, name_length, silent, rv)
+
+#endif
+
+#endif // LUASANDBOX_COMPAT_H
diff --git a/php-pecl-luasandbox.spec b/php-pecl-luasandbox.spec
index 4f3c97a..af8e1c9 100644
--- a/php-pecl-luasandbox.spec
+++ b/php-pecl-luasandbox.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-pecl-luasandbox
#
-# Copyright (c) 2015-2019 Remi Collet
+# Copyright (c) 2015-2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -25,14 +25,16 @@
Summary: Lua interpreter with limits and safe environment
Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 3.0.3
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Version: 4.0.0
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: MIT
-URL: http://pecl.php.net/package/%{proj_name}
-Source0: http://pecl.php.net/get/%{proj_name}-%{version}.tgz
+URL: https://pecl.php.net/package/%{proj_name}
+Source0: https://pecl.php.net/get/%{proj_name}-%{version}.tgz
+Source1: https://phab.wmfusercontent.org/file/download/jkix723fmmopugebtkh2/PHID-FILE-6sdx6iccvk4muq2kolg7/luasandbox_compat.h
+BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel
+BuildRequires: %{?scl_prefix}php-devel >= 7.2
BuildRequires: %{?scl_prefix}php-pear
# version 5.1 required
%if 0%{?fedora} >=20 || 0%{?rhel} >= 8
@@ -54,38 +56,17 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{rele
Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
%endif
-%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
+%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
-%if "%{php_version}" > "5.6"
-Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.0"
-Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
-%endif
%if "%{php_version}" > "7.3"
Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "7.4"
Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-Obsoletes: php74w-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "8.0"
+Obsoletes: php80-pecl-%{pecl_name} <= %{version}
%endif
-
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Filter shared private
-%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
-%{?filter_setup}
%endif
@@ -108,6 +89,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+cp %{SOURCE1} .
+
: Sanity check, really often broken
extver=$(sed -n '/#define LUASANDBOX_VERSION /{s/.* "//;s/".*$//;p}' luasandbox_version.h)
if test "x${extver}" != "x%{version}"; then
@@ -239,6 +222,10 @@ fi
%changelog
+* Thu Mar 4 2021 Remi Collet <remi@remirepo.net> - 4.0.0-1
+- update to 4.0.0
+- raise dependency on PHP 7.2
+
* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 3.0.3-4
- rebuild for 7.4.0RC1