Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions system/dotenv/autoloader.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
<?php

require_once 'Dotenv.php';
require_once 'Loader.php';
require_once 'Validator.php';


if (!function_exists('env')) {
// Define function `env` if it doesn't already exists

/**
* Gets the environment varaible if set or returns the second argument
*
* @param string $varname
* The variable. null will return all environment varaibles
*
* @param mixed $default_value
* The value to return if $varname is not set
*
* @return array|mixed
*/
function env($varname = null, $default_value = "") {
if (is_null($varname)) {
return getenv();
}
return getenv($varname) ? getenv($varname) : $default_value;
}
}