geoffry304/yii2-enveditor

Yii2 Env editor

Installs: 1 871

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 2

Open Issues: 0

Type:yii2-component

v1.4 2019-02-20 11:08 UTC

This package is auto-updated.

Last update: 2024-12-20 23:51:00 UTC


README

Latest Version Total Downloads

Module and component to edit env file

Installation

The preferred way to install yii2-enveditor is through Composer. Either add the following to the require section of your composer.json file:

"geoffry304/yii2-enveditor": "*"

Or run:

$ php composer.phar require geoffry304/yii2-enveditor "*"

You can manually install yii2-enveditor by downloading the source in ZIP-format.

Update the config file

// 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"
        ],
    ],
];

Options

Module Has the following options to modify it's behaviour:

  • allowedIds: The userids who have access to the module, multiple ids with comma separated.

Component Has the following options to modify it's behaviour:

  • filePath: The path to the .env file. Default to the basepath/.env
  • autoBackup: Autobackup to true or false. Default to true
  • backupPath: The folder where the backups need to be stored. Default to backups

Special thanks to JackieDo

Used his Laravel code to make it work in Yii2.