-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#155 Add docs for [Input][FileReader|LineReader|FolderBrowser]Tasks
- Loading branch information
1 parent
745db03
commit 75a89e5
Showing
7 changed files
with
260 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FileReaderTask | ||
============= | ||
|
||
Reads a file and return raw content as a string | ||
|
||
Task reference | ||
-------------- | ||
|
||
* **Service**: `CleverAge\ProcessBundle\Task\File\FileReaderTask` | ||
|
||
Accepted inputs | ||
--------------- | ||
|
||
Input is ignored | ||
|
||
Possible outputs | ||
---------------- | ||
|
||
`string`: raw content of the file. | ||
Underlying method is [file_get_contents](https://www.php.net/manual/en/function.file-get-contents.php). | ||
|
||
Options | ||
------- | ||
|
||
| Code | Type | Required | Default | Description | | ||
|------------|----------|:---------:|----------|------------------------------------------| | ||
| `filename` | `string` | **X** | | Path of the file to read from (absolute) | | ||
|
||
Example | ||
------- | ||
|
||
```yaml | ||
# Task configuration level | ||
code: | ||
service: '@CleverAge\ProcessBundle\Task\File\FileReaderTask' | ||
options: | ||
filename: 'path/to/file.txt' | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FolderBrowserTask | ||
============= | ||
|
||
Reads a folder and iterate on each file, returning absolute path as string. | ||
|
||
Task reference | ||
-------------- | ||
|
||
* **Service**: `CleverAge\ProcessBundle\Task\File\FolderBrowserTask` | ||
* **Iterable task** | ||
|
||
Accepted inputs | ||
--------------- | ||
|
||
Input is ignored | ||
|
||
Possible outputs | ||
---------------- | ||
|
||
`string`: absolute path of the file. | ||
Underlying method is [Symfony Finder component](https://symfony.com/doc/current/components/finder.html). | ||
|
||
Options | ||
------- | ||
|
||
| Code | Type | Required | Default | Description | | ||
|-------------------|-------------------------------|:---------:|---------------------------|------------------------------------| | ||
| `folder_path` | `string` | **X** | | Path of the directory to read from | | ||
| `name_pattern` | `null` or `string` or `array` | | null | Restrict files using a pattern | | ||
| `empty_log_level` | `string` | | Psr\Log\LogLevel::WARNING | From Psr\Log\LogLevel constants | | ||
|
||
Example | ||
------- | ||
|
||
```yaml | ||
# Task configuration level | ||
code: | ||
service: '@CleverAge\ProcessBundle\Task\File\FolderBrowserTask' | ||
options: | ||
folder_path: '%kernel.project_dir%/var/data' | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
InputFileReaderTask | ||
============= | ||
|
||
Reads a file and return raw content as a string | ||
|
||
Task reference | ||
-------------- | ||
|
||
* **Service**: `CleverAge\ProcessBundle\Task\File\InputFileReaderTask` | ||
|
||
Accepted inputs | ||
--------------- | ||
|
||
`string`: file path | ||
|
||
Possible outputs | ||
---------------- | ||
|
||
`string`: raw content of the file. | ||
Underlying method is [file_get_contents](https://www.php.net/manual/en/function.file-get-contents.php). | ||
|
||
Options | ||
------- | ||
|
||
None | ||
|
||
Example | ||
------- | ||
|
||
```yaml | ||
# 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' | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
InputFolderBrowserTask | ||
============= | ||
|
||
Reads a folder and iterate on each file, returning absolute path as string. | ||
|
||
Task reference | ||
-------------- | ||
|
||
* **Service**: `CleverAge\ProcessBundle\Task\File\InputFolderBrowserTask` | ||
* **Iterable task** | ||
|
||
Accepted inputs | ||
--------------- | ||
|
||
`string`: folder path | ||
|
||
Possible outputs | ||
---------------- | ||
|
||
`string`: absolute path of the file. | ||
Underlying method is [Symfony Finder component](https://symfony.com/doc/current/components/finder.html). | ||
|
||
Options | ||
------- | ||
|
||
| Code | Type | Required | Default | Description | | ||
|--------------------|----------|:---------:|---------|---------------------------------------| | ||
| `base_folder_path` | `string` | | | Concatenated with input `folder_path` | | ||
|
||
Example | ||
------- | ||
|
||
```yaml | ||
# 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 | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
InputLineReaderTask | ||
============= | ||
|
||
Reads a file and iterate on each line, returning content as string. Skips empty lines. | ||
|
||
Task reference | ||
-------------- | ||
|
||
* **Service**: `CleverAge\ProcessBundle\Task\File\InputLineReaderTask` | ||
* **Iterable task** | ||
|
||
Accepted inputs | ||
--------------- | ||
|
||
`string`: file path | ||
|
||
Possible outputs | ||
---------------- | ||
|
||
`string`: foreach line, it will return content as string. | ||
Underlying method is [SplFileObject](https://www.php.net/manual/en/class.splfileobject.php). | ||
|
||
Options | ||
------- | ||
|
||
None | ||
|
||
Example | ||
------- | ||
|
||
```yaml | ||
# 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' | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
LineReaderTask | ||
============= | ||
|
||
Reads a file and iterate on each line, returning content as string. Skips empty lines. | ||
|
||
Task reference | ||
-------------- | ||
|
||
* **Service**: `CleverAge\ProcessBundle\Task\File\LineReaderTask` | ||
* **Iterable task** | ||
|
||
Accepted inputs | ||
--------------- | ||
|
||
Input is ignored | ||
|
||
Possible outputs | ||
---------------- | ||
|
||
`string`: foreach line, it will return content as string. | ||
Underlying method is [SplFileObject](https://www.php.net/manual/en/class.splfileobject.php). | ||
|
||
Options | ||
------- | ||
|
||
| Code | Type | Required | Default | Description | | ||
|------------|----------|:---------:|----------|------------------------------------------| | ||
| `filename` | `string` | **X** | | Path of the file to read from (absolute) | | ||
|
||
Example | ||
------- | ||
|
||
```yaml | ||
# Task configuration level | ||
code: | ||
service: '@CleverAge\ProcessBundle\Task\File\LineReaderTask' | ||
options: | ||
filename: 'path/to/file.txt' | ||
``` | ||