edumarques / dynamophp-symfony
Symfony bundle that wraps DynamoPHP and simplifies development on Symfony applications.
Requires
- php: ^8.3
- edumarques/dynamophp: ^0.5
- symfony/config: ^7.2
- symfony/dependency-injection: ^7.2
- symfony/http-kernel: ^7.2
Requires (Dev)
- phpstan/phpstan: ^2.1
- slevomat/coding-standard: ^8.18
- squizlabs/php_codesniffer: ^3.12
- symfony/var-dumper: ^7.2
README
The DynamoPHP Symfony Bundle integrates DynamoPHP into Symfony applications, providing seamless configuration and service registration for Amazon DynamoDB operations.
Features
- Auto-wiring of DynamoPHP services
- Configurable AWS SDK DynamoDB client, Marshaler and Serializer
- Sandbox application for testing and development
Installation
Install via Composer:
composer require edumarques/dynamophp-symfony
If your Symfony application is not configured to use Symfony Flex for automatic bundle registration, you need to
register it manually in config/bundles.php
:
# config/bundles.php return [ // ... other bundles EduardoMarques\DynamoPHPBundle\DynamoPHPBundle::class => ['all' => true], ];
Configuration
After installation, you must configure the bundle by creating a dynamo_php.yaml
file in your config/packages/
directory:
# config/packages/dynamo_php.yaml dynamo_php: client: dynamodb_client # set the service ID of the AWS DynamoDB client registered in your app marshaler: marshaler # set the service ID of the AWS Marshaler registered in your app serializer: serializer # set the service ID of the Symfony serializer registered in your app
Usage
Once configured, you can inject DynamoPHP services into your Symfony services or controllers. For example, to use the EntityManager:
use EduardoMarques\DynamoPHP\ODM\EntityManager; class YourService { public function __construct( private EntityManager $entityManager, ) { } // Your methods here }
Contributing
Contributors are always welcome! For more information on how you can contribute, please read our contribution guideline.
For any questions, feel free to reach out to me directly by email: eduardomarqs1@gmail.com.
For more information on DynamoPHP, visit the DynamoPHP repository.