https://github.com/b2pweb/bdf-prime-bundle
https://github.com/b2pweb/bdf-prime-bundle
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/b2pweb/bdf-prime-bundle
- Owner: b2pweb
- License: mit
- Created: 2020-06-02T13:33:24.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-28T13:22:53.000Z (about 1 year ago)
- Last Synced: 2025-08-12T08:28:20.076Z (11 months ago)
- Language: PHP
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/b2pweb/bdf-prime-bundle/actions/workflows/php.yml)
[](https://scrutinizer-ci.com/g/b2pweb/bdf-prime-bundle/?branch=master)
[](https://packagist.org/packages/b2pweb/bdf-prime-bundle)
[](https://packagist.org/packages/b2pweb/bdf-prime-bundle)
Installation
============
1 Download the Bundle
---------------------
Download the latest stable version of this bundle with composer:
```bash
composer require b2pweb/bdf-prime-bundle
```
2 Enable the Bundle
-------------------
Adding the following line in the `config/bundles.php` file of your project:
```php
['all' => true],
Bdf\PrimeBundle\TestingPrimeBundle::class => ['test' => true],
// ...
];
```
3 Set environment
-----------------
Add your dsn on the`.env` file
```
DATABASE_URL=mysql://root@127.0.0.1/dbname?serverVersion=5.7
```
Add your dsn on the`.env.test` file
```
DATABASE_URL=sqlite::memory:
```
4 Add configuration
-------------------
Add a default config file to `./config/packages/prime.yaml`
```yaml
prime:
activerecord: true
hydrators: '%kernel.cache_dir%/prime/hydrators/loader.php'
default_connection: 'default'
connections:
default: '%env(resolve:DATABASE_URL)%'
migration:
connection: 'default'
path: '%kernel.project_dir%/src/Migration'
```
Enable caching for production
```yaml
prime:
cache:
query:
service: 'Bdf\Prime\Cache\ArrayCache'
metadata:
pool: 'cache.app'
```
Add a test file to `./config/packages/test/prime.yaml`
```yaml
prime:
logging: false
cache:
query:
pool: null
service: null
metadata:
pool: null
service: null
```
See [the available values](Resources/doc/configuration.md) of the configuration