Search by

adachsoft / task-data-backup

Arkadiusz Adach

Task, comment, dependency, and attachment data sources for the AdachSoft data-backup library.

Package info

gitlab.com/a.adach/task-data-backup

Issues

pkg:composer/adachsoft/task-data-backup

Statistics

Installs: 17

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.1 2026-11-30 21:48 UTC

This package is auto-updated.

Last update: 2026-11-30 20:49:03 UTC


README

adachsoft/task-data-backup provides task, comment, dependency, and attachment data sources for the framework-free adachsoft/data-backup package. The adapters use the adachsoft/task-contracts repository interfaces, so they can be connected to an application's existing persistence layer.

Requirements

  • PHP 8.3 or later.
  • adachsoft/task-contracts and adachsoft/data-backup-contracts (installed automatically as dependencies).
  • The adachsoft/data-backup-symfony-bundle package to register and run the data sources in a Symfony application.
  • A PSR-17 stream factory when using the attachment source.

Installation

Install the adapter and the Symfony integration bundle:

composer require adachsoft/task-data-backup adachsoft/data-backup-symfony-bundle

The attachment source requires a PSR-17 stream factory. If the application does not already provide one, install an implementation such as Nyholm PSR-7:

composer require nyholm/psr7

Data sources

Source IDData-backup contractDepends onContents
tasksRecordDataSourceInterface—Task fields, checklist, attributes, status, dates, author, parent ID, and version.
task_dependenciesRecordDataSourceInterfacetasksTask-to-task dependency relationships.
commentsRecordDataSourceInterfacetasksComments belonging to all exported tasks.
attachmentsBlobDataSourceInterfacetasksAttachment metadata and binary content.

The sources use schema version 1. Comments and attachments retain their identifiers during import; task references are resolved through the shared import ID map.

Symfony service registration

Register the data-source services with Symfony's service container and enable autowiring and autoconfiguration. The data-backup-symfony-bundle automatically tags services that implement DataSourceInterface; no manual data-source tag is required. Bind the task-contract repository interfaces to the application's implementations and provide a PSR-17 stream factory for AttachmentDataSource.

For example, in config/services.yaml:

services:
    _defaults:
        autowire: true
        autoconfigure: true

    AdachSoft\TaskDataBackup\Source\:
        resource: '../vendor/adachsoft/task-data-backup/src/Source/'

    AdachSoft\TaskContracts\Interface\TaskRepositoryInterface: '@App\Task\TaskRepository'
    AdachSoft\TaskContracts\Interface\CommentRepositoryInterface: '@App\Task\CommentRepository'
    AdachSoft\TaskContracts\Interface\AttachmentRepositoryInterface: '@App\Task\AttachmentRepository'
    AdachSoft\TaskContracts\Interface\AttachmentContentStorageInterface: '@App\Task\AttachmentContentStorage'

    Nyholm\Psr7\Factory\Psr17Factory: ~
    Psr\Http\Message\StreamFactoryInterface: '@Nyholm\Psr7\Factory\Psr17Factory'

Replace the example App\Task\... service IDs with the application's repository and content-storage services. If those services are already registered and autowired by their interfaces, keep the existing bindings.

Usage

After configuring a target and archive storage in the bundle, run a backup and restore an archive with the bundle's console commands:

php bin/console data-backup:run
php bin/console data-backup:restore <archive-id>

Use php bin/console data-backup:run --help and php bin/console data-backup:restore --help to see the options supported by the installed bundle version and configured storage.

Missing dependency limitation

MissingReferencePolicyEnum::KEEP cannot preserve a task_dependencies relationship when either endpoint task is missing. TaskRepositoryInterface::addDependency() requires both tasks to exist, so the dependency source reports that unresolved relationship as a failed import instead of storing an orphaned dependency. Use FAIL or SKIP_RECORD when missing dependency endpoints are possible.