{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/42131289","id":42131289,"diff_hunk":"@@ -288,4 +285,49 @@ private function determineSymfonyState()\n \n         return $versionState;\n     }\n+\n+    /**\n+     * Gets the names, paths and installed versions of the bundles enabled in\n+     * the application.\n+     *\n+     * @return array\n+     */\n+    private function getBundleData()\n+    {\n+        $bundles = array();\n+\n+        $composerLockPath = $this->kernel->getRootDir().'/../composer.lock';\n+        if (!file_exists($composerLockPath)) {\n+            $installedPackages = array();\n+        } else {\n+            $composerLock = json_decode(file_get_contents($composerLockPath), true);\n+            foreach (array_merge($composerLock['packages'], $composerLock['packages-dev']) as $package) {\n+                $installedPackages[$package['name']] = $package['version'];\n+            }\n+        }\n+\n+        foreach ($this->kernel->getBundles() as $name => $bundle) {\n+            $bundlePath = $bundle->getPath();\n+\n+            $bundleVersion = null;\n+            foreach ($installedPackages as $packageName => $packageVersion) {\n+                if (strpos($bundlePath, '/vendor/'.$packageName)) {","path":"src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php","position":42,"original_position":42,"commit_id":"e787fae911ae86f4762e30486535c3599d3a03f5","original_commit_id":"e787fae911ae86f4762e30486535c3599d3a03f5","user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"body":"add a ``/`` after the package name, to avoid issues with overlapping package names (``knplabs/knp-menu`` vs ``knplabs/knp-menu-bundle`` for instance, where your code would use the ``knplabs/knp-menu`` version as it appears first in the lock file and would match your condition)","created_at":"2015-10-15T14:33:02Z","updated_at":"2015-10-15T14:33:02Z","html_url":"https://github.com/symfony/symfony/pull/16247#discussion_r42131289","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/16247","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/42131289"},"html":{"href":"https://github.com/symfony/symfony/pull/16247#discussion_r42131289"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/16247"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/16247","id":47773257,"html_url":"https://github.com/symfony/symfony/pull/16247","diff_url":"https://github.com/symfony/symfony/pull/16247.diff","patch_url":"https://github.com/symfony/symfony/pull/16247.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/16247","number":16247,"state":"open","locked":false,"title":"Show the installed bundle versions in the web profiler","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/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?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | -\r\n| License       | MIT\r\n| Doc PR        | -\r\n\r\nNow that I'm upgrading some apps to Symfony 2.8, sometimes I need to know the exact version installed for some bundles. I think that the web profiler is the right place to show that information.\r\n\r\nThis feature is also useful to provide support for bundles' users because it's common to ask them: \"which version of the bundle are you using?\"\r\n\r\n### Before\r\n\r\n![before](https://cloud.githubusercontent.com/assets/73419/10512204/0085fba8-733f-11e5-8352-ee53d350f8e1.png)\r\n\r\n### After\r\n\r\n![after](https://cloud.githubusercontent.com/assets/73419/10512206/033ec172-733f-11e5-8bac-53a36d1a1518.png)\r\n","created_at":"2015-10-15T11:17:57Z","updated_at":"2015-10-15T14:33:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3bb944942ad19cd7d558c7286f53a906b72ecf26","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/16247/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/16247/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/16247/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/e787fae911ae86f4762e30486535c3599d3a03f5","head":{"label":"javiereguiluz:show_bundle_version","ref":"show_bundle_version","sha":"e787fae911ae86f4762e30486535c3599d3a03f5","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"repo":{"id":15188086,"name":"symfony","full_name":"javiereguiluz/symfony","owner":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/javiereguiluz/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/javiereguiluz/symfony","forks_url":"https://api.github.com/repos/javiereguiluz/symfony/forks","keys_url":"https://api.github.com/repos/javiereguiluz/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/javiereguiluz/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/javiereguiluz/symfony/teams","hooks_url":"https://api.github.com/repos/javiereguiluz/symfony/hooks","issue_events_url":"https://api.github.com/repos/javiereguiluz/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/javiereguiluz/symfony/events","assignees_url":"https://api.github.com/repos/javiereguiluz/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/javiereguiluz/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/javiereguiluz/symfony/tags","blobs_url":"https://api.github.com/repos/javiereguiluz/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/javiereguiluz/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/javiereguiluz/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/javiereguiluz/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/javiereguiluz/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/javiereguiluz/symfony/languages","stargazers_url":"https://api.github.com/repos/javiereguiluz/symfony/stargazers","contributors_url":"https://api.github.com/repos/javiereguiluz/symfony/contributors","subscribers_url":"https://api.github.com/repos/javiereguiluz/symfony/subscribers","subscription_url":"https://api.github.com/repos/javiereguiluz/symfony/subscription","commits_url":"https://api.github.com/repos/javiereguiluz/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/javiereguiluz/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/javiereguiluz/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/javiereguiluz/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/javiereguiluz/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/javiereguiluz/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/javiereguiluz/symfony/merges","archive_url":"https://api.github.com/repos/javiereguiluz/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/javiereguiluz/symfony/downloads","issues_url":"https://api.github.com/repos/javiereguiluz/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/javiereguiluz/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/javiereguiluz/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/javiereguiluz/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/javiereguiluz/symfony/labels{/name}","releases_url":"https://api.github.com/repos/javiereguiluz/symfony/releases{/id}","created_at":"2013-12-14T15:54:02Z","updated_at":"2015-07-31T05:53:32Z","pushed_at":"2015-10-15T14:21:36Z","git_url":"git://github.com/javiereguiluz/symfony.git","ssh_url":"git@github.com:javiereguiluz/symfony.git","clone_url":"https://github.com/javiereguiluz/symfony.git","svn_url":"https://github.com/javiereguiluz/symfony","homepage":"symfony.com","size":62298,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"symfony:2.8","ref":"2.8","sha":"eca3e37225614ab49feb8cd1763ea1ebee76edd7","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}","created_at":"2010-01-04T14:21:21Z","updated_at":"2015-10-15T11:37:38Z","pushed_at":"2015-10-15T14:21:42Z","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":257740,"stargazers_count":10958,"watchers_count":10958,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4309,"mirror_url":null,"open_issues_count":771,"forks":4309,"open_issues":771,"watchers":10958,"default_branch":"2.8"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/16247"},"html":{"href":"https://github.com/symfony/symfony/pull/16247"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/16247"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/16247/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/16247/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/16247/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/e787fae911ae86f4762e30486535c3599d3a03f5"}}}}