PHPackages                             bear/dotenv - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bear/dotenv

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bear/dotenv
===========

Dotenv utility for BEAR.Sunday

1.1.0(5y ago)2212.9k↓10.9%3MITPHPPHP ^7.3 || ^8.0

Since Aug 25Pushed 3y ago2 watchersCompare

[ Source](https://github.com/bearsunday/BEAR.Dotenv)[ Packagist](https://packagist.org/packages/bear/dotenv)[ RSS](/packages/bear-dotenv/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (4)Used By (3)

BEAR.Dotenv
===========

[](#beardotenv)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6846c1c4b652cff16cfad59fe698693ad5c52b90b70051f0788c69541e933637/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6265617273756e6461792f424541522e446f74656e762f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bearsunday/BEAR.Dotenv/?branch=master)[![Build Status](https://camo.githubusercontent.com/5c1bac7b09c352a09f23c024cdbfd9e7876d7b9cbc18b9a71fb9e1b7b142a250/68747470733a2f2f7472617669732d63692e6f72672f6265617273756e6461792f424541522e446f74656e762e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bearsunday/BEAR.Dotenv)[![Build Status](https://camo.githubusercontent.com/479c29ac48fd93ebc4c3a5d063ce95da4c2d6241e13c153a8fb4464b3d363739/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6265617273756e6461792f424541522e446f74656e762f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bearsunday/BEAR.Dotenv/build-status/master)

Loads environment variables from .env to $\_ENV and $\_SERVER.

Installation
------------

[](#installation)

Installation is via [Composer](https://getcomposer.org/):

```
composer require bear/dotenv
```

Usage
-----

[](#usage)

```
use BEAR\Dotenv\Dotenv;

(new Dotenv)->load($dir);
```

If the `.env.dist` file exists in the `$dir` directory, environment variables are created from it. If you customize locally, the `.env` file is loaded first. If neither file is present, nothing is done. In that case, the environment variables must be provided by means other than the dotenv library.

`.env.dist`が`$dir`ディレクトリにあれば読み込まれ環境変数が作られます。ローカルでカスタマイズする場合には`.env`を用意すれば優先して読み込まれます。 どちらのファイルも無ければ何もしません。その場合、環境変数はdotenvライブラリ以外の方法で用意されなければなりません。

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~319 days

Total

3

Last Release

1454d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.2.0

1.1.0PHP ^7.3 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/db4fc75ffc631168d0d7143b6f2c24b1534dfb921212bd851c026c5cbbb1344d?d=identicon)[koriym](/maintainers/koriym)

---

Top Contributors

[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (37 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bear-dotenv/health.svg)

```
[![Health](https://phpackages.com/badges/bear-dotenv/health.svg)](https://phpackages.com/packages/bear-dotenv)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
