Download the PHP package takuya/php-proc_open-wrapper without Composer
On this page you can find all versions of the php package takuya/php-proc_open-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download takuya/php-proc_open-wrapper
More information about takuya/php-proc_open-wrapper
Files in takuya/php-proc_open-wrapper
Package php-proc_open-wrapper
Short Description proc_open wrapper to exec command.
License GPL-3.0-or-later
Informations about the package php-proc_open-wrapper
Run Process.
Run process and run string by interpreter(ex.python,bash). and keep process long time task running.
proc_open
is distinctive style. so I make proc_open
EASY and friendly.
Installing
from packagist.
from GitHub repos.
check installation.
sample.php
Test
phpunit
examples
See Examples.
safer process call
This package directly exec command, not using 'shell'.
proc_open executes command directly, without shell ( fork then exec ).
Using proc_open correctly, directory traversal
vulnerability , shell injection
vulnerability will not be occurred. Shell escaping will not be needed. this can reduce risks.
Don't escape string , use array.
use cmd array. not escaping.
proc_open can accept cmd string, but cmd string may be danger(mal-escaping). exec cmd by array is more safe.
you must check arguments.
To prevent directory traversal. you must check args in advance. cmd string cannot be checked, but array can check.
pipe process
Make easy to pipe process by proc_open.
pipe by pure php. It's very painful.
Use this ProcOpen class , reduce cost by naturally call proc_open.
Run string as shell script.
Run string as python code.
run python code in proc_open
Run php interactive shell php -a
Linux pipe max.
Linux pipe will be blocked if left unread.
LINUX_PIPE_SIZE
is 1024*64
.
so if you try to write one more byte (1024*64+1
bytes) to stdout
, process will be blocked by OS.
To avoid blocking, you should use tmp-io.
Or use select syscall
and read the buffer.
All versions of php-proc_open-wrapper with dependencies
ext-pcntl Version *
ext-sysvshm Version *
ext-posix Version *