Reads a file, whose path is given as input, and iterates over its lines, outputting each line as a string. Same behaviour as LineReaderTask, except for the file path.
- Service:
CleverAge\ProcessBundle\Task\File\InputLineReaderTask - Iterable task
string: path of the file to read. An \UnexpectedValueException is thrown if the file does not exist or is not
readable. The file is released once fully read, so each input (the same path again or a different one) is read from
its beginning.
string: for each line, its raw content. The line break is not removed.
Underlying class is SplFileObject, with the READ_AHEAD and
SKIP_EMPTY flags.
This task has no option.
- Read every line of 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\InputLineReaderTask'
outputs: [log_line]