xiaowang/kirby/bootstrap.php

33 lines
820 B
PHP
Raw Normal View History

2021-10-29 18:05:46 +02:00
<?php
/**
* Validate the PHP version to already
* stop at older or too recent versions
*/
if (
2022-08-31 16:08:03 +02:00
version_compare(PHP_VERSION, '7.4.0', '>=') === false ||
version_compare(PHP_VERSION, '8.2.0', '<') === false
2021-10-29 18:05:46 +02:00
) {
2022-08-31 16:08:03 +02:00
die(include __DIR__ . '/views/php.php');
2021-10-29 18:05:46 +02:00
}
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
2022-08-31 16:08:03 +02:00
/**
* Always prefer a site-wide Composer autoloader
* if it exists, it means that the user has probably
* installed additional packages
*/
include $autoloader;
2021-10-29 18:05:46 +02:00
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
2022-08-31 16:08:03 +02:00
/**
* Fall back to the local autoloader if that exists
*/
include $autoloader;
2021-10-29 18:05:46 +02:00
} else {
2022-08-31 16:08:03 +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
*/
2021-10-29 18:05:46 +02:00
}