diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-08-27 12:04:36 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-08-27 12:04:36 +0200 |
commit | 7e3dc0ba98bf019c2804e5c74fb6061b16fb712f (patch) | |
tree | f0a333e9e009d78d59c1e4823f766625bc2bb255 /application/container/ContainerBuilder.php | |
parent | af41d5ab5d2bd3ba64d052c997bc6afa6966a63c (diff) | |
download | Shaarli-7e3dc0ba98bf019c2804e5c74fb6061b16fb712f.tar.gz Shaarli-7e3dc0ba98bf019c2804e5c74fb6061b16fb712f.tar.zst Shaarli-7e3dc0ba98bf019c2804e5c74fb6061b16fb712f.zip |
Better handling of plugin incompatibility
If a PHP is raised while executing plugin hook, Shaarli will display an error instead of rendering the error page (or just ending in fatal error for default hooks).
Also added phpErrorHandler which is handled differently that regular errorHandler by Slim.:
Diffstat (limited to 'application/container/ContainerBuilder.php')
-rw-r--r-- | application/container/ContainerBuilder.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/application/container/ContainerBuilder.php b/application/container/ContainerBuilder.php index 4a1a6ea7..58067c99 100644 --- a/application/container/ContainerBuilder.php +++ b/application/container/ContainerBuilder.php | |||
@@ -152,6 +152,9 @@ class ContainerBuilder | |||
152 | $container['errorHandler'] = function (ShaarliContainer $container): ErrorController { | 152 | $container['errorHandler'] = function (ShaarliContainer $container): ErrorController { |
153 | return new ErrorController($container); | 153 | return new ErrorController($container); |
154 | }; | 154 | }; |
155 | $container['phpErrorHandler'] = function (ShaarliContainer $container): ErrorController { | ||
156 | return new ErrorController($container); | ||
157 | }; | ||
155 | 158 | ||
156 | return $container; | 159 | return $container; |
157 | } | 160 | } |