Skip to content

feat(storage): support fopen modes x and xb#9159

Merged
kalragauri merged 4 commits intogoogleapis:mainfrom
salilg-eng:feat/upgrade-modes-fopen
May 5, 2026
Merged

feat(storage): support fopen modes x and xb#9159
kalragauri merged 4 commits intogoogleapis:mainfrom
salilg-eng:feat/upgrade-modes-fopen

Conversation

@salilg-eng
Copy link
Copy Markdown
Contributor

  • Goal: Add support for x and xb modes in fopen for Google Cloud Storage (fixes PHP fopen is supported with the modes X and XB #5132).
  • What these modes do: They create a file and fail if the file already exists.
  • Changes in StreamWrapper.php:
    • Added a check to fail immediately if the file exists.
    • Used ifGenerationMatch => 0 to ensure atomicity and prevent overwrites safely.
  • Changes in Tests:
    • Added unit tests in StreamWrapperTest.php (Passed).
    • Added system tests in WriteTest.php (To be verified on CI).

@salilg-eng salilg-eng requested review from a team as code owners May 4, 2026 15:31
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 4, 2026
Copy link
Copy Markdown
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@bshaffer bshaffer added the next release PRs to be included in the next release label May 4, 2026
@kalragauri kalragauri assigned kalragauri and unassigned kalragauri May 5, 2026
@kalragauri kalragauri self-requested a review May 5, 2026 04:15
@kalragauri kalragauri merged commit 563c2f9 into googleapis:main May 5, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. next release PRs to be included in the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP fopen is supported with the modes X and XB

3 participants