2017 © Pedro Peláez
 

library silex-provider-doctrine-mongodb

Silex provider for MongoDB integration via Doctrine

image

devture/silex-provider-doctrine-mongodb

Silex provider for MongoDB integration via Doctrine

  • Wednesday, January 10, 2018
  • by spantaleev
  • Repository
  • 1 Watchers
  • 1 Stars
  • 196 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Silex Doctrine-MongoDB Provider

A doctrine/mongodb provider for the Silex micro-framework., (*1)

Usage

Registering the provider creates a few services under a given namespace. The provider can be registered multiple times if multiple connections are needed., (*2)

Basic Usage

<?php
// Register services under the 'mongodb' namespace, with no custom configuration (empty array)
$app->register(new \Devture\SilexProvider\DoctrineMongoDB\ServicesProvider('mongodb', []));

// Get a reference to a database on that server connection
$app['db'] = function ($app) {
    return $app['mongodb.connection']->selectDatabase('database_name');
};

Advanced Usage

<?php
// See the docs for \MongoClient (http://php.net/MongoClient) for connection string format and options
$configuration = [
    'server' => 'mongodb://example.com:27017',
    'options' => [
        'connect' => true,
        'connectTimeoutMS' => 200,
    ],
];

$app->register(new \Devture\SilexProvider\DoctrineMongoDB\ServicesProvider('mongodb', $configuration));

$app['db_main'] = function ($app) {
    return $app['mongodb.connection']->selectDatabase('database_name');
};

$app['db_other'] = function ($app) {
    return $app['mongodb.connection']->selectDatabase('another_database_name');
};

The Versions

10/01 2018

dev-master

9999999-dev

Silex provider for MongoDB integration via Doctrine

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

mongodb silex doctrine

10/01 2018

1.0.3

1.0.3.0

Silex provider for MongoDB integration via Doctrine

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

mongodb silex doctrine

14/12 2016

1.0.2

1.0.2.0

Silex provider for MongoDB integration via Doctrine

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

mongodb silex doctrine

29/08 2016

1.0.1

1.0.1.0

Silex provider for MongoDB integration via Doctrine

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

mongodb silex doctrine

23/02 2013

1.0

1.0.0.0

Silex provider for MongoDB integration via Doctrine

  Sources   Download

BSD

The Requires

 

by Slavi Pantaleev

mongodb silex doctrine