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. When a different path is received, the previous file is dropped and the new one is opened.
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]