2017 © Pedro Peláez
 

library cos-php-sdk

php sdk for www.qcloud.com cos service

image

tencentyun/cos-php-sdk

php sdk for www.qcloud.com cos service

  • Friday, June 17, 2016
  • by moria
  • Repository
  • 14 Watchers
  • 19 Stars
  • 612 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 19 Forks
  • 1 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

tencentyun-cos-php

SDK for 腾讯云对象存储服务, (*1)

已弃用 - 请升级到 cos-php-sdk-v5

SDK 依赖的 API 已弃用,请直接使用基于 XML API 的 cos-php-sdk-v5。, (*2)

源码集成

从github下载源码装入到您的程序中,并加载include.php, (*3)

修改配置

修改Qcloud_cos/Conf.php内的APPID、SECRET_ID、SECRET_KEY等信息为您的配置, (*4)

程序示例(sample.php)

``` php require('./include.php'); use Qcloud_cos\Auth; use Qcloud_cos\Cosapi; use Qcloud_cos\CosDb;, (*5)

Cosapi::setTimeout(180);, (*6)

//创建文件夹 $bucketName = 'test'; $srcPath = './test.log'; $dstPath = '/sdk/test.log'; $dstFolder = '/sdk/'; $createFolderRet = Cosapi::createFolder($bucketName, $dstFolder); var_dump($createFolderRet);, (*7)

//上传文件 $bizAttr = ""; $insertOnly = 0; $sliceSize = 3 * 1024 * 1024; $uploadRet = Cosapi::upload($bucketName, $srcPath, $dstPath,$bizAttr,$sliceSize, $insertOnly); var_dump($uploadRet);, (*8)

//目录列表 $listnum = 20; $pattern = "eListBoth"; $order = 0; $listRet = Cosapi::listFolder($bucketName, $dstFolder,$listnum,$pattern, $order); var_dump($listRet);, (*9)

//更新目录信息 $bizAttr = ""; $updateRet = Cosapi::updateFolder($bucketName, $dstFolder, $bizAttr); var_dump($updateRet);, (*10)

//更新文件信息 $bizAttr = ""; $authority = "eWPrivateRPublic"; $customer_headers_array = array( 'Cache-Control' => "no", 'Content-Type' => "application/pdf", 'Content-Language' => "ch", ); $updateRet = Cosapi::update($bucketName, $dstPath, $bizAttr,$authority, $customer_headers_array); var_dump($updateRet);, (*11)

//查询目录信息 $statRet = Cosapi::statFolder($bucketName, $dstFolder); var_dump($statRet);, (*12)

//查询文件信息 $statRet = Cosapi::stat($bucketName, $dstPath); var_dump($statRet);, (*13)

//删除文件 $delRet = Cosapi::delFile($bucketName, $dstPath); var_dump($delRet);, (*14)

//删除目录 $delRet = Cosapi::delFolder($bucketName, $dstFolder); var_dump($delRet); ```, (*15)

The Versions

17/06 2016

3.3.x-dev

3.3.9999999.9999999-dev http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun

17/06 2016

dev-master

9999999-dev http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun

17/06 2016

3.3

3.3.0.0 http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun

06/01 2016

2.0.4

2.0.4.0 http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun

04/11 2015

2.0.3

2.0.3.0 http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun

28/10 2015

2.0.2

2.0.2.0 http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun

27/10 2015

2.0.1

2.0.1.0 http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun

27/10 2015

2.0.0

2.0.0.0 http://www.qcloud.com/

php sdk for www.qcloud.com cos service

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

sdk qcloud tencentyun