{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/21582","repository_url":"https://api.github.com/repos/owncloud/core","labels_url":"https://api.github.com/repos/owncloud/core/issues/21582/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/21582/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/21582/events","html_url":"https://github.com/owncloud/core/pull/21582","id":125810273,"number":21582,"title":"[POC] Composers PSR-4 autoloader","user":{"login":"rullzer","id":45821,"avatar_url":"https://avatars.githubusercontent.com/u/45821?v=3","gravatar_id":"","url":"https://api.github.com/users/rullzer","html_url":"https://github.com/rullzer","followers_url":"https://api.github.com/users/rullzer/followers","following_url":"https://api.github.com/users/rullzer/following{/other_user}","gists_url":"https://api.github.com/users/rullzer/gists{/gist_id}","starred_url":"https://api.github.com/users/rullzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rullzer/subscriptions","organizations_url":"https://api.github.com/users/rullzer/orgs","repos_url":"https://api.github.com/users/rullzer/repos","events_url":"https://api.github.com/users/rullzer/events{/privacy}","received_events_url":"https://api.github.com/users/rullzer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/comp:core","name":"comp:core","color":"d4c5f9"},{"url":"https://api.github.com/repos/owncloud/core/labels/discussion","name":"discussion","color":"fbca04"},{"url":"https://api.github.com/repos/owncloud/core/labels/enhancement","name":"enhancement","color":"02e10c"},{"url":"https://api.github.com/repos/owncloud/core/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/11","html_url":"https://github.com/owncloud/core/milestones/backlog","labels_url":"https://api.github.com/repos/owncloud/core/milestones/11/labels","id":697149,"number":11,"title":"backlog","description":"","creator":{"login":"MTRichards","id":1818977,"avatar_url":"https://avatars.githubusercontent.com/u/1818977?v=3","gravatar_id":"","url":"https://api.github.com/users/MTRichards","html_url":"https://github.com/MTRichards","followers_url":"https://api.github.com/users/MTRichards/followers","following_url":"https://api.github.com/users/MTRichards/following{/other_user}","gists_url":"https://api.github.com/users/MTRichards/gists{/gist_id}","starred_url":"https://api.github.com/users/MTRichards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTRichards/subscriptions","organizations_url":"https://api.github.com/users/MTRichards/orgs","repos_url":"https://api.github.com/users/MTRichards/repos","events_url":"https://api.github.com/users/MTRichards/events{/privacy}","received_events_url":"https://api.github.com/users/MTRichards/received_events","type":"User","site_admin":false},"open_issues":532,"closed_issues":188,"state":"open","created_at":"2014-06-20T19:52:03Z","updated_at":"2016-02-08T08:46:55Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2016-01-10T09:44:44Z","updated_at":"2016-02-08T10:42:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/21582","html_url":"https://github.com/owncloud/core/pull/21582","diff_url":"https://github.com/owncloud/core/pull/21582.diff","patch_url":"https://github.com/owncloud/core/pull/21582.patch"},"body":"Related to https://github.com/owncloud/core/issues/13241\r\n\r\nThis POC shows that getting the widely used composers autoloader into core is almost trivial. The second commit moves server.php => Server.php as a proof that things still work.\r\n\r\n### Background\r\nIn core we have some old classes following PSR-0. However we try to get rid of those classes one at a time. Then we have the new classes. Like `\\OC\\User\\Manager` etc. Which look like PSR-4 but we do not store them as PSR-4. Because we storate that in `lib/private/user/manager.php`. Proper PSR-4 would be `lib/private/User/Manager.php`.\r\n\r\nAs a result we have our own autoloader that does a lot of string manipulation to get to the correct file when autoloading.\r\n\r\n### Proposal\r\nIt would be good practice I think if we follow proper standards like PSR-4. The two autoloaders can exists side by side without any trouble. And we can slowly migrate existing classes to PSR-4.\r\n\r\nThis brings several advantages:\r\n\r\n- We can use a widely used autoloader, which is not only tested by us but by many other packages as well\r\n  * Note that we already use the composer autoloader for our 3rdparty repo\r\n- Possibility to generate a classmap for releases === faster autoloader\r\n- We can \"eventually\" get rid of our own autoloader. Which means less code to maintain ourself.\r\n\r\nThe apps will still use the old autoloader until we get something like https://github.com/owncloud/core/issues/18804 in. Then moving apps to PSR-4 should also be possible. But baby steps!\r\n\r\n### Discussion\r\nI just want to show that getting the autoloader in is not hard and a minimal code change. Using standards is IMO something we as a serious project should do and we have to start somewhere.\r\n\r\nInput is welcome: @LukasReschke @Xenopathic @nickvergessen @PVince81 @DeepDiver1975 "},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/181300675","html_url":"https://github.com/owncloud/core/pull/21582#issuecomment-181300675","issue_url":"https://api.github.com/repos/owncloud/core/issues/21582","id":181300675,"user":{"login":"schiesbn","id":1589737,"avatar_url":"https://avatars.githubusercontent.com/u/1589737?v=3","gravatar_id":"","url":"https://api.github.com/users/schiesbn","html_url":"https://github.com/schiesbn","followers_url":"https://api.github.com/users/schiesbn/followers","following_url":"https://api.github.com/users/schiesbn/following{/other_user}","gists_url":"https://api.github.com/users/schiesbn/gists{/gist_id}","starred_url":"https://api.github.com/users/schiesbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schiesbn/subscriptions","organizations_url":"https://api.github.com/users/schiesbn/orgs","repos_url":"https://api.github.com/users/schiesbn/repos","events_url":"https://api.github.com/users/schiesbn/events{/privacy}","received_events_url":"https://api.github.com/users/schiesbn/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T10:42:59Z","updated_at":"2016-02-08T10:42:59Z","body":"shouldn't the integrity check developed by @LukasReschke for 9.0 be able to detect if someone does something stupid like just extract the new tar file over their old installation."}}