Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.25 KB

File metadata and controls

44 lines (31 loc) · 1.25 KB

FileReaderTask

Reads the whole content of a file, whose path is set in the options, and outputs it as a string.

Task reference

  • Service: CleverAge\ProcessBundle\Task\File\FileReaderTask

Accepted inputs

Input is ignored

Possible outputs

string: raw content of the file. Underlying method is file_get_contents.

Options

Code Type Required Default Description
filename string X Path of the file to read. An \UnexpectedValueException is thrown if the file does not exist or is not readable

Examples

# Task configuration level
entry:
  service: '@CleverAge\ProcessBundle\Task\File\FileReaderTask'
  options:
    filename: '%kernel.project_dir%/var/data/sample.txt'
  outputs: [debug]

Notes