- Модуль: translate
- Путь к файлу: ~/bitrix/modules/translate/lib/file.php
- Класс: BitrixTranslateFile
- Вызов: File::putContents
public function putContents($data, $flags = self::REWRITE)
{
// encoding
$operatingEncoding = $this->getOperatingEncoding();
$sourceEncoding = $this->getSourceEncoding();
if ($operatingEncoding != $sourceEncoding)
{
$data = MainTextEncoding::convertEncoding($data, $operatingEncoding, $sourceEncoding);
}
set_error_handler(
function ($severity, $message, $file, $line)
{
throw new ErrorException($message, $severity, $severity, $file, $line);
}
);
try
{
$result = parent::putContents($data, $flags);
}
catch (ErrorException $exception)
{
restore_error_handler();
throw new MainIOIoException($exception->getMessage());
}
restore_error_handler();
return $result;
}