-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.php
executable file
·33 lines (28 loc) · 929 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Retour for Kirby Plugin
*
* Easily add and manage redirects from the
* Kirby 4 Panel and track 404 errors
*
* @package Retour for Kirby
* @author Nico Hoffmann <[email protected]>
* @link https://github.com/distantnative/retour-for-kirby
* @copyright Nico Hoffmann
* @license https://opensource.org/licenses/MIT
*/
use Composer\Semver\Semver;
use Kirby\Cms\App as Kirby;
// validate Kirby version
if (Semver::satisfies(Kirby::version() ?? '0.0.0', '~4.0 || ~5.0') === false) {
throw new Exception('Retour requires Kirby 4 or 5');
}
// load classes
require_once 'src/bootstrap.php';
// register the plugin
Kirby::plugin('distantnative/retour', [
'areas' => require_once 'src/extensions/areas.php',
'hooks' => require_once 'src/extensions/hooks.php',
'routes' => require_once 'src/extensions/routes.php',
'translations' => require_once 'src/extensions/i18n.php'
]);