{"action":"created","comment":{"url":"https://api.github.com/repos/sulu/sulu/pulls/comments/59689273","id":59689273,"diff_hunk":"@@ -0,0 +1,106 @@\n+<?php\n+\n+/*\n+ * This file is part of Sulu.\n+ *\n+ * (c) MASSIVE ART WebServices GmbH\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+namespace Sulu\\Bundle\\DocumentManagerBundle\\DependencyInjection\\Compiler;\n+\n+use Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface;\n+use Symfony\\Component\\DependencyInjection\\ContainerBuilder;\n+\n+/**\n+ * Compiler pass to register document manager subscribers.\n+ *\n+ * Subscriber tags may indicate to which document manager they\n+ * should be associated.\n+ */\n+class SubscriberPass implements CompilerPassInterface\n+{\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function process(ContainerBuilder $container)\n+    {\n+        $managers = $container->getParameter('sulu_document_manager.managers');\n+        $baseDispatcherId = 'sulu_document_manager.event_dispatcher';\n+        $dispatcherIds = [];\n+\n+        foreach ($managers as $inde => $manager) {\n+            $dispatcherId = $baseDispatcherId . '.' . $manager;\n+\n+            // TODO: Why would this happen?\n+            if (!$container->hasDefinition($dispatcherId) && !$container->hasAlias($dispatcherId)) {\n+                continue;\n+            }\n+\n+            $dispatcherIds[] = $dispatcherId;\n+        }\n+\n+        foreach ($container->findTaggedServiceIds('sulu_document_manager.event_subscriber') as $subscriberId => $attributes) {\n+            $subscriber = $container->getDefinition($subscriberId);\n+\n+            if (!$subscriber->isPublic()) {\n+                throw new \\InvalidArgumentException(sprintf('The service \"%s\" must be public as event subscribers are lazy-loaded.', $subscriberId));","path":"src/Sulu/Bundle/DocumentManagerBundle/DependencyInjection/Compiler/SubscriberPass.php","position":49,"original_position":49,"commit_id":"542841adaeb64b3060c415c9e532c563daf4c328","original_commit_id":"542841adaeb64b3060c415c9e532c563daf4c328","user":{"login":"danrot","id":405874,"avatar_url":"https://avatars.githubusercontent.com/u/405874?v=3","gravatar_id":"","url":"https://api.github.com/users/danrot","html_url":"https://github.com/danrot","followers_url":"https://api.github.com/users/danrot/followers","following_url":"https://api.github.com/users/danrot/following{/other_user}","gists_url":"https://api.github.com/users/danrot/gists{/gist_id}","starred_url":"https://api.github.com/users/danrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danrot/subscriptions","organizations_url":"https://api.github.com/users/danrot/orgs","repos_url":"https://api.github.com/users/danrot/repos","events_url":"https://api.github.com/users/danrot/events{/privacy}","received_events_url":"https://api.github.com/users/danrot/received_events","type":"User","site_admin":false},"body":"Also the other usages here.","created_at":"2016-04-14T09:44:09Z","updated_at":"2016-04-14T09:44:09Z","html_url":"https://github.com/sulu/sulu/pull/2277#discussion_r59689273","pull_request_url":"https://api.github.com/repos/sulu/sulu/pulls/2277","_links":{"self":{"href":"https://api.github.com/repos/sulu/sulu/pulls/comments/59689273"},"html":{"href":"https://github.com/sulu/sulu/pull/2277#discussion_r59689273"},"pull_request":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2277"}}},"pull_request":{"url":"https://api.github.com/repos/sulu/sulu/pulls/2277","id":65976766,"html_url":"https://github.com/sulu/sulu/pull/2277","diff_url":"https://github.com/sulu/sulu/pull/2277.diff","patch_url":"https://github.com/sulu/sulu/pull/2277.patch","issue_url":"https://api.github.com/repos/sulu/sulu/issues/2277","number":2277,"state":"open","locked":false,"title":"Multiple Document Managers (document_context)","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"This PR introduces the possiblity to have multiple document managers and access them via. a `DocumentManagerRegistry`.\r\n\r\nThis allows us to access more than one PHPCR workspace or backend in the same request.\r\n\r\nWARNING: This is using a POC branch of the document manager, and as such most of the code in this PR is liable to change if we implement a different strategy in the document manager.\r\n\r\nSee DocumentManager PR for more details: https://github.com/sulu-io/sulu-document-manager/pull/66\r\n\r\nNotes\r\n\r\n- We move the PHPCR configuration out of the `SuluCoreBundle` to the `DocumentManagerBundle`.","created_at":"2016-04-11T11:16:14Z","updated_at":"2016-04-14T09:44:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce789736fa8d7015e4e0fc146a7e1f81f3b0b805","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sulu/sulu/pulls/2277/commits","review_comments_url":"https://api.github.com/repos/sulu/sulu/pulls/2277/comments","review_comment_url":"https://api.github.com/repos/sulu/sulu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sulu/sulu/issues/2277/comments","statuses_url":"https://api.github.com/repos/sulu/sulu/statuses/542841adaeb64b3060c415c9e532c563daf4c328","head":{"label":"dantleech:document_context","ref":"document_context","sha":"542841adaeb64b3060c415c9e532c563daf4c328","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"repo":{"id":21705580,"name":"sulu","full_name":"dantleech/sulu","owner":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=3","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dantleech/sulu","description":"Sulu 2.0 core bundle & components","fork":true,"url":"https://api.github.com/repos/dantleech/sulu","forks_url":"https://api.github.com/repos/dantleech/sulu/forks","keys_url":"https://api.github.com/repos/dantleech/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dantleech/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dantleech/sulu/teams","hooks_url":"https://api.github.com/repos/dantleech/sulu/hooks","issue_events_url":"https://api.github.com/repos/dantleech/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/dantleech/sulu/events","assignees_url":"https://api.github.com/repos/dantleech/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/dantleech/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/dantleech/sulu/tags","blobs_url":"https://api.github.com/repos/dantleech/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dantleech/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dantleech/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/dantleech/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dantleech/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/dantleech/sulu/languages","stargazers_url":"https://api.github.com/repos/dantleech/sulu/stargazers","contributors_url":"https://api.github.com/repos/dantleech/sulu/contributors","subscribers_url":"https://api.github.com/repos/dantleech/sulu/subscribers","subscription_url":"https://api.github.com/repos/dantleech/sulu/subscription","commits_url":"https://api.github.com/repos/dantleech/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/dantleech/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/dantleech/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/dantleech/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/dantleech/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/dantleech/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dantleech/sulu/merges","archive_url":"https://api.github.com/repos/dantleech/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dantleech/sulu/downloads","issues_url":"https://api.github.com/repos/dantleech/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/dantleech/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/dantleech/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/dantleech/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dantleech/sulu/labels{/name}","releases_url":"https://api.github.com/repos/dantleech/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/dantleech/sulu/deployments","created_at":"2014-07-10T18:30:43Z","updated_at":"2016-03-14T15:37:38Z","pushed_at":"2016-04-14T09:38:40Z","git_url":"git://github.com/dantleech/sulu.git","ssh_url":"git@github.com:dantleech/sulu.git","clone_url":"https://github.com/dantleech/sulu.git","svn_url":"https://github.com/dantleech/sulu","homepage":"www.sulu.io","size":64814,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"sulu:develop","ref":"develop","sha":"ab19f81cc2eb00eaa6a68b1fe2d319b08664e4f1","user":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"repo":{"id":13678015,"name":"sulu","full_name":"sulu/sulu","owner":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu/sulu","description":"Sulu core bundles & components","fork":false,"url":"https://api.github.com/repos/sulu/sulu","forks_url":"https://api.github.com/repos/sulu/sulu/forks","keys_url":"https://api.github.com/repos/sulu/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu/sulu/teams","hooks_url":"https://api.github.com/repos/sulu/sulu/hooks","issue_events_url":"https://api.github.com/repos/sulu/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/sulu/sulu/events","assignees_url":"https://api.github.com/repos/sulu/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/sulu/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/sulu/sulu/tags","blobs_url":"https://api.github.com/repos/sulu/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu/sulu/languages","stargazers_url":"https://api.github.com/repos/sulu/sulu/stargazers","contributors_url":"https://api.github.com/repos/sulu/sulu/contributors","subscribers_url":"https://api.github.com/repos/sulu/sulu/subscribers","subscription_url":"https://api.github.com/repos/sulu/sulu/subscription","commits_url":"https://api.github.com/repos/sulu/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/sulu/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu/sulu/merges","archive_url":"https://api.github.com/repos/sulu/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu/sulu/downloads","issues_url":"https://api.github.com/repos/sulu/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/sulu/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu/sulu/labels{/name}","releases_url":"https://api.github.com/repos/sulu/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/sulu/sulu/deployments","created_at":"2013-10-18T12:57:02Z","updated_at":"2016-04-14T09:06:25Z","pushed_at":"2016-04-14T08:42:06Z","git_url":"git://github.com/sulu/sulu.git","ssh_url":"git@github.com:sulu/sulu.git","clone_url":"https://github.com/sulu/sulu.git","svn_url":"https://github.com/sulu/sulu","homepage":"sulu.io","size":74791,"stargazers_count":111,"watchers_count":111,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":348,"forks":31,"open_issues":348,"watchers":111,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2277"},"html":{"href":"https://github.com/sulu/sulu/pull/2277"},"issue":{"href":"https://api.github.com/repos/sulu/sulu/issues/2277"},"comments":{"href":"https://api.github.com/repos/sulu/sulu/issues/2277/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2277/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu/sulu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2277/commits"},"statuses":{"href":"https://api.github.com/repos/sulu/sulu/statuses/542841adaeb64b3060c415c9e532c563daf4c328"}}}}