承接 rfussien/dotenv 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

rfussien/dotenv

Composer 安装命令:

composer require rfussien/dotenv

包简介

dotenv loader/parser improved for performance

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Requirements

PHP >= 5.6 | >= 7.0 | >= 7.1
⚠️ HHVM not supported so far ⚠️

Install

Via Composer

$ composer require rfussien/dotenv

Usage

$dotenv = new Rfussien\Dotenv\Loader(__DIR__);
$dotenv->load();

// optionally you can set a different filename (by defaul .env)
$dotenv = new Rfussien\Dotenv\Loader(__DIR__, '.my.env');
$dotenv->load();

Why should I use this dotenv loader instead of another ?

This package is meant to be faster than the other dotenv loaders.
But please, don't believe me, check my small benchmark out, and try it by yourself.

It has less features, but come on, it's about a config file and a minimum computing should be done...

IMHO:

  • A real boolean MUST NOT be between quotes
  • A string SHOULD be between quotes or double quotes
  • An empty value is not null, but an empty string
  • Computing nested values every single time my app runs is a waste of time

Results

In the .env type value
K01=true bool true
K02=tRuE bool true
K03="true" string(4) "true"
K04=on bool true
K05=On bool true
K06="on" string(2) "on"
K07=yes bool true
K08=Yes bool true
K09="yes" string(3) "yes"
K10=false bool false
K11=fAlSe bool false
K12="false" string(5) "false"
K13=off bool false
K14=Off bool false
K15="off" string(3) "off"
K16=no bool false
K17=No bool false
K18="no" string(2) "no"
K19=1 int 1
K20=1.1 double 1.1
K21=value string(5) "value"
K22="value" string(5) "value"
K23="VaLuE" string(5) "VaLuE"
K24=VaLuE string(5) "VaLuE"
K25="value " value" string(13) "value " value"
K26="value "value" value" string(19) "value "value" value"
K27="value 'value' value" string(19) "value 'value' value"
K28="" string(0) ""
K29= value string(5) "value"
K30='value' string(5) "value"
K31='' string(0) ""
K32= string(0) ""
K33=null NULL NULL

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email remi.fussien@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固