class PhpStorageFactory (View source)

Creates a php storage object.

Methods

get(string $name)

Instantiates a storage for generated PHP code.

Details

static PhpStorageInterface get(string $name)

Instantiates a storage for generated PHP code.

By default, this returns an instance of the \Drupal\Component\PhpStorage\MTimeProtectedFileStorage class.

Classes implementing \Drupal\Component\PhpStorage\PhpStorageInterface can be registered for a specific bin or as a default implementation.

Parameters

string $name

The name for which the storage should be returned. Defaults to 'default' The name is also used as the storage bin if one is not specified in the configuration.

Return Value

PhpStorageInterface

An instantiated storage for the specified name.