]> git.agnieray.net Git - galette.git/blob - galette/includes/routes/main.routes.php
ac9a0603382d34a513ad5abc65da3e9bdf8d14be
[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 * @link http://galette.tuxfamily.org
34 * @since 0.8.2dev 2014-11-11
35 */
36
37 use Galette\Controllers\GaletteController;
38 use Galette\Controllers\ImagesController;
39
40 //main route
41 $app->get(
42 '/',
43 GaletteController::class . ':slash'
44 )->setName('slash');
45
46 //logo route
47 $app->get(
48 '/logo',
49 ImagesController::class . ':logo'
50 )->setName('logo');
51
52 //print logo route
53 $app->get(
54 '/print-logo',
55 ImagesController::class . ':logo'
56 )->setName('printLogo');
57
58 //photo route
59 $app->get(
60 '/photo/{id:\d+}',
61 ImagesController::class . ':photo'
62 )->setName('photo');
63
64 //system information - keep old route with typo ('s' on 'information') for now (0.9.4)
65 $app->get(
66 '/system-informations',
67 function ($request, $response) {
68 return $response
69 ->withStatus(302)
70 ->withHeader('Location', $this->router->pathFor('sysinfos'));
71 }
72 );
73
74 //system information
75 $app->get(
76 '/system-information',
77 GaletteController::class . ':systemInformation'
78 )->setName('sysinfos')->add($authenticate);