mince/mince.php

27 lines
908 B
PHP
Raw Normal View History

2022-07-03 22:07:00 +00:00
<?php
namespace Mince;
use Index\Environment;
use Index\Data\ConnectionFailedException;
use Index\Data\DbTools;
use Syokuhou\SharpConfig;
2022-07-03 22:07:00 +00:00
define('MCR_STARTUP', microtime(true));
define('MCR_ROOT', __DIR__);
define('MCR_DEBUG', is_file(MCR_ROOT . '/.debug'));
define('MCR_DIR_SRC', MCR_ROOT . '/src');
define('MCR_DIR_PUB', MCR_ROOT . '/public');
define('MCR_DIR_PRV', MCR_ROOT . '/private');
define('MCR_DIR_CFG', MCR_ROOT . '/config');
2023-08-16 21:18:12 +00:00
define('MCR_DIR_MIG', MCR_ROOT . '/database');
2023-08-16 22:39:35 +00:00
define('MCR_DIR_TPL', MCR_ROOT . '/templates');
2022-07-03 22:07:00 +00:00
2023-08-16 21:18:12 +00:00
require_once MCR_ROOT . '/vendor/autoload.php';
2022-07-03 22:07:00 +00:00
Environment::setDebug(MCR_DEBUG);
$cfg = SharpConfig::fromFile(MCR_ROOT . '/mince.cfg');
2022-07-03 22:07:00 +00:00
$db = DbTools::create($cfg->getString('database:dsn', 'null:'));
$db->execute('SET SESSION time_zone = \'+00:00\', sql_mode = \'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\';');