Метод writeGeneratedFiles

private

Сигнатура метода

private function writeGeneratedFiles(array $files): void

Возвращает: void

Описание

The generated files are written as one step. A write that fails halfway - the second file, or a truncated first one - would leave the delivered agent described by one file and versioned by the other, so what was there before is put back and the failure is reported instead. A write is done only when every byte of the contents is on the disk: a write that stops halfway - no space left on the device, a quota reached - answers with the number of bytes it managed and not with false, and a truncated template.json read as a success would be delivered as the template of the agent. A write can also throw instead of answering at all - a warning of the file system turned into an exception by the error handler of the environment, a directory that cannot be created - and one step of writing means the same answer to every failure: whatever leaves the loop rolls the delivered files back and is reported together with what the rollback did.

Параметры

1
Имя Тип По умолчанию Флаги
$files array —
—

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу Source
~/bitrix/modulesbizproc/lib/Internal/AI/Agent/Generator/AgentTemplateGenerator.php
Расположение метода в файле
Строки 286–315

Исходный код

PHP