Smalldb Symfony Bundle
Symfony bundle for Smalldb., (*1)
See https://smalldb.org/, (*2)
Features
Smalldb Symfony Bundle integrates libSmalldb into Symfony
framework, including the
Security subsystem.
It also provides convenient configuration and optional REST API., (*3)
Installation
First, add the bundle into your composer.json
:, (*4)
{
"require": {
"smalldb/smalldb-symfony-bundle": "*"
}
}
Then register the bundle in your app/AppKernel.php
:, (*5)
```php?start_inline
class AppKernel extends \Symfony\Component\HttpKernel\Kernel
{
public function registerBundles()
{
return [
// ...
new Smalldb\SmalldbBundle\SmalldbBundle(),
// ...
];
}
}, (*6)
Finally, configure the bundle — `app/config/config.yml`:
```yml
# See: bin/console config:dump-reference SmalldbBundle
smalldb:
smalldb:
base_dir: '%kernel.root_dir%/../src/AppBundle/StateMachines'
cache_disabled: false
flupdo:
driver: mysql
host: ~
port: ~
database: ~
username: ~
password: ~
log_query: false
log_explain: false
auth:
class: Smalldb\StateMachine\Auth\CookieAuth
… and enable authentication listener in app/config/security.yml
:, (*7)
security:
firewalls:
main:
smalldb: ~
REST API can be enabled using predefined routes — app/config/routing.yml
:, (*8)
smalldb:
resource: "@SmalldbBundle/Resources/config/routing.yml"
Usage
Smaldb Symfony bundle registers JsonDirBackend
as smalldb
service., (*9)
Therefore you may use $this->get('smalldb')
to retrieve Smalldb backend in
your controllers, or better inject it using @smalldb
identifier in the
configuration files., (*10)
Documentation
See https://smalldb.org/doc/smalldb-symfony-bundle/master/, (*11)
License
The most of the code is published under Apache 2.0 license. See LICENSE file for details., (*12)
Contribution guidelines
Project's primary repository is hosted at https://git.frozen-doe.net/smalldb/smalldb-symfony-bundle,
feel free to submit issues there or create merge requests., (*13)