2017 © Pedro Peláez
 

library spot-service-provider

A Pimple 3 ServiceProvider for the Spot2 ORM

image

dijky/spot-service-provider

A Pimple 3 ServiceProvider for the Spot2 ORM

  • Tuesday, July 25, 2017
  • by Dijky
  • Repository
  • 3 Watchers
  • 2 Stars
  • 502 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

spot-service-provider

SpotServiceProvider allows you to easily integrate the Spot ORM with Pimple 3., (*1)

Installation

Simply require the composer package in your application:, (*2)

composer require dijky/spot-service-provider

or in your composer.json:, (*3)

{
  ...
  "require": {
    "dijky/spot-service-provider": "~2.0"
  }
}

If you don't use Composer, clone the Git repository or download the zipball.
You will have to do autoloading yourself then., (*4)

Usage

Register the SpotServiceProvider in your application bootstrap file:, (*5)

$app->register(new Dijky\Pimple\Provider\SpotServiceProvider(), array(
  'spot.connections' => array(
    'website' => '<dsn>',
    'forum' => '<dsn>'
  )
));

You can add as many connections as you like., (*6)

The service provider also takes connections already configured for DoctrineServiceProvider:, (*7)

$app['spot.connections'] = function() use ($app) {
  return $app['dbs'];
};

Notice the closure? This way, the dbs service will only be accessed (and initialized) as needed.
You can still override or extend it later on in your bootstrap code., (*8)

The first connection in $app['spot.connections'] will be set as default.
The default connection can also be set to connection abc with, (*9)

$app['spot.connections.default'] = 'abc';

Services

SpotServiceProvider exposes the following services:, (*10)

  • spot: The Spot\Locator instance to use the Spot ORM.
  • spot.config: The Spot\Config instance to configure the spot service.

It takes the following configuration values:, (*11)

  • spot.connections: Set this to a key-value array (or Pimple container) with connection names as keys and connection strings (DSNs) or instances of Doctrine\DBAL\Connection as values.
  • spot.connections.default (optional): Set this to the connection name that should be set as default. Unset with null.

Notice: once the spot service is first accessed, changing spot.config, spot.connections, or spot.connections.default will have no effect on it., (*12)

License

This software is provided under the BSD 3-clause license.
Refer to LICENSE for the full license text., (*13)

Changelog

New in 2.0

  • Add support for Pimple 3 (incl. Silex 2)
  • [BC BREAK] Drop support for Silex 1.x / Pimple 1.x
  • [BC BREAK] Change namespace to Dijky\Pimple\... from Dijky\Silex\...

The Versions

25/07 2017

dev-master

9999999-dev https://github.com/Dijky/spot-service-provider

A Pimple 3 ServiceProvider for the Spot2 ORM

  Sources   Download

BSD-3-Clause

The Requires

 

orm pimple spot2

25/07 2017

v2.0.1

2.0.1.0 https://github.com/Dijky/spot-service-provider

A Pimple 3 ServiceProvider for the Spot2 ORM

  Sources   Download

BSD-3-Clause

The Requires

 

orm pimple spot2

02/09 2016

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/Dijky/spot-service-provider

A Pimple 3 ServiceProvider for the Spot2 ORM

  Sources   Download

BSD-3-Clause

The Requires

 

orm pimple spot2

02/09 2016

v2.0.0

2.0.0.0 https://github.com/Dijky/spot-service-provider

A Pimple 3 ServiceProvider for the Spot2 ORM

  Sources   Download

BSD-3-Clause

The Requires

 

orm pimple spot2

28/08 2015

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/Dijky/spot-service-provider

A Silex Service Provider for the Spot2 ORM

  Sources   Download

BSD-3-Clause

The Requires

 

orm silex spot2

28/08 2015

v1.0.0

1.0.0.0 https://github.com/Dijky/spot-service-provider

A Silex Service Provider for the Spot2 ORM

  Sources   Download

BSD-3-Clause

The Requires

 

orm silex spot2

30/11 2014

v0.1.0

0.1.0.0 https://github.com/Dijky/spot-service-provider

A Silex Service Provider for the Spot2 ORM

  Sources   Download

BSD-3-Clause

The Requires

 

orm silex spot2