PHPackages                             mheads/yii2-dbfiles - 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. mheads/yii2-dbfiles

ActiveYii2-extension

mheads/yii2-dbfiles
===================

Db file manager

v1.0.10(3y ago)03.0k↓31.8%1MITPHP

Since Aug 6Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (13)Used By (0)

yii2-dbfiles
============

[](#yii2-dbfiles)

Базовая конфигурация
--------------------

[](#базовая-конфигурация)

Необходимо выполнить миграцию:

`yii migrate --migrationPath=@mheads/dbfiles/migrations`

После миграции просто измените конфигурацию приложения следующим образом:

```
return [
    'components' => [
        ...
		'dbFileStorage' => [
			'class' => 'mheads\dbfiles\FileStorage',
			'basePath' => '@frontend/web/upload',
			'host' => $params['public_host'],
			// Полный нобор свойств и их описания
			// можно посмотреть в классе
			// mheads\dbfiles\FileStorage
		]
		...
    ],
];
```

Использование
-------------

[](#использование)

Сохранение любого файла:

```
$uploadedFile = yii\web\UploadedFile::getInstanceByName('file');
$file = Yii::$app->dbFileStorage->saveFile($uploadedFile, [
	'group_name'  => 'docs',
	'description' => 'File description',
]);
if(!$file->hasErrors())
{
	echo $file->id;
	echo $file->url;
	echo $file->path;
}
```

Сохранение изображения:

```
$oldFileId = 2;
$uploadedImage = yii\web\UploadedFile::getInstanceByName('image');
$image = Yii::$app->dbFileStorage->saveFile($uploadedImage, [
	'deleteFileId' => $oldFileId,
	'group_name'   => 'images',
	'description'  => 'Image description',
]);
if(!$image->hasErrors())
{
	echo $image->id;
	echo $image->url;
	echo $image->path;
}
```

Получение файла:

```
$file = Yii::$app->dbFileStorage->getFile(123);
echo $file->id;
echo $file->url;
echo $file->path;
```

Удаление файла:

```
Yii::$app->dbFileStorage->deleteFile(123);
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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.

###  Release Activity

Cadence

Every ~129 days

Recently: every ~121 days

Total

11

Last Release

1181d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8805360bd6ba1a19f70a9a23819afe7109a80ea0a4c387201f4fa986a50c75f8?d=identicon)[alse0017](/maintainers/alse0017)

---

Top Contributors

[![sa-machineheads](https://avatars.githubusercontent.com/u/22737984?v=4)](https://github.com/sa-machineheads "sa-machineheads (7 commits)")[![alse0017](https://avatars.githubusercontent.com/u/13018747?v=4)](https://github.com/alse0017 "alse0017 (2 commits)")

---

Tags

yii2extensionfile manager

### Embed Badge

![Health badge](/badges/mheads-yii2-dbfiles/health.svg)

```
[![Health](https://phpackages.com/badges/mheads-yii2-dbfiles/health.svg)](https://phpackages.com/packages/mheads-yii2-dbfiles)
```

###  Alternatives

[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[zxbodya/yii2-elfinder

Extension to use elFinder 1.x file manager in Yii2 application

1035.7k3](/packages/zxbodya-yii2-elfinder)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[rkit/filemanager-yii2

FileManager for Yii2

181.3k](/packages/rkit-filemanager-yii2)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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