WebOrbiton
v1.0.1

AtheraStudio Database

26 lines · 772 B
  1. <?php
  2. declare(strict_types=1);
  3. ​
  4. namespace Athera;
  5. ​
  6. defined('ATHERA') || exit;
  7. ​
  8. const ROOT = __DIR__ . '/..';
  9. define('Athera\\VERSION', (string)require ROOT . '/version.php');
  10. ​
  11. error_reporting(E_ALL);
  12. ini_set('display_errors', '0');
  13. ini_set('html_errors', '0');
  14. ​
  15. spl_autoload_register(function (string $class): void {
  16. if (strncmp($class, 'Athera\\', 7) !== 0) return;
  17. $file = __DIR__ . '/' . str_replace('\\', '/', substr($class, 7)) . '.php';
  18. if (is_file($file)) require $file;
  19. });
  20. ​
  21. set_error_handler(function (int $no, string $msg, string $file = '', int $line = 0): bool {
  22. if (!(error_reporting() & $no)) return false;
  23. if ($no === E_DEPRECATED || $no === E_USER_DEPRECATED) return true;
  24. throw new \ErrorException($msg, 0, $no, $file, $line);
  25. });
  26. ​