Skip to content

Support nul log path on Windows - #309

Merged
clue merged 2 commits into
clue:mainfrom
clue-labs:windows-nul
Sep 23, 2026
Merged

clue merged 2 commits into
clue:mainfrom
clue-labs:windows-nul

Conversation

@clue

@clue clue commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

This changeset adds support for passing nul as the log path on Windows and updates the test suite and documentation to use this instead of an absolute path like C:\…\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 with Unable to open log file on these versions. A plain nul works across all PHP versions, so this is now also what the documentation recommends to disable the access log on Windows.

$container = new FrameworkX\Container([
    'accesslog' => DIRECTORY_SEPARATOR !== '\\' ? '/dev/null' : 'nul',
    FrameworkX\AccessLogHandler::class => fn(string $accesslog) => new FrameworkX\AccessLogHandler($accesslog),
]);

Absolute nul paths 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

@clue clue added this to the v0.18.0 milestone Sep 23, 2026
@clue clue added the new feature New feature or request label Sep 23, 2026
@clue
clue requested a lite review from Copilot September 23, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 nul on 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.

@clue
clue merged commit fe275dc into clue:main Sep 23, 2026
75 checks passed
@clue
clue deleted the windows-nul branch September 23, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants