Created
March 7, 2016 15:42
-
-
Save maciejzgadzaj/dbe6580ce416b0112044 to your computer and use it in GitHub Desktop.
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
| diff --git i/index.php w/index.php | |
| index 8b83199..2efe8c9 100644 | |
| --- i/index.php | |
| +++ w/index.php | |
| @@ -16,6 +16,29 @@ | |
| */ | |
| define('DRUPAL_ROOT', getcwd()); | |
| -require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
| -drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
| -menu_execute_active_handler(); | |
| + | |
| +try { | |
| + require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
| + drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
| + menu_execute_active_handler(); | |
| +} catch (Exception $e) { | |
| + // Hopefully we have devel installed? | |
| + if (module_exists('devel')) { | |
| + // Temporarily set all messages to be displayed. | |
| + $GLOBALS['conf']['error_level'] = 2; | |
| + // Temporarily mark current user as having access to devel information. | |
| + $drupal_static_fast['perm'] = &drupal_static('user_access'); | |
| + $drupal_static_fast['perm'][$GLOBALS['user']->uid]['access devel information'] = 1; | |
| + // Print exception message and stack trace. | |
| + kpr($e->getMessage()); | |
| + kpr($e->getFile() . ':' . $e->getLine()); | |
| + kpr($e->getTrace()); | |
| + } | |
| + // No devel, so we need to use crude var_dumps. | |
| + else { | |
| + var_dump($e->getMessage()); | |
| + var_dump($e->getFile() . ':' . $e->getLine()); | |
| + var_dump($e->getTrace()); | |
| + } | |
| + die('Sorry.'); | |
| +} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment