← Back to Index 🇧🇷 Português

âš¡ Resilience & Circuit Breaker

How Domain-System protects itself from fatal plugins and critical errors.

The Classic Problem (White Screen of Death)

In traditional monolithic or plugin-based systems (like legacy WordPress), a simple typo by a developer — such as forgetting a semicolon in a newly installed plugin — can cause the infamous "White Screen of Death". PHP abruptly halts all execution, and the entire site becomes inaccessible for everyone (including administrators).

The Solution: Circuit Breaker

The Domain-System was designed with an advanced architectural concept focused on high resilience: the Circuit Breaker.

It works very similarly to an electrical circuit breaker in a house. When an "overload" (a fatal error) occurs in one of the rooms (plugins), the breaker "trips" only that line, protecting the overall core from burning out.

How It Works Under the Hood

  1. Global Interception (ErrorHandler): A defense layer, directly hooked into PHP's register_shutdown_function, watches all fatal events at the hardware and compilation level (Syntax Errors, Parse Errors, etc).
  2. Isolated Tracking: When a fatal exception blows up, the Watchman captures the Stack Trace to discover the exact origin of the error.
  3. Automatic Disarming: If the system identifies that the failure came from a file belonging to a specific Plugin's folder, it intercepts the config/plugins.json file and disconnects / disables the plugin in milliseconds.
  4. Panel Protection: The system clears half-rendered buffers and displays a clean "Core Overload" screen only for the author of the affected request. On the same screen, it displays a button to Reload the Safe System.
  5. Log and Visual Alerts: The system adds a record of the crash to the temporary disarmed.json file. As soon as the administrator accesses the native Plugins screen (via SystemAdmin), they see a bright alert highlighting the disarmed plugin, with a shortcut to the detailed reports screen (SystemMonitor).