Function resolve_app_paths
Resolves the paths where the application can look for config, locale, modules, and more.
Consider an application root directory with the following directories:
all
cli
default
fr
icanboogie.fr
localhost
org
The directory "all" contains resources that are shared between all the sites. It is always
added if it is present. The directory "default" is only used if a directory matching
$server_name
cannot be found. The directory "cli" is used when the application is ran
from the CLI.
To resolve the matching directory, $server_name
is first broken into parts and the most
specific ones are removed until a corresponding directory is found. For instance, given
the server name "www.icanboogie.localhost", the following directories are tried:
"www.icanboogie.localhost", "icanboogie.localhost", and finally "localhost".
Parameters summary
string |
$root |
The absolute path of a root directory. |
string|null |
$server_name = null |
<p>A server name. If <code>$server_name</code> is <code>null</code>, it is resolved from <code>PHP_SAPI</code> and <code>$_SERVER['SERVER_NAME']</code>. If <code>PHP_SAPI</code> equals "cli", then "cli" is used, otherwise <code>$_SERVER['SERVER_NAME']</code> is used.</p> |
Return value summary
string[]
|
An array of absolute paths, ordered from the less specific to the most specific. |