zend-expressive-1.0.3-error.../config/container.php

32 lines
860 B
PHP
Raw Permalink Normal View History

2016-11-15 18:36:06 +01:00
<?php
return _createContainer();
use Xtreamwayz\Pimple\Container as PimpleContainer;
use Zend\Expressive\Application;
function _createContainer()
{
$container = new PimpleContainer;
$container['config'] = new ArrayObject([
'middleware_pipeline' => [
['middleware' => Test\ErrorMiddleware::class],
['middleware' => Test\TestMiddleware::class],
],
]);;
$container[Application::class] =
new Zend\Expressive\Container\ApplicationFactory;
$container['ErrorHandler 1'] = function ($c) { return new Test\ErrorHandler; };
$container['ErrorHandler 2'] = function ($c) { return new Test\ErrorHandler; };
$container[Test\TestMiddleware::class] = function ($c) { return new Test\TestMiddleware; };
$container[Test\ErrorMiddleware::class] = function ($c) {
return new Test\ErrorMiddleware($c->get('ErrorHandler 2'));
};
return $container;
}