migrate from zend-ldap to laminas-ldap (#1530)

This commit is contained in:
Sebastian Schreiber
2020-03-12 00:34:23 +01:00
committed by GitHub
parent e7458e76e1
commit e4610af235
3 changed files with 8 additions and 8 deletions

View File

@@ -125,7 +125,7 @@
}, },
"suggest": { "suggest": {
"ext-mbstring": "If ext-mbstring is not available you MUST install symfony/polyfill-mbstring", "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": { "scripts": {
"auto-scripts": { "auto-scripts": {

View File

@@ -10,10 +10,10 @@
namespace App\Ldap; namespace App\Ldap;
use App\Configuration\LdapConfiguration; use App\Configuration\LdapConfiguration;
use Laminas\Ldap\Exception\LdapException;
use Laminas\Ldap\Ldap;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\User\UserInterface; 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 * Inspired by https://github.com/Maks3w/FR3DLdapBundle @ MIT License
@@ -57,9 +57,9 @@ class LdapDriver
protected function getDriver() protected function getDriver()
{ {
if (null === $this->driver) { if (null === $this->driver) {
if (!class_exists('Zend\Ldap\Ldap')) { if (!class_exists('Laminas\Ldap\Ldap')) {
throw new \Exception( 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' 'or deactivate LDAP, see https://www.kimai.org/documentation/ldap.html'
); );
} }

View File

@@ -12,9 +12,9 @@ namespace App\Tests\Ldap;
use App\Entity\User; use App\Entity\User;
use App\Ldap\LdapDriver; use App\Ldap\LdapDriver;
use App\Ldap\LdapDriverException; use App\Ldap\LdapDriverException;
use Laminas\Ldap\Exception\LdapException;
use Laminas\Ldap\Ldap;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Zend\Ldap\Exception\LdapException;
use Zend\Ldap\Ldap;
/** /**
* @covers \App\Ldap\LdapDriver * @covers \App\Ldap\LdapDriver
@@ -24,7 +24,7 @@ class LdapDriverTest extends TestCase
protected function setUp(): void protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
if (!class_exists('Zend\Ldap\Ldap')) { if (!class_exists('Laminas\Ldap\Ldap')) {
$this->markTestSkipped('LDAP is not installed'); $this->markTestSkipped('LDAP is not installed');
} }
} }