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