PHPackages                             dbrisinajumi/d2files - 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. dbrisinajumi/d2files

ActiveYii-extension

dbrisinajumi/d2files
====================

file uploader

1.0.0(11y ago)12821[2 issues](https://github.com/DBRisinajumi/d2files/issues)BSD-2-ClausePHPPHP &gt;=5.3.2

Since Mar 23Pushed 3y ago4 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)Security (1)

d2files (cloned from d1files)
=============================

[](#d2files-cloned-from-d1files)

Features
--------

[](#features)

- attach files to model record
- widget for model view

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

[](#installation)

- install
- install

```
php composer.phar require dbrisinajumi/d2files dev-master
```

- add to config/main.php

```
     'import' => array(
        'vendor.dbrisinajumi.d2files.models.*',
        'vendor.dbrisinajumi.d2files.widgets.*', // shared classes
    ),
    'modules' => array(
        'd2files' => array(
            'class' => 'vendor.dbrisinajumi.d2files.D2filesModule',
            'upload_dir' => 'root.upload',
            'accept_file_types' => '/\.(gif|pdf|dat|jpe?g|png|doc|docx|xls|xlsx|htm)$/i',

            //automaticly registre tasks, when upload files to model
            // d2person.PprsPerson, if user role is Agent or Client
            'registre_tasks_to_models' => array(
                'd2person.PprsPerson' => array(
                    'new_project_status' => 1, //Not started
                    'task_init_status' => 1, //Active
                    'task_due_in_days' => 3,
                    'user_roles' => array('Agent','Client'),
                    ),
            ),
            'shareable_by_link' => [
                'my_module.my_model' => [
                    'allow_ip' => [
                        '127.0.0.1',
                        ],
                    'salt' => '1212133243243',
                ]
            ]
         ),
	 ),
```

- to config/console.php under commandMap add

```
	'd2files' => 'vendor.dbrisinajumi.d2files.migrations',

```

- execute yiic migration
- in table d2files can define file types for model.

Usage
-----

[](#usage)

### VIEW

[](#view)

```
    $this->widget('d2FilesWidget',[
        'module'=>$this->module->id,
        'model'=>$model,
        'title'=> 'Wiget Title',
        'icon' => false,
        'hideTitle' => false,
        'readOnly' => false,
        'showImagesTypes' => '/\.(gif|jpe?g|png)$/i'
        ]
        );
```

### Requirements

[](#requirements)

- To upload file user must have "ModuleName.ModelName.uploadD2File" access rights for caller module
- To delete file user must have "ModuleName.ModelName.deleteD2File" access rights for caller module
- To download, upload or delete file user must have read access to corresponding item it is attached to and "ModuleName.ModelName.downloadD2File"

### sql statement example for giving access

[](#sql-statement-example-for-giving-access)

```
INSERT INTO `authitem`
(`name`, `type`, `description`, `bizrule`, `data`)
VALUES
('D2company.CcmpCompany.uploadD2File','0','D2company.CcmpCompany upolad D2Files',NULL,'N;'),
('D2company.CcmpCompany.downloadD2File','0','D2company.CcmpCompany downloas D2Files',NULL,'N;'),
('D2company.CcmpCompany.deleteD2File','0','D2company.CcmpCompany delete D2Files',NULL,'N;')
;

INSERT INTO `authitemchild` (`parent`, `child`) VALUES ('Agent', 'D2company.CcmpCompany.uploadD2File');
INSERT INTO `authitemchild` (`parent`, `child`) VALUES ('Agent', 'D2company.CcmpCompany.downloadD2File');
INSERT INTO `authitemchild` (`parent`, `child`) VALUES ('Agent', 'D2company.CcmpCompany.deleteD2File');

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

4065d ago

### 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 (53 commits)")[![ivarsju](https://avatars.githubusercontent.com/u/4513623?v=4)](https://github.com/ivarsju "ivarsju (19 commits)")[![anothersoftware-lv](https://avatars.githubusercontent.com/u/9327511?v=4)](https://github.com/anothersoftware-lv "anothersoftware-lv (1 commits)")

---

Tags

fileswidgetyiiuploaderphundament

### Embed Badge

![Health badge](/badges/dbrisinajumi-d2files/health.svg)

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

###  Alternatives

[vova07/yii2-imperavi-widget

The imperavi redactor widget for Yii 2 framework.

243979.7k40](/packages/vova07-yii2-imperavi-widget)[sjaakp/yii2-sortable-behavior

Sort ActiveRecords and related records in Yii2.

36144.7k](/packages/sjaakp-yii2-sortable-behavior)[yiisoft/yii-dataview

Yii data displaying widgets

4252.6k1](/packages/yiisoft-yii-dataview)[evgeniyrru/yii2-slick

Yii2 extension for Slick Carousel

22182.1k3](/packages/evgeniyrru-yii2-slick)[zhuravljov/yii2-datetime-widgets

Datetime widgets for Yii2.

21118.6k3](/packages/zhuravljov-yii2-datetime-widgets)[romka-chev/yii2-swiper

Yii2 extension for Swiper slider

1840.6k](/packages/romka-chev-yii2-swiper)

PHPackages © 2026

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