From 97cc37b99ca9c62f3bf75be77eef963544b7958c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 29 Jan 2015 15:59:03 +0100 Subject: [PATCH] Move php version check from ...\Ldap\Query to ...\Ldap\Connection refs #8261 refs #6176 --- library/Icinga/Protocol/Ldap/Connection.php | 2 +- library/Icinga/Protocol/Ldap/Query.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index b0bf1f281..e340efc25 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -320,7 +320,7 @@ class Connection protected function runQuery(Query $query, $fields = array()) { - if ($query->getUsePagedResults()) { + if ($query->getUsePagedResults() && version_compare(PHP_VERSION, '5.4.0') >= 0) { if ($this->pageCookie === null) { $this->pageCookie = ''; } else { diff --git a/library/Icinga/Protocol/Ldap/Query.php b/library/Icinga/Protocol/Ldap/Query.php index 930cefa96..c6f0d6fa1 100644 --- a/library/Icinga/Protocol/Ldap/Query.php +++ b/library/Icinga/Protocol/Ldap/Query.php @@ -33,7 +33,7 @@ class Query protected $sort_columns = array(); protected $count; protected $base; - protected $usePagedResults; + protected $usePagedResults = true; /** * Constructor @@ -44,7 +44,6 @@ class Query public function __construct(Connection $connection) { $this->connection = $connection; - $this->usePagedResults = version_compare(PHP_VERSION, '5.4.0') >= 0; } public function setBase($base) @@ -65,7 +64,7 @@ class Query public function setUsePagedResults($state = true) { - $this->usePagedResults = (bool) $state && version_compare(PHP_VERSION, '5.4.0') >= 0; + $this->usePagedResults = (bool) $state; return $this; }