The DynamoPHP Symfony Bundle integrates DynamoPHP into Symfony applications, providing seamless configuration and service registration for Amazon DynamoDB operations.
- Auto-wiring of DynamoPHP services
- Configurable AWS SDK DynamoDB client, Marshaler and Serializer
- Sandbox application for testing and development
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],
];
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
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
}
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.