IsDebugOn.php 573 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\Core\Traits;
  3. use ModulesGarden\ProxmoxAddon\Core\App\Controllers\Instances\Addon\Config;
  4. use ModulesGarden\ProxmoxAddon\Core\ServiceLocator;
  5. /**
  6. * Description of IsDebugOn
  7. *
  8. * @author INBSX-37H
  9. */
  10. trait IsDebugOn
  11. {
  12. protected $isDebug = null;
  13. public function isDebugOn()
  14. {
  15. if ($this->isDebug === null)
  16. {
  17. $addon = ServiceLocator::call(Config::class);
  18. $this->isDebug = (bool) ((int) $addon->getConfigValue('debug', "0"));
  19. }
  20. return $this->isDebug;
  21. }
  22. }