diff --git a/src/Publisher.php b/src/Publisher.php index 06520914..4a8108f1 100644 --- a/src/Publisher.php +++ b/src/Publisher.php @@ -10,6 +10,7 @@ use SilverStripe\Core\Config\Configurable; use SilverStripe\Core\CoreKernel; use SilverStripe\Core\Environment; +use SilverStripe\Core\Extensible; use SilverStripe\Core\Injector\Injectable; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\FieldType\DBDatetime; @@ -22,6 +23,7 @@ abstract class Publisher implements StaticPublisher { + use Extensible; use Injectable; use Configurable; diff --git a/src/Publisher/FilesystemPublisher.php b/src/Publisher/FilesystemPublisher.php index 63e0c49a..2cbab79c 100644 --- a/src/Publisher/FilesystemPublisher.php +++ b/src/Publisher/FilesystemPublisher.php @@ -109,7 +109,11 @@ public function publishURL($url, $forcePublish = false) return; } $success = false; + + $this->extend('onBeforeGeneratePageResponse', $url); $response = $this->generatePageResponse($url); + $this->extend('onAfterGeneratePageResponse', $url, $response); + $statusCode = $response->getStatusCode(); $doPublish = ($forcePublish && $this->getFileExtension() === 'php') || $statusCode < 400;