summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-06-17 15:17:59 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-06-19 10:38:26 +0200
commit2b7b7144d44cdb323039d8384f7a94fc6422e923 (patch)
tree6eada54697fa843a7d3de8d19e3b672d79877220 /lib/public
parentdd0b9655b2dc72556f0a273f262357f5b058fe49 (diff)
downloadnextcloud-server-2b7b7144d44cdb323039d8384f7a94fc6422e923.tar.gz
nextcloud-server-2b7b7144d44cdb323039d8384f7a94fc6422e923.zip
Allow crash reporters registration during app bootstrap
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/AppFramework/Bootstrap/IRegistrationContext.php10
-rw-r--r--lib/public/Support/CrashReport/IRegistry.php7
-rw-r--r--lib/public/Support/CrashReport/IReporter.php3
3 files changed, 20 insertions, 0 deletions
diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
index 589b5def5a8..5d3ffc8d479 100644
--- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
+++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
@@ -46,6 +46,16 @@ interface IRegistrationContext {
public function registerCapability(string $capability): void;
/**
+ * Register an implementation of \OCP\Support\CrashReport\IReporter that
+ * will receive unhandled exceptions and throwables
+ *
+ * @param string $reporterClass
+ * @return void
+ * @since 20.0.0
+ */
+ public function registerCrashReporter(string $reporterClass): void;
+
+ /**
* Register a service
*
* @param string $name
diff --git a/lib/public/Support/CrashReport/IRegistry.php b/lib/public/Support/CrashReport/IRegistry.php
index 5ceabcca641..77456663848 100644
--- a/lib/public/Support/CrashReport/IRegistry.php
+++ b/lib/public/Support/CrashReport/IRegistry.php
@@ -27,10 +27,12 @@ declare(strict_types=1);
namespace OCP\Support\CrashReport;
use Exception;
+use OCP\AppFramework\Bootstrap\IRegistrationContext;
use Throwable;
/**
* @since 13.0.0
+ * @deprecated used internally only
*/
interface IRegistry {
@@ -40,6 +42,8 @@ interface IRegistry {
* @param IReporter $reporter
*
* @since 13.0.0
+ * @deprecated 20.0.0 use IRegistrationContext::registerCrashReporter
+ * @see IRegistrationContext::registerCrashReporter()
*/
public function register(IReporter $reporter): void;
@@ -50,6 +54,7 @@ interface IRegistry {
* @param string $category
* @param array $context
*
+ * @deprecated used internally only
* @since 15.0.0
*/
public function delegateBreadcrumb(string $message, string $category, array $context = []): void;
@@ -60,6 +65,7 @@ interface IRegistry {
* @param Exception|Throwable $exception
* @param array $context
*
+ * @deprecated used internally only
* @since 13.0.0
*/
public function delegateReport($exception, array $context = []);
@@ -72,6 +78,7 @@ interface IRegistry {
*
* @return void
*
+ * @deprecated used internally only
* @since 17.0.0
*/
public function delegateMessage(string $message, array $context = []): void;
diff --git a/lib/public/Support/CrashReport/IReporter.php b/lib/public/Support/CrashReport/IReporter.php
index b7f84417937..5aaa9d8a6f5 100644
--- a/lib/public/Support/CrashReport/IReporter.php
+++ b/lib/public/Support/CrashReport/IReporter.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
*
*