1
|
<?php
|
2
|
|
3
|
require __DIR__ . '/../vendor/autoload.php';
|
4
|
|
5
|
$configurator = new Nette\Configurator;
|
6
|
|
7
|
include __DIR__ . '/bootstrap-local.php';
|
8
|
|
9
|
// dev prostředí, kytičky, sluníčko, všechno hezky funguje
|
10
|
if ($env === 'dev')
|
11
|
{
|
12
|
$configurator->setDebugMode(TRUE); // enable for your remote IP
|
13
|
$configurator->enableTracy(__DIR__ . '/../log');
|
14
|
$configurator->setTempDirectory(__DIR__ . '/../temp');
|
15
|
}
|
16
|
// CIV prostředí
|
17
|
else
|
18
|
{
|
19
|
if (!file_exists($logDir))
|
20
|
{
|
21
|
mkdir($logDir, 0700, TRUE);
|
22
|
}
|
23
|
|
24
|
if (!file_exists($tempDir))
|
25
|
{
|
26
|
mkdir($tempDir, 0700, TRUE);
|
27
|
}
|
28
|
|
29
|
$configurator->enableTracy($logDir);
|
30
|
$configurator->setTempDirectory($tempDir);
|
31
|
}
|
32
|
|
33
|
$configurator->setTimeZone('Europe/Prague');
|
34
|
|
35
|
$configurator->createRobotLoader()
|
36
|
->addDirectory(__DIR__)
|
37
|
->register();
|
38
|
|
39
|
$configurator->addConfig(__DIR__ . '/config/config.neon');
|
40
|
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
|
41
|
$configurator->addConfig(__DIR__ . '/config/model.neon');
|
42
|
$configurator->addConfig(__DIR__ . '/config/components.neon');
|
43
|
|
44
|
$container = $configurator->createContainer();
|
45
|
|
46
|
return $container;
|