You are here

public function RealisticDummyContentDummyEnvironment::fileGetContents in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/includes/RealisticDummyContentDummyEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDummyEnvironment::fileGetContents()

Get the contents of a file.

Parameters

string $filename: A valid filename, for example /drupal/root/sites/all/modules/ your_module/realistic_dummy_content/fields/node/blog/body/03.txt.

Throws

\Exception

Overrides RealisticDummyContentEnvironment::fileGetContents

File

api/src/includes/RealisticDummyContentDummyEnvironment.php, line 28

Class

RealisticDummyContentDummyEnvironment
The dummy environment.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public function fileGetContents($filename) {
  if (isset($this->files[$filename])) {
    return $this->files[$filename];
  }
  trigger_error('file_get_contents(): failed to open stream');
  return NULL;
}