Download the PHP package lfyw/file-manager without Composer

On this page you can find all versions of the php package lfyw/file-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package file-manager

file-manager

A file manager.

安装

使用

数据库迁移

执行数据库迁移:

如果需要对数据表做修改,可以导出迁移文件:

配置

导出配置文件:

path是文件存放目录;clear_sync_file是指同步完文件,是否删除同步中失效的文件,建议true

如果需要给模型设置另外的链接,则可以增加connection属性,会读取database.connections中对应的连接配置。

文件上传

upload($file, $keepOriginalName = false, $guessExtension = true)

像下面这样来上传文件。第一个参数是上传的文件;第二个参数是上传时是否以原文件名进行保存,默认会重新命名;第三个参数是是否根据文件 MIME 类型推测文件后缀,默认true, 如果要保存文件的原后缀名请改为false

结果会返回一个File模型:

文件关联

在目标模型文件中引用HasFilestrait

新增文件关联

attachFiles($param = null, string $type = null)

同步文件关联

syncFiles($param = null, string $type = null, $clear = true, $onlyCurrent = true)

接受一个参数替换原本的关联,未在参数中的原关联会被移除 。如果$onlyCurrent的值为 true,则同步关联仅同步当前type的关联文件,而不会影响其他type

同步当前类型文件关联

syncOnlyCurrentTypeFiles($param = null, string $type = null, $onlyCurrent = true)

等同于syncFiles($onlyCurrent = true)

同步不移除

syncFilesWithoutDetaching($param = null, string $type = null, $clear = false)

用法同 syncFiles() 一致,同步的时候不会移除原先的关联文件

移除关联

detachFiles($param = null, string $type = null)

追加文件

addFiles($param = null, string $type = null)

强制同步

forceSync(bool$param = true)

当使用syncFiles()同步文件时,方法会默认对参数做空判断,如果参数为空则不执行任何操作,从而避免手动判断文件参数是否为空。但在某些情况下,如编辑的时候取消了图片,此时需要将空参数也参与同步关联,可以使用该方法进行强制同步:

注意:由于syncFilesWithoutDetaching()是同步不移除,所以forceSync()syncFilesWithoutDetaching无效.

预加载

延迟预加载

预加载计数

延迟加载文件数量

License

MIT


All versions of file-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lfyw/file-manager contains the following files

Loading the files please wait ....