From e4d35d74e3f970cc2a81ee5be222ccccc7cd7d14 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 13 Jul 2017 11:43:13 +0200 Subject: [PATCH] Migrations: fail on PHP 5.3.x fixes #1006 --- library/Director/Db/Migrations.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/Director/Db/Migrations.php b/library/Director/Db/Migrations.php index 7ab4d795..f1c41a00 100644 --- a/library/Director/Db/Migrations.php +++ b/library/Director/Db/Migrations.php @@ -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(); }