julienmonnerie/kirby/bootstrap.php

37 lines
892 B
PHP
Raw Normal View History

2022-06-17 17:51:59 +02:00
<?php
/**
* Validate the PHP version to already
* stop at older or too recent versions
*/
if (
2025-01-12 18:56:44 +01:00
version_compare(PHP_VERSION, '8.1.0', '>=') === false ||
version_compare(PHP_VERSION, '8.4.0', '<') === false
2022-06-17 17:51:59 +02:00
) {
2022-08-31 15:02:43 +02:00
die(include __DIR__ . '/views/php.php');
2022-06-17 17:51:59 +02:00
}
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
2022-08-31 15:02:43 +02:00
/**
* Always prefer a site-wide Composer autoloader
* if it exists, it means that the user has probably
* installed additional packages
2022-12-19 14:56:05 +01:00
*
* @psalm-suppress MissingFile
2022-08-31 15:02:43 +02:00
*/
include $autoloader;
2022-06-17 17:51:59 +02:00
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
2022-08-31 15:02:43 +02:00
/**
* Fall back to the local autoloader if that exists
2022-12-19 14:56:05 +01:00
*
* @psalm-suppress MissingFile
2022-08-31 15:02:43 +02:00
*/
include $autoloader;
2022-06-17 17:51:59 +02:00
} else {
2022-08-31 15:02:43 +02:00
/**
* If neither one exists, don't bother searching;
* it's a custom directory setup and the users need to
* load the autoloader themselves
*/
2022-06-17 17:51:59 +02:00
}