imbo / imbo-mongodb-adapters
MongoDB adapters for Imbo
Installs: 1 976
Dependents: 1
Suggesters: 1
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
Requires
- php: >=8.3
- ext-mongodb: ^1.21
- mongodb/mongodb: ^1.21
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- imbo/imbo: dev-main
- imbo/imbo-adapters-sdk: dev-main
- imbo/imbo-coding-standard: ^2.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^12.0
- symfony/var-dumper: ^7.2
This package is auto-updated.
Last update: 2025-04-04 06:27:33 UTC
README
MongoDB storage and database adapters for Imbo.
Installation
composer require imbo/imbo-mongodb-adapters
Usage
This package provides both storage and database adapters for Imbo, leveraging GridFS and MongoDB. The package also has a storage adapter for image variations.
$mainDatabaseAdapter = new Imbo\Database\MongoDB(); $mainStorageAdapter = new Imbo\Storage\GridFS(); $imageVariationsDatabaseAdapter = new Imbo\EventListener\ImageVariations\Database\MongoDB(); $imageVariationsStorageAdapter = new Imbo\EventListener\ImageVariations\Storage\GridFS(); $mutableAccessControlAdapter = new Imbo\Auth\AccessControl\Adapter\MongoDB();
Running integration tests
If you want to run the integration tests you will need a running MongoDB service. The repo contains a simple configuration file for Docker Compose that you can use to quickly run a MongoDB instance.
If you wish to use this, run the following command to start up the service after you have cloned the repo:
docker-compose up -d
After the service is running you can execute all tests by simply running PHPUnit:
composer run test # or ./vendor/bin/phpunit
License
MIT, see LICENSE.