indextank/yii2-plugin-env 问题修复 & 功能扩展

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

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

indextank/yii2-plugin-env

Composer 安装命令:

composer require indextank/yii2-plugin-env

包简介

PHP DotEnv for Yii2 framework

README 文档

README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Yii 2 框架添加.env功能,实现类似于Lavaral框架中的.env功能。使框架配置更简单,更利于维护。本项目基于yiithings/yii2-dotenv。

本项目内含2个全局调试方法: p()和dd(),替代echo()、print_r()等输出函数;

p($a, $b):打印变量,支持数组,格式化显示,不中断打印后续的输出,类似于:echo "<pre>";print_r($a);echo "----";print_r($b);
dd($a):打印变量,支持数组,格式化显示,中断打印后续的输出,类似于:echo "<pre>";print_r($A);exit()

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist indextank/yii2-plugin-env "*"

or add

"indextank/yii2-plugin-env": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

[
    'db' => [
        'password' => penv('DB_PASS'),
    ],
]

The env function will autoload .env file, it uses the following search mechanism:

If there is a Yii class, then pass the alias @vendor or @app or @yii, Otherwise 
according to the project directory to determine.

But, if your application vendor directory is a symbol link and you no registered @vendor or @app alias before call env function, the project will not working. So you should set the @vendor alias before calling env function.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固