Migrations: fail on PHP 5.3.x

fixes #1006
This commit is contained in:
Thomas Gelf 2017-07-13 11:43:13 +02:00
parent b11c6b9f34
commit e4d35d74e3
1 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@ namespace Icinga\Module\Director\Db;
use DirectoryIterator;
use Exception;
use Icinga\Application\Icinga;
use Icinga\Exception\IcingaException;
use Icinga\Module\Director\Data\Db\DbConnection;
class Migrations
@ -23,6 +24,13 @@ class Migrations
public function __construct(DbConnection $connection)
{
if (version_compare(PHP_VERSION, '5.4.0') < 0) {
throw new IcingaException(
"PHP version 5.4.x is required for Director >= 1.4.0, you're running %s."
. ' Please either upgrade PHP or downgrade Icinga Director',
PHP_VERSION
);
}
$this->connection = $connection;
$this->db = $connection->getDbAdapter();
}