This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
DataMigration/files/custom/Espo/Modules/DataMigration/Services/BufferedIO.php
T
chaim 6d6f5d571a feat: add admin UI for export/import data migration
- Admin panel page at #Admin/dataMigration with two-column layout
- Export: filter by case status, skip attachments option, progress + log
- Import: select backup, preserve IDs / skip duplicates, dry run support
- List/delete existing backups with full manifest details
- 5 API endpoints (status, export, import, listBackups, deleteBackup)
- BufferedIO adapter to capture CLI output for API responses
- Admin-only access on all endpoints
- i18n: English + Hebrew (fa_IR) translations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:45:20 +00:00

44 lines
774 B
PHP

<?php
namespace Espo\Modules\DataMigration\Services;
use Espo\Core\Console\IO;
/**
* A buffered IO implementation that captures output lines
* for returning via API responses instead of console.
*/
class BufferedIO extends IO
{
/** @var string[] */
private array $lines = [];
public function write(string $string): void
{
$this->lines[] = $string;
}
public function writeLine(string $string): void
{
$this->lines[] = $string;
}
public function readLine(): string
{
return '';
}
/**
* @return string[]
*/
public function getLines(): array
{
return $this->lines;
}
public function getOutput(): string
{
return implode("\n", $this->lines);
}
}