PHP code example of grrr-amsterdam / simply-static-deploy

1. Go to this page and download the library: Download grrr-amsterdam/simply-static-deploy 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/ */

    

grrr-amsterdam / simply-static-deploy example snippets


/** Sets up WordPress vars and included files. */

define('SIMPLY_STATIC_DEPLOY_CONFIG', [
    'aws' => [
        'key' => '...', # AWS access key
        'secret' => '...', # AWS secret key
        'region' => '...', # AWS region
        'bucket' => '...', # S3 bucket
        'bucket_acl' => '...', # S3 bucket ACL (optional, defaults to `public-read`)
        'distribution' => '...', # CloudFront distribution ID (optional, step is skipped when empty)
        'endpoint' => '...', # For usage with providers other than AWS (optional)
    ],
    'url' => '...', # Website url (used for displaying url after deploy is finished)
]);

add_filter('simply_static_deploy_additional_files', function (array $files) {
    # Modify files, and possibly resolve paths with `realpath`.
    return $files;
});

add_filter('simply_static_deploy_additional_urls', function (array $urls) {
    # Modify urls, for example by adding missing pages.
    return $urls;
});

add_filter('simply_static_deploy_recursive_excludable', function (
    $excludable,
    string $staticPageUrl,
    string $recursiveUrl
) {
    # Modify excludable url logic, for example ignore excludeable url setting when current page contains the recursiveUrl
    return $excludable;
});

add_action('simply_static_deploy_error', function (\WP_Error $error) {
    # Handle the error.
});

add_action('simply_static_deploy_modify_generated_files', function (
    string $directory
) {
    # Modify generated files, like renaming or moving them.
});

do_action('simply_static_deploy_schedule', '12:00', 'daily');

define('DISABLE_WP_CRON', true);

add_action('simply_static_deploy_complete' , function (\Simply_Static\Options $options) {
    // Finished static deploy job.
});
cron
*/5 * * * * curl https://example.com/wp/wp-cron.php?doing-cron > /dev/null 2>&1