Русская документация доступна на сайте OpenItStudio
Database Backup and Restore functionality
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.
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
'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.
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'],
]
]
]
]
...
...
],
Pretty Url's /backup
No pretty Url's index.php?r=backup
Console yii backup/backup
Comments