Skip to content

phpinfo improvements - #99

Open
pavetheway91 wants to merge 1 commit into
kjdev:masterfrom
pavetheway91:phpinfo-improvements
Open

phpinfo improvements#99
pavetheway91 wants to merge 1 commit into
kjdev:masterfrom
pavetheway91:phpinfo-improvements

Conversation

@pavetheway91

@pavetheway91 pavetheway91 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
  • "Brotli support enabled" doesn't provide any information, so just remove it
  • show if brotli is bundled or not
  • show if brotli is the active serializer for apcu or if apcu isn't loaded
  • rename serializer ABI to interface
  • if apcu support wasn't built, show that it could have been built

Summary by CodeRabbit

  • New Features

    • Extension information now displays the Brotli extension version, library source and version, dictionary support, and APCu serializer status.
  • Bug Fixes

    • Improved diagnostic reporting for bundled or external Brotli libraries and APCu availability, including clearer configuration-specific status details.
  • Tests

    • Expanded coverage to validate extension details, library configuration, dictionary support, APCu states, and consistent diagnostic output.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ff819c6-258c-42e2-8661-c40030b5e5d9

📥 Commits

Reviewing files that changed from the base of the PR and between 7f962d4 and 80884c9.

📒 Files selected for processing (2)
  • brotli.c
  • tests/info.phpt
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/info.phpt
  • brotli.c

📝 Walkthrough

Walkthrough

The Brotli module information output now reports extension, library, dictionary, and APCu serializer status. The information test captures this output and validates expected values across Brotli and APCu configurations.

Changes

Brotli information reporting

Layer / File(s) Summary
Module information status
brotli.c
The module information output reports the extension version, Brotli library source and version, dictionary support, and APCu serializer status.
Information output validation
tests/info.phpt
The test captures ReflectionExtension('brotli')->info() output and validates Brotli, dictionary, APCu, and fixed MIME status lines across supported configurations.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies improvements to the phpinfo output, which is the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/info.phpt`:
- Around line 72-98: Update the MIME-check section in tests/info.phpt to execute
validation before printing success: scan all entries in $lines for the “Built-in
output compression exclusions => ” row rather than using fixed indices, parse
its MIME values, report invalid values or a missing row as failures, and print
“MIMEs OK” only when the row exists and every MIME matches the expected format.
- Line 39: Update the assertion around the dictionary-status check in
tests/info.phpt to derive the expected enabled or disabled value from the
configured BROTLI_DICTIONARY_SUPPORT setting, then require an exact match
against $lines[3] instead of accepting either state.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aca54509-8114-48f3-995a-c8b7f2c7879d

📥 Commits

Reviewing files that changed from the base of the PR and between 7f962d4 and e990d20.

📒 Files selected for processing (2)
  • brotli.c
  • tests/info.phpt

Comment thread tests/info.phpt Outdated
Comment thread tests/info.phpt
Comment on lines +72 to +98
echo "MIMEs OK\n";
/*
$search = 'Built-in output compression exclusions => ';
$mimeIndex = null;
// could be 5 or 6 depending on apcu
foreach([5, 6] as $index) {
if (isset($lines[$index]) && substr($lines[$index], 0, 42) == $search) {
$mimeIndex = $index;
}
}
if ($mimeIndex) {
$types = explode(', ', substr($lines[$mimeIndex], 42));
$invalidTypes = [];
foreach($types as $type) {
if (!preg_match('/^([a-z]+)\/(([a-z0-9\-\.]+)|\*)$/', $type)) {
$invalidTypes[] = $type;
}
}
if ($invalidTypes) {
echo "Fail: " . implode(", ", $invalidTypes) . "\n";
} else {
echo "MIMEs OK\n";
}
} else {
echo "Fail\n";
}
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore MIME validation before reporting success.

Line 72 always prints "MIMEs OK". The commented validation no longer detects a missing or invalid MIME row. Restore the validation and scan $lines for the MIME row instead of relying on a fixed index, because the APCu rows vary by build state.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/info.phpt` around lines 72 - 98, Update the MIME-check section in
tests/info.phpt to execute validation before printing success: scan all entries
in $lines for the “Built-in output compression exclusions => ” row rather than
using fixed indices, parse its MIME values, report invalid values or a missing
row as failures, and print “MIMEs OK” only when the row exists and every MIME
matches the expected format.

@pavetheway91
pavetheway91 force-pushed the phpinfo-improvements branch from e990d20 to 80884c9 Compare August 5, 2026 22:27
- "Brotli support enabled" doesn't provide any information, so just remove it
- show if brotli is bundled or not
- show if brotli is the active serializer for apcu or if apcu isn't loaded
- rename serializer ABI to interface
- if apcu support wasn't built, show that it could have been built
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Comment thread tests/info.phpt
echo ($lines[4] == 'APCu serializer support => not built') ? "Apcu OK\n" : "Fail: not built\n";
}

echo "MIMEs OK\n";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Isn't the validation logic left commented out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants