Up to date

This page is up to date for Godot 4.3. If you still find outdated information, please open an issue.

ENV

Inherits: Object

This class provides access to environment variables file.

Description

This class provides access to environment variables file.

Properties

bool

debug

false

Methods

void

clear()

Dictionary

config(file: String, override: bool = false)

Variant

get_env(key: String)

bool

has_env(key: String)

Dictionary

parse(data: String)

Dictionary

populate(env: Dictionary, override: bool = false)

Dictionary

refresh(override: bool = false)

void

set_env(key: String, value: Variant)


Signals

cleared() 🔗

Signal emitted when all environment variables are cleared.


file_loaded(file: String, env: Dictionary) 🔗

Signal emitted when a file is loaded.


refreshed(env: Dictionary) 🔗

Signal emitted when environment variables are refreshed.


updated(key: String, value: String) 🔗

Signal emitted when an environment variable is updated.


Property Descriptions

bool debug = false 🔗

  • void set_debug(value: bool)

  • bool get_debug()

Controls debug mode.


Method Descriptions

void clear() 🔗

Clears all environment variables


Dictionary config(file: String, override: bool = false) 🔗

Loads environment variables from file.


Variant get_env(key: String) 🔗

Returns the value of the environment variable key.


bool has_env(key: String) 🔗

Returns true if the environment variable key exists.


Dictionary parse(data: String) 🔗

Parses the data into a dictionary.


Dictionary populate(env: Dictionary, override: bool = false) 🔗

Populates environment variables from env.

Override existing variables if override is true.


Dictionary refresh(override: bool = false) 🔗

Refreshes environment variables.

Override existing variables if override is true.


void set_env(key: String, value: Variant) 🔗

Sets the value of the environment variable key to value.