Added filp/whoops for nicer error displays.

This commit is contained in:
Markus Birth 2022-02-11 02:08:27 +01:00
parent 1109e09b85
commit 4bea3ccdd6
3 changed files with 113 additions and 27 deletions

View File

@ -9,8 +9,9 @@
], ],
"require": { "require": {
"php": ">=7.0 <9.0", "php": ">=7.0 <9.0",
"filp/whoops": "^2.14",
"foxy/foxy": "^1.0.0", "foxy/foxy": "^1.0.0",
"katzgrau/klogger": "1.0.*", "katzgrau/klogger": "~1.0",
"smarty/smarty": "~3.1.33", "smarty/smarty": "~3.1.33",
"voku/simple-cache": "4.*" "voku/simple-cache": "4.*"
}, },

129
composer.lock generated
View File

@ -4,8 +4,79 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "40f0311ec28386f8c283291d768ba4bb", "content-hash": "adba64a31c2fda3c0e61414e5166f2a9",
"packages": [ "packages": [
{
"name": "filp/whoops",
"version": "2.14.5",
"source": {
"type": "git",
"url": "https://github.com/filp/whoops.git",
"reference": "a63e5e8f26ebbebf8ed3c5c691637325512eb0dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filp/whoops/zipball/a63e5e8f26ebbebf8ed3c5c691637325512eb0dc",
"reference": "a63e5e8f26ebbebf8ed3c5c691637325512eb0dc",
"shasum": ""
},
"require": {
"php": "^5.5.9 || ^7.0 || ^8.0",
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
},
"require-dev": {
"mockery/mockery": "^0.9 || ^1.0",
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3",
"symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0"
},
"suggest": {
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
"whoops/soap": "Formats errors as SOAP responses"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Whoops\\": "src/Whoops/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Filipe Dobreira",
"homepage": "https://github.com/filp",
"role": "Developer"
}
],
"description": "php error handling for cool kids",
"homepage": "https://filp.github.io/whoops/",
"keywords": [
"error",
"exception",
"handling",
"library",
"throwable",
"whoops"
],
"support": {
"issues": "https://github.com/filp/whoops/issues",
"source": "https://github.com/filp/whoops/tree/2.14.5"
},
"funding": [
{
"url": "https://github.com/denis-sokolov",
"type": "github"
}
],
"time": "2022-01-07T12:00:00+00:00"
},
{ {
"name": "foxy/foxy", "name": "foxy/foxy",
"version": "v1.1.2", "version": "v1.1.2",
@ -82,21 +153,21 @@
}, },
{ {
"name": "katzgrau/klogger", "name": "katzgrau/klogger",
"version": "1.0.0", "version": "1.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/katzgrau/klogger.git", "url": "https://github.com/katzgrau/KLogger.git",
"reference": "46cdd92a9b4a8443120cc955bf831450cb274813" "reference": "a4ed373fa8a214aa4ae7aa4f221fe2c6ce862ef1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/katzgrau/klogger/zipball/46cdd92a9b4a8443120cc955bf831450cb274813", "url": "https://api.github.com/repos/katzgrau/KLogger/zipball/a4ed373fa8a214aa4ae7aa4f221fe2c6ce862ef1",
"reference": "46cdd92a9b4a8443120cc955bf831450cb274813", "reference": "a4ed373fa8a214aa4ae7aa4f221fe2c6ce862ef1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3", "php": ">=5.3",
"psr/log": "1.0.0" "psr/log": "^1.0.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "4.0.*" "phpunit/phpunit": "4.0.*"
@ -115,15 +186,13 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Dan Horrigan",
"email": "dan@dhorrigan.com",
"homepage": "http://dhorrigan.com",
"role": "Lead Developer"
},
{ {
"name": "Kenny Katzgrau", "name": "Kenny Katzgrau",
"email": "katzgrau@gmail.com" "email": "katzgrau@gmail.com"
},
{
"name": "Dan Horrigan",
"email": "dan@dhorrigan.com"
} }
], ],
"description": "A Simple Logging Class", "description": "A Simple Logging Class",
@ -131,29 +200,37 @@
"logging" "logging"
], ],
"support": { "support": {
"issues": "https://github.com/katzgrau/klogger/issues", "issues": "https://github.com/katzgrau/KLogger/issues",
"source": "https://github.com/katzgrau/klogger/tree/1.0.0" "source": "https://github.com/katzgrau/KLogger/tree/master"
}, },
"time": "2014-03-20T02:36:36+00:00" "time": "2016-11-07T19:29:14+00:00"
}, },
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.0.0", "version": "1.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/log.git", "url": "https://github.com/php-fig/log.git",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": "" "shasum": ""
}, },
"require": {
"php": ">=5.3.0"
},
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Psr\\Log\\": "" "Psr\\Log\\": "Psr/Log/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -163,20 +240,20 @@
"authors": [ "authors": [
{ {
"name": "PHP-FIG", "name": "PHP-FIG",
"homepage": "http://www.php-fig.org/" "homepage": "https://www.php-fig.org/"
} }
], ],
"description": "Common interface for logging libraries", "description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [ "keywords": [
"log", "log",
"psr", "psr",
"psr-3" "psr-3"
], ],
"support": { "support": {
"issues": "https://github.com/php-fig/log/issues", "source": "https://github.com/php-fig/log/tree/1.1.4"
"source": "https://github.com/php-fig/log/tree/1.0.0"
}, },
"time": "2012-12-21T11:40:51+00:00" "time": "2021-05-03T11:20:27+00:00"
}, },
{ {
"name": "psr/simple-cache", "name": "psr/simple-cache",

View File

@ -68,6 +68,7 @@ if ($serendipity['production']) {
if ($serendipity['production'] !== true) { if ($serendipity['production'] !== true) {
@ini_set('display_errors', 'on'); @ini_set('display_errors', 'on');
@ini_set('display_startup_errors', 'on');
} }
// The serendipity errorhandler string // The serendipity errorhandler string
@ -243,6 +244,13 @@ if (function_exists('get_include_path')) {
require_once("vendor/autoload.php"); require_once("vendor/autoload.php");
if ($serendipity['production'] !== true) {
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
}
$new_include = ($serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '') $new_include = ($serendipity['use_PEAR'] ? $old_include . PATH_SEPARATOR : '')
. S9Y_INCLUDE_PATH . 'bundled-libs/' . PATH_SEPARATOR . S9Y_INCLUDE_PATH . 'bundled-libs/' . PATH_SEPARATOR
. $serendipity['serendipityPath'] . PATH_SEPARATOR . $serendipity['serendipityPath'] . PATH_SEPARATOR