WebEnvironment

Utility API to verify which environment is the web application running.

The utility will check initially for the existence of a system property under the name vertx.mode, if there is no such property then it will look under the environment variables under the name VERTX_MODE.

This value will be then used when the API is invoked. By itself this utility will not affect the behavior of your application, however you can use it to simplify your handlers, e.g.:

When the development mode is active you can log more information or disable caches.

package

Default

Methods

__construct

__construct() 

Will return true if the mode is not null and equals ignoring case the string "dev"

development() : boolean
static

Response

boolean

always boolean

The current mode from the system properties with fallback to environment variables

mode() : string
static

Response

string

String with mode value or null

Constants

SYSTEM_PROPERTY_NAME

SYSTEM_PROPERTY_NAME
var

php文件只是为了写代码方便,常量的实际值请参考原java文件

ENV_VARIABLE_NAME

ENV_VARIABLE_NAME
var

php文件只是为了写代码方便,常量的实际值请参考原java文件