2022-06-17 22:46:42 -06:00
|
|
|
<?php
|
2025-03-29 10:50:03 +00:00
|
|
|
|
2022-06-17 22:46:42 -06:00
|
|
|
/**
|
|
|
|
|
* Class to help manage global state of various debugging variables.
|
2024-03-09 03:19:55 -08:00
|
|
|
* TODO: Make `Debugging::enabled()` instead of needing to do `defined('DEBUGGING') && DEBUGGING`.
|
2022-06-17 22:46:42 -06:00
|
|
|
*
|
|
|
|
|
* @package NamelessMC\Misc
|
|
|
|
|
* @author Aberdeener
|
|
|
|
|
* @version 2.0.0
|
|
|
|
|
* @license MIT
|
|
|
|
|
*/
|
2024-03-09 03:19:55 -08:00
|
|
|
class Debugging
|
|
|
|
|
{
|
2022-06-22 22:48:05 -06:00
|
|
|
private static bool $_can_view_detailed_error = false;
|
|
|
|
|
private static bool $_can_generate_debug_link = false;
|
2022-06-17 22:46:42 -06:00
|
|
|
|
2024-03-09 03:19:55 -08:00
|
|
|
public static function canViewDetailedError(): bool
|
|
|
|
|
{
|
2022-06-17 22:46:42 -06:00
|
|
|
return self::$_can_view_detailed_error;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-09 03:19:55 -08:00
|
|
|
public static function setCanViewDetailedError(bool $detailed_error): void
|
|
|
|
|
{
|
2022-06-17 22:46:42 -06:00
|
|
|
self::$_can_view_detailed_error = $detailed_error;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-09 03:19:55 -08:00
|
|
|
public static function canGenerateDebugLink(): bool
|
|
|
|
|
{
|
2022-06-17 22:46:42 -06:00
|
|
|
return self::$_can_generate_debug_link;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-09 03:19:55 -08:00
|
|
|
public static function setCanGenerateDebugLink(bool $can_generate_debug_link): void
|
|
|
|
|
{
|
2022-06-17 22:46:42 -06:00
|
|
|
self::$_can_generate_debug_link = $can_generate_debug_link;
|
|
|
|
|
}
|
|
|
|
|
}
|