diff --git a/sample/abortMultipartUpload.php b/sample/abortMultipartUpload.php index 50cd6da4..2a2887b3 100644 --- a/sample/abortMultipartUpload.php +++ b/sample/abortMultipartUpload.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/blindWatermark.php b/sample/blindWatermark.php index 2fc72534..b1eee5ae 100644 --- a/sample/blindWatermark.php +++ b/sample/blindWatermark.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/catchException.php b/sample/catchException.php index b44e6f1f..48e02640 100644 --- a/sample/catchException.php +++ b/sample/catchException.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/ciTransformation.php b/sample/ciTransformation.php index eece57ad..ad683863 100644 --- a/sample/ciTransformation.php +++ b/sample/ciTransformation.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/completeMultipartUpload.php b/sample/completeMultipartUpload.php index 35e0e04f..da5eee81 100644 --- a/sample/completeMultipartUpload.php +++ b/sample/completeMultipartUpload.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/copy.php b/sample/copy.php index b0e1d6ae..6ba9a896 100644 --- a/sample/copy.php +++ b/sample/copy.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/copyObject.php b/sample/copyObject.php index 813fc46b..6b496dd7 100644 --- a/sample/copyObject.php +++ b/sample/copyObject.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/cosClient.php b/sample/cosClient.php index b1a965bf..7e3d577d 100644 --- a/sample/cosClient.php +++ b/sample/cosClient.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $token = "COS_TMPTOKEN"; //"云 API 临时密钥 Token" $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( diff --git a/sample/createBucket.php b/sample/createBucket.php index eafad495..4c1a0fd6 100644 --- a/sample/createBucket.php +++ b/sample/createBucket.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/createFolder.php b/sample/createFolder.php index ccf3948a..91f54d8a 100644 --- a/sample/createFolder.php +++ b/sample/createFolder.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/createMultipartUpload.php b/sample/createMultipartUpload.php index bedca7e3..2d54dd73 100644 --- a/sample/createMultipartUpload.php +++ b/sample/createMultipartUpload.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucket.php b/sample/deleteBucket.php index a3d1fc26..b7363001 100644 --- a/sample/deleteBucket.php +++ b/sample/deleteBucket.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucketCors.php b/sample/deleteBucketCors.php index fc958e1a..16723194 100644 --- a/sample/deleteBucketCors.php +++ b/sample/deleteBucketCors.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucketDomain.php b/sample/deleteBucketDomain.php index 5239fe6d..fae1a327 100644 --- a/sample/deleteBucketDomain.php +++ b/sample/deleteBucketDomain.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucketGuetzli.php b/sample/deleteBucketGuetzli.php index f165e70d..73c181ff 100644 --- a/sample/deleteBucketGuetzli.php +++ b/sample/deleteBucketGuetzli.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucketImageStyle.php b/sample/deleteBucketImageStyle.php index cc4a2959..64c03841 100644 --- a/sample/deleteBucketImageStyle.php +++ b/sample/deleteBucketImageStyle.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucketLifecycle.php b/sample/deleteBucketLifecycle.php index dbe3183c..bc6c0f07 100644 --- a/sample/deleteBucketLifecycle.php +++ b/sample/deleteBucketLifecycle.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucketTagging.php b/sample/deleteBucketTagging.php index 9341d2a5..2ea7545e 100644 --- a/sample/deleteBucketTagging.php +++ b/sample/deleteBucketTagging.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteBucketWebsite.php b/sample/deleteBucketWebsite.php index a2b80141..47ac0639 100644 --- a/sample/deleteBucketWebsite.php +++ b/sample/deleteBucketWebsite.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteFolder.php b/sample/deleteFolder.php index 61bec247..834d321c 100644 --- a/sample/deleteFolder.php +++ b/sample/deleteFolder.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteObject.php b/sample/deleteObject.php index d89655e5..f872b055 100644 --- a/sample/deleteObject.php +++ b/sample/deleteObject.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/deleteObjectTagging.php b/sample/deleteObjectTagging.php index df6a2292..3144426a 100644 --- a/sample/deleteObjectTagging.php +++ b/sample/deleteObjectTagging.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/detectLable.php b/sample/detectLable.php index da120c10..29325893 100644 --- a/sample/detectLable.php +++ b/sample/detectLable.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/download.php b/sample/download.php index 2a0b2081..5f2c030d 100644 --- a/sample/download.php +++ b/sample/download.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( @@ -14,8 +14,8 @@ 'secretKey' => $secretKey))); $local_path = "/data/exampleobject"; -$printbar = function($totolSize, $downloadedSize) { - printf("downloaded [%d/%d]\n", $downloadedSize, $totolSize); +$printbar = function($totalSize, $downloadedSize) { + printf("downloaded [%d/%d]\n", $downloadedSize, $totalSize); }; try { diff --git a/sample/downloadFolder.php b/sample/downloadFolder.php index 0297ad14..0eb422c8 100644 --- a/sample/downloadFolder.php +++ b/sample/downloadFolder.php @@ -2,9 +2,9 @@ require dirname( __FILE__ ) . '/../vendor/autoload.php'; -$secretId = 'COS_SECRETID'; +$secretId = 'SECRETID'; //'云 API 密钥 SecretId'; -$secretKey = 'COS_SECRETKEY'; +$secretKey = 'SECRETKEY'; //'云 API 密钥 SecretKey'; $region = 'ap-beijing'; //设置一个默认的存储桶地域 diff --git a/sample/getBlindWatermark.php b/sample/getBlindWatermark.php index 01a54bbd..ae3e2dd3 100644 --- a/sample/getBlindWatermark.php +++ b/sample/getBlindWatermark.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketAcl.php b/sample/getBucketAcl.php index 997c56f0..f291315d 100644 --- a/sample/getBucketAcl.php +++ b/sample/getBucketAcl.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketCors.php b/sample/getBucketCors.php index 55b347f9..79d17818 100644 --- a/sample/getBucketCors.php +++ b/sample/getBucketCors.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketDomain.php b/sample/getBucketDomain.php index 72caf276..bc358ba5 100644 --- a/sample/getBucketDomain.php +++ b/sample/getBucketDomain.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketGuetzli.php b/sample/getBucketGuetzli.php index b1f53956..86e45983 100644 --- a/sample/getBucketGuetzli.php +++ b/sample/getBucketGuetzli.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketImageStyle.php b/sample/getBucketImageStyle.php index bb479178..2c7a3d94 100644 --- a/sample/getBucketImageStyle.php +++ b/sample/getBucketImageStyle.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketInventory.php b/sample/getBucketInventory.php index f76f47fb..dc580a59 100644 --- a/sample/getBucketInventory.php +++ b/sample/getBucketInventory.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketLifecycle.php b/sample/getBucketLifecycle.php index aef6702c..06a82465 100644 --- a/sample/getBucketLifecycle.php +++ b/sample/getBucketLifecycle.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketLogging.php b/sample/getBucketLogging.php index 1bea1807..3305551e 100644 --- a/sample/getBucketLogging.php +++ b/sample/getBucketLogging.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketTagging.php b/sample/getBucketTagging.php index 344d253d..9c460ca6 100644 --- a/sample/getBucketTagging.php +++ b/sample/getBucketTagging.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getBucketWebsite.php b/sample/getBucketWebsite.php index 3e5d76dc..01a42574 100644 --- a/sample/getBucketWebsite.php +++ b/sample/getBucketWebsite.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getObject.php b/sample/getObject.php index cbc0da7f..d94add31 100644 --- a/sample/getObject.php +++ b/sample/getObject.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/getObjectTagging.php b/sample/getObjectTagging.php index ad8df15a..f3540df4 100644 --- a/sample/getObjectTagging.php +++ b/sample/getObjectTagging.php @@ -1,8 +1,8 @@ $region, diff --git a/sample/textWatermark.php b/sample/textWatermark.php index 83622ea5..4227bef1 100644 --- a/sample/textWatermark.php +++ b/sample/textWatermark.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/sample/upload.php b/sample/upload.php index 7ef439fb..178f6f24 100644 --- a/sample/upload.php +++ b/sample/upload.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( @@ -14,8 +14,8 @@ 'secretKey' => $secretKey))); $local_path = "/data/exampleobject"; -$printbar = function($totolSize, $uploadedSize) { - printf("uploaded [%d/%d]\n", $uploadedSize, $totolSize); +$printbar = function($totalSize, $uploadedSize) { + printf("uploaded [%d/%d]\n", $uploadedSize, $totalSize); }; try { diff --git a/sample/uploadFolder.php b/sample/uploadFolder.php index 6b93925b..389fc58c 100644 --- a/sample/uploadFolder.php +++ b/sample/uploadFolder.php @@ -2,9 +2,9 @@ require dirname( __FILE__ ) . '/../vendor/autoload.php'; -$secretId = 'COS_SECRETID'; +$secretId = 'SECRETID'; //'云 API 密钥 SecretId'; -$secretKey = 'COS_SECRETKEY'; +$secretKey = 'SECRETKEY'; //'云 API 密钥 SecretKey'; $region = 'ap-beijing'; //设置一个默认的存储桶地域 diff --git a/sample/uploadPart.php b/sample/uploadPart.php index d2558070..54df340c 100644 --- a/sample/uploadPart.php +++ b/sample/uploadPart.php @@ -2,8 +2,8 @@ require dirname(__FILE__) . '/../vendor/autoload.php'; -$secretId = "COS_SECRETID"; //"云 API 密钥 SecretId"; -$secretKey = "COS_SECRETKEY"; //"云 API 密钥 SecretKey"; +$secretId = "SECRETID"; //"云 API 密钥 SecretId"; +$secretKey = "SECRETKEY"; //"云 API 密钥 SecretKey"; $region = "ap-beijing"; //设置一个默认的存储桶地域 $cosClient = new Qcloud\Cos\Client( array( diff --git a/src/Qcloud/Cos/MultipartUpload.php b/src/Qcloud/Cos/MultipartUpload.php index e38ddd40..2f928ff6 100644 --- a/src/Qcloud/Cos/MultipartUpload.php +++ b/src/Qcloud/Cos/MultipartUpload.php @@ -19,7 +19,7 @@ class MultipartUpload { private $parts; private $body; private $progress; - private $totolSize; + private $totalSize; private $uploadedSize; public function __construct($client, $body, $options = array()) { @@ -30,11 +30,11 @@ public function __construct($client, $body, $options = array()) { $this->options = $options; $this->partSize = $this->calculatePartSize($minPartSize); $this->concurrency = isset($options['Concurrency']) ? $options['Concurrency'] : 10; - $this->progress = isset($options['Progress']) ? $options['Progress'] : function($totolSize, $uploadedSize) {}; + $this->progress = isset($options['Progress']) ? $options['Progress'] : function($totalSize, $uploadedSize) {}; $this->parts = []; $this->partNumberList = []; $this->uploadedSize = 0; - $this->totolSize = $this->body->getSize(); + $this->totalSize = $this->body->getSize(); $this->needMd5 = isset($options['ContentMD5']) ? $options['ContentMD5'] : true; $this->retry = isset($options['Retry']) ? $options['Retry'] : 3; } @@ -66,8 +66,8 @@ public function uploadParts($uploadId) { } $body = $this->body->read($this->partSize); $partSize = $this->partSize; - if ($offset + $this->partSize >= $this->totolSize) { - $partSize = $this->totolSize - $offset; + if ($offset + $this->partSize >= $this->totalSize) { + $partSize = $this->totalSize - $offset; } $offset += $partSize; if (empty($body)) { @@ -107,7 +107,7 @@ public function uploadParts($uploadId) { $part = array('PartNumber' => $partNumber, 'ETag' => $etag); $this->parts[$partNumber] = $part; $this->uploadedSize += $partSize; - call_user_func_array($this->progress, [$this->totolSize, $this->uploadedSize]); + call_user_func_array($this->progress, [$this->totalSize, $this->uploadedSize]); }, 'rejected' => function ($reason, $index) { diff --git a/src/Qcloud/Cos/RangeDownload.php b/src/Qcloud/Cos/RangeDownload.php index e521ac0a..fb13e241 100644 --- a/src/Qcloud/Cos/RangeDownload.php +++ b/src/Qcloud/Cos/RangeDownload.php @@ -14,7 +14,7 @@ class RangeDownload { private $partSize; private $parts; private $progress; - private $totolSize; + private $totalSize; private $resumableJson; public function __construct( $client, $contentLength, $saveAs, $options = array() ) { @@ -22,13 +22,13 @@ public function __construct( $client, $contentLength, $saveAs, $options = array( $this->options = $options; $this->partSize = isset( $options['PartSize'] ) ? $options['PartSize'] : self::DEFAULT_PART_SIZE; $this->concurrency = isset( $options['Concurrency'] ) ? $options['Concurrency'] : 10; - $this->progress = isset( $options['Progress'] ) ? $options['Progress'] : function( $totolSize, $downloadedSize ) { + $this->progress = isset( $options['Progress'] ) ? $options['Progress'] : function( $totalSize, $downloadedSize ) { } ; $this->parts = []; $this->partNumberList = []; $this->downloadedSize = 0; - $this->totolSize = $contentLength; + $this->totalSize = $contentLength; $this->saveAs = $saveAs; $this->resumableJson = []; $this->resumableJson = isset( $options['ResumableJson'] ) ? $options['ResumableJson'] : []; @@ -83,10 +83,10 @@ public function donwloadParts() { $uploadRequests = function () { $index = 1; $partSize = 0; - for ( $offset = 0; $offset < $this->totolSize; ) { + for ( $offset = 0; $offset < $this->totalSize; ) { $partSize = $this->partSize; - if ( $offset + $this->partSize >= $this->totolSize ) { - $partSize = $this->totolSize - $offset; + if ( $offset + $this->partSize >= $this->totalSize ) { + $partSize = $this->totalSize - $offset; } $this->parts[$index]['PartSize'] = $partSize; $this->parts[$index]['Offset'] = $offset; @@ -107,7 +107,7 @@ public function donwloadParts() { } else { $this->resumableJson['DownloadedBlocks'][] = ['from' => $begin, 'to' => $end]; $this->downloadedSize += $partSize; - call_user_func_array( $this->progress, [$this->totolSize, $this->downloadedSize] ); + call_user_func_array( $this->progress, [$this->totalSize, $this->downloadedSize] ); } $offset += $partSize; } @@ -133,7 +133,7 @@ public function donwloadParts() { $this->resumableJson['DownloadedBlocks'][] = ['from' => $begin, 'to' => $end]; $partSize = $this->parts[$index]['PartSize']; $this->downloadedSize += $partSize; - call_user_func_array( $this->progress, [$this->totolSize, $this->downloadedSize] ); + call_user_func_array( $this->progress, [$this->totalSize, $this->downloadedSize] ); } , 'rejected' => function ( $reason, $index ) { diff --git a/src/Qcloud/Cos/ResultTransformer.php b/src/Qcloud/Cos/ResultTransformer.php index bb7e0766..26bc3250 100644 --- a/src/Qcloud/Cos/ResultTransformer.php +++ b/src/Qcloud/Cos/ResultTransformer.php @@ -140,9 +140,9 @@ public function getSelectContents($result) { if (empty($tmp)) { break; } - $totol_length = (int)(unpack("N", $tmp)[1]); + $total_length = (int)(unpack("N", $tmp)[1]); $headers_length = (int)(unpack("N", $f->read(4))[1]); - $body_length = $totol_length - $headers_length - 16; + $body_length = $total_length - $headers_length - 16; $predule_crc = (int)(unpack("N", $f->read(4))[1]); $headers = array(); for ($offset = 0; $offset < $headers_length;) {