diff options
-rw-r--r-- | 1095.patch | 44 | ||||
-rw-r--r-- | PHPINFO | 14 | ||||
-rw-r--r-- | REFLECTION | 239 | ||||
-rw-r--r-- | php-pecl-mongodb.spec | 51 |
4 files changed, 311 insertions, 37 deletions
diff --git a/1095.patch b/1095.patch new file mode 100644 index 0000000..2f82487 --- /dev/null +++ b/1095.patch @@ -0,0 +1,44 @@ +From 71a86ccd0c6338a18aced544cd798593d7ad93ea Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 4 Feb 2020 16:47:47 +0100 +Subject: [PATCH] Fix build with system libraries + +--- + config.m4 | 10 +++++----- + php_phongo.c | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/config.m4 b/config.m4 +index 39e0627b..e00ceb44 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -257,11 +257,11 @@ if test "$PHP_MONGODB" != "no"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + AC_MSG_CHECKING(for libmongocrypt) + +- if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmongocrypt-1.0; then +- if $PKG_CONFIG libmongocrypt-1.0 --atleast-version 1.0.1; then +- PHP_MONGODB_MONGOCRYPT_CFLAGS=`$PKG_CONFIG libmongocrypt-1.0 --cflags` +- PHP_MONGODB_MONGOCRYPT_LIBS=`$PKG_CONFIG libmongocrypt-1.0 --libs` +- PHP_MONGODB_MONGOCRYPT_VERSION=`$PKG_CONFIG libmongocrypt-1.0 --modversion` ++ if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmongocrypt; then ++ if $PKG_CONFIG libmongocrypt --atleast-version 1.0.1; then ++ PHP_MONGODB_MONGOCRYPT_CFLAGS=`$PKG_CONFIG libmongocrypt --cflags` ++ PHP_MONGODB_MONGOCRYPT_LIBS=`$PKG_CONFIG libmongocrypt --libs` ++ PHP_MONGODB_MONGOCRYPT_VERSION=`$PKG_CONFIG libmongocrypt --modversion` + AC_MSG_RESULT(version $PHP_MONGODB_MONGOCRYPT_VERSION found) + + PHP_MONGODB_CFLAGS="$PHP_MONGODB_CFLAGS $PHP_MONGODB_MONGOCRYPT_CFLAGS" +diff --git a/php_phongo.c b/php_phongo.c +index ef3600b8..83f5dfd4 100644 +--- a/php_phongo.c ++++ b/php_phongo.c +@@ -3924,7 +3924,7 @@ PHP_MINFO_FUNCTION(mongodb) + #ifdef MONGOC_ENABLE_CLIENT_SIDE_ENCRYPTION + #ifdef HAVE_SYSTEM_LIBMONGOCRYPT + php_info_print_table_row(2, "libmongocrypt headers version", MONGOCRYPT_VERSION); +- php_info_print_table_row(2, "libmongocrypt library version", mongocrypt_version()); ++ php_info_print_table_row(2, "libmongocrypt library version", mongocrypt_version(NULL)); + #else + php_info_print_table_row(2, "libmongocrypt bundled version", MONGOCRYPT_VERSION); + #endif @@ -2,12 +2,12 @@ mongodb MongoDB support => enabled -MongoDB extension version => 1.6.1 +MongoDB extension version => 1.7.0 MongoDB extension stability => stable -libbson headers version => 1.15.2 -libbson library version => 1.15.2 -libmongoc headers version => 1.15.2 -libmongoc library version => 1.15.2 +libbson headers version => 1.16.1 +libbson library version => 1.16.1 +libmongoc headers version => 1.16.1 +libmongoc library version => 1.16.1 libmongoc SSL => enabled libmongoc SSL library => OpenSSL libmongoc crypto => enabled @@ -18,6 +18,10 @@ libmongoc ICU => enabled libmongoc compression => enabled libmongoc compression snappy => enabled libmongoc compression zlib => enabled +libmongocrypt headers version => 1.0.1 +libmongocrypt library version => 1.0.1 +libmongocrypt crypto => enabled +libmongocrypt crypto library => libcrypto Directive => Local Value => Master Value mongodb.debug => no value => no value @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { +Extension [ <persistent> extension #106 mongodb version 1.7.0 ] { - Dependencies { Dependency [ date (Required) ] @@ -14,7 +14,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } - Constants [2] { - Constant [ string MONGODB_VERSION ] { 1.6.1 } + Constant [ string MONGODB_VERSION ] { 1.7.0 } Constant [ string MONGODB_STABILITY ] { stable } } @@ -70,7 +70,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } - - Classes [60] { + - Classes [62] { Interface [ <internal:mongodb> interface MongoDB\BSON\Type ] { - Constants [0] { @@ -395,13 +395,14 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { Class [ <internal:mongodb> final class MongoDB\BSON\Binary implements MongoDB\BSON\BinaryInterface, JsonSerializable, MongoDB\BSON\Type, Serializable ] { - - Constants [7] { + - Constants [8] { Constant [ public int TYPE_GENERIC ] { 0 } Constant [ public int TYPE_FUNCTION ] { 1 } Constant [ public int TYPE_OLD_BINARY ] { 2 } Constant [ public int TYPE_OLD_UUID ] { 3 } Constant [ public int TYPE_UUID ] { 4 } Constant [ public int TYPE_MD5 ] { 5 } + Constant [ public int TYPE_ENCRYPTED ] { 6 } Constant [ public int TYPE_USER_DEFINED ] { 128 } } @@ -1263,6 +1264,60 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } + Class [ <internal:mongodb> final class MongoDB\Driver\ClientEncryption ] { + + - Constants [2] { + Constant [ public string AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC ] { AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic } + Constant [ public string AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM ] { AEAD_AES_256_CBC_HMAC_SHA_512-Random } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [5] { + Method [ <internal:mongodb> final public method createDataKey ] { + + - Parameters [2] { + Parameter #0 [ <required> $kmsProvider ] + Parameter #1 [ <optional> array or NULL $options ] + } + } + + Method [ <internal:mongodb> final public method encrypt ] { + + - Parameters [2] { + Parameter #0 [ <required> $value ] + Parameter #1 [ <optional> array or NULL $options ] + } + } + + Method [ <internal:mongodb> final public method decrypt ] { + + - Parameters [1] { + Parameter #0 [ <required> MongoDB\BSON\BinaryInterface $keyVaultClient ] + } + } + + Method [ <internal:mongodb, ctor> final private method __construct ] { + + - Parameters [0] { + } + } + + Method [ <internal:mongodb> final public method __wakeup ] { + + - Parameters [0] { + } + } + } + } + Class [ <internal:mongodb> final class MongoDB\Driver\Command ] { - Constants [0] { @@ -1353,7 +1408,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } - Class [ <internal:mongodb> final class MongoDB\Driver\CursorId ] { + Class [ <internal:mongodb> final class MongoDB\Driver\CursorId implements Serializable ] { - Constants [0] { } @@ -1367,13 +1422,26 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Properties [0] { } - - Methods [3] { + - Methods [5] { Method [ <internal:mongodb> final public method __toString ] { - Parameters [0] { } } + Method [ <internal:mongodb, prototype Serializable> final public method serialize ] { + + - Parameters [0] { + } + } + + Method [ <internal:mongodb, prototype Serializable> final public method unserialize ] { + + - Parameters [1] { + Parameter #0 [ <required> $serialized ] + } + } + Method [ <internal:mongodb, ctor> final private method __construct ] { - Parameters [0] { @@ -1402,7 +1470,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Properties [0] { } - - Methods [14] { + - Methods [15] { Method [ <internal:mongodb, ctor> final public method __construct ] { - Parameters [3] { @@ -1412,6 +1480,13 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } + Method [ <internal:mongodb> final public method createClientEncryption ] { + + - Parameters [1] { + Parameter #0 [ <required> array $options ] + } + } + Method [ <internal:mongodb> final public method executeCommand ] { - Parameters [3] { @@ -1543,7 +1618,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } - Class [ <internal:mongodb> final class MongoDB\Driver\ReadConcern implements MongoDB\BSON\Serializable, MongoDB\BSON\Type ] { + Class [ <internal:mongodb> final class MongoDB\Driver\ReadConcern implements MongoDB\BSON\Serializable, MongoDB\BSON\Type, Serializable ] { - Constants [4] { Constant [ public string LOCAL ] { local } @@ -1567,7 +1642,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Properties [0] { } - - Methods [4] { + - Methods [6] { Method [ <internal:mongodb, ctor> final public method __construct ] { - Parameters [1] { @@ -1592,12 +1667,25 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Parameters [0] { } } + + Method [ <internal:mongodb, prototype Serializable> final public method serialize ] { + + - Parameters [0] { + } + } + + Method [ <internal:mongodb, prototype Serializable> final public method unserialize ] { + + - Parameters [1] { + Parameter #0 [ <required> $serialized ] + } + } } } - Class [ <internal:mongodb> final class MongoDB\Driver\ReadPreference implements MongoDB\BSON\Serializable, MongoDB\BSON\Type ] { + Class [ <internal:mongodb> final class MongoDB\Driver\ReadPreference implements MongoDB\BSON\Serializable, MongoDB\BSON\Type, Serializable ] { - - Constants [7] { + - Constants [12] { Constant [ public int RP_PRIMARY ] { 1 } Constant [ public int RP_PRIMARY_PREFERRED ] { 5 } Constant [ public int RP_SECONDARY ] { 2 } @@ -1605,6 +1693,11 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { Constant [ public int RP_NEAREST ] { 10 } Constant [ public int NO_MAX_STALENESS ] { -1 } Constant [ public int SMALLEST_MAX_STALENESS_SECONDS ] { 90 } + Constant [ public string PRIMARY ] { primary } + Constant [ public string PRIMARY_PREFERRED ] { primaryPreferred } + Constant [ public string SECONDARY ] { secondary } + Constant [ public string SECONDARY_PREFERRED ] { secondaryPreferred } + Constant [ public string NEAREST ] { nearest } } - Static properties [0] { @@ -1622,7 +1715,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Properties [0] { } - - Methods [5] { + - Methods [8] { Method [ <internal:mongodb, ctor> final public method __construct ] { - Parameters [3] { @@ -1644,6 +1737,12 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } + Method [ <internal:mongodb> final public method getModeString ] { + + - Parameters [0] { + } + } + Method [ <internal:mongodb> final public method getTagSets ] { - Parameters [0] { @@ -1655,6 +1754,19 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Parameters [0] { } } + + Method [ <internal:mongodb, prototype Serializable> final public method serialize ] { + + - Parameters [0] { + } + } + + Method [ <internal:mongodb, prototype Serializable> final public method unserialize ] { + + - Parameters [1] { + Parameter #0 [ <required> $serialized ] + } + } } } @@ -1818,7 +1930,12 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { Class [ <internal:mongodb> final class MongoDB\Driver\Session ] { - - Constants [0] { + - Constants [5] { + Constant [ public string TRANSACTION_NONE ] { none } + Constant [ public string TRANSACTION_STARTING ] { starting } + Constant [ public string TRANSACTION_IN_PROGRESS ] { in_progress } + Constant [ public string TRANSACTION_COMMITTED ] { committed } + Constant [ public string TRANSACTION_ABORTED ] { aborted } } - Static properties [0] { @@ -1830,7 +1947,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Properties [0] { } - - Methods [13] { + - Methods [15] { Method [ <internal:mongodb> final public method abortTransaction ] { - Parameters [0] { @@ -1887,6 +2004,18 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } + Method [ <internal:mongodb> final public method getTransactionOptions ] { + + - Parameters [0] { + } + } + + Method [ <internal:mongodb> final public method getTransactionState ] { + + - Parameters [0] { + } + } + Method [ <internal:mongodb> final public method isInTransaction ] { - Parameters [0] { @@ -1914,7 +2043,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } - Class [ <internal:mongodb> final class MongoDB\Driver\WriteConcern implements MongoDB\BSON\Serializable, MongoDB\BSON\Type ] { + Class [ <internal:mongodb> final class MongoDB\Driver\WriteConcern implements MongoDB\BSON\Serializable, MongoDB\BSON\Type, Serializable ] { - Constants [1] { Constant [ public string MAJORITY ] { majority } @@ -1935,7 +2064,7 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Properties [0] { } - - Methods [6] { + - Methods [8] { Method [ <internal:mongodb, ctor> final public method __construct ] { - Parameters [3] { @@ -1974,6 +2103,19 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { - Parameters [0] { } } + + Method [ <internal:mongodb, prototype Serializable> final public method serialize ] { + + - Parameters [0] { + } + } + + Method [ <internal:mongodb, prototype Serializable> final public method unserialize ] { + + - Parameters [1] { + Parameter #0 [ <required> $serialized ] + } + } } } @@ -2748,6 +2890,71 @@ Extension [ <persistent> extension #182 mongodb version 1.6.1 ] { } } + Class [ <internal:mongodb> class MongoDB\Driver\Exception\EncryptionException extends MongoDB\Driver\Exception\RuntimeException implements MongoDB\Driver\Exception\Exception, Throwable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [5] { + Property [ <default> protected $message ] + Property [ <default> protected $code ] + Property [ <default> protected $file ] + Property [ <default> protected $line ] + Property [ <default> protected $errorLabels ] + } + + - Methods [11] { + Method [ <internal:mongodb, inherits MongoDB\Driver\Exception\RuntimeException> final public method hasErrorLabel ] { + + - Parameters [1] { + Parameter #0 [ <required> $label ] + } + } + + Method [ <internal:Core, inherits Exception, ctor> public method __construct ] { + + - Parameters [3] { + Parameter #0 [ <optional> $message ] + Parameter #1 [ <optional> $code ] + Parameter #2 [ <optional> $previous ] + } + } + + Method [ <internal:Core, inherits Exception> public method __wakeup ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] { + } + + Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] { + } + } + } + Class [ <internal:mongodb> final class MongoDB\Driver\Exception\ExecutionTimeoutException extends MongoDB\Driver\Exception\ServerException implements Throwable, MongoDB\Driver\Exception\Exception ] { - Constants [0] { diff --git a/php-pecl-mongodb.spec b/php-pecl-mongodb.spec index 16a8feb..caddfeb 100644 --- a/php-pecl-mongodb.spec +++ b/php-pecl-mongodb.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-mongodb # -# Copyright (c) 2015-2019 Remi Collet +# Copyright (c) 2015-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -30,34 +30,42 @@ %global with_tests 0%{?_with_tests:1} # F30 for fedora repo, F28 for remi -%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 %global with_syslib 1 -%global libver 1.15.2 -%global libbuildver %(pkg-config --silence-errors --modversion libmongoc-1.0 2>/dev/null || echo %{libver}) +%global libmongo 1.16.1 +%global libmongover %(pkg-config --silence-errors --modversion libmongoc-1.0 2>/dev/null || echo %{libmongoc}) +%global libcrypt 1.0.1 +%global libcryptver %(pkg-config --silence-errors --modversion libmongocrypt 2>/dev/null || echo %{libcrypt}) %else %global with_syslib 0 -%global libver 1.15.2 +%global libmongo 1.16.1 +%global libcrypt 1.0.1 %endif Summary: MongoDB driver for PHP Name: %{?sub_prefix}php-pecl-%{pecl_name} -%global upstream_version 1.6.1 +%global upstream_version 1.7.0 #global upstream_prever RC1 #global upstream_lower ~rc1 Version: %{upstream_version}%{?upstream_lower} Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: ASL 2.0 -URL: http://pecl.php.net/package/%{pecl_name} -Source0: http://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +URL: https://pecl.php.net/package/%{pecl_name} +Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz + +Patch0: https://patch-diff.githubusercontent.com/raw/mongodb/mongo-php-driver/pull/1095.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 5.6 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json %if %{with_syslib} -BuildRequires: pkgconfig(libbson-1.0) >= %{libver} -BuildRequires: pkgconfig(libmongoc-1.0) >= %{libver} -Requires: mongo-c-driver-libs%{?_isa} >= %{libbuildver} +BuildRequires: pkgconfig(libbson-1.0) >= %{libmongo} +BuildRequires: pkgconfig(libmongoc-1.0) >= %{libmongo} +BuildRequires: pkgconfig(libmongocrypt) >= %{libcrypt} +Requires: libbson%{?_isa} >= %{libmongover} +Requires: mongo-c-driver-libs%{?_isa} >= %{libmongover} +Requires: libmongocrypt%{?_isa} >= %{libcryptver} %else BuildRequires: cyrus-sasl-devel BuildRequires: openssl-devel @@ -65,8 +73,9 @@ BuildRequires: snappy-devel BuildRequires: zlib-devel # We require 50 to ensure use of libicu-last (same version than PHP) BuildRequires: libicu-devel >= 50 -Provides: bundled(libbson) = %{libver} -Provides: bundled(mongo-c-driver) = %{libver} +Provides: bundled(libbson) = %{libmongo} +Provides: bundled(mongo-c-driver) = %{libmongo} +Provides: bundled(libmongocrypt) = %{libcrypt} %endif %if %{with_tests} BuildRequires: mongodb-server @@ -138,6 +147,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .pr1095 + # Sanity check, really often broken extver=$(sed -n '/#define PHP_MONGODB_VERSION /{s/.* "//;s/".*$//;p}' phongo_version.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -170,18 +181,19 @@ peclbuild() { %if %{with_syslib} # Ensure we use system library # Need to be removed only after phpize because of m4_include - rm -r src/libmongoc + rm -r src/libmongoc* %configure \ --with-php-config=%{_bindir}/${1}-config \ - --with-libbson \ - --with-libmongoc \ + --with-mongodb-system-libs \ + --with-mongodb-client-side-encryption \ --enable-mongodb %else %configure \ --with-php-config=%{_bindir}/${1}-config \ --enable-mongodb-crypto-system-profile \ + --with-mongodb-client-side-encryption \ --with-mongodb-sasl=cyrus \ --with-mongodb-icu=yes \ --with-mongodb-ssl=openssl \ @@ -328,6 +340,13 @@ exit $ret %changelog +* Tue Feb 4 2020 Remi Collet <remi@remirepo.net> - 1.7.0-1 +- update to 1.7.0 +- with libbson and libmongoc 1.16.1 +- with libmongocrypt 1.0.1 +- fix build with system libraries using patch from + https://github.com/mongodb/mongo-php-driver/pull/1095 + * Fri Dec 6 2019 Remi Collet <remi@remirepo.net> - 1.6.1-1 - update to 1.6.1 |