{"action":"closed","number":5238,"pull_request":{"url":"https://api.github.com/repos/composer/composer/pulls/5238","id":67613908,"html_url":"https://github.com/composer/composer/pull/5238","diff_url":"https://github.com/composer/composer/pull/5238.diff","patch_url":"https://github.com/composer/composer/pull/5238.patch","issue_url":"https://api.github.com/repos/composer/composer/issues/5238","number":5238,"state":"closed","locked":false,"title":"Fixes the init event.","user":{"login":"LionsAd","id":354804,"avatar_url":"https://avatars.githubusercontent.com/u/354804?v=3","gravatar_id":"","url":"https://api.github.com/users/LionsAd","html_url":"https://github.com/LionsAd","followers_url":"https://api.github.com/users/LionsAd/followers","following_url":"https://api.github.com/users/LionsAd/following{/other_user}","gists_url":"https://api.github.com/users/LionsAd/gists{/gist_id}","starred_url":"https://api.github.com/users/LionsAd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LionsAd/subscriptions","organizations_url":"https://api.github.com/users/LionsAd/orgs","repos_url":"https://api.github.com/users/LionsAd/repos","events_url":"https://api.github.com/users/LionsAd/events{/privacy}","received_events_url":"https://api.github.com/users/LionsAd/received_events","type":"User","site_admin":false},"body":"Listening to the init event introduced in https://github.com/composer/composer/commit/aeafe2fe59992efd1bc3f890b760f1a9c4874e1c actually does not work properly.\r\n\r\nComposer gives the following error:\r\n\r\n```\r\nPHP Fatal error:  Call to undefined method Composer\\EventDispatcher\\Event::getComposer() in /Users/ladmin/projects/oss/composer/src/Composer/EventDispatcher/EventDispatcher.php on line 294\r\nPHP Stack trace:\r\nPHP   1. {main}() /Users/ladmin/projects/oss/composer/bin/composer:0\r\nPHP   2. Composer\\Console\\Application->run() /Users/ladmin/projects/oss/composer/bin/composer:44\r\nPHP   3. Symfony\\Component\\Console\\Application->run() /Users/ladmin/projects/oss/composer/src/Composer/Console/Application.php:99\r\nPHP   4. Composer\\Console\\Application->doRun() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Application.php:123\r\nPHP   5. Symfony\\Component\\Console\\Application->doRun() /Users/ladmin/projects/oss/composer/src/Composer/Console/Application.php:197\r\nPHP   6. Symfony\\Component\\Console\\Application->doRunCommand() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Application.php:192\r\nPHP   7. Symfony\\Component\\Console\\Command\\Command->run() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Application.php:844\r\nPHP   8. Composer\\Command\\InstallCommand->execute() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Command/Command.php:259\r\nPHP   9. Composer\\Command\\BaseCommand->getComposer() /Users/ladmin/projects/oss/composer/src/Composer/Command/InstallCommand.php:84\r\nPHP  10. Composer\\Console\\Application->getComposer() /Users/ladmin/projects/oss/composer/src/Composer/Command/BaseCommand.php:53\r\nPHP  11. Composer\\Factory::create() /Users/ladmin/projects/oss/composer/src/Composer/Console/Application.php:275\r\nPHP  12. Composer\\Factory->createComposer() /Users/ladmin/projects/oss/composer/src/Composer/Factory.php:540\r\nPHP  13. Composer\\EventDispatcher\\EventDispatcher->dispatch() /Users/ladmin/projects/oss/composer/src/Composer/Factory.php:372\r\nPHP  14. Composer\\EventDispatcher\\EventDispatcher->doDispatch() /Users/ladmin/projects/oss/composer/src/Composer/EventDispatcher/EventDispatcher.php:80\r\nPHP  15. Composer\\EventDispatcher\\EventDispatcher->checkListenerExpectedEvent() /Users/ladmin/projects/oss/composer/src/Composer/EventDispatcher/EventDispatcher.php:169\r\n\r\nFatal error: Call to undefined method Composer\\EventDispatcher\\Event::getComposer() in /Users/ladmin/projects/oss/composer/src/Composer/EventDispatcher/EventDispatcher.php on line 294\r\n\r\nCall Stack:\r\n    0.0050     238968   1. {main}() /Users/ladmin/projects/oss/composer/bin/composer:0\r\n    0.1388    4171264   2. Composer\\Console\\Application->run() /Users/ladmin/projects/oss/composer/bin/composer:44\r\n    0.1516    4574472   3. Symfony\\Component\\Console\\Application->run() /Users/ladmin/projects/oss/composer/src/Composer/Console/Application.php:99\r\n    0.1555    4721144   4. Composer\\Console\\Application->doRun() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Application.php:123\r\n    0.1931    4931864   5. Symfony\\Component\\Console\\Application->doRun() /Users/ladmin/projects/oss/composer/src/Composer/Console/Application.php:197\r\n    0.1933    4932120   6. Symfony\\Component\\Console\\Application->doRunCommand() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Application.php:192\r\n    0.1933    4932720   7. Symfony\\Component\\Console\\Command\\Command->run() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Application.php:844\r\n    0.1950    4938640   8. Composer\\Command\\InstallCommand->execute() /Users/ladmin/projects/oss/composer/vendor/symfony/console/Command/Command.php:259\r\n    0.1950    4939904   9. Composer\\Command\\BaseCommand->getComposer() /Users/ladmin/projects/oss/composer/src/Composer/Command/InstallCommand.php:84\r\n    0.1950    4940024  10. Composer\\Console\\Application->getComposer() /Users/ladmin/projects/oss/composer/src/Composer/Command/BaseCommand.php:53\r\n    0.1950    4940312  11. Composer\\Factory::create() /Users/ladmin/projects/oss/composer/src/Composer/Console/Application.php:275\r\n    0.1950    4940440  12. Composer\\Factory->createComposer() /Users/ladmin/projects/oss/composer/src/Composer/Factory.php:540\r\n    0.7540   11705048  13. Composer\\EventDispatcher\\EventDispatcher->dispatch() /Users/ladmin/projects/oss/composer/src/Composer/Factory.php:372\r\n    0.7540   11705096  14. Composer\\EventDispatcher\\EventDispatcher->doDispatch() /Users/ladmin/projects/oss/composer/src/Composer/EventDispatcher/EventDispatcher.php:80\r\n    0.7545   11708368  15. Composer\\EventDispatcher\\EventDispatcher->checkListenerExpectedEvent() /Users/ladmin/projects/oss/composer/src/Composer/EventDispatcher/EventDispatcher.php:169\r\n```\r\n\r\nI am not sure if the fix is the correct one, however it makes sense to me. It is also useful for giving the plugins a chance to get the composer instance (which globally is at init stage not yet available).","created_at":"2016-04-23T18:04:32Z","updated_at":"2016-04-24T14:22:55Z","closed_at":"2016-04-24T14:22:55Z","merged_at":null,"merge_commit_sha":"8a28104dac9ebde2fc5f7078654c8ac86c053cc6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/composer/composer/pulls/5238/commits","review_comments_url":"https://api.github.com/repos/composer/composer/pulls/5238/comments","review_comment_url":"https://api.github.com/repos/composer/composer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/composer/composer/issues/5238/comments","statuses_url":"https://api.github.com/repos/composer/composer/statuses/defb8778787fbaabb464bb6946fe2ffb42f31b1d","head":{"label":"LionsAd:fix-init-event","ref":"fix-init-event","sha":"defb8778787fbaabb464bb6946fe2ffb42f31b1d","user":{"login":"LionsAd","id":354804,"avatar_url":"https://avatars.githubusercontent.com/u/354804?v=3","gravatar_id":"","url":"https://api.github.com/users/LionsAd","html_url":"https://github.com/LionsAd","followers_url":"https://api.github.com/users/LionsAd/followers","following_url":"https://api.github.com/users/LionsAd/following{/other_user}","gists_url":"https://api.github.com/users/LionsAd/gists{/gist_id}","starred_url":"https://api.github.com/users/LionsAd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LionsAd/subscriptions","organizations_url":"https://api.github.com/users/LionsAd/orgs","repos_url":"https://api.github.com/users/LionsAd/repos","events_url":"https://api.github.com/users/LionsAd/events{/privacy}","received_events_url":"https://api.github.com/users/LionsAd/received_events","type":"User","site_admin":false},"repo":{"id":56932637,"name":"composer","full_name":"LionsAd/composer","owner":{"login":"LionsAd","id":354804,"avatar_url":"https://avatars.githubusercontent.com/u/354804?v=3","gravatar_id":"","url":"https://api.github.com/users/LionsAd","html_url":"https://github.com/LionsAd","followers_url":"https://api.github.com/users/LionsAd/followers","following_url":"https://api.github.com/users/LionsAd/following{/other_user}","gists_url":"https://api.github.com/users/LionsAd/gists{/gist_id}","starred_url":"https://api.github.com/users/LionsAd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LionsAd/subscriptions","organizations_url":"https://api.github.com/users/LionsAd/orgs","repos_url":"https://api.github.com/users/LionsAd/repos","events_url":"https://api.github.com/users/LionsAd/events{/privacy}","received_events_url":"https://api.github.com/users/LionsAd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LionsAd/composer","description":"Dependency Manager for PHP","fork":true,"url":"https://api.github.com/repos/LionsAd/composer","forks_url":"https://api.github.com/repos/LionsAd/composer/forks","keys_url":"https://api.github.com/repos/LionsAd/composer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LionsAd/composer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LionsAd/composer/teams","hooks_url":"https://api.github.com/repos/LionsAd/composer/hooks","issue_events_url":"https://api.github.com/repos/LionsAd/composer/issues/events{/number}","events_url":"https://api.github.com/repos/LionsAd/composer/events","assignees_url":"https://api.github.com/repos/LionsAd/composer/assignees{/user}","branches_url":"https://api.github.com/repos/LionsAd/composer/branches{/branch}","tags_url":"https://api.github.com/repos/LionsAd/composer/tags","blobs_url":"https://api.github.com/repos/LionsAd/composer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LionsAd/composer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LionsAd/composer/git/refs{/sha}","trees_url":"https://api.github.com/repos/LionsAd/composer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LionsAd/composer/statuses/{sha}","languages_url":"https://api.github.com/repos/LionsAd/composer/languages","stargazers_url":"https://api.github.com/repos/LionsAd/composer/stargazers","contributors_url":"https://api.github.com/repos/LionsAd/composer/contributors","subscribers_url":"https://api.github.com/repos/LionsAd/composer/subscribers","subscription_url":"https://api.github.com/repos/LionsAd/composer/subscription","commits_url":"https://api.github.com/repos/LionsAd/composer/commits{/sha}","git_commits_url":"https://api.github.com/repos/LionsAd/composer/git/commits{/sha}","comments_url":"https://api.github.com/repos/LionsAd/composer/comments{/number}","issue_comment_url":"https://api.github.com/repos/LionsAd/composer/issues/comments{/number}","contents_url":"https://api.github.com/repos/LionsAd/composer/contents/{+path}","compare_url":"https://api.github.com/repos/LionsAd/composer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LionsAd/composer/merges","archive_url":"https://api.github.com/repos/LionsAd/composer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LionsAd/composer/downloads","issues_url":"https://api.github.com/repos/LionsAd/composer/issues{/number}","pulls_url":"https://api.github.com/repos/LionsAd/composer/pulls{/number}","milestones_url":"https://api.github.com/repos/LionsAd/composer/milestones{/number}","notifications_url":"https://api.github.com/repos/LionsAd/composer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LionsAd/composer/labels{/name}","releases_url":"https://api.github.com/repos/LionsAd/composer/releases{/id}","deployments_url":"https://api.github.com/repos/LionsAd/composer/deployments","created_at":"2016-04-23T17:45:21Z","updated_at":"2016-04-23T17:45:24Z","pushed_at":"2016-04-23T17:46:08Z","git_url":"git://github.com/LionsAd/composer.git","ssh_url":"git@github.com:LionsAd/composer.git","clone_url":"https://github.com/LionsAd/composer.git","svn_url":"https://github.com/LionsAd/composer","homepage":"https://getcomposer.org/","size":12153,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"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":"1.0"}},"base":{"label":"composer:master","ref":"master","sha":"ac75680b1e58ebd0625d8de2940cecc5d0349ed9","user":{"login":"composer","id":837015,"avatar_url":"https://avatars.githubusercontent.com/u/837015?v=3","gravatar_id":"","url":"https://api.github.com/users/composer","html_url":"https://github.com/composer","followers_url":"https://api.github.com/users/composer/followers","following_url":"https://api.github.com/users/composer/following{/other_user}","gists_url":"https://api.github.com/users/composer/gists{/gist_id}","starred_url":"https://api.github.com/users/composer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/composer/subscriptions","organizations_url":"https://api.github.com/users/composer/orgs","repos_url":"https://api.github.com/users/composer/repos","events_url":"https://api.github.com/users/composer/events{/privacy}","received_events_url":"https://api.github.com/users/composer/received_events","type":"Organization","site_admin":false},"repo":{"id":1864363,"name":"composer","full_name":"composer/composer","owner":{"login":"composer","id":837015,"avatar_url":"https://avatars.githubusercontent.com/u/837015?v=3","gravatar_id":"","url":"https://api.github.com/users/composer","html_url":"https://github.com/composer","followers_url":"https://api.github.com/users/composer/followers","following_url":"https://api.github.com/users/composer/following{/other_user}","gists_url":"https://api.github.com/users/composer/gists{/gist_id}","starred_url":"https://api.github.com/users/composer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/composer/subscriptions","organizations_url":"https://api.github.com/users/composer/orgs","repos_url":"https://api.github.com/users/composer/repos","events_url":"https://api.github.com/users/composer/events{/privacy}","received_events_url":"https://api.github.com/users/composer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/composer/composer","description":"Dependency Manager for PHP","fork":false,"url":"https://api.github.com/repos/composer/composer","forks_url":"https://api.github.com/repos/composer/composer/forks","keys_url":"https://api.github.com/repos/composer/composer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/composer/composer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/composer/composer/teams","hooks_url":"https://api.github.com/repos/composer/composer/hooks","issue_events_url":"https://api.github.com/repos/composer/composer/issues/events{/number}","events_url":"https://api.github.com/repos/composer/composer/events","assignees_url":"https://api.github.com/repos/composer/composer/assignees{/user}","branches_url":"https://api.github.com/repos/composer/composer/branches{/branch}","tags_url":"https://api.github.com/repos/composer/composer/tags","blobs_url":"https://api.github.com/repos/composer/composer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/composer/composer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/composer/composer/git/refs{/sha}","trees_url":"https://api.github.com/repos/composer/composer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/composer/composer/statuses/{sha}","languages_url":"https://api.github.com/repos/composer/composer/languages","stargazers_url":"https://api.github.com/repos/composer/composer/stargazers","contributors_url":"https://api.github.com/repos/composer/composer/contributors","subscribers_url":"https://api.github.com/repos/composer/composer/subscribers","subscription_url":"https://api.github.com/repos/composer/composer/subscription","commits_url":"https://api.github.com/repos/composer/composer/commits{/sha}","git_commits_url":"https://api.github.com/repos/composer/composer/git/commits{/sha}","comments_url":"https://api.github.com/repos/composer/composer/comments{/number}","issue_comment_url":"https://api.github.com/repos/composer/composer/issues/comments{/number}","contents_url":"https://api.github.com/repos/composer/composer/contents/{+path}","compare_url":"https://api.github.com/repos/composer/composer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/composer/composer/merges","archive_url":"https://api.github.com/repos/composer/composer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/composer/composer/downloads","issues_url":"https://api.github.com/repos/composer/composer/issues{/number}","pulls_url":"https://api.github.com/repos/composer/composer/pulls{/number}","milestones_url":"https://api.github.com/repos/composer/composer/milestones{/number}","notifications_url":"https://api.github.com/repos/composer/composer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/composer/composer/labels{/name}","releases_url":"https://api.github.com/repos/composer/composer/releases{/id}","deployments_url":"https://api.github.com/repos/composer/composer/deployments","created_at":"2011-06-08T08:53:00Z","updated_at":"2016-04-24T12:19:22Z","pushed_at":"2016-04-24T14:17:14Z","git_url":"git://github.com/composer/composer.git","ssh_url":"git@github.com:composer/composer.git","clone_url":"https://github.com/composer/composer.git","svn_url":"https://github.com/composer/composer","homepage":"https://getcomposer.org/","size":23711,"stargazers_count":7571,"watchers_count":7571,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2088,"mirror_url":null,"open_issues_count":130,"forks":2088,"open_issues":130,"watchers":7571,"default_branch":"1.0"}},"_links":{"self":{"href":"https://api.github.com/repos/composer/composer/pulls/5238"},"html":{"href":"https://github.com/composer/composer/pull/5238"},"issue":{"href":"https://api.github.com/repos/composer/composer/issues/5238"},"comments":{"href":"https://api.github.com/repos/composer/composer/issues/5238/comments"},"review_comments":{"href":"https://api.github.com/repos/composer/composer/pulls/5238/comments"},"review_comment":{"href":"https://api.github.com/repos/composer/composer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/composer/composer/pulls/5238/commits"},"statuses":{"href":"https://api.github.com/repos/composer/composer/statuses/defb8778787fbaabb464bb6946fe2ffb42f31b1d"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":3,"review_comments":0,"commits":1,"additions":1,"deletions":2,"changed_files":1}}