-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.php
More file actions
35 lines (25 loc) · 724 Bytes
/
bootstrap.php
File metadata and controls
35 lines (25 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare(strict_types=1);
namespace Naja\Guide;
use Nette\Configurator;
use Nette\DI\Container;
use Nette\StaticClass;
require __DIR__ . '/vendor/autoload.php';
final class Bootstrap
{
use StaticClass;
public static function boot(?string $configFile = null): Container
{
$configurator = new Configurator();
$configurator->addParameters([
'rootDir' => __DIR__,
'logDir' => $logDir = __DIR__ . '/var/log',
'tempDir' => $tempDir = __DIR__ . '/var/tmp',
]);
$configurator->setTempDirectory($tempDir);
$configurator->enableTracy($logDir);
$configurator->addConfig(__DIR__ . '/etc/config.neon');
$configurator->addConfig($configFile ?? []);
return $configurator->createContainer();
}
}