eseperio/yii2-files-catalog

用于显示文件集合的工具

安装: 96

依赖项: 0

建议者: 0

安全: 0

星星: 2

关注者: 2

分支: 2

开放问题: 1

类型:yii2-extension

1.4.1 2024-09-27 12:06 UTC

README

yii2-files-catalog

开发者: waizabu.com

这是一个带有访问控制列表的虚拟文件系统。

我在*nix文件系统中复现了主要原则,其中任何对象都由磁盘上的inode表示,每个inode都有一个不同的身份(目录、文件、符号链接)。您得到的是一个可以依赖于任何现有文件系统的虚拟文件系统,这得益于在深层使用FlySystem

许可证

非商业用途免费。否则请联系我们获取商业许可证。

安装

此扩展作为composer库分发。运行

composer require eseperio/yii2-files-catalog

然后运行迁移

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

将模块添加到您的模块配置中

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

要管理访问控制列表,请将管理员添加到模块配置中。

版本控制。

此模块支持文件版本控制。您可以设置必须保留的文件数量。可以通过配置禁用文件版本控制

访问控制

inode访问控制是通过ACLs执行的。任何inode都必须有一个与之关联的规则,以便对其进行访问。可以授予用户ID或角色的访问权限。

要了解更多关于访问控制的信息,请参阅访问控制文档

文件共享

此模块还包括文件共享功能。可以通过电子邮件共享文件,并且可以通过user_id参数与其他用户共享文件夹和文件。为此有特定的视图。要查看“与我共享”的文件,请进入共享URL。用户只能共享他们具有写权限的文件。您可以通过重写AclHelper::canShare()设置自定义设置

自定义

您可以通过重写容器定义中的类来自定义模块的任何元素。Gridview使用列类,控制器使用操作,依此类推。

使用

可用的操作

默认控制器具有以下操作。

配置

其他

为了提高隐私性,inode使用uuid作为公共pk,但使用整数作为内部pk。保持简单id为私有。在使用数据提供者时,请记住使用此模块中包含的一个。此模块使用相邻模型概念来管理嵌套。这需要额外的查询来获取父项或子项,但在需要大量节点和写入的系统上比嵌套集模式更高效

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.

测试

请参阅测试文档