{"action":"created","comment":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/comments/27821409","id":27821409,"diff_hunk":"@@ -0,0 +1,96 @@\n+<?php\n+namespace Elgg\\Filesystem;\n+use Elgg\\Filesystem\\Adapter\\Adapter;\n+\n+\n+class AdapterService {\n+\tprivate $logger;\n+\t\n+\t/**\n+\t *\n+\t * @var string\n+\t */\n+\tprivate $default;\n+\t\n+\t/**\n+\t *\n+\t * @var Adapter[]\n+\t */\n+\tprivate $adapters;\n+\t\n+\tpublic function __construct(\\Elgg\\Logger $logger) {\n+\t\t$this->logger = $logger;\n+\t}\n+\t\n+\tpublic function set($name, Adapter $adapter, $default = false) {\n+\t\tif ($this->has($name)) {\n+\t\t\tthrow new \\UnexpectedValueException(\"Filesystem adapter \\\"$name\\\" already exists.\");\n+\t\t}\n+\t\t$this->adapters[$name] = $adapter;\n+\t\t\n+\t\tif ($default) {\n+\t\t\t$this->setDefault($name);\n+\t\t}\n+\t\treturn true;\n+\t}\n+\t\n+\t/**\n+\t * \n+\t * @param type $name\n+\t * @return Adapter\n+\t * @throws \\InvalidArgumentException\n+\t */\n+\tpublic function get($name) {\n+\t\tif (!$this->has($name)) {\n+\t\t\tthrow new \\InvalidArgumentException(\"Filesystem Adapter \\\"$name\\\" does not exist.\");\n+\t\t}\n+\t\t\n+\t\treturn $this->adapters[$name];\n+\t}\n+\t\n+\tpublic function has($name) {\n+\t\treturn isset($this->adapters[$name]);\n+\t}\n+\t\n+\tpublic function remove($name) {","path":"engine/classes/Elgg/Filesystem/AdapterService.php","position":55,"original_position":55,"commit_id":"a84540107581b3772510031e59c818c1bc99c815","original_commit_id":"a84540107581b3772510031e59c818c1bc99c815","user":{"login":"brettp","id":43375,"avatar_url":"https://avatars.githubusercontent.com/u/43375?v=3","gravatar_id":"","url":"https://api.github.com/users/brettp","html_url":"https://github.com/brettp","followers_url":"https://api.github.com/users/brettp/followers","following_url":"https://api.github.com/users/brettp/following{/other_user}","gists_url":"https://api.github.com/users/brettp/gists{/gist_id}","starred_url":"https://api.github.com/users/brettp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettp/subscriptions","organizations_url":"https://api.github.com/users/brettp/orgs","repos_url":"https://api.github.com/users/brettp/repos","events_url":"https://api.github.com/users/brettp/events{/privacy}","received_events_url":"https://api.github.com/users/brettp/received_events","type":"User","site_admin":false},"body":"I just saw those classes this morning. It's a shame they're not used in core.\r\n\r\nI'll be able to switch over to ArrayCollection assuming plugins are fully init'd by the time the service is called.","created_at":"2015-04-06T19:15:12Z","updated_at":"2015-04-06T19:15:12Z","html_url":"https://github.com/Elgg/Elgg/pull/8092#discussion_r27821409","pull_request_url":"https://api.github.com/repos/Elgg/Elgg/pulls/8092","_links":{"self":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/comments/27821409"},"html":{"href":"https://github.com/Elgg/Elgg/pull/8092#discussion_r27821409"},"pull_request":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/8092"}}},"pull_request":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/8092","id":31636747,"html_url":"https://github.com/Elgg/Elgg/pull/8092","diff_url":"https://github.com/Elgg/Elgg/pull/8092.diff","patch_url":"https://github.com/Elgg/Elgg/pull/8092.patch","issue_url":"https://api.github.com/repos/Elgg/Elgg/issues/8092","number":8092,"state":"open","locked":false,"title":"Adding cloud storage capabilities","user":{"login":"brettp","id":43375,"avatar_url":"https://avatars.githubusercontent.com/u/43375?v=3","gravatar_id":"","url":"https://api.github.com/users/brettp","html_url":"https://github.com/brettp","followers_url":"https://api.github.com/users/brettp/followers","following_url":"https://api.github.com/users/brettp/following{/other_user}","gists_url":"https://api.github.com/users/brettp/gists{/gist_id}","starred_url":"https://api.github.com/users/brettp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettp/subscriptions","organizations_url":"https://api.github.com/users/brettp/orgs","repos_url":"https://api.github.com/users/brettp/repos","events_url":"https://api.github.com/users/brettp/events{/privacy}","received_events_url":"https://api.github.com/users/brettp/received_events","type":"User","site_admin":false},"body":"DO NOT MERGE. This is an initial commit for early feedback from @Elgg/contributors and MITRE. There is a lot left to address:\r\n\r\n- [ ] Access race condition when deleting ElggEntity with metadata.\r\n- [ ] Elgg disk caching solutions\r\n- [ ] Numerous core / bundled plugins access files directly\r\n- [ ] Need unified thumbnail generation on ElggFile\r\n- [ ] Rebase before merge\r\n\r\nTo get this in 1.x, I tried to touch ElggFile as little as possible. It has a number of shortcomings and needs some love. Ideas:\r\n\r\n* Kill the idea of ElggFilestore and register a stream context: `elgg://key:secret@filestoreAdapter/path/to/file.txt`\r\n* Hang Gaufrette\\File on ElggFile\r\n* Use Gaufrette\\Filesystem as ElggFilestore","created_at":"2015-03-20T17:56:06Z","updated_at":"2015-04-06T19:15:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef09089c27a33140cf84aafaeaf001b232be15e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Elgg/Elgg/pulls/8092/commits","review_comments_url":"https://api.github.com/repos/Elgg/Elgg/pulls/8092/comments","review_comment_url":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Elgg/Elgg/issues/8092/comments","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/a84540107581b3772510031e59c818c1bc99c815","head":{"label":"brettp:aws_s3","ref":"aws_s3","sha":"a84540107581b3772510031e59c818c1bc99c815","user":{"login":"brettp","id":43375,"avatar_url":"https://avatars.githubusercontent.com/u/43375?v=3","gravatar_id":"","url":"https://api.github.com/users/brettp","html_url":"https://github.com/brettp","followers_url":"https://api.github.com/users/brettp/followers","following_url":"https://api.github.com/users/brettp/following{/other_user}","gists_url":"https://api.github.com/users/brettp/gists{/gist_id}","starred_url":"https://api.github.com/users/brettp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettp/subscriptions","organizations_url":"https://api.github.com/users/brettp/orgs","repos_url":"https://api.github.com/users/brettp/repos","events_url":"https://api.github.com/users/brettp/events{/privacy}","received_events_url":"https://api.github.com/users/brettp/received_events","type":"User","site_admin":false},"repo":{"id":1952228,"name":"Elgg","full_name":"brettp/Elgg","owner":{"login":"brettp","id":43375,"avatar_url":"https://avatars.githubusercontent.com/u/43375?v=3","gravatar_id":"","url":"https://api.github.com/users/brettp","html_url":"https://github.com/brettp","followers_url":"https://api.github.com/users/brettp/followers","following_url":"https://api.github.com/users/brettp/following{/other_user}","gists_url":"https://api.github.com/users/brettp/gists{/gist_id}","starred_url":"https://api.github.com/users/brettp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettp/subscriptions","organizations_url":"https://api.github.com/users/brettp/orgs","repos_url":"https://api.github.com/users/brettp/repos","events_url":"https://api.github.com/users/brettp/events{/privacy}","received_events_url":"https://api.github.com/users/brettp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brettp/Elgg","description":"A social networking engine","fork":true,"url":"https://api.github.com/repos/brettp/Elgg","forks_url":"https://api.github.com/repos/brettp/Elgg/forks","keys_url":"https://api.github.com/repos/brettp/Elgg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brettp/Elgg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brettp/Elgg/teams","hooks_url":"https://api.github.com/repos/brettp/Elgg/hooks","issue_events_url":"https://api.github.com/repos/brettp/Elgg/issues/events{/number}","events_url":"https://api.github.com/repos/brettp/Elgg/events","assignees_url":"https://api.github.com/repos/brettp/Elgg/assignees{/user}","branches_url":"https://api.github.com/repos/brettp/Elgg/branches{/branch}","tags_url":"https://api.github.com/repos/brettp/Elgg/tags","blobs_url":"https://api.github.com/repos/brettp/Elgg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brettp/Elgg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brettp/Elgg/git/refs{/sha}","trees_url":"https://api.github.com/repos/brettp/Elgg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brettp/Elgg/statuses/{sha}","languages_url":"https://api.github.com/repos/brettp/Elgg/languages","stargazers_url":"https://api.github.com/repos/brettp/Elgg/stargazers","contributors_url":"https://api.github.com/repos/brettp/Elgg/contributors","subscribers_url":"https://api.github.com/repos/brettp/Elgg/subscribers","subscription_url":"https://api.github.com/repos/brettp/Elgg/subscription","commits_url":"https://api.github.com/repos/brettp/Elgg/commits{/sha}","git_commits_url":"https://api.github.com/repos/brettp/Elgg/git/commits{/sha}","comments_url":"https://api.github.com/repos/brettp/Elgg/comments{/number}","issue_comment_url":"https://api.github.com/repos/brettp/Elgg/issues/comments{/number}","contents_url":"https://api.github.com/repos/brettp/Elgg/contents/{+path}","compare_url":"https://api.github.com/repos/brettp/Elgg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brettp/Elgg/merges","archive_url":"https://api.github.com/repos/brettp/Elgg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brettp/Elgg/downloads","issues_url":"https://api.github.com/repos/brettp/Elgg/issues{/number}","pulls_url":"https://api.github.com/repos/brettp/Elgg/pulls{/number}","milestones_url":"https://api.github.com/repos/brettp/Elgg/milestones{/number}","notifications_url":"https://api.github.com/repos/brettp/Elgg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brettp/Elgg/labels{/name}","releases_url":"https://api.github.com/repos/brettp/Elgg/releases{/id}","created_at":"2011-06-25T14:05:03Z","updated_at":"2014-07-29T16:33:21Z","pushed_at":"2015-03-30T19:38:14Z","git_url":"git://github.com/brettp/Elgg.git","ssh_url":"git@github.com:brettp/Elgg.git","clone_url":"https://github.com/brettp/Elgg.git","svn_url":"https://github.com/brettp/Elgg","homepage":"http://elgg.org","size":38145,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Elgg:1.x","ref":"1.x","sha":"43722a50614b196d5b3e91b2442b77f84c7edd87","user":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"repo":{"id":299271,"name":"Elgg","full_name":"Elgg/Elgg","owner":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Elgg/Elgg","description":"A social networking engine in PHP/MySQL","fork":false,"url":"https://api.github.com/repos/Elgg/Elgg","forks_url":"https://api.github.com/repos/Elgg/Elgg/forks","keys_url":"https://api.github.com/repos/Elgg/Elgg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Elgg/Elgg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Elgg/Elgg/teams","hooks_url":"https://api.github.com/repos/Elgg/Elgg/hooks","issue_events_url":"https://api.github.com/repos/Elgg/Elgg/issues/events{/number}","events_url":"https://api.github.com/repos/Elgg/Elgg/events","assignees_url":"https://api.github.com/repos/Elgg/Elgg/assignees{/user}","branches_url":"https://api.github.com/repos/Elgg/Elgg/branches{/branch}","tags_url":"https://api.github.com/repos/Elgg/Elgg/tags","blobs_url":"https://api.github.com/repos/Elgg/Elgg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Elgg/Elgg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Elgg/Elgg/git/refs{/sha}","trees_url":"https://api.github.com/repos/Elgg/Elgg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/{sha}","languages_url":"https://api.github.com/repos/Elgg/Elgg/languages","stargazers_url":"https://api.github.com/repos/Elgg/Elgg/stargazers","contributors_url":"https://api.github.com/repos/Elgg/Elgg/contributors","subscribers_url":"https://api.github.com/repos/Elgg/Elgg/subscribers","subscription_url":"https://api.github.com/repos/Elgg/Elgg/subscription","commits_url":"https://api.github.com/repos/Elgg/Elgg/commits{/sha}","git_commits_url":"https://api.github.com/repos/Elgg/Elgg/git/commits{/sha}","comments_url":"https://api.github.com/repos/Elgg/Elgg/comments{/number}","issue_comment_url":"https://api.github.com/repos/Elgg/Elgg/issues/comments{/number}","contents_url":"https://api.github.com/repos/Elgg/Elgg/contents/{+path}","compare_url":"https://api.github.com/repos/Elgg/Elgg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Elgg/Elgg/merges","archive_url":"https://api.github.com/repos/Elgg/Elgg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Elgg/Elgg/downloads","issues_url":"https://api.github.com/repos/Elgg/Elgg/issues{/number}","pulls_url":"https://api.github.com/repos/Elgg/Elgg/pulls{/number}","milestones_url":"https://api.github.com/repos/Elgg/Elgg/milestones{/number}","notifications_url":"https://api.github.com/repos/Elgg/Elgg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Elgg/Elgg/labels{/name}","releases_url":"https://api.github.com/repos/Elgg/Elgg/releases{/id}","created_at":"2009-09-06T17:10:11Z","updated_at":"2015-04-06T11:04:30Z","pushed_at":"2015-04-05T20:32:33Z","git_url":"git://github.com/Elgg/Elgg.git","ssh_url":"git@github.com:Elgg/Elgg.git","clone_url":"https://github.com/Elgg/Elgg.git","svn_url":"https://github.com/Elgg/Elgg","homepage":"http://elgg.org","size":73836,"stargazers_count":693,"watchers_count":693,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":421,"mirror_url":null,"open_issues_count":751,"forks":421,"open_issues":751,"watchers":693,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/8092"},"html":{"href":"https://github.com/Elgg/Elgg/pull/8092"},"issue":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/8092"},"comments":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/8092/comments"},"review_comments":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/8092/comments"},"review_comment":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/8092/commits"},"statuses":{"href":"https://api.github.com/repos/Elgg/Elgg/statuses/a84540107581b3772510031e59c818c1bc99c815"}}}}