You are here

function RealisticDummyContentEnvironment::file_get_contents in Realistic Dummy Content 7

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/includes/RealisticDummyContentEnvironment.inc, line 63
Define RealisticDummyContentLiveEnvironment autoload class.

Class

RealisticDummyContentEnvironment
The abstract base environment.

Code

function file_get_contents($filename) {
  if (!$filename) {
    throw new RealisticDummyContentException('Please use valid filename');
  }
  if (strpos($filename, '/') === FALSE) {
    throw new RealisticDummyContentException('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;
}