Get backup Description in UI

Created on 2 June 2023, over 1 year ago

If anybody want to get Description (of advanced backup) in UI (Saved Backups)
\backup_migrate\src\Controller\BackupController.php

    foreach ($backups as $backup_id => $backup) {
/*WT+:description in UI*/
   $wtDescription = $backup->getMeta('description') ? $backup->getMeta('description')
      :( ($fileContent = file_get_contents($backup->realpath() . ".info"))/*get file content*/
           && preg_match('/description\s=\s"(.*?)"/', str_replace(["\n",'""',"\r",], ['','',' '], $fileContent), $matches)
             ? $matches[1] : false);
/*<<<*/
      $rows[] = [
        'data' => [
          // Cells.
/*WTmod*//*$backup->getFullName(),*/ $backup->getFullName() . ($wtDescription ? " || ({$wtDescription})" : ''),
          \Drupal::service('date.formatter')
Feature request
Status

Active

Version

5.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024