$gapp = new \Galette\Core\SlimApp();
}
$app = $gapp->getApp();
+$app->setBasePath((function () {
+ $scriptDir = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
+ $uri = (string)parse_url('http://a' . $_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH);
+ if (stripos($uri, $_SERVER['SCRIPT_NAME']) === 0) {
+ return dirname($_SERVER['SCRIPT_NAME']);
+ }
+ if ($scriptDir !== '/' && stripos($uri, $scriptDir) === 0) {
+ return $scriptDir;
+ }
+ return '';
+})());
//CONFIGURE AND START SESSION
*/
$app->add(TwigMiddleware::createFromContainer($app, Twig::class));
-/**
- * Trailing slash middleware
- */
-$app->add(TrailingSlash::class);
-
$app->run();
if (isset($profiler)) {
+++ /dev/null
-<?php
-
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
-/**
- * Galette Slim middleware to handle trailing slash in URLs
- *
- * PHP version 5
- *
- * Copyright © 2020-2023 The Galette Team
- *
- * This file is part of Galette (http://galette.tuxfamily.org).
- *
- * Galette is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Galette is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Galette. If not, see <http://www.gnu.org/licenses/>.
- *
- * @category Core
- * @package Galette
- *
- * @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2020-2023 The Galette Team
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
- * @link http://galette.tuxfamily.org
- * @since Available since 0.9.4dev - 2020-05-06
- */
-
-namespace Galette\Middleware;
-
-use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\ServerRequestInterface as Request;
-use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
-use Slim\Psr7\Response;
-
-/**
- * Galette Slim middleware to handle trailing slash in URLs
- *
- * @category Middleware
- * @name TrailingSlash
- * @package Galette
- * @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2020-2023 The Galette Team
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
- * @link http://galette.tuxfamily.org
- * @since Available since 0.9.4dev - 2020-05-06
- */
-class TrailingSlash
-{
- /**
- * Middleware invokable class
- *
- * @param Request $request PSR7 request
- * @param RequestHandler $handler Request handler
- *
- * @return ResponseInterface
- */
- public function __invoke(Request $request, RequestHandler $handler): ResponseInterface
- {
- $uri = $request->getUri();
- $path = $uri->getPath();
-
- if ($path != '/' && substr($path, -1) == '/') {
- // recursively remove slashes when its more than 1 slash
- $path = rtrim($path, '/');
-
- // permanently redirect paths with a trailing slash
- // to their non-trailing counterpart
- $uri = $uri->withPath($path);
-
- if ($request->getMethod() == 'GET') {
- $response = new Response();
- return $response
- ->withHeader('Location', (string)$uri)
- ->withStatus(301);
- } else {
- $request = $request->withUri($uri);
- }
- }
-
- return $handler->handle($request);
- }
-}
*
* PHP version 5
*
- * Copyright © 2013-2014 The Galette Team
+ * Copyright © 2013-2023 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
*
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2013-2017 The Galette Team
+ * @copyright 2013-2023 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since Available since 0.7.4dev - 2013-02-03
echo $cm->toHtml(false);
?>
</ul>
+ <?php
+ if ($cm->isValid() && $phpok) {
+ echo '<p class="ui center aligned message">You can now <a href="./installer.php">install Galette</a></p>';
+ }
+ ?>
</div>
</div>
</div>
js: './ui/js/*.js',
favicon:'./ui/images/favicon.png',
logo: './ui/images/galette.png',
- photo:'./ui/images/default.png'
+ photo:'./ui/images/default.png',
+ emojis: './node_modules/twemoji-emojis/vendor/svg/*'
},
semantic: {
src: './semantic/src/',
}, {
src: './node_modules/jquery/dist/jquery.min.js',
dest: 'js/'
- }, {
- src: './node_modules/twemoji-emojis/vendor/svg/*',
- dest: 'emojis/'
}
]
};
.pipe(gulp.dest(paths.semantic.theme))
.pipe(browserSync.stream());
- return merge(config, theme);
+ emojis = gulp.src(paths.src.emojis)
+ .pipe(gulp.dest(paths.semantic.theme + 'assets/emojis'))
+ .pipe(browserSync.stream());
+
+ return merge(config, theme, emojis);
}
function clean() {