function PhpStorageInterface::load

Same name in other branches
  1. 9 core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php \Drupal\Component\PhpStorage\PhpStorageInterface::load()
  2. 10 core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php \Drupal\Component\PhpStorage\PhpStorageInterface::load()
  3. 11.x core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php \Drupal\Component\PhpStorage\PhpStorageInterface::load()

Loads PHP code from storage.

Depending on storage implementation, exists() checks can be expensive, so this function may be called for a file that doesn't exist, and that should not result in errors. This function does not return anything, so it is up to the caller to determine if any code was loaded (for example, check class_exists() or function_exists() for what was expected in the code).

Parameters

string $name: The virtual file name. Can be a relative path.

2 methods override PhpStorageInterface::load()
FileReadOnlyStorage::load in core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php
Loads PHP code from storage.
FileStorage::load in core/lib/Drupal/Component/PhpStorage/FileStorage.php
Loads PHP code from storage.

File

core/lib/Drupal/Component/PhpStorage/PhpStorageInterface.php, line 39

Class

PhpStorageInterface
Stores and loads PHP code.

Namespace

Drupal\Component\PhpStorage

Code

public function load($name);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.