{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/5046","repository_url":"https://api.github.com/repos/composer/composer","labels_url":"https://api.github.com/repos/composer/composer/issues/5046/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/5046/comments","events_url":"https://api.github.com/repos/composer/composer/issues/5046/events","html_url":"https://github.com/composer/composer/issues/5046","id":140180477,"number":5046,"title":"Shared packages [question]","user":{"login":"andrewtch","id":925330,"avatar_url":"https://avatars.githubusercontent.com/u/925330?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewtch","html_url":"https://github.com/andrewtch","followers_url":"https://api.github.com/users/andrewtch/followers","following_url":"https://api.github.com/users/andrewtch/following{/other_user}","gists_url":"https://api.github.com/users/andrewtch/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewtch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewtch/subscriptions","organizations_url":"https://api.github.com/users/andrewtch/orgs","repos_url":"https://api.github.com/users/andrewtch/repos","events_url":"https://api.github.com/users/andrewtch/events{/privacy}","received_events_url":"https://api.github.com/users/andrewtch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/composer/composer/labels/Question","name":"Question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-03-11T13:15:06Z","updated_at":"2016-03-15T14:30:34Z","closed_at":"2016-03-15T10:42:33Z","body":"Well, this is a bit of philosophical question, but it comes from live environment. Imagine a server, hosting multiple versions of the same app. The apps have dependencies, like so:\r\n\r\n```\r\n/var/www/app1.1/\r\n/var/www/app1.1/vendor/depencency_a1.3\r\n/var/www/app1.1/vendor/depencency_b1.0\r\n/var/www/app1.1/vendor/depencency_c2.7\r\n\r\n/var/www/app1.2/\r\n/var/www/app1.2/vendor/depencency_a1.3\r\n/var/www/app1.2/vendor/depencency_b1.1\r\n/var/www/app1.2/vendor/depencency_c2.8\r\n\r\n/var/www/app2.0/\r\n/var/www/app2.0/vendor/depencency_a2.0\r\n/var/www/app2.0/vendor/depencency_bdev-master\r\n/var/www/app2.0/vendor/depencency_c2.9\r\n```\r\n\r\nThe problem is that Opcache has waaaay to may vendors, and is basically going mad and not working. Is there any possibility (googled, didn't find) to make composer install vendors like that:\r\n\r\n```\r\n/var/www/vendors\r\n/var/www/vendors/dependency_a\r\n/var/www/vendors/dependency_a/1.3\r\n/var/www/vendors/dependency_a/2.0\r\n/var/www/vendors/depencency_b/1.0\r\n/var/www/vendors/depencency_b/1.1\r\n/var/www/vendors/depencency_b/dev-master\r\n\r\n/var/www/app2.0/\r\n/var/www/app2.0/vendor/autoload.php (with links to needed direcotries).\r\n```\r\n\r\nOf course, vendors are never uninstalled in this case, but this is a minor issue.\r\n\r\nCan this be implemented without major composer rewrite?"},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/196845833","html_url":"https://github.com/composer/composer/issues/5046#issuecomment-196845833","issue_url":"https://api.github.com/repos/composer/composer/issues/5046","id":196845833,"user":{"login":"curry684","id":1455673,"avatar_url":"https://avatars.githubusercontent.com/u/1455673?v=3","gravatar_id":"","url":"https://api.github.com/users/curry684","html_url":"https://github.com/curry684","followers_url":"https://api.github.com/users/curry684/followers","following_url":"https://api.github.com/users/curry684/following{/other_user}","gists_url":"https://api.github.com/users/curry684/gists{/gist_id}","starred_url":"https://api.github.com/users/curry684/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curry684/subscriptions","organizations_url":"https://api.github.com/users/curry684/orgs","repos_url":"https://api.github.com/users/curry684/repos","events_url":"https://api.github.com/users/curry684/events{/privacy}","received_events_url":"https://api.github.com/users/curry684/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T14:30:34Z","updated_at":"2016-03-15T14:30:34Z","body":"```sh\r\nmkdir -p /var/dependencies/app1.1\r\ncd /var/dependencies/app1.1\r\ncomposer require symfony/symfony:2.7.1\r\n```\r\n\r\n```php\r\n$config = json_decode(file_get_contents('/var/dependencies/app1.1/composer.json'));\r\n$config['repositories'] = [\r\n    \"type\" => \"path\",\r\n    \"url\" => \"/var/dependencies/app1.1/vendor/*/*\",\r\n];\r\nfile_put_contents('/var/dependencies/app.1.1.json', json_encode($config));\r\n```\r\nAnd now in all 1000 folders:\r\n```sh\r\nln -s /var/dependencies/app.1.1.json composer.json && composer install\r\n```\r\n\r\n"}}