EngineGP/index.php

63 lines
1.9 KiB
PHP
Raw Normal View History

2023-03-04 23:45:46 +00:00
<?php
header('Content-Type: text/html; charset=utf-8');
header('X-Powered-By: EGP');
date_default_timezone_set('Europe/Moscow');
2023-11-11 20:56:12 +00:00
// Composer
if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
die('Please <a href="https://getcomposer.org/download/" target="_blank" rel="noreferrer" style="color:#0a25bb;">install composer</a> and run <code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">composer install</code>');
}
require(__DIR__ . '/vendor/autoload.php');
// Загружаем .env
$dotenv = new Symfony\Component\Dotenv\Dotenv();
$dotenv->load(__DIR__ . '/.env');
if ($_ENV['RUN_MODE'] === 'dev') {
// Включение отображения ошибок в режиме разработки
ini_set('display_errors', TRUE);
ini_set('html_errors', TRUE);
ini_set('error_reporting', E_ALL);
} else {
// Отключение отображения ошибок в продакшене
ini_set('display_errors', FALSE);
ini_set('html_errors', FALSE);
ini_set('error_reporting', 0);
}
2023-11-11 20:56:12 +00:00
DEFINE('EGP', TRUE);
DEFINE('DIR', dirname('index.php'));
DEFINE('ROOT', DIR . '/');
DEFINE('SYS', ROOT . 'system/');
DEFINE('TPL', ROOT . 'template/');
DEFINE('TEMP', ROOT . 'temp/');
DEFINE('FILES', ROOT . 'files/');
DEFINE('DATA', SYS . 'data/');
DEFINE('LIB', SYS . 'library/');
DEFINE('ENG', SYS . 'engine/');
DEFINE('SEC', SYS . 'sections/');
2023-11-11 20:56:12 +00:00
$start_point = $_SERVER['REQUEST_TIME'];
2023-11-11 20:56:12 +00:00
$mcache = new Memcache;
$mcache->connect('127.0.0.1', 11211) or exit('Ошибка подключения Memcache');
// Настройки
include(DATA . 'config.php');
include(DATA . 'engine.php');
include(DATA . 'mysql.php');
include(DATA . 'params.php');
2023-11-11 20:56:12 +00:00
// Библиотеки
include(LIB . 'sql.php');
include(LIB . 'html.php');
include(LIB . 'system.php');
2023-11-11 20:56:12 +00:00
$uip = sys::ip();
2023-11-11 20:56:12 +00:00
// Распределитель
include(SYS . 'distributor.php');
2023-11-11 20:56:12 +00:00
// Выхлоп
echo $html->arr['all'];