{"action":"created","comment":{"url":"https://api.github.com/repos/sensiolabs/melody/pulls/comments/22493266","id":22493266,"diff_hunk":"@@ -79,6 +79,14 @@ public function getVendorDir()\n         return end($outputByLines);\n     }\n \n+    public function configureRepositories(array $repositories, $dir)\n+    {\n+        if (!empty($repositories)) {\n+            $composerJsonPath = $dir . '/composer.json';\n+            file_put_contents($composerJsonPath, json_encode(array('repositories' => $repositories)));","path":"src/SensioLabs/Melody/Composer/Composer.php","position":8,"original_position":8,"commit_id":"d2857d18704d3aada0199aa18cf19dfca61f8657","original_commit_id":"10a7b40756d6f2afba5410a65a2223bcdec17148","user":{"login":"jeremy-derusse","id":578547,"avatar_url":"https://avatars.githubusercontent.com/u/578547?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremy-derusse","html_url":"https://github.com/jeremy-derusse","followers_url":"https://api.github.com/users/jeremy-derusse/followers","following_url":"https://api.github.com/users/jeremy-derusse/following{/other_user}","gists_url":"https://api.github.com/users/jeremy-derusse/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremy-derusse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremy-derusse/subscriptions","organizations_url":"https://api.github.com/users/jeremy-derusse/orgs","repos_url":"https://api.github.com/users/jeremy-derusse/repos","events_url":"https://api.github.com/users/jeremy-derusse/events{/privacy}","received_events_url":"https://api.github.com/users/jeremy-derusse/received_events","type":"User","site_admin":false},"body":"reply to my self, yes, I really think we should generate the whole composer.json (repositories and packages) and then run a `composer update` instead of `composer require ...`\r\n\r\nBTW, the generated composer.json could be used to calculate the WorkingDirectory uniqueness","created_at":"2015-01-05T22:03:12Z","updated_at":"2015-01-05T22:03:12Z","html_url":"https://github.com/sensiolabs/melody/pull/38#discussion_r22493266","pull_request_url":"https://api.github.com/repos/sensiolabs/melody/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/sensiolabs/melody/pulls/comments/22493266"},"html":{"href":"https://github.com/sensiolabs/melody/pull/38#discussion_r22493266"},"pull_request":{"href":"https://api.github.com/repos/sensiolabs/melody/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/sensiolabs/melody/pulls/38","id":26697486,"html_url":"https://github.com/sensiolabs/melody/pull/38","diff_url":"https://github.com/sensiolabs/melody/pull/38.diff","patch_url":"https://github.com/sensiolabs/melody/pull/38.patch","issue_url":"https://api.github.com/repos/sensiolabs/melody/issues/38","number":38,"state":"open","locked":false,"title":"Add composer repositories configuration","user":{"login":"aaa2000","id":163941,"avatar_url":"https://avatars.githubusercontent.com/u/163941?v=3","gravatar_id":"","url":"https://api.github.com/users/aaa2000","html_url":"https://github.com/aaa2000","followers_url":"https://api.github.com/users/aaa2000/followers","following_url":"https://api.github.com/users/aaa2000/following{/other_user}","gists_url":"https://api.github.com/users/aaa2000/gists{/gist_id}","starred_url":"https://api.github.com/users/aaa2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaa2000/subscriptions","organizations_url":"https://api.github.com/users/aaa2000/orgs","repos_url":"https://api.github.com/users/aaa2000/repos","events_url":"https://api.github.com/users/aaa2000/events{/privacy}","received_events_url":"https://api.github.com/users/aaa2000/received_events","type":"User","site_admin":false},"body":"It is a PR for #36.\r\n\r\nWith this PR, it is possible to use fork, private or local repositories (local maybe not useful). \r\n\r\n```php\r\n<<<CONFIG\r\nrepositories:\r\n    - type: vcs\r\n      url: https://github.com/fabpot/Pimple\r\npackages:\r\n    - \"pimple/pimple: 1.0.2\"\r\n```\r\n\r\nIn the implementation, I would have preferred to use the CLI composer to add a repository but without composer.json, composer throws an exception.\r\n```\r\ncomposer config repositories.pimple vcs https://github.com/fabpot/Pimple\r\n[RuntimeException]                               \r\nNo composer.json found in the current directory \r\n```\r\n","created_at":"2014-12-30T18:40:11Z","updated_at":"2015-01-05T22:03:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7a7378d28a5dc0e57b66553867513182164dea0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sensiolabs/melody/pulls/38/commits","review_comments_url":"https://api.github.com/repos/sensiolabs/melody/pulls/38/comments","review_comment_url":"https://api.github.com/repos/sensiolabs/melody/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sensiolabs/melody/issues/38/comments","statuses_url":"https://api.github.com/repos/sensiolabs/melody/statuses/d2857d18704d3aada0199aa18cf19dfca61f8657","head":{"label":"aaa2000:fork-repository","ref":"fork-repository","sha":"d2857d18704d3aada0199aa18cf19dfca61f8657","user":{"login":"aaa2000","id":163941,"avatar_url":"https://avatars.githubusercontent.com/u/163941?v=3","gravatar_id":"","url":"https://api.github.com/users/aaa2000","html_url":"https://github.com/aaa2000","followers_url":"https://api.github.com/users/aaa2000/followers","following_url":"https://api.github.com/users/aaa2000/following{/other_user}","gists_url":"https://api.github.com/users/aaa2000/gists{/gist_id}","starred_url":"https://api.github.com/users/aaa2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaa2000/subscriptions","organizations_url":"https://api.github.com/users/aaa2000/orgs","repos_url":"https://api.github.com/users/aaa2000/repos","events_url":"https://api.github.com/users/aaa2000/events{/privacy}","received_events_url":"https://api.github.com/users/aaa2000/received_events","type":"User","site_admin":false},"repo":{"id":28270779,"name":"melody","full_name":"aaa2000/melody","owner":{"login":"aaa2000","id":163941,"avatar_url":"https://avatars.githubusercontent.com/u/163941?v=3","gravatar_id":"","url":"https://api.github.com/users/aaa2000","html_url":"https://github.com/aaa2000","followers_url":"https://api.github.com/users/aaa2000/followers","following_url":"https://api.github.com/users/aaa2000/following{/other_user}","gists_url":"https://api.github.com/users/aaa2000/gists{/gist_id}","starred_url":"https://api.github.com/users/aaa2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaa2000/subscriptions","organizations_url":"https://api.github.com/users/aaa2000/orgs","repos_url":"https://api.github.com/users/aaa2000/repos","events_url":"https://api.github.com/users/aaa2000/events{/privacy}","received_events_url":"https://api.github.com/users/aaa2000/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aaa2000/melody","description":"One-file composer scripts","fork":true,"url":"https://api.github.com/repos/aaa2000/melody","forks_url":"https://api.github.com/repos/aaa2000/melody/forks","keys_url":"https://api.github.com/repos/aaa2000/melody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aaa2000/melody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aaa2000/melody/teams","hooks_url":"https://api.github.com/repos/aaa2000/melody/hooks","issue_events_url":"https://api.github.com/repos/aaa2000/melody/issues/events{/number}","events_url":"https://api.github.com/repos/aaa2000/melody/events","assignees_url":"https://api.github.com/repos/aaa2000/melody/assignees{/user}","branches_url":"https://api.github.com/repos/aaa2000/melody/branches{/branch}","tags_url":"https://api.github.com/repos/aaa2000/melody/tags","blobs_url":"https://api.github.com/repos/aaa2000/melody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aaa2000/melody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aaa2000/melody/git/refs{/sha}","trees_url":"https://api.github.com/repos/aaa2000/melody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aaa2000/melody/statuses/{sha}","languages_url":"https://api.github.com/repos/aaa2000/melody/languages","stargazers_url":"https://api.github.com/repos/aaa2000/melody/stargazers","contributors_url":"https://api.github.com/repos/aaa2000/melody/contributors","subscribers_url":"https://api.github.com/repos/aaa2000/melody/subscribers","subscription_url":"https://api.github.com/repos/aaa2000/melody/subscription","commits_url":"https://api.github.com/repos/aaa2000/melody/commits{/sha}","git_commits_url":"https://api.github.com/repos/aaa2000/melody/git/commits{/sha}","comments_url":"https://api.github.com/repos/aaa2000/melody/comments{/number}","issue_comment_url":"https://api.github.com/repos/aaa2000/melody/issues/comments/{number}","contents_url":"https://api.github.com/repos/aaa2000/melody/contents/{+path}","compare_url":"https://api.github.com/repos/aaa2000/melody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aaa2000/melody/merges","archive_url":"https://api.github.com/repos/aaa2000/melody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aaa2000/melody/downloads","issues_url":"https://api.github.com/repos/aaa2000/melody/issues{/number}","pulls_url":"https://api.github.com/repos/aaa2000/melody/pulls{/number}","milestones_url":"https://api.github.com/repos/aaa2000/melody/milestones{/number}","notifications_url":"https://api.github.com/repos/aaa2000/melody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aaa2000/melody/labels{/name}","releases_url":"https://api.github.com/repos/aaa2000/melody/releases{/id}","created_at":"2014-12-20T15:33:38Z","updated_at":"2014-12-20T15:33:39Z","pushed_at":"2015-01-04T21:13:15Z","git_url":"git://github.com/aaa2000/melody.git","ssh_url":"git@github.com:aaa2000/melody.git","clone_url":"https://github.com/aaa2000/melody.git","svn_url":"https://github.com/aaa2000/melody","homepage":"http://melody.sensiolabs.org/","size":188,"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":"master"}},"base":{"label":"sensiolabs:master","ref":"master","sha":"2a57fa4dd18f404b061f9a75d25f65bbdb86d8e2","user":{"login":"sensiolabs","id":1780787,"avatar_url":"https://avatars.githubusercontent.com/u/1780787?v=3","gravatar_id":"","url":"https://api.github.com/users/sensiolabs","html_url":"https://github.com/sensiolabs","followers_url":"https://api.github.com/users/sensiolabs/followers","following_url":"https://api.github.com/users/sensiolabs/following{/other_user}","gists_url":"https://api.github.com/users/sensiolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/sensiolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensiolabs/subscriptions","organizations_url":"https://api.github.com/users/sensiolabs/orgs","repos_url":"https://api.github.com/users/sensiolabs/repos","events_url":"https://api.github.com/users/sensiolabs/events{/privacy}","received_events_url":"https://api.github.com/users/sensiolabs/received_events","type":"Organization","site_admin":false},"repo":{"id":27604816,"name":"melody","full_name":"sensiolabs/melody","owner":{"login":"sensiolabs","id":1780787,"avatar_url":"https://avatars.githubusercontent.com/u/1780787?v=3","gravatar_id":"","url":"https://api.github.com/users/sensiolabs","html_url":"https://github.com/sensiolabs","followers_url":"https://api.github.com/users/sensiolabs/followers","following_url":"https://api.github.com/users/sensiolabs/following{/other_user}","gists_url":"https://api.github.com/users/sensiolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/sensiolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensiolabs/subscriptions","organizations_url":"https://api.github.com/users/sensiolabs/orgs","repos_url":"https://api.github.com/users/sensiolabs/repos","events_url":"https://api.github.com/users/sensiolabs/events{/privacy}","received_events_url":"https://api.github.com/users/sensiolabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sensiolabs/melody","description":"One-file composer scripts","fork":false,"url":"https://api.github.com/repos/sensiolabs/melody","forks_url":"https://api.github.com/repos/sensiolabs/melody/forks","keys_url":"https://api.github.com/repos/sensiolabs/melody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sensiolabs/melody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sensiolabs/melody/teams","hooks_url":"https://api.github.com/repos/sensiolabs/melody/hooks","issue_events_url":"https://api.github.com/repos/sensiolabs/melody/issues/events{/number}","events_url":"https://api.github.com/repos/sensiolabs/melody/events","assignees_url":"https://api.github.com/repos/sensiolabs/melody/assignees{/user}","branches_url":"https://api.github.com/repos/sensiolabs/melody/branches{/branch}","tags_url":"https://api.github.com/repos/sensiolabs/melody/tags","blobs_url":"https://api.github.com/repos/sensiolabs/melody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sensiolabs/melody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sensiolabs/melody/git/refs{/sha}","trees_url":"https://api.github.com/repos/sensiolabs/melody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sensiolabs/melody/statuses/{sha}","languages_url":"https://api.github.com/repos/sensiolabs/melody/languages","stargazers_url":"https://api.github.com/repos/sensiolabs/melody/stargazers","contributors_url":"https://api.github.com/repos/sensiolabs/melody/contributors","subscribers_url":"https://api.github.com/repos/sensiolabs/melody/subscribers","subscription_url":"https://api.github.com/repos/sensiolabs/melody/subscription","commits_url":"https://api.github.com/repos/sensiolabs/melody/commits{/sha}","git_commits_url":"https://api.github.com/repos/sensiolabs/melody/git/commits{/sha}","comments_url":"https://api.github.com/repos/sensiolabs/melody/comments{/number}","issue_comment_url":"https://api.github.com/repos/sensiolabs/melody/issues/comments/{number}","contents_url":"https://api.github.com/repos/sensiolabs/melody/contents/{+path}","compare_url":"https://api.github.com/repos/sensiolabs/melody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sensiolabs/melody/merges","archive_url":"https://api.github.com/repos/sensiolabs/melody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sensiolabs/melody/downloads","issues_url":"https://api.github.com/repos/sensiolabs/melody/issues{/number}","pulls_url":"https://api.github.com/repos/sensiolabs/melody/pulls{/number}","milestones_url":"https://api.github.com/repos/sensiolabs/melody/milestones{/number}","notifications_url":"https://api.github.com/repos/sensiolabs/melody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sensiolabs/melody/labels{/name}","releases_url":"https://api.github.com/repos/sensiolabs/melody/releases{/id}","created_at":"2014-12-05T18:37:58Z","updated_at":"2015-01-05T15:28:13Z","pushed_at":"2015-01-05T15:28:16Z","git_url":"git://github.com/sensiolabs/melody.git","ssh_url":"git@github.com:sensiolabs/melody.git","clone_url":"https://github.com/sensiolabs/melody.git","svn_url":"https://github.com/sensiolabs/melody","homepage":"http://melody.sensiolabs.org/","size":801,"stargazers_count":190,"watchers_count":190,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":9,"forks":13,"open_issues":9,"watchers":190,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sensiolabs/melody/pulls/38"},"html":{"href":"https://github.com/sensiolabs/melody/pull/38"},"issue":{"href":"https://api.github.com/repos/sensiolabs/melody/issues/38"},"comments":{"href":"https://api.github.com/repos/sensiolabs/melody/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/sensiolabs/melody/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/sensiolabs/melody/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sensiolabs/melody/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/sensiolabs/melody/statuses/d2857d18704d3aada0199aa18cf19dfca61f8657"}}}}