You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ambiguous difference between App.webroot and App.wwwRoot #838
The documentation shows them being essentially the same:
* - webroot - The webroot directory.
* - wwwRoot - The file path to webroot.
'webroot' => 'webroot',
'wwwRoot' => WWW_ROOT,
However, wwwRoot uses a path from paths.php wile webroot hard-codes the same directory in the config.
/*
* File path to the webroot directory.
*
* To derive your webroot from your webserver change this to:
*
* `define('WWW_ROOT', rtrim($_SERVER['DOCUMENT_ROOT'], DS) . DS);`
*/
define('WWW_ROOT', ROOT . DS . 'webroot' . DS);
When would you want the webroot separate from the path? Asset loading from plugins don't use either of these, but instead hard-code the directory name webroot/ in source.
The only use cases I remember around App.webroot are when URL rewriting is off, and the application is in a subdirectory. Plugins are different because their static assets are either served by middleware or the webserver and deployment tooling.
Activity
markstory commentedon Apr 14, 2021
The only use cases I remember around
App.webrootare when URL rewriting is off, and the application is in a subdirectory. Plugins are different because their static assets are either served by middleware or the webserver and deployment tooling.othercorey commentedon Apr 14, 2021
There is one direct use of WWW_ROOT in cakephp/cakephp, but it's in
ServerCommand.The only use of
App.webrootis inServerRequestFactory::updatePath():github-actions commentedon Aug 13, 2021
This issue is stale because it has been open for 120 days with no activity. Remove the
stalelabel or comment or this will be closed in 15 daysgithub-actions commentedon Apr 22, 2022
This issue is stale because it has been open for 120 days with no activity. Remove the
stalelabel or comment or this will be closed in 15 daysdereuromark commentedon Oct 15, 2024
Do we want to tackle this for 5.next or 6.0?