Skip to content

Commit 464ca05

Browse files
Merge v1.17 into v1.18 (#1339)
* Merge v1.16 into v1.17 (#1327) * PHPLIB-1279: Revise driver/extension terminology (#1335) Prefer "extension" over "driver" when referring to ext-mongodb specifically. Also removes mention of Int64 having a private constructor. * PHPLIB-1466: Remove obsolete "Type Map Limitations" --------- Co-authored-by: Jeremy Mikola <[email protected]>
1 parent fd10c53 commit 464ca05

23 files changed

+71
-91
lines changed

docs/faq.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ The following are all examples of
125125

126126
These errors typically manifest as a
127127
:php:`MongoDB\Driver\Exception\ConnectionTimeoutException <mongodb-driver-exception-connectiontimeoutexception>`
128-
exception from the driver. The actual exception messages originate from
129-
libmongoc, which is the underlying library used by the PHP driver. Since these
130-
messages can take many forms, it's helpful to break down the structure of the
131-
message so you can better diagnose errors in your application.
128+
exception from the extension. The actual exception messages originate from
129+
libmongoc, which is the underlying system library used by the extension. Since
130+
these messages can take many forms, it's helpful to break down the structure of
131+
the message so you can better diagnose errors in your application.
132132

133133
Messages will typically start with "No suitable servers found". The next part of
134-
the message indicates *how* server selection failed. By default, the PHP driver
134+
the message indicates *how* server selection failed. By default, the extension
135135
avoids a server selection loop and instead makes a single attempt (according to
136-
the ``serverSelectionTryOnce`` connection string option). If the driver is
136+
the ``serverSelectionTryOnce`` connection string option). If the extension is
137137
configured to utilize a loop, a message like "serverSelectionTimeoutMS expired"
138138
will tell us that we exhausted its time limit.
139139

docs/includes/extracts-error.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ ref: error-driver-invalidargumentexception
1010
content: |
1111
:php:`MongoDB\Driver\Exception\InvalidArgumentException
1212
<mongodb-driver-exception-invalidargumentexception>` for errors related to the
13-
parsing of parameters or options at the driver level.
13+
parsing of parameters or options at the extension level.
1414
---
1515
ref: error-driver-runtimeexception
1616
content: |
1717
:php:`MongoDB\Driver\Exception\RuntimeException
18-
<mongodb-driver-exception-runtimeexception>` for other errors at the driver
18+
<mongodb-driver-exception-runtimeexception>` for other errors at the extension
1919
level (e.g. connection errors).
2020
---
2121
ref: error-badmethodcallexception-write-result

docs/includes/extracts-note.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ content: |
66
:php:`comparison <manual/en/types.comparisons.php>` and :php:`type juggling
77
<manual/en/language.types.type-juggling.php>` rules. When matching a special
88
BSON type the query criteria should use the respective :php:`BSON class
9-
<manual/en/book.bson.php>` in the driver (e.g. use
9+
<manual/en/book.bson.php>` in the extension (e.g. use
1010
:php:`MongoDB\BSON\ObjectId <class.mongodb-bson-objectid>` to match an
1111
:manual:`ObjectId </reference/object-id/>`).
1212
---

docs/index.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ MongoDB PHP Library
55
.. default-domain:: mongodb
66

77
The |php-library| provides a high-level abstraction around the lower-level
8-
`PHP driver <https://php.net/mongodb>`_, also known as the ``mongodb``
9-
extension.
8+
:php:`mongodb extension <mongodb>`.
109

1110
The ``mongodb`` extension provides a limited API to connect to the database and
1211
execute generic commands, queries, and write operations. In contrast, the

docs/reference/bson.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Classes
2828

2929
This class extends PHP's :php:`ArrayObject <arrayobject>` class. It also
3030
implements PHP's :php:`JsonSerializable <jsonserializable>` interface and the
31-
driver's :php:`MongoDB\BSON\Serializable <mongodb-bson-serializable>` and
31+
extension's :php:`MongoDB\BSON\Serializable <mongodb-bson-serializable>` and
3232
:php:`MongoDB\BSON\Unserializable <mongodb-bson-unserializable>`
3333
interfaces.
3434

@@ -41,7 +41,7 @@ Classes
4141

4242
This class extends PHP's :php:`ArrayObject <arrayobject>` class. It also
4343
implements PHP's :php:`JsonSerializable <jsonserializable>` interface and the
44-
driver's :php:`MongoDB\BSON\Serializable <mongodb-bson-serializable>` and
44+
extension's :php:`MongoDB\BSON\Serializable <mongodb-bson-serializable>` and
4545
:php:`MongoDB\BSON\Unserializable <mongodb-bson-unserializable>`
4646
interfaces.
4747

docs/reference/class/MongoDBClient.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Definition
1818
This class serves as an entry point for the |php-library|. It is the
1919
preferred class for connecting to a MongoDB server or cluster of servers and
2020
acts as a gateway for accessing individual databases and collections.
21-
:phpclass:`MongoDB\Client` is analogous to the driver's
21+
:phpclass:`MongoDB\Client` is analogous to the extension's
2222
:php:`MongoDB\Driver\Manager <mongodb-driver-manager>` class, which it
2323
`composes <https://en.wikipedia.org/wiki/Object_composition>`_.
2424

docs/reference/class/MongoDBCollection.txt

+1-15
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Definition
1818
Provides methods for common operations on collections and documents,
1919
including CRUD operations and index management.
2020

21-
You can construct collections directly using the driver's
21+
You can construct collections directly using the extension's
2222
:php:`MongoDB\Driver\Manager <class.mongodb-driver-manager>` class or
2323
select a collection from the library's :phpclass:`MongoDB\Client` or
2424
:phpclass:`MongoDB\Database` classes. A collection may also be cloned from
@@ -37,20 +37,6 @@ Definition
3737
Operations within the :phpclass:`MongoDB\Collection` class inherit the
3838
collection's options.
3939

40-
Type Map Limitations
41-
--------------------
42-
43-
The :manual:`aggregate </reference/command/aggregate>` (when not using a
44-
cursor), :manual:`distinct </reference/command/distinct>`, and
45-
:manual:`findAndModify </reference/command/findAndModify>` helpers do not
46-
support a ``typeMap`` option due to a driver limitation. The
47-
:phpmethod:`aggregate() <MongoDB\Collection::aggregate()>`,
48-
:phpmethod:`distinct() <MongoDB\Collection::distinct()>`,
49-
:phpmethod:`findOneAndReplace() <MongoDB\Collection::findOneAndReplace()>`,
50-
:phpmethod:`findOneAndUpdate() <MongoDB\Collection::findOneAndUpdate()>`, and
51-
:phpmethod:`findOneAndDelete() <MongoDB\Collection::findOneAndDelete()>`
52-
methods return BSON documents as ``stdClass`` objects and BSON arrays as arrays.
53-
5440
Methods
5541
-------
5642

docs/reference/class/MongoDBDatabase.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Definition
1818
Provides methods for common operations on a database, such as executing
1919
database commands and managing collections.
2020

21-
You can construct a database directly using the driver's
21+
You can construct a database directly using the extension's
2222
:php:`MongoDB\Driver\Manager <class.mongodb-driver-manager>` class or
2323
select a database from the library's :phpclass:`MongoDB\Client` class. A
2424
database may also be cloned from an existing :phpclass:`MongoDB\Database`

docs/reference/class/MongoDBGridFSBucket.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Definition
2222
provides an interface around these collections for working with the files as
2323
PHP :php:`Streams <stream>`.
2424

25-
You can construct a GridFS bucket using the driver's
25+
You can construct a GridFS bucket using the extension's
2626
:php:`Manager <class.mongodb-driver-manager>` class, or select a bucket from
2727
the library's :phpclass:`MongoDB\Database` class via the
2828
:phpmethod:`selectGridFSBucket() <MongoDB\Database::selectGridFSBucket()>`

docs/reference/exception-classes.txt

+5-6
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ MongoDB\\Exception\\InvalidArgumentException
5353
Thrown for errors related to the parsing of parameters or options within the
5454
library.
5555

56-
This class extends the driver's :php:`InvalidArgumentException
56+
This class extends the extension's :php:`InvalidArgumentException
5757
<mongodb-driver-exception-invalidargumentexception>` class and implements the
5858
library's :phpclass:`Exception <MongoDB\Exception\Exception>` interface.
5959

@@ -67,10 +67,9 @@ MongoDB\\Exception\\UnexpectedValueException
6767
This exception is thrown when a command response from the server is
6868
malformed or not what the library expected. This exception means that an
6969
assertion in some operation, which abstracts a database command, has failed.
70-
It may indicate a corrupted BSON response or bug in the server, driver, or
71-
library.
70+
It may indicate a corrupted BSON response or bug in the server or driver.
7271

73-
This class extends the driver's :php:`UnexpectedValueException
72+
This class extends the extension's :php:`UnexpectedValueException
7473
<mongodb-driver-exception-unexpectedvalueexception>` class and implements the
7574
library's :phpclass:`Exception <MongoDB\Exception\Exception>` interface.
7675

@@ -133,7 +132,7 @@ MongoDB\\Exception\\Exception
133132

134133
.. phpclass:: MongoDB\Exception\Exception
135134

136-
This interface extends the driver's :php:`Exception
135+
This interface extends the extension's :php:`Exception
137136
<mongodb-driver-exception-exception>` interface and is implemented by all
138137
exception classes within the library.
139138

@@ -144,6 +143,6 @@ MongoDB\\Exception\\RuntimeException
144143

145144
.. phpclass:: MongoDB\Exception\RuntimeException
146145

147-
This class extends the driver's :php:`RuntimeException
146+
This class extends the extension's :php:`RuntimeException
148147
<mongodb-driver-exception-runtimeexception>` class, which in turn extends
149148
PHP's :php:`RuntimeException <runtimeexception>` class.

docs/reference/function/add_logger.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Definition
1717

1818
.. phpmethod:: MongoDB\add_logger()
1919

20-
Registers a PSR logger to receive log messages from the driver.
20+
Registers a PSR logger to receive log messages from the extension.
2121

2222
.. code-block:: php
2323

@@ -36,8 +36,8 @@ Behavior
3636

3737
This function allows the application to register one or more
3838
`Psr\\Log\\LoggerInterface <https://www.php-fig.org/psr/psr-3/#3-psrlogloggerinterface>`__
39-
objects to receive log messages from libmongoc and the driver. Each registered
40-
logger will receive messages for *all* clients.
39+
objects to receive log messages from libmongoc and the extension. Each
40+
registered logger will receive messages for *all* clients.
4141

4242
Messages originating from the extension will have their log level translated to
4343
an equivalent `PSR log level <https://www.php-fig.org/psr/psr-3/#5-psrlogloglevel>`__.

docs/reference/function/remove_logger.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Definition
1717

1818
.. phpmethod:: MongoDB\remove_logger()
1919

20-
Unregisters a PSR logger to no longer receive log messages from the driver.
20+
Unregisters a PSR logger to no longer receive log messages from the
21+
extension.
2122

2223
.. code-block:: php
2324

docs/reference/method/MongoDBDatabase__construct.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Parameters
2929
----------
3030

3131
``$manager`` : :php:`MongoDB\Driver\Manager <class.mongodb-driver-manager>`
32-
The :php:`Manager <mongodb-driver-manager>` instance from the driver. The
33-
manager maintains connections between the driver and your MongoDB instances.
32+
The :php:`Manager <mongodb-driver-manager>` instance from the extension. The
33+
manager maintains connections between the driver and MongoDB.
3434

3535
``$databaseName`` : string
3636
The name of the database.

docs/reference/method/MongoDBGridFSBucket__construct.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Parameters
2929
----------
3030

3131
``$manager`` : :php:`MongoDB\Driver\Manager <class.mongodb-driver-manager>`
32-
The :php:`Manager <mongodb-driver-manager>` instance from the driver. The
33-
manager maintains connections between the driver and your MongoDB instances.
32+
The :php:`Manager <mongodb-driver-manager>` instance from the extension. The
33+
manager maintains connections between the driver and MongoDB.
3434

3535
``$databaseName`` : string
3636
The name of the database.

docs/tutorial/commands.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The output might resemble the following:
9191
will return a single result document with the essential ingredients for
9292
constructing the cursor (i.e. the cursor's ID, namespace, and an optional
9393
first batch of results). If the :php:`MongoDB\Driver\Manager::executeCommand()
94-
<mongodb-driver-manager.executecommand>` method in the PHP driver detects
94+
<mongodb-driver-manager.executecommand>` method in the extension detects
9595
such a response, it will construct an iterable command cursor and return it
9696
instead of the raw result document. If necessary, raw result documents can
9797
still be observed using `command monitoring

docs/tutorial/custom-types.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if you want to store date/time information retaining the time zone
1616
information that PHP's :php:`DateTimeImmutable <class.datetimeimmutable>`
1717
class stores with a point in time.
1818

19-
The driver serializes PHP variables, including objects, into BSON when it
19+
The extension serializes PHP variables, including objects, into BSON when it
2020
communicates to the server, and deserializes BSON back into PHP variables when
2121
it receives data from the server.
2222

@@ -74,12 +74,12 @@ a string containing the Olson time zone identifier:
7474
}
7575
?>
7676

77-
The driver will additionally add a ``__pclass`` field to the document, and
77+
The extension will additionally add a ``__pclass`` field to the document, and
7878
store that in the database, too. This field contains the PHP class name so that
79-
upon deserialization the driver knows which class to use for recreating the
79+
upon deserialization the extension knows which class to use for recreating the
8080
stored object.
8181

82-
When the document is read from the database, the driver detects whether a
82+
When the document is read from the database, the extension detects whether a
8383
``__pclass`` field is present and then executes
8484
:php:`MongoDB\BSON\Persistable::bsonUnserialize
8585
<mongodb-bson-unserializable.bsonunserialize>` method which is

docs/tutorial/decimal128.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ floating-point value capable of emulating decimal rounding with exact precision.
1919
This functionality is intended for applications that handle :manual:`monetary
2020
data </tutorial/model-monetary-data>`, such as financial and tax computations.
2121

22-
The :php:`MongoDB\BSON\Decimal128 <mongodb-bson-decimal128>` class, which was
23-
introduced in :php:`PHP driver <mongodb>` 1.2.0, may be used to work with this
24-
type in PHP.
22+
The :php:`MongoDB\BSON\Decimal128 <mongodb-bson-decimal128>` class may be used
23+
to work with this type in PHP.
2524

2625
Working with Decimal128 Values
2726
------------------------------
@@ -70,7 +69,7 @@ The output would then resemble:
7069
Mathematical Operations with BCMath
7170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7271

73-
The :php:`PHP driver <mongodb>` does not provide any functionality for working
72+
The :php:`extension <mongodb>` does not provide any functionality for working
7473
with ``Decimal128`` values; however, the string representation of a
7574
:php:`MongoDB\BSON\Decimal128 <mongodb-bson-decimal128>` object may be used
7675
with PHP's :php:`BCMath <bcmath>` extension.

docs/tutorial/encryption.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Dependencies
1515
------------
1616

1717
To get started using in-use encryption in your project, the
18-
`PHP driver <https://php.net/mongodb>`_ (i.e. ``mongodb`` extension) will need
19-
to be compiled with `libmongocrypt <https://github.com/mongodb/libmongocrypt>`_
20-
(enabled by default).
18+
:php:`extension <mongodb>` will need to be compiled with
19+
`libmongocrypt <https://github.com/mongodb/libmongocrypt>`_ (enabled by
20+
default).
2121

2222
Additionally, either ``crypt_shared`` or ``mongocryptd`` are required in order to
2323
use *automatic* client-side encryption. Neither is required for *explicit*
@@ -31,14 +31,14 @@ The :manual:`Automatic Encryption Shared Library </core/queryable-encryption/ref
3131
(``crypt_shared``) provides the same functionality as ``mongocryptd``, but does not
3232
require you to spawn another process to perform automatic encryption.
3333

34-
By default, the PHP driver attempts to load ``crypt_shared`` from the system path(s)
35-
and uses it automatically if found. To load ``crypt_shared`` from another location,
36-
use the ``cryptSharedLibPath`` auto encryption
34+
By default, the extension attempts to load ``crypt_shared`` from the system
35+
path(s) and uses it automatically if found. To load ``crypt_shared`` from
36+
another location, use the ``cryptSharedLibPath`` auto encryption
3737
:php:`driver option <manual/en/mongodb-driver-manager.construct.php#mongodb-driver-manager.construct-driveroptions>`
38-
when constructing a client. If the driver cannot load ``crypt_shared`` it will
39-
attempt to fallback to using ``mongocryptd`` by default. The
40-
``cryptSharedLibRequired`` option may be used to always require ``crypt_shared`` and
41-
fail if it cannot be loaded.
38+
when constructing a client. If the extension cannot load ``crypt_shared`` it
39+
will attempt to fallback to using ``mongocryptd`` by default. The
40+
``cryptSharedLibRequired`` option may be used to always require ``crypt_shared``
41+
and fail if it cannot be loaded.
4242

4343
For detailed installation instructions see the MongoDB documentation for the
4444
:manual:`Automatic Encryption Shared Library </core/queryable-encryption/reference/shared-library/>`.

docs/tutorial/example-data.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Some examples in this documentation use example data fixtures from
99
`primer-dataset.json <https://raw.githubusercontent.com/mongodb/docs-assets/primer-dataset/primer-dataset.json>`_.
1010

1111
Importing the dataset into MongoDB can be done in several ways. The following
12-
example imports the ``zips.json`` file into a ``test.zips`` collection:
13-
:php:`driver <mongodb>` directly:
12+
example imports the ``zips.json`` file into a ``test.zips`` collection using the
13+
:php:`extension <mongodb>` directly:
1414

1515
.. code-block:: php
1616

docs/tutorial/install-php-library.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ Install the |php-library|
1111
:class: singlecol
1212

1313
The |php-library| is a high-level abstraction for the
14-
`PHP driver <https://php.net/mongodb>`_ (i.e. ``mongodb`` extension). This page
15-
will briefly explain how to install both the ``mongodb`` extension and the
16-
|php-library|.
14+
:php:`mongodb extension <mongodb>`. This page will briefly explain how to
15+
install both the ``mongodb`` extension and the |php-library|.
1716

1817
Installing the Extension
1918
------------------------

docs/tutorial/modeling-bson-data.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ are aliases of one another).
5353
Persistable Classes
5454
-------------------
5555

56-
The driver's :php:`persistence specification <mongodb.persistence>` outlines how
57-
classes implementing its :php:`MongoDB\BSON\Persistable
56+
The extension's :php:`persistence specification <mongodb.persistence>` outlines
57+
how classes implementing its :php:`MongoDB\BSON\Persistable
5858
<mongodb-bson-persistable>` interface are serialized to and deserialized from
5959
BSON. The :php:`Persistable <mongodb-bson-persistable>` interface is analogous
6060
to PHP's :php:`Serializable interface <class.serializable>`.
6161

62-
The driver automatically handles serialization and deserialization for classes
63-
implementing the :php:`Persistable <mongodb-bson-persistable>` interface without
64-
requiring the use of the ``typeMap`` option. This is done by encoding the name
65-
of the PHP class in a special property within the BSON document.
62+
The extension automatically handles serialization and deserialization for
63+
classes implementing the :php:`Persistable <mongodb-bson-persistable>` interface
64+
without requiring the use of the ``typeMap`` option. This is done by encoding
65+
the name of the PHP class in a special property within the BSON document.
6666

6767
.. note::
6868

docs/tutorial/server-selection.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Server Selection and Monitoring
1515

1616
Before any operation can be executed, the |php-library| must first select a
1717
server from the topology (e.g. replica set, sharded cluster). Selecting a server
18-
requires an accurate view of the topology, so the driver (i.e. ``mongodb``
19-
extension) regularly monitors the servers to which it is connected.
18+
requires an accurate view of the topology, so the extension regularly monitors
19+
the servers to which it is connected.
2020

2121
In most other drivers, server discovery and monitoring is handled by a
2222
background thread; however, the PHP driver is single-threaded and must therefore
@@ -30,9 +30,9 @@ Consider the following example application:
3030

3131
/**
3232
* When constructing a Client, the library creates a MongoDB\Driver\Manager
33-
* object from the driver. In turn, the driver will either create a libmongoc
34-
* client object (and persist it according to the constructor parameters) or
35-
* re-use a previously persisted client.
33+
* object from the extension. In turn, the extension will either create a
34+
* libmongoc client object (and persist it according to the constructor
35+
* parameters) or re-use a previously persisted client.
3636
*
3737
* Assuming a new libmongoc client was created, the host name(s) in the
3838
* connection string must be resolved via DNS. Likewise, if the connection

0 commit comments

Comments
 (0)