<?php namespace Uiharu; use Index\Cache\CacheBackends; use Index\Config\Fs\FsConfig; define('UIH_STARTUP', microtime(true)); define('UIH_ROOT', __DIR__); define('UIH_DEBUG', is_file(UIH_ROOT . '/.debug')); define('UIH_PUBLIC', UIH_ROOT . '/public'); define('UIH_SOURCE', UIH_ROOT . '/src'); define('UIH_LIBRARY', UIH_ROOT . '/lib'); define('UIH_VERSION', '20241023'); require_once UIH_ROOT . '/vendor/autoload.php'; error_reporting(UIH_DEBUG ? -1 : 0); mb_internal_encoding('UTF-8'); date_default_timezone_set('GMT'); $cfg = FsConfig::fromFile(UIH_ROOT . '/uiharu.cfg'); if($cfg->hasValues('sentry:dsn')) (function($cfg) { \Sentry\init([ 'dsn' => $cfg->getString('dsn'), 'traces_sample_rate' => $cfg->getFloat('tracesRate', 0.2), 'profiles_sample_rate' => $cfg->getFloat('profilesRate', 0.2), ]); set_exception_handler(function(\Throwable $ex) { \Sentry\captureException($ex); }); })($cfg->scopeTo('sentry')); $cache = CacheBackends::create($cfg->getString('cache:dsn', 'array:')); $ctx = new UihContext($cache, $cfg);