-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9648e37
commit e893ec3
Showing
1,827 changed files
with
214,568 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
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,8 @@ | ||
filter: | ||
paths: | ||
- source/* | ||
|
||
checks: | ||
php: | ||
code_rating: true | ||
duplication: true |
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,14 @@ | ||
language: php | ||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
before_script: | ||
- composer self-update | ||
- composer install --dev | ||
- phpenv rehash | ||
script: phpunit -v --colors --coverage-text | ||
notifications: | ||
email: | ||
- [email protected] |
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,105 @@ | ||
# Process Pipe Component in PHP | ||
|
||
This component easy up creation of a [pipe](http://en.wikipedia.org/wiki/Pipeline_(computing)) for processes in php. | ||
|
||
Indeed, it is a [pseudo pipeline](http://en.wikipedia.org/wiki/Pipeline_(software)#Pseudo-pipelines) (process collection or process batch) since the php process is single threaded so far. | ||
|
||
Currently, there is no plan to bloat the code base with an implementation of [STDIN](http://en.wikipedia.org/wiki/Standard_streams#Standard_input_.28stdin.29), [STDOUT](http://en.wikipedia.org/wiki/Standard_streams#Standard_output_.28stdout.29) or [STDERR](http://en.wikipedia.org/wiki/Standard_streams#Standard_error_.28stderr.29). | ||
Errors can be handled by the thrown exception. Input is defined by the ExecutableInterface, as well as the output (return value). | ||
|
||
|
||
@todo | ||
The build status of the current master branch is tracked by Travis CI: | ||
[](http://travis-ci.org/bazzline/php_component_process_pipe) | ||
[](https://packagist.org/packages/net_bazzline/php_component_process_pipe) | ||
|
||
|
||
@todo | ||
The scrutinizer status are: | ||
[](https://scrutinizer-ci.com/g/bazzline/php_component_process_pipe/) | [](https://scrutinizer-ci.com/g/bazzline/php_component_process_pipe/) | [](https://scrutinizer-ci.com/g/bazzline/php_component_process_pipe/) | ||
|
||
@todo | ||
The versioneye status is: | ||
[](https://www.versioneye.com/user/projects/53e48c23e0a229172f000146) | ||
|
||
Downloads: | ||
[](https://packagist.org/packages/net_bazzline/php_component_process_pipe) | ||
|
||
@todo | ||
It is also available at [openhub.net](http://www.openhub.net/p/718154). | ||
|
||
# Examples | ||
|
||
* [no input](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/NoInput/run.php] | ||
* [input array](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputArray/run.php] | ||
* [failing execution](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/FailingExecution/run.php] | ||
* [input generator](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputGenerator/run.php] | ||
* [input transformer](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputTransformer/run.php] | ||
* [input validator](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/InputValidator/run.php] | ||
* [data flow manipulator](https://github.com/bazzline/php_component_process_pipe/tree/master/example/Example/DataFlowManipulator/run.php] | ||
|
||
# Install | ||
|
||
## Manuel | ||
|
||
mkdir -p vendor/net_bazzline/php_component_process_pipe | ||
cd vendor/net_bazzline/php_component_process_pipe | ||
git clone https://github.com/bazzline/php_component_process_pipe | ||
|
||
## With [Packagist](https://packagist.org/packages/net_bazzline/php_component_process_pipe) | ||
|
||
composer require net_bazzline/php_component_process_pipe:dev-master | ||
|
||
# Usage | ||
|
||
## By using the pipe method for multiple process | ||
|
||
```php | ||
$pipe = new Pipe(); | ||
|
||
$pipe->pipe( | ||
new ProcessOne(), | ||
new ProcessTwo() | ||
); | ||
|
||
$output = $pipe->execute($input); | ||
|
||
``` | ||
## By using the pipe method once for each process | ||
|
||
```php | ||
$pipe = new Pipe(); | ||
|
||
$pipe->pipe(new ProcessOne()); | ||
$pipe->pipe(new ProcessTwo()); | ||
|
||
$output = $pipe->execute($input); | ||
``` | ||
|
||
## By instantiation | ||
|
||
```php | ||
$pipe = new Pipe( | ||
new ProcessOne(), | ||
new ProcessTwo() | ||
); | ||
|
||
$output = $pipe->execute($input); | ||
``` | ||
|
||
|
||
# API | ||
|
||
Thanks to [apigen](https://github.com/apigen/apigen), the api is available in the [document](https://github.com/bazzline/php_component_process_pipe/blob/master/document/index.html) section or [online](http://code.bazzline.net/). | ||
|
||
# History | ||
|
||
* [1.0.1](https://github.com/bazzline/php_component_process_pipe/tree/1.0.1) - not released yet | ||
* [1.0.0](https://github.com/bazzline/php_component_process_pipe/tree/1.0.0) - not released yet | ||
* initial release | ||
|
||
# Links | ||
|
||
* [pipes](https://github.com/vkartaviy/pipes) | ||
* [php-pipeline](https://github.com/JosephMoniz/php-pipeline) | ||
* [php-pipeline-lib](https://github.com/phppro/php-pipeline-lib) |
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,32 @@ | ||
{ | ||
"description": "php component process to easy up creation of pipe process in php", | ||
"keywords": ["php", "pipe", "process", "component", "process pipe"], | ||
"license": "LGPLv3", | ||
"name": "net_bazzline/php_component_process_pipe", | ||
"type": "library", | ||
"authors": [ | ||
{ | ||
"email": "[email protected]", | ||
"homepage": "https://artodeto.bazzline.et", | ||
"name": "Stev Leibelt", | ||
"role": "Developer" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"require": { | ||
"php": ">=5.3.3" | ||
}, | ||
"require-dev": { | ||
"apigen/apigen": "2.8.1", | ||
"mockery/mockery": "0.9.2", | ||
"phpmd/phpmd": "2.1.3", | ||
"phpunit/phpunit": "4.3.4" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"Example": "example/", | ||
"Net\\Bazzline\\Component\\ProcessPipe": "source/", | ||
"Test\\Net\\Bazzline\\Component\\ProcessPipe": "test/" | ||
} | ||
} | ||
} |
Oops, something went wrong.