Commit fcf45ca8 authored by Ondrej Sury's avatar Ondrej Sury

New upstream version 1.5.3

parent 7764245c

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
This diff is collapsed.
/*
* Copyright 2014-2018 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef PHONGO_VERSION_H
#define PHONGO_VERSION_H
/* clang-format off */
#define PHP_MONGODB_VERSION "1.5.2"
#define PHP_MONGODB_STABILITY "stable"
#define PHP_MONGODB_VERSION_DESC 1,5,0,6
/* clang-format on */
#endif /* PHONGO_VERSION_H */
/*
* Copyright 2014-2017 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef PHONGO_BSON_H
#define PHONGO_BSON_H
#include <bson.h>
/* PHP Core stuff */
#include <php.h>
#define BSON_UNSERIALIZE_FUNC_NAME "bsonUnserialize"
#define BSON_SERIALIZE_FUNC_NAME "bsonSerialize"
#define PHONGO_ODM_FIELD_NAME "__pclass"
typedef enum {
PHONGO_BSON_NONE = 0x00,
PHONGO_BSON_ADD_ID = 0x01,
PHONGO_BSON_RETURN_ID = 0x02
} php_phongo_bson_flags_t;
typedef enum {
PHONGO_TYPEMAP_NONE,
PHONGO_TYPEMAP_NATIVE_ARRAY,
PHONGO_TYPEMAP_NATIVE_OBJECT,
PHONGO_TYPEMAP_CLASS
} php_phongo_bson_typemap_types;
typedef enum {
PHONGO_FIELD_PATH_ITEM_NONE,
PHONGO_FIELD_PATH_ITEM_ARRAY,
PHONGO_FIELD_PATH_ITEM_DOCUMENT
} php_phongo_bson_field_path_item_types;
typedef struct {
char** elements;
php_phongo_bson_field_path_item_types* element_types;
size_t allocated_size;
size_t size;
size_t ref_count;
bool owns_elements;
} php_phongo_field_path;
typedef struct _php_phongo_field_path_map_element {
php_phongo_field_path* entry;
php_phongo_bson_typemap_types node_type;
zend_class_entry* node_ce;
} php_phongo_field_path_map_element;
typedef struct {
php_phongo_bson_typemap_types document_type;
zend_class_entry* document;
php_phongo_bson_typemap_types array_type;
zend_class_entry* array;
php_phongo_bson_typemap_types root_type;
zend_class_entry* root;
struct {
php_phongo_field_path_map_element** map;
size_t allocated_size;
size_t size;
} field_paths;
} php_phongo_bson_typemap;
typedef struct {
ZVAL_RETVAL_TYPE zchild;
php_phongo_bson_typemap map;
zend_class_entry* odm;
bool is_visiting_array;
php_phongo_field_path* field_path;
} php_phongo_bson_state;
#if PHP_VERSION_ID >= 70000
#define PHONGO_BSON_STATE_INITIALIZER \
{ \
{ { 0 } }, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL }, NULL, NULL \
}
#else
#define PHONGO_BSON_STATE_INITIALIZER \
{ \
NULL, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL }, NULL, NULL \
}
#endif
void php_phongo_zval_to_bson(zval* data, php_phongo_bson_flags_t flags, bson_t* bson, bson_t** bson_out TSRMLS_DC);
bool php_phongo_bson_to_zval_ex(const unsigned char* data, int data_len, php_phongo_bson_state* state);
#if PHP_VERSION_ID >= 70000
bool php_phongo_bson_to_zval(const unsigned char* data, int data_len, zval* out);
#else
bool php_phongo_bson_to_zval(const unsigned char* data, int data_len, zval** out);
#endif
bool php_phongo_bson_typemap_to_state(zval* typemap, php_phongo_bson_typemap* map TSRMLS_DC);
void php_phongo_bson_state_ctor(php_phongo_bson_state* state);
void php_phongo_bson_state_dtor(php_phongo_bson_state* state);
void php_phongo_bson_state_copy_ctor(php_phongo_bson_state* dst, php_phongo_bson_state* src);
void php_phongo_bson_typemap_dtor(php_phongo_bson_typemap* map);
php_phongo_field_path* php_phongo_field_path_alloc(bool owns_elements);
void php_phongo_field_path_free(php_phongo_field_path* field_path);
void php_phongo_field_path_write_item_at_current_level(php_phongo_field_path* field_path, const char* element);
void php_phongo_field_path_write_type_at_current_level(php_phongo_field_path* field_path, php_phongo_bson_field_path_item_types element_type);
bool php_phongo_field_path_push(php_phongo_field_path* field_path, const char* element, php_phongo_bson_field_path_item_types element_type);
bool php_phongo_field_path_pop(php_phongo_field_path* field_path);
char* php_phongo_field_path_as_string(php_phongo_field_path* field_path);
#endif /* PHONGO_BSON_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
PHP_ARG_WITH([mongodb-ssl],
[whether to enable crypto and TLS],
[AS_HELP_STRING([--with-mongodb-ssl=@<:@auto/no/openssl/libressl/darwin@:>@],
[MongoDB: Enable TLS connections and SCRAM-SHA-1 authentication [default=auto]])],
[auto],
[no])
PHP_ARG_WITH([openssl-dir],
[deprecated option for OpenSSL library path],
[AC_HELP_STRING([--with-openssl-dir=@<:@auto/DIR@:>@],
[MongoDB: OpenSSL library path (deprecated for pkg-config) [default=auto]])],
[auto],
[no])
dnl PHP_ARG_WITH without a value assigns "yes". Treat it like "auto" but required.
AS_IF([test "$PHP_MONGODB_SSL" = "yes"],[
crypto_required="yes"
PHP_MONGODB_SSL="auto"
])
AS_IF([test "$PHP_MONGODB_SSL" = "darwin" -o \( "$PHP_MONGODB_SSL" = "auto" -a "$os_darwin" = "yes" \)],[
AC_MSG_NOTICE([checking whether Darwin SSL is available])
if test "$os_darwin" = "no"; then
AC_MSG_ERROR([Darwin SSL is only supported on macOS])
fi
dnl PHP_FRAMEWORKS is only used for SAPI builds, so use MONGODB_SHARED_LIBADD for shared builds
if test "$ext_shared" = "yes"; then
MONGODB_SHARED_LIBADD="-framework Security -framework CoreFoundation $MONGODB_SHARED_LIBADD"
else
PHP_ADD_FRAMEWORK([Security])
PHP_ADD_FRAMEWORK([CoreFoundation])
fi
PHP_MONGODB_SSL="darwin"
])
AS_IF([test "$PHP_MONGODB_SSL" = "openssl" -o "$PHP_MONGODB_SSL" = "auto"],[
AC_MSG_NOTICE([checking whether OpenSSL is available])
found_openssl="no"
PKG_CHECK_MODULES([PHP_MONGODB_SSL],[openssl],[
PHP_MONGODB_BUNDLED_CFLAGS="$PHP_MONGODB_BUNDLED_CFLAGS $PHP_MONGODB_SSL_CFLAGS"
PHP_EVAL_LIBLINE([$PHP_MONGODB_SSL_LIBS],[MONGODB_SHARED_LIBADD])
PHP_MONGODB_SSL="openssl"
found_openssl="yes"
old_CFLAGS="$CFLAGS"
CFLAGS="$PHP_MONGODB_SSL_CFLAGS $CFLAGS"
AC_CHECK_DECLS([ASN1_STRING_get0_data],
[have_ASN1_STRING_get0_data="yes"],
[have_ASN1_STRING_get0_data="no"],
[[#include <openssl/asn1.h>]])
CFLAGS="$old_CFLAGS"
],[
unset OPENSSL_INCDIR
unset OPENSSL_LIBDIR
dnl Use a list of directories from PHP_SETUP_OPENSSL by default.
dnl Support documented "auto" and older, undocumented "yes" options
if test "$PHP_OPENSSL_DIR" = "auto" -o "$PHP_OPENSSL_DIR" = "yes"; then
PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
for i in $PHP_OPENSSL_DIR; do
if te