PHP code example of floor12 / yii2-module-backup

1. Go to this page and download the library: Download floor12/yii2-module-backup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

floor12 / yii2-module-backup example snippets

  
 'modules' => [
            'backup' =>  [
                'class' => 'floor12\backup\Module',
                'backupFolder' => '/mnt/raid10/backups',
                'administratorRoleName' => '@',
                'configs' => [
                    'mysql_db' => [
                        'type' => BackupType::DB,
                        'title' => 'Mysql Database',
                        'connection' => 'db',  // component from app config, usually 'db' 
                        'limit' => 0
                    ],
                    'postgres_db' => [
                        'type' => BackupType::DB,
                        'title' => 'PostgresQL database',
                        'connection' => 'example_connection_name', // component from app config, usually 'db'
                        'io' => IOPriority::REALTIME,
                        'limit' => 0
                    ],
                    'user_files_backup' => [
                        'type' => BackupType::FILES,
                        'title' => 'User uploaded files',
                        'path' => '@app/user_files',
                        'io' => IOPriority::IDLE,
                        'limit' => 0
                    ]
                ]
            ]
        ]
     ...