Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 18 additions & 35 deletions source/php-drivers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ MongoDB PHP Driver
:titlesonly:

Laravel MongoDB <https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current>
/php-frameworks/symfony
/php-libraries
Symfony Integration </php-frameworks/symfony>
Drupal Integration </php-frameworks/drupal>
Libraries, Frameworks, & Tools </php-libraries>

.. contents:: On this page
:local:
Expand All @@ -36,44 +37,32 @@ 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 following components:

- The `extension <https://github.com/mongodb/mongo-php-driver>`__, which
provides a low-level API and mainly serves to integrate
`libmongoc and libbson <https://www.mongodb.com/docs/languages/c/c-driver/current/>`__ with
PHP.
- `Extension <https://php.net/mongodb>`__:
Provides a low-level API and mainly serves to integrate
the `C Driver <https://www.mongodb.com/docs/languages/c/c-driver/current/>`__
`libmongoc <https://mongoc.org/libmongoc/current/>`__ and
`libbson <https://mongoc.org/libbson/current/>`__ libraries with PHP.

- The `library <https://www.mongodb.com/docs/php-library/current>`__, which
provides a high-level API for working with MongoDB
- `Library <https://www.mongodb.com/docs/php-library/current>`__:
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. To learn more about
the components of the PHP driver, see the :ref:`Driver Architecture
<php-driver-arch>` section of this page.
the components of the PHP driver, see the :ref:`php-driver-arch` 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 <https://www.mongodb.com/docs/php-library/current/tutorial>`__
- `Get Started with the PHP Library <https://www.mongodb.com/docs/php-library/current/get-started/>`__
- `Connect to MongoDB <https://www.mongodb.com/docs/php-library/current/connect/>`__

- `Extension Architecture and Internals <https://www.php.net/manual/en/mongodb.architecture.php>`__
Reference
~~~~~~~~~

- Documentation

- `Library <https://www.mongodb.com/docs/php-library/current>`__

- `Extension <https://php.net/mongodb>`__

- Changelog

- `Library <https://github.com/mongodb/mongo-php-library/releases>`__

- `Extension <https://github.com/mongodb/mongo-php-driver/releases>`__

- Source Code

- `Library <https://github.com/mongodb/mongo-php-library>`__

- `Extension <https://github.com/mongodb/mongo-php-driver>`__
- :github:`Release Notes <mongodb/mongo-php-driver/releases>`
- :github:`Driver Source Code <mongodb/mongo-php-driver>`

.. _php-driver-arch:

Expand Down Expand Up @@ -245,9 +234,3 @@ The first column lists the driver versions.
.. include:: /includes/about-driver-compatibility.rst

.. include:: /includes/help-links-php.rst

See Also
--------

- :ref:`php-libraries-frameworks-and-tools`

110 changes: 110 additions & 0 deletions source/php-frameworks/drupal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
.. _php-drupal-integration:

==========================
Drupal MongoDB Integration
==========================

.. facet::
:name: genre
:values: tutorial

.. meta::
:keywords: php framework, CMS, web app, authentication, Atlas

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

Overview
--------

In this guide, you can learn about the benefits of using MongoDB Atlas
as the database for Drupal sites and navigate to a tutorial that
demonstrates how to set up the MongoDB driver for Drupal.

`Drupal <https://www.drupal.org/about>`__ is an open-source web content
management system (CMS) written in PHP. Drupal provides simple content
authoring, composability, and robust authentication features.

The :ref:`php-drupal-tutorial` section of this guide links to a tutorial
which you can follow to set up a Drupal site that connects to MongoDB Atlas.

The :ref:`php-drupal-resources` section contains links to resources and
documentation for further learning.

Why Use MongoDB as the Database for Drupal Sites?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Websites that seek to provide personalized user experiences must contain
robust capabilities for user authentication. Sites that have many
authenticated users might face performance impacts due to the complexity
of retrieving entity data from multiple tables in a relational database.
MongoDB supports eliminates the need for complicated table joins and
thus increases data retrieval speed, enhancing user experience with
components such as personalized dashboards and dynamic content feeds.

When you use MongoDB Atlas as your site's database, Drupal stores entity
instances as JSON objects that contain all revisions, translations, and
field data. This flexible data structure decreases latency and allows
Drupal to support personalized, user-focused experiences.

MongoDB offers the following features that improve your Drupal sites:

- Horizontal scaling: Distribute loads across multiple
servers, making your database scalable for large user bases.

- Integrated file storage: Store user files directly in the
database instead of on the web server, simplifying hosting.

- Full-Text search: Avoid implementing separate search
solutions by leveraging the :atlas:`Atlas Search
</atlas-search/atlas-search-overview/>` feature.

- AI capabilities: Perform vector searches and integrate AI services by
using the :atlas:`Atlas Vector Search
</atlas-vector-search/vector-search-overview/>` feature.

.. _php-drupal-tutorial:

Tutorial
--------

To learn how to install the MongoDB driver for Drupal and set up a site
that uses MongoDB Atlas as its database, see the
`How to Run Drupal on MongoDB <https://dev.to/mongodb/how-to-install-drupal-on-mongodb-atlas-2dg3>`__
tutorial on the DEV Community website.

This tutorial demonstrates how to perform the following steps:

1. Setting up a MongoDB Atlas account and deployment.

#. Setting up an AWS EC2 medium instance.

#. Connecting the EC2 instance to Atlas.

#. Installing the following components:

- Apache web server
- `MongoDB PHP extension <https://php.net/mongodb>`__
- Drupal web server
- Drupal core patch

#. Connecting your Drupal site to Atlas.

#. Adding content to Drupal and viewing how it is stored in Atlas.

#. Safely shutting down your web server.

.. _php-drupal-resources:

Resources
---------

Learn more about Drupal and MongoDB by viewing the following resources:

- `MongoDB module suite for Drupal <https://www.drupal.org/project/mongodb>`__
- `Drupal CMS User Guide <https://new.drupal.org/docs/drupal-cms>`__
- :website:`Podcast: PHP, Drupal and MongoDB with David Bekker
</developer/podcasts/ep-185-php-drupal-and-mongodb-with-david-bekker/>`
12 changes: 6 additions & 6 deletions source/php-frameworks/symfony.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ read about the benefits of using Symfony to build
web applications with MongoDB as your database and practice using libraries
that simplify querying MongoDB.

Symfony is a flexible and highly configurable framework for building PHP
applications. You can use this framework to create reusable components
to streamline your web app.
`Symfony <https://symfony.com/>`__ is a flexible and highly configurable
framework for building PHP applications. You can use this framework to
create reusable components to streamline your web app.

The :ref:`php-symfony-qs` section of this guide contains a tutorial
which you can follow to build a single page app that accesses data from
Expand Down Expand Up @@ -124,9 +124,9 @@ Atlas documentation.
Install MongoDB Extension
~~~~~~~~~~~~~~~~~~~~~~~~~

To learn more about installing the MongoDB extension, see `Installing the Extension
<https://www.mongodb.com/docs/php-library/current/tutorial/install-php-library/#installing-the-extension>`__
in the PHP Library Manual.
To learn more about installing the MongoDB extension, see the `Get
Started with the PHP Library
<https://www.mongodb.com/docs/php-library/current/get-started/#download-and-install>`__ tutorial.

Initialize a Symfony Project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 4 additions & 0 deletions source/php-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Framework Integrations
types of Drupal data in MongoDB. The ``mongodb`` extension supports
Drupal 8 and later.

- :ref:`php-drupal-integration` describes the benefits of using MongoDB
as a data store in a Drupal site and provides useful links to learn
about using this integration.

- Laravel

- `Laravel MongoDB <https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/>`__
Expand Down
Loading