Download the PHP package balint-horvath/dotenv-php without Composer
On this page you can find all versions of the php package balint-horvath/dotenv-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download balint-horvath/dotenv-php
More information about balint-horvath/dotenv-php
Files in balint-horvath/dotenv-php
Download balint-horvath/dotenv-php
More information about balint-horvath/dotenv-php
Files in balint-horvath/dotenv-php
Vendor balint-horvath
Package dotenv-php
Short Description Simple .env file parser and ENV loader (.env to getenv() and $_ENV) based on standard PHP INI parser (parse_ini_file).
License Apache-2.0
Package dotenv-php
Short Description Simple .env file parser and ENV loader (.env to getenv() and $_ENV) based on standard PHP INI parser (parse_ini_file).
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package dotenv-php
dotenv
Simple .env file parser and ENV loader (.env
to getenv()
and $_ENV
) based on standard PHP INI parser (parse_ini_file).
Supported methods:
- getenv(variable)
- getenv(section_variable)
- $_ENV[variable]
- $_ENV[section_variable]
- $dotenv->variable
- $dotenv->section->variable
- $dotenv[variable]
- $dotenv[section][variable]
Examples
- Usage Example (PHP Code)
- Example INI (.ini)
Installation
To install this library, you need to use Composer in your project. If you are not using Composer yet, here's how to install:
via Composer
Phar
Example Environment File (INI) (.env)
Usage (Instance)
Class
Namespace: \BalintHorvath\DotEnv\
Class: DotEnv
Properties
(string)
path: Directory of .env file or full path to your ini file. (default:../../../
)(bool)
setEnvironmentVariables: If it'strue
, variables will be available via environment ($_ENV
,getenv()
), otherwise (iffalse
) they'll be available only via the DotEnv as object or array ($dotenv->
$dotenv[]
). (default:true
)(bool)
processSections: If it'strue
, variables will be organized under sections ($dotenv->section
$dotenv[section]
), otherwise sections will have no matter. (default:true
)(bool)
scannerMode: If it'sINI_SCANNER_TYPED
, values0
/off
/"false"
/false
will becomebool
false
, values1
/on
/"true"
/true
will becomebool
true
. Can either beINI_SCANNER_NORMAL
orINI_SCANNER_RAW
. IfINI_SCANNER_RAW
is supplied, then option values will not be parsed. (See PHP Manual: parse_ini_file and PHP Manual: Predefined Constants for more.) (default:INI_SCANNER_TYPED
)
Example
Getting environment variables
Object Access
Usage:
Example:
ENV Access ($_ENV)
Usage:
Example:
ENV Access (getenv)
Usage:
Example:
Array Access
Usage:
Example:
Dependencies
Developer Dependencies
- Kahlan 4 (kahlan/kahlan:^4.0)
Unit & BDD Test
This package has included test cases for Kahlan.
PSR
PSR-4 Autoload
- \BalintHorvath\DotEnv\
All versions of dotenv-php with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
The package balint-horvath/dotenv-php contains the following files
Loading the files please wait ....