PHP code example of demi / dropbox-backup

1. Go to this page and download the library: Download demi/dropbox-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/ */

    

demi / dropbox-backup example snippets


return [
    'controllerMap' => [
        'backup' => [
            'class' => 'demi\backup\dropbox\BackupController',
            // Name of \demi\backup\Component in Yii components.
            // Default Yii::$app->backup
            'backupComponent' => 'backup',
            // Dropbox app identifier
            'dropboxAppKey' => '65pwea8lqgbq5dm',
            // Dropbox app secret
            'dropboxAppSecret' => 'k2x0sl8a7wfj7h9',
            // Access token for user which will be get up backups.
            // To get this navigate to
            // https://www.dropbox.com/developers/apps/info/<AppKey>
            // and press OAuth 2: Generated access token button.
            'dropboxAccessToken' => 'kFflkUk7K3AAAAAAAAAAEh2tNeQbPbOX8Z11wk0rSdFfYMb5B5VX6kTvkcWz5N8R',
            // Path in the dropbox folder where would be saved backups
            'dropboxUploadPath' => '/',
            // If true: will be deleted files in the
            // dropbox when $expiryTime has come
            'autoDelete' => true,
            // Number of seconds after which the file is
            // considered deprecated and will be deleted.
            'expiryTime' => 30 * 86400, // 30 days
            // @see more options here [\console\controllers\BackupController]  
        ],
    ],
];
bash
php yii backup