From 514b340fda944e288facab6799ba5c67056c2501 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 24 Sep 2014 09:04:09 +0200 Subject: only register error handler once --- appinfo/app.php | 6 ++++++ appinfo/application.php | 8 -------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/appinfo/app.php b/appinfo/app.php index 77e3fe19d..98c033124 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -19,6 +19,12 @@ use \OCA\News\Config\DependencyException; require_once __DIR__ . '/setup.php'; if (is_setup()) { + // Turn all errors into exceptions to combat shitty library behavior + set_error_handler(function ($code, $message) { + if ($code === E_ERROR || $code === E_USER_ERROR) { + throw new \Exception($message, $code); + } + }); $container = new Application(); diff --git a/appinfo/application.php b/appinfo/application.php index 4c99583e6..2dea28fc2 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -67,14 +67,6 @@ class Application extends App { public function __construct(array $urlParams=array()){ parent::__construct('news', $urlParams); - // Turn all errors into exceptions to combat shitty library behavior - set_error_handler(function ($code, $message) { - if ($code === E_ERROR || $code === E_USER_ERROR) { - throw new \Exception($message, $code); - } - }); - - $container = $this->getContainer(); -- cgit v1.2.3