PHP Classes

File: Config/container.php

Recommend this page to a friend!
  Classes of Nerijus   CakePHP 2 Zend Service Manager integration   Config/container.php   Download  
File: Config/container.php
Role: Configuration script
Content type: text/plain
Description: Configuration script
Class: CakePHP 2 Zend Service Manager integration
Integrates the Zend Service Manager with CakePHP 2
Author: By
Last change:
Date: 8 years ago
Size: 357 bytes
 

Contents

Class file image Download
<?php

use Zend\ServiceManager\Config;
use
Zend\ServiceManager\ServiceManager;

// Load configuration
$config = require __DIR__ . '/config.php';

// Build container
$container = new ServiceManager();
(new
Config($config['dependencies']))->configureServiceManager($container);

// Inject config
$container->setService('config', $config);

return
$container;