Download the PHP package bingher/obs without Composer

On this page you can find all versions of the php package bingher/obs. 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 obs

OBS

统一对象存储服务API客户端,支持多种云存储服务平台,提供简洁一致的接口。

项目介绍

OBS是一个轻量级的统一对象存储客户端库,为多种云存储服务提供一致的API接口。通过OBS,您可以用相同的代码轻松切换不同的存储服务提供商,无需关心底层实现细节。

支持平台

安装方法

通过Composer安装核心包:

按需安装驱动依赖

本项目支持按需安装驱动依赖,根据您使用的存储服务,只需安装对应的驱动包:

注意:如果您尝试使用某个驱动但未安装相应的依赖包,系统会提供明确的错误提示,指导您安装缺少的包。

快速开始

基本使用

切换驱动

配置说明

通用配置参数

配置项 类型 说明 是否必填 默认值
type string 驱动类型(推荐使用DriverType枚举) 是 -
endpoint string 服务端点URL 是 -
key string 访问密钥ID 是 -
secret string 访问密钥Secret 是 -
bucket string 存储桶名称 是 -
region string 区域 否 us-east-1
ssl_verify bool 是否验证SSL证书 否 false
timeout int 超时时间(秒) 否 30
connect_timeout int 连接超时时间(秒) 否 10
driver_options array 驱动特定配置 否 []

API参考

OBS类方法

__construct(array $config)

创建OBS客户端实例

setDriver(string $type): self

切换存储驱动

以下方法通过魔术方法调用对应驱动的实现

put(string $key, string $filePath, string $acl = 'private', string $contentType = ''): bool

上传文件

get(string $key, string $filePath): bool

下载文件

url(string $key, int $expire = 3600, string $contentType = ''): string

获取文件访问链接

putUrl(string $key, string $contentType, int $expire = 3600): array

获取预授权上传链接

exist(string $key): bool

检查文件是否存在

delete(string $key): bool

删除文件

download(string $url, string $filePath): bool

下载远程文件到本地

DriverType枚举

OBS提供了DriverType枚举类,用于安全地指定驱动类型:

运行测试

项目包含完整的测试用例,可通过以下方式运行:

  1. 首先确保安装了所有依赖

  2. 创建.env.ini配置文件,填入测试所需的存储服务配置

  3. 运行测试

系统要求

许可证

本项目基于MIT许可证开源。详见LICENSE文件。


All versions of obs with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 bingher/obs contains the following files

Loading the files please wait ...