{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/11261","labels_url":"https://api.github.com/repos/owncloud/core/issues/11261/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/11261/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/11261/events","html_url":"https://github.com/owncloud/core/issues/11261","id":43645940,"number":11261,"title":"[ext storage] Rely on numeric_id, store config in DB, improve config format","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/app:files_external","name":"app:files_external","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/enhancement","name":"enhancement","color":"02e10c"},{"url":"https://api.github.com/repos/owncloud/core/labels/technical%20debt","name":"technical debt","color":"FFFF00"},{"url":"https://api.github.com/repos/owncloud/core/labels/triage","name":"triage","color":"00FFFF"}],"state":"open","locked":false,"assignee":{"login":"Xenopathic","id":2016878,"avatar_url":"https://avatars.githubusercontent.com/u/2016878?v=3","gravatar_id":"","url":"https://api.github.com/users/Xenopathic","html_url":"https://github.com/Xenopathic","followers_url":"https://api.github.com/users/Xenopathic/followers","following_url":"https://api.github.com/users/Xenopathic/following{/other_user}","gists_url":"https://api.github.com/users/Xenopathic/gists{/gist_id}","starred_url":"https://api.github.com/users/Xenopathic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xenopathic/subscriptions","organizations_url":"https://api.github.com/users/Xenopathic/orgs","repos_url":"https://api.github.com/users/Xenopathic/repos","events_url":"https://api.github.com/users/Xenopathic/events{/privacy}","received_events_url":"https://api.github.com/users/Xenopathic/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/37","html_url":"https://github.com/owncloud/core/milestones/8.2-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/37/labels","id":993629,"number":37,"title":"8.2-current","description":"","creator":{"login":"craigpg","id":160667,"avatar_url":"https://avatars.githubusercontent.com/u/160667?v=3","gravatar_id":"","url":"https://api.github.com/users/craigpg","html_url":"https://github.com/craigpg","followers_url":"https://api.github.com/users/craigpg/followers","following_url":"https://api.github.com/users/craigpg/following{/other_user}","gists_url":"https://api.github.com/users/craigpg/gists{/gist_id}","starred_url":"https://api.github.com/users/craigpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigpg/subscriptions","organizations_url":"https://api.github.com/users/craigpg/orgs","repos_url":"https://api.github.com/users/craigpg/repos","events_url":"https://api.github.com/users/craigpg/events{/privacy}","received_events_url":"https://api.github.com/users/craigpg/received_events","type":"User","site_admin":false},"open_issues":634,"closed_issues":305,"state":"open","created_at":"2015-02-24T16:19:37Z","updated_at":"2015-08-10T12:57:43Z","due_on":"2015-10-20T04:00:00Z","closed_at":null},"comments":31,"created_at":"2014-09-23T15:44:45Z","updated_at":"2015-08-10T13:58:34Z","closed_at":null,"body":"Code like this is just unreadable and difficult to extend: https://github.com/owncloud/core/blob/master/apps/files_external/lib/config.php#L503\r\n\r\nThe external storage mount points are stored with multi-dimensional arrays:\r\n```php\r\n$mounts[$mountType][$applicableUsers][$mountPointName][$extraField]\r\n```\r\n\r\nThis needs a lot of code gymnastics to get to the right information and it also increases the risk of misunderstanding and introducing bugs this way.\r\n\r\nI suggest to provide a new class to contain that data, like:\r\n```php\r\nclass MountPoint {\r\n    private $type; // personal or system\r\n    private $applicable; // array of users/groups to which the mount point applies\r\n    private $mountPath; // path to the mount point in the user's file system\r\n    private $priority;\r\n    // ...\r\n}\r\n```\r\n\r\nHopefully in OC8...\r\n\r\n@icewind1991 @Xenopathic "},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/129462548","html_url":"https://github.com/owncloud/core/issues/11261#issuecomment-129462548","issue_url":"https://api.github.com/repos/owncloud/core/issues/11261","id":129462548,"user":{"login":"Xenopathic","id":2016878,"avatar_url":"https://avatars.githubusercontent.com/u/2016878?v=3","gravatar_id":"","url":"https://api.github.com/users/Xenopathic","html_url":"https://github.com/Xenopathic","followers_url":"https://api.github.com/users/Xenopathic/followers","following_url":"https://api.github.com/users/Xenopathic/following{/other_user}","gists_url":"https://api.github.com/users/Xenopathic/gists{/gist_id}","starred_url":"https://api.github.com/users/Xenopathic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xenopathic/subscriptions","organizations_url":"https://api.github.com/users/Xenopathic/orgs","repos_url":"https://api.github.com/users/Xenopathic/repos","events_url":"https://api.github.com/users/Xenopathic/events{/privacy}","received_events_url":"https://api.github.com/users/Xenopathic/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T13:58:34Z","updated_at":"2015-08-10T13:58:34Z","body":"We should try and get rid of `getId()` on the storage implementation itself, it's awkward to have to construct the storage to get its ID. That leads to easy-to-break code such as https://github.com/owncloud/core/blob/master/apps/files_external/lib/config.php#L971-L980. Especially with session-based credentials, some storages will reject being constructed entirely, so we can never correctly get the ID of such storages."}}