Browses a folder, whose path is given as input, recursively and iterates over each file found (sorted by name), outputting its path. Same behaviour as FolderBrowserTask, except for the folder path.
- Service:
CleverAge\ProcessBundle\Task\File\InputFolderBrowserTask - Iterable task
- Flushable task
string: path of the folder to browse, prefixed by the base_folder_path option. It must be an existing readable
directory.
Receiving a different folder path before the task has been flushed throws a \LogicException.
string: path of the file (folder path followed by the path of the file relative to it).
Underlying component is Symfony Finder.
If no file is found, a message is logged with the empty_log_level level, the task is skipped and the folder path is
set as error output.
| Code | Type | Required | Default | Description |
|---|---|---|---|---|
base_folder_path |
string |
'' |
Prepended to the input path, without adding any separator | |
name_pattern |
string|array|null |
null |
Restrict files by name using a pattern (glob, regexp or string) or an array of patterns (see Finder::name()) |
|
empty_log_level |
string |
warning |
Log level used when no file is found, one of the Psr\Log\LogLevel constants |
The folder_path option of FolderBrowserTask is removed: the path comes from the input.
# Task configuration level
entry:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output: '/var/data'
outputs: [directory]
directory:
service: '@CleverAge\ProcessBundle\Task\File\InputFolderBrowserTask'
options:
base_folder_path: '%kernel.project_dir%'
outputs: [read]
read:
service: '@CleverAge\ProcessBundle\Task\File\InputFileReaderTask'