{"action":"opened","issue":{"url":"https://api.github.com/repos/composer/composer/issues/4250","labels_url":"https://api.github.com/repos/composer/composer/issues/4250/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/4250/comments","events_url":"https://api.github.com/repos/composer/composer/issues/4250/events","html_url":"https://github.com/composer/composer/issues/4250","id":94734397,"number":4250,"title":"Inconsistent replace behavior","user":{"login":"astehlik","id":956513,"avatar_url":"https://avatars.githubusercontent.com/u/956513?v=3","gravatar_id":"","url":"https://api.github.com/users/astehlik","html_url":"https://github.com/astehlik","followers_url":"https://api.github.com/users/astehlik/followers","following_url":"https://api.github.com/users/astehlik/following{/other_user}","gists_url":"https://api.github.com/users/astehlik/gists{/gist_id}","starred_url":"https://api.github.com/users/astehlik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astehlik/subscriptions","organizations_url":"https://api.github.com/users/astehlik/orgs","repos_url":"https://api.github.com/users/astehlik/repos","events_url":"https://api.github.com/users/astehlik/events{/privacy}","received_events_url":"https://api.github.com/users/astehlik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-13T14:28:41Z","updated_at":"2015-07-13T14:28:41Z","closed_at":null,"body":"This behavior of composer seems wrong to me:\r\n\r\nGiven I need two libraries in my project:\r\n\r\n```json\r\n{\r\n    \"name\": \"vendor/myproject\",\r\n    \"type\": \"project\",\r\n\t\"require\": {\r\n\t\t\"vendor/lib-dependency\": \"*\",\r\n\t\t\"vendor/lib-depends\": \"*\",\r\n\t}\r\n}\r\n\r\n```\r\n\r\nThe package ```vendor/lib-depends``` depends on a library, that is replaced by ```vendor/lib-dependency```. The ```composer.json``` of ```vendor/lib-dependency``` looks like this:\r\n\r\n```json\r\n{\r\n\t\"name\": \"vendor/lib-dependency\",\r\n\t\"type\": \"library\",\r\n\t\"replace\": {\r\n\t\t\"vendor-original/lib-dependency\": \"self.version\"\r\n\t}\r\n}\r\n```\r\n\r\nThe ```composer.json``` file of ```vendor/lib-depends``` looks like this:\r\n\r\n```json\r\n{\r\n\t\"name\": \"vendor/lib-depends\",\r\n\t\"type\": \"library\",\r\n\t\"require\": {\r\n\t\t\"vendor-original/lib-dependency\": \">=1.0.0\"\r\n\t}\r\n}\r\n```\r\n\r\nThe ```vendor-original/lib-dependency``` package is **not available at any repository**.\r\n\r\nWhen I run a ```composer update``` with this I get an dependency error because no matching package is found for ```vendor-original/lib-dependency```.\r\n\r\nWhen I follow these steps, I can install the package:\r\n\r\n1. Remove the dependency for ```vendor/lib-depends```\r\n2. Run ```composer update``` (the package ```vendor/lib-dependency``` is installed without problems)\r\n3. Add the dependency for ```vendor/lib-depends```\r\n4. Run ```composer update``` again, now no dependency error occurs.\r\n\r\nI would expect composer to resolve the replace configuration of all packages that should be installed. Not only of the installed packages."}}