Download the PHP package vergil-lai/laravel-oss-filesystem without Composer

On this page you can find all versions of the php package vergil-lai/laravel-oss-filesystem. 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-oss-filesystem

Laravel OSS Filesystem

基于 alibabacloud/oss-v2 的 Laravel 阿里云 OSS filesystem 驱动。

Laravel 集成基于独立的 vergil-lai/oss-flysystem 包;Laravel 用户只需安装当前包,Composer 会自动安装底层依赖。

要求

安装

配置

在应用的 config/filesystems.php 中,将以下配置加入 disks。本包会先加载内部默认值,再用这里的 disks.oss 配置覆盖默认值。

regionbucket 是通常需要配置的参数。凭证可以使用 access_key_idaccess_key_secret 和可选的 security_token,也可以程序化注入 credentials_provider。其余参数按实际环境选填。

OSS_USE_CNAME=false 时,SDK 使用 OSS_ENDPOINT(留空则根据 OSS_REGION 生成),请求地址采用 Bucket.Endpoint 形式。OSS_USE_CNAME=true 且配置了 OSS_DOMAIN 时,SDK 改用 OSS_DOMAIN 进行读写和临时 URL 签名,并且不再把 Bucket 名添加到主机名前。为兼容原有配置,未设置 OSS_DOMAIN 时仍使用 OSS_ENDPOINT 作为 CNAME Endpoint。

OSS_DOMAIN 必须是在 OSS 中绑定到当前 Bucket 的自定义 CNAME 域名。若只是希望 Storage::url() 使用 CDN 或其他公开访问地址,而 SDK 读写和临时 URL 继续使用 OSS Endpoint,请保持 OSS_USE_CNAME=false,并使用 OSS_URL 配置公开 URL。

和旧版 aliyuncs/oss-sdk-php 的配置相比,这里有几个差异:

自定义凭证提供器和重试器

credentials_provider 接受 SDK 的 CredentialsProvider 实现,设置后优先于 access_key_idaccess_key_secretsecurity_tokenretryer 接受 SDK 的 RetryerInterface 实现。

这两个参数是对象,不建议直接写进 config/filesystems.php,否则可能影响 Laravel 的 config:cache。可以在应用的 Service Provider 中、首次解析 OSS disk 前注入:

如果没有设置 retryer,SDK 会使用默认的 StandardRetryer。仅需调整最大重试次数时,直接配置 retry_max_attempts 即可。

自定义 HTTP 客户端

底层 SDK 的 AlibabaCloud\Oss\V2\Client 第二个参数支持传入 Guzzle 选项。你可以通过 client_options 透传这些配置:

本包不会自动替换底层 HTTP handler。如有需要,可以通过 client_options.handler 自行配置;该值会被原样传给 OSS SDK。

handler 通常是对象,不建议直接写入 config/filesystems.php。可以在应用的 Service Provider 中、首次解析 OSS disk 前注入:

注入原生 SDK Client

client 接受 AlibabaCloud\Oss\V2\Client 实例。设置后,本包不会再根据数组配置创建客户端:

自定义 Client 同样不建议直接写入配置文件,应在首次解析 OSS disk 前程序化注入。公开 URL 仍由 disk 的 urlendpointregion 和 endpoint 模式配置生成。

支持的操作

使用

详细请查看官方文档


All versions of laravel-oss-filesystem with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
alibabacloud/oss-v2 Version ^0.4
illuminate/container Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/filesystem Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
league/flysystem Version ^3.19
vergil-lai/oss-flysystem Version ^1.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 vergil-lai/laravel-oss-filesystem contains the following files

Loading the files please wait ...