googleapis / googleapis/google-cloud-php
Checking gs bucket readability, fails when bucket is not writeable.
Open
api: storage
type: feature request
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 463
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 145
Description
Using the php stream wrapper a call like this `is_readable("gs://foo/bar")` will actually attempt to write to the bucket, in our case it fails as it's read only, but its add a $ cost and latency too. This is because of https://github.com/GoogleCloudPlatform/google-cloud-php/blob/master/Storage/src/StreamWrapper.php#L592 as it's hooked into the stat() call in the stream wrapper http://php.net/manual/en/streamwrapper.url-stat.php
Is this working as designed? Could we perform this check differently?
Contributor guide
Assessment
This issue has not been assessed yet.