Download the PHP package mitoop/laravel-alioss-storage without Composer

On this page you can find all versions of the php package mitoop/laravel-alioss-storage. 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 laravel-alioss-storage

Laravel Aliyun OSS Filesystem Storage

Install

composer require mitoop/laravel-alioss-storage

Laravel 版本低于5.5版本 请添加Mitoop\AliOSS\ServiceProviderconfig/app.phpproviders 数组

Require

Configure

config/filesystems.phpdisk里增加配置:

Use

可以使用 Laravel Storage 的所有方法

集成插件提供的方法 :

Notice

  1. deleteDir 删除文件夹方法. 方法直接返回为 false, 不会进行删除,如果要删除文件夹强烈推荐到阿里云后台操作.

  2. listContents 列出文件夹目录(支持递归)方法. 方法直接返回为空数组 [], 如果有此业务,可以考虑通过插件实现.

  3. 除了 has 方法, 所有方法在失败的时候都会返回 false (不抛出异常,但有日志记录),

    如果需要, 你可以用 === false 来判断是否成功. 配置正常的情况下, 失败概率极低.

  4. has 方法, 本身返回 true / false, 所以发生错误会抛出异常.

  5. $request->file('avatar')->store('avatars'); 上传文件直接 store 就生成随机名称,这里的 avatars 只是目录名称

    所以推荐使用 storeAs 方法来达到预期的目的.

    曾经遇到过 store 方法生成随机名称获取扩展的时候,对于 WPS 的 docx/pptx, 总是获取不到正确的文件扩展名称

    最后 storeAs 手动解决了.

  6. temporaryUrl 方法和 signUrl 是一样的效果, 区别仅在于第二个参数

    signUrl 传入的 int 类型, 例如, 传入30表示30秒后过期

    temporaryUrl 传入的是 \DateTimeInterface 类型, 例如, 传入 now()->addSeconds(30) 也是表示30秒后过期

More

Storage方法通常会提供 options 参数. 最常用的就是设置文件可见性.

设置可见性:

Links

https://github.com/laravel/framework/tree/7.x/src/Illuminate/Filesystem

https://github.com/thephpleague/flysystem

https://help.aliyun.com/document_detail/32099.html

https://github.com/jacobcyl/Aliyun-oss-storage

https://github.com/thephpleague/flysystem-aws-s3-v3

https://github.com/apollopy/flysystem-aliyun-oss

License


All versions of laravel-alioss-storage with dependencies

PHP Build Version
Package Version
Requires aliyuncs/oss-sdk-php Version ^2.3.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 mitoop/laravel-alioss-storage contains the following files

Loading the files please wait ....