geoffry304 / yii2-enveditor
Yii2 Env 编辑器
v1.4
2019-02-20 11:08 UTC
Requires
- kartik-v/yii2-grid: ^3.2.6
- templesuite/yii2-ajaxcrud: dev-master
- vlucas/phpdotenv: ^2.5
- yiisoft/yii2: ~2.0.14
This package is auto-updated.
Last update: 2024-09-20 23:08:43 UTC
README
模块和组件,用于编辑 .env 文件
安装
安装 yii2-enveditor 的首选方式是通过 Composer。您可以将以下内容添加到您的 composer.json
文件的 require 部分中
"geoffry304/yii2-enveditor": "*"
或者运行
$ php composer.phar require geoffry304/yii2-enveditor "*"
您可以通过 下载 ZIP 格式的源代码 来手动安装 yii2-enveditor。
更新配置文件
// app/config/web.php return [ 'components' => [ 'env' => [ 'class' => '\geoffry304\enveditor\components\EnvComponent', 'autoBackup' => true, 'backupPath' => "backups", ], ], 'modules' => [ 'enveditor' => [ 'class' => '\geoffry304\enveditor\Module', 'allowedIds' => "1,2,3" ], ], ];
选项
模块 有以下选项来修改其行为
- allowedIds: 具有模块访问权限的用户ID,多个ID用逗号分隔。
组件 有以下选项来修改其行为
- filePath: .env 文件的路径。默认为 basepath/.env
- autoBackup: 是否自动备份。默认为 true
- backupPath: 存储备份的文件夹。默认为 backups
特别感谢 JackieDo
使用了他的 Laravel 代码,使其在 Yii2 中运行。