szurubooru/src/Injector.php

23 lines
462 B
PHP
Raw Normal View History

2014-09-05 20:33:05 +02:00
<?php
namespace Szurubooru;
final class Injector
{
private static $container;
public static function init()
{
$builder = new \DI\ContainerBuilder();
$builder->setDefinitionCache(new \Doctrine\Common\Cache\ArrayCache());
$builder->addDefinitions(__DIR__ . DS . '..' . DS . 'src' . DS . 'di.php');
self::$container = $builder->build();
}
public static function get($className)
{
return self::$container->get($className);
}
}
Injector::init();