Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • FilesystemPublisher
  • RsyncMultiHostPublisher
  • StaticPublisher

Class FilesystemPublisher

Usage: Object::add_extension("SiteTree", "FilesystemPublisher('static-folder', 'html')");

Usage: To work with Subsite module you need to:

  • Add FilesystemPublisher::$domain_based_caching = true; in mysite/_config.php
  • Added main site host mapping in subsites/host-map.php after everytime a new subsite is created or modified

You may also have a method $page->pagesAffectedByUnpublishing() to return other URLS that should be de-cached if $page is unpublished.

Extension
Extended by DataObjectDecorator
Extended by StaticPublisher
Extended by FilesystemPublisher

Direct known subclasses

RsyncMultiHostPublisher

Package: cms\publishers
See: http://doc.silverstripe.com/doku.php?id=staticpublisher
Located at cms/code/staticpublisher/FilesystemPublisher.php

Methods summary

public static
# set_static_base_url( mixed $url )

Set a different base URL for the static copy of the site. This can be useful if you are running the CMS on a different domain from the website.

Set a different base URL for the static copy of the site. This can be useful if you are running the CMS on a different domain from the website.

public
# __construct( mixed $destFolder, mixed $fileExtension = null )

Parameters

$destFolder
$destFolder The folder to save the cached site into. This needs to be set in sapphire/static-main.php as well through the $cacheBaseDir variable.
$fileExtension
$fileExtension The file extension to use, e.g 'html'. If omitted, then each page will be placed in its own directory, with the filename 'index.html'. If you set the extension to PHP, then a simple PHP script will be generated that can do appropriate cache & redirect header negotation.

Overrides

Extension::__construct
public Array
# urlsToPaths( Array $urls )

Transforms relative or absolute URLs to their static path equivalent. This needs to be the same logic that's used to look up these paths through sapphire/static-main.php. Does not include the FilesystemPublisher::$destFolder prefix. Replaces various special characters in the resulting filename similar to SiteTree::generateURLSegment().

Transforms relative or absolute URLs to their static path equivalent. This needs to be the same logic that's used to look up these paths through sapphire/static-main.php. Does not include the FilesystemPublisher::$destFolder prefix. Replaces various special characters in the resulting filename similar to SiteTree::generateURLSegment().

Examples (without $domain_based_caching): - http://mysite.com/mywebroot/ => /index.html (assuming your webroot is in a subfolder) - http://mysite.com/about-us => /about-us.html - http://mysite.com/parent/child => /parent/child.html

Examples (with $domain_based_caching): - http://mysite.com/mywebroot/ => /mysite.com/index.html (assuming your webroot is in a subfolder) - http://mysite.com/about-us => /mysite.com/about-us.html - http://myothersite.com/about-us => /myothersite.com/about-us.html - http://subdomain.mysite.com/parent/child => /subdomain.mysite.com/parent/child.html

Parameters

$urls
Array $urls Absolute or relative URLs

Returns

Array
Map of original URLs to filesystem paths (relative to FilesystemPublisher::$destFolder).
public
# unpublishPages( mixed $urls )
public
# publishPages( mixed $urls )
protected
# generatePHPCacheFile( mixed $content, mixed $age, mixed $lastModified )

Generate the templated content for a PHP script that can serve up the given piece of content with the given age and expiry

Generate the templated content for a PHP script that can serve up the given piece of content with the given age and expiry

protected
# generatePHPCacheRedirection( mixed $destination )

Generate the templated content for a PHP script that can serve up a 301 redirect to the given destionation

Generate the templated content for a PHP script that can serve up a 301 redirect to the given destionation

public
# getDestDir( )
public
# 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.

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.

Methods inherited from StaticPublisher

echo_progress(), externalReferencesFor(), onAfterPublish(), onAfterUnpublish(), onRenameLinkedAsset(), republish(), set_echo_progress(), set_static_publisher_theme(), static_publisher_theme()

Methods inherited from DataObjectDecorator

augmentDatabase(), augmentSQL(), augmentWrite(), can(), canCreate(), canDelete(), canEdit(), extraStatics(), flushCache(), load_extra_statics(), onAfterDelete(), onAfterWrite(), onBeforeDelete(), onBeforeWrite(), populateDefaults(), requireDefaultRecords(), updateCMSActions(), updateCMSFields(), updateFieldLabels(), updateFrontEndFields(), updateSummaryFields()

Methods inherited from Extension

clearOwner(), getOwner(), get_classname_without_arguments(), setOwner()

Magic methods summary

Properties summary

protected String $destFolder
#
protected String $fileExtension
#
protected static String $static_base_url
#
public static Boolean $domain_based_caching
#

Use domain based cacheing (put cache files into a domain subfolder) This must be true if you are using this with the "subsites" module. Please note that this form of caching requires all URLs to be provided absolute (not relative to the webroot) via SiteTree->AbsoluteLink().

Use domain based cacheing (put cache files into a domain subfolder) This must be true if you are using this with the "subsites" module. Please note that this form of caching requires all URLs to be provided absolute (not relative to the webroot) via SiteTree->AbsoluteLink().

Properties inherited from StaticPublisher

$disable_realtime, $echo_progress, $static_publisher_theme

Properties inherited from DataObjectDecorator

$decoratable_statics

Properties inherited from Extension

$allowed_actions, $class, $owner, $ownerBaseClass

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0