Download the PHP package calchen/flysystem-aliyun-oss without Composer

On this page you can find all versions of the php package calchen/flysystem-aliyun-oss. 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 flysystem-aliyun-oss

flysystem-aliyun-oss

用于阿里云对象存储(OSS)的 Flysystem 适配器

Style CI Latest Stable Version Total Downloads License

English

这是一个基于阿里云 OSS SDK(2.3.0 及以上)的 Flysystem 适配器

受到 apollopy/flysystem-aliyun-oss 的启发

安装

Laravel

如果您的 Laravel 版本为 5.5 及以上,您不需要手动的配置文件中添加 AliyunOssServiceProvider Laravel 自带的扩展包发现机制会处理好一切。如是小于 5.5 版本那么需要您进行如下操作:

打开位于 app/ProvidersAppServiceProvider.php 文件并在 register 函数中添加如下内容:

您也可以在配置文件 config/app.php 中的 providers 中添加如下内容:

只需选择以上操作中的一种,即可加载本扩招包。

Lumen

Lumen 并未移植扩展包自动发现机制,所以需要手动加载扩展包并复制配置文件。

打开配置文件 bootstrap/app.php 并在大约 81 行左右添加如下内容:

将文件系统配置文件从 vendor/laravel/lumen-framework/filesystems.php 复制到 config/filesystems.php

配置

打开配置文件 config/filesystems.php 并在 disks 中添加如下内容:

如果您想将阿里云 OSS 作为默认的存储方式,那么可以在 .env 文件中设置配置项 FILESYSTEM_DRIVER=oss

配置说明

配置项 必须 说明 备注
driver 驱动名称 默认值:oss,不可修改
access_id 用于身份验证的 AccessKey ID 见下文“安全提醒”
access_key_secret 用于身份验证的 AccessKey Key Secret 见下文“安全提醒”
bucket 存储空间名称 -
endpoint 地域节点 见下文“地域节点”
cdn_base_url CDN 基础路径 见下文“CDN 基础路径”
prefix 保存路径的统一前缀 -

地域节点(endpoint)

官方地域节点:访问域名和数据中心

地域节点可以是域名,也可以是以 http://域名https://域名

如果地域节点是域名则默认使用 HTTPS,如果需要使用 HTTP 请使用 http://域名

用户域名(CNAME domain)

设置成功并正常解析至阿里云 OSS 访问域名的用户域名可作为地域节点使用,如果是解析到 CDN 节点的用户域名是不可以作为地域节点使用的!!!

CDN 基础路径(CDN base URL)

如果您为阿里云 OSS 存储空间启用了 CDN(无论是不是阿里云 CDN),那么建议您设置 cdn_base_url,设置此项后您获取到的文件 URL 将全部以 cdn_base_url 开头

安全提醒

为了安全,请使用子账户的 AccessKey ID 和 AccessKey Key Secret,请务必不要使用主账户的 AccessKey ID 和 AccessKey Key Secret

用法

在 Laravel/Lumen 中可以使用 \Storage::disk('oss')->temporaryUrl($filePath); 来获取阿里云 OSS 私有存储空间中文件的带签名的 URL

开源协议

MIT


All versions of flysystem-aliyun-oss with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
aliyuncs/oss-sdk-php Version ~2.3.0
league/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 calchen/flysystem-aliyun-oss contains the following files

Loading the files please wait ....