From 6b96600f485c29996d75af92d2537a138a1d9b09 Mon Sep 17 00:00:00 2001 From: Rea Rustagi Date: Tue, 17 Oct 2023 13:28:52 -0400 Subject: [PATCH] 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