From e4610af235da335962ad09fb5ac9da6b82d30722 Mon Sep 17 00:00:00 2001 From: Sebastian Schreiber Date: Thu, 12 Mar 2020 00:34:23 +0100 Subject: [PATCH] migrate from zend-ldap to laminas-ldap (#1530) --- composer.json | 2 +- src/Ldap/LdapDriver.php | 8 ++++---- tests/Ldap/LdapDriverTest.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 675a9fbd..24f5b131 100644 --- a/composer.json +++ b/composer.json @@ -125,7 +125,7 @@ }, "suggest": { "ext-mbstring": "If ext-mbstring is not available you MUST install symfony/polyfill-mbstring", - "zendframework/zend-ldap": "For LDAP authentication with Kimai" + "laminas/laminas-ldap": "For LDAP authentication with Kimai" }, "scripts": { "auto-scripts": { diff --git a/src/Ldap/LdapDriver.php b/src/Ldap/LdapDriver.php index cfd5a5fb..3275f641 100644 --- a/src/Ldap/LdapDriver.php +++ b/src/Ldap/LdapDriver.php @@ -10,10 +10,10 @@ namespace App\Ldap; use App\Configuration\LdapConfiguration; +use Laminas\Ldap\Exception\LdapException; +use Laminas\Ldap\Ldap; use Psr\Log\LoggerInterface; use Symfony\Component\Security\Core\User\UserInterface; -use Zend\Ldap\Exception\LdapException; -use Zend\Ldap\Ldap; /** * Inspired by https://github.com/Maks3w/FR3DLdapBundle @ MIT License @@ -57,9 +57,9 @@ class LdapDriver protected function getDriver() { if (null === $this->driver) { - if (!class_exists('Zend\Ldap\Ldap')) { + if (!class_exists('Laminas\Ldap\Ldap')) { throw new \Exception( - 'Zend\Ldap\Ldap is missing, install it with "composer require zendframework/zend-ldap" ' . + 'Laminas\Ldap\Ldap is missing, install it with "composer require laminas/laminas-ldap" ' . 'or deactivate LDAP, see https://www.kimai.org/documentation/ldap.html' ); } diff --git a/tests/Ldap/LdapDriverTest.php b/tests/Ldap/LdapDriverTest.php index 68889737..a16d1ba0 100644 --- a/tests/Ldap/LdapDriverTest.php +++ b/tests/Ldap/LdapDriverTest.php @@ -12,9 +12,9 @@ namespace App\Tests\Ldap; use App\Entity\User; use App\Ldap\LdapDriver; use App\Ldap\LdapDriverException; +use Laminas\Ldap\Exception\LdapException; +use Laminas\Ldap\Ldap; use PHPUnit\Framework\TestCase; -use Zend\Ldap\Exception\LdapException; -use Zend\Ldap\Ldap; /** * @covers \App\Ldap\LdapDriver @@ -24,7 +24,7 @@ class LdapDriverTest extends TestCase protected function setUp(): void { parent::setUp(); - if (!class_exists('Zend\Ldap\Ldap')) { + if (!class_exists('Laminas\Ldap\Ldap')) { $this->markTestSkipped('LDAP is not installed'); } }