PHPackages                             crasivo/bitrix-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. crasivo/bitrix-dotenv

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

crasivo/bitrix-dotenv
=====================

Dotenv library adapter for 1C-Bitrix

0.0.2(9mo ago)042MITPHPPHP ^7.2 || ^8.0

Since Sep 11Pushed 9mo agoCompare

[ Source](https://github.com/crasivo/bitrix-dotenv)[ Packagist](https://packagist.org/packages/crasivo/bitrix-dotenv)[ Docs](https://github.com/crasivo/bitrix-dotenv)[ GitHub Sponsors](https://github.com/crasivo)[ RSS](/packages/crasivo-bitrix-dotenv/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

📃 Bitrix Dotenv
===============

[](#-bitrix-dotenv)

Adapter for the popular [Dotenv](https://github.com/vlucas/phpdotenv) library for 1C-Bitrix &amp; Bitrix24.

Implementation features:

- Simple and quick integration into an existing project
- Formatting of scalar values

Minimum requirements for installation:

- 1C-Bitrix kernel version (main): `v20.5.400`
- PHP version: `v7.2`
- Dotenv version: `v5.0`

🚀 Quick Start
=============

[](#-quick-start)

To use the library (adapter), simply install the [Composer](https://getcomposer.org/) package via the command:

```
$ cd /path/to/project
$ composer require crasivo/bitrix-dotenv
```

It is initially assumed that `autoload.php` is already connected to your project. If this is not the case, you can add it to one of the following files:

- `/bitrix/.settings.php`
- `/bitrix/.settings_extra.php`
- `/local/php_interface/init.php`

Next, you need to initialize the `EnvLocator` service (similar to the standard one) and load the environment variables. Below is an example of initializing and loading environment variables.

```
// document root
Crasivo\Bitrix\Dotenv\EnvLocator::getInstance()->load();
// specified dir
Crasivo\Bitrix\Dotenv\EnvLocator::getInstance()->load('/path/to/another/dir');
```

Access to values is via `EnvLocator` or via the helper function `env`. Below are examples of working with environment variables.

```
$envLocator = Crasivo\Bitrix\Dotenv\EnvLocator::getInstance();
echo $envLocator->get('LOG_LEVEL', 'debug'); // 'debug' (string)
echo $envLocator->get('APP_DEBUG', false); // true (bool)
echo $envLocator->get('SOME_INTEGER_PARAM'); // 415454 (integer)
echo $envLocator->get('SOME_FLOAT_PARAM'); // 154.69 (float)
```

Via the helper function:

```
echo env('LOG_LEVEL', 'debug'); // 'debug' (string)
echo env('APP_DEBUG', false); // true (bool)
echo env('SOME_INTEGER_PARAM'); // 415454 (integer)
echo env('SOME_FLOAT_PARAM'); // 154.69 (float)
```

---

📜 License
---------

[](#-license)

This project is distributed under the [MIT](https://en.wikipedia.org/wiki/MIT_License) license. The full text of the license can be read in the corresponding [file](LICENSE).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance57

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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 ~6 days

Total

2

Last Release

288d ago

### Community

Maintainers

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

---

Top Contributors

[![crasivo](https://avatars.githubusercontent.com/u/130065622?v=4)](https://github.com/crasivo "crasivo (5 commits)")

---

Tags

bitrixbitrix24dotenvbitrixadapterdotenv

### Embed Badge

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

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[lullabot/drainpipe

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

43785.5k4](/packages/lullabot-drainpipe)[yiithings/yii2-dotenv

PHP DotEnv for Yii2 framework

42621.3k7](/packages/yiithings-yii2-dotenv)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4149.6k2](/packages/bnomei-kirby3-dotenv)[beebmx/kirby-env

Enable env variables to Kirby

2140.5k3](/packages/beebmx-kirby-env)[johannschopplich/kirby-helpers

Environment, SEO, and build utilities for Kirby CMS

287.9k](/packages/johannschopplich-kirby-helpers)

PHPackages © 2026

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