New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adistoe/env-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adistoe/env-loader

A loader for environment variables

Source
Packagist
Version
1.2.0
Version published
Total downloads
514
Maintainers
1
Created
Source

EnvLoader

A PHP class to load environment variables from .env files

Installation

Install it using composer:

composer require adistoe/env-loader

Getting Started

Create a .env file or copy the .env.example (rename it to .env) and modify it as needed.
Then you can load the file with the following code:

EnvLoader::load('path/to/your/project/');

If no .env file exists in the given path, the EnvLoader will automatically search for a .env file in all subdirectories.

If the file is loaded correctly you can access your environment variables with over the php function:

getenv('NAME_OF_THE_VARIABLE');

FAQs

Package last updated on 24 Oct 2025

Related posts