Get support for PedroTroller/PHPetroleum
If you're new to LTH, please see our FAQ for more information on what it is we do.
Support Options
Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:
View Open IssuesTake a look to see if anyone else has experienced the same issue as you and if they managed to solve it.
Open an IssueMake sure to read any relevant guidelines for opening issues on this repo before posting a new issue.
Sponsor directlyCheck out the page and see if there are any options to sponsor this project or it's developers directly.
PedroTroller/PHPetroleum
PHPetroleum
Because at least one good thing comes from petroleum industry
Installation
composer require pedrotroller/phpetroleum ~1.0.0
Usage
Create a simple pipe
$pipe = new PHPetroleum\Pipe('/tmp/pipe');
Then you, are able to write some content on this Pipe
$pipe->write('some content');
Or you can wait for content
$content = $pipe->read();
Use stream
One-way stream
$pipe = new PHPetroleum\Pipe('/tmp/input');
$stream = new PHPetroleum\Stream\ReaderStream($pipe);
$content = $stream->read();
$pipe = new PHPetroleum\Pipe('/tmp/output');
$stream = new PHPetroleum\Stream\WriterStream($pipe);
$stream->write($content);
Two-way stream
This stream is using tow pipes, one to read content, the other one to answer.
$input = new PHPetroleum\Pipe('/tmp/input');
$output = new PHPetroleum\Pipe('/tmp/output');
$stream = new PHPetroleum\Stream\TwoWayStream($input, $output);
$content = $stream->read();
$stream->write('Other content');
How did it works
The Pipe object will push two elements into the pipe file, the message size and the message itself.
By default, the message size is stored into 8 bytes but you can change the size.
For exemle, if you write test
, the entire message will be 00000004test
(00000004
is the size for the message, test
the message itself)
If you set the message size length to 6 (php $pipe = new PHPetroleum\Pipe('/tmp/file', 6);
) test
will be stored 000004test
Our Mission
We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.
From the Blog
Interesting Articles
-
Generating income from open source
Jun 23 • 8 min read
-
2023 State of OSS
Apr 23 • 45 min read ★
-
A funding experiment...
Aug 19 • 10 min read
-
But You Said I could
Aug 19 • 2 min read
Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated
p-e622a1a2