FileReadOnlyStorage::load

public FileReadOnlyStorage::load($name)

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.

Overrides PhpStorageInterface::load

File

core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php, line 41

Class

FileReadOnlyStorage
Reads code as regular PHP files, but won't write them.

Namespace

Drupal\Component\PhpStorage

Code

public function load($name) {
  // The FALSE returned on failure is enough for the caller to handle this,
  // we do not want a warning too.
  return (@include_once $this->getFullPath($name)) !== FALSE;
}
doc_Drupal
2016-10-29 09:13:32
Comments
Leave a Comment

Please login to continue.