From 6b96600f485c29996d75af92d2537a138a1d9b09 Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:28:52 -0400 Subject: [PATCH 1/9] DOCSP-33692: php improvements --- source/figures/PHP-driver-arch.rst | 3 ++ source/figures/PHP_driver_architecture.svg | 1 + source/php-libraries.txt | 6 +-- source/php.txt | 59 +++++++++++++++++----- 4 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 source/figures/PHP-driver-arch.rst create mode 100644 source/figures/PHP_driver_architecture.svg diff --git a/source/figures/PHP-driver-arch.rst b/source/figures/PHP-driver-arch.rst new file mode 100644 index 000000000..1d43e2674 --- /dev/null +++ b/source/figures/PHP-driver-arch.rst @@ -0,0 +1,3 @@ +.. figure:: /figures/PHP_driver_architecture.svg + :alt: PHP driver component architecture + :figwidth: 500px \ No newline at end of file diff --git a/source/figures/PHP_driver_architecture.svg b/source/figures/PHP_driver_architecture.svg new file mode 100644 index 000000000..67d7a0e2a --- /dev/null +++ b/source/figures/PHP_driver_architecture.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/php-libraries.txt b/source/php-libraries.txt index fb34b92c8..6479e452e 100644 --- a/source/php-libraries.txt +++ b/source/php-libraries.txt @@ -37,7 +37,6 @@ Standalone Libraries use this standalone library or use the `Laravel `__ integration, which adds support for failed jobs, migrations, and events. - Framework Integrations ---------------------- @@ -50,7 +49,7 @@ Framework Integrations - Laravel - - `Laravel MongoDB `__ is an + - `Laravel MongoDB `__ is an Eloquent model and Query builder that supports MongoDB by using the original Laravel API. This library extends the original Laravel classes and therefore uses the same methods. @@ -90,5 +89,4 @@ Tools and Projects a common way for programs to create, send, and read messages. - `XHGui `__ is a web interface for the - XHProf profiler, which stores profiling data in MongoDB. - + XHProf profiler, which stores profiling data in MongoDB. \ No newline at end of file diff --git a/source/php.txt b/source/php.txt index f6a8d40fb..8317cf39c 100644 --- a/source/php.txt +++ b/source/php.txt @@ -4,8 +4,6 @@ MongoDB PHP Driver ================== -.. default-domain:: mongodb - .. facet:: :name: programming_language :values: php @@ -28,7 +26,6 @@ MongoDB PHP Driver :depth: 1 :class: twocols - Introduction ------------ @@ -36,19 +33,22 @@ Welcome to the documentation site for the official MongoDB PHP driver. You can add the driver to your application to work with MongoDB in PHP. The MongoDB PHP Driver consists of the two following components: -- The `extension `_, which +- The `extension `__, which provides a low-level API and mainly serves to integrate - `libmongoc and libbson `_ with + :ref:`libmongoc and libbson ` with PHP. -- The `library `_, which +- The :ref:`library `_, which provides a high-level API for working with MongoDB databases consistent with other MongoDB language drivers. While it is possible to use the extension alone, MongoDB recommends -using both the extension and the library together. Download the -components you need or set up a runnable project by following our -tutorials. +using both the extension and the library together. To learn more about +the components of the PHP driver, see the :ref:`Driver Architecture +` section of this page. + +Navigate through the following links to learn more about the driver and access +tutorial content on setting up a runnable project: - `Tutorials `__ @@ -72,6 +72,42 @@ tutorials. - `Extension `__ +.. _php-driver-arch: + +Driver Architecture +------------------- + +This section describes how the components of the PHP driver work together. +These components fit into the following general categories: + +- High-Level API, which includes the library and other integrations +- Extension, which includes the extension that integrates the system libraries +- System, which includes the C Driver, BSON library, and encryption library + +The following diagram illustrates the architecture of the PHP driver +components: + +.. include: /figures/PHP-driver-arch.rst + +The PHP library provides an API that is consistent with the other +drivers, and it is continually updated to meet cross-drivers +specifications. You need to add the library as a dependency in most +applications that use PHP to work with MongoDB. + +The extension is distributed by `PECL +`__, and +connects PHP to the system libraries. The extension's public API +provides the following functionality: + +- Connection management +- BSON encoding and decoding +- Object document serialization +- Command execution +- Cursor management + +To learn more about the system libraries, see the :ref:`C Driver +` documentation. + Compatibility ------------- @@ -80,18 +116,17 @@ following environments: .. include:: /includes/fact-environments.rst - Installation ------------ First, make sure you have a recent version of PHP installed on your system. See the -`official PHP manual `_ +`official PHP manual `__ for download and installation instructions. Install the PHP MongoDB Extension before installing the PHP Library for MongoDB. You can install the extension using -`PECL `_ on +`PECL `__ on the command line: .. code-block:: sh From 9a3a6643c5d646ede2c6a6748c794bd7df8b31c1 Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:31:13 -0400 Subject: [PATCH 2/9] error fixes --- source/php.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/php.txt b/source/php.txt index 8317cf39c..6c8f32495 100644 --- a/source/php.txt +++ b/source/php.txt @@ -38,7 +38,7 @@ The MongoDB PHP Driver consists of the two following components: :ref:`libmongoc and libbson ` with PHP. -- The :ref:`library `_, which +- The `library `__, which provides a high-level API for working with MongoDB databases consistent with other MongoDB language drivers. From 7eb109f836c4116661b3ec83d12f9fbb9074be4f Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:33:32 -0400 Subject: [PATCH 3/9] test --- source/php.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/php.txt b/source/php.txt index 6c8f32495..25e412f6c 100644 --- a/source/php.txt +++ b/source/php.txt @@ -87,7 +87,9 @@ These components fit into the following general categories: The following diagram illustrates the architecture of the PHP driver components: -.. include: /figures/PHP-driver-arch.rst +.. figure:: /figures/PHP_driver_architecture.svg + :alt: PHP driver component architecture + :figwidth: 500px The PHP library provides an API that is consistent with the other drivers, and it is continually updated to meet cross-drivers From f3b336cb93ccc4056bd9f6761985659423441d83 Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:35:15 -0400 Subject: [PATCH 4/9] image width --- source/figures/PHP-driver-arch.rst | 3 --- source/php.txt | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 source/figures/PHP-driver-arch.rst diff --git a/source/figures/PHP-driver-arch.rst b/source/figures/PHP-driver-arch.rst deleted file mode 100644 index 1d43e2674..000000000 --- a/source/figures/PHP-driver-arch.rst +++ /dev/null @@ -1,3 +0,0 @@ -.. figure:: /figures/PHP_driver_architecture.svg - :alt: PHP driver component architecture - :figwidth: 500px \ No newline at end of file diff --git a/source/php.txt b/source/php.txt index 25e412f6c..3dffa8772 100644 --- a/source/php.txt +++ b/source/php.txt @@ -89,7 +89,7 @@ components: .. figure:: /figures/PHP_driver_architecture.svg :alt: PHP driver component architecture - :figwidth: 500px + :figwidth: 700px The PHP library provides an API that is consistent with the other drivers, and it is continually updated to meet cross-drivers From 695b57e4b523af9a62006086d0bc409193474cb7 Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:36:52 -0400 Subject: [PATCH 5/9] image width --- source/php.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/php.txt b/source/php.txt index 3dffa8772..76cf260f5 100644 --- a/source/php.txt +++ b/source/php.txt @@ -89,7 +89,7 @@ components: .. figure:: /figures/PHP_driver_architecture.svg :alt: PHP driver component architecture - :figwidth: 700px + :figwidth: 600px The PHP library provides an API that is consistent with the other drivers, and it is continually updated to meet cross-drivers From d730add19a44c445e8d9fab6842d4c688db25358 Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:38:22 -0400 Subject: [PATCH 6/9] small fix --- source/php.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/php.txt b/source/php.txt index 76cf260f5..448d65eb0 100644 --- a/source/php.txt +++ b/source/php.txt @@ -92,7 +92,7 @@ components: :figwidth: 600px The PHP library provides an API that is consistent with the other -drivers, and it is continually updated to meet cross-drivers +drivers, and it is continually updated to meet cross-driver specifications. You need to add the library as a dependency in most applications that use PHP to work with MongoDB. From 7d3f365b222830de4c2e831a72e5a49e09e209ad Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:40:16 -0400 Subject: [PATCH 7/9] vale issues --- source/php.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/php.txt b/source/php.txt index 448d65eb0..3151dd82c 100644 --- a/source/php.txt +++ b/source/php.txt @@ -93,7 +93,7 @@ components: The PHP library provides an API that is consistent with the other drivers, and it is continually updated to meet cross-driver -specifications. You need to add the library as a dependency in most +specifications. You must add the library as a dependency in most applications that use PHP to work with MongoDB. The extension is distributed by `PECL @@ -147,7 +147,7 @@ Finally, add the following line to your ``php.ini`` file: CLI, FPM). Make sure to enable the extension in all SAPIs that you need. The preferred method of installing the PHP library is with -`Composer `_ by running the following from your project root: +`Composer `__ by running the following from your project root: .. code-block:: sh @@ -163,7 +163,7 @@ Composer's autoloader as in the following example: require_once __DIR__ . '/vendor/autoload.php'; Additional installation instructions may be found in the -`library documentation `_. +`library documentation `__. .. _connect-atlas-php-driver: @@ -214,7 +214,7 @@ Compatibility Due to potential problems representing 64-bit integers on 32-bit platforms, users are advised to use 64-bit environments. When using a 32-bit platform, be aware that any 64-bit integer read from the database will be returned as a -`MongoDB\\BSON\\Int64 `_ +`MongoDB\\BSON\\Int64 `__ instance instead of a PHP integer type. MongoDB Compatibility From 353b0fd3636af61063a598a403c6b852bb52be79 Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 16:03:25 -0400 Subject: [PATCH 8/9] JS PR fixes 1 --- source/php.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/php.txt b/source/php.txt index 3151dd82c..53250d4d4 100644 --- a/source/php.txt +++ b/source/php.txt @@ -92,9 +92,9 @@ components: :figwidth: 600px The PHP library provides an API that is consistent with the other -drivers, and it is continually updated to meet cross-driver -specifications. You must add the library as a dependency in most -applications that use PHP to work with MongoDB. +MongoDB drivers. The library is continually updated to meet cross-driver +specifications. You must add the library as a dependency to access +MongoDB in most PHP applications. The extension is distributed by `PECL `__, and From 47da8bf04f5b6b2b2126c42dd03c280936798cbb Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Wed, 18 Oct 2023 10:26:00 -0400 Subject: [PATCH 9/9] AB tech review comment --- source/php.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/php.txt b/source/php.txt index 53250d4d4..ad2dbd1bd 100644 --- a/source/php.txt +++ b/source/php.txt @@ -96,7 +96,7 @@ MongoDB drivers. The library is continually updated to meet cross-driver specifications. You must add the library as a dependency to access MongoDB in most PHP applications. -The extension is distributed by `PECL +The extension is distributed by using `PECL `__, and connects PHP to the system libraries. The extension's public API provides the following functionality: