cakephp / cakephp/app

Ambiguous difference between App.webroot and App.wwwRoot

Open
#838 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pinned
Dominant language
PHP
Stars
387
Forks
392
Avg merge
6m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the documentation and paths.php definitions for App.webroot and App.wwwRoot, then trace the plugin asset-loading references to the hard-coded webroot/ path. Clarify when the two settings differ and how asset loading relates to them; done means the documentation gives an unambiguous explanation and examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.