|
| 1 | +DynamoPHP Symfony Bundle |
| 2 | +================ |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +The **DynamoPHP Symfony Bundle** integrates [DynamoPHP](https://github.com/edumarques/dynamophp) |
| 9 | +into [Symfony](https://symfony.com) applications, providing seamless configuration and service registration for Amazon |
| 10 | +DynamoDB operations. |
| 11 | + |
| 12 | +## Features |
| 13 | + |
| 14 | +- Auto-wiring of DynamoPHP services |
| 15 | +- Configurable AWS SDK DynamoDB client and Marshaler |
| 16 | +- Symfony Flex recipe support for automatic configuration |
| 17 | +- Sandbox application for testing and development |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +Install via Composer: |
| 22 | + |
| 23 | +```shell |
| 24 | +composer require edumarques/dynamophp-symfony |
| 25 | +``` |
| 26 | + |
| 27 | +Ensure that your Symfony application is configured to use Symfony Flex for automatic bundle registration and |
| 28 | +configuration. |
| 29 | + |
| 30 | +## Configuration |
| 31 | + |
| 32 | +**Note: this is an optional step. By default, the bundle assumes _DynamoDBClient_ and _Marshaler_ services are already |
| 33 | +registered in the application DI container.** |
| 34 | + |
| 35 | +After installation, you can configure the bundle by creating a `dynamo_php.yaml` file in your `config/packages/` |
| 36 | +directory: |
| 37 | + |
| 38 | +```yaml |
| 39 | +# config/packages/dynamo_php.yaml |
| 40 | +dynamo_php: |
| 41 | + client: |
| 42 | + region: 'us-east-1' |
| 43 | + version: 'latest' |
| 44 | + # Add DynamoDB client configuration options here |
| 45 | + marshaler: |
| 46 | + # Add Marshaler configuration options here |
| 47 | +``` |
| 48 | + |
| 49 | +Adjust the client and marshaler settings according to your AWS DynamoDB setup and application requirements. |
| 50 | + |
| 51 | +## Usage |
| 52 | + |
| 53 | +Once configured, you can inject DynamoPHP services into your Symfony services or controllers. For example, to use the |
| 54 | +EntityManager: |
| 55 | + |
| 56 | +```php |
| 57 | +use EduardoMarques\DynamoPHP\ODM\EntityManager; |
| 58 | + |
| 59 | +class YourService |
| 60 | +{ |
| 61 | + public function __construct( |
| 62 | + private EntityManager $entityManager, |
| 63 | + ) { |
| 64 | + } |
| 65 | + |
| 66 | + // Your methods here |
| 67 | +} |
| 68 | +``` |
| 69 | + |
| 70 | +## Contributing |
| 71 | + |
| 72 | +Contributors are always welcome! For more information on how you can contribute, please read |
| 73 | +our [contribution guideline](CONTRIBUTING.md). |
| 74 | + |
| 75 | +For any questions, feel free to reach out to me directly by |
| 76 | +email: [eduardomarqs1@gmail.com](mailto:eduardomarqs1@gmail.com). |
| 77 | + |
| 78 | +For more information on DynamoPHP, visit the [DynamoPHP repository](https://github.com/edumarques/dynamophp). |
0 commit comments