Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/utils/serverstamp/ |
Upload File : |
<?php namespace Yandex\Market\Utils\ServerStamp; use Bitrix\Main; use Yandex\Market\Data\TextString; use Yandex\Market\Reference\Concerns; class Database implements PropertyInterface { use Concerns\HasMessage; public function name() { return 'database'; } public function title() { return self::getMessage('TITLE'); } public function reset() { // nothing } public function collect() { $connection = Main\Application::getConnection(); if ($connection === null) { return null; } $name = $connection->getDatabase(); $host = $connection->getHost(); $host = $this->sanitizeHost($host); return $name . '@' . $host; } public function test($stored, $current) { if (TextString::toLower($stored) !== TextString::toLower($current)) { throw new ChangedException(self::getMessage('CHANGED', [ '#STORED#' => $stored, '#CURRENT#' => $current, ])); } } protected function sanitizeHost($host) { return preg_replace('/^127\.0\.0\.1(:|$)/', 'localhost$1', $host); } }