PHP Classes

PHP Environment Variables Detection: Detect the current PHP environment variables

Recommend this page to a friend!
  Info   View files Documentation   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 61 All time: 10,404 This week: 113Up
Version License PHP version Categories
environment 1.0MIT/X Consortium ...5PHP 5, Configuration


Ahir Ar-Ge
Özgür Adem I??kl?
Till Wehowski


This package can detect the current PHP environment variables.

It can check a given directory or the current directory to find a dotenv (.env) file with configuration values specific to the current HTTP request host based on a list of possible environment setups.

The package can load the environment variables if it finds the dotenv file and initializes the system environment variables with the loaded values.

Innovation Award
PHP Programming Innovation award nominee
July 2022
Number 8
dotenv is a popular format used by many developers to store configuration values.

It is language-independent, so applications written in different languages can easily read the files written in that format.

Usually, dotenv files exist in a fixed location relative to the path of a project.

If you have multiple projects, you may need to find the path of the dotenv file to load the correct configuration file.

This package can test different paths and find the correct location based on a list of possible setups for your projects and the current HTTP host.

Manuel Lemos
Picture of Till Wehowski
  Performance   Level  
Name: Till Wehowski <contact>
Classes: 30 packages by
Country: Germany Germany
Age: 45
All time rank: 107569 in Germany Germany
Week rank: 110 Up5 in Germany Germany Up
Innovation award
Innovation award
Nominee: 12x



This is a environment library for quick environment setup. Forked from ahirarge/environment


To install through composer, simply put the following in your composer.json file:

    "require": {
        "frdl/environment": "*",



$environment = new Frdlweb\Environment\Environment;
                'local' =>[
                    'required' => true,
                    'hosts' => ['your-machine-name']


$environment = new Frdlweb\Environment\Environment;
                'local' =>[
                    'required' => false,
                    'hosts' => ['your-machine-name']

> You can check your machine name with hostname command.


return [
        'secret-password' => 'secret-password-value'



    "environment": "development"

$secret = getenv('secret-password');


If you wish, you can use environment library with facade connector. Please visit for guideline. ahir/facades



  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageFrdlweb (1 directory)

  Files folder image Files  /  src  /  Frdlweb  
File Role Description
Files folder imageEnvironment (1 file)

  Files folder image Files  /  src  /  Frdlweb  /  Environment  
File Role Description
  Accessible without login Plain text file Environment.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,404
This week:113Up