\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
- private static array $targets = ;
- private static array $excluded_folders = ;
- // Inherited members from FilesystemPublisher
- protected string $destFolder;
- protected string $fileExtension;
- // 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 array publishPages()
- protected string generatePHPCacheFile()
- protected string generatePHPCacheRedirection()
- public string getDestDir()
- public array getExistingStaticCacheFiles()
- // Inherited methods from StaticPublisher
- public abstract void publishPages()
- public abstract void unpublishPages()
- public static void set_static_publisher_theme()
- public static string static_publisher_theme()
- public static boolean echo_progress()
- public static void set_echo_progress()
- public void onAfterPublish()
- public void onRenameLinkedAsset()
- public void republish()
- public void onAfterUnpublish()
- public array getMetadata()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
146 | - Make a more memory efficient publisher |
187 | - Make a more memory efficient publisher |
Members
private
- $excluded_folders — array
- $targets — array
protected
- $destFolder — string
- $fileExtension — string
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 destination.
public
- getDestDir()
- getExistingStaticCacheFiles() — Return an array of all the existing static cache files, as a map of URL => file. Only returns cache files that will actually map to a URL, based on urlsToPaths.
- publishPages() — Uses {@link Director::test()} to perform in-memory HTTP requests on the passed-in URLs.
- 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()
- getMetadata()
- onAfterPublish() — Called after a page is published.
- onAfterUnpublish() — 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()
- set_static_publisher_theme()
- static_publisher_theme()
- unpublishPages()