PHPackages                             d3yii2/d3backupmodules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. d3yii2/d3backupmodules

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

d3yii2/d3backupmodules
======================

031PHP

Since Jun 7Pushed 3y ago5 watchersCompare

[ Source](https://github.com/d3yii2/d3backupmodules)[ Packagist](https://packagist.org/packages/d3yii2/d3backupmodules)[ RSS](/packages/d3yii2-d3backupmodules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\##Features

- Creates compressed backup of preferred module data with it's attachments. (run from console with cron)
- Sends out an email of process completion with link (depends on view)
- Checks expire parameter to delete old compressed files.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ composer require d3yii2/d3backupmodules "*"

```

or add

```
"d3yii2/d3backupmodules": "*"

```

to the `require` section of your `composer.json` file.

Configuration
-------------

[](#configuration)

change console.php

```
    'components' =>
        [
            'd3backupmodules' => [
                'class' => 'd3yii2\d3backupmodules\components\ModuleBackupBase',
                'modelComponents' => [2 => 'd3modules\d3invoices\components\InvInvoiceBackup'],
                'emailFrom' => 'Irēķini sistēma',
                'emailBody' => 'Lejuplādēt arhīvu',
            ]
        ]
```

change main.php/web.php

```
    'modules' => [
        'd3backupmodules' => [
            'class' => 'd3yii2\d3backupmodules\Module',
            'backupDirectory' => $basePath . '/runtime/backups/'
        ]
    ]
```

Usage
-----

[](#usage)

After configuration, need to create custom component (see example bellow) in preferred module with view.

Important
---------

[](#important)

Data column in database should be json format keyed with "id", "error", "date\_from", "date\_to"

Methods
-------

[](#methods)

Create custom filename by passing variables with an additional 8 char random string and returns it.

```
public function createFileName(string $sys_company_name, string $list_name, string $date_from, string $date_to):string
```

Creates a directory by passed name and generates first index.html from given $html string.

```
public function createFile(string $fileName, string $html):string
```

Creates compressed file.

```
public function createZip(string $backUpFolder, string $fileNameFullPath, string $fileName, array $addFiles = [], D3BackupModule $model)
```

Examples of Custom component example :
--------------------------------------

[](#examples-of-custom-component-example-)

```
public function compile(array $backupData, D3BackupModule $model)
{
   $moduleBackup = new ModuleBackupBase();
   $fileName = $moduleBackup->createFileName('Company', 'Invoices', $model->getDataValue('date_from'), $model->getDataValue('date_to'));
   $html = \Yii::$app->view->render('@vendor/d3modules/d3invoices/views/d3yii2-backup/index', ['backupData' => $backupData]);
   $backupFolder = $moduleBackup->createFile($fileName, $html);
   $moduleBackup->createZip($backupFolder, $moduleBackup->backupDirectory.$fileName, $fileName, [], $model);
}
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/542187ba859514d10d0952dca77df8ea889a9651b249d0b5b513da791fd2919b?d=identicon)[uldisn](/maintainers/uldisn)

---

Top Contributors

[![uldisn](https://avatars.githubusercontent.com/u/3525344?v=4)](https://github.com/uldisn "uldisn (6 commits)")

### Embed Badge

![Health badge](/badges/d3yii2-d3backupmodules/health.svg)

```
[![Health](https://phpackages.com/badges/d3yii2-d3backupmodules/health.svg)](https://phpackages.com/packages/d3yii2-d3backupmodules)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
