fgh151/yii2-backup

Database Backup and Restore functionality

Installs: 23

Dependents: 0

Suggesters: 0

Stars: 4

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.0.2 2016-01-11 12:43 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