<?php

declare(strict_types=1);

/*
|--------------------------------------------------------------------------
| HYRO ONE Core Bootstrap
|--------------------------------------------------------------------------
| Loads shared configuration, helpers and error handling.
|--------------------------------------------------------------------------
*/

define(
    'HYRO_BASE_PATH',
    dirname(__DIR__)
);

define(
    'HYRO_CORE_PATH',
    __DIR__
);

define(
    'HYRO_STORAGE_PATH',
    HYRO_BASE_PATH . '/storage'
);

define(
    'HYRO_LOG_PATH',
    HYRO_STORAGE_PATH . '/logs'
);

if (!is_dir(HYRO_LOG_PATH)) {
    mkdir(HYRO_LOG_PATH, 0755, true);
}

date_default_timezone_set('Asia/Dubai');

ini_set('display_errors', '0');
ini_set('log_errors', '1');
ini_set(
    'error_log',
    HYRO_LOG_PATH . '/php-error.log'
);

require_once HYRO_CORE_PATH . '/Support/helpers.php';
require_once HYRO_CORE_PATH . '/Security/Csrf.php';
require_once HYRO_CORE_PATH . '/Database/Connection.php';
require_once HYRO_CORE_PATH . '/Lead/LeadRepository.php';
require_once HYRO_CORE_PATH . '/Lead/LeadService.php';
