Exemplo n.º 1
0
function getContainer()
{
    static $container;
    if ($container === null) {
        $container = new PSX\Dependency\DefaultContainer();
        $container->setParameter('config.file', array('psx_url' => 'http://127.0.0.1/projects/psx/public', 'psx_dispatch' => 'index.php/', 'psx_timezone' => 'UTC', 'psx_debug' => true, 'psx_path_cache' => sys_get_temp_dir(), 'psx_path_library' => __DIR__ . '/../src'));
    }
    return $container;
}
Exemplo n.º 2
0
<?php

/*
This file returns the global DI container for the application. The DI container
must be compatible with the symfony DI container interface. If you want load an 
different configuration depending on the environment you can change the 
"config.file" parameter.
*/
$container = new \PSX\Dependency\DefaultContainer();
$container->setParameter('config.file', __DIR__ . '/configuration.php');
return $container;