]> git.agnieray.net Git - galette.git/blob - galette/includes/routes/main.routes.php
Scrutinizer Auto-Fixes
[galette.git] / galette / includes / routes / main.routes.php
1 <?php
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 /**
6 * Main routes
7 *
8 * PHP version 5
9 *
10 * Copyright © 2014 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 Routes
28 * @package Galette
29 *
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2014 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 0.8.2dev 2014-11-11
36 */
37
38 use Galette\Controllers\GaletteController;
39 use Galette\Controllers\ImagesController;
40
41 //main route
42 $app->get(
43 '/',
44 GaletteController::class . ':slash'
45 )->setName('slash');
46
47 //logo route
48 $app->get(
49 '/logo',
50 ImagesController::class . ':logo'
51 )->setName('logo');
52
53 //print logo route
54 $app->get(
55 '/print-logo',
56 ImagesController::class . ':logo'
57 )->setName('printLogo');
58
59 //photo route
60 $app->get(
61 '/photo/{id:\d+}',
62 ImagesController::class . ':photo'
63 )->setName('photo');
64
65 //system information - keep old route with typo ('s' on 'information') for now (0.9.4)
66 $app->get(
67 '/system-informations',
68 function ($request, $response, $args) {
69 return $response
70 ->withStatus(302)
71 ->withHeader('Location', $this->router->pathFor('sysinfos'));
72 }
73 );
74
75 //system information
76 $app->get(
77 '/system-information',
78 GaletteController::class . ':systemInformation'
79 )->setName('sysinfos')->add($authenticate);