PHPackages                             dmstr/yii2-filefly-module - 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. [API Development](/categories/api)
4. /
5. dmstr/yii2-filefly-module

ActiveYii2-extension[API Development](/categories/api)

dmstr/yii2-filefly-module
=========================

FlySystem API for Filemanager

1.7.4(1y ago)962.2k—7.7%8[6 issues](https://github.com/dmstr/yii2-filefly-module/issues)[1 PRs](https://github.com/dmstr/yii2-filefly-module/pulls)2proprietaryPHP

Since Jun 20Pushed 1y ago7 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (93)Used By (2)

Yii2 FileFly Module
===================

[](#yii2-filefly-module)

[![Latest Stable Version](https://camo.githubusercontent.com/d6ea8acb3ad7aec377aebd4475fe3a572bbd6aee68e832929bddb085f59e28f4/68747470733a2f2f706f7365722e707567782e6f72672f646d7374722f796969322d66696c65666c792d6d6f64756c652f762f737461626c652e737667)](https://packagist.org/packages/dmstr/yii2-filefly-module)[![Total Downloads](https://camo.githubusercontent.com/9b0f85b8aa13d75abbaa445043dc6907c3f831a56fd4d7eacfa750f9837e4fd4/68747470733a2f2f706f7365722e707567782e6f72672f646d7374722f796969322d66696c65666c792d6d6f64756c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/dmstr/yii2-filefly-module)[![License](https://camo.githubusercontent.com/f3b11059f34ba9c8ef95631087688c9f9bf4e007e0335b5bdf028cdc8bf287ba/68747470733a2f2f706f7365722e707567782e6f72672f646d7374722f796969322d66696c65666c792d6d6f64756c652f6c6963656e73652e737667)](https://packagist.org/packages/dmstr/yii2-filefly-module)

FlySystem API for [dmstr/yii2-filemanager-widgets](https://github.com/dmstr/yii2-filemanager-widgets)

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

[](#installation)

#### ENV variables

[](#env-variables)

VariableValueRequiredAFM\_FILESYSTEMyii component nameyesAFM\_REPAIRdefault: truenoAFM\_SLUG\_NAMESdefault: truenoAFM\_DELETE\_RECURSIVEdefault: falsenoi.e. `AFM_FILESYSTEM=fsLocal`

❓ How to configure a filesystem component [Filesystem docs](https://github.com/creocoder/yii2-flysystem/blob/master/README.md)

#### Yii config

[](#yii-config)

```
'filefly' => [
    'class'              => 'hrzg\filefly\Module',
    'layout'             => '@backend/views/layouts/main',
    'filesystem'         => getenv('AFM_FILESYSTEM'),
    'slugNames'			 => (getenv('AFM_SLUG_NAMES')) ? getenv('AFM_SLUG_NAMES') : true,
    'repair'             => (getenv('AFM_REPAIR')) ? getenv('AFM_REPAIR') : true,
    'deleteRecursive'    => (getenv('AFM_DELETE_RECURSIVE')) ? getenv('AFM_DELETE_RECURSIVE') : false,
    'streamExpireOffset' => 604800 # Offset (in seconds) for Expires Header in stream action
    'defaultPermissions' => [
        \hrzg\filefly\Module::ACCESS_OWNER  => 1,
        \hrzg\filefly\Module::ACCESS_READ   => \hrzg\filefly\models\FileflyHashmap::$_all,
        \hrzg\filefly\Module::ACCESS_UPDATE => \hrzg\filefly\models\FileflyHashmap::$_all,
        \hrzg\filefly\Module::ACCESS_DELETE => \hrzg\filefly\models\FileflyHashmap::$_all,
    ],
    # the urlCallbck property can be used to provide customized urls for each file item which (if defined) will overwrite
    # the default handler URLs
    'urlCallback'        => function($item) {
		$urls = [];
		$isImageFileExtList = ['jpg', 'jpeg', 'gif', 'tiff', 'tif', 'svg', 'png', 'bmp'] ;
		if ($item['type'] === 'file') {
			if (in_array(strtolower($item['extension']), $isImageFileExtList)) {
				$urls['image url'] = \dmstr\willnorrisImageproxy\Url::image($item['path']);
			}
			else {
				$urls['download url'] = implode('/', ['/img/download', ltrim($item['path'], '/')]) . ',p1';
			}
		}
		return $urls;
	},
	// previewCallback can be used to overwrite the default downloadUrl for preview URLs within filemanagerApp
	'previewCallback' => function($item) {
		$isImageFileExtList = ['jpg', 'jpeg', 'gif', 'tiff', 'tif', 'png', 'bmp'] ;
		if ($item['type'] === 'file') {
			if (in_array(strtolower($item['extension']), $isImageFileExtList)) {
				return \dmstr\willnorrisImageproxy\Url::image($item['path'], '500x');
			}
		}
		return '';
	}
],
```

RBAC
----

[](#rbac)

**Prosa**

- `FileflyAdmin` full module access including debug information
- `FileflyDefault` management access (eg. POST request for upload, change, delete)
- `FileflyPermissions` assigned users can set or unset roles or permissions which the user himself has assigned
- `access_owner` permission before `access_read`, `access_update`, `access_delete`
- If no permission is set, it will check if any inherited permission can be granted

So if inherited `access_*` permissions should be used, set defaultPermissions to `null` NOT to `'*'`.

```
            'defaultPermissions' => [
                \hrzg\filefly\Module::ACCESS_OWNER  => 1,
                \hrzg\filefly\Module::ACCESS_READ   => null,
                \hrzg\filefly\Module::ACCESS_UPDATE => null,
                \hrzg\filefly\Module::ACCESS_DELETE => null,
            ],

```

**ActiveRecord: FileflyHashmap**

- uses `dmstr\activeRecordPermissions\ActiveRecordAccessTrait` with `$activeAccessTrait = false`
- access checks will be done for each permission type explicitly, `hasPermission($action)`
- uses a `pathValidator` rule to ensure the `path` syntax on active record operations

#### Roles

[](#roles)

- FileflyAdmin

    - filefly
- FileflyDefault

    - filefly\_default\_index
- FileflyApi

    - filefly\_api\_index
- FileflyPermissions

#### Permissions

[](#permissions)

- filefly
- filefly\_default\_index
- filefly\_api\_index

RBAC Plugins
------------

[](#rbac-plugins)

Permission checks will ever come after file or folder operation

**GrantPermission**

```
Granted or deny permission

1. access field empty (is owner, true or continue)
2. access field set (permission granted, true)
   access field set (is access owner, true, permission denied, false)

```

**SetPermission**

```
Create or update permission

1. Add new hash records
2. Update hash records (recursive option)

- Multi create and update option

```

**RemovePermission**

```
Remove permission

1. Deletes file or folder records

- Multi delete option

```

CLI
---

[](#cli)

Configure

```
'controllerMap' => [
    'fs' => [
        'class' => '\hrzg\filefly\commands\FsController',
        'filesystemComponents' => [
            'local' => 'fs',
            's3' => 'fsS3',
            'storage' => 'fsFtp',
        ],
    ],
]

```

Widget
------

[](#widget)

see

```
    {{ use ('hrzg/filemanager/widgets') }}
    {{ file_manager_widget_widget(
        {
            "handlerUrl": "/#{app.language}/filefly/api"
        }
    ) }}

```

Options for the yii2-filemanager-widgets Widget can be injected via the Module property `fileManagerWidgetOptions`

example:

```
        'filefly' => [
            'filesystemComponents' => [
                'ftp' => 'fsFtp',
                'ftpcrud' => 'fsFtpCrud',
            ],
            // ...
            // other configs
            // ...
            // Options for the angular fileManagerWidget
            'fileManagerWidgetOptions' => [
                'searchForm' => false,
                'allowedActions' => [
                    'move' => false,
                    'upload' => false,
                    'createFolder' => false,
                    ],
            ],
        ],
```

### Controller action in iFrame

[](#controller-action-in-iframe)

Modal button

```

```

Load event listener

```

    window.addEventListener('load', function () {
        var fileflyIframeToggle = document.querySelector('#filefly-iframe-toggle');
        var iframe = document.querySelector('#filefly-iframe');

        fileflyIframeToggle.addEventListener('click', function () {
            iframe.src = "/filefly/default/filemanager-full-screen";
        });
    });

```

Iframe

```
{{ use ('yii/bootstrap') }}
{{ modal_begin(
{
    'id': 'modal-filemanager',
	'size': 'modal-lg'
}) }}

{{ modal_end() }}'

```

Helper
------

[](#helper)

DescriptionMethod callExample outputTotal size for all filesystems`FileflyHashmap::getTotalSize()`202.82 MiBTotal size for all filesystems (raw bytes)`FileflyHashmap::getTotalSize(true)`212670464Total size for `local` filesystems`FileflyHashmap::getTotalSize(false, 'local')`48.32 MiBTotal size for `s3` filesystems (raw bytes)`FileflyHashmap::getTotalSize(true, 's3')`166546843

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~39 days

Recently: every ~140 days

Total

82

Last Release

467d ago

Major Versions

0.6.20 → 1.0.0-alpha12018-07-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b4ab2b6685ec71887908ec8cff261a16cd5bb24c69bb8ab52840e220f175f9d?d=identicon)[schmunk](/maintainers/schmunk)

---

Top Contributors

[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (71 commits)")[![eluhr](https://avatars.githubusercontent.com/u/13000805?v=4)](https://github.com/eluhr "eluhr (33 commits)")[![handcode](https://avatars.githubusercontent.com/u/825574?v=4)](https://github.com/handcode "handcode (29 commits)")[![a-klapper](https://avatars.githubusercontent.com/u/54941040?v=4)](https://github.com/a-klapper "a-klapper (5 commits)")[![H-Algabri](https://avatars.githubusercontent.com/u/100204087?v=4)](https://github.com/H-Algabri "H-Algabri (2 commits)")[![Kanabanarama](https://avatars.githubusercontent.com/u/1219900?v=4)](https://github.com/Kanabanarama "Kanabanarama (1 commits)")[![amk0](https://avatars.githubusercontent.com/u/7900784?v=4)](https://github.com/amk0 "amk0 (1 commits)")

---

Tags

apifileflyrbacyii2yii2extension

### Embed Badge

![Health badge](/badges/dmstr-yii2-filefly-module/health.svg)

```
[![Health](https://phpackages.com/badges/dmstr-yii2-filefly-module/health.svg)](https://phpackages.com/packages/dmstr-yii2-filefly-module)
```

###  Alternatives

[dotzero/yii2-amocrm

Расширение для Yii Framework 2 реализующее клиент для работы с API amoCRM

1639.7k](/packages/dotzero-yii2-amocrm)[conquer/services

Yii2 soap wsdl web services

1632.5k](/packages/conquer-services)[apexwire/yii2-restclient

Tools to use API as ActiveRecord for Yii2

143.5k](/packages/apexwire-yii2-restclient)

PHPackages © 2026

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