Psecio\Gatekeeper\Gatekeeper::loadDotEnv PHP Method

loadDotEnv() protected static method

Load the variables using the .env handling
protected static loadDotEnv ( string $envPath ) : array | boolean
$envPath string Path to the .env file
return array | boolean Array of data if found, false if load fails
    protected static function loadDotEnv($envPath)
    {
        try {
            $dotenv = new \Dotenv\Dotenv($envPath);
            $dotenv->load();
            $config = array('username' => $_SERVER['DB_USER'], 'password' => $_SERVER['DB_PASS'], 'name' => $_SERVER['DB_NAME'], 'type' => isset($_SERVER['DB_TYPE']) ? $_SERVER['DB_TYPE'] : 'mysql', 'host' => $_SERVER['DB_HOST']);
            if (isset($_SERVER['DB_PREFIX'])) {
                $config['prefix'] = $_SERVER['DB_PREFIX'];
            }
            return $config;
        } catch (\Exception $e) {
            return false;
        }
    }