\RsyncMultiHostPublisher
This static publisher can be used to deploy static content to multiple hosts, by generating the cache files locally and then rsyncing then to each destination box. This can be used to set up a load-balanced collection of static servers.
Synopsis
class RsyncMultiHostPublisher
extends FilesystemPublisher
{
- // members
- protected static array $targets = ;
- protected static array $excluded_folders = ;
- // Inherited members from FilesystemPublisher
- protected String $destFolder;
- protected String $fileExtension;
- protected static String $static_base_url;
- public static Boolean $domain_based_caching;
- // Inherited members from StaticPublisher
- public static boolean $echo_progress;
- public static boolean $disable_realtime;
- public static boolean $static_publisher_theme;
- // methods
- public static void set_targets()
- public static void set_excluded_folders()
- public void publishPages()
- // Inherited methods from FilesystemPublisher
- public static void set_static_base_url()
- public void __construct()
- public Array urlsToPaths()
- public void unpublishPages()
- public void publishPages()
- protected void generatePHPCacheFile()
- protected void generatePHPCacheRedirection()
- public void getDestDir()
- public void getExistingStaticCacheFiles()
- // Inherited methods from StaticPublisher
- public abstract void publishPages()
- public abstract void unpublishPages()
- public static void echo_progress()
- public static void set_echo_progress()
- public void onAfterPublish()
- public void onRenameLinkedAsset()
- public void republish()
- public void onAfterUnpublish()
- public void externalReferencesFor()
- public void set_static_publisher_theme()
- public void static_publisher_theme()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
128 | - Make a more memory efficient publisher |
147 | - Make a more memory efficient publisher |
Members
protected
- $destFolder — String
- $excluded_folders
- $fileExtension — String
- $static_base_url — String
-
$targets
Array of rsync targets to publish to. These can either be local file names, or scp-style targets, in the form "user@server:path"
public
-
$disable_realtime
Realtime static publishing... the second a page is saved, it is written to the cache - $domain_based_caching — Boolean
-
$echo_progress
Defines whether to output information about publishing or not. By default, this is off, and should be turned on when you want debugging (for example, in a cron task) - $static_publisher_theme
Methods
public
- publishPages()
- set_excluded_folders() — Specify folders to exclude from the rsync For example, you could exclude assets.
- set_targets() — Set the targets to publish to.
Inherited from FilesystemPublisher
protected
- generatePHPCacheFile() — Generate the templated content for a PHP script that can serve up the given piece of content with the given age and expiry
- generatePHPCacheRedirection() — Generate the templated content for a PHP script that can serve up a 301 redirect to the given destionation
public
- getDestDir()
- getExistingStaticCacheFiles() — Return an array of all the existing static cache files, as a map of URL => file.
- publishPages()
- set_static_base_url() — Set a different base URL for the static copy of the site.
- unpublishPages()
- urlsToPaths() — Transforms relative or absolute URLs to their static path equivalent.
Inherited from StaticPublisher
public
- echo_progress()
- externalReferencesFor() — Get all external references to CSS, JS,
- onAfterPublish() — Called after a page is published.
- onAfterUnpublish() — On after unpublish, get changes and hook into underlying functionality
- onRenameLinkedAsset() — Called after link assets have been renamed, and the live site has been updated, without an actual publish event.
- publishPages()
- republish()
- set_echo_progress() — Either turns on (boolean true) or off (boolean false) the progress indicators.
- set_static_publisher_theme()
- static_publisher_theme()
- unpublishPages()