PHP code example of in2code / in2connector

1. Go to this page and download the library: Download in2code/in2connector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

in2code / in2connector example snippets


use In2code\In2connector\Driver\LdapDriver;
use In2code\In2connector\Service\ConnectionService;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class PersonRepository
{
    /**
     * @var LdapDriver
     */
    protected $driver = null;

    /**
     * PersonRepository constructor.
     */
    public function __construct()
    {
        $this->driver = GeneralUtility::makeInstance(ConnectionService::class)->getDriverInstanceIfAvailable('asd');
    }

    public function findAll()
    {
        return $this->driver->searchAndGetResults('', 'objectClass=*');
    }
}