From 610c8cae18ecae42336b90ad8c5d6a3a90d24242 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 15 Oct 2009 22:44:14 +0000 Subject: [PATCH] MINOR disable realtime publishing for unit tests MINOR fix a test that makes no sense MINOR a couple bugs around embargo/expiry have been fixed (from r85505) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89222 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/staticpublisher/StaticPublisher.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/staticpublisher/StaticPublisher.php b/code/staticpublisher/StaticPublisher.php index f043d67a..b8869cd8 100644 --- a/code/staticpublisher/StaticPublisher.php +++ b/code/staticpublisher/StaticPublisher.php @@ -11,6 +11,10 @@ abstract class StaticPublisher extends DataObjectDecorator { */ static $echo_progress = false; + // Realtime static publishing... the second a page + // is saved, it is written to the cache + static $disable_realtime = false; + abstract function publishPages($pages); abstract function unpublishPages($pages); @@ -27,6 +31,8 @@ abstract class StaticPublisher extends DataObjectDecorator { } function onAfterPublish($original) { + if (self::$disable_realtime) return; + $urls = array(); if($this->owner->hasMethod('pagesAffectedByChanges')) { @@ -59,6 +65,8 @@ abstract class StaticPublisher extends DataObjectDecorator { * functionality */ function onAfterUnpublish($page) { + if (self::$disable_realtime) return; + if($this->owner->hasMethod('pagesAffectedByUnpublishing')) { $urls = $this->owner->pagesAffectedByUnpublishing(); $urls = array_unique($urls);