{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/4383","labels_url":"https://api.github.com/repos/composer/composer/issues/4383/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/4383/comments","events_url":"https://api.github.com/repos/composer/composer/issues/4383/events","html_url":"https://github.com/composer/composer/issues/4383","id":103843882,"number":4383,"title":"Wildcard expansion in the autoload definition?","user":{"login":"lauthiamkok","id":427931,"avatar_url":"https://avatars.githubusercontent.com/u/427931?v=3","gravatar_id":"","url":"https://api.github.com/users/lauthiamkok","html_url":"https://github.com/lauthiamkok","followers_url":"https://api.github.com/users/lauthiamkok/followers","following_url":"https://api.github.com/users/lauthiamkok/following{/other_user}","gists_url":"https://api.github.com/users/lauthiamkok/gists{/gist_id}","starred_url":"https://api.github.com/users/lauthiamkok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauthiamkok/subscriptions","organizations_url":"https://api.github.com/users/lauthiamkok/orgs","repos_url":"https://api.github.com/users/lauthiamkok/repos","events_url":"https://api.github.com/users/lauthiamkok/events{/privacy}","received_events_url":"https://api.github.com/users/lauthiamkok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-29T10:40:44Z","updated_at":"2015-08-30T03:01:45Z","closed_at":null,"body":"I think Composer should have wildcard expansions in the autoload definition as it doesn't make sense while you can do that in `\"require\"`, such as `\"slim/views\": \"0.1.*\"` but not in `\"autoload\"`.\r\n\r\nIt would be so good if I can do like this,\r\n\r\n````\r\n{\r\n    \"require\": {\r\n        \"slim/slim\": \"~2.0\",\r\n        \"slim/views\": \"0.1.*\"\r\n    },\r\n    \"autoload\": {\r\n        \"psr-4\": {\r\n            \"Foo\\\\\": [\r\n                \"module/*/source/\"\r\n            ]\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nInstead of writing a long list of paths,\r\n\r\n```\r\n\"module/Artcle/source/\"\r\n\"module/Book/source/\"\r\n\"module/Contact/source/\"\r\n\"module/Admin/Article/source/\"\r\n\"module/Admin/Book/source/\"\r\n\"module/Admin/Contact/source/\"\r\n```\r\n\r\nfor if I have this structure in my app,\r\n\r\n```\r\nmyapp/\r\n  config/ (config and setup)\r\n  module/ (tons of modules!)\r\n     Article/ (one of the modules)\r\n        source/ (<----- note that all php psr4 classes are stored in this folder)\r\n           Article\r\n              Model/\r\n                 ArticleModel.php\r\n                 ArticlesModel.php\r\n              Controller/\r\n              View/\r\n     Book/ (one of the modules)\r\n       ....(the structure is the same as Article's)\r\n  public/  (web site doc root)\r\n  vendor/\r\n    composer/\r\n    ...(other packages)\r\n```\r\n\r\nIt would be great if this can be considered into the future versions of Composer."},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/136075612","html_url":"https://github.com/composer/composer/issues/4383#issuecomment-136075612","issue_url":"https://api.github.com/repos/composer/composer/issues/4383","id":136075612,"user":{"login":"lauthiamkok","id":427931,"avatar_url":"https://avatars.githubusercontent.com/u/427931?v=3","gravatar_id":"","url":"https://api.github.com/users/lauthiamkok","html_url":"https://github.com/lauthiamkok","followers_url":"https://api.github.com/users/lauthiamkok/followers","following_url":"https://api.github.com/users/lauthiamkok/following{/other_user}","gists_url":"https://api.github.com/users/lauthiamkok/gists{/gist_id}","starred_url":"https://api.github.com/users/lauthiamkok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauthiamkok/subscriptions","organizations_url":"https://api.github.com/users/lauthiamkok/orgs","repos_url":"https://api.github.com/users/lauthiamkok/repos","events_url":"https://api.github.com/users/lauthiamkok/events{/privacy}","received_events_url":"https://api.github.com/users/lauthiamkok/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T03:01:45Z","updated_at":"2015-08-30T03:01:45Z","body":"I think you don't understand the issue I raised. "}}