Download the PHP package xiaoniuge/think-dotenv without Composer

On this page you can find all versions of the php package xiaoniuge/think-dotenv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-dotenv

介绍

ThinkPHP 3.2 集成 php-dotenv

composer中文文档

dotenv简介

dotenv 解决一套代码在多处部署时各处代码所用的环境变量及配置的相互独立问题:

  1. 团队协作时, 不同成员本地开发环境的系统,服务器类型,数据库用户密码都可能不同. 如果环境配置写死在项目中, 可能每次更新完代码都需要重新修改本地配置.

  2. 本地与线上环境配置肯定不同, 如果直接利用版本库部署代码到线上, 必须防止将本地配置推送到线上.

  3. 新增加入一个自定义的 .env

使用

安装篇

配置篇

修改 .gitignore, 添加.env文件到排除列表

现在你可以在项目根目录(即APP_PATH目录)下创建.env文件定义独立的环境配置了! 就是这么简单.

默认行为

原来

现在

应用启动后, .env 文件中的配置项将覆盖config.php中的这些同名的配置项.

因此, 不同的机器,通过创建自己的.env文件,就可以避免开发和部署时的配置冲突问题.

注: windows平台创建以.号开头的特殊文件可能需要从编辑器中创建.

现在你就可以去验证下是否OK了。

复杂配置

TP中有些配置的值是数组, 使用 dotenv的配置格式为: KeyP1.KeyP2.Key...=value

例如:

如果想使用 .env 文件进行配置, 文件内容如下:

高级用法

一般情况下, 以上默认行为已经足够应付绝大多数场景. 但也许你也需要dotenv提供的其他功能(见文档).

think-dotenv 提供了以下配置对应dotenv提供的其他功能:

注意: 这些配置必须定义在 Conf/config.php 等配置文件中.


All versions of think-dotenv with dependencies

PHP Build Version
Package Version
Requires josegonzalez/dotenv Version ^1.0
snowair/think-hookagent Version >=0.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xiaoniuge/think-dotenv contains the following files

Loading the files please wait ....