{"action":"created","comment":{"url":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/comments/362764052","pull_request_review_id":338022595,"id":362764052,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2Mjc2NDA1Mg==","diff_hunk":"@@ -5,25 +5,31 @@\n use League\\Flysystem\\FileNotFoundException;\n use League\\Flysystem\\FilesystemInterface;\n use League\\Flysystem\\MountManager;\n+use Psr\\Container\\ContainerInterface;\n use Symfony\\Component\\HttpFoundation\\File\\UploadedFile;\n use Vich\\UploaderBundle\\Mapping\\PropertyMapping;\n use Vich\\UploaderBundle\\Mapping\\PropertyMappingFactory;\n \n /**\n  * @author Markus Bachmann <markus.bachmann@bachi.biz>\n+ * @author Titouan Galopin <galopintitouan@gmail.com>\n  */\n class FlysystemStorage extends AbstractStorage\n {\n     /**\n-     * @var MountManager Flysystem mount manager\n+     * @var MountManager|ContainerInterface a registry to get FilesystemInterface instances\n      */\n-    protected $mountManager;\n+    protected $registry;\n \n-    public function __construct(PropertyMappingFactory $factory, MountManager $mountManager)\n+    public function __construct(PropertyMappingFactory $factory, $registry)","path":"src/Storage/FlysystemStorage.php","position":23,"original_position":23,"commit_id":"a9a535d418a341b5e29dd36f0de7f3b2038fe514","original_commit_id":"2182cbfcef5a4ed3635e98af3b7fb3cad8e29507","user":{"login":"tgalopin","id":1651494,"node_id":"MDQ6VXNlcjE2NTE0OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1651494?v=4","gravatar_id":"","url":"https://api.github.com/users/tgalopin","html_url":"https://github.com/tgalopin","followers_url":"https://api.github.com/users/tgalopin/followers","following_url":"https://api.github.com/users/tgalopin/following{/other_user}","gists_url":"https://api.github.com/users/tgalopin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgalopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgalopin/subscriptions","organizations_url":"https://api.github.com/users/tgalopin/orgs","repos_url":"https://api.github.com/users/tgalopin/repos","events_url":"https://api.github.com/users/tgalopin/events{/privacy}","received_events_url":"https://api.github.com/users/tgalopin/received_events","type":"User","site_admin":false},"body":"I did the change :)","created_at":"2020-01-03T10:30:37Z","updated_at":"2020-01-03T10:30:37Z","html_url":"https://github.com/dustin10/VichUploaderBundle/pull/1082#discussion_r362764052","pull_request_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/comments/362764052"},"html":{"href":"https://github.com/dustin10/VichUploaderBundle/pull/1082#discussion_r362764052"},"pull_request":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082"}},"in_reply_to_id":362756066},"pull_request":{"url":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082","id":358743588,"node_id":"MDExOlB1bGxSZXF1ZXN0MzU4NzQzNTg4","html_url":"https://github.com/dustin10/VichUploaderBundle/pull/1082","diff_url":"https://github.com/dustin10/VichUploaderBundle/pull/1082.diff","patch_url":"https://github.com/dustin10/VichUploaderBundle/pull/1082.patch","issue_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/1082","number":1082,"state":"open","locked":false,"title":"Add support for a ContainerInterface instance in FlysystemStorage","user":{"login":"tgalopin","id":1651494,"node_id":"MDQ6VXNlcjE2NTE0OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1651494?v=4","gravatar_id":"","url":"https://api.github.com/users/tgalopin","html_url":"https://github.com/tgalopin","followers_url":"https://api.github.com/users/tgalopin/followers","following_url":"https://api.github.com/users/tgalopin/following{/other_user}","gists_url":"https://api.github.com/users/tgalopin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgalopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgalopin/subscriptions","organizations_url":"https://api.github.com/users/tgalopin/orgs","repos_url":"https://api.github.com/users/tgalopin/repos","events_url":"https://api.github.com/users/tgalopin/events{/privacy}","received_events_url":"https://api.github.com/users/tgalopin/received_events","type":"User","site_admin":false},"body":"I am currently working on integrating the official Flysystem bundle (https://github.com/thephpleague/flysystem-bundle) into this one and I realized there is a huge downside in the current implementation: the MountManager provided by OneUpFlysystemBundle is public and references *directly* all the filesystems defined with the bundle. This means that 1/ the container can't be optimized to remove unused filesystems from the compiled code and 2/ each time the MountManager service is instanciated, all the filesystem services are instanciated as well at the same time, even if they are not useful in the context. This hurts performance and can lead to unstable application if a storage tries to connect to a service which is down or inaccessible.\r\n\r\nThis PR adds support for a PSR ContainerInterface instance instead of a MountManager, to rely on the lazyness a container can have. It will also let me finalize the integration with the official bundle afterwards.","created_at":"2020-01-02T18:04:13Z","updated_at":"2020-01-03T10:30:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"607fc80cd9939c05b3a2baf8452b1f746e02bf0b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":69644884,"node_id":"MDU6TGFiZWw2OTY0NDg4NA==","url":"https://api.github.com/repos/dustin10/VichUploaderBundle/labels/Enhancement","name":"Enhancement","color":"009800","default":false,"description":null}],"milestone":null,"commits_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082/commits","review_comments_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082/comments","review_comment_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/1082/comments","statuses_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/statuses/a9a535d418a341b5e29dd36f0de7f3b2038fe514","head":{"label":"tgalopin:flysystem-container-interface","ref":"flysystem-container-interface","sha":"a9a535d418a341b5e29dd36f0de7f3b2038fe514","user":{"login":"tgalopin","id":1651494,"node_id":"MDQ6VXNlcjE2NTE0OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1651494?v=4","gravatar_id":"","url":"https://api.github.com/users/tgalopin","html_url":"https://github.com/tgalopin","followers_url":"https://api.github.com/users/tgalopin/followers","following_url":"https://api.github.com/users/tgalopin/following{/other_user}","gists_url":"https://api.github.com/users/tgalopin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgalopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgalopin/subscriptions","organizations_url":"https://api.github.com/users/tgalopin/orgs","repos_url":"https://api.github.com/users/tgalopin/repos","events_url":"https://api.github.com/users/tgalopin/events{/privacy}","received_events_url":"https://api.github.com/users/tgalopin/received_events","type":"User","site_admin":false},"repo":{"id":231426711,"node_id":"MDEwOlJlcG9zaXRvcnkyMzE0MjY3MTE=","name":"VichUploaderBundle","full_name":"tgalopin/VichUploaderBundle","private":false,"owner":{"login":"tgalopin","id":1651494,"node_id":"MDQ6VXNlcjE2NTE0OTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/1651494?v=4","gravatar_id":"","url":"https://api.github.com/users/tgalopin","html_url":"https://github.com/tgalopin","followers_url":"https://api.github.com/users/tgalopin/followers","following_url":"https://api.github.com/users/tgalopin/following{/other_user}","gists_url":"https://api.github.com/users/tgalopin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgalopin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgalopin/subscriptions","organizations_url":"https://api.github.com/users/tgalopin/orgs","repos_url":"https://api.github.com/users/tgalopin/repos","events_url":"https://api.github.com/users/tgalopin/events{/privacy}","received_events_url":"https://api.github.com/users/tgalopin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tgalopin/VichUploaderBundle","description":"A simple Symfony bundle to ease file uploads with ORM entities and ODM documents.","fork":true,"url":"https://api.github.com/repos/tgalopin/VichUploaderBundle","forks_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/forks","keys_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/teams","hooks_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/hooks","issue_events_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/issues/events{/number}","events_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/events","assignees_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/assignees{/user}","branches_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/branches{/branch}","tags_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/tags","blobs_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/languages","stargazers_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/stargazers","contributors_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/contributors","subscribers_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/subscribers","subscription_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/subscription","commits_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/contents/{+path}","compare_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/merges","archive_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/downloads","issues_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/issues{/number}","pulls_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/labels{/name}","releases_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/releases{/id}","deployments_url":"https://api.github.com/repos/tgalopin/VichUploaderBundle/deployments","created_at":"2020-01-02T17:15:54Z","updated_at":"2020-01-02T17:15:56Z","pushed_at":"2020-01-03T10:29:54Z","git_url":"git://github.com/tgalopin/VichUploaderBundle.git","ssh_url":"git@github.com:tgalopin/VichUploaderBundle.git","clone_url":"https://github.com/tgalopin/VichUploaderBundle.git","svn_url":"https://github.com/tgalopin/VichUploaderBundle","homepage":"","size":1418,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dustin10:master","ref":"master","sha":"cbfe3625aba941271d869336bfa188fe8f309acd","user":{"login":"dustin10","id":546381,"node_id":"MDQ6VXNlcjU0NjM4MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/546381?v=4","gravatar_id":"","url":"https://api.github.com/users/dustin10","html_url":"https://github.com/dustin10","followers_url":"https://api.github.com/users/dustin10/followers","following_url":"https://api.github.com/users/dustin10/following{/other_user}","gists_url":"https://api.github.com/users/dustin10/gists{/gist_id}","starred_url":"https://api.github.com/users/dustin10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustin10/subscriptions","organizations_url":"https://api.github.com/users/dustin10/orgs","repos_url":"https://api.github.com/users/dustin10/repos","events_url":"https://api.github.com/users/dustin10/events{/privacy}","received_events_url":"https://api.github.com/users/dustin10/received_events","type":"User","site_admin":false},"repo":{"id":2894555,"node_id":"MDEwOlJlcG9zaXRvcnkyODk0NTU1","name":"VichUploaderBundle","full_name":"dustin10/VichUploaderBundle","private":false,"owner":{"login":"dustin10","id":546381,"node_id":"MDQ6VXNlcjU0NjM4MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/546381?v=4","gravatar_id":"","url":"https://api.github.com/users/dustin10","html_url":"https://github.com/dustin10","followers_url":"https://api.github.com/users/dustin10/followers","following_url":"https://api.github.com/users/dustin10/following{/other_user}","gists_url":"https://api.github.com/users/dustin10/gists{/gist_id}","starred_url":"https://api.github.com/users/dustin10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustin10/subscriptions","organizations_url":"https://api.github.com/users/dustin10/orgs","repos_url":"https://api.github.com/users/dustin10/repos","events_url":"https://api.github.com/users/dustin10/events{/privacy}","received_events_url":"https://api.github.com/users/dustin10/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dustin10/VichUploaderBundle","description":"A simple Symfony bundle to ease file uploads with ORM entities and ODM documents.","fork":false,"url":"https://api.github.com/repos/dustin10/VichUploaderBundle","forks_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/forks","keys_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/teams","hooks_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/hooks","issue_events_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/events{/number}","events_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/events","assignees_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/assignees{/user}","branches_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/branches{/branch}","tags_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/tags","blobs_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/languages","stargazers_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/stargazers","contributors_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/contributors","subscribers_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/subscribers","subscription_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/subscription","commits_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/contents/{+path}","compare_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/merges","archive_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/downloads","issues_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues{/number}","pulls_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/labels{/name}","releases_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/releases{/id}","deployments_url":"https://api.github.com/repos/dustin10/VichUploaderBundle/deployments","created_at":"2011-12-01T22:18:22Z","updated_at":"2020-01-03T10:03:44Z","pushed_at":"2020-01-03T10:29:56Z","git_url":"git://github.com/dustin10/VichUploaderBundle.git","ssh_url":"git@github.com:dustin10/VichUploaderBundle.git","clone_url":"https://github.com/dustin10/VichUploaderBundle.git","svn_url":"https://github.com/dustin10/VichUploaderBundle","homepage":"","size":1403,"stargazers_count":1346,"watchers_count":1346,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":408,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":56,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":408,"open_issues":56,"watchers":1346,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082"},"html":{"href":"https://github.com/dustin10/VichUploaderBundle/pull/1082"},"issue":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/1082"},"comments":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/issues/1082/comments"},"review_comments":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082/comments"},"review_comment":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/pulls/1082/commits"},"statuses":{"href":"https://api.github.com/repos/dustin10/VichUploaderBundle/statuses/a9a535d418a341b5e29dd36f0de7f3b2038fe514"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tgalopin"}}