{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/4354","labels_url":"https://api.github.com/repos/composer/composer/issues/4354/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/4354/comments","events_url":"https://api.github.com/repos/composer/composer/issues/4354/events","html_url":"https://github.com/composer/composer/issues/4354","id":100528014,"number":4354,"title":"Multiple private composer repositories for redundancy purposes","user":{"login":"P0rnflake","id":9717287,"avatar_url":"https://avatars.githubusercontent.com/u/9717287?v=3","gravatar_id":"","url":"https://api.github.com/users/P0rnflake","html_url":"https://github.com/P0rnflake","followers_url":"https://api.github.com/users/P0rnflake/followers","following_url":"https://api.github.com/users/P0rnflake/following{/other_user}","gists_url":"https://api.github.com/users/P0rnflake/gists{/gist_id}","starred_url":"https://api.github.com/users/P0rnflake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P0rnflake/subscriptions","organizations_url":"https://api.github.com/users/P0rnflake/orgs","repos_url":"https://api.github.com/users/P0rnflake/repos","events_url":"https://api.github.com/users/P0rnflake/events{/privacy}","received_events_url":"https://api.github.com/users/P0rnflake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-08-12T12:09:33Z","updated_at":"2015-08-14T09:48:57Z","closed_at":null,"body":"Hi,\r\n\r\nI am wondering whether it is possible to define multiple repositories of the type \"composer\" to provide an easy way to support development and productive satis servers.\r\n\r\nIn my case I have two satis repository servers (dev-repo.company.com & prod-repo.company.com) which should be used in each of our composer.json like this:\r\n```\r\n...\r\n    \"repositories\": [\r\n        { \"packagist\": false },\r\n        { \"type\": \"composer\", \"url\": \"http://dev-repo.company.com/\" },\r\n        { \"type\": \"composer\", \"url\": \"http://prod-repo.company.com/\" }\r\n    ],\r\n    \"require\": {\r\n        \"php\": \">=5.5\",\r\n        \"company/samplelib\": \"1.0.0\"\r\n    }\r\n...\r\n```\r\n\r\nOur dev/staging team has only access to dev-repo.company.com and they can update it by their own.\r\nThe same applies for the distribution team for the productive repository server.\r\n\r\nMy problem is that it depends on the machine where the application is installed whether one or the other server is reachable - both provide more or less the same packages only that the productive server should archive everything, even dev versions.\r\n\r\nCurrently I am facing the issue that if one of the repository servers is not reachable by the machine there is an exception like this:\r\n```\r\n[Composer\\Downloader\\TransportException]                                     \r\n  The \"http://prod-repo.company.com/packages.json\" file could not be downloade  \r\n  d: php_network_getaddresses: getaddrinfo failed: Name or service not known   \r\n  failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known  \r\n```\r\n\r\nAnother  problem I think I could face is that the composer.lock files are generated during development of the application so the referenced repository will probably be the dev-repo server.\r\n\r\nIs there any possible configuration to achieve the described scenario, maybe by defining one meta repository with multiple urls which will be checked by priority?\r\n\r\nNotice: In our case is not possible to define just one repository url and decide by routing which server should be used."},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/131052758","html_url":"https://github.com/composer/composer/issues/4354#issuecomment-131052758","issue_url":"https://api.github.com/repos/composer/composer/issues/4354","id":131052758,"user":{"login":"P0rnflake","id":9717287,"avatar_url":"https://avatars.githubusercontent.com/u/9717287?v=3","gravatar_id":"","url":"https://api.github.com/users/P0rnflake","html_url":"https://github.com/P0rnflake","followers_url":"https://api.github.com/users/P0rnflake/followers","following_url":"https://api.github.com/users/P0rnflake/following{/other_user}","gists_url":"https://api.github.com/users/P0rnflake/gists{/gist_id}","starred_url":"https://api.github.com/users/P0rnflake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P0rnflake/subscriptions","organizations_url":"https://api.github.com/users/P0rnflake/orgs","repos_url":"https://api.github.com/users/P0rnflake/repos","events_url":"https://api.github.com/users/P0rnflake/events{/privacy}","received_events_url":"https://api.github.com/users/P0rnflake/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T09:48:57Z","updated_at":"2015-08-14T09:48:57Z","body":"@stof maybe the idea behind that was, that the repository itself \"could\" overwrite each package mirror config by a global repository specific mirrors config. I am currently testing it with the repository mirror configuration. Keeping you up to date..."}}