-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.php
More file actions
42 lines (32 loc) · 1.53 KB
/
bootstrap.php
File metadata and controls
42 lines (32 loc) · 1.53 KB
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
36
37
38
39
40
41
42
<?php
// phpcs:disable PSR1.Files.SideEffects
// define the application path as single global constant
define("APP_PATH", realpath(__DIR__));
chdir(__DIR__);
// use autoloading offered by composer, see composer.json for path settings
if (file_exists(APP_PATH . '/vendor/autoload.php')) {
define('VENDOR_PATH', APP_PATH . '/vendor');
} else {
define('VENDOR_PATH', APP_PATH . '/../..');
}
require_once(VENDOR_PATH . '/autoload.php');
// initialize the static \App singleton
require(APP_PATH . '/config.php');
// Set option for environment, routing, logging and templating
\BO\Slim\Bootstrap::init();
\BO\Slim\Helper\ModuleLoggerInitializer::registerHttpMiddleware(false);
\BO\Slim\Bootstrap::addTwigExtension(new \Twig\Extra\Intl\IntlExtension());
\BO\Mellon\ValidMail::$disableDnsChecks = true;
\App::$http = new \BO\Zmsclient\Http(\App::HTTP_BASE_URL);
\BO\Zmsclient\Psr7\Client::$curlopt = \App::$http_curl_config;
// Http Logging
\BO\Slim\Bootstrap::addTwigExtension(new \BO\Zmsclient\TwigExtension(\App::$slim->getContainer()));
\BO\Zmsclient\Http::$logEnabled = \App::DEBUG;
\BO\Zmsclient\Http::$jsonCompressLevel = \App::JSON_COMPRESS_LEVEL;
// Templating
\BO\Slim\Bootstrap::addTwigTemplateDirectory('zmsentities', \BO\Zmsentities\Helper\TemplateFinder::getTemplatePath());
// add slim middleware
$errorMiddleware = \App::$slim->getContainer()->get('errorMiddleware');
$errorMiddleware->setDefaultErrorHandler(new \BO\Zmsadmin\Helper\TwigExceptionHandler());
// load routing
\BO\Slim\Bootstrap::loadRouting(\App::APP_PATH . '/routing.php');