PHP code example of netresearch / nr-bug-reporter

1. Go to this page and download the library: Download netresearch/nr-bug-reporter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

netresearch / nr-bug-reporter example snippets


  // Development error page with the "Report this bug" banner:
  $GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler']
      = \Netresearch\NrBugReporter\Error\ReportingExceptionHandler::class;
  // Production capture: visitors get the core production error page; the error is recorded
  // for the toolbar of a logged-in backend user:
  $GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler']
      = \Netresearch\NrBugReporter\Error\ReportingProductionExceptionHandler::class;
  

Classes/
  Attribution/   PackageIndex, PackageAttributionService, AttributionResult   (the engine)
  Resolver/      GitHubTrackerResolver, TrackerEndpoint                        (4-tier tracker chain)
  Decision/      ReportPolicy                                                  (confidence/config gating)
  Service/       PackageIndexProvider                                          (runtime index from Composer)
  Capture/       CapturedError, SessionStore                                   (last error + action trail)
  Context/       BackendContext, BackendContextCollector                       (module/route/url)
  Report/        IssueUrlComposer                                              (prefilled URL + redaction)
  Error/         ReportingExceptionHandler, ReportingProductionExceptionHandler (error-page integration)
  Backend/       ReportToolbarItem                                             (proactive toolbar)
  Middleware/    ActionTrailMiddleware                                         (records recent actions)
  EventListener/ BackendAssetLoader                                            (loads the toolbar JS)
Configuration/   Services.yaml, JavaScriptModules.php, RequestMiddlewares.php, Icons.php
Resources/       Public/JavaScript/report-toolbar.js, Public/Icons/Extension.svg
Tests/Unit/      attribution + ReportPolicy + GitHubTrackerResolver tests (portable, no TYPO3 boot)
bin/, fixtures/  CLI dev/regression harness (local; needs a sibling TYPO3 core checkout)
.github/         CI: PHP lint + PHPUnit on PHP 8.2-8.5 × TYPO3 13.4/14.3, plus security checks