Source of file PrefixCachePurgeJob.php
Size: 0,959 Bytes - Last Modified: 2021-12-23T10:07:25+00:00
/var/www/docs.ssmods.com/process/src/src/Jobs/PrefixCachePurgeJob.php
12345678910111213141516171819202122232425262728293031323334 | <?php namespace NSWDPC\Utilities\Cloudflare; use SilverStripe\Core\Injector\Injector; use Symbiote\Cloudflare\Cloudflare; /** * Purge cache by prefix or prefixes * Note: requires a CF Enterprise account * @author James Ellis <james.ellis@dpc.nsw.gov.au> */ class PrefixCachePurgeJob extends AbstractRecordCachePurgeJob { public function getTitle() { return parent::getTitle() . " - " . _t(__CLASS__ . '.JOB_TITLE', 'CF purge prefix(es)'); } /** * Process the job */ public function process() { try { $values = $this->checkRecordForErrors('prefixes'); $this->checkPurgeResult( $this->getPurgeClient()->purgePrefixes($values['prefixes']) ); } catch (\Exception $e) { $this->addMessage("Cloudflare: failed to purge prefixes with error=" . $e->getMessage() . " of type " . get_class($e)); $this->isComplete = false; } return false; } } |