Skip to content

Commit

Permalink
Merge pull request #79 from EngineGPDev/develop
Browse files Browse the repository at this point in the history
Upgrade to 3.7.1.4
  • Loading branch information
SeAnSolovev authored Apr 9, 2024
2 parents 498015f + 8a2727f commit 3b3cf27
Show file tree
Hide file tree
Showing 1,782 changed files with 18,744 additions and 199,952 deletions.
23 changes: 23 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Basic Settings
# Panel operation mode. (dev or prod)
RUN_MODE="prod"
# Site protocol http:// or https://
APP_PROTOCOL="http://"
# The URL of the site
APP_URL="example.com"
# The name of the site
APP_NAME="EngineGP"
# Site Description
APP_DESCRIPTION="EngineGP"

# Database Connection Settings
DB_HOST="127.0.0.1"
DB_DATABASE="enginegp_db"
DB_USERNAME="enginegp_usr"
DB_PASSWORD="enginegp_pwd"

# Settings of the "Control" service
# The IP address of the site
APP_IP="192.168.1.1"
# Site subnet
APP_SUBNET="192.168.1.0/24"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea
.vscode
.env
vendor
composer.phar
18 changes: 5 additions & 13 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,14 @@ RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(?!acp).* index.php [L]

<Files .env>
Order allow,deny
Deny from all
</Files>

ErrorDocument 403 /403.html
ErrorDocument 404 /404.html

#***Раскодировать, если не загружаются большие файлы:
php_value max_execution_time 500
php_value max_input_time 500
php_value upload_max_filesize 30M
php_value post_max_size 30M

#***Раскодировать, если белый экран:
#php_flag short_open_tag = On

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on

<ifModule mod_expires.c>

ExpiresActive On
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2023 Sergei Solovev and contributors
Copyright (c) 2018-present Solovev Sergei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 22 additions & 11 deletions acp/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
<?php
header('Content-Type: text/html; charset=utf-8');

header('X-Powered-By: EGP');
date_default_timezone_set('Europe/Moscow');

@ini_set('display_errors', FALSE);
@ini_set('html_errors', FALSE);
@ini_set('error_reporting', E_ALL);
// Composer
if (!file_exists('../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('../vendor/autoload.php');

// Загружаем .env
$dotenv = new Symfony\Component\Dotenv\Dotenv();
$dotenv->load('../.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);
}

DEFINE('EGP', TRUE);
DEFINE('ROOT', '../');
Expand All @@ -24,12 +42,6 @@
$mcache = new Memcache;
$mcache->connect('127.0.0.1', 11211) or exit('Ошибка подключения Memcache');

// Composer
if (!file_exists(ROOT . '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(ROOT . 'vendor/autoload.php');

// Настройки
include(DATA . 'config.php');
include(DATA . 'mysql.php');
Expand All @@ -48,4 +60,3 @@

// Выхлоп
echo $html->arr['all'];
?>
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"require": {
"symfony/polyfill": "1.28.0",
"symfony/dotenv": "5.4.35",
"filp/whoops": "2.15.4",
"monolog/monolog": "2.9.2",
"xpaw/php-source-query-class": "2.1.0",
Expand Down
142 changes: 140 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 25 additions & 8 deletions cron.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
<?php
date_default_timezone_set('Europe/Moscow');

@ini_set('display_errors', TRUE);
@ini_set('html_errors', TRUE);
@ini_set('error_reporting', E_ALL);
// Composer
if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
exit('Please install composer and run composer install' . PHP_EOL);
}
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);
}

DEFINE('EGP', TRUE);
DEFINE('DIR', dirname('index.php'));
Expand All @@ -21,14 +39,14 @@
$start_point = $_SERVER['REQUEST_TIME'];

$mcache = new Memcache;
$mcache->connect('127.0.0.1', 11211) or exit('Ошибка: не удалось создать связь с Memcache.' . PHP_EOL);
$mcache->connect('127.0.0.1', 11211) or exit('Ошибка подключения Memcache.' . PHP_EOL);

// Настройки
include(DATA . 'config.php');

/*if($argv[1] != $cfg['cron_key'])
exit('error key.'.PHP_EOL);
*/
// Проверка ключа и указания параметра
if($argv[1] != $cfg['cron_key'])
exit('Invalid cron key' . PHP_EOL);
$task = $argv[2];

include(DATA . 'engine.php');
Expand All @@ -40,4 +58,3 @@
include(LIB . 'html.php');
include(LIB . 'system.php');
include(LIB . 'cron.php');
?>
Loading

0 comments on commit 3b3cf27

Please sign in to comment.