Skip to content

Repository to help getting started with Tigris using the MongoDB PHP driver

License

Notifications You must be signed in to change notification settings

tigrisdata-archive/tigris-mongodb-php-example

 
 

Repository files navigation

Tigris MongoDB compatibility and PHP example

Introduction

Welcome to this Tigris MongoDB compatibility and PHP example app. This repo aims to show a basic example of how you can use the power of Tigris MongoDB compatibility with PHP.

This project uses MongoDB PHP driver version 1.15 by default. Although you can change the driver version, the provided code example was only tested against the default version of MongoDB driver. Please note that the MongoDB PHP driver consists of two components: the extension and library.

Tigris MongoDB compatibility supports the MongoDB 6.0+ wire protocol, so any drivers or other components must support this version.

Prerequisites

Preparing Tigris

  1. Create a project in Tigris.
  2. Create an application key, and copy the Project Name, Client ID, and Client Secret values.

Copy the .env.example to a .env file:

cp .env.example .env

And update the values with your Tigris Project Name, Client ID, and Client Secret.

Build and run using a new Docker image

Build the image:

DOCKER_BUILDKIT=0 docker build . -t tigris-mongodb-php-local

Run the example:

./get-started-local.sh

Build and run using the pre-existing Docker image

./get-started.sh

Where next?

About

Repository to help getting started with Tigris using the MongoDB PHP driver

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 70.5%
  • Dockerfile 19.1%
  • Shell 10.4%