Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions bootstrap/PanicAttack.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ public function checkAccessRightsEnv()
$this->displaySimpleError();
}

/*
|--------------------------------------------------------------------------
| Catch error on missing ldap extension.
|--------------------------------------------------------------------------
| When the ldap extension is not loaded, we display a nice error.
| This is a sanity check to prevent the user from seeing a blank page with an error in the top left
*/
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();
}


/**
* dispatcher.
*/
Expand Down
9 changes: 9 additions & 0 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
*/
require_once __DIR__ . '/../bootstrap/PanicAttack.php';

/**
* Check if the required extensions are loaded and if not, display a nice error page.
* This is a sanity check to prevent the user from seeing a blank page with an error in the top left corner.
*/
if (!extension_loaded('ldap')) {
$panic_attack = new PanicAttack();
$panic_attack->ldap();
}
Comment thread
ildyria marked this conversation as resolved.

/*
|--------------------------------------------------------------------------
| Initialize before loading composer
Expand Down
Loading