aws / aws-sdk-php

Official repository of the AWS SDK for PHP (@awsforphp)
http://aws.amazon.com/sdkforphp
Apache License 2.0
6k stars 1.21k forks source link

Missing functions in Aws\S3\StreamWrapper #2954

Open p8nut opened 2 months ago

p8nut commented 2 months ago

Describe the feature

Add the missing functions:

Use Case

As I Wrap a Stream in one of my project the interpreter complain about those two function missing.

Proposed Solution

In the php documentation, the two functions have the return value described as Returns true on success or false on failure. If option is not implemented, false should be returned. so we could simply implements the functions like that:

<?php

    public function stream_set_option($option, $arg1, $arg2)
    {
        return false;
    }

    public function stream_metadata($path, $option, $value)
    {
        return false;
    }

see https://www.php.net/manual/en/streamwrapper.stream-set-option.php and https://www.php.net/manual/en/streamwrapper.stream-metadata.php

Other Information

No response

Acknowledgements

SDK version used

3.316.3

Environment details (Version of PHP (php -v)? OS name and version, etc.)

PHP 8.1.27

p8nut commented 1 month ago

dont know if it was planned but it seems possible to implement file lock functions that are missing using the s3 object lock

but i have no idea if it's possible to native implement the truncate functions.

RanVaknin commented 3 weeks ago

Hi @p8nut ,

Thanks for the Feature request and PR. I think this is a valid request. We will have someone review.

All the best, Ran~