You are here

public function FileSystemBackendFactory::get in File Cache 8

Returns the FileSystemBackend for the specified cache bin.

Parameters

string $bin: The cache bin for which the object is created.

Return value

\Drupal\filecache\Cache\FileSystemBackend The cache backend object for the specified cache bin.

Throws

\Exception Thrown when no path has been configured to store the files for the given bin.

Overrides CacheFactoryInterface::get

File

src/Cache/FileSystemBackendFactory.php, line 76

Class

FileSystemBackendFactory
Factory for creating FileSystemBackend cache backends.

Namespace

Drupal\filecache\Cache

Code

public function get($bin) {
  $path = $this
    ->getPathForBin($bin);
  $strategy = $this
    ->getCacheStrategyForBin($bin);
  return new FileSystemBackend($this->fileSystem, $this->time, $this->checksumProvider, $path, $strategy);
}