PHP code example of gaambo / deployer-wordpress

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

    

gaambo / deployer-wordpress example snippets


localhost()
    ->set('public_url', 'http://wp-boilerplate.test')
    ->set('deploy_path', __DIR__)
    ->set('current_path', '{{deploy_path}}/public') // WordPress root
    ->set('dbdump_path', 'data/db_dumps')
    ->set('backup_path', __DIR__ . '/data/backups');

if (file_exists(__DIR__ . '/wp-config-local.php')) {
    

set('wp/multisite', true);

set('packages', [
    'custom-theme' => [
        'path' => '{{themes/dir}}/custom-theme',
        'remote:path' => '{{themes/dir}}/custom-theme', // optional
        'assets' => true,
        'assets:build_script' => 'build',
        'vendors' => true,              // Run composer install
    ],
    // Add more packages as needed
]);