2017 © Pedro Peláez
 

library database-utils-service-provider

Database utilities service provider for Silex. Includes some database commands and adds fixtures for your database.

image

gridonic/database-utils-service-provider

Database utilities service provider for Silex. Includes some database commands and adds fixtures for your database.

  • Friday, February 20, 2015
  • by btemperli
  • Repository
  • 8 Watchers
  • 1 Stars
  • 124 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

DatabaseUtilsServiceProvider

Build Status, (*1)

This is a simple collection of utilities for your database for Silex and Doctrine DBAL., (*2)

Install

As usual, just include gridonic/database-utils-service-provider in your composer.json , and register the service., (*3)

$app->register(new \Gridonic\Provider\DatabaseUtilsServiceProvider(), array(
    'database_utils.fixtures'       => PATH_RESOURCES . '/fixtures/*.yml',
    'database_utils.password_keys'  => array('password'),
    'database_utils.security.salt'  => 'abcd',
));

Parameters

An overview of the possible parameters, (*4)

database_utils.fixtures

required for fixtures All your fixtures-files., (*5)

database_utils.password_keys

optional An array of keys of table-columns, in which you are saving passwords. The values will be automatically encoded before insert., (*6)

database_utils.security.salt

required for database_utils.password_keys To encode the passwords, we use this salt., (*7)

Commands

When you have registered the ConsoleServiceProvider correct, you can use the following commands in your console., (*8)

database:drop

Clears your database, (*9)

database:reset

Resets your database. Means: * Drops your database * Migrates the database (uses MigrationServiceProvider) * Loads example-data into your database, (*10)

database:fixtures:load

Loads example-data from your fixtures-files into the database., (*11)

when you set the password_keys and the salt, all the values for the password_keys (p.E. 1234 as password) will be encoded before insert. All the passwords will be encoded by the Silex\Provider\SecurityProvider. You have to register the SecurityProvider before you can use this function., (*12)

Example 01_test.yml

test:
    -
        id: 1
        created: 1000000000
        username: abc
        email: abc@abc.com
        password: 1234
    -
        id: 2
        created: 1000000001
        username: def
        email: def@abc.com
        password: 1234

Example to register the SecurityProvider

$app->register(new Silex\Provider\SecurityServiceProvider(), array(
    'security.firewalls' => array(
        'private' => array(
            'pattern' => '^/admin',
            'http' => true,
            'users' => array(
                'admin' => array('ROLE_ADMIN', 'ASv5vPSea0zB3EIpIB/mLOFAxkMIfh1EkTozyenPTZa0mGAiTC3n+mCAEdcYiITruuPaFb6GWFDiyF5fvJtqOg=='),
            ),
        ),
    ),
));

Licence

The DatabaseUtilsServiceProvider is licensed under the MIT license., (*13)

The Versions

20/02 2015

dev-master

9999999-dev http://gridonic.ch

Database utilities service provider for Silex. Includes some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

The Development Requires

database service silex doctrine

20/02 2015

dev-develop

dev-develop http://gridonic.ch

Database utilities service provider for Silex. Includes some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

The Development Requires

database service silex doctrine

20/02 2015

1.0.9

1.0.9.0 http://gridonic.ch

Database utilities service provider for Silex. Includes some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

The Development Requires

database service silex doctrine

27/10 2014

1.0.8

1.0.8.0 http://gridonic.ch

Database utilities service provider for Silex. Includes some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

The Development Requires

database service silex doctrine

27/10 2014

1.0.7

1.0.7.0 http://gridonic.ch

Database utilities service provider for Silex. Include some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

23/10 2014

v1.0.6

1.0.6.0 http://gridonic.ch

Database utilities service provider for Silex. Include some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

23/10 2014

v1.0.5

1.0.5.0 http://gridonic.ch

Database utilities service provider for Silex. Include some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

23/10 2014

v1.0.4

1.0.4.0 http://gridonic.ch

Database utilities service provider for Silex. Include some database commands and adds fixtures for your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

29/08 2014

1.0.1

1.0.1.0 http://gridonic.ch

Database utils service provider for Silex. Include some Database Commands and loads Fixtures into your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

29/08 2014

v1.0.2

1.0.2.0 http://gridonic.ch

Database utils service provider for Silex. Include some Database Commands and loads Fixtures into your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

29/08 2014

v1.0.3

1.0.3.0 http://gridonic.ch

Database utils service provider for Silex. Include some Database Commands and loads Fixtures into your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

28/08 2014

1.0.0

1.0.0.0 http://gridonic.ch

Database utils service provider for Silex. Include some Database Commands and loads Fixtures into your database.

  Sources   Download

MIT

The Requires

 

database service silex doctrine

27/08 2014

v0.1.0

0.1.0.0 http://gridonic.ch

Database utils service provider for Silex. Include some Database Commands and loads Fixtures into your database.

  Sources   Download

MIT

The Requires

 

database silex doctrine2 util