You are here

function DummyEnvironment::_file_get_contents_ in Realistic Dummy Content 8

Internal function used to get the contents of a file.

Wrapper around PHP's file_get_contents() (or a simulation thereof). This function will not return an \Exception. Please use Environment:: file_get_contents(), instead.

Parameters

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

Return value

Undefined in case the filename is invalid; otherwise returns the contents of the file.

Overrides Environment::_file_get_contents_

File

api/src/environments/DummyEnvironment.php, line 32
Define autoload class.

Class

DummyEnvironment
The dummy environment.

Namespace

Drupal\realistic_dummy_content_api\environments

Code

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