{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/52847629","id":52847629,"diff_hunk":"@@ -0,0 +1,72 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Symfony\\Component\\Ldap\\Adapter\\ExtLdap;\n+\n+use Symfony\\Component\\Ldap\\Adapter\\AbstractQuery;\n+use Symfony\\Component\\Ldap\\Exception\\LdapException;\n+\n+/**\n+ * @author Charles Sarrazin <charles@sarraz.in>\n+ */\n+class Query extends AbstractQuery\n+{\n+    /** @var  Connection */\n+    protected $connection;\n+\n+    /** @var resource */\n+    private $search;\n+\n+    public function __construct(Connection $connection, $dn, $query, array $options = array())\n+    {\n+        parent::__construct($connection, $dn, $query, $options);\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function execute()\n+    {\n+        // If the connection is not bound, then we try an anonymous bind.\n+        if (!$this->connection->isBound()) {\n+            $this->connection->bind();\n+        }\n+\n+        $con = $this->connection->getResource();\n+\n+        $this->search = ldap_search(\n+            $con,\n+            $this->dn,\n+            $this->query,\n+            $this->options['filter'],\n+            $this->options['attrsOnly'],\n+            $this->options['maxItems'],\n+            $this->options['timeout'],\n+            $this->options['deref']\n+        );\n+\n+        if (!$this->search) {\n+            throw new LdapException(sprintf('Could not complete search with dn \"%s\", query \"%s\" and filters \"%s\"', $this->dn, $this->query, implode(',', $this->options['filter'])));\n+        };\n+\n+        return new Collection($this->connection, $this);\n+    }\n+\n+    /**\n+     * Returns a LDAP search resource.\n+     *\n+     * @return resource\n+     */\n+    public function getResource()","path":"src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php","position":68,"original_position":68,"commit_id":"34d3c853cba3640c5cb8bce2570c1a3c9d7b44d5","original_commit_id":"34d3c853cba3640c5cb8bce2570c1a3c9d7b44d5","user":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"body":"Yes, as it is needed by ldap_search and other functions!","created_at":"2016-02-14T19:41:57Z","updated_at":"2016-02-14T19:41:57Z","html_url":"https://github.com/symfony/symfony/pull/17560#discussion_r52847629","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/17560","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/52847629"},"html":{"href":"https://github.com/symfony/symfony/pull/17560#discussion_r52847629"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17560"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/17560","id":57342087,"html_url":"https://github.com/symfony/symfony/pull/17560","diff_url":"https://github.com/symfony/symfony/pull/17560.diff","patch_url":"https://github.com/symfony/symfony/pull/17560.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/17560","number":17560,"state":"closed","locked":false,"title":"[Ldap] Improving the LDAP component","user":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | yes\r\n| Deprecations? | no\r\n| Tests pass?   | no\r\n| Fixed tickets | #14602\r\n| License       | MIT\r\n| Doc PR        | not yet\r\n\r\nThis PR will address a few issues mentioned in #14602.\r\n\r\n* [x] Integrate the Config component in order to simplify the client's configuration\r\n* [x] Separate Connection handling from the Client \r\n* [x] Support for multiple drivers\r\n* [x] Add functional tests\r\n* [x] Update Security component","created_at":"2016-01-27T10:45:49Z","updated_at":"2016-02-14T19:41:57Z","closed_at":"2016-02-14T10:16:36Z","merged_at":"2016-02-14T10:16:36Z","merge_commit_sha":"567315292cc8a9bc317a7e9cac16890d8bf8fa13","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/17560/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/17560/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/17560/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/34d3c853cba3640c5cb8bce2570c1a3c9d7b44d5","head":{"label":"csarrazi:feat-improve-ldap","ref":"feat-improve-ldap","sha":"34d3c853cba3640c5cb8bce2570c1a3c9d7b44d5","user":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"repo":{"id":16704730,"name":"symfony","full_name":"csarrazi/symfony","owner":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csarrazi/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/csarrazi/symfony","forks_url":"https://api.github.com/repos/csarrazi/symfony/forks","keys_url":"https://api.github.com/repos/csarrazi/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csarrazi/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csarrazi/symfony/teams","hooks_url":"https://api.github.com/repos/csarrazi/symfony/hooks","issue_events_url":"https://api.github.com/repos/csarrazi/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/csarrazi/symfony/events","assignees_url":"https://api.github.com/repos/csarrazi/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/csarrazi/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/csarrazi/symfony/tags","blobs_url":"https://api.github.com/repos/csarrazi/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csarrazi/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csarrazi/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/csarrazi/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csarrazi/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/csarrazi/symfony/languages","stargazers_url":"https://api.github.com/repos/csarrazi/symfony/stargazers","contributors_url":"https://api.github.com/repos/csarrazi/symfony/contributors","subscribers_url":"https://api.github.com/repos/csarrazi/symfony/subscribers","subscription_url":"https://api.github.com/repos/csarrazi/symfony/subscription","commits_url":"https://api.github.com/repos/csarrazi/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/csarrazi/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/csarrazi/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/csarrazi/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/csarrazi/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/csarrazi/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csarrazi/symfony/merges","archive_url":"https://api.github.com/repos/csarrazi/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csarrazi/symfony/downloads","issues_url":"https://api.github.com/repos/csarrazi/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/csarrazi/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/csarrazi/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/csarrazi/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csarrazi/symfony/labels{/name}","releases_url":"https://api.github.com/repos/csarrazi/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/csarrazi/symfony/deployments","created_at":"2014-02-10T18:26:10Z","updated_at":"2015-03-24T15:55:17Z","pushed_at":"2016-02-11T17:57:37Z","git_url":"git://github.com/csarrazi/symfony.git","ssh_url":"git@github.com:csarrazi/symfony.git","clone_url":"https://github.com/csarrazi/symfony.git","svn_url":"https://github.com/csarrazi/symfony","homepage":"symfony.com","size":67000,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"33c797ee05061538b7a5b4999056fb2362dd7655","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-02-14T12:01:42Z","pushed_at":"2016-02-14T19:09:32Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":101479,"stargazers_count":11750,"watchers_count":11750,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4608,"mirror_url":null,"open_issues_count":748,"forks":4608,"open_issues":748,"watchers":11750,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17560"},"html":{"href":"https://github.com/symfony/symfony/pull/17560"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/17560"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/17560/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17560/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17560/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/34d3c853cba3640c5cb8bce2570c1a3c9d7b44d5"}}}}