Smalldb Symfony Bundle

Symfony bundle for Smalldb. Integrates libsmalldb into Symfony framework.

Features

Smalldb Symfony Bundle integrates libSmalldb into Symfony framework, including the Security subsystem. It also provides convenient configuration and optional REST-API.

Installation

Add the bundle into your composer.json:

{
    "require": {
        "smalldb/smalldb-symfony-bundle": "*"
    }
}

Then register the bundle in your app/AppKernel.php:

class AppKernel extends \Symfony\Component\HttpKernel\Kernel
{
	public function registerBundles()
	{
		return [
			// ...
			new Smalldb\SmalldbBundle\SmalldbBundle(),
			// ...
		];
	}
}

Finally, configure the bundle — app/config/config.yml:

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:

security:
    firewalls:
        main:
            smalldb: ~

REST API can be unabled using predefined routes — app/config/routing.yml:

smalldb:
        resource: "@SmalldbBundle/Resources/config/routing.yml"

Usage

Smaldb Symfony bundle registers JsonDirBackend as smalldb service.

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.

See also …