You are here

AcquiaPurgeExecutorPageCache.php in Acquia Purge 7

Contains AcquiaPurgeExecutorPageCache.

File

lib/executor/AcquiaPurgeExecutorPageCache.php
View source
<?php

/**
 * @file
 * Contains AcquiaPurgeExecutorPageCache.
 */

/**
 * Executor that pre-clears URLs from Drupal's page cache.
 */
class AcquiaPurgeExecutorPageCache extends AcquiaPurgeExecutorBase implements AcquiaPurgeExecutorInterface {

  /**
   * {@inheritdoc}
   */
  public static function isEnabled(AcquiaPurgeService $service) {
    if ($service
      ->hostingInfo()
      ->isPageCacheFake()) {
      return FALSE;
    }
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function invalidate($invalidations) {
    foreach ($invalidations as $invalidation) {
      cache_clear_all($invalidation
        ->getUri(), 'cache_page');
      $invalidation
        ->setStatusSucceeded();
    }
  }

}

Classes

Namesort descending Description
AcquiaPurgeExecutorPageCache Executor that pre-clears URLs from Drupal's page cache.