diff --git a/admin/inc/header.php b/admin/inc/header.php
index 289d2fc..4b5c0c7 100644
--- a/admin/inc/header.php
+++ b/admin/inc/header.php
@@ -256,7 +256,6 @@
Кэширование
Диспетчер очереди
Командная PHP строка
- Логи nginx
В никуда
diff --git a/admin/nginx.php b/admin/nginx.php
deleted file mode 100644
index 1ec5cea..0000000
--- a/admin/nginx.php
+++ /dev/null
@@ -1,96 +0,0 @@
-
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
- use Core\Helpers\Pagination;
- use Core\Helpers\SystemFunctions;
- use Core\SystemConfig;
-
- require_once __DIR__ . '/inc/header.php';
-
- global $USER;
- if ($USER->isAdmin() === false) {
- header('Location: ./');
- die();
- }
-?>
-
-
-
-
-
-
-
-
-
-
- | IP |
- Дата |
- Запрос |
- Код |
- Размер |
- URL |
- Браузер |
-
-
-
-
-
- | = $elLog['ip'] ?> |
- = date('Y.m.d H:i:s', strtotime($elLog['date'] . ' +3 hour')) ?> |
- = $elLog['request'] ?> |
- = $elLog['httpCode'] ?> |
- = $elLog['size'] ? SystemFunctions::convertBytes($elLog['size']) : '' ?> |
- = $elLog['url'] ?> |
- = $elLog['userAgent'] ?> |
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/core/lib/Core/Helpers/SystemFunctions.class.php b/core/lib/Core/Helpers/SystemFunctions.class.php
index 457cf11..ed25657 100644
--- a/core/lib/Core/Helpers/SystemFunctions.class.php
+++ b/core/lib/Core/Helpers/SystemFunctions.class.php
@@ -686,63 +686,6 @@
return $count;
}
- /**
- * Парсинг логов nginx
- *
- * @param string $logPath Путь до файла логов
- * @param bool $isOnlyCount Только получение количества
- * @param string|null $limit Ограничение выборки "0, 10"
- * @param bool $isReverse Перевернуть выборку
- *
- * @return array|int
- * @throws CoreException
- */
- public static function getNginxLogData(string $logPath, bool $isOnlyCount = false, ?string $limit = null, bool $isReverse = false)
- {
- if (!file_exists($logPath)) {
- throw new CoreException('Файл логов не найден', CoreException::ERROR_FILE_NOT_FOUND);
- }
- $arLogs = file($logPath);
- $logCount = count($arLogs);
- if ($isOnlyCount) {
- return $logCount;
- }
- if ($isReverse) {
- $arLogs = array_reverse($arLogs);
- }
- $arLimit = [0, $logCount];
- if ($limit !== null) {
- $arLimit['start'] = (int)explode(',', $limit)[0];
- $arLimit['stop'] = $arLimit['start'] + (int)explode(',', $limit)[1];
- }
- $regExp = '/(?[0-9.]+)\s+\-\s+\-\s\[(?[^\]]+)\]\s"(?[^"]+)"\s(?\d+)\s+(?\d+)\s"(?[^"]+)"\s"(?[^"]+)"/m';
- $arResult = [];
- $result = null;
- $counter = 0;
- foreach ($arLogs as $logEvent) {
- $counter++;
- if ($limit !== null && ($counter - 1) < $arLimit['start']) {
- continue;
- }
- preg_match_all($regExp, $logEvent, $result, PREG_SET_ORDER, 0);
- $result = array_shift($result);
- $arResult[] = [
- 'ip' => $result['ip'],
- 'date' => $result['date'],
- 'request' => $result['request'],
- 'httpCode' => $result['code'],
- 'size' => $result['size'],
- 'url' => $result['url'],
- 'userAgent' => $result['useragent'],
- ];
- $result = null;
- if ($limit !== null && ($counter + 1) > $arLimit['stop']) {
- break;
- }
- }
- return $arResult;
- }
-
/**
* Возвращает подсвеченную PHP строку
*