environment
class environment
| internal |
Utility class for environment detection.
Constants
| ENV_PRODUCTION |
|
| ENV_DEVELOPMENT |
|
| ENV_TESTING |
|
Methods
static bool
is_development()
Checks if the application is currently running in development mode.
static bool
is_production()
Checks if the application is currently running in production mode.
static bool
is_testing()
Checks if the application is currently running in testing mode.
static string
get_environment()
Returns the current environment name based on multiple discovery factors.
Details
at line 41
static bool
is_development()
Checks if the application is currently running in development mode.
at line 51
static bool
is_production()
Checks if the application is currently running in production mode.
at line 61
static bool
is_testing()
Checks if the application is currently running in testing mode.
at line 78
static string
get_environment()
Returns the current environment name based on multiple discovery factors.
Priority:
- PHPUNIT_TEST constant (Testing)
- MOODLE_ENV environment variable
- $CFG->middag_env configuration
- Moodle Debug Mode (Developer level implies Development)
- Default: Production