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/rospirotorg.ru/bitrix/modules/lpost.delivery/lib/ |
Upload File : |
<? namespace Lpost\Delivery; trait Logger { public function setLog($text, $data) { \Bitrix\Main\Diag\Debug::dumpToFile( $data, date("d.m.Y H:i:s") . "\n" . $text, "/bitrix/php_interface/lpost.delivery.txt" ); } public function setAllLog($text, $data) { \Bitrix\Main\Diag\Debug::writeToFile( $data, date("d.m.Y H:i:s") . "\n" . $text, "/bitrix/php_interface/lpost.delivery.all.txt" ); } /** * @param $error * @return array|string convert info if site in cp1251 */ public static function convertInfo($error) { $newError = $error; if (defined('LANG_CHARSET') && LANG_CHARSET != 'UTF-8') { if (is_array($newError)) { foreach ($newError as &$nextError) { $nextError = iconv("UTF-8", "windows-1251", $nextError); } } else { $newError = iconv("UTF-8", "windows-1251", $newError); } } return $newError; } /** * @param $error * @return string html block with error message for admin bitrix */ public static function getHTMLErrors($error) { $newError = is_array($error) ? implode('<br>', $error) : $error; return \CAdminMessage::ShowMessage(["MESSAGE" => $newError, "TYPE" => "ERROR", "HTML" => true]); } } ?>