@@ -20,8 +20,9 @@ MongoDB PHP Driver
2020 :titlesonly:
2121
2222 Laravel MongoDB <https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current>
23- /php-frameworks/symfony
24- /php-libraries
23+ Symfony Integration </php-frameworks/symfony>
24+ Drupal Integration </php-frameworks/drupal>
25+ Libraries, Frameworks, & Tools </php-libraries>
2526
2627.. contents:: On this page
2728 :local:
@@ -36,44 +37,31 @@ Welcome to the documentation site for the official MongoDB PHP driver.
3637You can add the driver to your application to work with MongoDB in PHP.
3738The MongoDB PHP Driver consists of the following components:
3839
39- - The `extension <https://github.com /mongodb/mongo-php-driver >`__, which
40- provides a low-level API and mainly serves to integrate
41- `libmongoc and libbson <https://www.mongodb.com/docs/languages/c/c-driver/ current/>`__ with
42- PHP.
40+ - `Extension <https://php.net /mongodb>`__:
41+ Provides a low-level API and mainly serves to integrate
42+ the `libmongoc <https://mongoc.org/libmongoc/ current/>`__ and
43+ `libbson <https://mongoc.org/libbson/current/>`__ libraries with PHP.
4344
44- - The `library <https://www.mongodb.com/docs/php-library/current>`__, which
45- provides a high-level API for working with MongoDB
45+ - `Library <https://www.mongodb.com/docs/php-library/current>`__:
46+ Provides a high-level API for working with MongoDB
4647 databases consistent with other MongoDB language drivers.
4748
48- While it is possible to use the extension alone, MongoDB recommends
49- using both the extension and the library together. To learn more about
50- the components of the PHP driver, see the :ref:`Driver Architecture
51- <php-driver-arch>` section of this page.
49+ While it is possible to use only the extension, we recommend
50+ using the extension and the library together. To learn more about
51+ the components of the PHP driver, see the :ref:`php-driver-arch` section
52+ of this page.
5253
53- Navigate through the following links to learn more about the driver and access
54+ View the following guides to learn more about the driver and access
5455tutorial content on setting up a runnable project:
5556
56- - `Tutorials <https://www.mongodb.com/docs/php-library/current/tutorial>`__
57+ - `Get Started with the PHP Library <https://www.mongodb.com/docs/php-library/current/get-started/>`__
58+ - `Connect to MongoDB <https://www.mongodb.com/docs/php-library/current/connect/>`__
5759
58- - `Extension Architecture and Internals <https://www.php.net/manual/en/mongodb.architecture.php>`__
60+ Reference
61+ ~~~~~~~~~
5962
60- - Documentation
61-
62- - `Library <https://www.mongodb.com/docs/php-library/current>`__
63-
64- - `Extension <https://php.net/mongodb>`__
65-
66- - Changelog
67-
68- - `Library <https://github.com/mongodb/mongo-php-library/releases>`__
69-
70- - `Extension <https://github.com/mongodb/mongo-php-driver/releases>`__
71-
72- - Source Code
73-
74- - `Library <https://github.com/mongodb/mongo-php-library>`__
75-
76- - `Extension <https://github.com/mongodb/mongo-php-driver>`__
63+ - :github:`Release Notes <mongodb/mongo-php-driver/releases>`
64+ - :github:`Driver Source Code <mongodb/mongo-php-driver>`
7765
7866.. _php-driver-arch:
7967
@@ -124,92 +112,53 @@ following environments:
124112Installation
125113------------
126114
127- First, make sure you have a recent version of PHP installed on your
128- system. See the
129- `official PHP manual <https://www.php.net/manual/en/install.php>`__
115+ Make sure you have a recent version of PHP installed on your
116+ system. See the `PHP manual <https://www.php.net/manual/en/install.php>`__
130117for download and installation instructions.
131118
132- Install the PHP MongoDB Extension before installing the PHP Library for
133- MongoDB . You can install the extension using
134- `PECL <https://www.php.net/manual/en/mongodb.installation.php>`__ on
135- the command line:
119+ Install the PHP MongoDB Extension before you install the MongoDB PHP
120+ Library . You can install the extension by using `PECL
121+ <https://www.php.net/manual/en/mongodb.installation.php>`__ on the
122+ command line:
136123
137124.. code-block:: sh
138125
139- $ sudo pecl install mongodb
126+ sudo pecl install mongodb
140127
141- Finally, add the following line to your ``php.ini`` file:
128+ After installation completes, add the following line to your ``php.ini``
129+ file:
142130
143131.. code-block:: text
144132
145133 extension=mongodb.so
146134
147135.. note::
148136
149- On some systems, there may be multiple INI files for individual SAPIs (e.g.
150- CLI, FPM). Make sure to enable the extension in all SAPIs that you need.
137+ On some systems, there might be multiple ``.ini`` files for
138+ individual SAPIs, such as CLI, FPM. Make sure to enable the extension
139+ in all SAPIs that you use.
151140
152- The preferred method of installing the PHP library is with
153- `Composer <https://getcomposer.org/>`__ by running the following from your project root:
141+ Then, install the PHP library by using `Composer
142+ <https://getcomposer.org/>`__. Run the following command from your
143+ project directory:
154144
155145.. code-block:: sh
156146
157- $ composer require mongodb/mongodb
147+ composer require mongodb/mongodb
158148
159- Once you have installed the library , ensure that your application includes
160- Composer's autoloader as in the following example:
149+ After installation completes , ensure that your application includes
150+ Composer's autoloader as shown in the following example:
161151
162152.. code-block:: php
163153
164154 <?php
165155
166156 require_once __DIR__ . '/vendor/autoload.php';
167157
168- Additional installation instructions may be found in the
169- `library documentation <https://www.mongodb.com/docs/php-library/current/tutorial/install-php-library/>`__.
170-
171- .. _connect-atlas-php-driver:
172-
173- Connect to MongoDB Atlas
174- ------------------------
175-
176- You can use the following connection snippet to test your connection to
177- your MongoDB deployment on Atlas:
178-
179- .. literalinclude:: /includes/connection-snippets/scram/php-connection.php
180- :language: php
181-
182- This connection snippet uses the {+stable-api+} feature, which you can
183- enable when using the PHP driver v1.9 and later to connect to MongoDB Server
184- v5.0 and later. When you use this feature, you can update your driver or server without
185- worrying about backward compatibility issues with any commands covered by the
186- {+stable-api+}.
187-
188- To learn more about the {+stable-api+} feature, see
189- :manual:`{+stable-api+} </reference/stable-api/>` in the Server manual.
190-
191- .. include:: /includes/stable-api-notice.rst
192-
193- .. _connect-atlas-no-stable-api-php-driver:
194-
195- Connect to MongoDB Atlas Without the Stable API
196- -----------------------------------------------
197-
198- If you are using a version of MongoDB or the driver that doesn't support the
199- {+stable-api+} feature, you can use the following code snippet to test your connection
200- to your MongoDB deployment on Atlas:
201-
202- .. literalinclude:: /includes/connection-snippets/scram/php-connection-no-stableapi.php
203- :language: php
204-
205- Connect to a MongoDB Server on Your Local Machine
206- -------------------------------------------------
207-
208- .. include:: /includes/localhost-connection.rst
209-
210- To test whether you can connect to your server, replace the connection
211- string in the :ref:`Connect to MongoDB Atlas <connect-atlas-php-driver>` code
212- example and run it.
158+ The `PHP Library documentation
159+ <https://www.mongodb.com/docs/php-library/current>`__ contains reference
160+ materials and tutorials that demonstrate how to interact with your
161+ MongoDB data.
213162
214163Compatibility
215164-------------
@@ -245,9 +194,3 @@ The first column lists the driver versions.
245194.. include:: /includes/about-driver-compatibility.rst
246195
247196.. include:: /includes/help-links-php.rst
248-
249- See Also
250- --------
251-
252- - :ref:`php-libraries-frameworks-and-tools`
253-
0 commit comments