PHPackages                             sgomez/simplesamlphp-module-dbal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sgomez/simplesamlphp-module-dbal

ActiveSimplesamlphp-module[Database &amp; ORM](/categories/database)

sgomez/simplesamlphp-module-dbal
================================

A SimpleSAMLphp module adding support for Doctrine/DBAL.

2.0.3(8y ago)324.1k—6.7%[2 issues](https://github.com/sgomez/simplesamlphp-module-dbal/issues)1GPL-3.0PHPPHP &gt;=5.5.9

Since Aug 18Pushed 7y agoCompare

[ Source](https://github.com/sgomez/simplesamlphp-module-dbal)[ Packagist](https://packagist.org/packages/sgomez/simplesamlphp-module-dbal)[ RSS](/packages/sgomez-simplesamlphp-module-dbal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (13)Used By (1)

SimpleSAMLphp Composer Doctrine/DBAL module
===========================================

[](#simplesamlphp-composer-doctrinedbal-module)

This package add a new datastore with Doctrine/DBAL library through a SimpleSAMLphp module installable through [Composer](https://getcomposer.org/). Installation can be as easy as executing:

```
composer require sgomez/simplesamlphp-module-dbal ~1.0 # for SSP >= 1.14
composer require sgomez/simplesamlphp-module-dbal ~2.0 # for SSP >= 2.0|master

```

Configuring
-----------

[](#configuring)

You need to specify the next *store.type* on your config file:

```
    'store.type'                    => 'SimpleSAML\Modules\DBAL\Store\DBAL',

```

And copy the template config file from `modules/dbal/config-templates/module_dbal.php` to your config base directory. You must edit it with your database connection configuration.

This module supports the same engines than *Doctrine/DBAL*. See [Doctrine DBAL configuration](http://doctrine-dbal.readthedocs.org/en/latest/reference/configuration.html)for the syntax.

```
$config = array (
    'store.dbal.url'                => 'mysql://user:password@localhost:3306/simplesamlphp?charset=utf8mb4&serverVersion=5.7',
    // 'store.dbal.url'                => 'sqlite:///simplesamlphp.sqlite',
);

```

If you want to clean old keys automatically, remember to enable and configure the *cron* module.

Creating the Schema
-------------------

[](#creating-the-schema)

The schema is not created every time than Store is called (like SQL store). You need to created it manually. You need to run this every time you install or update a module than use DBAL Store:

```
bash$ vendor/bin/dbalschema

```

Creating new schemas
--------------------

[](#creating-new-schemas)

If you want to create your own schema to your module, you need to create a `hook_dbal.php` file on your *hooks* directory. This file will run every time than *dbalschema* is launched.

This is a template:

```
