RFC: 6.x: Use public/ instead of webroot/
I think with v6 we should finally fix this up to be consistent with all other frameworks and the intuitive understanding of
- whats actually "public" from the outside, accessible directly
- and whats "under the hood"
This would make CakePHP compatible with https://github.com/php-pds/skeleton
Symfony, Laravel and the other major PHP frameworks all use this for years, and it also makes the transition from them to Cake easier, as well as provide less hacks needed for dev tools (e.g. ddev needs to customize this internally to fit Cake).
One thing I always do wrong is where I put user generated content. Could be a js, pdf, xls, etc.
I tend to put it at webroot/generated/idl, webroot/generated/xls, etc.
but then other places i put it in generated at the same level as webroot. There should kinda be a default as sometimes I end up making the entire webroot read-write when in theory I should only make a generated dir writable and everything else read-only to the webserver.
More correctness about "webroot" would be helpful.
Is the generated content supposed to be internal or external (= accessible via URL)?
- external: webroot/files/... for example
- internal: resources/...
I'm on-board with this change :+1:
Thought about this a bit more, what happens with plugins, and the core command line tools for moving webroot files around? Do those start to support both public and webroot?
Thats why 6.x It probably should be a hard cut.
Thought about this a bit more, what happens with plugins, and the core command line tools for moving webroot files around? Do those start to support both public and webroot?
I was wondering if for plugins we should use the folder name assets, since they are made publicly accessible through the AssetMiddleware (or symlinking under app's webroot/public folder).
It probably should be a hard cut.
Meaning 6.x won't be backwards compatible with the plugins that use webroot naming?
Yes it will per App i think to some extend. Because this is a skeleton and config change.