index.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. header('Content-Type: text/html; charset=utf-8');
  3. header('X-Powered-By: EGP');
  4. date_default_timezone_set('Europe/Moscow');
  5. @ini_set('display_errors', TRUE);
  6. @ini_set('html_errors', TRUE);
  7. @ini_set('error_reporting', E_ALL);
  8. DEFINE('EGP', TRUE);
  9. DEFINE('DIR', dirname('index.php'));
  10. DEFINE('ROOT', DIR . '/');
  11. DEFINE('SYS', ROOT . 'system/');
  12. DEFINE('TPL', ROOT . 'template/');
  13. DEFINE('TEMP', ROOT . 'temp/');
  14. DEFINE('FILES', ROOT . 'files/');
  15. DEFINE('DATA', SYS . 'data/');
  16. DEFINE('LIB', SYS . 'library/');
  17. DEFINE('ENG', SYS . 'engine/');
  18. DEFINE('SEC', SYS . 'sections/');
  19. $device = isset($_COOKIE['egp_device']) ? $_COOKIE['egp_device'] : '!mobile';
  20. $start_point = $_SERVER['REQUEST_TIME'];
  21. $mcache = new Memcache;
  22. $mcache->connect('127.0.0.1', 11211) or exit('Ошибка подключения Memcache');
  23. // Composer
  24. if (!file_exists(ROOT . 'vendor/autoload.php')) {
  25. 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>');
  26. }
  27. require(ROOT . 'vendor/autoload.php');
  28. // Настройки
  29. include(DATA . 'config.php');
  30. include(DATA . 'engine.php');
  31. include(DATA . 'mysql.php');
  32. include(DATA . 'params.php');
  33. // Библиотеки
  34. include(LIB . 'sql.php');
  35. include(LIB . 'html.php');
  36. include(LIB . 'system.php');
  37. $uip = sys::ip();
  38. /* if(!isset($_COOKIE['egp_device']))
  39. {
  40. include(LIB.'megp.php');
  41. $device = $megp->isMobile() ? 'mobile' : '!mobile';
  42. sys::cookie('egp_device', $device, 14);
  43. if($device == 'mobile')
  44. sys::back();
  45. } */
  46. // Распределитель
  47. if ($device == '!mobile')
  48. include(SYS . 'distributor.php');
  49. /* else
  50. include(SYS.'mdistributor.php'); */
  51. // Выхлоп
  52. echo $html->arr['all'];
  53. ?>