]>
git.agnieray.net Git - galette.git/blob - galette/lib/Galette/Core/SlimApp.php
ad9716fd8f7caf1f1ad2a62a677b1fec7d5a7e0d
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
;
31 * @author Johan Cwiklinski <johan@x-tnd.be>
39 * Create a new Slim application
41 public function __construct()
43 $builder = new ContainerBuilder();
44 $builder->useAttributes(true);
45 $builder->addDefinitions([
47 'mode' => GALETTE_MODE
,
50 'level' => \Monolog\Logger
::DEBUG
,
51 'path' => GALETTE_LOGS_PATH
. '/galette_slim.log',
54 'mode' => GALETTE_MODE
, //TODO: rely on galette.mode
55 'galette.mode' => GALETTE_MODE
,
56 'session' => \DI\autowire
('\RKA\Session')
58 $container = $builder->build();
60 $this->app
= Bridge
::create($container);
64 * Get Slim application
68 public function getApp(): App