PHP code example of aerni / sync

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

    

aerni / sync example snippets




return [

    /*
    |--------------------------------------------------------------------------
    | Remotes
    |--------------------------------------------------------------------------
    |
    | Define on or more remotes you want to sync with.
    | Each remote is an array with 'user', 'host', 'root', and optional 'port'.
    |
    */

    'remotes' => [

        // 'production' => [
        //     'user' => 'forge',
        //     'host' => '104.26.3.113',
        //     'port' => 1431,
        //     'root' => '/home/forge/statamic.com',
        //     'read_only' => false,
        // ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Recipes
    |--------------------------------------------------------------------------
    |
    | Define one or more recipes with the paths you want to sync.
    | Each recipe is an array of paths relative to your project's root.
    |
    */

    'recipes' => [

        // 'assets' => ['storage/app/assets/', 'storage/app/img/'],

    ],

    /*
    |--------------------------------------------------------------------------
    | Options
    |--------------------------------------------------------------------------
    |
    | An array of default rsync options.
    | You can override these options when executing the command.
    |
    */

    'options' => [
        '--archive',
    ],

];

'remotes' => [

    'production' => [
        'user' => 'forge',
        'host' => '104.26.3.113',
        'port' => 1431,
        'root' => '/home/forge/statamic.com',
        'read_only' => env('SYNC_PRODUCTION', true),
    ],

],

'recipes' => [
    'assets' => ['storage/app/assets/', 'storage/app/img/'],
    'env' => ['.env'],
],

'options' => [
    '--archive',
],
bash
php artisan vendor:publish --provider="Aerni\Sync\SyncServiceProvider"
bash
php artisan [command] [operation] [remote] [recipe] [options]
bash
php artisan sync pull staging assets
bash
php artisan sync pull staging assets --dry
bash
php artisan sync pull staging assets --verbose
bash
php artisan sync:list pull staging assets
bash
php artisan sync:commands pull staging assets