Darken\Config\ConfigHelperTrait

trait

Trait ConfigHelperTrait This trait is used to provide helper methods for the configuration classes.

Methods

Method Details

public string path (string $path) ConfigHelperTrait.php#25

Ensure that the path is normalized.

  • Convert all directory separators into / (e.g. "\a/b\c" becomes "/a/b/c")
  • Remove trailing directory separators (e.g. "/a/b/c/" becomes "/a/b/c")
  • Turn multiple consecutive slashes into a single one (e.g. "/a///b/c" becomes "/a/b/c")
  • Remove ".." and "." based on their meanings (e.g. "/a/./b/../c" becomes "/a/c")
$path string
Return string
public void loadEnvFile () ConfigHelperTrait.php#33

Load the environment variables from the .env file into the $_ENV superglobal.

Return void
public string|bool|int env (string $name, string|bool|int $default) ConfigHelperTrait.php#53

Access the environment variables from the $_ENV superglobal using getenv().

$name string
$default string|bool|int
Return string|bool|int