Download the PHP package bright-tech/aliyun-oss-sdk-php without Composer

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

Aliyun OSS SDK for PHP

Latest Stable Version Build Status Coverage Status

概述

阿里云对象存储(Object Storage Service,简称OSS),是阿里云对外提供的海量、安全、低成本、高可靠的云存储服务。用户可以通过调用API,在任何应用、任何时间、任何地点上传和下载数据,也可以通过用户Web控制台对数据进行简单的管理。OSS适合存放任意文件类型,适合各种网站、开发企业及开发者使用。

运行环境

提示:

安装方法

  1. 如果您通过composer管理您的项目依赖,可以在你的项目根目录运行:

    $ composer require aliyuncs/oss-sdk-php

    或者在你的composer.json中声明对Aliyun OSS SDK for PHP的依赖:

    "require": {
        "aliyuncs/oss-sdk-php": "~2.0"
    }

    然后通过composer install安装依赖。composer安装完成后,在您的PHP代码中引入依赖即可:

    require_once __DIR__ . '/vendor/autoload.php';
  2. 您也可以直接下载已经打包好的phar文件,然后在你 的代码中引入这个文件即可:

    require_once '/path/to/oss-sdk-php.phar';
  3. 下载SDK源码,在您的代码中引入SDK目录下的autoload.php文件:

    require_once '/path/to/oss-sdk/autoload.php';

快速使用

常用类

类名 解释
OSS\OssClient OSS客户端类,用户通过OssClient的实例调用接口
OSS\Core\OssException OSS异常类,用户在使用的过程中,只需要注意这个异常

OssClient初始化

SDK的OSS操作通过OssClient类完成的,下面代码创建一个OssClient对象:

文件操作

文件(又称对象,Object)是OSS中最基本的数据单元,您可以把它简单地理解为文件,用下面代码可以实现一个Object的上传:

存储空间操作

存储空间(又称Bucket)是一个用户用来管理所存储Object的存储空间,对于用户来说是一个管理Object的单元,所有的Object都必须隶属于某个Bucket。您可以按照下面的代码新建一个Bucket:

返回结果处理

OssClient提供的接口返回返回数据分为两种:

上面代码中的$bucketListInfo的数据类型是 OSS\Model\BucketListInfo

运行Sample程序

  1. 修改 samples/Config.php, 补充配置信息
  2. 执行 cd samples/ && php RunAll.php

运行单元测试

  1. 执行composer install下载依赖的库
  2. 设置环境变量

    export OSS_ACCESS_KEY_ID=access-key-id
    export OSS_ACCESS_KEY_SECRET=access-key-secret
    export OSS_ENDPOINT=endpoint
    export OSS_BUCKET=bucket-name
  3. 执行 php vendor/bin/phpunit

贡献代码

  1. 开发流程参考:https://github.com/rockuw/oss-sdk-status#development-oss-members-only
  2. 提交代码后,确保travis CI是PASS的
  3. 每发布一个新的版本:
    • 运行build-phar.sh生成相应的phar包(需要安装phar-composer)
    • Release页面发布一个版本
    • 将生成的phar包上传到相应的Release下面

联系我们


All versions of aliyun-oss-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 bright-tech/aliyun-oss-sdk-php contains the following files

Loading the files please wait ....