You are here

function Environment::file_get_contents in Realistic Dummy Content 8

Get the contents of a file.

Parameters

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

Throws

\Exception

File

api/src/environments/Environment.php, line 69
Define autoload class.

Class

Environment
The abstract base environment.

Namespace

Drupal\realistic_dummy_content_api\environments

Code

function file_get_contents($filename) {
  if (!$filename) {
    throw new Exception('Please use valid filename');
  }
  if (strpos($filename, '/') === FALSE) {
    throw new Exception('Please use an absolute filename including its path, which must always contain at least one slash. You are using ' . $filename);
  }
  $return = $this
    ->_file_get_contents_($filename);
  return $return;
}