Bolt\Exception\BootException::earlyExceptionVersion PHP Method

earlyExceptionVersion() public static method

Exception due to a PHP version being unsupported.
public static earlyExceptionVersion ( )
    public static function earlyExceptionVersion()
    {
        $message = <<<EOM
Bolt requires PHP <u>5.5.9</u>, or higher. 
<br><br>
You are running PHP <u>%s</u>, so Bolt will not run on your current setup.
EOM;
        $message = sprintf($message, htmlspecialchars(PHP_VERSION, ENT_QUOTES));
        echo sprintf(static::getEarlyExceptionHtml(), 'Bolt - Fatal error', $message, '');
        throw new static(strip_tags($message));
    }

Usage Example

Beispiel #1
0
<?php

/*
 * This could be loaded on a very old version of PHP so no syntax/methods over 5.2 in this file.
 */
use Bolt\Exception\BootException;
if (version_compare(PHP_VERSION, '5.5.9', '<')) {
    require dirname(dirname(__FILE__)) . '/src/Exception/BootException.php';
    BootException::earlyExceptionVersion();
}
if (PHP_SAPI === 'cli-server') {
    if (is_file($_SERVER['DOCUMENT_ROOT'] . preg_replace('#(\\?.*)$#', '', $_SERVER['REQUEST_URI']))) {
        return false;
    }
}
return require dirname(__FILE__) . '/bootstrap.php';