Skip to content

add error message for ldap requirement#4139

Merged
ildyria merged 1 commit intomasterfrom
ldap
Mar 3, 2026
Merged

add error message for ldap requirement#4139
ildyria merged 1 commit intomasterfrom
ldap

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Mar 2, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved system stability with enhanced error handling for the LDAP PHP extension. Added a pre-initialization check that displays a clear, user-friendly error message if the required extension is missing, preventing blank pages or cryptic errors.

@ildyria ildyria requested a review from a team as a code owner March 2, 2026 22:18
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

The changes add an LDAP extension availability check to the application. A new error handler method in PanicAttack displays a 500 error if LDAP is missing, and a pre-flight check in index.php invokes this handler before normal initialization.

Changes

Cohort / File(s) Summary
LDAP Error Handler
bootstrap/PanicAttack.php
New ldap() method added to display a 500 error page when the LDAP PHP extension is not loaded.
Pre-flight Extension Check
public/index.php
Added early validation before app initialization to detect missing LDAP extension and trigger the error handler if not available.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop through the code, a check so divine,
"Is LDAP loaded?" we must first design,
When missing, we panic with grace and with flair,
No cryptic blank pages, just errors laid bare! 🌿

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
bootstrap/PanicAttack.php (1)

133-140: Inconsistent brace placement and extra blank line.

The opening brace should be on a new line to match the rest of the file (PSR-12 style). Also, there's an extra blank line at the end.

🧹 Proposed style fix
-	public function ldap() {
+	public function ldap()
+	{
 		$this->title = 'Missing PHP Extension';
 		$this->code = 500;
 		$this->message = 'The PHP extension "ldap" is required but not loaded. Please install and enable it to run Lychee.';
 		$this->displaySimpleError();
 	}
-
-

As per coding guidelines: "Run vendor/bin/php-cs-fixer fix to apply PHP code style fixes before committing."


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e40be8 and 32e7ac3.

📒 Files selected for processing (2)
  • bootstrap/PanicAttack.php
  • public/index.php

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.37%. Comparing base (425329f) to head (32e7ac3).
⚠️ Report is 2 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria merged commit e8f1216 into master Mar 3, 2026
44 checks passed
@ildyria ildyria deleted the ldap branch March 3, 2026 07:11
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.

1 participant