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
-
DataObjectDecorator
-
StaticPublisher
-
FilesystemPublisher
Direct known subclasses
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. |
public
|
|
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 |
public
|
|
public
|
|
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 |
protected
|
#
generatePHPCacheRedirection( mixed $destination )
Generate the templated content for a PHP script that can serve up a 301 redirect to the given destionation |
public
|
|
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. |
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
|
$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(). |
Properties inherited from StaticPublisher
$disable_realtime,
$echo_progress,
$static_publisher_theme