public static function load($filename)
    {
        if (static::$env != null) {
            return;
        }

        static::$env = json_decode(trim(file_get_contents($filename)), true);

        if (json_last_error() == JSON_ERROR_SYNTAX) {
            throw new \ErrorException('');
        }

        if (json_last_error() == JSON_ERROR_INVALID_PROPERTY_NAME) {
            throw new \ErrorException('Check environment file json syntax (.env.json)');
        }

        if (json_last_error() != JSON_ERROR_NONE) {
            throw new \ErrorException(json_last_error_msg());
        }
    }