reactphp / filesystem

Evented filesystem access.
MIT License
135 stars 40 forks source link

Unable to extend React\Filesystem\ChildProcess\Proces #88

Closed zkabic closed 3 years ago

zkabic commented 3 years ago

I need to implement @flock() on file but I couldn't find the way to do it.

I already try to extend React\Filesystem\ChildProcess\Adapter and React\Filesystem\ChildProcess\Proces to owerride React\Filesystem\ChildProcess\Process::open() but I get error:

Call to undefined method React\Filesystem\ChildProcess\Process::open()

Class React\Filesystem\ChildProcess\Proces is called even if I extend this class.

My Adapter class look like this:

class Adapter extends  React\Filesystem\ChildProcess\Adapter
{
    const CHILD_CLASS_NAME = '\MyNamespace\ChildProcess\Process';
}

and I extend `Process class with:

public function open(array $payload)
{
    $this->fd = @fopen($payload['path'], $payload['flags']);
    // here I could set fopen()
    return \React\Promise\resolve([
        'result' => (string)$this->fd,
    ]);
}

I'm not sure if this is an actual problem or if I missed something