Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.04 KB

input_file_reader_task.md

File metadata and controls

45 lines (33 loc) · 1.04 KB

InputFileReaderTask

Reads the whole content of a file, whose path is given as input, and outputs it as a string. Same behaviour as FileReaderTask, except for the file path.

Task reference

  • Service: CleverAge\ProcessBundle\Task\File\InputFileReaderTask
  • Code: input_file_reader (task: input_file_reader)

Accepted inputs

string: path of the file to read. An UnexpectedValueException is thrown if the input is not a non-empty string (e.g. null, ''), or if the file does not exist or is not readable.

Possible outputs

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

Options

This task has no option.

Examples

  • Read every file of a folder
# Task configuration level
entry:
  task: folder_browser
  options:
    folder_path: '%kernel.project_dir%/var/data'
  outputs: [read]
read:
  task: input_file_reader
  outputs: [debug]