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
dev
icanboogie.org
org
The directory "all" contains resources that are shared between all the sites. It is always
added if present. The directory "default" is only added if there no directory matches
$instance
.
To resolve the matching directory, $instance
is first broken into parts and the most
specific ones are removed until a corresponding directory is found. For instance, given
the instance 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 |
$instance = null |
<p>An instance name. If <code>$instance</code> is <code>null</code>, the instance name defaults as follows:</p> <ul> <li>The <code>ICANBOOGIE_INSTANCE</code> environment variable is defined, it is used as instance name.</li> <li>The application runs from the CLI, "cli" is used.</li> <li><code>$_SERVER['SERVER_NAME']</code> is defined, it is used as instance name.</li> </ul> |
Return value summary
string[]
|
An array of absolute paths, ordered from the less specific to the most specific. |