You are here

class BoostCacheHandler in Boost 8

BoostCacheHandler class.

Hierarchy

Expanded class hierarchy of BoostCacheHandler

1 file declares its use of BoostCacheHandler
BoostCache.php in src/BoostCache.php
Contains Drupal\boost\BoostCache

File

src/BoostCacheHandler.php, line 15
Contains Drupal\boost\BoostCacheHandler.

Namespace

Drupal\boost
View source
class BoostCacheHandler {

  /**
   * @var \Drupal\boost\BoostCacheFile
   */
  protected $file;

  /**
   * Constructs a new BoostCacheHandler.
   */
  public function __construct() {
    $this->file = new BoostCacheFile(\Drupal::service('file_system'));
  }

  /**
   * Load a file by uri.
   * @param string $uri
   */
  public function getCache($uri) {
    return $this->file
      ->load($uri);
  }

  /**
   * Delete cache file.
   * @param string $path
   */
  public function deleteCache($uri) {
    return $this->file
      ->delete($uri);
  }

  /**
   * Save boost cache file.
   */
  public function setCache($uri, $content) {
    $this->file
      ->save($uri, $content);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BoostCacheHandler::$file protected property
BoostCacheHandler::deleteCache public function Delete cache file.
BoostCacheHandler::getCache public function Load a file by uri.
BoostCacheHandler::setCache public function Save boost cache file.
BoostCacheHandler::__construct public function Constructs a new BoostCacheHandler.