dolfen/env-file-reader 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dolfen/env-file-reader

Composer 安装命令:

composer require dolfen/env-file-reader

包简介

Scanning environment variables from an env file into php environment variables.

README 文档

README

Description

A simple class to read one or more dotenv files from various locations and loading them into the php environment.

TODO: Add instructions on env files.

Badges

On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.

Installation

composer require dolfen/env-file-reader

Usage

Given this directory structure:

├── .env
├── index.php
├── composer.json
├── composer.lock
├── src
│   └── ExampleController.php
└── vendor
    ├── dolfen
    │   └── env-file-reader
    └── ...

We will be loading the environment variables in the index.php.

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use Dolfen\Environment;

Environment::readEnvFile(__DIR__ . '/.env');

$exampleController = new ExampleController();

...

Now you can access the variables set in the dotenv file using getenv().

Contributing

I do not accept any modifications to the codebase by other developers right now, but feel free to raise an issue if you encounter any bug or edge case that I did not catch.

License

This project is licensed under MIT. See license for further information.

统计信息

  • 总下载量: 3.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固