-
-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathbootstrap.php
More file actions
47 lines (45 loc) · 1.28 KB
/
Copy pathbootstrap.php
File metadata and controls
47 lines (45 loc) · 1.28 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Validate the PHP version to already
* stop at older or too recent versions
*
* This check can be disabled by setting:
* define('KIRBY_PHP_VERSION_CHECK', false);
* in your `index.php`.
*
* ATTENTION: Set this constant at your own risk only.
* PHP releases contain backward-incompatible changes that can
* cause and have caused unexpected behavior and security impact.
* We strongly advise against disabling the PHP version check
* in production.
*/
if (
(
defined('KIRBY_PHP_VERSION_CHECK') !== true ||
KIRBY_PHP_VERSION_CHECK !== false
) && (
version_compare(PHP_VERSION, '8.2.0', '>=') === false ||
version_compare(PHP_VERSION, '8.6.0', '<') === false
)
) {
http_response_code(503);
die(include __DIR__ . '/views/php.php');
}
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
/**
* Always prefer a site-wide Composer autoloader
* if it exists, it means that the user has probably
* installed additional packages
*/
include $autoloader;
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
/**
* Fall back to the local autoloader if that exists
*/
include $autoloader;
}
/**
* If neither one exists, don't bother searching;
* it's a custom directory setup and the users need to
* load the autoloader themselves
*/