]> git.agnieray.net Git - galette.git/blob - galette/lib/Galette/Core/LightSlimApp.php
Scrutinizer Auto-Fixes
[galette.git] / galette / lib / Galette / Core / LightSlimApp.php
1 <?php
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 /**
6 * Slim application
7 *
8 * PHP version 5
9 *
10 * Copyright © 2020 The Galette Team
11 *
12 * This file is part of Galette (http://galette.tuxfamily.org).
13 *
14 * Galette is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * Galette is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
26 *
27 * @category Core
28 * @package Galette
29 *
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2020 The Galette Team
32 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
33 * @version SVN: $Id$
34 * @link http://galette.tuxfamily.org
35 * @since Available since 0.9.5dev - 2020-12-12
36 */
37
38 namespace Galette\Core;
39
40 use DI\Bridge\Slim;
41 use DI\ContainerBuilder;
42
43 /**
44 * Light Slim application
45 *
46 * @category Core
47 * @name Db
48 * @package Galette
49 * @author Johan Cwiklinski <johan@x-tnd.be>
50 * @copyright 2020 The Galette Team
51 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
52 * @link http://framework.zend.com/apidoc/2.2/namespaces/Zend.Db.html
53 * @since Available since 0.9.5dev - 2020-12-12
54 */
55 class LightSlimApp extends \DI\Bridge\Slim\App
56 {
57 /**
58 * Configure the container builder.
59 *
60 * @param ContainerBuilder $builder Builder to configure
61 *
62 * @return void
63 */
64 protected function configureContainer(ContainerBuilder $builder)
65 {
66 $builder->useAnnotations(true);
67 $builder->addDefinitions([
68 'templates.path' => GALETTE_ROOT . GALETTE_THEME,
69 'settings.displayErrorDetails' => (GALETTE_MODE === 'DEV'),
70 'settings.addContentLengthHeader' => false,
71 'galette' => [
72 'mode' => 'NEED_UPDATE',
73 'logger' => [
74 'name' => 'galette',
75 'level' => \Monolog\Logger::DEBUG,
76 'path' => GALETTE_LOGS_PATH . '/galette_slim.log',
77 ]
78 ],
79 'mode' => 'NEED_UPDATE', //TODO: rely on galette.mode
80 'galette.mode' => 'NEED_UPDATE',
81 'session' => \DI\autowire('\RKA\Session')
82 ]);
83 }
84 }