]>
git.agnieray.net Git - galette.git/blob - galette/lib/Galette/Core/LightSlimApp.php
21d5f96ccddf5427ddf354441c95983342f9f424
4 * Copyright © 2003-2024 The Galette Team
6 * This file is part of Galette (https://galette.eu).
8 * Galette is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * Galette is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
22 namespace Galette\Core
;
24 use DI\Bridge\Slim\Bridge
;
25 use DI\ContainerBuilder
;
29 * Light Slim application
31 * @author Johan Cwiklinski <johan@x-tnd.be>
40 * Create a new Slim application
42 * @param string $mode Galette mode
44 public function __construct(string $mode = 'NEED_UPDATE')
48 $builder = new ContainerBuilder();
49 $builder->useAttributes(true);
50 $builder->addDefinitions([
51 'templates.path' => GALETTE_ROOT
. GALETTE_THEME
,
52 'settings.displayErrorDetails' => Galette
::isDebugEnabled(),
53 'settings.addContentLengthHeader' => false,
55 'mode' => $this->mode
,
58 'level' => \Monolog\Logger
::DEBUG
,
59 'path' => GALETTE_LOGS_PATH
. '/galette_slim.log',
62 'mode' => $this->mode
,
63 'galette.mode' => $this->mode
,
64 'session' => \DI\autowire
('\RKA\Session')
66 $container = $builder->build();
68 $this->app
= Bridge
::create($container);
72 * Get Slim application
76 public function getApp(): App