2017 © Pedro Peláez
 

library slim-doctrine-middleware

Slim Framework Doctrine middleware

image

juliangut/slim-doctrine-middleware

Slim Framework Doctrine middleware

  • Wednesday, October 28, 2015
  • by juliangut
  • Repository
  • 1 Watchers
  • 5 Stars
  • 670 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Latest Version License, (*1)

Build status Code Quality Code Coverage Total Downloads, (*2)

Juliangut Slim Framework Doctrine handler middleware

Doctrine handler middleware for Slim Framework., (*3)

Slim3 version

Doctrine integration service for Slim3 can be found in its own repository juliangut/slim-doctrine, (*4)

Installation

Best way to install is using Composer:, (*5)

php composer.phar require juliangut/slim-doctrine-middleware

Then require_once the autoload file:, (*6)

require_once './vendor/autoload.php';

Usage

Just add as any other middleware., (*7)

use Slim\Slim;
use Jgut\Slim\Middleware\DoctrineMiddleware;

$app = new Slim();

...

$app->add(new DoctrineMiddleware());

Configuration

There are two ways to configure Doctrine Middleware, (*8)

First by using doctrine key in Slim application configuration, (*9)

// Minimun configuration
$config = [
    'doctrine' => [
        'connection' => [
            'driver' => 'pdo_sqlite',
            'memory' => true,
        ],
        'annotation_paths' => ['path_to_entities_files'],
    ],
];

$app = new Slim($config);
$app->add(new DoctrineMiddleware());

Second way is assigning options directly to Doctrine Middleware, (*10)

$app = new Slim();

$doctrineMiddleware = new DoctrineMiddleware();
$doctrineMiddleware->setOption(
    'connection',
    ['driver' => 'pdo_sqlite', 'memory' => true]
);
$doctrineMiddleware->setOption('annotation_paths', ['path_to_entities_files']);
$app->add($doctrineMiddleware);

Available configurations

  • connection array of PDO configurations
  • cache_driver array with Doctrine cache configurations
    • type string representing cache type, apc, xcache, memcache, redis or array
    • host string representing caching daemon host, needed for memcache and redis, defaults to '127.0.0.1'
    • port string representing caching daemon port, optionally available for memcache (defaults to 11211) and redis (defaults to 6379)
  • proxy_path path were Doctrine creates its proxy classes, defaults to /tmp
  • annotation_files array of Doctrine annotations files
  • annotation_namespaces array of Doctrine annotations namespaces
  • annotation_autoloaders array of Doctrine annotations autoloader callables
  • annotation_paths array of paths where to find annotated entity files
  • xml_paths array of paths where to find XML entity mapping files
  • yaml_paths array of paths where to find YAML entity mapping files
  • auto_generate_proxies bool indicating whether Doctrine should auto-generate missing proxies (default: true)

Note:

annotation_paths, xml_paths or yaml_paths is needed by Doctrine to include a Metadata Driver, (*11)

Contributing

Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before, (*12)

See file CONTRIBUTING.md, (*13)

Contributors

License

Release under BSD-3-Clause License.

See file LICENSE included with the source code for a copy of the license terms, (*14)

The Versions

28/10 2015

dev-master

9999999-dev http://github.com/juliangut/slim-doctrine-middleware

Slim Framework Doctrine middleware

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

middleware framework doctrine slim handler

04/09 2015

0.3.2

0.3.2.0 http://github.com/juliangut/slim-doctrine-middleware

Slim Framework Doctrine middleware

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

middleware framework doctrine slim handler

14/08 2015

0.3.1

0.3.1.0 http://github.com/juliangut/slim-doctrine-middleware

Slim Framework Doctrine middleware

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

middleware framework doctrine slim handler

10/08 2015

0.3

0.3.0.0 http://github.com/juliangut/slim-doctrine-middleware

Slim Framework Doctrine middleware

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

middleware framework doctrine slim handler

08/08 2015

0.2

0.2.0.0 http://github.com/juliangut/slim-doctrine-middleware

Slim Framework Doctrine middleware

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

middleware framework doctrine slim handler

05/04 2015

0.1

0.1.0.0 http://github.com/juliangut/slim-doctrine-middleware

Slim Framework Doctrine middleware

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

middleware framework doctrine slim handler