Support nul log path on Windows - #309
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The only outstanding item is a minor documentation clarification; no blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Adds support for using plain nul as the Windows log path, compatible with recent PHP versions.
Changes:
- Accepts case-insensitive
nulon Windows. - Updates tests and integration fixtures.
- Updates application documentation.
| File | Summary |
|---|---|
tests/Io/LogStreamHandlerTest.php |
Adds Windows null-device path coverage. |
tests/integration/public/index.php |
Uses plain nul for integration logging. |
tests/AppTest.php |
Updates test logger configuration. |
tests/AppMiddlewareTest.php |
Updates middleware test logger configuration. |
tests/AccessLogHandlerTest.php |
Uses plain nul for disabled logging. |
src/Io/LogStreamHandler.php |
Recognizes Windows nul; PHPDocs should document this exception. |
docs/api/app.md |
Documents plain nul on Windows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset adds support for passing
nulas the log path on Windows and updates the test suite and documentation to use this instead of an absolute path likeC:\…\nul. The latest PHP releases reject reserved Windows device names as part of a path as a fix for GHSA-9f67-6fw4-hpfp, so our Windows tests started failing withUnable to open log fileon these versions. A plainnulworks across all PHP versions, so this is now also what the documentation recommends to disable the access log on Windows.Absolute
nulpaths continue to work on older PHP versions and remain covered by the test suite, so this should be safe to apply.Builds on top of #247, #296, #31 and others