PHPackages                             eseperio/yii2-files-catalog - 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. eseperio/yii2-files-catalog

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

eseperio/yii2-files-catalog
===========================

A tool to display files as a collection

1.6.0(2w ago)21002GPL-3.0-or-laterPHPCI failing

Since Oct 31Pushed 2w ago1 watchersCompare

[ Source](https://github.com/Eseperio/yii2-files-catalog)[ Packagist](https://packagist.org/packages/eseperio/yii2-files-catalog)[ RSS](/packages/eseperio-yii2-files-catalog/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (30)Versions (49)Used By (0)

Yii2 files catalog
==================

[](#yii2-files-catalog)

yii2-files-catalog
------------------

[](#yii2-files-catalog-1)

**Developer: waizabu.com**

It is a virtual file system with access control lists.

I have replicated the main principles of \*nix filesystem where any object is represented by an inode in the disk, and each inode have a different identity (directory, file, symlink). What you get is a virtual file system that can rely on any existing file system, thanks to the usage of [FlySystem](https://flysystem.thephpleague.com/docs/usage/filesystem-api/) in a deep layer,

License
-------

[](#license)

Free for NonCommercial use. Otherwise contact us for a commercial license.

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

[](#installation)

This extension is distributed as a composer library. Run

```
composer require eseperio/yii2-files-catalog

```

Then run migration

```
php yii migrate/up --migrationPath=@vendor/eseperio/yii2-files-catalog/src/migrations

```

Add the module to your modules configuration

```
'modules' => [
     'filex' => [
            'class' => \eseperio\filescatalog\FilesCatalogModule::class,
            'salt' => 'yourrandomstringhere'
            'identityClass' => 'youridentity/classname',
            'administrators' => ['adminusername']
            // 'administratorPermissionName' => 'permissionname'
        ]
      ]

```

To manage access control list, add administrators to module configuration.

Versioning.
-----------

[](#versioning)

This module supports file versioning. You can set how much files must be kept. File versioning can be disabled via configuration

Access control
--------------

[](#access-control)

Inodes access control is performed by ACLs. Any inode must have a rule associated in order to give access to it. Access can be granted to a user id or a role.

To know more about access control, see [access control docs](docs/acl.md)

File sharing
------------

[](#file-sharing)

This module also includes file sharing functionalities. A file can be shared via email and folders and files can be shared with other users via user\_id param. There are specific views for that. To see "Shared with me" files, go into shared url Users can only share those files which they had write permissions. You can set your custom settings overriding `AclHelper::canShare()`

Customization
-------------

[](#customization)

You can customize any element of the module by overriding the classes in container definitions. Gridview uses column classes, controller uses actions, and so on.

Usage
-----

[](#usage)

### Actions available

[](#actions-available)

There is a default controller with the following actions.

ActionDescriptionIndexDisplays the contents of a given dir. Accepts param `uuid` to select which directory to showViewOnly for inodes of type `file`. If files is image or pdf, it displays on screen, otherwise downloads the filePropertiesDisplays properties of the file or directory selectedUploadAction to handle file uploadsNewFolderDisplays the "create directory" formRenameAllows renaming an inodeBulkDeleteBulk deletionBulkDownloadDownload many files at the same timeRemoveAclRemove permissions from an InodeBulkAclBulk permissions attachmentinheritAclCopy all selected permissions to all childrenbulk-downloadDownload multiple files as a zip filesharedShows all files shared with the current logged in userunshareRemoves an existing share with a useremailSends a file via email to custom address### Configuration

[](#configuration)

PropertyDescriptionDefault`maxFileSize`int the maximum number of bytes required for the uploaded file. Defaults to null, meaning no limit. Note, the size limit is also affected by `upload_max_filesize` and `post_max_size` INI setting and the 'MAX\_FILE\_SIZE' hidden field value. See \[\[FileValidator::getSizeLimit()\]\] for details. @see  @see  @see FileValidator::getSizeLimitnull`directory`string This will be used as default directory where all files will be created. Set to false to use your default storage component'filex'`maxVersions`int number of maximun versions of a files that can be kept.4`storage`string name of the component responsible of handling files. Must comply with flysystem.'storage'`user`string The user component. This is used on blameable behavior'user'`userIdAttribute`string attribute of the user component'id'`userNameAttribute`string user attribute that returns the name. Can be a anything valid for \[\[ArrayHelper::getValue()\]\]'username'`db`string Name of the db component to use on data handling'db'`usePjax`bool whether use pjax on main viewtrue`inodeRealPathCallback`\*\* nullarray`allowOverwrite`bool whether overwrite existing files. Remember this setting can be overrided in calls tu savefalse`allowMoving`bool whether to allow users to move files and folders. If ACL is enabled, this requires write permissions on both the item to move and the destination folder.true`allowCutPaste`bool whether to allow users to cut and paste files and folders. If ACL is enabled, this requires write permissions on both the item to cut and the destination folder.true`allowRenaming`bool whether to allow users to rename items. If ACL is enabled, this requires write permissions on the item.true`prefix`string the prefix to be used on urlGroup'filex'`urlRules`array the url rules (routes)'controller:\[\\w\\-\]+`maxTreeDepthDisplay`int the max amount of elements to display when using a tree view. Set to false to disable4`groupFilesByExt`bool whether show icons grouped by extensionfalse`displayAuthorNames`bool whether display author names on viewstrue`routePrefix`string the prefix for the route part of every rule declared in \[\[rules\]\]. The prefix and the route will be separated with a slash. If this property is not set, it will take the value of \[\[prefix\]\]."filesCatalog"`realFileNamesSystem`string which kind of name use on saving files. Defaults to FILENAMES\_BY\_ID. Files will be stored using its own id, so an attacker can not find a file based on their public uuid. If you want to preserve an easy way to find physical FILENAMES\_BY\_ID: File 1979 will become prefix1`browserInlineMimeTypes`array list of the mimetypes that can be represented directly in browser with their corresponding tag`enableACL`bool whether enable access control listtrue`administrators`List of roles or usernames that can manage acl\['admin'\]`aclException`Classname of the exception to be thrown when user can access an inode`eseperio\filescatalog\exceptions\FilexAccessDeniedException``defaultACLmask`Default value for access control crud mask when no one has been defined4`maxInlineFileSize`Since this module relies on Flysystem, you can not have a direct link to the file, so in order to preview images or mp4 videos they are converted to base64. This number limits the maximun size allowed for a file to be embedded. int max inline file size in bytes. Defaults to 10Mb10000000`checkFilesIntegrity`bool whether save file hashes in database and check integrity everytime a file is required. In large filesystems it can make the database grow significantly.true`allowVersioning`bool whether allow multiple versions of a file.true`identityClass`string the class name of the \[\[identity\]\] object.null`salt`String to be used as hash salt on sensitive operations, like deletenull`defaultInodePermissions`list with default permissions for inodes\[AccessControl::ACTION\_READ\]`secureHashParamName`name of the parameter to be used when sending and receiving secure hashfxsh`secureHashAlgorithm`which algorithm use for secure hash generationSHA3-256`newFolderIconclass`css classname for the new folder icon'glyphicon glyphicon-folder-open';`propertiesIconClass`css classname for the properties iconglyphicon glyphicon-list-alt`addFilesIconClass`css classname for the new add files iconglyphicon glyphicon-cloud-upload`showBreadcrumbButtonLabels`whether display labels in breadcrumb buttonsfalse`itemsPerPage`number of items per page10`rbacItems`arraycallable Array with the available permissions or roles available while managing inode permissions`readOnlyMessage`stringmessage to display in gridview as a name suffix when user has no write permissions.`offsetParam`stringparam name to be used while transferring offset to view. Used on next-previoust buttons`sortParam`stringparam name to be used while transferring sort to view`enableEmailSharing`whether allow users share a file via emailfalse`emailFromAddress`Address to be used when sharing fils via emailfalse`maxFileSizeForEmailShare`max allowed size for a file to be sent over email5mb### Other

[](#other)

In order to improve privacy inodes use the uuid as public pk, but an integer as internal pk. Keep simple id private. When using data providers, remember use the one included within this module. This module use adjacency models concept to manage nesting. That requires extra queries to get parents or childrens, but is way more efficient than nested-set pattern on system that require a lot of nodes and writes

```
Important: when a inode of type file is created, model is stored and then file data is stored. If file data can not be
stored, model is deleted. This is done to avoid orphaned files. If you want to change this behavior, override
`File::afterSave()` method.
You can check whether a file has been deleted by checking `hasErrors()` method. If it returns true, you can check
`getErrors()` method to get the error message.

```

Testing
-------

[](#testing)

See [testing docs](docs/testing.md)

Directory Selection Widget
--------------------------

[](#directory-selection-widget)

The module includes a directory selection widget called `DirectoryTreeWidget`. This widget displays a virtual directory tree and allows users to select one or more directories (and optionally files), making it easy to integrate into forms where a location within the virtual filesystem must be chosen.

### Main features

[](#main-features)

- Can display only directories, only files, or both.
- Supports single or multiple selection.
- Can filter by file extensions.
- Allows excluding specific nodes from the tree.
- Loads data asynchronously for better performance with large structures.

### Basic usage example

[](#basic-usage-example)

```
use eseperio\filescatalog\widgets\DirectoryTreeWidget;

echo DirectoryTreeWidget::widget([
    'name' => 'destination_uuid',
    'mode' => DirectoryTreeWidget::MODE_DIRECTORIES_ONLY, // Only directories
    'multiple' => false,
    'rootNodeUuid' => null, // Root of the virtual filesystem
]);
```

### Main options

[](#main-options)

- `mode`: Display mode (`MODE_DIRECTORIES_ONLY` for directories only, `MODE_ALL` for directories and files).
- `multiple`: Allow multiple selection (`true` or `false`).
- `rootNodeUuid`: UUID of the root node to start displaying the tree (default is the root of the system).
- `extensions`: Array of allowed file extensions (only if files are shown).
- `excludedUuids`: Array of UUIDs to exclude from the tree.
- `ajaxUrl`: URL for asynchronous loading (defaults to the module's standard route).

This widget is useful for forms where a destination folder must be selected for moving, copying, or pasting files, or for any functionality that requires navigation and selection within the virtual directory tree.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance96

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 91.9% 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 ~51 days

Recently: every ~81 days

Total

47

Last Release

17d ago

Major Versions

0.9.9 → 1.0.02020-11-30

1.3.1 → 2.0.x-dev2022-09-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1e173755eb4a5abae378ed4c8a8e8066f578c3192105c5e3f9b8ea3ef0086e7?d=identicon)[Eseperio](/maintainers/Eseperio)

---

Top Contributors

[![Eseperio](https://avatars.githubusercontent.com/u/5459366?v=4)](https://github.com/Eseperio "Eseperio (284 commits)")[![SHI1989](https://avatars.githubusercontent.com/u/22391106?v=4)](https://github.com/SHI1989 "SHI1989 (15 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eseperio-yii2-files-catalog/health.svg)

```
[![Health](https://phpackages.com/badges/eseperio-yii2-files-catalog/health.svg)](https://phpackages.com/packages/eseperio-yii2-files-catalog)
```

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k74.6k86](/packages/pocketmine-pocketmine-mp)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)

PHPackages © 2026

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