Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (28 sloc) 1011 Bytes
<?php declare(strict_types = 1);
namespace Achse\PetrHejna;
use Nette\DI\Compiler;
use Nette\DI\ContainerLoader;
use Tracy\Debugger;
use function dirname;
use function file_exists;
require __DIR__ . '/../vendor/autoload.php';
$isInDevelopmentMode = file_exists(__DIR__ . '/config/.debug');
if ($isInDevelopmentMode) {
Debugger::enable(Debugger::DEVELOPMENT);
}
$loader = new ContainerLoader(__DIR__ . '/../temp', $isInDevelopmentMode);
$class = $loader->load(
static function (Compiler $compiler): void {
$parameters = [
'appDir' => __DIR__,
'wwwDir' => dirname(__DIR__) . '/www',
];
$compiler->addConfig(['parameters' => $parameters]);
$compiler->loadConfig(__DIR__ . '/config/config.neon');
$compiler->loadConfig(__DIR__ . '/config/config.local.neon');
foreach ((new NetteServicesNeonFinder())->find(__DIR__) as $servicesNeon) {
$compiler->loadConfig($servicesNeon);
}
},
);
return new $class();
You can’t perform that action at this time.