-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
The Configuration
class locates in framework
namespace, the default collection name is Configurations
.
Because the framework relies on it regardless of a database connection, this class will automatically fall back to file system when no database connection is available.
Natively it supports JSON files, and YAML is also loaded if the respective extension(s) is available.
The logic is simple.
- If a database connection is available, query and decode the contents.
- If
FALLBACK_DIRECTORY . "/$key.json"
is readable andjson_decode
exists, decodes file contents and merge+
with the configuration object. - If
FALLBACK_DIRECTORY . "/$key.yaml"
is readable andyaml_parse_file
exists, decodes file contents and merge+
with the configuration object.
-
system.domains
-
default
(Optional) The default hostname to use when making and detecting redirections, defaults to the machine network name
gethostname()
. -
secure
(Optional) Hostname to use when redirecting to secure paths, if not defined the redirection will be done in normal mode.
-
local
(Optional) Hostname to local machine, used when making local redirections.
-
service
(Optional) Hostname specifically when making service redirections.
-
-
database.connection
-
driver
string
PDO DSN prefix, currently only
"mysql"
is supported. -
host
string
Host to connect to, defaults null. Which works according to PHP default, usually defined in php.ini.
-
port
int
Connection port
-
schema {string}
(Optional) Database name.
-
user
string
(Optional) Username when making connection.
-
password
string
(Optional) Password when making connection.
-
options
array
(Optional) PDO driver options, refer to the docs according to the chosen driver. String keys in this array are treated as constant names under the
PDO
class, unable to resolve that name skips it.
-