fgh151/yii2-backup

Database Backup and Restore functionality

Installs: 1 090

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.2 2016-01-11 12:43 UTC

This package is auto-updated.

Last update: 2024-09-28 23:00:35 UTC


README

Русская документация доступна на сайте OpenItStudio

Yii2 Backup and Restore Database

Database Backup and Restore functionality

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist fgh151/yii2-backup "*"

or add

"fgh151/yii2-backup": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply add it in your config by :

Basic config/web.php

Advanced [backend|frontend|common]/config/main.php

    'modules'    => [
        'backup' => [
            'class' => 'fgh151\modules\backup\Module',
        ],
        ...
        ...
    ],

Console php 'bootstrap' => ['backup'], 'modules' => [ 'backup' => [ 'class' => 'fgh151\modules\backup\Module', 'path' => '@backend/_backup/' //path alias of backup dir ] ],

make sure you create a writable directory named _backup on app root directory.

RBAC

You can use RBAC with module. Simply add it in your config:

        'modules'    => [
             'backup' => [
                 'class' => 'fgh151\modules\backup\Module',
                 'as access' => [
                     'class' => 'yii\filters\AccessControl',
                     'rules' => [
                         [
                             'allow' => true,
                             'roles' => ['admin'],
                         ]
                     ]
                 ]
             ]
            ...
            ...
        ],

Usage

Pretty Url's /backup

No pretty Url's index.php?r=backup

Console yii backup/backup