6d6f5d571a
- 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>
44 lines
774 B
PHP
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);
|
|
}
|
|
}
|