Xuanwo opened a new pull request, #9293:
URL: https://github.com/apache/opendal/pull/9293
# Which issue does this PR close?
Refs #9278.
# Rationale for this change
#9278 upgraded `bindings/php` from `ext-php-rs` 0.15.15 to 0.16.5. After
this upgrade, passing invalid UTF-8 in the `$content` string to
`OpenDAL\Operator::write($path, $content)` throws `\TypeError` instead of
`\Exception`, so existing `catch (\Exception $e)` handlers for invalid UTF-8
input need to be updated.
# What changes are included in this PR?
Add a `PHP binding` section to `core/core/src/docs/upgrade.md`:
- Document that `OpenDAL\Operator::write($path, $content)` now throws
`\TypeError` (previously `\Exception`) when `$content` contains invalid UTF-8,
requiring updates to `catch (\Exception $e)` handlers for this input.
- Recommend validating `$content` before calling `write()` for applications
that handle invalid UTF-8 specifically, without relying on diagnostic-message
matching, so the check works across both binding versions and leaves storage
errors for `OpenDAL\Exception` handlers.
- Document passing an array of byte values to `write_binary()` to store
arbitrary bytes.
Verification: tested against a real PHP 8.1.34 runtime before and after the
`ext-php-rs` 0.15.15 -> 0.16.5 upgrade.
# Are there any user-facing changes?
Documentation only (`core/core/src/docs/upgrade.md`).
# Breaking changes
# AI Usage Statement
- **Harness:** Pi (via T3 Code)
**Model:** `magpie/codex/gpt-6.2-sol`
**Effort:** `high`
**Role:** Native validation of the PHP binding behavior change and
independent review of the upgrade documentation.
- **Harness:** Pi (via T3 Code)
**Model:** `magpie/codex/gpt-6.2-sol`
**Effort:** `max`
**Role:** Initial draft of the PHP binding upgrade documentation.
- **Harness:** Pi (via T3 Code)
**Model:** `magpie/codex/gpt-6.2-astra`
**Effort:** `high`
**Role:** Implemented the final revised `core/core/src/docs/upgrade.md`
change (`daf27c6efb`) and verified before/after runtime behavior on PHP 8.1.34.
- **Harness:** Pi (via T3 Code)
**Model:** Gemini 4 Neon
**Effort:** `high`
**Role:** Verified publication preflight (commit signature, tree,
integration onto `main`, duplicate PRs, Actions queue load, and template
compliance), drafted this PR description, and published the PR.
Assumptions/unknowns affecting review: runtime verification covered PHP 8.1.34;
other PHP versions were not separately tested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]