{"action":"created","comment":{"url":"https://api.github.com/repos/sulu-io/sulu/pulls/comments/45036151","id":45036151,"diff_hunk":"@@ -35,14 +35,19 @@ protected function execute(InputInterface $input, OutputInterface $output)\n \n         $output->writeln('Create media dirs in ' . $baseDir);\n \n-        $uploadDir = $this->getContainer()->getParameter('sulu_media.media.storage.local.path');\n-\n-        $output->writeln('Create Upload dir in ' . $uploadDir);\n-\n-        if (!is_dir($uploadDir)) {\n-            $filesystem->mkdir($uploadDir);\n-        } else {\n-            $output->writeLn('Directory ' . $uploadDir . ' already exists');\n+        $adapters = $this->getContainer()->getParameter('sulu_media.storage.adapters');\n+\n+        foreach ($adapters as $config) {\n+            if (isset($config['type']) && $config['type'] == 'local' && isset($config['uploadPath'])) {","path":"src/Sulu/Bundle/MediaBundle/Command/InitCommand.php","position":15,"original_position":15,"commit_id":"2b97e3290b864fdb739e8fbdcb31d4e8af25627b","original_commit_id":"2b97e3290b864fdb739e8fbdcb31d4e8af25627b","user":{"login":"wachterjohannes","id":1464615,"avatar_url":"https://avatars.githubusercontent.com/u/1464615?v=3","gravatar_id":"","url":"https://api.github.com/users/wachterjohannes","html_url":"https://github.com/wachterjohannes","followers_url":"https://api.github.com/users/wachterjohannes/followers","following_url":"https://api.github.com/users/wachterjohannes/following{/other_user}","gists_url":"https://api.github.com/users/wachterjohannes/gists{/gist_id}","starred_url":"https://api.github.com/users/wachterjohannes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wachterjohannes/subscriptions","organizations_url":"https://api.github.com/users/wachterjohannes/orgs","repos_url":"https://api.github.com/users/wachterjohannes/repos","events_url":"https://api.github.com/users/wachterjohannes/events{/privacy}","received_events_url":"https://api.github.com/users/wachterjohannes/received_events","type":"User","site_admin":false},"body":"use `===`","created_at":"2015-11-17T09:11:34Z","updated_at":"2015-11-17T09:11:34Z","html_url":"https://github.com/sulu-io/sulu/pull/1139#discussion_r45036151","pull_request_url":"https://api.github.com/repos/sulu-io/sulu/pulls/1139","_links":{"self":{"href":"https://api.github.com/repos/sulu-io/sulu/pulls/comments/45036151"},"html":{"href":"https://github.com/sulu-io/sulu/pull/1139#discussion_r45036151"},"pull_request":{"href":"https://api.github.com/repos/sulu-io/sulu/pulls/1139"}}},"pull_request":{"url":"https://api.github.com/repos/sulu-io/sulu/pulls/1139","id":36295178,"html_url":"https://github.com/sulu-io/sulu/pull/1139","diff_url":"https://github.com/sulu-io/sulu/pull/1139.diff","patch_url":"https://github.com/sulu-io/sulu/pull/1139.patch","issue_url":"https://api.github.com/repos/sulu-io/sulu/issues/1139","number":1139,"state":"open","locked":false,"title":"Add storagemanager for multiple storage support","user":{"login":"alexander-schranz","id":1698337,"avatar_url":"https://avatars.githubusercontent.com/u/1698337?v=3","gravatar_id":"","url":"https://api.github.com/users/alexander-schranz","html_url":"https://github.com/alexander-schranz","followers_url":"https://api.github.com/users/alexander-schranz/followers","following_url":"https://api.github.com/users/alexander-schranz/following{/other_user}","gists_url":"https://api.github.com/users/alexander-schranz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-schranz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-schranz/subscriptions","organizations_url":"https://api.github.com/users/alexander-schranz/orgs","repos_url":"https://api.github.com/users/alexander-schranz/repos","events_url":"https://api.github.com/users/alexander-schranz/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-schranz/received_events","type":"User","site_admin":false},"body":"__Tasks:__\r\n\r\n - [ ] test coverage\r\n - [ ] gather feedback for my changes\r\n - [x] submit changes to the documentation\r\n - [x] added changelog line\r\n - [x] StorageManager implementation in MediaManager\r\n - [x] StorageManager implementation in FormatManager\r\n - [x] Default Storage is local\r\n - [x] Refractor Storage Interface (the storage should not have to need to know about media versions and co ...)\r\n  - [x] save ($path, $filename, $storageOptions = null)\r\n  - [x] remove ($storageOptions)\r\n  - [x] load ($storageOptions)\r\n  - [x] getDownloadUrl($storageOptions) not all storages will have a public download url when this function return null the default Sulu DownloadAction is used. Then the server first will need to load the file from the storage and then return \r\n - [x] Support Download from Other Url\r\n - [x] StorageCompilerPass Test\r\n - [x] Multiple Storage Support from same type\r\n - [x] FlySystem Class based on StorageInterface so you can add multiple FlySystem Storages for Sulu\r\n - [x] FlySystem Download Url S3 / DropBox\r\n - [x] Add sample Service for FlySystem implementation to documentation (fixes #595)\r\n - [x] Redirect to Download Url to keep download counter (when want to keep the download counter it should be use the twig `path` method to link to the media controller which will redirect after increase the downloadcounter to the external url when exists)\r\n - [x] UPGRADE.md\r\n\r\n__Not Implemented in this PR__\r\n\r\n - Add Media Overlay Storage Tab (to move media from e.g. local to s3)  #1752\r\n - Add Collection DefaultStorageType Dropdown (all medias uploaded in this collection are stored in e.g. s3 in other collection on local)  #1753\r\n\r\n__Informations:__\r\n\r\n| Q             | A\r\n| ------------- | ---\r\n| Tests pass?   | Yes\r\n| Fixed tickets | fixes #1137, fixes #595 \r\n| BC Breaks     | Yes\r\n| Doc           | https://github.com/sulu-io/docs/pull/21 (PR!)","created_at":"2015-05-27T11:49:18Z","updated_at":"2015-11-17T09:11:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61225957a3c3545ba202ccf800eb90681933c928","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sulu-io/sulu/pulls/1139/commits","review_comments_url":"https://api.github.com/repos/sulu-io/sulu/pulls/1139/comments","review_comment_url":"https://api.github.com/repos/sulu-io/sulu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sulu-io/sulu/issues/1139/comments","statuses_url":"https://api.github.com/repos/sulu-io/sulu/statuses/2b97e3290b864fdb739e8fbdcb31d4e8af25627b","head":{"label":"sulu-io:feature/storage-manager","ref":"feature/storage-manager","sha":"2b97e3290b864fdb739e8fbdcb31d4e8af25627b","user":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"repo":{"id":13678015,"name":"sulu","full_name":"sulu-io/sulu","owner":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-io/sulu","description":"Sulu core bundles & components","fork":false,"url":"https://api.github.com/repos/sulu-io/sulu","forks_url":"https://api.github.com/repos/sulu-io/sulu/forks","keys_url":"https://api.github.com/repos/sulu-io/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-io/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-io/sulu/teams","hooks_url":"https://api.github.com/repos/sulu-io/sulu/hooks","issue_events_url":"https://api.github.com/repos/sulu-io/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-io/sulu/events","assignees_url":"https://api.github.com/repos/sulu-io/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-io/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-io/sulu/tags","blobs_url":"https://api.github.com/repos/sulu-io/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-io/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-io/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-io/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-io/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-io/sulu/languages","stargazers_url":"https://api.github.com/repos/sulu-io/sulu/stargazers","contributors_url":"https://api.github.com/repos/sulu-io/sulu/contributors","subscribers_url":"https://api.github.com/repos/sulu-io/sulu/subscribers","subscription_url":"https://api.github.com/repos/sulu-io/sulu/subscription","commits_url":"https://api.github.com/repos/sulu-io/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-io/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-io/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-io/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu-io/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-io/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-io/sulu/merges","archive_url":"https://api.github.com/repos/sulu-io/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-io/sulu/downloads","issues_url":"https://api.github.com/repos/sulu-io/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-io/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-io/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-io/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-io/sulu/labels{/name}","releases_url":"https://api.github.com/repos/sulu-io/sulu/releases{/id}","created_at":"2013-10-18T12:57:02Z","updated_at":"2015-11-16T15:22:07Z","pushed_at":"2015-11-17T08:48:01Z","git_url":"git://github.com/sulu-io/sulu.git","ssh_url":"git@github.com:sulu-io/sulu.git","clone_url":"https://github.com/sulu-io/sulu.git","svn_url":"https://github.com/sulu-io/sulu","homepage":"sulu.io","size":60573,"stargazers_count":83,"watchers_count":83,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":347,"forks":18,"open_issues":347,"watchers":83,"default_branch":"develop"}},"base":{"label":"sulu-io:develop","ref":"develop","sha":"1fc21b759f04c02dd6120b8e8ce96e1a080ab0fa","user":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"repo":{"id":13678015,"name":"sulu","full_name":"sulu-io/sulu","owner":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-io/sulu","description":"Sulu core bundles & components","fork":false,"url":"https://api.github.com/repos/sulu-io/sulu","forks_url":"https://api.github.com/repos/sulu-io/sulu/forks","keys_url":"https://api.github.com/repos/sulu-io/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-io/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-io/sulu/teams","hooks_url":"https://api.github.com/repos/sulu-io/sulu/hooks","issue_events_url":"https://api.github.com/repos/sulu-io/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-io/sulu/events","assignees_url":"https://api.github.com/repos/sulu-io/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-io/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-io/sulu/tags","blobs_url":"https://api.github.com/repos/sulu-io/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-io/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-io/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-io/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-io/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-io/sulu/languages","stargazers_url":"https://api.github.com/repos/sulu-io/sulu/stargazers","contributors_url":"https://api.github.com/repos/sulu-io/sulu/contributors","subscribers_url":"https://api.github.com/repos/sulu-io/sulu/subscribers","subscription_url":"https://api.github.com/repos/sulu-io/sulu/subscription","commits_url":"https://api.github.com/repos/sulu-io/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-io/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-io/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-io/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu-io/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-io/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-io/sulu/merges","archive_url":"https://api.github.com/repos/sulu-io/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-io/sulu/downloads","issues_url":"https://api.github.com/repos/sulu-io/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-io/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-io/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-io/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-io/sulu/labels{/name}","releases_url":"https://api.github.com/repos/sulu-io/sulu/releases{/id}","created_at":"2013-10-18T12:57:02Z","updated_at":"2015-11-16T15:22:07Z","pushed_at":"2015-11-17T08:48:01Z","git_url":"git://github.com/sulu-io/sulu.git","ssh_url":"git@github.com:sulu-io/sulu.git","clone_url":"https://github.com/sulu-io/sulu.git","svn_url":"https://github.com/sulu-io/sulu","homepage":"sulu.io","size":60573,"stargazers_count":83,"watchers_count":83,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":347,"forks":18,"open_issues":347,"watchers":83,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sulu-io/sulu/pulls/1139"},"html":{"href":"https://github.com/sulu-io/sulu/pull/1139"},"issue":{"href":"https://api.github.com/repos/sulu-io/sulu/issues/1139"},"comments":{"href":"https://api.github.com/repos/sulu-io/sulu/issues/1139/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu-io/sulu/pulls/1139/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu-io/sulu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sulu-io/sulu/pulls/1139/commits"},"statuses":{"href":"https://api.github.com/repos/sulu-io/sulu/statuses/2b97e3290b864fdb739e8fbdcb31d4e8af25627b"}}}}