Commit 837247a2 authored by alexpott's avatar alexpott

Issue #2905109 by iainp999, gawaksh, msankhala, joachim, borisson_, alexpott:...

Issue #2905109 by iainp999, gawaksh, msankhala, joachim, borisson_, alexpott: DrupalKernel::guessApplicationRoot() should document what the assumptions are and what it's doing

(cherry picked from commit 03a3058d)
parent 9130e65f
...@@ -298,12 +298,16 @@ public function __construct($environment, $class_loader, $allow_dumping = TRUE, ...@@ -298,12 +298,16 @@ public function __construct($environment, $class_loader, $allow_dumping = TRUE,
} }
/** /**
* Determine the application root directory based on assumptions. * Determine the application root directory based on this file's location.
* *
* @return string * @return string
* The application root. * The application root.
*/ */
protected static function guessApplicationRoot() { protected static function guessApplicationRoot() {
// Determine the application root by:
// - Removing the namespace directories from the path.
// - Getting the path to the directory two levels up from the path
// determined in the previous step.
return dirname(dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__)))); return dirname(dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment