summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-restore-7.0-compatibility.patch28
-rw-r--r--PHPINFO2
-rw-r--r--REFLECTION103
-rw-r--r--oauth-pcre.patch23
-rw-r--r--oauth-php82.patch85
-rw-r--r--php-pecl-oauth.spec69
6 files changed, 122 insertions, 188 deletions
diff --git a/0001-restore-7.0-compatibility.patch b/0001-restore-7.0-compatibility.patch
new file mode 100644
index 0000000..766e600
--- /dev/null
+++ b/0001-restore-7.0-compatibility.patch
@@ -0,0 +1,28 @@
+From 70f260f6e395af7c6061e2b07ea91b85b28532f1 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Tue, 8 Oct 2024 10:31:48 +0200
+Subject: [PATCH] restore 7.0 compatibility
+
+---
+ provider.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/provider.c b/provider.c
+index f1f8e2a..5f988b5 100644
+--- a/provider.c
++++ b/provider.c
+@@ -960,7 +960,11 @@ SOP_METHOD(generateToken)
+ php_error_docref(NULL, E_WARNING, "Could not gather enough random data, falling back on rand()");
+ }
+ while (reaped < size) {
++#if PHP_VERSION_ID < 70100
++ iv[reaped++] = (char) (255.0 * php_rand() / RAND_MAX);
++#else
+ iv[reaped++] = (char)php_mt_rand_range(0, 255);
++#endif
+ }
+ }
+
+--
+2.46.2
+
diff --git a/PHPINFO b/PHPINFO
index e6227ed..9bd2472 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -6,4 +6,4 @@ PLAINTEXT support => enabled
RSA-SHA1 support => enabled
HMAC-SHA1 support => enabled
Request engine support => php_streams, curl
-version => 2.0.7
+version => 2.0.9
diff --git a/REFLECTION b/REFLECTION
index 751797f..466198f 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
+Extension [ <persistent> extension #88 OAuth version 2.0.9 ] {
- Constants [32] {
Constant [ string OAUTH_SIG_METHOD_HMACSHA1 ] { HMAC-SHA1 }
@@ -47,7 +47,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
- Parameters [3] {
Parameter #0 [ <required> $http_method ]
Parameter #1 [ <required> $uri ]
- Parameter #2 [ <required> $parameters ]
+ Parameter #2 [ <optional> $parameters = <default> ]
}
}
}
@@ -65,9 +65,9 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
}
- Properties [3] {
- Property [ <default> public $debug ]
- Property [ <default> public $sslChecks ]
- Property [ <default> public $debugInfo ]
+ Property [ public $debug = 0 ]
+ Property [ public $sslChecks = 1 ]
+ Property [ public $debugInfo = '' ]
}
- Methods [26] {
@@ -76,8 +76,8 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
- Parameters [4] {
Parameter #0 [ <required> $consumer_key ]
Parameter #1 [ <required> $consumer_secret ]
- Parameter #2 [ <optional> $signature_method ]
- Parameter #3 [ <optional> $auth_type ]
+ Parameter #2 [ <optional> $signature_method = <default> ]
+ Parameter #3 [ <optional> $auth_type = <default> ]
}
}
@@ -90,18 +90,20 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
Method [ <internal:OAuth> public method getRequestToken ] {
- - Parameters [2] {
+ - Parameters [3] {
Parameter #0 [ <required> $request_token_url ]
- Parameter #1 [ <optional> $callback_url ]
+ Parameter #1 [ <optional> $callback_url = <default> ]
+ Parameter #2 [ <optional> $http_method = <default> ]
}
}
Method [ <internal:OAuth> public method getAccessToken ] {
- - Parameters [3] {
+ - Parameters [4] {
Parameter #0 [ <required> $access_token_url ]
- Parameter #1 [ <optional> $auth_session_handle ]
- Parameter #2 [ <optional> $auth_verifier ]
+ Parameter #1 [ <optional> $auth_session_handle = <default> ]
+ Parameter #2 [ <optional> $auth_verifier = <default> ]
+ Parameter #3 [ <optional> $http_method = <default> ]
}
}
@@ -170,9 +172,9 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
- Parameters [4] {
Parameter #0 [ <required> $protected_resource_url ]
- Parameter #1 [ <optional> $extra_parameters ]
- Parameter #2 [ <optional> $http_method ]
- Parameter #3 [ <optional> $request_headers ]
+ Parameter #1 [ <optional> $extra_parameters = <default> ]
+ Parameter #2 [ <optional> $http_method = <default> ]
+ Parameter #3 [ <optional> $request_headers = <default> ]
}
}
@@ -231,7 +233,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
- Parameters [3] {
Parameter #0 [ <required> $http_method ]
Parameter #1 [ <required> $url ]
- Parameter #2 [ <optional> $extra_parameters ]
+ Parameter #2 [ <optional> $extra_parameters = <default> ]
}
}
@@ -254,13 +256,13 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
- Parameters [3] {
Parameter #0 [ <required> $http_method ]
Parameter #1 [ <required> $url ]
- Parameter #2 [ <optional> $extra_parameters ]
+ Parameter #2 [ <optional> $extra_parameters = <default> ]
}
}
}
}
- Class [ <internal:OAuth> class OAuthException extends Exception implements Throwable ] {
+ Class [ <internal:OAuth> class OAuthException extends Exception implements Throwable, Stringable ] {
- Constants [0] {
}
@@ -272,49 +274,84 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
}
- Properties [6] {
- Property [ <default> protected $message ]
- Property [ <default> protected $code ]
- Property [ <default> protected $file ]
- Property [ <default> protected $line ]
- Property [ <default> public $lastResponse ]
- Property [ <default> public $debugInfo ]
+ Property [ protected $message = '' ]
+ Property [ protected $code = 0 ]
+ Property [ protected string $file = '' ]
+ Property [ protected int $line = 0 ]
+ Property [ public $lastResponse = NULL ]
+ Property [ public $debugInfo = NULL ]
}
- Methods [10] {
Method [ <internal:Core, inherits Exception, ctor> public method __construct ] {
- Parameters [3] {
- Parameter #0 [ <optional> $message ]
- Parameter #1 [ <optional> $code ]
- Parameter #2 [ <optional> $previous ]
+ Parameter #0 [ <optional> string $message = "" ]
+ Parameter #1 [ <optional> int $code = 0 ]
+ Parameter #2 [ <optional> ?Throwable $previous = null ]
}
}
Method [ <internal:Core, inherits Exception> public method __wakeup ] {
+
+ - Parameters [0] {
+ }
+ - Tentative return [ void ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] {
+
+ - Parameters [0] {
+ }
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] {
+
+ - Parameters [0] {
+ }
+ - Return [ int ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] {
+
+ - Parameters [0] {
+ }
+ - Return [ array ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] {
+
+ - Parameters [0] {
+ }
+ - Return [ ?Throwable ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
- Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] {
+ Method [ <internal:Core, inherits Exception, prototype Stringable> public method __toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
}
}
@@ -339,7 +376,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
- Parameters [2] {
Parameter #0 [ <required> $size ]
- Parameter #1 [ <optional> $strong ]
+ Parameter #1 [ <optional> $strong = <default> ]
}
}
}
@@ -351,7 +388,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
Method [ <internal:OAuth, ctor> public method __construct ] {
- Parameters [1] {
- Parameter #0 [ <optional> $params_array ]
+ Parameter #0 [ <optional> $params_array = <default> ]
}
}
@@ -397,8 +434,8 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
Method [ <internal:OAuth> public method checkOAuthRequest ] {
- Parameters [2] {
- Parameter #0 [ <optional> $uri ]
- Parameter #1 [ <optional> $method ]
+ Parameter #0 [ <optional> $uri = <default> ]
+ Parameter #1 [ <optional> $method = <default> ]
}
}
@@ -427,7 +464,7 @@ Extension [ <persistent> extension #117 OAuth version 2.0.7 ] {
- Parameters [2] {
Parameter #0 [ <required> $param_key ]
- Parameter #1 [ <optional> $param_val ]
+ Parameter #1 [ <optional> $param_val = <default> ]
}
}
diff --git a/oauth-pcre.patch b/oauth-pcre.patch
deleted file mode 100644
index 31635ca..0000000
--- a/oauth-pcre.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 2e02631fa424639b10d105ff47e9cf650403cef7 Mon Sep 17 00:00:00 2001
-From: Andy Postnikov <apostnikov@gmail.com>
-Date: Fri, 18 Sep 2020 16:22:33 +0300
-Subject: [PATCH] Remove pcre.h dependency
-
-PHP using pcre2 and I see no usage of pcre 1
----
- config.m4 | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/config.m4 b/config.m4
-index f4a6899..2adf937 100644
---- a/config.m4
-+++ b/config.m4
-@@ -10,8 +10,6 @@ if test "$PHP_OAUTH" != "no"; then
- PHP_NEW_EXTENSION(oauth, oauth.c provider.c, $ext_shared)
- CFLAGS="$CFLAGS -Wall -g"
-
-- AC_CHECK_HEADER(pcre.h, , [AC_MSG_ERROR([Couldn't find pcre.h, try installing the libpcre development/headers package])])
--
- AS_IF([test "x$with_curl" != "xno"],
- [
- AC_MSG_CHECKING(for cURL in default path)
diff --git a/oauth-php82.patch b/oauth-php82.patch
deleted file mode 100644
index ad8eb4a..0000000
--- a/oauth-php82.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 66e8e9cf9805c96dd9aa6a7c08ec0da5c2c6b656 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@php.net>
-Date: Fri, 9 Sep 2022 14:03:57 +0200
-Subject: [PATCH] fix for php 8.2: declare used properties
-
----
- oauth.c | 1 +
- provider.c | 13 +++++++++++++
- tests/oauthprovider_001.phpt | 12 ++++++++----
- 3 files changed, 22 insertions(+), 4 deletions(-)
-
-diff --git a/oauth.c b/oauth.c
-index f845893..46eccda 100644
---- a/oauth.c
-+++ b/oauth.c
-@@ -2781,6 +2781,7 @@ PHP_MINIT_FUNCTION(oauth)
- soo_exception_ce = zend_register_internal_class_ex(&soo_ex_ce, zend_exception_get_default());
- zend_declare_property_null(soo_exception_ce, "lastResponse", sizeof("lastResponse")-1, ZEND_ACC_PUBLIC);
- zend_declare_property_null(soo_exception_ce, "debugInfo", sizeof("debugInfo")-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(soo_exception_ce, "additionalInfo", sizeof("additionalInfo")-1, ZEND_ACC_PUBLIC);
-
- REGISTER_STRING_CONSTANT("OAUTH_SIG_METHOD_HMACSHA1", OAUTH_SIG_METHOD_HMACSHA1, CONST_CS | CONST_PERSISTENT);
- REGISTER_STRING_CONSTANT("OAUTH_SIG_METHOD_HMACSHA256", OAUTH_SIG_METHOD_HMACSHA256, CONST_CS | CONST_PERSISTENT);
-diff --git a/provider.c b/provider.c
-index 45880fb..43f2bc0 100644
---- a/provider.c
-+++ b/provider.c
-@@ -1184,6 +1184,19 @@ extern int oauth_provider_register_class(void) /* {{{ */
- osce.create_object = oauth_provider_new;
- oauthprovider = zend_register_internal_class(&osce);
-
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CONSUMER_KEY, sizeof(OAUTH_PROVIDER_CONSUMER_KEY)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CONSUMER_SECRET, sizeof(OAUTH_PROVIDER_CONSUMER_SECRET)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_SIGNATURE, sizeof(OAUTH_PROVIDER_SIGNATURE)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_SIGNATURE_METHOD, sizeof(OAUTH_PROVIDER_SIGNATURE_METHOD)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TOKEN, sizeof(OAUTH_PROVIDER_TOKEN)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TOKEN_SECRET, sizeof(OAUTH_PROVIDER_TOKEN_SECRET)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_NONCE, sizeof(OAUTH_PROVIDER_NONCE)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TIMESTAMP, sizeof(OAUTH_PROVIDER_TIMESTAMP)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_VERSION, sizeof(OAUTH_PROVIDER_VERSION)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CALLBACK, sizeof(OAUTH_PROVIDER_CALLBACK)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_VERIFIER, sizeof(OAUTH_PROVIDER_VERIFIER)-1, ZEND_ACC_PUBLIC);
-+ zend_declare_property_null(oauthprovider, "request_token_endpoint", sizeof("request_token_endpoint")-1, ZEND_ACC_PUBLIC);
-+
- memcpy(&oauth_provider_obj_hndlrs, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
- oauth_provider_obj_hndlrs.offset = XtOffsetOf(php_oauth_provider, zo);
- oauth_provider_obj_hndlrs.free_obj = oauth_provider_free_storage;
-diff --git a/tests/oauthprovider_001.phpt b/tests/oauthprovider_001.phpt
-index e93af65..ab005c4 100644
---- a/tests/oauthprovider_001.phpt
-+++ b/tests/oauthprovider_001.phpt
-@@ -6,25 +6,29 @@ $provider = new OAuthProvider(['foo' => 'bar']);
- var_dump($provider);
-
- --EXPECT--
--object(OAuthProvider)#1 (10) {
-+object(OAuthProvider)#1 (12) {
- ["consumer_key"]=>
- NULL
- ["consumer_secret"]=>
- NULL
-- ["nonce"]=>
-+ ["signature"]=>
-+ NULL
-+ ["signature_method"]=>
- NULL
- ["token"]=>
- NULL
- ["token_secret"]=>
- NULL
-+ ["nonce"]=>
-+ NULL
- ["timestamp"]=>
- NULL
- ["version"]=>
- NULL
-- ["signature_method"]=>
-- NULL
- ["callback"]=>
- NULL
-+ ["verifier"]=>
-+ NULL
- ["request_token_endpoint"]=>
- bool(false)
- }
diff --git a/php-pecl-oauth.spec b/php-pecl-oauth.spec
index 9462e2c..c21426c 100644
--- a/php-pecl-oauth.spec
+++ b/php-pecl-oauth.spec
@@ -20,19 +20,17 @@
%global _configure ../%{sources}/configure
Name: %{?scl_prefix}php-pecl-oauth
-Version: 2.0.7
-Release: 9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Version: 2.0.9
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: PHP OAuth consumer extension
License: BSD-3-Clause
URL: https://pecl.php.net/package/oauth
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-Patch0: %{pecl_name}-pcre.patch
-Patch1: %{pecl_name}-php82.patch
-
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel >= 7
+# see https://github.com/php/pecl-web_services-oauth/pull/31
+BuildRequires: %{?scl_prefix}php-devel >= 7.1
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-posix
BuildRequires: pcre-devel
@@ -46,17 +44,6 @@ Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7
-# Other third party repo stuff
-Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
-%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
-
%description
OAuth is an authorization protocol built on top of HTTP which allows
@@ -73,13 +60,10 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
cd %{sources}
-%patch -P0 -p1 -b .up
-%patch -P1 -p1 -b .pr24
-
#sed -e '/PHP_OAUTH_VERSION/s/2.0.3-dev/2.0.3/' -i php_oauth.h
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_OAUTH_VERSION/{s/.* //;s/".*$//;p}' php_oauth.h)
@@ -105,22 +89,24 @@ mkdir ZTS
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure --with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
%configure --with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+%make_build
%endif
%install
%{?dtsenable}
-make install -C NTS INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# Drop in the bit of configuration
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -129,7 +115,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make install -C ZTS INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -140,26 +126,6 @@ do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-%endif
-
-
%check
cd %{sources}
@@ -186,7 +152,7 @@ REPORT_EXIT_STATUS=1 \
%files
-%{?_licensedir:%license %{sources}/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -200,6 +166,17 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Tue Oct 8 2024 Remi Collet <remi@remirepo.net> - 2.0.9-1
+- update to 2.0.9
+- drop patches merged upstream
+
+* Mon Sep 30 2024 Remi Collet <remi@remirepo.net> - 2.0.7-11
+- more patch for 8.4
+
+* Tue Jul 9 2024 Remi Collet <remi@remirepo.net> - 2.0.7-10
+- add patch for PHP 8.4 from
+ https://github.com/php/pecl-web_services-oauth/pull/30
+
* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 2.0.7-9
- rebuild for PHP 8.3.0RC1