BootstrapConfig
in package
Methods for determining the details of the very initial environment, prior to the rest of the system coming up
This is a fallback class. Define this in your app config folder and load it into your index.php.
Table of Contents
Constants
- ENABLE_FATAL_ERRORS : mixed = \true
- Whether to process fatal errors with the shutdown handler.
- ENABLE_KOHANA_CACHE : mixed = \false
- Toggle Kohana caching for files and configurations.
- ENABLE_MEDIA_CACHE : mixed = \IN_PRODUCTION
- Copy media assets into the target web folder.
- ERROR_REPORTING : mixed = \IN_PRODUCTION ? \E_ALL ^ \E_NOTICE : \E_ALL
- The PHP error reporting level.
- ORIGIN_CLEANUP_DEBUG : mixed = \false
- Turns on the debug mode for origin cleanup, which outputs the redirect which would occur, but doesn't actually perform the redirect
- TIMEZONE : mixed = 'Australia/Adelaide'
- The PHP timezone will be set to this value using date_default_timezone_set
Methods
- originCleanup() : array<string|int, mixed>
- Specify what the protocol and/or hostname which should be for requests If this doesn't match the current values, then a 301 redirect will occur
Constants
ENABLE_FATAL_ERRORS
Whether to process fatal errors with the shutdown handler.
public
mixed
ENABLE_FATAL_ERRORS
= \true
Else uses native display_errors.
ENABLE_KOHANA_CACHE
Toggle Kohana caching for files and configurations.
public
mixed
ENABLE_KOHANA_CACHE
= \false
ENABLE_MEDIA_CACHE
Copy media assets into the target web folder.
public
mixed
ENABLE_MEDIA_CACHE
= \IN_PRODUCTION
This assumes the web server (nginx/apache) will pick up the real file before it defers to the PHP application.
ERROR_REPORTING
The PHP error reporting level.
public
mixed
ERROR_REPORTING
= \IN_PRODUCTION ? \E_ALL ^ \E_NOTICE : \E_ALL
ORIGIN_CLEANUP_DEBUG
Turns on the debug mode for origin cleanup, which outputs the redirect which would occur, but doesn't actually perform the redirect
public
mixed
ORIGIN_CLEANUP_DEBUG
= \false
TIMEZONE
The PHP timezone will be set to this value using date_default_timezone_set
public
mixed
TIMEZONE
= 'Australia/Adelaide'
If set to an empty value then the timezone will not be set, which may cause warnings if the server config has not set the timezone.
Methods
originCleanup()
Specify what the protocol and/or hostname which should be for requests If this doesn't match the current values, then a 301 redirect will occur
public
static originCleanup(string $proto, string $hostname) : array<string|int, mixed>
Default version of this method does nothing, but commented-out examples for common adjustments are included
Parameters
- $proto : string
-
Current request protocol, either 'http' or 'https'
- $hostname : string
-
Current request hostname, e.g. 'example.com'
Return values
array<string|int, mixed> —New values for $proto and $hostname vars. If these are different from the incoming values, then a redirect will occur First element is protocol, second element is hostname Example: ['https', 'www.example.com']