Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.01 KB

File metadata and controls

44 lines (32 loc) · 1.01 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

Accepted inputs

string: path of the file to read. An \UnexpectedValueException is thrown 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:
  service: '@CleverAge\ProcessBundle\Task\File\FolderBrowserTask'
  options:
    folder_path: '%kernel.project_dir%/var/data'
  outputs: [read]
read:
  service: '@CleverAge\ProcessBundle\Task\File\InputFileReaderTask'
  outputs: [debug]