diff --git a/src/vendor/aliyuncs/oss-sdk-php/CHANGELOG.md b/src/vendor/aliyuncs/oss-sdk-php/CHANGELOG.md
index 0de5ae5c7..63167e5f7 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/CHANGELOG.md
+++ b/src/vendor/aliyuncs/oss-sdk-php/CHANGELOG.md
@@ -1,159 +1,137 @@
-# ChangeLog - Aliyun OSS SDK for PHP
-
-## v2.7.2 / 2024-10-28
-* Added: presign supports response-* parameters
-* Added: forcePathStyle option.
-
-## v2.7.1 / 2024-02-28
-* Fixed: fix deprecated
-
-## v2.7.0 / 2024-02-02
-* Added: support signature version 4.
-* Added: support checkObjectEndcoding option.
-* Added: support strictObjectName option.
-* Added: support filePathCompatible option.
-* Added: support path style.
-* Added: support environment variables credentials provider.
-* Update: add filed for some api.
-* Fixed: fix some bugs.
-
-## v2.6.0 / 2022-08-03
-* Added: support credentials provider.
-* Fixed: compatible with swoole curl handler.
-* Added: support more bucket stat info.
-
-## v2.5.0 / 2022-05-13
-* Added: support bucket transfer acceleration.
-* Added: support bucket cname token.
-* Added: support listobjectsV2.
-
-## v2.4.3 / 2021-08-25
-* Fixed: integer overflow in PHP5.x.
-
-## v2.4.2 / 2021-06-04
-* Compatible with PHP8.
-* Fixed: compatible with PHP5.4.
-* Fixed: the signature is incorrect in some scenarios
-* Update: change $requestUrl from a member variable to a local variable.
-
-## v2.4.1 / 2020-09-29
-* Fixed: the getBucketPolicy bug.
-
-
-## v2.4.0 / 2020-08-31
-
-* Added: disable Expect: 100-continue
-* Added: support getBucketInfo
-* Added: support getBucketStat
-* Added: support bucket policy
-* Added: support bucket encryption
-* Added: support bucket tagging
-* Added: support bucket worm
-* Added: support versioning
-* Added: support request payment
-* Added: support object tagging
-* Added: support code archive
-* Added: support process object
-* Added: support traffic limit paramter
-* Added: support upload object from file handle
-* Added: support getSimplifiedObjectMeta
-* Fixed: the object name can not be '0' stirng.
-* Update: endpoint validity check
-* Update: add new pre-signed url api
-
-
-## v2.3.1 / 2019-01-15
-
-* translate chinese comments into english
-* Added: endpoint validity check
-
-## v2.3.0 / 2018-01-05
-
-* Fixed: putObject support creating empty files
-* Fixed: createBucket support IA/Archive
-* Added: support restoreObject
-* Added: support the Symlink feature
-* Added: support getBucketLocation
-* Added: support getBucketMeta
-* Added: support proxy server Proxy
-
-## v2.2.4 / 2017-04-25
-
-* Fixed getObject to local file bug
-
-## v2.2.3 / 2017-04-14
-
-* Fixed md5 check
-
-## v2.2.2 / 2017-01-18
-
-* Resolve to run the connection number and memory bug on php7
-
-## v2.2.1 / 2016-12-01
-
-* No HTTP curl is allowed to automatically populate accept-encoding
-
-## v2.2.0 / 2016-11-22
-
-* Fixed PutObject/CompleteMultipartUpload return values(#26)
-
-## v2.1.0 / 2016-11-12
-
-* Added[RTMP](https://help.aliyun.com/document_detail/44297.html)interface
-* Add support[image service](https://help.aliyun.com/document_detail/44686.html)
-
-## v2.0.7 / 2016-06-17
-
-* Support append object
-
-## v2.0.6
-
-* Trim access key id/secret and endpoint
-* Refine tests and setup travis CI
-
-## v2.0.5
-
-* Added Add/Delete/Get BucketCname interface
-
-## v2.0.4
-
-* Added Put/Get Object Acl interface
-
-## v2.0.3
-
-* Fixing the constants in Util is defined in a PHP version that is less than 5.6.
-
-## v2.0.2
-
-* The problem of content-type cannot be specified when restoring multipart uploads
-
-## v2.0.1
-
-* Increase the ListObjects/ListMultipartUploads special characters
-* Provides the interface to get the details of the OssException
-
-
-## 2015.11.25
-
-* **Large version upgrade, no longer compatible with previous interface, new version has made great improvements to ease of use, suggesting that users migrate to a new version.**
-
-## Modify the content
-
-* PHP 5.2 is no longer supported
-
-### Add the cotent
-
-* Introduce namespace
-* Interface naming and modification, using hump naming
-* The interface is modified, and the common parameters are extracted from the Options parameter.
-* The interface returns the result modification, processing the return result, and the user can directly get the data structure easily processed
-* OssClient's constructor changes
-* The Endpoint address that support CNAME and IP formats
-* Rearrange the sample file organization structure and use function to organize the function points
-* Add an interface that sets the connection timeout and requests timeout
-* Remove the outdated interface associated with the Object Group
-* The message in the OssException is changed to English
-
-### Repair problem
-
-* The object name is not complete
+# ChangeLog - Aliyun OSS SDK for PHP
+
+## v2.5.0 / 2022-05-13
+* Added: support bucket transfer acceleration.
+* Added: support bucket cname token.
+* Added: support listobjectsV2.
+
+## v2.4.3 / 2021-08-25
+* Fixed: integer overflow in PHP5.x.
+
+## v2.4.2 / 2021-06-04
+* Compatible with PHP8.
+* Fixed: compatible with PHP5.4.
+* Fixed: the signature is incorrect in some scenarios
+* Update: change $requestUrl from a member variable to a local variable.
+
+## v2.4.1 / 2020-09-29
+* Fixed: the getBucketPolicy bug.
+
+
+## v2.4.0 / 2020-08-31
+
+* Added: disable Expect: 100-continue
+* Added: support getBucketInfo
+* Added: support getBucketStat
+* Added: support bucket policy
+* Added: support bucket encryption
+* Added: support bucket tagging
+* Added: support bucket worm
+* Added: support versioning
+* Added: support request payment
+* Added: support object tagging
+* Added: support code archive
+* Added: support process object
+* Added: support traffic limit paramter
+* Added: support upload object from file handle
+* Added: support getSimplifiedObjectMeta
+* Fixed: the object name can not be '0' stirng.
+* Update: endpoint validity check
+* Update: add new pre-signed url api
+
+
+## v2.3.1 / 2019-01-15
+
+* translate chinese comments into english
+* Added: endpoint validity check
+
+## v2.3.0 / 2018-01-05
+
+* Fixed: putObject support creating empty files
+* Fixed: createBucket support IA/Archive
+* Added: support restoreObject
+* Added: support the Symlink feature
+* Added: support getBucketLocation
+* Added: support getBucketMeta
+* Added: support proxy server Proxy
+
+## v2.2.4 / 2017-04-25
+
+* Fixed getObject to local file bug
+
+## v2.2.3 / 2017-04-14
+
+* Fixed md5 check
+
+## v2.2.2 / 2017-01-18
+
+* Resolve to run the connection number and memory bug on php7
+
+## v2.2.1 / 2016-12-01
+
+* No HTTP curl is allowed to automatically populate accept-encoding
+
+## v2.2.0 / 2016-11-22
+
+* Fixed PutObject/CompleteMultipartUpload return values(#26)
+
+## v2.1.0 / 2016-11-12
+
+* Added[RTMP](https://help.aliyun.com/document_detail/44297.html)interface
+* Add support[image service](https://help.aliyun.com/document_detail/44686.html)
+
+## v2.0.7 / 2016-06-17
+
+* Support append object
+
+## v2.0.6
+
+* Trim access key id/secret and endpoint
+* Refine tests and setup travis CI
+
+## v2.0.5
+
+* Added Add/Delete/Get BucketCname interface
+
+## v2.0.4
+
+* Added Put/Get Object Acl interface
+
+## v2.0.3
+
+* Fixing the constants in Util is defined in a PHP version that is less than 5.6.
+
+## v2.0.2
+
+* The problem of content-type cannot be specified when restoring multipart uploads
+
+## v2.0.1
+
+* Increase the ListObjects/ListMultipartUploads special characters
+* Provides the interface to get the details of the OssException
+
+
+## 2015.11.25
+
+* **Large version upgrade, no longer compatible with previous interface, new version has made great improvements to ease of use, suggesting that users migrate to a new version.**
+
+## Modify the content
+
+* PHP 5.2 is no longer supported
+
+### Add the cotent
+
+* Introduce namespace
+* Interface naming and modification, using hump naming
+* The interface is modified, and the common parameters are extracted from the Options parameter.
+* The interface returns the result modification, processing the return result, and the user can directly get the data structure easily processed
+* OssClient's constructor changes
+* The Endpoint address that support CNAME and IP formats
+* Rearrange the sample file organization structure and use function to organize the function points
+* Add an interface that sets the connection timeout and requests timeout
+* Remove the outdated interface associated with the Object Group
+* The message in the OssException is changed to English
+
+### Repair problem
+
+* The object name is not complete
diff --git a/src/vendor/aliyuncs/oss-sdk-php/composer.json b/src/vendor/aliyuncs/oss-sdk-php/composer.json
index f8ace5527..29e280b98 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/composer.json
+++ b/src/vendor/aliyuncs/oss-sdk-php/composer.json
@@ -15,7 +15,7 @@
},
"require-dev" : {
"phpunit/phpunit": "*",
- "php-coveralls/php-coveralls": "*"
+ "satooshi/php-coveralls": "*"
},
"minimum-stability": "stable",
"autoload": {
diff --git a/src/vendor/aliyuncs/oss-sdk-php/samples/BucketCors.php b/src/vendor/aliyuncs/oss-sdk-php/samples/BucketCors.php
index f5f8f2147..dfa42d323 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/samples/BucketCors.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/samples/BucketCors.php
@@ -26,39 +26,7 @@ Common::println("bucket $bucket corsConfig created:" . $corsConfig->serializeToX
// Get cors configuration
$corsConfig = $ossClient->getBucketCors($bucket);
-
-if ($corsConfig->getResponseVary()){
- printf("Response Vary : true" .PHP_EOL);
-}else{
- printf("Response Vary : false" .PHP_EOL);
-}
-
-foreach ($corsConfig->getRules() as $key => $rule){
- if($rule->getAllowedHeaders()){
- foreach($rule->getAllowedHeaders() as $header){
- printf("Allowed Headers :" .$header .PHP_EOL);
- }
- }
- if ($rule->getAllowedMethods()){
- foreach($rule->getAllowedMethods() as $method){
- printf("Allowed Methods :" .$method . PHP_EOL);
- }
-
- }
- if($rule->getAllowedOrigins()){
- foreach($rule->getAllowedOrigins() as $origin){
- printf("Allowed Origins :" .$origin , PHP_EOL);
- }
-
- }
- if($rule->getExposeHeaders()){
- foreach($rule->getExposeHeaders() as $exposeHeader){
- printf("Expose Headers :" .$exposeHeader . PHP_EOL);
- }
- }
- printf("Max Age Seconds :" .$rule->getMaxAgeSeconds() .PHP_EOL);
-
-}
+Common::println("bucket $bucket corsConfig fetched:" . $corsConfig->serializeToXml());
// Delete cors configuration
$ossClient->deleteBucketCors($bucket);
@@ -110,44 +78,13 @@ function getBucketCors($ossClient, $bucket)
$corsConfig = null;
try {
$corsConfig = $ossClient->getBucketCors($bucket);
-
- if ($corsConfig->getResponseVary()){
- printf("Response Vary : true" .PHP_EOL);
- }else{
- printf("Response Vary : false" .PHP_EOL);
- }
- foreach ($corsConfig->getRules() as $key => $rule){
- if($rule->getAllowedHeaders()){
- foreach($rule->getAllowedHeaders() as $header){
- printf("Allowed Headers :" .$header .PHP_EOL);
- }
- }
- if ($rule->getAllowedMethods()){
- foreach($rule->getAllowedMethods() as $method){
- printf("Allowed Methods :" .$method . PHP_EOL);
- }
-
- }
- if($rule->getAllowedOrigins()){
- foreach($rule->getAllowedOrigins() as $origin){
- printf("Allowed Origins :" .$origin , PHP_EOL);
- }
-
- }
- if($rule->getExposeHeaders()){
- foreach($rule->getExposeHeaders() as $exposeHeader){
- printf("Expose Headers :" .$exposeHeader . PHP_EOL);
- }
- }
- printf("Max Age Seconds :" .$rule->getMaxAgeSeconds() .PHP_EOL);
-
- }
} catch (OssException $e) {
printf(__FUNCTION__ . ": FAILED\n");
printf($e->getMessage() . "\n");
return;
}
print(__FUNCTION__ . ": OK" . "\n");
+ print($corsConfig->serializeToXml() . "\n");
}
/**
diff --git a/src/vendor/aliyuncs/oss-sdk-php/samples/Object.php b/src/vendor/aliyuncs/oss-sdk-php/samples/Object.php
index 5d83efaa7..bf6e86b04 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/samples/Object.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/samples/Object.php
@@ -55,7 +55,7 @@ $day = 3;
$tier = 'Expedited';
$config = new RestoreConfig($day,$tier);
$options = array(
- OssClient::OSS_RESTORE_CONFIG => $config
+ OssClient::OSS_RESTORE_CONFIG => $config
);
$ossClient->restoreObject($bucket, 'b.file',$options);
@@ -93,9 +93,9 @@ $content = "hello world";
// The speed limit is 100 KB/s, which is 819200 bit/s.
$options = array(
- OssClient::OSS_HEADERS => array(
- OssClient::OSS_TRAFFIC_LIMIT => 819200,
- ));
+ OssClient::OSS_HEADERS => array(
+ OssClient::OSS_TRAFFIC_LIMIT => 819200,
+ ));
// Speed limit upload.
$ossClient->putObject($bucket, $object, $content, $options);
@@ -205,7 +205,7 @@ function uploadFile($ossClient, $bucket)
}
/**
- * Lists all files and folders in the bucket.
+ * Lists all files and folders in the bucket.
* Note if there's more items than the max-keys specified, the caller needs to use the nextMarker returned as the value for the next call's maker paramter.
* Loop through all the items returned from ListObjects.
*
@@ -227,47 +227,30 @@ function listObjects($ossClient, $bucket)
);
try {
$listObjectInfo = $ossClient->listObjects($bucket, $options);
- printf("Bucket Name: %s". "\n",$listObjectInfo->getBucketName());
- printf("Prefix: %s". "\n",$listObjectInfo->getPrefix());
- printf("Marker: %s". "\n",$listObjectInfo->getMarker());
- printf("Next Marker: %s". "\n",$listObjectInfo->getNextMarker());
- printf("Max Keys: %s". "\n",$listObjectInfo->getMaxKeys());
- printf("Delimiter: %s". "\n",$listObjectInfo->getDelimiter());
- printf("Is Truncated: %s". "\n",$listObjectInfo->getIsTruncated());
- $objectList = $listObjectInfo->getObjectList(); // object list
- $prefixList = $listObjectInfo->getPrefixList(); // directory list
- if (!empty($objectList)) {
- print("objectList:\n");
- foreach ($objectList as $objectInfo) {
- printf("Object Name: %s". "\n",$objectInfo->getKey());
- printf("Object Size: %s". "\n",$objectInfo->getSize());
- printf("Object Type: %s". "\n",$objectInfo->getType());
- printf("Object ETag: %s". "\n",$objectInfo->getETag());
- printf("Object Last Modified: %s". "\n",$objectInfo->getLastModified());
- printf("Object Storage Class: %s". "\n",$objectInfo->getStorageClass());
-
- if ($objectInfo->getRestoreInfo()){
- printf("Restore Info: %s". "\n",$objectInfo->getRestoreInfo() );
- }
-
- if($objectInfo->getOwner()){
- printf("Owner Id:".$objectInfo->getOwner()->getId() . "\n");
- printf("Owner Name:".$objectInfo->getOwner()->getDisplayName() . "\n");
- }
- }
- }
- if (!empty($prefixList)) {
- print("prefixList: \n");
- foreach ($prefixList as $prefixInfo) {
- printf("Common Prefix:%s\n",$prefixInfo->getPrefix());
- }
- }
} catch (OssException $e) {
printf(__FUNCTION__ . ": FAILED\n");
printf($e->getMessage() . "\n");
return;
}
print(__FUNCTION__ . ": OK" . "\n");
+ $objectList = $listObjectInfo->getObjectList(); // object list
+ $prefixList = $listObjectInfo->getPrefixList(); // directory list
+ if (!empty($objectList)) {
+ print("objectList:\n");
+ foreach ($objectList as $objectInfo) {
+ print($objectInfo->getKey() . "\n");
+ if($objectInfo->getOwner() != null){
+ printf("owner id:".$objectInfo->getOwner()->getId() . "\n");
+ printf("owner name:".$objectInfo->getOwner()->getDisplayName() . "\n");
+ }
+ }
+ }
+ if (!empty($prefixList)) {
+ print("prefixList: \n");
+ foreach ($prefixList as $prefixInfo) {
+ print($prefixInfo->getPrefix() . "\n");
+ }
+ }
}
/**
@@ -281,61 +264,42 @@ function listObjects($ossClient, $bucket)
*/
function listObjectsV2($ossClient, $bucket)
{
- $prefix = 'oss-php-sdk-test/';
- $delimiter = '/';
- $maxkeys = 1000;
- $options = array(
- 'delimiter' => $delimiter,
- 'prefix' => $prefix,
- 'max-keys' => $maxkeys,
- 'start-after' =>'test-object',
- 'fetch-owner' =>'true',
- );
- try {
- $listObjectInfo = $ossClient->listObjectsV2($bucket, $options);
- printf("Bucket Name: %s". "\n",$listObjectInfo->getBucketName());
- printf("Prefix: %s". "\n",$listObjectInfo->getPrefix());
- printf("Next Continuation Token: %s". "\n",$listObjectInfo->getNextContinuationToken());
- printf("Continuation Token: %s". "\n",$listObjectInfo->getContinuationToken());
- printf("Max Keys: %s". "\n",$listObjectInfo->getMaxKeys());
- printf("Key Count: %s". "\n",$listObjectInfo->getKeyCount());
- printf("Delimiter: %s". "\n",$listObjectInfo->getDelimiter());
- printf("Is Truncated: %s". "\n",$listObjectInfo->getIsTruncated());
- printf("Start After: %s". "\n",$listObjectInfo->getStartAfter());
- $objectList = $listObjectInfo->getObjectList(); // object list
- $prefixList = $listObjectInfo->getPrefixList(); // directory list
- if (!empty($objectList)) {
- print("objectList:\n");
- foreach ($objectList as $objectInfo) {
- printf("Object Name: %s". "\n",$objectInfo->getKey());
- printf("Object Size: %s". "\n",$objectInfo->getSize());
- printf("Object Type: %s". "\n",$objectInfo->getType());
- printf("Object ETag: %s". "\n",$objectInfo->getETag());
- printf("Object Last Modified: %s". "\n",$objectInfo->getLastModified());
- printf("Object Storage Class: %s". "\n",$objectInfo->getStorageClass());
-
- if ($objectInfo->getRestoreInfo()){
- printf("Restore Info: %s". "\n",$objectInfo->getRestoreInfo() );
- }
-
- if($objectInfo->getOwner()){
- printf("Owner Id:".$objectInfo->getOwner()->getId() . "\n");
- printf("Owner Name:".$objectInfo->getOwner()->getDisplayName() . "\n");
- }
- }
- }
- if (!empty($prefixList)) {
- print("prefixList: \n");
- foreach ($prefixList as $prefixInfo) {
- printf("Common Prefix:%s\n",$prefixInfo->getPrefix());
- }
- }
- } catch (OssException $e) {
- printf(__FUNCTION__ . ": FAILED\n");
- printf($e->getMessage() . "\n");
- return;
- }
- print(__FUNCTION__ . ": OK" . "\n");
+ $prefix = 'oss-php-sdk-test/';
+ $delimiter = '/';
+ $maxkeys = 1000;
+ $options = array(
+ 'delimiter' => $delimiter,
+ 'prefix' => $prefix,
+ 'max-keys' => $maxkeys,
+ 'start-after' =>'test-object',
+ 'fetch-owner' =>'true',
+ );
+ try {
+ $listObjectInfo = $ossClient->listObjectsV2($bucket, $options);
+ } catch (OssException $e) {
+ printf(__FUNCTION__ . ": FAILED\n");
+ printf($e->getMessage() . "\n");
+ return;
+ }
+ print(__FUNCTION__ . ": OK" . "\n");
+ $objectList = $listObjectInfo->getObjectList(); // object list
+ $prefixList = $listObjectInfo->getPrefixList(); // directory list
+ if (!empty($objectList)) {
+ print("objectList:\n");
+ foreach ($objectList as $objectInfo) {
+ print($objectInfo->getKey() . "\n");
+ if($objectInfo->getOwner() != null){
+ printf("owner id:".$objectInfo->getOwner()->getId() . "\n");
+ printf("owner name:".$objectInfo->getOwner()->getDisplayName() . "\n");
+ }
+ }
+ }
+ if (!empty($prefixList)) {
+ print("prefixList: \n");
+ foreach ($prefixList as $prefixInfo) {
+ print($prefixInfo->getPrefix() . "\n");
+ }
+ }
}
/**
@@ -659,20 +623,20 @@ function doesObjectExist($ossClient, $bucket)
*/
function putObjectSpeed($ossClient, $bucket)
{
- $object = "upload-test-object-name.txt";
- $content = file_get_contents(__FILE__);
- $options = array(
- OssClient::OSS_HEADERS => array(
- OssClient::OSS_TRAFFIC_LIMIT => 819200,
- ));
- try {
- $ossClient->putObject($bucket, $object, $content, $options);
- } catch (OssException $e) {
- printf(__FUNCTION__ . ": FAILED\n");
- printf($e->getMessage() . "\n");
- return;
- }
- print(__FUNCTION__ . ": OK" . "\n");
+ $object = "upload-test-object-name.txt";
+ $content = file_get_contents(__FILE__);
+ $options = array(
+ OssClient::OSS_HEADERS => array(
+ OssClient::OSS_TRAFFIC_LIMIT => 819200,
+ ));
+ try {
+ $ossClient->putObject($bucket, $object, $content, $options);
+ } catch (OssException $e) {
+ printf(__FUNCTION__ . ": FAILED\n");
+ printf($e->getMessage() . "\n");
+ return;
+ }
+ print(__FUNCTION__ . ": OK" . "\n");
}
/**
@@ -684,19 +648,19 @@ function putObjectSpeed($ossClient, $bucket)
*/
function getObjectSpeed($ossClient, $bucket)
{
- $object = "upload-test-object-name.txt";
- $options = array(
- OssClient::OSS_HEADERS => array(
- OssClient::OSS_TRAFFIC_LIMIT => 819200,
- ));
- try {
- $ossClient->getObject($bucket, $object, $options);
- } catch (OssException $e) {
- printf(__FUNCTION__ . ": FAILED\n");
- printf($e->getMessage() . "\n");
- return;
- }
- print(__FUNCTION__ . ": OK" . "\n");
+ $object = "upload-test-object-name.txt";
+ $options = array(
+ OssClient::OSS_HEADERS => array(
+ OssClient::OSS_TRAFFIC_LIMIT => 819200,
+ ));
+ try {
+ $ossClient->getObject($bucket, $object, $options);
+ } catch (OssException $e) {
+ printf(__FUNCTION__ . ": FAILED\n");
+ printf($e->getMessage() . "\n");
+ return;
+ }
+ print(__FUNCTION__ . ": OK" . "\n");
}
/**
@@ -708,14 +672,14 @@ function getObjectSpeed($ossClient, $bucket)
*/
function signUrlSpeedUpload($ossClient, $bucket)
{
- $object = "upload-test-object-name.txt";
- $timeout = 120;
- $options = array(
- OssClient::OSS_TRAFFIC_LIMIT => 819200,
- );
- $timeout = 60;
- $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
- print($signedUrl);
+ $object = "upload-test-object-name.txt";
+ $timeout = 120;
+ $options = array(
+ OssClient::OSS_TRAFFIC_LIMIT => 819200,
+ );
+ $timeout = 60;
+ $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
+ print($signedUrl);
}
@@ -728,14 +692,14 @@ function signUrlSpeedUpload($ossClient, $bucket)
*/
function signUrlSpeedDownload($ossClient, $bucket)
{
- $object = "upload-test-object-name.txt";
- $timeout = 120;
- $options = array(
- OssClient::OSS_TRAFFIC_LIMIT => 819200,
- );
- $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "GET", $options);
- print($signedUrl);
- print(__FUNCTION__ . ": OK" . "\n");
+ $object = "upload-test-object-name.txt";
+ $timeout = 120;
+ $options = array(
+ OssClient::OSS_TRAFFIC_LIMIT => 819200,
+ );
+ $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "GET", $options);
+ print($signedUrl);
+ print(__FUNCTION__ . ": OK" . "\n");
}
/**
@@ -747,19 +711,19 @@ function signUrlSpeedDownload($ossClient, $bucket)
*/
function restoreObject($ossClient, $bucket)
{
- $object = "oss-php-sdk-test/upload-test-object-name.txt";
- $day = 3;
- $tier = 'Expedited';
- $config = new RestoreConfig($day,$tier);
- $options = array(
- OssClient::OSS_RESTORE_CONFIG => $config
- );
- try {
- $ossClient->restoreObject($bucket, $object,$options);
- } catch (OssException $e) {
- printf(__FUNCTION__ . ": FAILED\n");
- printf($e->getMessage() . "\n");
- return;
- }
- print(__FUNCTION__ . ": OK" . "\n");
+ $object = "oss-php-sdk-test/upload-test-object-name.txt";
+ $day = 3;
+ $tier = 'Expedited';
+ $config = new RestoreConfig($day,$tier);
+ $options = array(
+ OssClient::OSS_RESTORE_CONFIG => $config
+ );
+ try {
+ $ossClient->restoreObject($bucket, $object,$options);
+ } catch (OssException $e) {
+ printf(__FUNCTION__ . ": FAILED\n");
+ printf($e->getMessage() . "\n");
+ return;
+ }
+ print(__FUNCTION__ . ": OK" . "\n");
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php
index d2358c2ac..66b467629 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php
@@ -1,543 +1,534 @@
- $value) {
- if (is_string($key) && !is_array($value)) {
- if (strlen($value) > 0) {
- $temp[] = rawurlencode($key) . '=' . rawurlencode($value);
- } else {
- $temp[] = rawurlencode($key);
- }
- }
- }
- return implode('&', $temp);
- }
-
- /**
- * Html encoding '<', '>', '&', '\', '"' in subject parameter.
- *
- * @param string $subject
- * @return string
- */
- public static function sReplace($subject)
- {
- $search = array('<', '>', '&', '\'', '"');
- $replace = array('<', '>', '&', ''', '"');
- return str_replace($search, $replace, $subject);
- }
-
- /**
- * Check whether the string includes any chinese character
- *
- * @param $str
- * @return int
- */
- public static function chkChinese($str)
- {
- return preg_match('/[\x80-\xff]./', $str);
- }
-
- /**
- * Checks if the string is encoded by GB2312.
- *
- * @param string $str
- * @return boolean false UTF-8 encoding TRUE GB2312 encoding
- */
- public static function isGb2312($str)
- {
- for ($i = 0; $i < strlen($str); $i++) {
- $v = ord($str[$i]);
- if ($v > 127) {
- if (($v >= 228) && ($v <= 233)) {
- if (($i + 2) >= (strlen($str) - 1)) return true; // not enough characters
- $v1 = ord($str[$i + 1]);
- $v2 = ord($str[$i + 2]);
- if (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191))
- return false;
- else
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Checks if the string is encoded by GBK
- *
- * @param string $str
- * @param boolean $gbk
- * @return boolean
- */
- public static function checkChar($str, $gbk = true)
- {
- for ($i = 0; $i < strlen($str); $i++) {
- $v = ord($str[$i]);
- if ($v > 127) {
- if (($v >= 228) && ($v <= 233)) {
- if (($i + 2) >= (strlen($str) - 1)) return $gbk ? true : FALSE; // not enough characters
- $v1 = ord($str[$i + 1]);
- $v2 = ord($str[$i + 2]);
- if ($gbk) {
- return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? FALSE : TRUE;//GBK
- } else {
- return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? TRUE : FALSE;
- }
- }
- }
- }
- return $gbk ? TRUE : FALSE;
- }
-
- /**
- * Checks if the bucket name is valid
- * bucket naming rules
- * 1. Can only include lowercase letters, numbers, or dashes
- * 2. Must start and end with lowercase letters or numbers
- * 3. Must be within a length from 3 to 63 bytes.
- *
- * @param string $bucket Bucket name
- * @return boolean
- */
- public static function validateBucket($bucket)
- {
- $pattern = '/^[a-z0-9][a-z0-9-]{2,62}$/';
- if (!preg_match($pattern, $bucket)) {
- return false;
- }
- return true;
- }
-
- /**
- * Checks if object name is valid
- * object naming rules:
- * 1. Must be within a length from 1 to 1023 bytes
- * 2. Cannot start with '/' or '\\'.
- * 3. Must be encoded in UTF-8.
- *
- * @param string $object Object名称
- * @return boolean
- */
- public static function validateObject($object)
- {
- $pattern = '/^.{1,1023}$/';
- if (!preg_match($pattern, $object) ||
- self::startsWith($object, '/') || self::startsWith($object, '\\')
- ) {
- return false;
- }
- return true;
- }
-
-
- /**
- * Checks if $str starts with $findMe
- *
- * @param string $str
- * @param string $findMe
- * @return bool
- */
- public static function startsWith($str, $findMe)
- {
- if (strpos($str, $findMe) === 0) {
- return true;
- } else {
- return false;
- }
- }
-
-
- /**
- * Generate the xml message of createBucketXmlBody.
- *
- * @param string $storageClass
- * @return string
- */
- public static function createBucketXmlBody($storageClass)
- {
- $xml = new \SimpleXMLElement('');
- $xml->addChild('StorageClass', $storageClass);
- return $xml->asXML();
- }
-
- /**
- * validate $options
- *
- * @param array $options
- * @throws OssException
- */
- public static function validateOptions($options)
- {
- //$options
- if ($options != NULL && !is_array($options)) {
- throw new OssException ($options . ':' . 'option must be array');
- }
- }
-
- /**
- * check whether the Content is valid.
- *
- * @param $content string
- * @throws OssException
- */
- public static function validateContent($content)
- {
- if (empty($content)) {
- throw new OssException("http body content is invalid");
- }
- }
-
- /**
- * Check if BUCKET/OBJECT/OBJECT GROUP is empty.
- *
- * @param string $name
- * @param string $errMsg
- * @throws OssException
- * @return void
- */
- public static function throwOssExceptionWithMessageIfEmpty($name, $errMsg)
- {
- if (empty($name)) {
- if (is_string($name) && $name == '0')
- return;
- throw new OssException($errMsg);
- }
- }
-
- /**
- * This is a method for test only. DO NOT USE.
- *
- * @param $filename
- * @param $size
- */
- public static function generateFile($filename, $size)
- {
- if (file_exists($filename) && $size == sprintf('%u',filesize($filename))) {
- echo $filename . " already exists, no need to create again. ";
- return;
- }
- $part_size = 1 * 1024 * 1024;
- $fp = fopen($filename, "w");
- $characters = << 0) {
- if ($size < $part_size) {
- $write_size = $size;
- } else {
- $write_size = $part_size;
- }
- $size -= $write_size;
- $a = $characters[rand(0, $charactersLength - 1)];
- $content = str_repeat($a, $write_size);
- $flag = fwrite($fp, $content);
- if (!$flag) {
- echo "write to " . $filename . " failed.
";
- break;
- }
- }
- } else {
- echo "open " . $filename . " failed.
";
- }
- fclose($fp);
- }
-
- /**
- * Get MD5 of the file.
- *
- * @param $filename
- * @param $from_pos
- * @param $to_pos
- * @return string
- */
- public static function getMd5SumForFile($filename, $from_pos, $to_pos)
- {
- $content_md5 = "";
- if (($to_pos - $from_pos) > self::OSS_MAX_PART_SIZE) {
- return $content_md5;
- }
- $filesize = sprintf('%u',filesize($filename));
- if ($from_pos >= $filesize || $to_pos >= $filesize || $from_pos < 0 || $to_pos < 0) {
- return $content_md5;
- }
-
- $total_length = $to_pos - $from_pos + 1;
- $buffer = 8192;
- $left_length = $total_length;
- if (!file_exists($filename)) {
- return $content_md5;
- }
-
- if (false === $fh = fopen($filename, 'rb')) {
- return $content_md5;
- }
-
- fseek($fh, $from_pos);
- $data = '';
- while (!feof($fh)) {
- if ($left_length >= $buffer) {
- $read_length = $buffer;
- } else {
- $read_length = $left_length;
- }
- if ($read_length <= 0) {
- break;
- } else {
- $data .= fread($fh, $read_length);
- $left_length = $left_length - $read_length;
- }
- }
- fclose($fh);
- $content_md5 = base64_encode(md5($data, true));
- return $content_md5;
- }
-
- /**
- * Check if the OS is Windows. The default encoding in Windows is GBK.
- *
- * @return bool
- */
- public static function isWin()
- {
- return strtoupper(substr(PHP_OS, 0, 3)) == "WIN";
- }
-
- /**
- * Encodes the file path from GBK to UTF-8.
- * The default encoding in Windows is GBK.
- * And if the file path is in Chinese, the file would not be found without the transcoding to UTF-8.
- *
- * @param $file_path
- * @return string
- */
- public static function encodePath($file_path)
- {
- if (self::chkChinese($file_path) && self::isWin()) {
- $file_path = iconv('utf-8', 'gbk', $file_path);
- }
- return $file_path;
- }
-
- /**
- * Check if the endpoint is in the IPv4 format, such as xxx.xxx.xxx.xxx:port or xxx.xxx.xxx.xxx.
- *
- * @param string $endpoint The endpoint to check.
- * @return boolean
- */
- public static function isIPFormat($endpoint)
- {
- $ip_array = explode(":", $endpoint);
- $hostname = $ip_array[0];
- $ret = filter_var($hostname, FILTER_VALIDATE_IP);
- if (!$ret) {
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Get the host:port from endpoint.
- *
- * @param string $endpoint the endpoint.
- * @return string
- * @throws OssException
- */
- public static function getHostPortFromEndpoint($endpoint)
- {
- $str = $endpoint;
- $pos = strpos($str, "://");
- if ($pos !== false) {
- $str = substr($str, $pos+3);
- }
-
- $pos = strpos($str, '#');
- if ($pos !== false) {
- $str = substr($str, 0, $pos);
- }
-
- $pos = strpos($str, '?');
- if ($pos !== false) {
- $str = substr($str, 0, $pos);
- }
-
- $pos = strpos($str, '/');
- if ($pos !== false) {
- $str = substr($str, 0, $pos);
- }
-
- $pos = strpos($str, '@');
- if ($pos !== false) {
- $str = substr($str, $pos+1);
- }
-
- if (!preg_match('/^[\w.-]+(:[0-9]+)?$/', $str)) {
- throw new OssException("endpoint is invalid:" . $endpoint);
- }
-
- return $str;
- }
-
- /**
- * Generate the xml message of DeleteMultiObjects.
- *
- * @param string[] $objects
- * @param bool $quiet
- * @return string
- */
- public static function createDeleteObjectsXmlBody($objects, $quiet)
- {
- $xml = new \SimpleXMLElement('');
- $xml->addChild('Quiet', $quiet);
- foreach ($objects as $object) {
- $sub_object = $xml->addChild('Object');
- $object = OssUtil::sReplace($object);
- $sub_object->addChild('Key', $object);
- }
- return $xml->asXML();
- }
-
- /**
- * Generate the xml message of DeleteMultiObjects.
- *
- * @param DeleteObjectInfo[] $objects
- * @param bool $quiet
- * @return string
- */
- public static function createDeleteObjectVersionsXmlBody($objects, $quiet)
- {
- $xml = new \SimpleXMLElement('');
- $xml->addChild('Quiet', $quiet);
- foreach ($objects as $object) {
- $sub_object = $xml->addChild('Object');
- $key = OssUtil::sReplace($object->getKey());
- $sub_object->addChild('Key', $key);
- $versionId = $object->getVersionId();
- if (!empty($versionId)) {
- $sub_object->addChild('VersionId', $object->getVersionId());
- }
- }
- return $xml->asXML();
- }
-
- /**
- * Generate the xml message of CompleteMultipartUpload.
- *
- * @param array[] $listParts
- * @return string
- */
- public static function createCompleteMultipartUploadXmlBody($listParts)
- {
- $xml = new \SimpleXMLElement('');
- foreach ($listParts as $node) {
- $part = $xml->addChild('Part');
- $part->addChild('PartNumber', $node['PartNumber']);
- $part->addChild('ETag', $node['ETag']);
- }
- return $xml->asXML();
- }
-
- /**
- * Read the directory, return a associative array in which the MD5 is the named key and the is the value.
- *
- * @param string $dir
- * @param string $exclude
- * @param bool $recursive
- * @return string[]
- */
- public static function readDir($dir, $exclude = ".|..|.svn|.git", $recursive = false)
- {
- $file_list_array = array();
- $base_path = $dir;
- $exclude_array = explode("|", $exclude);
- $exclude_array = array_unique(array_merge($exclude_array, array('.', '..')));
-
- if ($recursive) {
- foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)) as $new_file) {
- if ($new_file->isDir()) continue;
- $object = str_replace($base_path, '', $new_file);
- if (!in_array(strtolower($object), $exclude_array)) {
- $object = ltrim($object, '/');
- if (is_file($new_file)) {
- $key = md5($new_file . $object, false);
- $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
- }
- }
- }
- } else if ($handle = opendir($dir)) {
- while (false !== ($file = readdir($handle))) {
- if (!in_array(strtolower($file), $exclude_array)) {
- $new_file = $dir . '/' . $file;
- $object = $file;
- $object = ltrim($object, '/');
- if (is_file($new_file)) {
- $key = md5($new_file . $object, false);
- $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
- }
- }
- }
- closedir($handle);
- }
- return $file_list_array;
- }
-
- /**
- * Decode key based on the encoding type
- *
- * @param string $key
- * @param string $encoding
- * @return string
- */
- public static function decodeKey($key, $encoding)
- {
- if ($encoding == "") {
- return $key;
- }
-
- if ($encoding == "url") {
- return rawurldecode($key);
- } else {
- throw new OssException("Unrecognized encoding type: " . $encoding);
- }
- }
-
- public static function unparseUrl($parsed_url) {
- $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
- $host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
- $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
- $path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
- $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
- return "$scheme$host$port$path$query";
- }
-}
+ $value) {
+ if (is_string($key) && !is_array($value)) {
+ if (strlen($value) > 0) {
+ $temp[] = rawurlencode($key) . '=' . rawurlencode($value);
+ } else {
+ $temp[] = rawurlencode($key);
+ }
+ }
+ }
+ return implode('&', $temp);
+ }
+
+ /**
+ * Html encoding '<', '>', '&', '\', '"' in subject parameter.
+ *
+ * @param string $subject
+ * @return string
+ */
+ public static function sReplace($subject)
+ {
+ $search = array('<', '>', '&', '\'', '"');
+ $replace = array('<', '>', '&', ''', '"');
+ return str_replace($search, $replace, $subject);
+ }
+
+ /**
+ * Check whether the string includes any chinese character
+ *
+ * @param $str
+ * @return int
+ */
+ public static function chkChinese($str)
+ {
+ return preg_match('/[\x80-\xff]./', $str);
+ }
+
+ /**
+ * Checks if the string is encoded by GB2312.
+ *
+ * @param string $str
+ * @return boolean false UTF-8 encoding TRUE GB2312 encoding
+ */
+ public static function isGb2312($str)
+ {
+ for ($i = 0; $i < strlen($str); $i++) {
+ $v = ord($str[$i]);
+ if ($v > 127) {
+ if (($v >= 228) && ($v <= 233)) {
+ if (($i + 2) >= (strlen($str) - 1)) return true; // not enough characters
+ $v1 = ord($str[$i + 1]);
+ $v2 = ord($str[$i + 2]);
+ if (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191))
+ return false;
+ else
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks if the string is encoded by GBK
+ *
+ * @param string $str
+ * @param boolean $gbk
+ * @return boolean
+ */
+ public static function checkChar($str, $gbk = true)
+ {
+ for ($i = 0; $i < strlen($str); $i++) {
+ $v = ord($str[$i]);
+ if ($v > 127) {
+ if (($v >= 228) && ($v <= 233)) {
+ if (($i + 2) >= (strlen($str) - 1)) return $gbk ? true : FALSE; // not enough characters
+ $v1 = ord($str[$i + 1]);
+ $v2 = ord($str[$i + 2]);
+ if ($gbk) {
+ return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? FALSE : TRUE;//GBK
+ } else {
+ return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? TRUE : FALSE;
+ }
+ }
+ }
+ }
+ return $gbk ? TRUE : FALSE;
+ }
+
+ /**
+ * Checks if the bucket name is valid
+ * bucket naming rules
+ * 1. Can only include lowercase letters, numbers, or dashes
+ * 2. Must start and end with lowercase letters or numbers
+ * 3. Must be within a length from 3 to 63 bytes.
+ *
+ * @param string $bucket Bucket name
+ * @return boolean
+ */
+ public static function validateBucket($bucket)
+ {
+ $pattern = '/^[a-z0-9][a-z0-9-]{2,62}$/';
+ if (!preg_match($pattern, $bucket)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if object name is valid
+ * object naming rules:
+ * 1. Must be within a length from 1 to 1023 bytes
+ * 2. Cannot start with '/' or '\\'.
+ * 3. Must be encoded in UTF-8.
+ *
+ * @param string $object Object名称
+ * @return boolean
+ */
+ public static function validateObject($object)
+ {
+ $pattern = '/^.{1,1023}$/';
+ if (!preg_match($pattern, $object) ||
+ self::startsWith($object, '/') || self::startsWith($object, '\\')
+ ) {
+ return false;
+ }
+ return true;
+ }
+
+
+ /**
+ * Checks if $str starts with $findMe
+ *
+ * @param string $str
+ * @param string $findMe
+ * @return bool
+ */
+ public static function startsWith($str, $findMe)
+ {
+ if (strpos($str, $findMe) === 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+
+ /**
+ * Generate the xml message of createBucketXmlBody.
+ *
+ * @param string $storageClass
+ * @return string
+ */
+ public static function createBucketXmlBody($storageClass)
+ {
+ $xml = new \SimpleXMLElement('');
+ $xml->addChild('StorageClass', $storageClass);
+ return $xml->asXML();
+ }
+
+ /**
+ * validate $options
+ *
+ * @param array $options
+ * @throws OssException
+ * @return boolean
+ */
+ public static function validateOptions($options)
+ {
+ //$options
+ if ($options != NULL && !is_array($options)) {
+ throw new OssException ($options . ':' . 'option must be array');
+ }
+ }
+
+ /**
+ * check whether the Content is valid.
+ *
+ * @param $content string
+ * @throws OssException
+ */
+ public static function validateContent($content)
+ {
+ if (empty($content)) {
+ throw new OssException("http body content is invalid");
+ }
+ }
+
+ /**
+ * Check if BUCKET/OBJECT/OBJECT GROUP is empty.
+ *
+ * @param string $name
+ * @param string $errMsg
+ * @throws OssException
+ * @return void
+ */
+ public static function throwOssExceptionWithMessageIfEmpty($name, $errMsg)
+ {
+ if (empty($name)) {
+ if (is_string($name) && $name == '0')
+ return;
+ throw new OssException($errMsg);
+ }
+ }
+
+ /**
+ * This is a method for test only. DO NOT USE.
+ *
+ * @param $filename
+ * @param $size
+ */
+ public static function generateFile($filename, $size)
+ {
+ if (file_exists($filename) && $size == sprintf('%u',filesize($filename))) {
+ echo $filename . " already exists, no need to create again. ";
+ return;
+ }
+ $part_size = 1 * 1024 * 1024;
+ $fp = fopen($filename, "w");
+ $characters = << 0) {
+ if ($size < $part_size) {
+ $write_size = $size;
+ } else {
+ $write_size = $part_size;
+ }
+ $size -= $write_size;
+ $a = $characters[rand(0, $charactersLength - 1)];
+ $content = str_repeat($a, $write_size);
+ $flag = fwrite($fp, $content);
+ if (!$flag) {
+ echo "write to " . $filename . " failed.
";
+ break;
+ }
+ }
+ } else {
+ echo "open " . $filename . " failed.
";
+ }
+ fclose($fp);
+ }
+
+ /**
+ * Get MD5 of the file.
+ *
+ * @param $filename
+ * @param $from_pos
+ * @param $to_pos
+ * @return string
+ */
+ public static function getMd5SumForFile($filename, $from_pos, $to_pos)
+ {
+ $content_md5 = "";
+ if (($to_pos - $from_pos) > self::OSS_MAX_PART_SIZE) {
+ return $content_md5;
+ }
+ $filesize = sprintf('%u',filesize($filename));
+ if ($from_pos >= $filesize || $to_pos >= $filesize || $from_pos < 0 || $to_pos < 0) {
+ return $content_md5;
+ }
+
+ $total_length = $to_pos - $from_pos + 1;
+ $buffer = 8192;
+ $left_length = $total_length;
+ if (!file_exists($filename)) {
+ return $content_md5;
+ }
+
+ if (false === $fh = fopen($filename, 'rb')) {
+ return $content_md5;
+ }
+
+ fseek($fh, $from_pos);
+ $data = '';
+ while (!feof($fh)) {
+ if ($left_length >= $buffer) {
+ $read_length = $buffer;
+ } else {
+ $read_length = $left_length;
+ }
+ if ($read_length <= 0) {
+ break;
+ } else {
+ $data .= fread($fh, $read_length);
+ $left_length = $left_length - $read_length;
+ }
+ }
+ fclose($fh);
+ $content_md5 = base64_encode(md5($data, true));
+ return $content_md5;
+ }
+
+ /**
+ * Check if the OS is Windows. The default encoding in Windows is GBK.
+ *
+ * @return bool
+ */
+ public static function isWin()
+ {
+ return strtoupper(substr(PHP_OS, 0, 3)) == "WIN";
+ }
+
+ /**
+ * Encodes the file path from GBK to UTF-8.
+ * The default encoding in Windows is GBK.
+ * And if the file path is in Chinese, the file would not be found without the transcoding to UTF-8.
+ *
+ * @param $file_path
+ * @return string
+ */
+ public static function encodePath($file_path)
+ {
+ if (self::chkChinese($file_path) && self::isWin()) {
+ $file_path = iconv('utf-8', 'gbk', $file_path);
+ }
+ return $file_path;
+ }
+
+ /**
+ * Check if the endpoint is in the IPv4 format, such as xxx.xxx.xxx.xxx:port or xxx.xxx.xxx.xxx.
+ *
+ * @param string $endpoint The endpoint to check.
+ * @return boolean
+ */
+ public static function isIPFormat($endpoint)
+ {
+ $ip_array = explode(":", $endpoint);
+ $hostname = $ip_array[0];
+ $ret = filter_var($hostname, FILTER_VALIDATE_IP);
+ if (!$ret) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Get the host:port from endpoint.
+ *
+ * @param string $endpoint the endpoint.
+ * @return boolean
+ */
+ public static function getHostPortFromEndpoint($endpoint)
+ {
+ $str = $endpoint;
+ $pos = strpos($str, "://");
+ if ($pos !== false) {
+ $str = substr($str, $pos+3);
+ }
+
+ $pos = strpos($str, '#');
+ if ($pos !== false) {
+ $str = substr($str, 0, $pos);
+ }
+
+ $pos = strpos($str, '?');
+ if ($pos !== false) {
+ $str = substr($str, 0, $pos);
+ }
+
+ $pos = strpos($str, '/');
+ if ($pos !== false) {
+ $str = substr($str, 0, $pos);
+ }
+
+ $pos = strpos($str, '@');
+ if ($pos !== false) {
+ $str = substr($str, $pos+1);
+ }
+
+ if (!preg_match('/^[\w.-]+(:[0-9]+)?$/', $str)) {
+ throw new OssException("endpoint is invalid:" . $endpoint);
+ }
+
+ return $str;
+ }
+
+ /**
+ * Generate the xml message of DeleteMultiObjects.
+ *
+ * @param string[] $objects
+ * @param bool $quiet
+ * @return string
+ */
+ public static function createDeleteObjectsXmlBody($objects, $quiet)
+ {
+ $xml = new \SimpleXMLElement('');
+ $xml->addChild('Quiet', $quiet);
+ foreach ($objects as $object) {
+ $sub_object = $xml->addChild('Object');
+ $object = OssUtil::sReplace($object);
+ $sub_object->addChild('Key', $object);
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * Generate the xml message of DeleteMultiObjects.
+ *
+ * @param DeleteObjectInfo[] $objects
+ * @param bool $quiet
+ * @return string
+ */
+ public static function createDeleteObjectVersionsXmlBody($objects, $quiet)
+ {
+ $xml = new \SimpleXMLElement('');
+ $xml->addChild('Quiet', $quiet);
+ foreach ($objects as $object) {
+ $sub_object = $xml->addChild('Object');
+ $key = OssUtil::sReplace($object->getKey());
+ $sub_object->addChild('Key', $key);
+ $versionId = $object->getVersionId();
+ if (!empty($versionId)) {
+ $sub_object->addChild('VersionId', $object->getVersionId());
+ }
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * Generate the xml message of CompleteMultipartUpload.
+ *
+ * @param array[] $listParts
+ * @return string
+ */
+ public static function createCompleteMultipartUploadXmlBody($listParts)
+ {
+ $xml = new \SimpleXMLElement('');
+ foreach ($listParts as $node) {
+ $part = $xml->addChild('Part');
+ $part->addChild('PartNumber', $node['PartNumber']);
+ $part->addChild('ETag', $node['ETag']);
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * Read the directory, return a associative array in which the MD5 is the named key and the is the value.
+ *
+ * @param string $dir
+ * @param string $exclude
+ * @param bool $recursive
+ * @return string[]
+ */
+ public static function readDir($dir, $exclude = ".|..|.svn|.git", $recursive = false)
+ {
+ $file_list_array = array();
+ $base_path = $dir;
+ $exclude_array = explode("|", $exclude);
+ $exclude_array = array_unique(array_merge($exclude_array, array('.', '..')));
+
+ if ($recursive) {
+ foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)) as $new_file) {
+ if ($new_file->isDir()) continue;
+ $object = str_replace($base_path, '', $new_file);
+ if (!in_array(strtolower($object), $exclude_array)) {
+ $object = ltrim($object, '/');
+ if (is_file($new_file)) {
+ $key = md5($new_file . $object, false);
+ $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
+ }
+ }
+ }
+ } else if ($handle = opendir($dir)) {
+ while (false !== ($file = readdir($handle))) {
+ if (!in_array(strtolower($file), $exclude_array)) {
+ $new_file = $dir . '/' . $file;
+ $object = $file;
+ $object = ltrim($object, '/');
+ if (is_file($new_file)) {
+ $key = md5($new_file . $object, false);
+ $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
+ }
+ }
+ }
+ closedir($handle);
+ }
+ return $file_list_array;
+ }
+
+ /**
+ * Decode key based on the encoding type
+ *
+ * @param string $key
+ * @param string $encoding
+ * @return string
+ */
+ public static function decodeKey($key, $encoding)
+ {
+ if ($encoding == "") {
+ return $key;
+ }
+
+ if ($encoding == "url") {
+ return rawurldecode($key);
+ } else {
+ throw new OssException("Unrecognized encoding type: " . $encoding);
+ }
+ }
+}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php
index 58bb21506..c8089b419 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php
@@ -170,7 +170,7 @@ class RequestCore
public $registered_streaming_write_callback = null;
/**
- * The request timeout time, which is 5,184,000 seconds,that is, 60 days by default
+ * The request timeout time, which is 5,184,000 seconds,that is, 6 days by default
*
* @var int
*/
@@ -789,7 +789,7 @@ class RequestCore
}
// As long as this came back as a valid resource or CurlHandle instance...
- if (is_resource($curl_handle) || (is_object($curl_handle) && in_array(get_class($curl_handle),array('CurlHandle','Swoole\Curl\Handler', 'Swoole\Coroutine\Curl\Handle'),true))) {
+ if (is_resource($curl_handle) || (is_object($curl_handle) && get_class($curl_handle) === 'CurlHandle')) {
// Determine what's what.
$header_size = curl_getinfo($curl_handle, CURLINFO_HEADER_SIZE);
$this->response_headers = substr($this->response, 0, $header_size);
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketStat.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketStat.php
index 60c7e55c8..9e2989a76 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketStat.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketStat.php
@@ -41,135 +41,6 @@ class BucketStat
return $this->multipartUploadCount;
}
- /**
- * Get live channel count
- *
- * @return int
- */
- public function getLiveChannelCount()
- {
- return $this->liveChannelCount;
- }
-
- /**
- * Get last modified time
- *
- * @return int
- */
- public function getLastModifiedTime()
- {
- return $this->lastModifiedTime;
- }
-
- /**
- * Get standard storage
- *
- * @return int
- */
- public function getStandardStorage()
- {
- return $this->standardStorage;
- }
-
- /**
- * Get standard object count
- *
- * @return int
- */
- public function getStandardObjectCount()
- {
- return $this->standardObjectCount;
- }
-
- /**
- * Get infrequent access storage
- *
- * @return int
- */
- public function getInfrequentAccessStorage()
- {
- return $this->infrequentAccessStorage;
- }
-
- /**
- * Get infrequent access real storage
- *
- * @return int
- */
- public function getInfrequentAccessRealStorage()
- {
- return $this->infrequentAccessRealStorage;
- }
-
- /**
- * Get infrequent access object count
- *
- * @return int
- */
- public function getInfrequentAccessObjectCount()
- {
- return $this->infrequentAccessObjectCount;
- }
-
- /**
- * Get archive storage
- *
- * @return int
- */
- public function getArchiveStorage()
- {
- return $this->archiveStorage;
- }
-
- /**
- * Get archive real storage
- *
- * @return int
- */
- public function getArchiveRealStorage()
- {
- return $this->archiveRealStorage;
- }
- /**
- * Get archive object count
- *
- * @return int
- */
- public function getArchiveObjectCount()
- {
- return $this->archiveObjectCount;
- }
-
- /**
- * Get cold archive storage
- *
- * @return int
- */
- public function getColdArchiveStorage()
- {
- return $this->coldArchiveStorage;
- }
-
- /**
- * Get cold archive real storage
- *
- * @return int
- */
- public function getColdArchiveRealStorage()
- {
- return $this->coldArchiveRealStorage;
- }
-
- /**
- * Get cold archive object count
- *
- * @return int
- */
- public function getColdArchiveObjectCount()
- {
- return $this->coldArchiveObjectCount;
- }
-
/**
* Parse stat from the xml.
*
@@ -189,45 +60,6 @@ class BucketStat
if (isset($xml->MultipartUploadCount) ) {
$this->multipartUploadCount = intval($xml->MultipartUploadCount);
}
- if (isset($xml->LiveChannelCount) ) {
- $this->liveChannelCount = intval($xml->LiveChannelCount);
- }
- if (isset($xml->LastModifiedTime) ) {
- $this->lastModifiedTime = intval($xml->LastModifiedTime);
- }
- if (isset($xml->StandardStorage) ) {
- $this->standardStorage = intval($xml->StandardStorage);
- }
- if (isset($xml->StandardObjectCount) ) {
- $this->standardObjectCount = intval($xml->StandardObjectCount);
- }
- if (isset($xml->InfrequentAccessStorage) ) {
- $this->infrequentAccessStorage = intval($xml->InfrequentAccessStorage);
- }
- if (isset($xml->InfrequentAccessRealStorage) ) {
- $this->infrequentAccessRealStorage = intval($xml->InfrequentAccessRealStorage);
- }
- if (isset($xml->InfrequentAccessObjectCount) ) {
- $this->infrequentAccessObjectCount = intval($xml->InfrequentAccessObjectCount);
- }
- if (isset($xml->ArchiveStorage) ) {
- $this->archiveStorage = intval($xml->ArchiveStorage);
- }
- if (isset($xml->ArchiveRealStorage) ) {
- $this->archiveRealStorage = intval($xml->ArchiveRealStorage);
- }
- if (isset($xml->ArchiveObjectCount) ) {
- $this->archiveObjectCount = intval($xml->ArchiveObjectCount);
- }
- if (isset($xml->ColdArchiveStorage) ) {
- $this->coldArchiveStorage = intval($xml->ColdArchiveStorage);
- }
- if (isset($xml->ColdArchiveRealStorage) ) {
- $this->coldArchiveRealStorage = intval($xml->ColdArchiveRealStorage);
- }
- if (isset($xml->ColdArchiveObjectCount) ) {
- $this->coldArchiveObjectCount = intval($xml->ColdArchiveObjectCount);
- }
}
/**
@@ -250,82 +82,4 @@ class BucketStat
*/
private $multipartUploadCount;
- /**
- * live channel count
- * @var int
- */
- private $liveChannelCount;
-
- /**
- * last modified time
- * @var int
- */
- private $lastModifiedTime;
-
- /**
- * standard storage
- * @var int
- */
- private $standardStorage;
-
- /**
- * standard object count
- * @var int
- */
- private $standardObjectCount;
-
- /**
- * infrequent access storage
- * @var int
- */
- private $infrequentAccessStorage;
-
- /**
- * infrequent access real storage
- * @var int
- */
- private $infrequentAccessRealStorage;
-
- /**
- * infrequent access object Count
- * @var int
- */
- private $infrequentAccessObjectCount;
-
- /**
- * archive storage
- * @var int
- */
- private $archiveStorage;
-
- /**
- * archive real storage
- * @var int
- */
- private $archiveRealStorage;
-
- /**
- * archive object count
- * @var int
- */
- private $archiveObjectCount;
-
- /**
- * cold archive storage
- * @var int
- */
- private $coldArchiveStorage;
-
- /**
- * cold archive real storage
- * @var int
- */
- private $coldArchiveRealStorage;
-
- /**
- * cold archive object count
- * @var int
- */
- private $coldArchiveObjectCount;
-
}
\ No newline at end of file
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php
index e0f18923f..62a0d7103 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php
@@ -45,26 +45,10 @@ class CorsConfig implements XmlConfig
}
$this->rules[] = $rule;
}
- /**
- * @param boolean $value
- */
- public function setResponseVary($value)
- {
- $this->responseVary = $value;
- }
-
- /**
- * @return boolean
- */
- public function getResponseVary(){
- if (isset($this->responseVary)) {
- return $this->responseVary;
- }
- return false;
- }
/**
* Parse CorsConfig from the xml.
+ *
* @param string $strXml
* @throws OssException
* @return null
@@ -72,10 +56,6 @@ class CorsConfig implements XmlConfig
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
- if(isset($xml->ResponseVary)){
- $this->responseVary =
- (strval($xml->ResponseVary) === 'TRUE' || strval($xml->ResponseVary) === 'true') ? true : false;
- }
if (!isset($xml->CORSRule)) return;
foreach ($xml->CORSRule as $rule) {
$corsRule = new CorsRule();
@@ -94,6 +74,7 @@ class CorsConfig implements XmlConfig
}
$this->addRule($corsRule);
}
+ return;
}
/**
@@ -108,13 +89,6 @@ class CorsConfig implements XmlConfig
$xmlRule = $xml->addChild('CORSRule');
$rule->appendToXml($xmlRule);
}
- if(isset($this->responseVary)){
- if ($this->responseVary) {
- $xml->addChild('ResponseVary', 'true');
- } else {
- $xml->addChild('ResponseVary', 'false');
- }
- }
return $xml->asXML();
}
@@ -136,5 +110,4 @@ class CorsConfig implements XmlConfig
* @var CorsRule[]
*/
private $rules = array();
- private $responseVary;
}
\ No newline at end of file
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php
index 9e538bf2a..5b412240d 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php
@@ -24,10 +24,8 @@ class ObjectInfo
* @param string $type
* @param string $size
* @param string $storageClass
- * @param Owner|null $owner
- * @param null $restoreInfo
*/
- public function __construct($key, $lastModified, $eTag, $type, $size, $storageClass,$owner=null,$restoreInfo=null)
+ public function __construct($key, $lastModified, $eTag, $type, $size, $storageClass)
{
$this->key = $key;
$this->lastModified = $lastModified;
@@ -35,8 +33,6 @@ class ObjectInfo
$this->type = $type;
$this->size = $size;
$this->storageClass = $storageClass;
- $this->owner = $owner;
- $this->restoreInfo = $restoreInfo;
}
/**
@@ -98,32 +94,10 @@ class ObjectInfo
return $this->storageClass;
}
- /**
- * @return string
- */
- public function getRestoreInfo()
- {
- return $this->restoreInfo;
- }
-
-
- /**
- * @return Owner|null
- */
- public function getOwner()
- {
- return $this->owner;
- }
-
private $key = "";
private $lastModified = "";
private $eTag = "";
private $type = "";
private $size = "0";
private $storageClass = "";
- /**
- * @var Owner
- */
- private $owner;
- private $restoreInfo;
}
\ No newline at end of file
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionListInfo.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionListInfo.php
index f976b7e60..c94210d01 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionListInfo.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionListInfo.php
@@ -22,7 +22,7 @@ class ObjectVersionListInfo
* @param string $nextVersionIdMarker
* @param string $maxKeys
* @param string $delimiter
- * @param null|string $isTruncated
+ * @param null $isTruncated
* @param array $objectversionList
* @param array $deleteMarkerList
* @param array $prefixList
@@ -151,7 +151,7 @@ class ObjectVersionListInfo
private $prefix = "";
private $keyMarker = "";
private $nextKeyMarker = "";
- private $versionIdMarker = "";
+ private $versionIdmarker = "";
private $nextVersionIdMarker = "";
private $maxKeys = 0;
private $delimiter = "";
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php
index ab6b7fd30..d7f73df9a 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php
@@ -1,21 +1,13 @@
$endpoint,
- 'cname' => $isCName,
- 'request_proxy' => $requestProxy,
- 'provider' => $provider
- );
- $this->__initNewClient($config);
- }
-
- /**
- * @param array $config
- * @throws OssException
- */
- private function __initNewClient($config = array())
- {
- $isCName = isset($config['cname']) ? $config['cname'] : false;
- $endpoint = isset($config['endpoint']) ? $config['endpoint'] : '';
- $requestProxy = isset($config['request_proxy']) ? $config['request_proxy'] : null;
- $provider = isset($config['provider']) ? $config['provider'] : '';
if (empty($endpoint)) {
throw new OssException("endpoint is empty");
}
$this->hostname = $this->checkEndpoint($endpoint, $isCName);
- if (isset($config['forcePathStyle'])) {
- if ($config['forcePathStyle'] === true) {
- $this->hostType = self::OSS_HOST_TYPE_PATH_STYLE;
- }
- }
+ $this->accessKeyId = $accessKeyId;
+ $this->accessKeySecret = $accessKeySecret;
+ $this->securityToken = $securityToken;
$this->requestProxy = $requestProxy;
- if (!$provider instanceof CredentialsProvider) {
- throw new OssException("provider must be an instance of CredentialsProvider");
- }
- $this->provider = $provider;
-
- $this->region = isset($config['region']) ? $config['region'] : '';
- $this->cloudBoxId = isset($config['cloudBoxId']) ? $config['cloudBoxId'] : '';
-
- // $enableStrictObjName
- $this->enableStrictObjName = true;
- if (isset($config['strictObjectName'])) {
- if ($config['strictObjectName'] === false) {
- $this->enableStrictObjName = false;
- }
- }
-
- // sign version
- $signatureVersion = self::OSS_SIGNATURE_VERSION_V1;
- if (isset($config['signatureVersion']) && $config['signatureVersion'] === self::OSS_SIGNATURE_VERSION_V4) {
- $signatureVersion = self::OSS_SIGNATURE_VERSION_V4;
- }
- if ($signatureVersion === self::OSS_SIGNATURE_VERSION_V4) {
- $this->enableStrictObjName = false;
- $this->signer = new SignerV4();
- } else {
- $this->signer = new SignerV1();
- }
-
- //checkObjectEncoding
- $this->checkObjectEncoding = false;
- if (isset($config['checkObjectEncoding'])) {
- if ($config['checkObjectEncoding'] === true) {
- $this->checkObjectEncoding = true;
- }
- }
-
- //filePathCompatible
- $this->filePathCompatible = false;
- if (version_compare(phpversion(), '7.0.0', '<')) {
- if (OssUtil::isWin()) {
- $this->filePathCompatible = true;
- }
- }
- if (isset($config['filePathCompatible'])) {
- if ($config['filePathCompatible'] === true) {
- $this->filePathCompatible = true;
- } else if ($config['filePathCompatible'] === false) {
- $this->filePathCompatible = false;
- }
- }
-
self::checkEnv();
}
@@ -233,8 +135,8 @@ class OssClient
* Lists the Bucket [GetService]. Not applicable if the endpoint is CName (because CName must be binded to a specific bucket).
*
* @param array $options
- * @return BucketListInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return BucketListInfo
*/
public function listBuckets($options = NULL)
{
@@ -244,6 +146,7 @@ class OssClient
$this->precheckOptions($options);
$options[self::OSS_BUCKET] = '';
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$response = $this->auth($options);
$result = new ListBucketsResult($response);
return $result->getData();
@@ -255,15 +158,16 @@ class OssClient
* @param string $bucket
* @param string $acl
* @param array $options
+ * @param string $storageType
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function createBucket($bucket, $acl = self::OSS_ACL_TYPE_PRIVATE, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
- $options[self::OSS_HEADERS][self::OSS_ACL] = $acl;
+ $options[self::OSS_OBJECT] = '/';
+ $options[self::OSS_HEADERS] = array(self::OSS_ACL => $acl);
if (isset($options[self::OSS_STORAGE])) {
$this->precheckStorage($options[self::OSS_STORAGE]);
$options[self::OSS_CONTENT] = OssUtil::createBucketXmlBody($options[self::OSS_STORAGE]);
@@ -282,13 +186,13 @@ class OssClient
* @param string $bucket
* @param array $options
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function deleteBucket($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
return $result->getData();
@@ -298,14 +202,15 @@ class OssClient
* Checks if a bucket exists
*
* @param string $bucket
- * @return bool|null
- * @throws OssException|RequestCore_Exception
+ * @return bool
+ * @throws OssException
*/
public function doesBucketExist($bucket)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'acl';
$response = $this->auth($options);
$result = new ExistResult($response);
@@ -317,14 +222,15 @@ class OssClient
*
* @param string $bucket
* @param array $options
- * @return string|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string
*/
public function getBucketLocation($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'location';
$response = $this->auth($options);
$result = new GetLocationResult($response);
@@ -335,15 +241,15 @@ class OssClient
* Get the Meta information for the Bucket
*
* @param string $bucket
- * @param array $options Refer to the SDK documentation
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @param array $options Refer to the SDK documentation
+ * @return array
*/
public function getBucketMeta($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_HEAD;
+ $options[self::OSS_OBJECT] = '/';
$response = $this->auth($options);
$result = new HeaderResult($response);
return $result->getData();
@@ -354,14 +260,15 @@ class OssClient
*
* @param string $bucket
* @param array $options
- * @return string|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string
*/
public function getBucketAcl($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'acl';
$response = $this->auth($options);
$result = new AclResult($response);
@@ -374,15 +281,16 @@ class OssClient
* @param string $bucket bucket name
* @param string $acl access permissions, valid values are ['private', 'public-read', 'public-read-write']
* @param array $options by default is empty
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function putBucketAcl($bucket, $acl, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
- $options[self::OSS_HEADERS][self::OSS_ACL] = $acl;
+ $options[self::OSS_OBJECT] = '/';
+ $options[self::OSS_HEADERS] = array(self::OSS_ACL => $acl);
$options[self::OSS_SUB_RESOURCE] = 'acl';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -395,8 +303,8 @@ class OssClient
* @param string $bucket
* @param string $object
* @param array $options
- * @return string|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string
*/
public function getObjectAcl($bucket, $object, $options = NULL)
{
@@ -417,8 +325,8 @@ class OssClient
* @param string $object object name
* @param string $acl access permissions, valid values are ['default', 'private', 'public-read', 'public-read-write']
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function putObjectAcl($bucket, $object, $acl, $options = NULL)
{
@@ -426,7 +334,7 @@ class OssClient
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
$options[self::OSS_OBJECT] = $object;
- $options[self::OSS_HEADERS][self::OSS_OBJECT_ACL] = $acl;
+ $options[self::OSS_HEADERS] = array(self::OSS_OBJECT_ACL => $acl);
$options[self::OSS_SUB_RESOURCE] = 'acl';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -438,14 +346,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options by default is empty
- * @return LoggingConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return LoggingConfig
*/
public function getBucketLogging($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'logging';
$response = $this->auth($options);
$result = new GetLoggingResult($response);
@@ -459,8 +368,8 @@ class OssClient
* @param string $targetBucket The logging file's bucket
* @param string $targetPrefix The logging file's prefix
* @param array $options By default is empty.
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function putBucketLogging($bucket, $targetBucket, $targetPrefix, $options = NULL)
{
@@ -468,6 +377,7 @@ class OssClient
$this->precheckBucket($targetBucket, 'targetbucket is not allowed empty');
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'logging';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
@@ -483,14 +393,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function deleteBucketLogging($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'logging';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -503,14 +414,15 @@ class OssClient
* @param string $bucket bucket name
* @param WebsiteConfig $websiteConfig
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function putBucketWebsite($bucket, $websiteConfig, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'website';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$options[self::OSS_CONTENT] = $websiteConfig->serializeToXml();
@@ -524,14 +436,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return WebsiteConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return WebsiteConfig
*/
public function getBucketWebsite($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'website';
$response = $this->auth($options);
$result = new GetWebsiteResult($response);
@@ -543,14 +456,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function deleteBucketWebsite($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'website';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -563,14 +477,15 @@ class OssClient
* @param string $bucket bucket name
* @param CorsConfig $corsConfig CORS config. Check out the details from OSS API document
* @param array $options array
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function putBucketCors($bucket, $corsConfig, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'cors';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$options[self::OSS_CONTENT] = $corsConfig->serializeToXml();
@@ -584,17 +499,18 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return CorsConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return CorsConfig
*/
public function getBucketCors($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'cors';
$response = $this->auth($options);
- $result = new GetCorsResult($response);
+ $result = new GetCorsResult($response, __FUNCTION__);
return $result->getData();
}
@@ -603,14 +519,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function deleteBucketCors($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'cors';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -623,14 +540,15 @@ class OssClient
* @param string $bucket bucket name
* @param string $cname
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function addBucketCname($bucket, $cname, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$cnameConfig = new CnameConfig();
$cnameConfig->addCname($cname);
@@ -648,14 +566,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return CnameConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return CnameConfig
*/
public function getBucketCname($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_CNAME] = '';
$response = $this->auth($options);
$result = new GetCnameResult($response);
@@ -666,16 +585,17 @@ class OssClient
* Remove a CName binding from the bucket
*
* @param string $bucket bucket name
- * @param CnameConfig $cname
+ * @param CnameConfig $cnameConfig
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function deleteBucketCname($bucket, $cname, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$cnameConfig = new CnameConfig();
$cnameConfig->addCname($cname);
@@ -693,14 +613,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return CnameTokenInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return CnameToken
*/
public function createBucketCnameToken($bucket, $cname, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$cnameConfig = new CnameConfig();
$cnameConfig->addCname($cname);
@@ -717,14 +638,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return CnameTokenInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return CnameToken
*/
public function getBucketCnameToken($bucket, $cname, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_COMP] = 'token';
$options[self::OSS_CNAME] = $cname;
$response = $this->auth($options);
@@ -739,8 +661,8 @@ class OssClient
* @param string channelName $channelName
* @param LiveChannelConfig $channelConfig
* @param array $options
- * @return LiveChannelInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return LiveChannelInfo
*/
public function putBucketLiveChannel($bucket, $channelName, $channelConfig, $options = NULL)
{
@@ -757,7 +679,7 @@ class OssClient
$info = $result->getData();
$info->setName($channelName);
$info->setDescription($channelConfig->getDescription());
-
+
return $info;
}
@@ -768,8 +690,8 @@ class OssClient
* @param string channelName $channelName
* @param string channelStatus $channelStatus enabled or disabled
* @param array $options
- * @return null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function putLiveChannelStatus($bucket, $channelName, $channelStatus, $options = NULL)
{
@@ -791,8 +713,8 @@ class OssClient
* @param string $bucket bucket name
* @param string channelName $channelName
* @param array $options
- * @return GetLiveChannelInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return GetLiveChannelInfo
*/
public function getLiveChannelInfo($bucket, $channelName, $options = NULL)
{
@@ -813,8 +735,8 @@ class OssClient
* @param string $bucket bucket name
* @param string channelName $channelName
* @param array $options
- * @return GetLiveChannelStatus|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return GetLiveChannelStatus
*/
public function getLiveChannelStatus($bucket, $channelName, $options = NULL)
{
@@ -824,20 +746,20 @@ class OssClient
$options[self::OSS_OBJECT] = $channelName;
$options[self::OSS_SUB_RESOURCE] = 'live';
$options[self::OSS_COMP] = 'stat';
-
+
$response = $this->auth($options);
$result = new GetLiveChannelStatusResult($response);
return $result->getData();
}
- /**
+ /**
* Gets the LiveChannel pushing streaming record
*
* @param string $bucket bucket name
* @param string channelName $channelName
* @param array $options
- * @return GetLiveChannelHistory|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return GetLiveChannelHistory
*/
public function getLiveChannelHistory($bucket, $channelName, $options = NULL)
{
@@ -852,20 +774,21 @@ class OssClient
$result = new GetLiveChannelHistoryResult($response);
return $result->getData();
}
-
+
/**
*Gets the live channel list under a bucket.
*
* @param string $bucket bucket name
* @param array $options
- * @return LiveChannelListInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return LiveChannelListInfo
*/
public function listBucketLiveChannels($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'live';
$options[self::OSS_QUERY_STRING] = array(
'prefix' => isset($options['prefix']) ? $options['prefix'] : '',
@@ -884,11 +807,11 @@ class OssClient
* Creates a play list file for the LiveChannel
*
* @param string $bucket bucket name
- * @param string channelName $channelName
+ * @param string channelName $channelName
* @param string $playlistName The playlist name, must end with ".m3u8".
- * @param array $setTime startTime and EndTime in unix time. No more than 1 day.
+ * @param array $setTime startTime and EndTime in unix time. No more than 1 day.
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function postVodPlaylist($bucket, $channelName, $playlistName, $setTime)
{
@@ -899,7 +822,7 @@ class OssClient
$options[self::OSS_SUB_RESOURCE] = 'vod';
$options[self::OSS_LIVE_CHANNEL_END_TIME] = $setTime['EndTime'];
$options[self::OSS_LIVE_CHANNEL_START_TIME] = $setTime['StartTime'];
-
+
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
return $result->getData();
@@ -911,8 +834,8 @@ class OssClient
* @param string $bucket bucket name
* @param string channelName $channelName
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function deleteBucketLiveChannel($bucket, $channelName, $options = NULL)
{
@@ -934,8 +857,8 @@ class OssClient
* @param string channelName $channelName
* @param int timeout timeout value in seconds
* @param array $options
- * @return string The signed pushing streaming url
* @throws OssException
+ * @return The signed pushing streaming url
*/
public function signRtmpUrl($bucket, $channelName, $timeout = 60, $options = NULL)
{
@@ -954,12 +877,9 @@ class OssClient
$resource = '/' . $bucket . '/' . $channelName;
$string_to_sign = $expires . "\n" . $cano_params . $resource;
- $cred = $this->provider->getCredentials();
- $this->checkCredentials($cred);
+ $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $this->accessKeySecret, true));
- $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $cred->getAccessKeySecret(), true));
-
- $query_items[] = 'OSSAccessKeyId=' . rawurlencode($cred->getAccessKeyId());
+ $query_items[] = 'OSSAccessKeyId=' . rawurlencode($this->accessKeyId);
$query_items[] = 'Expires=' . rawurlencode($expires);
$query_items[] = 'Signature=' . rawurlencode($signature);
@@ -973,8 +893,8 @@ class OssClient
* @param string $channelName channel name
* @param int $expiration expiration time of the Url, unix epoch, since 1970.1.1 00.00.00 UTC
* @param array $options
- * @return string The signed pushing streaming url
* @throws OssException
+ * @return The signed pushing streaming url
*/
public function generatePresignedRtmpUrl($bucket, $channelName, $expiration, $options = NULL)
{
@@ -992,12 +912,9 @@ class OssClient
$resource = '/' . $bucket . '/' . $channelName;
$string_to_sign = $expiration . "\n" . $cano_params . $resource;
- $cred = $this->provider->getCredentials();
- $this->checkCredentials($cred);
+ $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $this->accessKeySecret, true));
- $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $cred->getAccessKeySecret(), true));
-
- $query_items[] = 'OSSAccessKeyId=' . rawurlencode($cred->getAccessKeyId());
+ $query_items[] = 'OSSAccessKeyId=' . rawurlencode($this->accessKeyId);
$query_items[] = 'Expires=' . rawurlencode($expiration);
$query_items[] = 'Signature=' . rawurlencode($signature);
@@ -1006,8 +923,8 @@ class OssClient
/**
* Precheck the CORS request. Before sending a CORS request, a preflight request (OPTIONS) is sent with the specific origin.
- * HTTP METHOD and headers information are sent to OSS as well for evaluating if the CORS request is allowed.
- *
+ * HTTP METHOD and headers information are sent to OSS as well for evaluating if the CORS request is allowed.
+ *
* Note: OSS could enable the CORS on the bucket by calling putBucketCors. Once CORS is enabled, the OSS could evaluate accordingto the preflight request.
*
* @param string $bucket bucket name
@@ -1016,8 +933,9 @@ class OssClient
* @param string $request_method The actual HTTP method which will be used in CORS request
* @param string $request_headers The actual HTTP headers which will be used in CORS request
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return array
+ * @throws OssException
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/cors/OptionObject.html
*/
public function optionsObject($bucket, $object, $origin, $request_method, $request_headers, $options = NULL)
{
@@ -1025,9 +943,11 @@ class OssClient
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_OPTIONS;
$options[self::OSS_OBJECT] = $object;
- $options[self::OSS_HEADERS][self::OSS_OPTIONS_ORIGIN] = $origin;
- $options[self::OSS_HEADERS][self::OSS_OPTIONS_REQUEST_HEADERS] = $request_headers;
- $options[self::OSS_HEADERS][self::OSS_OPTIONS_REQUEST_METHOD] = $request_method;
+ $options[self::OSS_HEADERS] = array(
+ self::OSS_OPTIONS_ORIGIN => $origin,
+ self::OSS_OPTIONS_REQUEST_HEADERS => $request_headers,
+ self::OSS_OPTIONS_REQUEST_METHOD => $request_method
+ );
$response = $this->auth($options);
$result = new HeaderResult($response);
return $result->getData();
@@ -1039,14 +959,15 @@ class OssClient
* @param string $bucket bucket name
* @param LifecycleConfig $lifecycleConfig LifecycleConfig instance
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function putBucketLifecycle($bucket, $lifecycleConfig, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'lifecycle';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$options[self::OSS_CONTENT] = $lifecycleConfig->serializeToXml();
@@ -1060,14 +981,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return LifecycleConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return LifecycleConfig
*/
public function getBucketLifecycle($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'lifecycle';
$response = $this->auth($options);
$result = new GetLifecycleResult($response);
@@ -1079,14 +1001,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function deleteBucketLifecycle($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'lifecycle';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -1095,19 +1018,20 @@ class OssClient
/**
* Sets a bucket's referer, which has a whitelist of referrer and specifies if empty referer is allowed.
- * Checks out API document for more details about "Bucket Referer"
+ * Checks out API document for more details about "Bucket Referer"
*
* @param string $bucket bucket name
* @param RefererConfig $refererConfig
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return ResponseCore
+ * @throws null
*/
public function putBucketReferer($bucket, $refererConfig, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'referer';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$options[self::OSS_CONTENT] = $refererConfig->serializeToXml();
@@ -1118,18 +1042,19 @@ class OssClient
/**
* Gets the bucket's Referer
- * Checks out API document for more details about "Bucket Referer"
+ * Checks out API document for more details about "Bucket Referer"
*
* @param string $bucket bucket name
* @param array $options
- * @return RefererConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return RefererConfig
*/
public function getBucketReferer($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'referer';
$response = $this->auth($options);
$result = new GetRefererResult($response);
@@ -1143,14 +1068,15 @@ class OssClient
* @param string $bucket bucket name
* @param int $storageCapacity
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return ResponseCore
+ * @throws null
*/
public function putBucketStorageCapacity($bucket, $storageCapacity, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'qos';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$storageCapacityConfig = new StorageCapacityConfig($storageCapacity);
@@ -1165,14 +1091,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return int|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return int
*/
public function getBucketStorageCapacity($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'qos';
$response = $this->auth($options);
$result = new GetStorageCapacityResult($response);
@@ -1184,33 +1111,35 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return BucketInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return BucketInfo
*/
public function getBucketInfo($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'bucketInfo';
$response = $this->auth($options);
$result = new GetBucketInfoResult($response);
return $result->getData();
}
- /**
+ /**
* Get the stat of the bucket
*
* @param string $bucket bucket name
* @param array $options
- * @return BucketStat|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return BucketStat
*/
public function getBucketStat($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'stat';
$response = $this->auth($options);
$result = new GetBucketStatResult($response);
@@ -1223,14 +1152,15 @@ class OssClient
* @param string $bucket bucket name
* @param string $policy policy json format content
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function putBucketPolicy($bucket, $policy, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'policy';
$options[self::OSS_CONTENT_TYPE] = 'application/json';
$options[self::OSS_CONTENT] = $policy;
@@ -1244,14 +1174,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return string|null policy json content
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string policy json content
*/
public function getBucketPolicy($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'policy';
$response = $this->auth($options);
$result = new BodyResult($response);
@@ -1263,14 +1194,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function deleteBucketPolicy($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'policy';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -1283,14 +1215,15 @@ class OssClient
* @param string $bucket bucket name
* @param ServerSideEncryptionConfig $sseConfig
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function putBucketEncryption($bucket, $sseConfig, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'encryption';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$options[self::OSS_CONTENT] = $sseConfig->serializeToXml();
@@ -1304,14 +1237,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return ServerSideEncryptionConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return ServerSideEncryptionConfig
*/
public function getBucketEncryption($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'encryption';
$response = $this->auth($options);
$result = new GetBucketEncryptionResult($response);
@@ -1323,14 +1257,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function deleteBucketEncryption($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'encryption';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -1343,14 +1278,15 @@ class OssClient
* @param string $bucket bucket name
* @param string $payer
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return ResponseCore
+ * @throws null
*/
public function putBucketRequestPayment($bucket, $payer, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'requestPayment';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$config = new RequestPaymentConfig($payer);
@@ -1365,14 +1301,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return string|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string
*/
public function getBucketRequestPayment($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'requestPayment';
$response = $this->auth($options);
$result = new GetBucketRequestPaymentResult($response);
@@ -1385,14 +1322,15 @@ class OssClient
* @param string $bucket bucket name
* @param TaggingConfig $taggingConfig
* @param array $options
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function putBucketTags($bucket, $taggingConfig, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$options[self::OSS_CONTENT] = $taggingConfig->serializeToXml();
@@ -1406,14 +1344,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return TaggingConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return TaggingConfig
*/
public function getBucketTags($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
$response = $this->auth($options);
$result = new GetBucketTagsResult($response);
@@ -1427,20 +1366,21 @@ class OssClient
* @param string $bucket bucket name
* @param tag[] $tags (optional)
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function deleteBucketTags($bucket, $tags = NULL, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
if (empty($tags)) {
$options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
} else {
$value = '';
- foreach ($tags as $tag) {
- $value .= $tag->getKey() . ',';
+ foreach ($tags as $tag ) {
+ $value .= $tag->getKey().',';
}
$value = rtrim($value, ',');
$options[self::OSS_TAGGING] = $value;
@@ -1456,14 +1396,15 @@ class OssClient
* @param string $bucket bucket name
* @param string $status
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return ResponseCore
+ * @throws null
*/
public function putBucketVersioning($bucket, $status, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'versioning';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$config = new VersioningConfig($status);
@@ -1478,14 +1419,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return string|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string
*/
public function getBucketVersioning($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'versioning';
$response = $this->auth($options);
$result = new GetBucketVersioningResult($response);
@@ -1498,14 +1440,15 @@ class OssClient
* @param string $bucket bucket name
* @param int $day
* @param array $options
- * @return string|null returns upload id
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string returns uploadid
*/
public function initiateBucketWorm($bucket, $day, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
$options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'worm';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$config = new InitiateWormConfig($day);
@@ -1520,34 +1463,36 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function abortBucketWorm($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'worm';
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
return $result->getData();
}
- /**
+ /**
* Complete a bucket's worm
*
* @param string $bucket bucket name
* @param string $wormId
* @param array $options
- * @return string|null returns upload id
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string returns uploadid
*/
public function completeBucketWorm($bucket, $wormId, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
$options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_WORM_ID] = $wormId;
$options[self::OSS_CONTENT] = '';
$response = $this->auth($options);
@@ -1562,14 +1507,15 @@ class OssClient
* @param string $wormId
* @param int $day
* @param array $options
- * @return string|null returns upload id
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string returns uploadid
*/
public function extendBucketWorm($bucket, $wormId, $day, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
$options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_WORM_ID] = $wormId;
$options[self::OSS_SUB_RESOURCE] = 'wormExtend';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
@@ -1585,14 +1531,15 @@ class OssClient
*
* @param string $bucket bucket name
* @param array $options
- * @return string|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string
*/
public function getBucketWorm($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'worm';
$response = $this->auth($options);
$result = new GetBucketWormResult($response);
@@ -1604,16 +1551,17 @@ class OssClient
* Put Bucket TransferAcceleration
* @param $bucket
* @param $enabled boolean
- * @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @param null $options
+ * @return null
+ * @throws OssException
*/
- public function putBucketTransferAcceleration($bucket, $enabled, $options = NULL)
+ public function putBucketTransferAcceleration($bucket,$enabled,$options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'transferAcceleration';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$config = new TransferAccelerationConfig();
@@ -1627,15 +1575,16 @@ class OssClient
/**
* Put Bucket TransferAcceleration
* @param $bucket
- * @param array $options
- * @return boolean|null
- * @throws OssException|RequestCore_Exception
+ * @param null $options
+ * @return enabled boolean
+ * @throws OssException
*/
- public function getBucketTransferAcceleration($bucket, $options = NULL)
+ public function getBucketTransferAcceleration($bucket,$options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'transferAcceleration';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$response = $this->auth($options);
@@ -1655,30 +1604,31 @@ class OssClient
* 'marker' => The key of returned object must be greater than the 'marker'.
*)
* Prefix and marker are for filtering and paging. Their length must be less than 256 bytes
- * @return ObjectListInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return ObjectListInfo
*/
public function listObjects($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$query = isset($options[self::OSS_QUERY_STRING]) ? $options[self::OSS_QUERY_STRING] : array();
$options[self::OSS_QUERY_STRING] = array_merge(
$query,
array(self::OSS_ENCODING_TYPE => self::OSS_ENCODING_TYPE_URL,
- self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
- self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
- self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
- self::OSS_MARKER => isset($options[self::OSS_MARKER]) ? $options[self::OSS_MARKER] : '')
+ self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
+ self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
+ self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
+ self::OSS_MARKER => isset($options[self::OSS_MARKER]) ? $options[self::OSS_MARKER] : '')
);
$response = $this->auth($options);
$result = new ListObjectsResult($response);
return $result->getData();
}
-
-
+
+
/**
* Lists the bucket's object list v2 (in ObjectListInfoV2)
*
@@ -1692,33 +1642,37 @@ class OssClient
* 'continuation-token' => The token from which the list operation must start.
*)
* Prefix, start-after and continuation-token are for filtering and paging. Their length must be less than 256 bytes
- * @return ObjectListInfoV2|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return ObjectListInfoV2
*/
public function listObjectsV2($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$query = isset($options[self::OSS_QUERY_STRING]) ? $options[self::OSS_QUERY_STRING] : array();
$temp = array(
- self::OSS_LIST_TYPE => 2,
+ self::OSS_LIST_TYPE=>2,
self::OSS_ENCODING_TYPE => self::OSS_ENCODING_TYPE_URL,
self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
self::OSS_START_AFTER => isset($options[self::OSS_START_AFTER]) ? $options[self::OSS_START_AFTER] : '',
);
- if (isset($options[self::OSS_CONTINUATION_TOKEN])) {
+ if(isset($options[self::OSS_CONTINUATION_TOKEN])){
$temp[self::OSS_CONTINUATION_TOKEN] = $options[self::OSS_CONTINUATION_TOKEN];
}
$options[self::OSS_QUERY_STRING] = array_merge(
- $query, $temp
+ $query,$temp
);
$response = $this->auth($options);
$result = new ListObjectsV2Result($response);
return $result->getData();
}
+
+
+
/**
* Lists the bucket's object with version information (in ObjectListInfo)
@@ -1733,24 +1687,25 @@ class OssClient
* 'version-id-marker' => The version id of returned object must be greater than the 'version-id-marker'.
*)
* Prefix and marker are for filtering and paging. Their length must be less than 256 bytes
- * @return ObjectVersionListInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return ObjectListInfo
*/
public function listObjectVersions($bucket, $options = NULL)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'versions';
$query = isset($options[self::OSS_QUERY_STRING]) ? $options[self::OSS_QUERY_STRING] : array();
$options[self::OSS_QUERY_STRING] = array_merge(
$query,
array(self::OSS_ENCODING_TYPE => self::OSS_ENCODING_TYPE_URL,
- self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
- self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
- self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
- self::OSS_KEY_MARKER => isset($options[self::OSS_KEY_MARKER]) ? $options[self::OSS_KEY_MARKER] : '',
- self::OSS_VERSION_ID_MARKER => isset($options[self::OSS_VERSION_ID_MARKER]) ? $options[self::OSS_VERSION_ID_MARKER] : '')
+ self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
+ self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
+ self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
+ self::OSS_KEY_MARKER => isset($options[self::OSS_KEY_MARKER]) ? $options[self::OSS_KEY_MARKER] : '',
+ self::OSS_VERSION_ID_MARKER => isset($options[self::OSS_VERSION_ID_MARKER]) ? $options[self::OSS_VERSION_ID_MARKER] : '')
);
$response = $this->auth($options);
@@ -1766,8 +1721,7 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
*/
public function createObjectDir($bucket, $object, $options = NULL)
{
@@ -1788,8 +1742,7 @@ class OssClient
* @param string $object objcet name
* @param string $content The content object
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
*/
public function putObject($bucket, $object, $content, $options = NULL)
{
@@ -1811,18 +1764,18 @@ class OssClient
$content_md5 = base64_encode(md5($content, true));
$options[self::OSS_CONTENT_MD5] = $content_md5;
}
-
+
if (!isset($options[self::OSS_CONTENT_TYPE])) {
$options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object);
}
$response = $this->auth($options);
-
+
if (isset($options[self::OSS_CALLBACK]) && !empty($options[self::OSS_CALLBACK])) {
$result = new CallbackResult($response);
} else {
$result = new PutSetDeleteResult($response);
}
-
+
return $result->getData();
}
@@ -1833,10 +1786,9 @@ class OssClient
* @param string $symlink symlink name
* @param string $targetObject targetObject name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
*/
- public function putSymlink($bucket, $symlink, $targetObject, $options = NULL)
+ public function putSymlink($bucket, $symlink ,$targetObject, $options = NULL)
{
$this->precheckCommon($bucket, $symlink, $options);
@@ -1852,12 +1804,11 @@ class OssClient
}
/**
- * Gets symlink
+ * gets symlink
* @param string $bucket bucket name
* @param string $symlink symlink name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
*/
public function getSymlink($bucket, $symlink, $options = NULL)
{
@@ -1880,19 +1831,19 @@ class OssClient
* @param string $object object name
* @param string $file local file path
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
+ * @throws OssException
*/
public function uploadFile($bucket, $object, $file, $options = NULL)
{
$this->precheckCommon($bucket, $object, $options);
OssUtil::throwOssExceptionWithMessageIfEmpty($file, "file path is invalid");
- $file = $this->encodeFilePath($file);
+ $file = OssUtil::encodePath($file);
if (!file_exists($file)) {
throw new OssException($file . " file does not exist");
}
$options[self::OSS_FILE_UPLOAD] = $file;
- $file_size = sprintf('%u', filesize($options[self::OSS_FILE_UPLOAD]));
+ $file_size = sprintf('%u',filesize($options[self::OSS_FILE_UPLOAD]));
$is_check_md5 = $this->isCheckMD5($options);
if ($is_check_md5) {
$content_md5 = base64_encode(md5_file($options[self::OSS_FILE_UPLOAD], true));
@@ -1917,8 +1868,8 @@ class OssClient
* @param string $object object name
* @param resource $handle file handle
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
+ * @throws OssException
*/
public function uploadStream($bucket, $object, $handle, $options = NULL)
{
@@ -1942,8 +1893,7 @@ class OssClient
$options[self::OSS_BUCKET] = $bucket;
$options[self::OSS_OBJECT] = $object;
if (!isset($options[self::OSS_CONTENT_LENGTH])) {
- $stat = fstat($handle);
- $options[self::OSS_CONTENT_LENGTH] = $stat[self::OSS_SIZE];
+ $options[self::OSS_CONTENT_LENGTH] = fstat($handle)[self::OSS_SIZE];
}
$response = $this->auth($options);
$result = new PutSetDeleteResult($response);
@@ -1957,8 +1907,8 @@ class OssClient
* @param string $object objcet name
* @param string $content content to append
* @param array $options
- * @return int|null next append position
- * @throws OssException|RequestCore_Exception
+ * @return int next append position
+ * @throws OssException
*/
public function appendObject($bucket, $object, $content, $position, $options = NULL)
{
@@ -1970,12 +1920,13 @@ class OssClient
$options[self::OSS_OBJECT] = $object;
$options[self::OSS_SUB_RESOURCE] = 'append';
$options[self::OSS_POSITION] = strval($position);
+
if (!isset($options[self::OSS_LENGTH])) {
$options[self::OSS_CONTENT_LENGTH] = strlen($options[self::OSS_CONTENT]);
} else {
$options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
}
-
+
$is_check_md5 = $this->isCheckMD5($options);
if ($is_check_md5) {
$content_md5 = base64_encode(md5($content, true));
@@ -1997,20 +1948,20 @@ class OssClient
* @param string $object object name
* @param string $file The local file path to append with
* @param array $options
- * @return int|null next append position
- * @throws OssException|RequestCore_Exception
+ * @return int next append position
+ * @throws OssException
*/
public function appendFile($bucket, $object, $file, $position, $options = NULL)
{
$this->precheckCommon($bucket, $object, $options);
OssUtil::throwOssExceptionWithMessageIfEmpty($file, "file path is invalid");
- $file = $this->encodeFilePath($file);
+ $file = OssUtil::encodePath($file);
if (!file_exists($file)) {
throw new OssException($file . " file does not exist");
}
$options[self::OSS_FILE_UPLOAD] = $file;
- $file_size = sprintf('%u', filesize($options[self::OSS_FILE_UPLOAD]));
+ $file_size = sprintf('%u',filesize($options[self::OSS_FILE_UPLOAD]));
$is_check_md5 = $this->isCheckMD5($options);
if ($is_check_md5) {
$content_md5 = base64_encode(md5_file($options[self::OSS_FILE_UPLOAD], true));
@@ -2041,7 +1992,7 @@ class OssClient
* @param string $toObject Target object name
* @param array $options
* @return null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
*/
public function copyObject($fromBucket, $fromObject, $toBucket, $toObject, $options = NULL)
{
@@ -2052,10 +2003,14 @@ class OssClient
$options[self::OSS_OBJECT] = $toObject;
$param = '/' . $fromBucket . '/' . rawurlencode($fromObject);
if (isset($options[self::OSS_VERSION_ID])) {
- $param = $param . '?versionId=' . $options[self::OSS_VERSION_ID];
+ $param = $param . '?versionId='.$options[self::OSS_VERSION_ID];
unset($options[self::OSS_VERSION_ID]);
}
- $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = $param;
+ if (isset($options[self::OSS_HEADERS])) {
+ $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = $param;
+ } else {
+ $options[self::OSS_HEADERS] = array(self::OSS_OBJECT_COPY_SOURCE => $param);
+ }
$response = $this->auth($options);
$result = new CopyObjectResult($response);
return $result->getData();
@@ -2067,8 +2022,7 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param string $options Checks out the SDK document for the detail
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return array
*/
public function getObjectMeta($bucket, $object, $options = NULL)
{
@@ -2081,15 +2035,14 @@ class OssClient
return $result->getData();
}
- /**
- * Gets the simplified metadata of a object.
+ /**
+ * Gets the simplified metadata of a object.
* Simplified metadata includes ETag, Size, LastModified.
*
* @param string $bucket bucket name
* @param string $object object name
* @param string $options Checks out the SDK document for the detail
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return array
*/
public function getSimplifiedObjectMeta($bucket, $object, $options = NULL)
{
@@ -2109,8 +2062,7 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
*/
public function deleteObject($bucket, $object, $options = NULL)
{
@@ -2129,8 +2081,8 @@ class OssClient
* @param string $bucket bucket name
* @param array $objects object list
* @param array $options
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return ResponseCore
+ * @throws null
*/
public function deleteObjects($bucket, $objects, $options = null)
{
@@ -2140,6 +2092,7 @@ class OssClient
}
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
$options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'delete';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$quiet = 'false';
@@ -2163,8 +2116,8 @@ class OssClient
* @param string $bucket bucket name
* @param array $objects DeleteObjectInfo list
* @param array $options
- * @return DeletedObjectInfo|null
- * @throws OssException|RequestCore_Exception
+ * @return ResponseCore
+ * @throws null
*/
public function deleteObjectVersions($bucket, $objects, $options = null)
{
@@ -2174,6 +2127,7 @@ class OssClient
}
$options[self::OSS_METHOD] = self::OSS_HTTP_POST;
$options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'delete';
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
$quiet = 'false';
@@ -2197,8 +2151,7 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param array $options It must contain ALIOSS::OSS_FILE_DOWNLOAD. And ALIOSS::OSS_RANGE is optional and empty means to download the whole file.
- * @return string|null
- * @throws OssException|RequestCore_Exception
+ * @return string
*/
public function getObject($bucket, $object, $options = NULL)
{
@@ -2231,8 +2184,7 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param array $options
- * @return bool|null True:object exists; False:object does not exist
- * @throws OssException|RequestCore_Exception|
+ * @return bool True:object exists; False:object does not exist
*/
public function doesObjectExist($bucket, $object, $options = NULL)
{
@@ -2251,8 +2203,8 @@ class OssClient
*
* @param string $bucket bucket name
* @param string $object object name
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @return null
+ * @throws OssException
*/
public function restoreObject($bucket, $object, $options = NULL)
{
@@ -2277,8 +2229,8 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param TaggingConfig $taggingConfig
- * @return array|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return null
*/
public function putObjectTagging($bucket, $object, $taggingConfig, $options = NULL)
{
@@ -2299,8 +2251,8 @@ class OssClient
*
* @param string $bucket
* @param string $object
- * @return TaggingConfig|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return TaggingConfig
*/
public function getObjectTagging($bucket, $object, $options = NULL)
{
@@ -2319,8 +2271,8 @@ class OssClient
*
* @param string $bucket
* @param string $object
- * @return null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return TaggingConfig
*/
public function deleteObjectTagging($bucket, $object, $options = NULL)
{
@@ -2340,8 +2292,7 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param string $process process script
- * @return string|null process result, json format
- * @throws OssException|RequestCore_Exception|
+ * @return string process result, json format
*/
public function processObject($bucket, $object, $process, $options = NULL)
{
@@ -2351,33 +2302,7 @@ class OssClient
$options[self::OSS_OBJECT] = $object;
$options[self::OSS_SUB_RESOURCE] = 'x-oss-process';
$options[self::OSS_CONTENT_TYPE] = 'application/octet-stream';
- $options[self::OSS_CONTENT] = 'x-oss-process=' . $process;
- $response = $this->auth($options);
- $result = new BodyResult($response);
- return $result->getData();
- }
-
-
- /**
- * Async Process the object
- *
- * @param string $bucket bucket name
- * @param string $object object name
- * @param string $asyncProcess async process script
- * @param null $options
- * @return string|null process result, json format
- * @throws OssException
- * @throws RequestCore_Exception
- */
- public function asyncProcessObject($bucket, $object, $asyncProcess, $options = NULL)
- {
- $this->precheckCommon($bucket, $object, $options);
- $options[self::OSS_BUCKET] = $bucket;
- $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
- $options[self::OSS_OBJECT] = $object;
- $options[self::OSS_SUB_RESOURCE] = 'x-oss-async-process';
- $options[self::OSS_CONTENT_TYPE] = 'application/octet-stream';
- $options[self::OSS_CONTENT] = 'x-oss-async-process=' . $asyncProcess;
+ $options[self::OSS_CONTENT] = 'x-oss-process='.$process;
$response = $this->auth($options);
$result = new BodyResult($response);
return $result->getData();
@@ -2406,7 +2331,7 @@ class OssClient
* It must be only called by upload_Part().
*
* @param integer $file_size File size
- * @param integer $partSize part size. Default is 5MB
+ * @param integer $partSize part大小,part size. Default is 5MB
* @return array An array contains key-value pairs--the key is `seekTo`and value is `length`.
*/
public function generateMultiuploadParts($file_size, $partSize = 5242880)
@@ -2432,8 +2357,8 @@ class OssClient
* @param string $bucket bucket name
* @param string $object object name
* @param array $options Key-Value array
- * @return string|null returns upload id
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return string returns uploadid
*/
public function initiateMultipartUpload($bucket, $object, $options = NULL)
{
@@ -2462,8 +2387,8 @@ class OssClient
* @param string $object object name
* @param string $uploadId
* @param array $options Key-Value array
- * @return string|null eTag
- * @throws OssException|RequestCore_Exception
+ * @return string eTag
+ * @throws OssException
*/
public function uploadPart($bucket, $object, $uploadId, $options = null)
{
@@ -2491,8 +2416,8 @@ class OssClient
* @param string $object object name
* @param string $uploadId uploadId
* @param array $options Key-Value array
- * @return ListPartsInfo|null
- * @throws OssException|RequestCore_Exception
+ * @return ListPartsInfo
+ * @throws OssException
*/
public function listParts($bucket, $object, $uploadId, $options = null)
{
@@ -2521,7 +2446,7 @@ class OssClient
* @param string $uploadId uploadId
* @param array $options Key-Value name
* @return null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
*/
public function abortMultipartUpload($bucket, $object, $uploadId, $options = NULL)
{
@@ -2543,8 +2468,8 @@ class OssClient
* @param string $uploadId uploadId
* @param array $listParts array( array("PartNumber"=> int, "ETag"=>string))
* @param array $options Key-Value array
+ * @throws OssException
* @return null
- * @throws OssException|RequestCore_Exception
*/
public function completeMultipartUpload($bucket, $object, $uploadId, $listParts, $options = NULL)
{
@@ -2556,7 +2481,7 @@ class OssClient
$options[self::OSS_CONTENT_TYPE] = 'application/xml';
if (is_array($listParts)) {
$options[self::OSS_CONTENT] = OssUtil::createCompleteMultipartUploadXmlBody($listParts);
- } else {
+ } else {
$options[self::OSS_CONTENT] = "";
}
@@ -2574,14 +2499,15 @@ class OssClient
*
* @param string $bucket bucket
* @param array $options key-value array--expected keys are 'delimiter', 'key-marker', 'max-uploads', 'prefix', 'upload-id-marker'
- * @return ListMultipartUploadInfo|null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
+ * @return ListMultipartUploadInfo
*/
public function listMultipartUploads($bucket, $options = null)
{
$this->precheckCommon($bucket, NULL, $options, false);
$options[self::OSS_METHOD] = self::OSS_HTTP_GET;
$options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = '/';
$options[self::OSS_SUB_RESOURCE] = 'uploads';
foreach (array('delimiter', 'key-marker', 'max-uploads', 'prefix', 'upload-id-marker') as $param) {
@@ -2612,7 +2538,7 @@ class OssClient
* @param string $uploadId Upload Id
* @param array $options Key-Value array---it should have 'start' or 'end' key to specify the range of the source object to copy. If it's not specifed, the whole object is copied.
* @return null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
*/
public function uploadPartCopy($fromBucket, $fromObject, $toBucket, $toObject, $partNumber, $uploadId, $options = NULL)
{
@@ -2640,7 +2566,7 @@ class OssClient
$param = '/' . $fromBucket . '/' . rawurlencode($fromObject);
if (isset($options[self::OSS_VERSION_ID])) {
- $param = $param . '?versionId=' . $options[self::OSS_VERSION_ID];
+ $param = $param . '?versionId='.$options[self::OSS_VERSION_ID];
unset($options[self::OSS_VERSION_ID]);
}
@@ -2659,7 +2585,7 @@ class OssClient
* @param string $file The local file to upload
* @param array $options Key-Value array
* @return null
- * @throws OssException|RequestCore_Exception
+ * @throws OssException
*/
public function multiuploadFile($bucket, $object, $file, $options = null)
{
@@ -2671,7 +2597,7 @@ class OssClient
if (empty($file)) {
throw new OssException("parameter invalid, file is empty");
}
- $uploadFile = $this->encodeFilePath($file);
+ $uploadFile = OssUtil::encodePath($file);
if (!isset($options[self::OSS_CONTENT_TYPE])) {
$options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object, $uploadFile);
}
@@ -2681,10 +2607,10 @@ class OssClient
if (isset($options[self::OSS_CONTENT_LENGTH])) {
$upload_file_size = (integer)$options[self::OSS_CONTENT_LENGTH];
} else {
- $upload_file_size = sprintf('%u', filesize($uploadFile));
+ $upload_file_size = sprintf('%u',filesize($uploadFile));
if ($upload_file_size !== false) {
- $upload_file_size -= $upload_position;
+ $upload_file_size -= $upload_position;
}
}
@@ -2746,7 +2672,7 @@ class OssClient
$cmp_options = array(
OssClient::OSS_HEADERS => array(
OssClient::OSS_REQUEST_PAYER => $options[self::OSS_HEADERS][self::OSS_REQUEST_PAYER],
- ));
+ ));
}
return $this->completeMultipartUpload($bucket, $object, $uploadId, $uploadParts, $cmp_options);
}
@@ -2770,7 +2696,7 @@ class OssClient
if (!is_string($prefix)) throw new OssException("parameter error, prefix is not string");
if (empty($localDirectory)) throw new OssException("parameter error, localDirectory is empty");
$directory = $localDirectory;
- $directory = $this->encodeFilePath($directory);
+ $directory = OssUtil::encodePath($directory);
//If it's not the local directory, throw OSSException.
if (!is_dir($directory)) {
throw new OssException('parameter error: ' . $directory . ' is not a directory, please check it');
@@ -2788,9 +2714,7 @@ class OssClient
self::OSS_PART_SIZE => self::OSS_MIN_PART_SIZE,
self::OSS_CHECK_MD5 => $checkMd5,
);
- //mbstring to utf-8
- $fileName = $this->decodeFilePath($item['file']);
- $realObject = (!empty($prefix) ? $prefix . '/' : '') . $fileName;
+ $realObject = (!empty($prefix) ? $prefix . '/' : '') . $item['file'];
try {
$this->multiuploadFile($bucket, $realObject, $item['path'], $options);
@@ -2816,8 +2740,22 @@ class OssClient
*/
public function signUrl($bucket, $object, $timeout = 60, $method = self::OSS_HTTP_GET, $options = NULL)
{
- $expiration = time() + $timeout;
- return $this->generatePresignedUrl($bucket, $object, $expiration, $method, $options);
+ $this->precheckCommon($bucket, $object, $options);
+ //method
+ if (self::OSS_HTTP_GET !== $method && self::OSS_HTTP_PUT !== $method) {
+ throw new OssException("method is invalid");
+ }
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_METHOD] = $method;
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = '';
+ }
+ $timeout = time() + $timeout;
+ $options[self::OSS_PREAUTH] = $timeout;
+ $options[self::OSS_DATE] = $timeout;
+ $this->setSignStsInUrl(true);
+ return $this->auth($options);
}
/**
@@ -2834,47 +2772,21 @@ class OssClient
*/
public function generatePresignedUrl($bucket, $object, $expiration, $method = self::OSS_HTTP_GET, $options = NULL)
{
- $this->precheckObjectExt($object, $this->enableStrictObjName);
$this->precheckCommon($bucket, $object, $options);
- $cred = $this->provider->getCredentials();
//method
if (self::OSS_HTTP_GET !== $method && self::OSS_HTTP_PUT !== $method) {
throw new OssException("method is invalid");
}
- // Should https or http be used?
- $scheme = $this->useSSL ? 'https://' : 'http://';
- // gets the host name. If the host name is public domain or private domain, form a third level domain by prefixing the bucket name on the domain name.
- $hostname = $this->generateHostname($bucket);
- $path = $this->generatePath($bucket, $object);
- $headers = $this->generateHeaders($options, '');
- $query_string = $this->generateQueryString($options);
- $query_string = empty($query_string) ? '' : '?' . $query_string;
- $requestUrl = $scheme . $hostname . $path . $query_string;
- //Creates the request
- $request = new RequestCore($requestUrl);
- $request->set_method($method);
- if (isset($options[self::OSS_CALLBACK])) {
- $headers[self::OSS_CALLBACK] = base64_encode($options[self::OSS_CALLBACK]);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_METHOD] = $method;
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = '';
}
- if (isset($options[self::OSS_CALLBACK_VAR])) {
- $headers[self::OSS_CALLBACK_VAR] = base64_encode($options[self::OSS_CALLBACK_VAR]);
- }
- foreach ($headers as $header_key => $header_value) {
- $header_value = trim($header_value);
- if (empty($header_value)) {
- continue;
- }
- $request->add_header($header_key, $header_value);
- }
- $signingOpt = array(
- 'bucket' => $bucket,
- 'key' => $object,
- 'region' => $this->getRegion(),
- 'product' => $this->getProduct(),
- 'expiration' => $expiration,
- );
- $this->signer->presign($request, $cred, $signingOpt);
- return $request->request_url;
+ $options[self::OSS_PREAUTH] = $expiration;
+ $options[self::OSS_DATE] = $expiration;
+ $this->setSignStsInUrl(true);
+ return $this->auth($options);
}
/**
@@ -2901,9 +2813,6 @@ class OssClient
private function precheckBucket($bucket, $errMsg = 'bucket is not allowed empty')
{
OssUtil::throwOssExceptionWithMessageIfEmpty($bucket, $errMsg);
- if (!OssUtil::validateBucket($bucket)) {
- throw new OssException('"' . $bucket . '"' . 'bucket name is invalid');
- }
}
/**
@@ -2915,31 +2824,12 @@ class OssClient
private function precheckObject($object)
{
OssUtil::throwOssExceptionWithMessageIfEmpty($object, "object name is empty");
- if (!OssUtil::validateObject($object)) {
- throw new OssException('"' . $object . '"' . ' object name is invalid');
- }
}
/**
- * validates object name start with ? or not
- * @param $object string
- * @param $strict boolean
- * @throws OssException
- */
- private function precheckObjectExt($object, $strict)
- {
- $this->precheckObject($object);
- if ($strict) {
- if (is_string($object) && $object[0] === "?") {
- throw new OssException('"' . $object . '"' . ' object name cannot start with `?`');
- }
- }
- }
-
- /**
- * Check option restore
+ * 校验option restore
*
- * @param $storage string
+ * @param string $restore
* @throws OssException
*/
private function precheckStorage($storage)
@@ -3005,7 +2895,7 @@ class OssClient
}
/**
- * Gets value of the specified key from the options
+ * Gets value of the specified key from the options
*
* @param array $options
* @param string $key
@@ -3062,32 +2952,46 @@ class OssClient
* Validates and executes the request according to OSS API protocol.
*
* @param array $options
- * @return ResponseCore|string
+ * @return ResponseCore
* @throws OssException
* @throws RequestCore_Exception
*/
private function auth($options)
{
OssUtil::validateOptions($options);
- //Object Encoding
+ //Validates bucket, not required for list_bucket
+ $this->authPrecheckBucket($options);
+ //Validates object
+ $this->authPrecheckObject($options);
+ //object name encoding must be UTF-8
$this->authPrecheckObjectEncoding($options);
//Validates ACL
$this->authPrecheckAcl($options);
- $cred = $this->provider->getCredentials();
- $this->checkCredentials($cred);
-
- $bucket = isset($options[self::OSS_BUCKET]) ? $options[self::OSS_BUCKET] : '';
- $object = isset($options[self::OSS_OBJECT]) ? $options[self::OSS_OBJECT] : '';
-
// Should https or http be used?
$scheme = $this->useSSL ? 'https://' : 'http://';
// gets the host name. If the host name is public domain or private domain, form a third level domain by prefixing the bucket name on the domain name.
- $hostname = $this->generateHostname($bucket);
- $path = $this->generatePath($bucket, $object);
+ $hostname = $this->generateHostname($options[self::OSS_BUCKET]);
+ $string_to_sign = '';
$headers = $this->generateHeaders($options, $hostname);
+ $signable_query_string_params = $this->generateSignableQueryStringParam($options);
+ $signable_query_string = OssUtil::toQueryString($signable_query_string_params);
+ $resource_uri = $this->generateResourceUri($options);
+ //Generates the URL (add query parameters)
+ $conjunction = '?';
+ $non_signable_resource = '';
+ if (isset($options[self::OSS_SUB_RESOURCE])) {
+ $conjunction = '&';
+ }
+ if ($signable_query_string !== '') {
+ $signable_query_string = $conjunction . $signable_query_string;
+ $conjunction = '&';
+ }
$query_string = $this->generateQueryString($options);
- $query_string = empty($query_string) ? '' : '?' . $query_string;
- $requestUrl = $scheme . $hostname . $path . $query_string;
+ if ($query_string !== '') {
+ $non_signable_resource .= $conjunction . $query_string;
+ $conjunction = '&';
+ }
+ $requestUrl = $scheme . $hostname . $resource_uri . $signable_query_string . $non_signable_resource;
//Creates the request
$request = new RequestCore($requestUrl, $this->requestProxy);
@@ -3127,12 +3031,15 @@ class OssClient
$request->set_write_file($options[self::OSS_FILE_DOWNLOAD]);
}
}
+
if (isset($options[self::OSS_METHOD])) {
$request->set_method($options[self::OSS_METHOD]);
+ $string_to_sign .= $options[self::OSS_METHOD] . "\n";
}
+
if (isset($options[self::OSS_CONTENT])) {
$request->set_body($options[self::OSS_CONTENT]);
- if (isset($headers[self::OSS_CONTENT_TYPE]) && $headers[self::OSS_CONTENT_TYPE] === 'application/x-www-form-urlencoded') {
+ if ($headers[self::OSS_CONTENT_TYPE] === 'application/x-www-form-urlencoded') {
$headers[self::OSS_CONTENT_TYPE] = 'application/octet-stream';
}
@@ -3151,31 +3058,44 @@ class OssClient
$headers[self::OSS_ACCEPT_ENCODING] = '';
}
- if (!isset($headers[self::OSS_CONTENT_TYPE])) {
- $headers[self::OSS_CONTENT_TYPE] = self::DEFAULT_CONTENT_TYPE;
- }
+ uksort($headers, 'strnatcasecmp');
foreach ($headers as $header_key => $header_value) {
- $header_value = trim($header_value);
- if (empty($header_value)) {
- continue;
+ $header_value = str_replace(array("\r", "\n"), '', $header_value);
+ if ($header_value !== '' || $header_key === self::OSS_ACCEPT_ENCODING) {
+ $request->add_header($header_key, $header_value);
}
- $request->add_header($header_key, $header_value);
- }
- // sign request
- $signingOpt = array(
- 'bucket' => $bucket,
- 'key' => $object,
- 'region' => $this->getRegion(),
- 'product' => $this->getProduct(),
- );
- if (isset($options[self::OSS_ADDITIONAL_HEADERS])) {
- $signingOpt['additionalHeaders'] = $options[self::OSS_ADDITIONAL_HEADERS];
+ if (
+ strtolower($header_key) === 'content-md5' ||
+ strtolower($header_key) === 'content-type' ||
+ strtolower($header_key) === 'date' ||
+ (isset($options['self::OSS_PREAUTH']) && (integer)$options['self::OSS_PREAUTH'] > 0)
+ ) {
+ $string_to_sign .= $header_value . "\n";
+ } elseif (substr(strtolower($header_key), 0, 6) === self::OSS_DEFAULT_PREFIX) {
+ $string_to_sign .= strtolower($header_key) . ':' . $header_value . "\n";
+ }
}
+ // Generates the signable_resource
+ $signable_resource = $this->generateSignableResource($options);
+ $signable_resource = rawurldecode($signable_resource) . urldecode($signable_query_string);
+ $string_to_sign_ordered = $string_to_sign;
+ $string_to_sign .= $signable_resource;
- $this->signer->sign($request, $cred, $signingOpt);
- $string_to_sign = isset($signingOpt['string_to_sign']) ? $signingOpt['string_to_sign'] : '';
+ // Sort the strings to be signed.
+ $string_to_sign_ordered .= $this->stringToSignSorted($signable_resource);
+
+
+ $signature = base64_encode(hash_hmac('sha1', $string_to_sign_ordered, $this->accessKeySecret, true));
+ $request->add_header('Authorization', 'OSS ' . $this->accessKeyId . ':' . $signature);
+
+ if (isset($options[self::OSS_PREAUTH]) && (integer)$options[self::OSS_PREAUTH] > 0) {
+ $signed_url = $requestUrl . $conjunction . self::OSS_URL_ACCESS_KEY_ID . '=' . rawurlencode($this->accessKeyId) . '&' . self::OSS_URL_EXPIRES . '=' . $options[self::OSS_PREAUTH] . '&' . self::OSS_URL_SIGNATURE . '=' . rawurlencode($signature);
+ return $signed_url;
+ } elseif (isset($options[self::OSS_PREAUTH])) {
+ return $requestUrl;
+ }
if ($this->timeout !== 0) {
$request->timeout = $this->timeout;
@@ -3206,7 +3126,7 @@ class OssClient
$data = $this->auth($options);
}
}
-
+
$this->redirects = 0;
return $data;
}
@@ -3239,6 +3159,7 @@ class OssClient
*/
public function setSignStsInUrl($enable)
{
+ $this->enableStsInUrl = $enable;
}
/**
@@ -3257,6 +3178,37 @@ class OssClient
$this->useSSL = $useSSL;
}
+ /**
+ * Validates bucket name--throw OssException if it's invalid
+ *
+ * @param $options
+ * @throws OssException
+ */
+ private function authPrecheckBucket($options)
+ {
+ if (!(('/' == $options[self::OSS_OBJECT]) && ('' == $options[self::OSS_BUCKET]) && ('GET' == $options[self::OSS_METHOD])) && !OssUtil::validateBucket($options[self::OSS_BUCKET])) {
+ throw new OssException('"' . $options[self::OSS_BUCKET] . '"' . 'bucket name is invalid');
+ }
+ }
+
+ /**
+ *
+ * Validates the object name--throw OssException if it's invalid.
+ *
+ * @param $options
+ * @throws OssException
+ */
+ private function authPrecheckObject($options)
+ {
+ if (isset($options[self::OSS_OBJECT]) && $options[self::OSS_OBJECT] === '/') {
+ return;
+ }
+
+ if (isset($options[self::OSS_OBJECT]) && !OssUtil::validateObject($options[self::OSS_OBJECT])) {
+ throw new OssException('"' . $options[self::OSS_OBJECT] . '"' . ' object name is invalid');
+ }
+ }
+
/**
* Checks the object's encoding. Convert it to UTF8 if it's in GBK or GB2312
*
@@ -3264,29 +3216,20 @@ class OssClient
*/
private function authPrecheckObjectEncoding(&$options)
{
- if ($this->checkObjectEncoding !== true) {
- return;
- }
-
- if (!isset($options[self::OSS_OBJECT])) {
- return;
- }
-
+ $tmp_object = $options[self::OSS_OBJECT];
try {
- $tmp_object = $options[self::OSS_OBJECT];
- $encoding = array('UTF-8', 'GB2312', 'GBK');
- $encode = mb_detect_encoding($tmp_object, $encoding);
- if ($encode === 'UTF-8' || $encode === false) {
- return;
+ if (OssUtil::isGb2312($options[self::OSS_OBJECT])) {
+ $options[self::OSS_OBJECT] = iconv('GB2312', "UTF-8//IGNORE", $options[self::OSS_OBJECT]);
+ } elseif (OssUtil::checkChar($options[self::OSS_OBJECT], true)) {
+ $options[self::OSS_OBJECT] = iconv('GBK', "UTF-8//IGNORE", $options[self::OSS_OBJECT]);
}
- $tmp_object = iconv($encode, "UTF-8", $tmp_object);
- if ($tmp_object === false) {
- return;
- }
- $options[self::OSS_OBJECT] = $tmp_object;
} catch (\Exception $e) {
- //IGNORE
+ try {
+ $tmp_object = iconv(mb_detect_encoding($tmp_object), "UTF-8", $tmp_object);
+ } catch (\Exception $e) {
+ }
}
+ $options[self::OSS_OBJECT] = $tmp_object;
}
/**
@@ -3313,7 +3256,7 @@ class OssClient
*/
private function generateHostname($bucket)
{
- if ($this->hostType === self::OSS_HOST_TYPE_IP || $this->hostType === self::OSS_HOST_TYPE_PATH_STYLE) {
+ if ($this->hostType === self::OSS_HOST_TYPE_IP) {
$hostname = $this->hostname;
} elseif ($this->hostType === self::OSS_HOST_TYPE_CNAME) {
$hostname = $this->hostname;
@@ -3325,42 +3268,45 @@ class OssClient
}
/**
- * Gets the Uri path in the current request
+ * Gets the resource Uri in the current request
*
- * @param $bucket
- * @param $object
+ * @param $options
* @return string return the resource uri.
*/
- private function generatePath($bucket, $object)
+ private function generateResourceUri($options)
{
- $paths = array();
- // +bucket
- if ('' !== $bucket) {
- if ($this->hostType === self::OSS_HOST_TYPE_IP || $this->hostType === self::OSS_HOST_TYPE_PATH_STYLE) {
- $paths[] = $bucket;
- if ('' === $object) {
- $paths[] = '';
- }
+ $resource_uri = "";
+
+ // resource_uri + bucket
+ if (isset($options[self::OSS_BUCKET]) && '' !== $options[self::OSS_BUCKET]) {
+ if ($this->hostType === self::OSS_HOST_TYPE_IP) {
+ $resource_uri = '/' . $options[self::OSS_BUCKET];
}
}
- // + object
- if ('' !== $object && '/' !== $object) {
- $paths[] = str_replace(array('%2F'), array('/'), rawurlencode($object));
+
+ // resource_uri + object
+ if (isset($options[self::OSS_OBJECT]) && '/' !== $options[self::OSS_OBJECT]) {
+ $resource_uri .= '/' . str_replace(array('%2F', '%25'), array('/', '%'), rawurlencode($options[self::OSS_OBJECT]));
}
- return '/' . implode('/', $paths);
+
+ // resource_uri + sub_resource
+ $conjunction = '?';
+ if (isset($options[self::OSS_SUB_RESOURCE])) {
+ $resource_uri .= $conjunction . $options[self::OSS_SUB_RESOURCE];
+ }
+ return $resource_uri;
}
/**
- * generates query string
+ * Generates the signalbe query string parameters in array type
*
- * @param mixed $options
- * @return string
+ * @param array $options
+ * @return array
*/
- private function generateQueryString($options)
+ private function generateSignableQueryStringParam($options)
{
- //query parameters
- $query = array();
- $queryList = array(
+ $signableQueryStringParams = array();
+ $signableList = array(
self::OSS_PART_NUM,
'response-content-type',
'response-content-language',
@@ -3384,19 +3330,89 @@ class OssClient
self::OSS_CONTINUATION_TOKEN,
self::OSS_CNAME,
);
- foreach ($queryList as $item) {
+
+ foreach ($signableList as $item) {
if (isset($options[$item])) {
- $query[$item] = $options[$item];
+ $signableQueryStringParams[$item] = $options[$item];
}
}
- if (isset($options[self::OSS_QUERY_STRING])) {
- $query = array_merge($query, $options[self::OSS_QUERY_STRING]);
- }
- if (isset($options[self::OSS_SUB_RESOURCE])) {
- $query[$options[self::OSS_SUB_RESOURCE]] = '';
+
+ if ($this->enableStsInUrl && (!is_null($this->securityToken))) {
+ $signableQueryStringParams["security-token"] = $this->securityToken;
}
- return OssUtil::toQueryString($query);
+ return $signableQueryStringParams;
+ }
+
+ /**
+ * Generates the resource uri for signing
+ *
+ * @param mixed $options
+ * @return string
+ */
+ private function generateSignableResource($options)
+ {
+ $signableResource = "";
+ $signableResource .= '/';
+ if (isset($options[self::OSS_BUCKET]) && '' !== $options[self::OSS_BUCKET]) {
+ $signableResource .= $options[self::OSS_BUCKET];
+ // if there's no object in options, adding a '/' if the host type is not IP.\
+ if ($options[self::OSS_OBJECT] == '/') {
+ if ($this->hostType !== self::OSS_HOST_TYPE_IP) {
+ $signableResource .= "/";
+ }
+ }
+ }
+ //signable_resource + object
+ if (isset($options[self::OSS_OBJECT]) && '/' !== $options[self::OSS_OBJECT]) {
+ $signableResource .= '/' . str_replace(array('%2F', '%25'), array('/', '%'), rawurlencode($options[self::OSS_OBJECT]));
+ }
+ if (isset($options[self::OSS_SUB_RESOURCE])) {
+ $signableResource .= '?' . $options[self::OSS_SUB_RESOURCE];
+ }
+ return $signableResource;
+ }
+
+ /**
+ * generates query string
+ *
+ * @param mixed $options
+ * @return string
+ */
+ private function generateQueryString($options)
+ {
+ //query parameters
+ $queryStringParams = array();
+ if (isset($options[self::OSS_QUERY_STRING])) {
+ $queryStringParams = array_merge($queryStringParams, $options[self::OSS_QUERY_STRING]);
+ }
+ return OssUtil::toQueryString($queryStringParams);
+ }
+
+ private function stringToSignSorted($string_to_sign)
+ {
+ $queryStringSorted = '';
+ $explodeResult = explode('?', $string_to_sign);
+ $index = count($explodeResult);
+ if ($index === 1)
+ return $string_to_sign;
+
+ $queryStringParams = explode('&', $explodeResult[$index - 1]);
+ sort($queryStringParams);
+
+ foreach($queryStringParams as $params)
+ {
+ $queryStringSorted .= $params . '&';
+ }
+
+ $queryStringSorted = substr($queryStringSorted, 0, -1);
+
+ $result = '';
+ for ($i = 0; $i < $index -1; $i++)
+ {
+ $result .= $explodeResult[$i] . '?';
+ }
+ return $result . $queryStringSorted;
}
/**
@@ -3408,24 +3424,20 @@ class OssClient
*/
private function generateHeaders($options, $hostname)
{
- $headers = array();
-
- if (!empty($hostname)) {
- $headers[self::OSS_HOST] = $hostname;
- }
-
- if (isset($options[self::OSS_CONTENT_TYPE])) {
- $headers[self::OSS_CONTENT_TYPE] = $options[self::OSS_CONTENT_TYPE];
- }
-
- if (isset($options[self::OSS_DATE])) {
- $headers[self::OSS_DATE] = $options[self::OSS_DATE];
- }
-
+ $headers = array(
+ self::OSS_CONTENT_MD5 => '',
+ self::OSS_CONTENT_TYPE => isset($options[self::OSS_CONTENT_TYPE]) ? $options[self::OSS_CONTENT_TYPE] : self::DEFAULT_CONTENT_TYPE,
+ self::OSS_DATE => isset($options[self::OSS_DATE]) ? $options[self::OSS_DATE] : gmdate('D, d M Y H:i:s \G\M\T'),
+ self::OSS_HOST => $hostname,
+ );
if (isset($options[self::OSS_CONTENT_MD5])) {
$headers[self::OSS_CONTENT_MD5] = $options[self::OSS_CONTENT_MD5];
}
+ //Add stsSecurityToken
+ if ((!is_null($this->securityToken)) && (!$this->enableStsInUrl)) {
+ $headers[self::OSS_SECURITY_TOKEN] = $this->securityToken;
+ }
//Merge HTTP headers
if (isset($options[self::OSS_HEADERS])) {
$headers = array_merge($headers, $options[self::OSS_HEADERS]);
@@ -3450,7 +3462,6 @@ class OssClient
* @param string $endpoint
* @param boolean $isCName
* @return string The domain name without the protocol schema.
- * @throws OssException
*/
private function checkEndpoint($endpoint, $isCName)
{
@@ -3476,110 +3487,6 @@ class OssClient
return $ret_endpoint;
}
- /**
- * @param Credentials $credential
- * @throws OssException
- */
- private function checkCredentials($credential)
- {
- if (empty($credential)) {
- throw new OssException("credentials is empty.");
- }
- if (strlen($credential->getAccessKeyId()) == 0) {
- throw new OssException("access key id is empty");
- }
- if (strlen($credential->getAccessKeySecret()) == 0) {
- throw new OssException("access key secret is empty");
- }
- }
-
- /**
- * For get Sign Product
- * @return string
- */
- private function getProduct()
- {
- if (!empty($this->cloudBoxId)) {
- return self::OSS_CLOUDBOX_PRODUCT;
- }
- return self::OSS_DEFAULT_PRODUCT;
- }
-
- /**
- * For get Sign Region
- * @return mixed
- */
- private function getRegion()
- {
- if (!empty($this->cloudBoxId)) {
- return $this->cloudBoxId;
- }
- return $this->region;
- }
-
- /**
- * Encodes the file path from UTF-8 to GBK.
- *
- * @param $filepath
- * @return string
- */
- private function encodeFilePath($filepath)
- {
- if ($this->filePathCompatible !== true) {
- return $filepath;
- }
-
- if (empty($filepath)) {
- return $filepath;
- }
-
- try {
- $encoding = array('UTF-8', 'GB2312', 'GBK');
- $encode = mb_detect_encoding($filepath, $encoding);
- if ($encode !== 'UTF-8') {
- return $filepath;
- }
- $tmp = iconv($encode, 'GBK', $filepath);
- if ($tmp !== false) {
- $filepath = $tmp;
- }
- } catch (\Exception $e) {
- //IGNORE
- }
- return $filepath;
- }
-
- /**
- * Decodes the file path from GBK to UTF-8.
- *
- * @param $filepath
- * @return string
- */
- private function decodeFilePath($filepath)
- {
- if ($this->filePathCompatible !== true) {
- return $filepath;
- }
- if (empty($filepath)) {
- return $filepath;
- }
-
- try {
- $encoding = array('UTF-8', 'GB2312', 'GBK');
- $encode = mb_detect_encoding($filepath, $encoding);
- if ($encode === 'UTF-8' || $encode === false) {
- return $filepath;
- }
- $tmp = iconv($encode, 'UTF-8', $filepath);
- if ($tmp !== false) {
- $filepath = $tmp;
- }
- } catch (\Exception $e) {
- //IGNORE
- }
- return $filepath;
- }
-
/**
* Check if all dependent extensions are installed correctly.
* For now only "curl" is needed.
@@ -3633,7 +3540,6 @@ class OssClient
const OSS_BUCKET = 'bucket';
const OSS_OBJECT = 'object';
const OSS_HEADERS = OssUtil::OSS_HEADERS;
- const OSS_ADDITIONAL_HEADERS = 'additionalHeaders';
const OSS_METHOD = 'method';
const OSS_QUERY = 'query';
const OSS_BASENAME = 'basename';
@@ -3668,7 +3574,7 @@ class OssClient
const OSS_IF_NONE_MATCH = 'If-None-Match';
const OSS_CACHE_CONTROL = 'Cache-Control';
const OSS_EXPIRES = 'Expires';
-
+ const OSS_PREAUTH = 'preauth';
const OSS_CONTENT_COING = 'Content-Coding';
const OSS_CONTENT_DISPOSTION = 'Content-Disposition';
const OSS_RANGE = 'range';
@@ -3690,7 +3596,6 @@ class OssClient
const OSS_SUB_RESOURCE = 'sub_resource';
const OSS_DEFAULT_PREFIX = 'x-oss-';
const OSS_CHECK_MD5 = 'checkmd5';
- const OSS_CHECK_OBJECT = 'checkobject';
const DEFAULT_CONTENT_TYPE = 'application/octet-stream';
const OSS_SYMLINK_TARGET = 'x-oss-symlink-target';
const OSS_SYMLINK = 'symlink';
@@ -3743,7 +3648,7 @@ class OssClient
const OSS_ACL_TYPE_PUBLIC_READ_WRITE = 'public-read-write';
const OSS_ENCODING_TYPE = "encoding-type";
const OSS_ENCODING_TYPE_URL = "url";
-
+
const OSS_LIST_TYPE = "list-type";
// Domain Types
@@ -3751,7 +3656,6 @@ class OssClient
const OSS_HOST_TYPE_IP = "ip"; //http://1.1.1.1/bucket/object
const OSS_HOST_TYPE_SPECIAL = 'special'; //http://bucket.guizhou.gov/object
const OSS_HOST_TYPE_CNAME = "cname"; //http://mydomain.com/object
- const OSS_HOST_TYPE_PATH_STYLE = "path-style"; //http://oss-cn-hangzhou.aliyuncs.com/bucket/object
//OSS ACL array
static $OSS_ACL_TYPES = array(
self::OSS_ACL_TYPE_PRIVATE,
@@ -3760,19 +3664,13 @@ class OssClient
);
// OssClient version information
const OSS_NAME = "aliyun-sdk-php";
- const OSS_VERSION = "2.7.2";
- const OSS_BUILD = "20241028";
+ const OSS_VERSION = "2.5.0";
+ const OSS_BUILD = "20220513";
const OSS_AUTHOR = "";
const OSS_OPTIONS_ORIGIN = 'Origin';
const OSS_OPTIONS_REQUEST_METHOD = 'Access-Control-Request-Method';
const OSS_OPTIONS_REQUEST_HEADERS = 'Access-Control-Request-Headers';
- // signatrue version information
- const OSS_SIGNATURE_VERSION_V1 = "v1";
- const OSS_SIGNATURE_VERSION_V4 = "v4";
- const OSS_DEFAULT_PRODUCT = "oss";
- const OSS_CLOUDBOX_PRODUCT = "oss-cloudbox";
-
//use ssl flag
private $useSSL = false;
private $maxRetries = 3;
@@ -3781,22 +3679,11 @@ class OssClient
// user's domain type. It could be one of the four: OSS_HOST_TYPE_NORMAL, OSS_HOST_TYPE_IP, OSS_HOST_TYPE_SPECIAL, OSS_HOST_TYPE_CNAME
private $hostType = self::OSS_HOST_TYPE_NORMAL;
private $requestProxy = null;
- /**
- * @var CredentialsProvider
- */
- private $provider;
+ private $accessKeyId;
+ private $accessKeySecret;
private $hostname;
- private $enableStrictObjName;
+ private $securityToken;
+ private $enableStsInUrl = false;
private $timeout = 0;
private $connectTimeout = 0;
- private $cloudBoxId = null;
- private $region = null;
- /**
- * @var SignerV1|SignerV4
- */
- private $signer;
-
- private $checkObjectEncoding = false;
-
- private $filePathCompatible;
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CreateBucketCnameTokenResult.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CreateBucketCnameTokenResult.php
index a38ca0d51..74bcb8dc4 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CreateBucketCnameTokenResult.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CreateBucketCnameTokenResult.php
@@ -7,7 +7,7 @@ use OSS\Model\CnameTokenInfo;
class CreateBucketCnameTokenResult extends Result
{
/**
- * @return CnameTokenInfo
+ * @return CnameConfig
*/
protected function parseDataFromResponse()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketInfoResult.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketInfoResult.php
index d467851cb..ad55e95bc 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketInfoResult.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketInfoResult.php
@@ -16,7 +16,7 @@ class GetBucketInfoResult extends Result
/**
* Parse data from response
*
- * @return BucketInfo
+ * @return string
* @throws OssException
*/
protected function parseDataFromResponse()
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php
index 5d5bc927d..202a6681d 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php
@@ -7,7 +7,7 @@ use OSS\Model\GetLiveChannelHistory;
class GetLiveChannelHistoryResult extends Result
{
/**
- * @return GetLiveChannelHistory
+ * @return
*/
protected function parseDataFromResponse()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php
index cefe460ab..d5a9005e7 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php
@@ -7,7 +7,7 @@ use OSS\Model\GetLiveChannelInfo;
class GetLiveChannelInfoResult extends Result
{
/**
- * @return GetLiveChannelInfo
+ * @return
*/
protected function parseDataFromResponse()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectVersionsResult.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectVersionsResult.php
index 4503c03d0..849c21c29 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectVersionsResult.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectVersionsResult.php
@@ -2,7 +2,6 @@
namespace OSS\Result;
-use OSS\Core\OssException;
use OSS\Core\OssUtil;
use OSS\Model\ObjectVersionInfo;
use OSS\Model\ObjectVersionListInfo;
@@ -18,12 +17,11 @@ class ListObjectVersionsResult extends Result
/**
* Parse the xml data returned by the ListObjectVersions interface
*
- * @return ObjectVersionListInfo
- * @throws OssException
+ * return ObjectVersionListInfo
*/
protected function parseDataFromResponse()
{
- $xml = simplexml_load_string($this->rawResponse->body);
+ $xml = simplexml_load_string($this->rawResponse->body);
$encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
$objectVersionList = $this->parseObjecVersionList($xml, $encodingType);
$deleteMarkerList = $this->parseDeleteMarkerList($xml, $encodingType);
@@ -42,8 +40,8 @@ class ListObjectVersionsResult extends Result
$delimiter = OssUtil::decodeKey($delimiter, $encodingType);
$isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
- return new ObjectVersionListInfo($bucketName, $prefix, $keyMarker, $nextKeyMarker,
- $versionIdMarker, $nextVersionIdMarker, $maxKeys, $delimiter, $isTruncated,
+ return new ObjectVersionListInfo($bucketName, $prefix, $keyMarker, $nextKeyMarker,
+ $versionIdMarker, $nextVersionIdMarker,$maxKeys, $delimiter, $isTruncated,
$objectVersionList, $deleteMarkerList, $prefixList);
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php
index 124617457..39f1f2927 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php
@@ -2,11 +2,9 @@
namespace OSS\Result;
-use OSS\Core\OssException;
use OSS\Core\OssUtil;
use OSS\Model\ObjectInfo;
use OSS\Model\ObjectListInfo;
-use OSS\Model\Owner;
use OSS\Model\PrefixInfo;
/**
@@ -18,8 +16,7 @@ class ListObjectsResult extends Result
/**
* Parse the xml data returned by the ListObjects interface
*
- * @return ObjectListInfo
- * @throws OssException
+ * return ObjectListInfo
*/
protected function parseDataFromResponse()
{
@@ -53,13 +50,7 @@ class ListObjectsResult extends Result
$type = isset($content->Type) ? strval($content->Type) : "";
$size = isset($content->Size) ? strval($content->Size) : "0";
$storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
- if(isset($content->Owner)){
- $owner = new Owner(strval($content->Owner->ID),strval($content->Owner->DisplayName));
- }else{
- $owner = null;
- }
- $restoreInfo= isset($content->RestoreInfo) ? strval($content->RestoreInfo) : null;
- $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass,$owner,$restoreInfo);
+ $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass);
}
}
return $retList;
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsV2Result.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsV2Result.php
index 8293767d8..882c3c0e3 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsV2Result.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsV2Result.php
@@ -2,11 +2,9 @@
namespace OSS\Result;
-use OSS\Core\OssException;
use OSS\Core\OssUtil;
use OSS\Model\ObjectInfo;
use OSS\Model\ObjectListInfoV2;
-use OSS\Model\Owner;
use OSS\Model\PrefixInfo;
/**
@@ -18,8 +16,7 @@ class ListObjectsV2Result extends Result
/**
* Parse the xml data returned by the ListObjectsV2 interface
*
- * @return ObjectListInfoV2
- * @throws OssException
+ * return ObjectListInfoV2
*/
protected function parseDataFromResponse()
{
@@ -37,7 +34,7 @@ class ListObjectsV2Result extends Result
$continuationToken = isset($xml->ContinuationToken) ? strval($xml->ContinuationToken) : "";
$nextContinuationToken = isset($xml->NextContinuationToken) ? strval($xml->NextContinuationToken) : "";
$startAfter = isset($xml->StartAfter) ? strval($xml->StartAfter) : "";
- $startAfter = OssUtil::decodeKey($startAfter, $encodingType);
+ $startAfter = OssUtil::decodeKey($startAfter, $encodingType);
$keyCount = isset($xml->KeyCount) ? intval($xml->KeyCount) : 0;
return new ObjectListInfoV2($bucketName, $prefix, $maxKeys, $delimiter, $isTruncated, $objectList, $prefixList, $continuationToken, $nextContinuationToken, $startAfter, $keyCount);
}
@@ -54,13 +51,7 @@ class ListObjectsV2Result extends Result
$type = isset($content->Type) ? strval($content->Type) : "";
$size = isset($content->Size) ? strval($content->Size) : "0";
$storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
- if(isset($content->Owner)){
- $owner = new Owner(strval($content->Owner->ID),strval($content->Owner->DisplayName));
- }else{
- $owner = null;
- }
- $restoreInfo= isset($content->RestoreInfo) ? strval($content->RestoreInfo) : null;
- $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass,$owner,$restoreInfo);
+ $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass);
}
}
return $retList;
diff --git a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php
index 597ac5a6b..e5d83d377 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php
@@ -109,29 +109,10 @@ abstract class Result
if (empty($body) || false === strpos($body, 'Message)) {
- return strval($xml->Message);
- }
- $flag = true;
- } catch (\Exception $e) {
- $flag = true;
+ $xml = simplexml_load_string($body);
+ if (isset($xml->Message)) {
+ return strval($xml->Message);
}
- if ($flag === true) {
- $start = strpos($body, '');
- if ($start === false) {
- return '';
- }
- $start += 9;
- $end = strpos($body, '', $start);
- if ($end === false) {
- return '';
- }
- return substr($body, $start, $end - $start);
- }
-
return '';
}
@@ -146,29 +127,10 @@ abstract class Result
if (empty($body) || false === strpos($body, 'Code)) {
- return strval($xml->Code);
- }
- $flag = true;
- } catch (\Exception $e) {
- $flag = true;
+ $xml = simplexml_load_string($body);
+ if (isset($xml->Code)) {
+ return strval($xml->Code);
}
- if ($flag === true) {
- $start = strpos($body, '');
- if ($start === false) {
- return '';
- }
- $start += 6;
- $end = strpos($body, '', $start);
- if ($end === false) {
- return '';
- }
- return substr($body, $start, $end - $start);
- }
-
return '';
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketCnameTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketCnameTest.php
index 290f58529..03b016f49 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketCnameTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketCnameTest.php
@@ -4,7 +4,6 @@ namespace OSS\Tests;
require_once __DIR__ . '/Common.php';
-use OSS\Core\OssException;
use OSS\Model\CnameConfig;
class BucketCnameTest extends \PHPUnit\Framework\TestCase
@@ -32,34 +31,47 @@ class BucketCnameTest extends \PHPUnit\Framework\TestCase
public function testAddCname()
{
- try {
- $this->client->addBucketCname($this->bucketName, 'www.baidu.com');
- } catch (OssException $e) {
- print_r($e->getMessage());
- $this->assertTrue(true);
- }
+ $this->client->addBucketCname($this->bucketName, 'www.baidu.com');
+ $this->client->addBucketCname($this->bucketName, 'www.qq.com');
- try {
- $ret = $this->client->getBucketCname($this->bucketName);
- $this->assertEquals(0, count($ret->getCnames()));
- } catch (OssException $e) {
- $this->assertTrue(false);
+ $ret = $this->client->getBucketCname($this->bucketName);
+ $this->assertEquals(2, count($ret->getCnames()));
+
+ // add another 2 cnames
+ $this->client->addBucketCname($this->bucketName, 'www.sina.com.cn');
+ $this->client->addBucketCname($this->bucketName, 'www.iqiyi.com');
+
+ $ret = $this->client->getBucketCname($this->bucketName);
+ $cnames = $ret->getCnames();
+ $cnameList = array();
+
+ foreach ($cnames as $c) {
+ $cnameList[] = $c['Domain'];
}
+ $should = array(
+ 'www.baidu.com',
+ 'www.qq.com',
+ 'www.sina.com.cn',
+ 'www.iqiyi.com'
+ );
+ $this->assertEquals(4, count($cnames));
+ $this->assertEquals(sort($should), sort($cnameList));
}
public function testDeleteCname()
{
- try {
- $this->client->deleteBucketCname($this->bucketName, 'www.not-exist.com');
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
+ $this->client->addBucketCname($this->bucketName, 'www.baidu.com');
+ $this->client->addBucketCname($this->bucketName, 'www.qq.com');
- try {
- $ret = $this->client->getBucketCname($this->bucketName);
- $this->assertEquals(0, count($ret->getCnames()));
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
+ $ret = $this->client->getBucketCname($this->bucketName);
+ $this->assertEquals(2, count($ret->getCnames()));
+
+ // delete one cname
+ $this->client->deleteBucketCname($this->bucketName, 'www.baidu.com');
+
+ $ret = $this->client->getBucketCname($this->bucketName);
+ $this->assertEquals(1, count($ret->getCnames()));
+ $cnames = $ret->getCnames();
+ $this->assertEquals('www.qq.com', $cnames[0]['Domain']);
}
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketLiveChannelTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketLiveChannelTest.php
index dacae0b80..cedf884d4 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketLiveChannelTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketLiveChannelTest.php
@@ -14,14 +14,10 @@ class BucketLiveChannelTest extends \PHPUnit\Framework\TestCase
protected function setUp(): void
{
- try {
- $this->client = Common::getOssClient();
- $this->bucketName = 'php-sdk-test-rtmp-bucket-name-' . strval(rand(0, 10000));
- $this->client->createBucket($this->bucketName);
- Common::waitMetaSync();
- }catch(\Exception $e) {
-
- }
+ $this->client = Common::getOssClient();
+ $this->bucketName = 'php-sdk-test-rtmp-bucket-name-' . strval(rand(0, 10000));
+ $this->client->createBucket($this->bucketName);
+ Common::waitMetaSync();
}
protected function tearDown(): void
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CallbackTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CallbackTest.php
index feb080105..31df548d8 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CallbackTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CallbackTest.php
@@ -44,26 +44,27 @@ class CallbackTest extends TestOssClientBase
/**
* step 3.
*/
- $json =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ $json =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size},\"x:var1\":${x:var1},\"x:var2\":${x:var2}}",
"callbackBodyType":"application/json"
}';
-
- $var =
- '{
+
+ $var =
+ '{
"x:var1":"value1",
"x:var2":"值2"
}';
- $options = array(OssClient::OSS_CALLBACK => $json,
- OssClient::OSS_CALLBACK_VAR => $var
- );
+ $options = array(OssClient::OSS_CALLBACK => $json,
+ OssClient::OSS_CALLBACK_VAR => $var
+ );
try {
$result = $this->ossClient->completeMultipartUpload($this->bucket, $object, $upload_id, $upload_parts, $options);
$this->assertEquals("200", $result['info']['http_code']);
+ $this->assertEquals("{\"Status\":\"OK\"}", $result['body']);
} catch (OssException $e) {
$this->assertTrue(false);
}
@@ -103,24 +104,24 @@ class CallbackTest extends TestOssClientBase
/**
* step 3.
*/
-
- $json =
- '{
+
+ $json =
+ '{
"callbackUrl":"www.baidu.com",
"callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size},\"x:var1\":${x:var1},\"x:var2\":${x:var2}}",
"callbackBodyType":"application/json"
}';
-
- $var =
- '{
+
+ $var =
+ '{
"x:var1":"value1",
"x:var2":"值2"
}';
- $options = array(OssClient::OSS_CALLBACK => $json,
- OssClient::OSS_CALLBACK_VAR => $var
- );
-
+ $options = array(OssClient::OSS_CALLBACK => $json,
+ OssClient::OSS_CALLBACK_VAR => $var
+ );
+
try {
$result = $this->ossClient->completeMultipartUpload($this->bucket, $object, $upload_id, $upload_parts, $options);
$this->assertTrue(false);
@@ -130,39 +131,39 @@ class CallbackTest extends TestOssClientBase
}
}
-
+
public function testPutObjectCallbackNormal()
{
//json
{
- $json =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ $json =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size}}",
"callbackBodyType":"application/json"
}';
$options = array(OssClient::OSS_CALLBACK => $json);
$this->putObjectCallbackOk($options, "200");
- }
- //url
- {
- $url =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ }
+ //url
+ {
+ $url =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.height=${imageInfo.height}&imageInfo.width=${imageInfo.width}&imageInfo.format=${imageInfo.format}",
"callbackBodyType":"application/x-www-form-urlencoded"
}';
$options = array(OssClient::OSS_CALLBACK => $url);
$this->putObjectCallbackOk($options, "200");
- }
+ }
// Unspecified typre
- {
- $url =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ {
+ $url =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.height=${imageInfo.height}&imageInfo.width=${imageInfo.width}&imageInfo.format=${imageInfo.format}"
}';
$options = array(OssClient::OSS_CALLBACK => $url);
@@ -170,10 +171,10 @@ class CallbackTest extends TestOssClientBase
}
//json and body is chinese
{
- $json =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ $json =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"{\" 春水碧于天,画船听雨眠。\":\"垆边人似月,皓腕凝霜雪。\"}",
"callbackBodyType":"application/json"
}';
@@ -182,10 +183,10 @@ class CallbackTest extends TestOssClientBase
}
//url and body is chinese
{
- $url =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ $url =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"春水碧于天,画船听雨眠。垆边人似月,皓腕凝霜雪",
"callbackBodyType":"application/x-www-form-urlencoded"
}';
@@ -194,51 +195,51 @@ class CallbackTest extends TestOssClientBase
}
//json and add callback_var
{
- $json =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ $json =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size},\"x:var1\":${x:var1},\"x:var2\":${x:var2}}",
"callbackBodyType":"application/json"
}';
-
- $var =
- '{
+
+ $var =
+ '{
"x:var1":"value1",
"x:var2":"aliyun.com"
}';
$options = array(OssClient::OSS_CALLBACK => $json,
- OssClient::OSS_CALLBACK_VAR => $var
- );
+ OssClient::OSS_CALLBACK_VAR => $var
+ );
$this->putObjectCallbackOk($options, "200");
}
//url and add callback_var
{
- $url =
- '{
- "callbackUrl":"' . Common::getCallbackUrl() . '",' .
- ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
+ $url =
+ '{
+ "callbackUrl":"'.Common::getCallbackUrl().'",'.
+ ' "callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.height=${imageInfo.height}&imageInfo.width=${imageInfo.width}&imageInfo.format=${imageInfo.format}&my_var1=${x:var1}&my_var2=${x:var2}",
"callbackBodyType":"application/x-www-form-urlencoded"
}';
- $var =
- '{
+ $var =
+ '{
"x:var1":"value1凌波不过横塘路,但目送,芳",
"x:var2":"值2"
}';
$options = array(OssClient::OSS_CALLBACK => $url,
- OssClient::OSS_CALLBACK_VAR => $var
- );
+ OssClient::OSS_CALLBACK_VAR => $var
+ );
$this->putObjectCallbackOk($options, "200");
}
}
public function testPutCallbackWithCallbackFailed()
- {
+ {
{
- $json =
- '{
+ $json =
+ '{
"callbackUrl":"http://www.baidu.com",
"callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"{\"mimeType\":${mimeType},\"size\":${size}}",
@@ -249,13 +250,13 @@ class CallbackTest extends TestOssClientBase
}
{
- $url =
- '{
+ $url =
+ '{
"callbackUrl":"http://www.baidu.com",
"callbackHost":"oss-cn-hangzhou.aliyuncs.com",
"callbackBody":"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&imageInfo.height=${imageInfo.height}&imageInfo.width=${imageInfo.width}&imageInfo.format=${imageInfo.format}&my_var1=${x:var1}&my_var2=${x:var2}",
"callbackBodyType":"application/x-www-form-urlencoded"
- }';
+ }';
$options = array(OssClient::OSS_CALLBACK => $url);
$this->putObjectCallbackFailed($options, "203");
}
@@ -269,6 +270,7 @@ class CallbackTest extends TestOssClientBase
try {
$result = $this->ossClient->putObject($this->bucket, $object, $content, $options);
$this->assertEquals($status, $result['info']['http_code']);
+ $this->assertEquals("{\"Status\":\"OK\"}", $result['body']);
} catch (OssException $e) {
$this->assertFalse(true);
}
@@ -290,8 +292,5 @@ class CallbackTest extends TestOssClientBase
protected function setUp(): void
{
parent::setUp();
- if (strlen(Common::getCallbackUrl()) == 0) {
- throw new OssException("callback url can not be empty!");
- }
}
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/Common.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/Common.php
index 5b76a76a4..152894481 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/Common.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/Common.php
@@ -3,11 +3,9 @@
namespace OSS\Tests;
require_once __DIR__ . '/../../../autoload.php';
-require_once __DIR__ . DIRECTORY_SEPARATOR . 'StsClient.php';
use OSS\OssClient;
use OSS\Core\OssException;
-use OSS\Credentials\StaticCredentialsProvider;
/**
* Class Common
@@ -21,121 +19,34 @@ class Common
*
* @return OssClient An OssClient instance
*/
- public static function getOssClient($conf = NULL)
+ public static function getOssClient()
{
try {
- $provider = new StaticCredentialsProvider(
- getenv('OSS_ACCESS_KEY_ID'),
- getenv('OSS_ACCESS_KEY_SECRET')
- );
- $config = array(
- 'region' => self::getRegion(),
- 'endpoint' => self::getEndpoint(),
- 'provider' => $provider,
- 'signatureVersion' => self::getSignVersion()
- );
-
- if ($conf != null) {
- foreach ($conf as $key => $value) {
- $config[$key] = $value;
- }
- }
-
- $ossClient = new OssClient($config);
-
- } catch (OssException $e) {
- printf(__FUNCTION__ . "creating OssClient instance: FAILED\n");
- printf($e->getMessage() . "\n");
- }
- return $ossClient;
- }
-
- public static function getStsOssClient($conf = NULL)
- {
- $stsClient = new StsClient();
- $assumeRole = new AssumeRole();
- $stsClient->AccessSecret = getenv('OSS_ACCESS_KEY_SECRET');
- $assumeRole->AccessKeyId = getenv('OSS_ACCESS_KEY_ID');
- $assumeRole->RoleArn = getenv('OSS_TEST_RAM_ROLE_ARN');
- $params = $assumeRole->getAttributes();
- $response = $stsClient->doAction($params);
-
- try {
- $provider = new StaticCredentialsProvider(
- $response->Credentials->AccessKeyId,
- $response->Credentials->AccessKeySecret,
- $response->Credentials->SecurityToken
- );
- $config = array(
- 'region' => self::getRegion(),
- 'endpoint' => self::getEndpoint(),
- 'provider' => $provider,
- 'signatureVersion' => self::getSignVersion()
- );
-
- if ($conf != null) {
- foreach ($conf as $key => $value) {
- $config[$key] = $value;
- }
- }
-
- $ossStsClient = new OssClient($config);
-
+ $ossClient = new OssClient(
+ getenv('OSS_ACCESS_KEY_ID'),
+ getenv('OSS_ACCESS_KEY_SECRET'),
+ getenv('OSS_ENDPOINT'), false);
} catch (OssException $e) {
printf(__FUNCTION__ . "creating OssClient instance: FAILED\n");
printf($e->getMessage() . "\n");
return null;
}
- return $ossStsClient;
+ return $ossClient;
}
public static function getBucketName()
{
- $name = getenv('OSS_BUCKET');
- if (empty($name)) {
- return "skyranch-php-test";
- }
- return $name;
+ return getenv('OSS_BUCKET');
}
public static function getRegion()
{
- return getenv('OSS_TEST_REGION');
- }
-
- public static function getEndpoint()
- {
- return getenv('OSS_TEST_ENDPOINT');
+ return getenv('OSS_REGION');
}
public static function getCallbackUrl()
{
- return getenv('OSS_TEST_CALLBACK_URL');
- }
-
- public static function getPayerUid()
- {
- return getenv('OSS_TEST_PAYER_UID');
- }
-
- public static function getPayerAccessKeyId()
- {
- return getenv('OSS_TEST_PAYER_ACCESS_KEY_ID');
- }
-
- public static function getPayerAccessKeySecret()
- {
- return getenv('OSS_TEST_PAYER_ACCESS_KEY_SECRET');
- }
-
- public static function getSignVersion()
- {
- return OssClient::OSS_SIGNATURE_VERSION_V1;
- }
-
- public static function getPathStyleBucket()
- {
- return getenv('OSS_TEST_PATHSTYLE_BUCKET');
+ return getenv('OSS_CALLBACK_URL');
}
/**
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ContentTypeTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ContentTypeTest.php
index 98c59981b..66b405775 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ContentTypeTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ContentTypeTest.php
@@ -2,14 +2,19 @@
namespace OSS\Tests;
-use OSS\Core\OssUtil;
-use OSS\OssClient;
-
require_once __DIR__ . '/Common.php';
-require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
class ContentTypeTest extends TestOssClientBase
{
+ private function runCmd($cmd)
+ {
+ $output = array();
+ $status = 0;
+ exec($cmd . ' 2>/dev/null', $output, $status);
+
+ $this->assertEquals(0, $status);
+ }
+
private function getContentType($bucket, $object)
{
$client = $this->ossClient;
@@ -22,22 +27,22 @@ class ContentTypeTest extends TestOssClientBase
$client = $this->ossClient;
$bucket = $this->bucket;
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.html';
+ $file = '/tmp/x.html';
$object = 'test/x';
- OssUtil::generateFile($file, 5);
+ $this->runCmd('touch ' . $file);
$client->uploadFile($bucket, $object, $file);
$type = $this->getContentType($bucket, $object);
- $this->assertEquals('text/html', $type);
- unlink($file);
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.json';
+ $this->assertEquals('text/html', $type);
+
+ $file = '/tmp/x.json';
$object = 'test/y';
- OssUtil::generateFile($file, 100 * 1024);
+ $this->runCmd('dd if=/dev/urandom of=' . $file . ' bs=1024 count=100');
$client->multiuploadFile($bucket, $object, $file, array('partSize' => 100));
$type = $this->getContentType($bucket, $object);
- unlink($file);
+
$this->assertEquals('application/json', $type);
}
@@ -49,37 +54,43 @@ class ContentTypeTest extends TestOssClientBase
$object = "test/x.txt";
$client->putObject($bucket, $object, "hello world");
$type = $this->getContentType($bucket, $object);
+
$this->assertEquals('text/plain', $type);
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.html';
+ $file = '/tmp/x.html';
$object = 'test/x.txt';
- OssUtil::generateFile($file, 5);
+ $this->runCmd('touch ' . $file);
+
$client->uploadFile($bucket, $object, $file);
- unlink($file);
$type = $this->getContentType($bucket, $object);
+
$this->assertEquals('text/html', $type);
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.none';
+ $file = '/tmp/x.none';
$object = 'test/x.txt';
- OssUtil::generateFile($file, 5);
+ $this->runCmd('touch ' . $file);
+
$client->uploadFile($bucket, $object, $file);
- unlink($file);
$type = $this->getContentType($bucket, $object);
+
$this->assertEquals('text/plain', $type);
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.mp3';
- OssUtil::generateFile($file, 1024 * 100);
+ $file = '/tmp/x.mp3';
$object = 'test/y.json';
+ $this->runCmd('dd if=/dev/urandom of=' . $file . ' bs=1024 count=100');
+
$client->multiuploadFile($bucket, $object, $file, array('partSize' => 100));
- unlink($file);
$type = $this->getContentType($bucket, $object);
+
$this->assertEquals('audio/mpeg', $type);
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.none';
- OssUtil::generateFile($file, 1024 * 100);
+
+ $file = '/tmp/x.none';
$object = 'test/y.json';
+ $this->runCmd('dd if=/dev/urandom of=' . $file . ' bs=1024 count=100');
+
$client->multiuploadFile($bucket, $object, $file, array('partSize' => 100));
- unlink($file);
$type = $this->getContentType($bucket, $object);
+
$this->assertEquals('application/json', $type);
}
@@ -96,28 +107,27 @@ class ContentTypeTest extends TestOssClientBase
$this->assertEquals('text/html', $type);
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.html';
+ $file = '/tmp/x.html';
$object = 'test/x';
- OssUtil::generateFile($file, 100);
+ $this->runCmd('touch ' . $file);
- $client->uploadFile($bucket, $object, $file, array(OssClient::OSS_HEADERS => array(
+ $client->uploadFile($bucket, $object, $file, array(
'Content-Type' => 'application/json'
- )));
- unlink($file);
+ ));
$type = $this->getContentType($bucket, $object);
$this->assertEquals('application/json', $type);
- $file = __DIR__ . DIRECTORY_SEPARATOR . 'x.json';
+ $file = '/tmp/x.json';
$object = 'test/y';
- OssUtil::generateFile($file, 100 * 1024);
+ $this->runCmd('dd if=/dev/urandom of=' . $file . ' bs=1024 count=100');
$client->multiuploadFile($bucket, $object, $file, array(
'partSize' => 100,
'Content-Type' => 'audio/mpeg'
));
- unlink($file);
$type = $this->getContentType($bucket, $object);
+
$this->assertEquals('audio/mpeg', $type);
}
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CorsConfigTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CorsConfigTest.php
index 42a46fa8e..3329b1af8 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CorsConfigTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CorsConfigTest.php
@@ -3,12 +3,9 @@
namespace OSS\Tests;
-use OSS\Http\ResponseCore;
use OSS\Model\CorsConfig;
use OSS\Model\CorsRule;
use OSS\Core\OssException;
-use OSS\Result\GetCorsResult;
-use OSS\Result\Result;
class CorsConfigTest extends \PHPUnit\Framework\TestCase
{
@@ -38,7 +35,6 @@ class CorsConfigTest extends \PHPUnit\Framework\TestCase
x-oss-test1
110
-false
BBBB;
@@ -62,23 +58,6 @@ BBBB;
10
-BBBB;
-
- private $validXml3 = <<
-
-
-http://www.b.com
-http://www.a.com
-http://www.a.com
-GET
-PUT
-POST
-x-oss-test
-10
-
-true
-
BBBB;
public function testParseValidXml()
@@ -102,56 +81,6 @@ BBBB;
$this->assertEquals($this->cleanXml($this->validXml2), $this->cleanXml($corsConfig->serializeToXml()));
}
- public function testParseValidXml3()
- {
- $corsConfig = new CorsConfig();
- $corsConfig->parseFromXml($this->validXml3);
- $this->assertEquals($this->cleanXml($this->validXml3), $this->cleanXml($corsConfig->serializeToXml()));
- $this->assertTrue($corsConfig->getResponseVary());
- }
-
- public function testResponseValidXml3()
- {
- $response = new ResponseCore(array(), $this->validXml, 200);
- $result = new GetCorsResult($response);
- $this->assertTrue($result->isOK());
- $this->assertNotNull($result->getData());
- $this->assertNotNull($result->getRawResponse());
- $this->assertNotNull($result->getRawResponse()->body);
- $corsConfig = $result->getData();
- $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($corsConfig->serializeToXml()));
- $this->assertNotNull($corsConfig->getRules());
- $rules = $corsConfig->getRules();
- $this->assertNotNull($rules[0]->getAllowedHeaders());
- $this->assertNotNull($rules[0]->getAllowedMethods());
- $this->assertNotNull($rules[0]->getAllowedOrigins());
- $this->assertNotNull($rules[0]->getExposeHeaders());
- $this->assertNotNull($rules[0]->getMaxAgeSeconds());
- $this->assertFalse($corsConfig->getResponseVary());
-
- }
-
- public function testResponseValidXml4()
- {
- $response = new ResponseCore(array(), $this->validXml3, 200);
- $result = new GetCorsResult($response);
- $this->assertTrue($result->isOK());
- $this->assertNotNull($result->getData());
- $this->assertNotNull($result->getRawResponse());
- $this->assertNotNull($result->getRawResponse()->body);
- $corsConfig = $result->getData();
- $this->assertEquals($this->cleanXml($this->validXml3), $this->cleanXml($corsConfig->serializeToXml()));
- $this->assertNotNull($corsConfig->getRules());
- $rules = $corsConfig->getRules();
- $this->assertNotNull($rules[0]->getAllowedHeaders());
- $this->assertNotNull($rules[0]->getAllowedMethods());
- $this->assertNotNull($rules[0]->getAllowedOrigins());
- $this->assertNotNull($rules[0]->getExposeHeaders());
- $this->assertNotNull($rules[0]->getMaxAgeSeconds());
- $this->assertTrue($corsConfig->getResponseVary());
-
- }
-
public function testCreateCorsConfigFromMoreThan10Rules()
{
$corsConfig = new CorsConfig();
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/DeleteObjectVersionsResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/DeleteObjectVersionsResultTest.php
index 2419e55e5..890b1a5d6 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/DeleteObjectVersionsResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/DeleteObjectVersionsResultTest.php
@@ -10,79 +10,79 @@ class DeleteObjectVersionsResultTest extends \PHPUnit\Framework\TestCase
{
private $validXml = <<
-
-
- demo.jpg
- CAEQNRiBgICEoPiC0BYiIGMxZWJmYmMzYjE0OTQ0ZmZhYjgzNzkzYjc2NjZk****
- true
- 111111
-
-
-BBBB;
+
+
+
+ demo.jpg
+ CAEQNRiBgICEoPiC0BYiIGMxZWJmYmMzYjE0OTQ0ZmZhYjgzNzkzYjc2NjZk****
+ true
+ 111111
+
+
+ BBBB;
private $validXml1 = <<
-
-
- multipart.data
- CAEQNRiBgIDyz.6C0BYiIGQ2NWEwNmVhNTA3ZTQ3MzM5ODliYjM1ZTdjYjA4****
-
-
-BBBB;
+
+
+
+ multipart.data
+ CAEQNRiBgIDyz.6C0BYiIGQ2NWEwNmVhNTA3ZTQ3MzM5ODliYjM1ZTdjYjA4****
+
+
+ BBBB;
private $validXml2 = <<
-
-
- multipart.data
- true
- CAEQMhiBgIDXiaaB0BYiIGQzYmRkZGUxMTM1ZDRjOTZhNjk4YjRjMTAyZjhl****
-
-
- test.jpg
- true
- CAEQMhiBgIDB3aWB0BYiIGUzYTA3YzliMzVmNzRkZGM5NjllYTVlMjYyYWEy****
-
-
-BBBB;
+
+
+
+ multipart.data
+ true
+ CAEQMhiBgIDXiaaB0BYiIGQzYmRkZGUxMTM1ZDRjOTZhNjk4YjRjMTAyZjhl****
+
+
+ test.jpg
+ true
+ CAEQMhiBgIDB3aWB0BYiIGUzYTA3YzliMzVmNzRkZGM5NjllYTVlMjYyYWEy****
+
+
+ BBBB;
private $validXml3 = <<
-
-
- multipart.data
-
-
- test.jpg
-
-
- demo.jpg
-
-
-BBBB;
+
+
+
+ multipart.data
+
+
+ test.jpg
+
+
+ demo.jpg
+
+
+ BBBB;
private $validXml4 = <<
-
- url
-
- multipart%2F.data
-
-
- test%2F.jpg
-
-
- demo%2F.jpg
-
-
-BBBB;
-
+
+
+ url
+
+ multipart%2F.data
+
+
+ test%2F.jpg
+
+
+ demo%2F.jpg
+
+
+ BBBB;
+
private $invalidXml = <<
-
-
-BBBB;
+
+
+
+ BBBB;
public function testParseValidXml()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketEncryptionResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketEncryptionResultTest.php
index 87e499674..6f0e0d279 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketEncryptionResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketEncryptionResultTest.php
@@ -10,39 +10,39 @@ class GetBucketEncryptionResultTest extends \PHPUnit\Framework\TestCase
{
private $validXml = <<
-
-
- AES256
-
-
-
-BBBB;
+
+
+
+ AES256
+
+
+
+ BBBB;
private $validXml1 = <<
-
-
- KMS
- kms-id
-
-
-BBBB;
+
+
+
+ KMS
+ kms-id
+
+
+ BBBB;
private $validXml2 = <<
-
-
-KMS
-
-
-BBBB;
+
+
+
+ KMS
+
+
+ BBBB;
private $invalidXml = <<
-
-
-BBBB;
+
+
+
+ BBBB;
public function testParseValidXml()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketRequestPaymentResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketRequestPaymentResultTest.php
index 227028b90..2de08be6d 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketRequestPaymentResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketRequestPaymentResultTest.php
@@ -10,24 +10,24 @@ class GetBucketRequestPaymentResultTest extends \PHPUnit\Framework\TestCase
{
private $validXml = <<
-
- Requester
-
-BBBB;
-
+
+
+ Requester
+
+ BBBB;
+
private $validXml2 = <<
-
- BucketOwner
-
-BBBB;
+
+
+ BucketOwner
+
+ BBBB;
private $invalidXml = <<
-
-
-BBBB;
+
+
+
+ BBBB;
public function testParseValidXml()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketStatResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketStatResultTest.php
index 74cb04ab7..967e65d13 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketStatResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketStatResultTest.php
@@ -9,33 +9,20 @@ use OSS\Http\ResponseCore;
class GetBucketStatResultTest extends \PHPUnit\Framework\TestCase
{
-private $validXml = <<
-
- 1600
- 230
- 40
- 4
- 1643341269
- 430
- 66
- 2359296
- 360
- 54
- 2949120
- 450
- 74
- 2359296
- 360
- 36
-
-BBBB;
+ private $validXml = <<
+
+ 100
+ 200
+ 10
+
+ BBBB;
-private $invalidXml = <<
-
-
-BBBB;
+ private $invalidXml = <<
+
+
+ BBBB;
public function testParseValidXml()
{
@@ -45,22 +32,9 @@ BBBB;
$this->assertNotNull($result->getData());
$this->assertNotNull($result->getRawResponse());
$stat = $result->getData();
- $this->assertEquals(1600, $stat->getStorage());
- $this->assertEquals(230, $stat->getObjectCount());
- $this->assertEquals(40, $stat->getMultipartUploadCount());
- $this->assertEquals(4, $stat->getLiveChannelCount());
- $this->assertEquals(1643341269, $stat->getLastModifiedTime());
- $this->assertEquals(430, $stat->getStandardStorage());
- $this->assertEquals(66, $stat->getStandardObjectCount());
- $this->assertEquals(2359296, $stat->getInfrequentAccessStorage());
- $this->assertEquals(360, $stat->getInfrequentAccessRealStorage());
- $this->assertEquals(54, $stat->getInfrequentAccessObjectCount());
- $this->assertEquals(2949120, $stat->getArchiveStorage());
- $this->assertEquals(450, $stat->getArchiveRealStorage());
- $this->assertEquals(74, $stat->getArchiveObjectCount());
- $this->assertEquals(2359296, $stat->getColdArchiveStorage());
- $this->assertEquals(360, $stat->getColdArchiveRealStorage());
- $this->assertEquals(36, $stat->getColdArchiveObjectCount());
+ $this->assertEquals(100, $stat->getStorage());
+ $this->assertEquals(200, $stat->getObjectCount());
+ $this->assertEquals(10, $stat->getMultipartUploadCount());
}
public function testParseNullXml()
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketTagsResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketTagsResultTest.php
index b2923092a..f4b2a8895 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketTagsResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketTagsResultTest.php
@@ -9,34 +9,34 @@ use OSS\Http\ResponseCore;
class GetBucketTagsResultTest extends \PHPUnit\Framework\TestCase
{
private $validXml = <<
-
-
-
- testa
- value1-test
-
-
- testb
- value2-test
-
-
-
-BBBB;
+
+
+
+
+ testa
+ value1-test
+
+
+ testb
+ value2-test
+
+
+
+ BBBB;
private $invalidXml = <<
-
-
-BBBB;
+
+
+
+ BBBB;
private $invalidXml2 = <<
-
-
-
-
-BBBB;
+
+
+
+
+
+ BBBB;
public function testParseValidXml()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketWormResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketWormResultTest.php
index 3bb90daa7..4d5d91297 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketWormResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetBucketWormResultTest.php
@@ -10,30 +10,30 @@ class GetBucketWormResultTest extends \PHPUnit\Framework\TestCase
{
private $validXml = <<
-
-ID1
-Locked
-1
-2018-08-14T15:50:32
-
-BBBB;
-
- private $validXml2 = <<
-
- ID2
- InProgress
- 10
- 2018-09-14T15:50:32
-
-BBBB;
+
+
+ ID1
+ Locked
+ 1
+ 2018-08-14T15:50:32
+
+ BBBB;
+
+ private $validXml2 = <<
+
+ ID2
+ InProgress
+ 10
+ 2018-09-14T15:50:32
+
+ BBBB;
private $invalidXml = <<
-
-
-BBBB;
+
+
+
+ BBBB;
public function testParseValidXml()
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListBucketsResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListBucketsResultTest.php
index 959b0114e..634f97d3a 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListBucketsResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListBucketsResultTest.php
@@ -42,53 +42,6 @@ BBBB;
BBBB;
-
- private $errorBody = <<< BBBB
-
-
- NoSuchBucket
- The specified bucket does not exist.
- 566B870D207FB3044302EB0A
- hello.oss-test.aliyun-inc.com
- hello
-
-BBBB;
-
- private $xml = <<
-
-
- ut_test_put_bucket
- ut_test_put_bucket
-
-
-
- 2015-12-17T18:12:43.000Z
- oss-cn-shanghai.aliyuncs.com
- oss-cn-shanghai-internal.aliyuncs.com
- oss-cn-shanghai
- app-base-oss
- cn-shanghai
- Standard
-
-
- 2014-12-25T11:21:04.000Z
- oss-cn-hangzhou.aliyuncs.com
- oss-cn-hangzhou-internal.aliyuncs.com
- oss-cn-hangzhou
- atestleo23
- cn-hangzhou
- IA
-
-
- 2014-12-25T11:21:04.000Z
- oss-cn-hangzhou
- atestleo23
-
-
-
-BBBB;
-
public function testParseValidXml()
{
$response = new ResponseCore(array(), $this->validXml, 200);
@@ -116,7 +69,18 @@ BBBB;
$errorHeader = array(
'x-oss-request-id' => '1a2b-3c4d'
);
- $response = new ResponseCore($errorHeader, $this->errorBody, 403);
+
+ $errorBody = <<< BBBB
+
+
+ NoSuchBucket
+ The specified bucket does not exist.
+ 566B870D207FB3044302EB0A
+ hello.oss-test.aliyun-inc.com
+ hello
+
+ BBBB;
+ $response = new ResponseCore($errorHeader, $errorBody, 403);
try {
new ListBucketsResult($response);
} catch (OssException $e) {
@@ -127,13 +91,48 @@ BBBB;
$this->assertEquals($e->getRequestId(), '1a2b-3c4d');
$this->assertEquals($e->getErrorCode(), 'NoSuchBucket');
$this->assertEquals($e->getErrorMessage(), 'The specified bucket does not exist.');
- $this->assertEquals($e->getDetails(), $this->errorBody);
+ $this->assertEquals($e->getDetails(), $errorBody);
}
}
public function testParseXml2()
{
- $response = new ResponseCore(array(), $this->xml, 200);
+ $xml = <<
+
+
+ ut_test_put_bucket
+ ut_test_put_bucket
+
+
+
+ 2015-12-17T18:12:43.000Z
+ oss-cn-shanghai.aliyuncs.com
+ oss-cn-shanghai-internal.aliyuncs.com
+ oss-cn-shanghai
+ app-base-oss
+ cn-shanghai
+ Standard
+
+
+ 2014-12-25T11:21:04.000Z
+ oss-cn-hangzhou.aliyuncs.com
+ oss-cn-hangzhou-internal.aliyuncs.com
+ oss-cn-hangzhou
+ atestleo23
+ cn-hangzhou
+ IA
+
+
+ 2014-12-25T11:21:04.000Z
+ oss-cn-hangzhou
+ atestleo23
+
+
+
+ BBBB;
+
+ $response = new ResponseCore(array(), $xml, 200);
$result = new ListBucketsResult($response);
$this->assertTrue($result->isOK());
$this->assertNotNull($result->getData());
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectVersionsResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectVersionsResultTest.php
index 7fdfd7e7d..8ddbdaa1b 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectVersionsResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectVersionsResultTest.php
@@ -10,106 +10,106 @@ class ListObjectVersionsResultTest extends \PHPUnit\Framework\TestCase
{
private $validXml = <<
-
- oss-example
-
- example
- CAEQMxiBgICbof2D0BYiIGRhZjgwMzJiMjA3MjQ0ODE5MWYxZDYwMzJlZjU1****
- 100
-
- false
-
- example
- CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****
- false
- 2019-04-09T07:27:28.000Z
-
- 1234512528586****
- 12345125285864390
-
-
-
- example
- CAEQMxiBgMDNoP2D0BYiIDE3MWUxNzgxZDQxNTRiODI5OGYwZGMwNGY3MzZjN****
- false
- 2019-04-09T07:27:28.000Z
- "250F8A0AE989679A22926A875F0A2****"
- Normal
- 93731
- Standard
-
- 1234512528586****
- 12345125285864390
-
-
-
- pic.jpg
- CAEQMxiBgMCZov2D0BYiIDY4MDllOTc2YmY5MjQxMzdiOGI3OTlhNTU0ODIx****
- true
- 2019-04-09T07:27:28.000Z
- "3663F7B0B9D3153F884C821E7CF4****"
- Normal
- 574768
- IA
-
- 1234512528586****
- 12345125285864390
-
-
-
-BBBB;
+
+
+ oss-example
+
+ example
+ CAEQMxiBgICbof2D0BYiIGRhZjgwMzJiMjA3MjQ0ODE5MWYxZDYwMzJlZjU1****
+ 100
+
+ false
+
+ example
+ CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****
+ false
+ 2019-04-09T07:27:28.000Z
+
+ 1234512528586****
+ 12345125285864390
+
+
+
+ example
+ CAEQMxiBgMDNoP2D0BYiIDE3MWUxNzgxZDQxNTRiODI5OGYwZGMwNGY3MzZjN****
+ false
+ 2019-04-09T07:27:28.000Z
+ "250F8A0AE989679A22926A875F0A2****"
+ Normal
+ 93731
+ Standard
+
+ 1234512528586****
+ 12345125285864390
+
+
+
+ pic.jpg
+ CAEQMxiBgMCZov2D0BYiIDY4MDllOTc2YmY5MjQxMzdiOGI3OTlhNTU0ODIx****
+ true
+ 2019-04-09T07:27:28.000Z
+ "3663F7B0B9D3153F884C821E7CF4****"
+ Normal
+ 574768
+ IA
+
+ 1234512528586****
+ 12345125285864390
+
+
+
+ BBBB;
private $validXml1 = <<
-
- oss-example
-
- example
- CAEQMxiBgICbof2D0BYiIGRhZjgwMzJiMjA3MjQ0ODE5MWYxZDYwMzJlZjU1****
- 100
-
- false
-
- example
- CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****
- true
- 2019-04-09T07:27:28.000Z
-
- 1234512528586****
- 12345125285864390
-
-
-
- example-1
- CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****
- 2019-04-09T07:27:28.000Z
-
- 1234512528586****
- 12345125285864390
-
-
-
- example-2
- CAEQMxiBgMDNoP2D0BYiIDE3MWUxNzgxZDQxNTRiODI5OGYwZGMwNGY3MzZjN****
- 2019-04-09T07:27:28.000Z
- "250F8A0AE989679A22926A875F0A2****"
- Normal
- 93731
- Standard
-
- 1234512528586****
- 12345125285864390
-
-
-
-BBBB;
+
+
+ oss-example
+
+ example
+ CAEQMxiBgICbof2D0BYiIGRhZjgwMzJiMjA3MjQ0ODE5MWYxZDYwMzJlZjU1****
+ 100
+
+ false
+
+ example
+ CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****
+ true
+ 2019-04-09T07:27:28.000Z
+
+ 1234512528586****
+ 12345125285864390
+
+
+
+ example-1
+ CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****
+ 2019-04-09T07:27:28.000Z
+
+ 1234512528586****
+ 12345125285864390
+
+
+
+ example-2
+ CAEQMxiBgMDNoP2D0BYiIDE3MWUxNzgxZDQxNTRiODI5OGYwZGMwNGY3MzZjN****
+ 2019-04-09T07:27:28.000Z
+ "250F8A0AE989679A22926A875F0A2****"
+ Normal
+ 93731
+ Standard
+
+ 1234512528586****
+ 12345125285864390
+
+
+
+ BBBB;
private $invalidXml = <<
-
-
-BBBB;
+
+
+
+ BBBB;
public function testParseValidXml()
{
@@ -136,7 +136,7 @@ BBBB;
$this->assertEquals('CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****', $deleteMarkerList[0]->getVersionId());
$this->assertEquals('false', $deleteMarkerList[0]->getIsLatest());
$this->assertEquals('2019-04-09T07:27:28.000Z', $deleteMarkerList[0]->getLastModified());
-
+
$objectVersionList = $list->getObjectVersionList();
$this->assertEquals('example', $objectVersionList[0]->getKey());
$this->assertEquals('CAEQMxiBgMDNoP2D0BYiIDE3MWUxNzgxZDQxNTRiODI5OGYwZGMwNGY3MzZjN****', $objectVersionList[0]->getVersionId());
@@ -180,7 +180,7 @@ BBBB;
$this->assertEquals('CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****', $deleteMarkerList[0]->getVersionId());
$this->assertEquals('true', $deleteMarkerList[0]->getIsLatest());
$this->assertEquals('2019-04-09T07:27:28.000Z', $deleteMarkerList[0]->getLastModified());
-
+
$this->assertEquals('example-1', $deleteMarkerList[1]->getKey());
$this->assertEquals('CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJm****', $deleteMarkerList[1]->getVersionId());
$this->assertEquals('', $deleteMarkerList[1]->getIsLatest());
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsResultTest.php
index d778c2491..c977ce715 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsResultTest.php
@@ -75,33 +75,6 @@ BBBB;
-BBBB;
-
- private $validXmlWithResoreInfo = <<
-
- testbucket-hf
- url
- php%2Fprefix
- php%2Fmarker
- php%2Fnext-marker
- 1000
- %2F
- true
-
- php/a%2Bb
- 2015-11-18T03:36:00.000Z
- "89B9E567E7EB8815F2F7D41851F9A2CD"
- Normal
- 13115
- Standard
-
- cname_user
- cname_user
-
- ongoing-request="false", expiry-date="Tue, 25 Apr 2023 07:30:00 GMT"
-
-
BBBB;
public function testParseValidXml1()
@@ -175,34 +148,4 @@ BBBB;
$this->assertEquals(13115, $objects[0]->getSize());
$this->assertEquals('Standard', $objects[0]->getStorageClass());
}
-
-
- public function testParseValidXmlWithRestoreInfo()
- {
- $response = new ResponseCore(array(), $this->validXmlWithResoreInfo, 200);
- $result = new ListObjectsResult($response);
- $this->assertTrue($result->isOK());
- $this->assertNotNull($result->getData());
- $this->assertNotNull($result->getRawResponse());
- $objectListInfo = $result->getData();
- $this->assertEquals(0, count($objectListInfo->getPrefixList()));
- $this->assertEquals(1, count($objectListInfo->getObjectList()));
- $this->assertEquals('testbucket-hf', $objectListInfo->getBucketName());
- $this->assertEquals('php/prefix', $objectListInfo->getPrefix());
- $this->assertEquals('php/marker', $objectListInfo->getMarker());
- $this->assertEquals('php/next-marker', $objectListInfo->getNextMarker());
- $this->assertEquals(1000, $objectListInfo->getMaxKeys());
- $this->assertEquals('/', $objectListInfo->getDelimiter());
- $this->assertEquals('true', $objectListInfo->getIsTruncated());
- $objects = $objectListInfo->getObjectList();
- $this->assertEquals('php/a+b', $objects[0]->getKey());
- $this->assertEquals('2015-11-18T03:36:00.000Z', $objects[0]->getLastModified());
- $this->assertEquals('"89B9E567E7EB8815F2F7D41851F9A2CD"', $objects[0]->getETag());
- $this->assertEquals('Normal', $objects[0]->getType());
- $this->assertEquals(13115, $objects[0]->getSize());
- $this->assertEquals('Standard', $objects[0]->getStorageClass());
- $this->assertEquals('ongoing-request="false", expiry-date="Tue, 25 Apr 2023 07:30:00 GMT"', $objects[0]->getRestoreInfo());
- $this->assertEquals('cname_user', $objects[0]->getOwner()->getId());
- $this->assertEquals('cname_user', $objects[0]->getOwner()->getDisplayName());
- }
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsV2ResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsV2ResultTest.php
index 7f07ecff6..b072cd2ed 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsV2ResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsV2ResultTest.php
@@ -74,35 +74,6 @@ BBBB;
1
-BBBB;
-
- private $validXmlWithRestoreInfo = <<
-
- testbucket-hf
- url
- php%2Fprefix
- php%2Fmarker
- 1gJiYw--
- CgJiYw--
- 1000
- %2F
- true
-
- php/a%2Bb
- 2015-11-18T03:36:00.000Z
- "89B9E567E7EB8815F2F7D41851F9A2CD"
- Normal
- 13115
- Standard
-
- cname_user
- cname_user
-
- ongoing-request="false", expiry-date="Tue, 25 Apr 2023 07:30:00 GMT"
-
- 1
-
BBBB;
public function testParseValidXml1()
@@ -180,36 +151,4 @@ BBBB;
$this->assertEquals(13115, $objects[0]->getSize());
$this->assertEquals('Standard', $objects[0]->getStorageClass());
}
-
-
- public function testParseValidXmlWithRestoreInfo()
- {
- $response = new ResponseCore(array(), $this->validXmlWithRestoreInfo, 200);
- $result = new ListObjectsV2Result($response);
- $this->assertTrue($result->isOK());
- $this->assertNotNull($result->getData());
- $this->assertNotNull($result->getRawResponse());
- $objectListInfo = $result->getData();
- $this->assertEquals(0, count($objectListInfo->getPrefixList()));
- $this->assertEquals(1, count($objectListInfo->getObjectList()));
- $this->assertEquals('testbucket-hf', $objectListInfo->getBucketName());
- $this->assertEquals('php/prefix', $objectListInfo->getPrefix());
- $this->assertEquals('php/marker', $objectListInfo->getStartAfter());
- $this->assertEquals('CgJiYw--', $objectListInfo->getNextContinuationToken());
- $this->assertEquals('1gJiYw--', $objectListInfo->getContinuationToken());
- $this->assertEquals(1000, $objectListInfo->getMaxKeys());
- $this->assertEquals('/', $objectListInfo->getDelimiter());
- $this->assertEquals('true', $objectListInfo->getIsTruncated());
- $this->assertEquals(1, $objectListInfo->getKeyCount());
- $objects = $objectListInfo->getObjectList();
- $this->assertEquals('php/a+b', $objects[0]->getKey());
- $this->assertEquals('2015-11-18T03:36:00.000Z', $objects[0]->getLastModified());
- $this->assertEquals('"89B9E567E7EB8815F2F7D41851F9A2CD"', $objects[0]->getETag());
- $this->assertEquals('Normal', $objects[0]->getType());
- $this->assertEquals(13115, $objects[0]->getSize());
- $this->assertEquals('Standard', $objects[0]->getStorageClass());
- $this->assertEquals('ongoing-request="false", expiry-date="Tue, 25 Apr 2023 07:30:00 GMT"', $objects[0]->getRestoreInfo());
- $this->assertEquals('cname_user', $objects[0]->getOwner()->getId());
- $this->assertEquals('cname_user', $objects[0]->getOwner()->getDisplayName());
- }
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ObjectAclTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ObjectAclTest.php
index ec003ca72..9260a6a5d 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ObjectAclTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ObjectAclTest.php
@@ -3,7 +3,6 @@
namespace OSS\Tests;
require_once __DIR__ . '/Common.php';
-require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
class ObjectAclTest extends TestOssClientBase
{
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketCorsTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketCorsTest.php
index bbe11f512..a32154b55 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketCorsTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketCorsTest.php
@@ -7,7 +7,6 @@ use OSS\Model\CorsConfig;
use OSS\Model\CorsRule;
use OSS\OssClient;
-
require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
@@ -39,7 +38,6 @@ class OssClientBucketCorsTest extends TestOssClientBase
$rule->addExposeHeader("x-oss-test1");
$rule->setMaxAgeSeconds(110);
$corsConfig->addRule($rule);
- $corsConfig->setResponseVary(true);
try {
$this->ossClient->putBucketCors($this->bucket, $corsConfig);
@@ -82,44 +80,5 @@ class OssClientBucketCorsTest extends TestOssClientBase
$this->assertFalse(True);
}
-
- try {
- Common::waitMetaSync();
- $this->ossClient->deleteBucketCors($this->bucket);
- } catch (OssException $e) {
- $this->assertFalse(True);
- }
-
- $corsConfig = new CorsConfig();
- $rule = new CorsRule();
- $rule->addAllowedHeader("x-oss-test");
- $rule->addAllowedOrigin("http://www.b.com");
- $rule->addAllowedMethod("GET");
- $rule->addExposeHeader("x-oss-test1");
- $rule->setMaxAgeSeconds(10);
- $corsConfig->addRule($rule);
- $rule = new CorsRule();
- $rule->addAllowedHeader("x-oss-test");
- $rule->addAllowedMethod("GET");
- $rule->addAllowedOrigin("http://www.b.com");
- $rule->addExposeHeader("x-oss-test1");
- $rule->setMaxAgeSeconds(110);
- $corsConfig->addRule($rule);
- $corsConfig->setResponseVary(false);
-
- try {
- $this->ossClient->putBucketCors($this->bucket, $corsConfig);
- } catch (OssException $e) {
- $this->assertFalse(True);
- }
-
- try {
- Common::waitMetaSync();
- $corsConfig4 = $this->ossClient->getBucketCors($this->bucket);
- $this->assertNotNull($corsConfig4);
- $this->assertEquals($corsConfig->serializeToXml(), $corsConfig4->serializeToXml());
- } catch (OssException $e) {
- $this->assertFalse(True);
- }
}
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketPolicyTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketPolicyTest.php
index 6007f1071..4f0c5ee66 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketPolicyTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketPolicyTest.php
@@ -1,5 +1,4 @@
ossClient->deleteBucketPolicy($this->bucket);
@@ -43,9 +38,7 @@ BBBB;
try {
$this->ossClient->putBucketPolicy($this->bucket, $policy_str);
$policy = $this->ossClient->getBucketPolicy($this->bucket);
- $data1 = json_decode($policy_str, true);
- $data2 = json_decode($policy, true);
- $this->assertEquals($data1, $data2);
+ $this->assertEquals($policy_str, $policy);
$this->ossClient->deleteBucketPolicy($this->bucket);
} catch (OssException $e) {
$this->assertTrue(false);
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketTest.php
index dc6368551..6bac445e3 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketTest.php
@@ -52,11 +52,11 @@ class OssClientBucketTest extends TestOssClientBase
$this->assertTrue($this->ossClient->doesBucketExist($this->bucket));
$this->assertFalse($this->ossClient->doesBucketExist($this->bucket . '-notexist'));
- //$this->assertContains(Common::getRegion(), $this->ossClient->getBucketLocation($this->bucket));
+ $this->assertEquals($this->ossClient->getBucketLocation($this->bucket), Common::getRegion());
$res = $this->ossClient->getBucketMeta($this->bucket);
$this->assertEquals('200', $res['info']['http_code']);
- //$this->assertContains(Common::getRegion(), $res['x-oss-bucket-region']);
+ $this->assertEquals(Common::getRegion(), $res['x-oss-bucket-region']);
}
public function testCreateBucketWithStorageType()
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientImageTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientImageTest.php
index a43584eb0..6def9f971 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientImageTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientImageTest.php
@@ -4,11 +4,9 @@ namespace OSS\Tests;
require_once __DIR__ . '/Common.php';
-require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
-
use OSS\OssClient;
-class OssClientImageTest extends TestOssClientBase
+class OssClinetImageTest extends TestOssClientBase
{
private $bucketName;
private $client;
@@ -35,20 +33,20 @@ class OssClientImageTest extends TestOssClientBase
parent::tearDown();
unlink($this->download_file);
}
-
+
public function testImageResize()
{
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
- OssClient::OSS_PROCESS => "image/resize,m_fixed,h_100,w_100",);
+ OssClient::OSS_PROCESS => "image/resize,m_fixed,h_100,w_100", );
$this->check($options, 100, 100, 3267, 'jpg');
}
-
+
public function testImageCrop()
{
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
- OssClient::OSS_PROCESS => "image/crop,w_100,h_100,x_100,y_100,r_1",);
+ OssClient::OSS_PROCESS => "image/crop,w_100,h_100,x_100,y_100,r_1", );
$this->check($options, 100, 100, 1969, 'jpg');
}
@@ -56,7 +54,7 @@ class OssClientImageTest extends TestOssClientBase
{
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
- OssClient::OSS_PROCESS => "image/rotate,90",);
+ OssClient::OSS_PROCESS => "image/rotate,90", );
$this->check($options, 267, 400, 20998, 'jpg');
}
@@ -64,7 +62,7 @@ class OssClientImageTest extends TestOssClientBase
{
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
- OssClient::OSS_PROCESS => "image/sharpen,100",);
+ OssClient::OSS_PROCESS => "image/sharpen,100", );
$this->check($options, 400, 267, 23015, 'jpg');
}
@@ -72,7 +70,7 @@ class OssClientImageTest extends TestOssClientBase
{
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
- OssClient::OSS_PROCESS => "image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ",);
+ OssClient::OSS_PROCESS => "image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ", );
$this->check($options, 400, 267, 26369, 'jpg');
}
@@ -80,7 +78,7 @@ class OssClientImageTest extends TestOssClientBase
{
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
- OssClient::OSS_PROCESS => "image/format,png",);
+ OssClient::OSS_PROCESS => "image/format,png", );
$this->check($options, 400, 267, 160733, 'png');
}
@@ -88,22 +86,22 @@ class OssClientImageTest extends TestOssClientBase
{
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
- OssClient::OSS_PROCESS => "image/resize,m_fixed,w_100,h_100",);
+ OssClient::OSS_PROCESS => "image/resize,m_fixed,w_100,h_100", );
$this->check($options, 100, 100, 3267, 'jpg');
}
public function testProcesObject()
{
$object = 'process-object.jpg';
- $process = 'image/resize,m_fixed,w_100,h_100' .
- '|sys/saveas' .
- ',o_' . $this->base64url_encode($object) .
- ',b_' . $this->base64url_encode($this->bucketName);
+ $process = 'image/resize,m_fixed,w_100,h_100'.
+ '|sys/saveas'.
+ ',o_'.$this->base64url_encode($object).
+ ',b_'.$this->base64url_encode($this->bucketName);
$result = $this->client->processObject($this->bucketName, $this->object, $process);
$this->assertTrue(stripos($result, '"object": "process-object.jpg",') > 0);
$this->assertTrue(stripos($result, '"status": "OK"') > 0);
-
+
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
);
@@ -115,14 +113,14 @@ class OssClientImageTest extends TestOssClientBase
//without bucket
$object = 'process-object-1.jpg';
- $process = 'image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ' .
- '|sys/saveas' .
- ',o_' . $this->base64url_encode($object);
+ $process = 'image/watermark,text_SGVsbG8g5Zu-54mH5pyN5YqhIQ'.
+ '|sys/saveas'.
+ ',o_'.$this->base64url_encode($object);
$result = $this->client->processObject($this->bucketName, $this->object, $process);
$this->assertTrue(stripos($result, '"object": "process-object-1.jpg",') > 0);
$this->assertTrue(stripos($result, '"status": "OK"') > 0);
-
+
$options = array(
OssClient::OSS_FILE_DOWNLOAD => $this->download_file,
);
@@ -144,6 +142,6 @@ class OssClientImageTest extends TestOssClientBase
private function base64url_encode($data)
{
- return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
+ return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientMultipartUploadTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientMultipartUploadTest.php
index 3cd6a1e47..5a6c45847 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientMultipartUploadTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientMultipartUploadTest.php
@@ -399,6 +399,7 @@ class OssClientMultipartUploadTest extends TestOssClientBase
try {
$uploadId = $this->ossClient->initiateMultipartUpload($this->bucket, $object);
$listMultipartUploadInfo = $this->ossClient->completeMultipartUpload($this->bucket, $object, $uploadId, array());
+ var_dump($listMultipartUploadInfo);
$this->assertNotNull($listMultipartUploadInfo);
} catch (OssException $e) {
$this->assertFalse(true);
@@ -464,6 +465,7 @@ class OssClientMultipartUploadTest extends TestOssClientBase
try {
$result = $this->ossClient->completeMultipartUpload($this->bucket, $object, $upload_id, null,$options);
+ var_dump($result);
$this->assertNotNull($result);
} catch (OssException $e) {
$this->assertTrue(false);
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectRequestPaymentTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectRequestPaymentTest.php
index 9f645d31b..66251880d 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectRequestPaymentTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectRequestPaymentTest.php
@@ -451,12 +451,12 @@ class OssClientObjectRequestPaymentTest extends TestOssClientBase
{
parent::setUp();
$this->payerClient = new OssClient(
- Common::getPayerAccessKeyId(),
- Common::getPayerAccessKeySecret(),
- Common::getEndpoint(), false);
+ getenv('OSS_PAYER_ACCESS_KEY_ID'),
+ getenv('OSS_PAYER_ACCESS_KEY_SECRET'),
+ getenv('OSS_ENDPOINT'), false);
$policy = '{"Version":"1","Statement":[{"Action":["oss:*"],"Effect": "Allow",'.
- '"Principal":["' . Common::getPayerUid() . '"],'.
+ '"Principal":["' . getenv('OSS_PAYER_UID') . '"],'.
'"Resource": ["acs:oss:*:*:' . $this->bucket . '","acs:oss:*:*:' . $this->bucket . '/*"]}]}';
$this->ossClient->putBucketPolicy($this->bucket, $policy);
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectTest.php
index a573f1587..bb6101889 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientObjectTest.php
@@ -3,7 +3,6 @@
namespace OSS\Tests;
use OSS\Core\OssException;
-use OSS\Core\OssUtil;
use OSS\OssClient;
require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
@@ -21,7 +20,8 @@ class OssClientObjectTest extends TestOssClientBase
$this->assertEquals('200', $res['info']['http_code']);
$this->assertEquals('text/plain', $res['content-type']);
$this->assertEquals('Accept-Encoding', $res['vary']);
- $this->assertTrue(isset($res['content-encoding']));
+ $this->assertTrue(isset($res['content-length']));
+ $this->assertFalse(isset($res['content-encoding']));
} catch (OssException $e) {
$this->assertTrue(false);
}
@@ -33,6 +33,7 @@ class OssClientObjectTest extends TestOssClientBase
$this->assertEquals('200', $res['info']['http_code']);
$this->assertEquals('text/plain', $res['content-type']);
$this->assertEquals('Accept-Encoding', $res['vary']);
+ $this->assertFalse(isset($res['content-length']));
$this->assertEquals('gzip', $res['content-encoding']);
} catch (OssException $e) {
$this->assertTrue(false);
@@ -98,13 +99,13 @@ class OssClientObjectTest extends TestOssClientBase
} catch (OssException $e) {
$this->assertFalse(true);
}
-
+
try {
- $this->ossClient->putObject($this->bucket, $object, $content, $options);
+ $this->ossClient->putObject($this->bucket, $object, $content, $options);
} catch (OssException $e) {
- $this->assertFalse(true);
+ $this->assertFalse(true);
}
-
+
try {
$result = $this->ossClient->deleteObjects($this->bucket, "stringtype", $options);
$this->assertEquals('stringtype', $result[0]);
@@ -199,7 +200,8 @@ class OssClientObjectTest extends TestOssClientBase
} catch (OssException $e) {
$this->assertTrue(true);
$this->assertFalse(file_exists($localfile));
- if (strpos($e, "The specified key does not exist") == false) {
+ if (strpos($e, "The specified key does not exist") == false)
+ {
$this->assertTrue(true);
}
}
@@ -212,7 +214,8 @@ class OssClientObjectTest extends TestOssClientBase
$this->assertTrue(false);
} catch (OssException $e) {
$this->assertTrue(true);
- if (strpos($e, "The specified key does not exist") == false) {
+ if (strpos($e, "The specified key does not exist") == false)
+ {
$this->assertTrue(true);
}
}
@@ -232,7 +235,7 @@ class OssClientObjectTest extends TestOssClientBase
$this->assertFalse(true);
var_dump($e->getMessage());
- }
+ }
/**
* Check if the replication is the same
@@ -322,11 +325,11 @@ class OssClientObjectTest extends TestOssClientBase
$list = array($object1, $object2);
try {
$this->assertTrue($this->ossClient->doesObjectExist($this->bucket, $object2));
-
+
$result = $this->ossClient->deleteObjects($this->bucket, $list);
$this->assertEquals($list[0], $result[0]);
$this->assertEquals($list[1], $result[1]);
-
+
$result = $this->ossClient->deleteObjects($this->bucket, $list, array('quiet' => 'true'));
$this->assertEquals(array(), $result);
$this->assertFalse($this->ossClient->doesObjectExist($this->bucket, $object2));
@@ -345,7 +348,7 @@ class OssClientObjectTest extends TestOssClientBase
{
$object = "oss-php-sdk-test/append-test-object-name.txt";
$content_array = array('Hello OSS', 'Hi OSS', 'OSS OK');
-
+
/**
* Append the upload string
*/
@@ -370,7 +373,7 @@ class OssClientObjectTest extends TestOssClientBase
$this->assertFalse(true);
}
-
+
/**
* Delete test object
*/
@@ -379,7 +382,7 @@ class OssClientObjectTest extends TestOssClientBase
} catch (OssException $e) {
$this->assertFalse(true);
}
-
+
/**
* Append the upload of invalid local files
*/
@@ -395,9 +398,9 @@ class OssClientObjectTest extends TestOssClientBase
*/
try {
$position = $this->ossClient->appendFile($this->bucket, $object, __FILE__, 0);
- $this->assertEquals($position, sprintf('%u', filesize(__FILE__)));
+ $this->assertEquals($position, sprintf('%u',filesize(__FILE__)));
$position = $this->ossClient->appendFile($this->bucket, $object, __FILE__, $position);
- $this->assertEquals($position, sprintf('%u', filesize(__FILE__)) * 2);
+ $this->assertEquals($position, sprintf('%u',filesize(__FILE__)) * 2);
} catch (OssException $e) {
$this->assertFalse(true);
}
@@ -411,7 +414,7 @@ class OssClientObjectTest extends TestOssClientBase
} catch (OssException $e) {
$this->assertFalse(true);
}
-
+
/**
* Delete test object
*/
@@ -458,138 +461,138 @@ class OssClientObjectTest extends TestOssClientBase
$this->assertFalse(true);
}
}
-
+
public function testPutIllelObject()
{
- $object = "/ilegal.txt";
- try {
- $this->ossClient->putObject($this->bucket, $object, "hi", null);
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('"/ilegal.txt" object name is invalid', $e->getMessage());
- }
+ $object = "/ilegal.txt";
+ try {
+ $this->ossClient->putObject($this->bucket, $object, "hi", null);
+ $this->assertFalse(true);
+ } catch (OssException $e) {
+ $this->assertEquals('"/ilegal.txt" object name is invalid', $e->getMessage());
+ }
}
-
+
public function testCheckMD5()
{
- $object = "oss-php-sdk-test/upload-test-object-name.txt";
- $content = file_get_contents(__FILE__);
- $options = array(OssClient::OSS_CHECK_MD5 => true);
+ $object = "oss-php-sdk-test/upload-test-object-name.txt";
+ $content = file_get_contents(__FILE__);
+ $options = array(OssClient::OSS_CHECK_MD5 => true);
+
+ /**
+ * Upload data to start MD5
+ */
+ try {
+ $this->ossClient->putObject($this->bucket, $object, $content, $options);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * Check if the replication is the same
+ */
+ try {
+ $content = $this->ossClient->getObject($this->bucket, $object);
+ $this->assertEquals($content, file_get_contents(__FILE__));
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
- /**
- * Upload data to start MD5
- */
- try {
- $this->ossClient->putObject($this->bucket, $object, $content, $options);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
+ /**
+ * Upload file to start MD5
+ */
+ try {
+ $this->ossClient->uploadFile($this->bucket, $object, __FILE__, $options);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * Check if the replication is the same
+ */
+ try {
+ $content = $this->ossClient->getObject($this->bucket, $object);
+ $this->assertEquals($content, file_get_contents(__FILE__));
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * Delete test object
+ */
+ try {
+ $this->ossClient->deleteObject($this->bucket, $object);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
- /**
- * Check if the replication is the same
- */
- try {
- $content = $this->ossClient->getObject($this->bucket, $object);
- $this->assertEquals($content, file_get_contents(__FILE__));
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * Upload file to start MD5
- */
- try {
- $this->ossClient->uploadFile($this->bucket, $object, __FILE__, $options);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * Check if the replication is the same
- */
- try {
- $content = $this->ossClient->getObject($this->bucket, $object);
- $this->assertEquals($content, file_get_contents(__FILE__));
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * Delete test object
- */
- try {
- $this->ossClient->deleteObject($this->bucket, $object);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- $object = "oss-php-sdk-test/append-test-object-name.txt";
- $content_array = array('Hello OSS', 'Hi OSS', 'OSS OK');
- $options = array(OssClient::OSS_CHECK_MD5 => true);
-
- /**
- * Append the upload string
- */
- try {
- $position = $this->ossClient->appendObject($this->bucket, $object, $content_array[0], 0, $options);
- $this->assertEquals($position, strlen($content_array[0]));
- $position = $this->ossClient->appendObject($this->bucket, $object, $content_array[1], $position, $options);
- $this->assertEquals($position, strlen($content_array[0]) + strlen($content_array[1]));
- $position = $this->ossClient->appendObject($this->bucket, $object, $content_array[2], $position, $options);
- $this->assertEquals($position, strlen($content_array[0]) + strlen($content_array[1]) + strlen($content_array[1]));
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * Check if the content is the same
- */
- try {
- $content = $this->ossClient->getObject($this->bucket, $object);
- $this->assertEquals($content, implode($content_array));
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * Delete test object
- */
- try {
- $this->ossClient->deleteObject($this->bucket, $object);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * Append upload of local files
- */
- try {
- $position = $this->ossClient->appendFile($this->bucket, $object, __FILE__, 0, $options);
- $this->assertEquals($position, sprintf('%u', filesize(__FILE__)));
- $position = $this->ossClient->appendFile($this->bucket, $object, __FILE__, $position, $options);
- $this->assertEquals($position, sprintf('%u', filesize(__FILE__)) * 2);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * Check if the replication is the same
- */
- try {
- $content = $this->ossClient->getObject($this->bucket, $object);
- $this->assertEquals($content, file_get_contents(__FILE__) . file_get_contents(__FILE__));
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- /**
- * delete test object
- */
- try {
- $this->ossClient->deleteObject($this->bucket, $object);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
+ $object = "oss-php-sdk-test/append-test-object-name.txt";
+ $content_array = array('Hello OSS', 'Hi OSS', 'OSS OK');
+ $options = array(OssClient::OSS_CHECK_MD5 => true);
+
+ /**
+ * Append the upload string
+ */
+ try {
+ $position = $this->ossClient->appendObject($this->bucket, $object, $content_array[0], 0, $options);
+ $this->assertEquals($position, strlen($content_array[0]));
+ $position = $this->ossClient->appendObject($this->bucket, $object, $content_array[1], $position, $options);
+ $this->assertEquals($position, strlen($content_array[0]) + strlen($content_array[1]));
+ $position = $this->ossClient->appendObject($this->bucket, $object, $content_array[2], $position, $options);
+ $this->assertEquals($position, strlen($content_array[0]) + strlen($content_array[1]) + strlen($content_array[1]));
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * Check if the content is the same
+ */
+ try {
+ $content = $this->ossClient->getObject($this->bucket, $object);
+ $this->assertEquals($content, implode($content_array));
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * Delete test object
+ */
+ try {
+ $this->ossClient->deleteObject($this->bucket, $object);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * Append upload of local files
+ */
+ try {
+ $position = $this->ossClient->appendFile($this->bucket, $object, __FILE__, 0, $options);
+ $this->assertEquals($position, sprintf('%u',filesize(__FILE__)));
+ $position = $this->ossClient->appendFile($this->bucket, $object, __FILE__, $position, $options);
+ $this->assertEquals($position, sprintf('%u',filesize(__FILE__)) * 2);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * Check if the replication is the same
+ */
+ try {
+ $content = $this->ossClient->getObject($this->bucket, $object);
+ $this->assertEquals($content, file_get_contents(__FILE__) . file_get_contents(__FILE__));
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ /**
+ * delete test object
+ */
+ try {
+ $this->ossClient->deleteObject($this->bucket, $object);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
}
public function testWithInvalidBucketName()
@@ -623,8 +626,8 @@ class OssClientObjectTest extends TestOssClientBase
$options = array(OssClient::OSS_CHECK_MD5 => true);
$handle = fopen(__FILE__, 'rb');
/**
- * Upload data to start MD5
- */
+ * Upload data to start MD5
+ */
try {
$this->ossClient->uploadStream($this->bucket, $object, $handle, $options);
} catch (OssException $e) {
@@ -632,8 +635,8 @@ class OssClientObjectTest extends TestOssClientBase
}
/**
- * Check if the replication is the same
- */
+ * Check if the replication is the same
+ */
try {
$content = $this->ossClient->getObject($this->bucket, $object);
$this->assertEquals($content, file_get_contents(__FILE__));
@@ -650,8 +653,8 @@ class OssClientObjectTest extends TestOssClientBase
}
/**
- * Check if the replication is the same
- */
+ * Check if the replication is the same
+ */
try {
$content = $this->ossClient->getObject($this->bucket, $object);
$this->assertEquals($content, file_get_contents(__FILE__));
@@ -748,7 +751,7 @@ class OssClientObjectTest extends TestOssClientBase
$this->assertFalse(true);
var_dump($e->getMessage());
- }
+ }
/**
* Check if the replication is the same
@@ -770,166 +773,6 @@ class OssClientObjectTest extends TestOssClientBase
}
}
- public function testObjectKeyWithNonUTF8Name()
- {
- $object = "中文测试.txt";
- $hexObject = bin2hex($object);
- $gbkObject = iconv('UTF-8', 'GBK', $object);
- $hexGbkObject = bin2hex($gbkObject);
- $content = "hello world";
-
- $this->assertEquals("e4b8ade69687e6b58be8af952e747874", $hexObject);
- $this->assertEquals("d6d0cec4b2e2cad42e747874", $hexGbkObject);
-
- try {
- $this->ossClient->putObject($this->bucket, $gbkObject, $content);
- $this->assertTrue(false);
- } catch (OssException $e) {
- $this->assertEquals('InvalidArgument', $e->getErrorCode());
- $this->assertEquals('The characters encoding must be utf-8.', $e->getErrorMessage());
- } catch (\Exception $e) {
- $this->assertTrue(false);
- }
-
- //enable object encoding check
- $config = array(
- 'checkObjectEncoding' => true,
- );
- $ossClient = Common::getOssClient($config);
- try {
- $ossClient->putObject($this->bucket, $gbkObject, $content);
- $content1 = $this->ossClient->getObject($this->bucket, $object);
- $content2 = $ossClient->getObject($this->bucket, $gbkObject);
- $this->assertEquals($content, $content1);
- $this->assertEquals($content, $content2);
- } catch (\Exception $e) {
- $this->assertTrue(false);
- }
-
- // ascii
- try {
- $ossClient->putObject($this->bucket, '1234', 'ascii');
- $content1 = $this->ossClient->getObject($this->bucket, '1234');
- $content2 = $ossClient->getObject($this->bucket, '1234');
- $this->assertEquals('ascii', $content1);
- $this->assertEquals('ascii', $content2);
- } catch (\Exception $e) {
- $this->assertTrue(false);
- }
- }
-
- public function testEncodeFilePath()
- {
- if (!OssUtil::isWin()) {
- $this->assertTrue(true);
- return;
- }
-
- $fileFolder = __DIR__ . DIRECTORY_SEPARATOR . "中文目录";
- $filePath1 = $fileFolder . DIRECTORY_SEPARATOR . "中文文件名1.txt";
- $filePath2 = $fileFolder . DIRECTORY_SEPARATOR . "中文文件名2.txt";
-
- $gbkfileFolder = iconv('UTF-8', 'GBK', $fileFolder);
- $gbkfilePath1 = iconv('UTF-8', 'GBK', $filePath1);
- $gbkfilePath2 = iconv('UTF-8', 'GBK', $filePath2);
-
- $hexfilePath1 = bin2hex($filePath1);
- $hexGbkfilePath2 = bin2hex($gbkfilePath2);
-
- $content1 = '';
- $content2 = '';
- if (version_compare(phpversion(), '7.0.0', '<')) {
- try {
- mkdir($gbkfileFolder);
- } catch (\Exception $e) {
- }
- OssUtil::generateFile($gbkfilePath1, 200 * 1024);
- OssUtil::generateFile($gbkfilePath2, 202 * 1024);
- $content1 = file_get_contents($gbkfilePath1);
- $content2 = file_get_contents($gbkfilePath2);
- } else {
- try {
- mkdir($fileFolder);
- } catch (\Exception $e) {
- }
- OssUtil::generateFile($filePath1, 200 * 1024);
- OssUtil::generateFile($filePath2, 202 * 1024);
- $content1 = file_get_contents($filePath1);
- $content2 = file_get_contents($filePath2);
- }
-
- try {
-
- // upload file
- $this->ossClient->uploadFile($this->bucket, '123', $filePath1);
- $this->ossClient->uploadFile($this->bucket, '234', $gbkfilePath2);
-
- $res = $this->ossClient->getObject($this->bucket, '123');
- $this->assertEquals($content1, $res);
-
- $res = $this->ossClient->getObject($this->bucket, '234');
- $this->assertEquals($content2, $res);
-
- // append file
- $position = $this->ossClient->appendFile($this->bucket, 'append-file', $filePath1, 0);
- $position = $this->ossClient->appendFile($this->bucket, 'append-file', $gbkfilePath2, $position);
-
- $res = $this->ossClient->getObject($this->bucket, 'append-file');
- $this->assertEquals($content1.$content2, $res);
-
- // multi paet
- $this->ossClient->multiuploadFile($this->bucket, 'multi-file-123', $filePath1, array(OssClient::OSS_PART_SIZE => 1));
- $this->ossClient->multiuploadFile($this->bucket, 'multi-file-234', $gbkfilePath2, array(OssClient::OSS_PART_SIZE => 1));
- $res = $this->ossClient->getObject($this->bucket, 'multi-file-123');
- $this->assertEquals($content1, $res);
-
- $res = $this->ossClient->getObject($this->bucket, 'multi-file-234');
- $this->assertEquals($content2, $res);
-
- // uploadDir
- $this->ossClient->uploadDir($this->bucket, "dir", $fileFolder);
- $options = array(
- 'delimiter' => '',
- 'prefix' => "dir",
- );
- $listObjectInfo = $this->ossClient->listObjects($this->bucket, $options);
- $objectList = $listObjectInfo->getObjectList();
- $this->assertEquals(2, count($objectList));
- $this->assertEquals('dir/中文文件名1.txt', $objectList[0]->getKey());
- $this->assertEquals('dir/中文文件名2.txt', $objectList[1]->getKey());
-
- // uploadDir
- if (version_compare(phpversion(), '7.0.0', '<')) {
- $this->ossClient->uploadDir($this->bucket, "gbkdir", $gbkfileFolder);
- $options = array(
- 'delimiter' => '',
- 'prefix' => "gbkdir",
- );
- $listObjectInfo = $this->ossClient->listObjects($this->bucket, $options);
- $objectList = $listObjectInfo->getObjectList();
- $this->assertEquals(2, count($objectList));
- $this->assertEquals('gbkdir/中文文件名1.txt', $objectList[0]->getKey());
- $this->assertEquals('gbkdir/中文文件名2.txt', $objectList[1]->getKey());
- }
-
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- try {
- if (phpversion() < "7.0.0") {
- unlink($gbkfilePath1);
- unlink($gbkfilePath2);
- rmdir($gbkfileFolder);
- } else {
- unlink($filePath1);
- unlink($filePath2);
- rmdir($fileFolder);
- }
- } catch (\Exception $e) {
- }
- }
-
protected function setUp(): void
{
parent::setUp();
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientSignatureTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientSignatureTest.php
index 7187a665f..00cf89a5e 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientSignatureTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientSignatureTest.php
@@ -1,267 +1,167 @@
-ossClient->putObject($this->bucket, $object, file_get_contents(__FILE__));
- $timeout = 3600;
- try {
- $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- $request = new RequestCore($signedUrl);
- $request->set_method('GET');
- $request->add_header('Content-Type', '');
- $request->send_request();
- $res = new ResponseCore($request->get_response_header(), $request->get_response_body(), $request->get_response_code());
- $this->assertEquals(file_get_contents(__FILE__), $res->body);
- }
-
- public function testGetSignedUrlForPuttingObject()
- {
- $object = "a.file";
- $timeout = 3600;
- try {
- $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "PUT");
- $content = file_get_contents(__FILE__);
- $request = new RequestCore($signedUrl);
- $request->set_method('PUT');
- $request->add_header('Content-Type', '');
- $request->add_header('Content-Length', strlen($content));
- $request->set_body($content);
- $request->send_request();
- $res = new ResponseCore($request->get_response_header(),
- $request->get_response_body(), $request->get_response_code());
- $this->assertTrue($res->isOK());
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
- public function testGetSignedUrlForPuttingObjectFromFile()
- {
- $file = __FILE__;
- $object = "a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- try {
- $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "PUT", $options);
- $request = new RequestCore($signedUrl);
- $request->set_method('PUT');
- $request->add_header('Content-Type', 'txt');
- $request->set_read_file($file);
- $request->set_read_stream_size(sprintf('%u',filesize($file)));
- $request->send_request();
- $res = new ResponseCore($request->get_response_header(),
- $request->get_response_body(), $request->get_response_code());
- $this->assertTrue($res->isOK());
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- }
-
- public function testSignedUrlWithException()
- {
- $file = __FILE__;
- $object = "a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- try {
- $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "POST", $options);
- $this->assertTrue(false);
- } catch (OssException $e) {
- $this->assertTrue(true);
- if (strpos($e, "method is invalid") == false)
- {
- $this->assertTrue(false);
- }
- }
-
- $object = "?a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- try {
- $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "PUT", $options);
- $this->assertTrue(false);
- } catch (OssException $e) {
- $this->assertTrue(true);
- if (strpos($e, "object name cannot start with `?`") == false)
- {
- $this->assertTrue(false);
- }
- }
-
- // Set StrictObjectName false
- $object = "?a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- $config = array(
- 'strictObjectName' => false
- );
- $ossClient = Common::getOssClient($config);
- try {
- $signedUrl = $ossClient->signUrl($this->bucket, $object, $timeout, "PUT", $options);
- $this->assertTrue(true);
- } catch (OssException $e) {
- print_r($e->getMessage());
- $this->assertFalse(true);
- }
-
- // V4
- $object = "?a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- $config = array(
- 'signatureVersion' => OssClient::OSS_SIGNATURE_VERSION_V4
- );
- $ossClient = Common::getOssClient($config);
- try {
- $signedUrl = $ossClient->signUrl($this->bucket, $object, $timeout, "PUT", $options);
- $this->assertTrue(true);
- } catch (OssException $e) {
- print_r($e->getMessage());
- $this->assertFalse(true);
- }
- }
-
- function testGetgenPreSignedUrlForGettingObject()
- {
- $object = "a.file";
- $this->ossClient->putObject($this->bucket, $object, file_get_contents(__FILE__));
- $expires = time() + 3600;
- try {
- $signedUrl = $this->ossClient->generatePresignedUrl($this->bucket, $object, $expires);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- $request = new RequestCore($signedUrl);
- $request->set_method('GET');
- $request->add_header('Content-Type', '');
- $request->send_request();
- $res = new ResponseCore($request->get_response_header(), $request->get_response_body(), $request->get_response_code());
- $this->assertEquals(file_get_contents(__FILE__), $res->body);
- }
-
- function testGetgenPreSignedUrlVsSignedUrl()
- {
- $object = "object-vs.file";
- $signedUrl1 = '245';
- $signedUrl2 = '123';
- $expiration = 0;
-
- do {
- usleep(500000);
- $begin = time();
- $expiration = time() + 3600;
- $signedUrl1 = $this->ossClient->generatePresignedUrl($this->bucket, $object, $expiration);
- $signedUrl2 = $this->ossClient->signUrl($this->bucket, $object, 3600);
- $end = time();
- } while ($begin != $end);
- $this->assertEquals($signedUrl1, $signedUrl2);
- $this->assertTrue(strpos($signedUrl1, 'Expires='.$expiration) !== false);
- }
-
- public function testPutObjectWithQueryCallback()
- {
- $object = "a.file";
- $timeout = 3600;
- $url = '{"callbackUrl":"http://aliyun.com", "callbackBody":"bucket=${bucket}&object=${object}"}';
- $var =
- '{
- "x:var1":"value1",
- "x:var2":"value2"
- }';
- try {
- $options[OssClient::OSS_QUERY_STRING] = array(
- 'callback'=>base64_encode($url),
- 'callback-var'=>base64_encode($var)
- );
- $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "PUT", $options);
- $content = file_get_contents(__FILE__);
- $request = new RequestCore($signedUrl);
- $request->set_method('PUT');
- $request->add_header('Content-Type', '');
- $request->add_header('Content-Length', strlen($content));
- $request->set_body($content);
- $request->send_request();
- $res = new ResponseCore($request->get_response_header(),
- $request->get_response_body(), $request->get_response_code());
- $this->assertEquals($res->status, 203);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- try {
- $options = array(OssClient::OSS_CALLBACK => $url,
- OssClient::OSS_CALLBACK_VAR => $var
- );
- $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "PUT", $options);
- $content = file_get_contents(__FILE__);
- $request = new RequestCore($signedUrl);
- $request->set_method('PUT');
- $request->add_header('Content-Type', '');
- $request->add_header(OssClient::OSS_CALLBACK, base64_encode($url));
- $request->add_header(OssClient::OSS_CALLBACK_VAR , base64_encode($var));
- $request->add_header('Content-Length', strlen($content));
- $request->set_body($content);
- $request->send_request();
- $res = new ResponseCore($request->get_response_header(),
- $request->get_response_body(), $request->get_response_code());
- $this->assertEquals($res->status, 203);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
-
- protected function tearDown(): void
- {
- $this->ossClient->deleteObject($this->bucket, "a.file");
- parent::tearDown();
- }
-
- protected function setUp(): void
- {
- parent::setUp();
- /**
- * 上传本地变量到bucket
- */
- $object = "a.file";
- $content = file_get_contents(__FILE__);
- $options = array(
- OssClient::OSS_LENGTH => strlen($content),
- OssClient::OSS_HEADERS => array(
- 'Expires' => 'Fri, 28 Feb 2020 05:38:42 GMT',
- 'Cache-Control' => 'no-cache',
- 'Content-Disposition' => 'attachment;filename=oss_download.log',
- 'Content-Encoding' => 'utf-8',
- 'Content-Language' => 'zh-CN',
- 'x-oss-server-side-encryption' => 'AES256',
- 'x-oss-meta-self-define-title' => 'user define meta info',
- ),
- );
-
- try {
- $this->ossClient->putObject($this->bucket, $object, $content, $options);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-}
+ossClient->putObject($this->bucket, $object, file_get_contents(__FILE__));
+ $timeout = 3600;
+ try {
+ $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ $request = new RequestCore($signedUrl);
+ $request->set_method('GET');
+ $request->add_header('Content-Type', '');
+ $request->send_request();
+ $res = new ResponseCore($request->get_response_header(), $request->get_response_body(), $request->get_response_code());
+ $this->assertEquals(file_get_contents(__FILE__), $res->body);
+ }
+
+ public function testGetSignedUrlForPuttingObject()
+ {
+ $object = "a.file";
+ $timeout = 3600;
+ try {
+ $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "PUT");
+ $content = file_get_contents(__FILE__);
+ $request = new RequestCore($signedUrl);
+ $request->set_method('PUT');
+ $request->add_header('Content-Type', '');
+ $request->add_header('Content-Length', strlen($content));
+ $request->set_body($content);
+ $request->send_request();
+ $res = new ResponseCore($request->get_response_header(),
+ $request->get_response_body(), $request->get_response_code());
+ $this->assertTrue($res->isOK());
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+
+ public function testGetSignedUrlForPuttingObjectFromFile()
+ {
+ $file = __FILE__;
+ $object = "a.file";
+ $timeout = 3600;
+ $options = array('Content-Type' => 'txt');
+ try {
+ $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "PUT", $options);
+ $request = new RequestCore($signedUrl);
+ $request->set_method('PUT');
+ $request->add_header('Content-Type', 'txt');
+ $request->set_read_file($file);
+ $request->set_read_stream_size(sprintf('%u',filesize($file)));
+ $request->send_request();
+ $res = new ResponseCore($request->get_response_header(),
+ $request->get_response_body(), $request->get_response_code());
+ $this->assertTrue($res->isOK());
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ }
+
+ public function testSignedUrlWithException()
+ {
+ $file = __FILE__;
+ $object = "a.file";
+ $timeout = 3600;
+ $options = array('Content-Type' => 'txt');
+ try {
+ $signedUrl = $this->ossClient->signUrl($this->bucket, $object, $timeout, "POST", $options);
+ $this->assertTrue(false);
+ } catch (OssException $e) {
+ $this->assertTrue(true);
+ if (strpos($e, "method is invalid") == false)
+ {
+ $this->assertTrue(false);
+ }
+ }
+ }
+
+ function testGetgenPreSignedUrlForGettingObject()
+ {
+ $object = "a.file";
+ $this->ossClient->putObject($this->bucket, $object, file_get_contents(__FILE__));
+ $expires = time() + 3600;
+ try {
+ $signedUrl = $this->ossClient->generatePresignedUrl($this->bucket, $object, $expires);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ $request = new RequestCore($signedUrl);
+ $request->set_method('GET');
+ $request->add_header('Content-Type', '');
+ $request->send_request();
+ $res = new ResponseCore($request->get_response_header(), $request->get_response_body(), $request->get_response_code());
+ $this->assertEquals(file_get_contents(__FILE__), $res->body);
+ }
+
+ function testGetgenPreSignedUrlVsSignedUrl()
+ {
+ $object = "object-vs.file";
+ $signedUrl1 = '245';
+ $signedUrl2 = '123';
+ $expiration = 0;
+
+ do {
+ usleep(500000);
+ $begin = time();
+ $expiration = time() + 3600;
+ $signedUrl1 = $this->ossClient->generatePresignedUrl($this->bucket, $object, $expiration);
+ $signedUrl2 = $this->ossClient->signUrl($this->bucket, $object, 3600);
+ $end = time();
+ } while ($begin != $end);
+ $this->assertEquals($signedUrl1, $signedUrl2);
+ $this->assertTrue(strpos($signedUrl1, 'Expires='.$expiration) !== false);
+ }
+
+ protected function tearDown(): void
+ {
+ $this->ossClient->deleteObject($this->bucket, "a.file");
+ parent::tearDown();
+ }
+
+ protected function setUp(): void
+ {
+ parent::setUp();
+ /**
+ * 上传本地变量到bucket
+ */
+ $object = "a.file";
+ $content = file_get_contents(__FILE__);
+ $options = array(
+ OssClient::OSS_LENGTH => strlen($content),
+ OssClient::OSS_HEADERS => array(
+ 'Expires' => 'Fri, 28 Feb 2020 05:38:42 GMT',
+ 'Cache-Control' => 'no-cache',
+ 'Content-Disposition' => 'attachment;filename=oss_download.log',
+ 'Content-Encoding' => 'utf-8',
+ 'Content-Language' => 'zh-CN',
+ 'x-oss-server-side-encryption' => 'AES256',
+ 'x-oss-meta-self-define-title' => 'user define meta info',
+ ),
+ );
+
+ try {
+ $this->ossClient->putObject($this->bucket, $object, $content, $options);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientTest.php
index 8898711dd..b7c676f5a 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientTest.php
@@ -1,521 +1,346 @@
-credentials = new TestEmptyIdCredentials();
- } else if ($flag == 1) {
- $this->credentials = new TestEmptySecretCredentials();
- } else {
- $this->credentials = null;
- }
- }
-
- /**
- * @return Credentials
- */
- public function getCredentials()
- {
- return $this->credentials;
- }
-}
-
-class OssClientTest extends TestOssClientBase
-{
- public function testConstrunct()
- {
- try {
- $ossClient = new OssClient('id', 'key', 'http://oss-cn-hangzhou.aliyuncs.com');
- $this->assertFalse($ossClient->isUseSSL());
- $ossClient->setUseSSL(true);
- $this->assertTrue($ossClient->isUseSSL());
- $this->assertTrue(true);
- $this->assertEquals(3, $ossClient->getMaxRetries());
- $ossClient->setMaxTries(4);
- $this->assertEquals(4, $ossClient->getMaxRetries());
- $ossClient->setTimeout(10);
- $ossClient->setConnectTimeout(20);
- } catch (OssException $e) {
- assertFalse(true);
- }
- }
-
- public function testConstrunct2()
- {
- try {
- $ossClient = new OssClient('id', "", 'http://oss-cn-hangzhou.aliyuncs.com');
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals("access key secret is empty", $e->getMessage());
- }
- }
-
- public function testConstrunct3()
- {
- try {
- $ossClient = new OssClient("", 'key', 'http://oss-cn-hangzhou.aliyuncs.com');
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals("access key id is empty", $e->getMessage());
- }
- }
-
- public function testConstrunct4()
- {
- try {
- $ossClient = new OssClient('id', 'key', "");
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('endpoint is empty', $e->getMessage());
- }
- }
-
- public function testConstrunct5()
- {
- try {
- $ossClient = new OssClient('id', 'key', "123.123.123.1");
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
- }
-
- public function testConstrunct6()
- {
- try {
- $ossClient = new OssClient('id', 'key', "https://123.123.123.1");
- $this->assertTrue($ossClient->isUseSSL());
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
-
- try {
- $ossClient = new OssClient('id', 'key', "https://123.123.123.1:3128");
- $this->assertTrue($ossClient->isUseSSL());
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
- }
-
- public function testConstrunct7()
- {
- try {
- $ossClient = new OssClient('id', 'key', "http://123.123.123.1");
- $this->assertFalse($ossClient->isUseSSL());
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
-
- try {
- $ossClient = new OssClient('id', 'key', "http://123.123.123.1:3128");
- $this->assertFalse($ossClient->isUseSSL());
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
- }
-
- public function testConstrunct8()
- {
- try {
- $ossClient = new OssClient('id', 'key', "http://123.123.123.1", true);
- $ossClient->listBuckets();
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertFalse(false);
- }
- }
-
- public function testConstrunct9()
- {
- try {
- $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint() . '/ ';
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
- $ossClient->listBuckets();
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
- public function testConstrunct10()
- {
- try {
- $ossClient = new OssClient('id', 'key', "http://ABC-COM.TEST.123.cn", true);
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertTrue(false);
- }
- }
-
- public function testConstrunct11()
- {
- try {
- $ossClient = new OssClient('id', 'key', "oss-test.com\\aliyuncs.com");
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('endpoint is invalid:' . "oss-test.com\\aliyuncs.com", $e->getMessage());
- }
- }
-
- public function testConstrunct12()
- {
- try {
- $ossClient = new OssClient('id', 'key', "192.168.1.0:abc123");
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('endpoint is invalid:' . "192.168.1.0:abc123", $e->getMessage());
- }
- }
-
- public function testSupportPutEmptyObject()
- {
- try {
- $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint() . '/ ';
- $bucket = $this->bucket;
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
- $ossClient->putObject($bucket, 'test_emptybody', '');
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- //use invalid sts-token, should fail.
- try {
- $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint() . '/ ';
- $bucket = $this->bucket;
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false, "invalid-sts-token");
- $ossClient->putObject($bucket, 'test_emptybody', '');
- $this->assertTrue(false);
- } catch (OssException $e) {
- $this->assertEquals('InvalidAccessKeyId', $e->getErrorCode());
- }
- }
-
- public function testCreateObjectDir()
- {
- $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint() . '/ ';
- $bucket = $this->bucket;
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
-
- try {
- $object = 'test-dir';
- $ossClient->createObjectDir($bucket, $object);
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
-
- try {
- $object = '0';
- $ossClient->createObjectDir($bucket, $object);
- $ossClient->putObject($bucket, $object, '');
- $this->assertTrue(true);
- } catch (OssException $e) {
- var_dump($e);
- $this->assertFalse(true);
- }
- }
-
- public function testGetBucketCors()
- {
- try {
- $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint(). '/ ';
- $bucket = Common::getBucketName();
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
- $ossClient->getBucketCors($bucket);
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
- public function testGetBucketCname()
- {
- try {
- $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint() . '/ ';
- $bucket = $this->bucket;
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
- $ossClient->getBucketCname($bucket);
- $this->assertTrue(true);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
- public function testProxySupport()
- {
- $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint() . '/ ';
- $bucket = Common::getBucketName() . '-proxy';
- $requestProxy = getenv('OSS_PROXY');
- $key = 'test-proxy-srv-object';
- $content = 'test-content';
- $proxys = parse_url($requestProxy);
-
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false, null, $requestProxy);
-
- $result = $ossClient->createBucket($bucket);
- $this->checkProxy($result, $proxys);
-
- $result = $ossClient->putObject($bucket, $key, $content);
- $this->checkProxy($result, $proxys);
- $result = $ossClient->getObject($bucket, $key);
- $this->assertEquals($content, $result);
-
- // list object
- $objectListInfo = $ossClient->listObjects($bucket);
- $objectList = $objectListInfo->getObjectList();
- $this->assertNotNull($objectList);
- $this->assertTrue(is_array($objectList));
- $objects = array();
- foreach ($objectList as $value) {
- $objects[] = $value->getKey();
- }
- $this->assertEquals(1, count($objects));
- $this->assertTrue(in_array($key, $objects));
-
- $result = $ossClient->deleteObject($bucket, $key);
- $this->checkProxy($result, $proxys);
-
- $result = $ossClient->deleteBucket($bucket);
- $this->checkProxy($result, $proxys);
- }
-
- private function checkProxy($result, $proxys)
- {
- $this->assertEquals($result['info']['primary_ip'], $proxys['host']);
- $this->assertEquals($result['info']['primary_port'], $proxys['port']);
- $this->assertTrue(array_key_exists('via', $result));
- }
-
- public function testIpEndpoint()
- {
- try {
- $accessKeyId = 'sk' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = '192.168.1.1';
- $bucket = Common::getBucketName();
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
- $object = "a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
- $this->assertTrue(strpos($signedUrl, '192.168.1.1/' . $bucket . '/a.file?') != false);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
- public function testCnameEndpoint()
- {
- try {
- $accessKeyId = 'sk' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = 'cname.endpoint';
- $bucket = Common::getBucketName();
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, true);
- $object = "a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
- $this->assertTrue(strpos($signedUrl, 'cname.endpoint/a.file?') != false);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
- public function testStsToken()
- {
- try {
- $accessKeyId = 'sk' . getenv('OSS_ACCESS_KEY_ID') . ' ';
- $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
- $endpoint = ' ' . Common::getEndpoint() . '/ ';
- $bucket = Common::getBucketName();
- $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false, "test-token");
- $object = "a.file";
- $timeout = 3600;
- $options = array('Content-Type' => 'txt');
- $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
- $this->assertTrue(strpos($signedUrl, 'security-token=test-token') != false);
- } catch (OssException $e) {
- $this->assertFalse(true);
- }
- }
-
- public function testEmptyCredentials()
- {
- // empty case, should throw exception
- try {
- $id = '';
- $secret = 'accessKey_secret';
- $provider = new StaticCredentialsProvider($id, $secret);
- $config = array(
- 'provider' => $provider,
- 'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com'
- );
- $ossClient = new OssClient($config);
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('access key id is empty', $e->getMessage());
- }
-
- // empty case, should throw exception
- try {
- $id = 'id';
- $secret = '';
- $provider = new StaticCredentialsProvider($id, $secret);
- $config = array(
- 'provider' => $provider,
- 'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com'
- );
- $ossClient = new OssClient($config);
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('access key secret is empty', $e->getMessage());
- }
-
- // empty case, should throw exception
- try {
- $provider = new TestCredentialsProvider(0);
- $config = array(
- 'provider' => $provider,
- 'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com'
- );
- $ossClient = new OssClient($config);
- $ossClient->getBucketAcl("bucket");
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('credentials is empty.', $e->getMessage());
- }
-
- // empty case, should throw exception
- try {
- $provider = new TestCredentialsProvider(1);
- $config = array(
- 'provider' => $provider,
- 'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com'
- );
- $ossClient = new OssClient($config);
- $ossClient->getBucketAcl("bucket");
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('access key secret is empty', $e->getMessage());
- }
-
- // empty case, should throw exception
- try {
- $provider = new TestCredentialsProvider(2);
- $config = array(
- 'provider' => $provider,
- 'endpoint' => 'http://oss-cn-hangzhou.aliyuncs.com'
- );
- $ossClient = new OssClient($config);
- $ossClient->getBucketAcl("bucket");
- $this->assertFalse(true);
- } catch (OssException $e) {
- $this->assertEquals('access key id is empty', $e->getMessage());
- }
- }
-
- public function testEnvironmentVariableCredentialsProvider()
- {
- try {
- $provider = new EnvironmentVariableCredentialsProvider();
- $config = array(
- 'provider' => $provider,
- 'endpoint' => Common::getEndpoint(),
- );
- $ossClient = new OssClient($config);
- $ossClient->putObject($this->bucket, 'test_emptybody', '');
- $this->assertTrue(true);
- } catch (OssException $e) {
- printf($e->getMessage());
- $this->assertFalse(true);
- }
-
-
- try {
- $ossClient->getObject($this->bucket, 'test_emptybody');
- $this->assertTrue(true);
- } catch (OssException $e) {
- printf($e->getMessage());
- $this->assertFalse(true);
- }
- }
-}
+assertFalse($ossClient->isUseSSL());
+ $ossClient->setUseSSL(true);
+ $this->assertTrue($ossClient->isUseSSL());
+ $this->assertTrue(true);
+ $this->assertEquals(3, $ossClient->getMaxRetries());
+ $ossClient->setMaxTries(4);
+ $this->assertEquals(4, $ossClient->getMaxRetries());
+ $ossClient->setTimeout(10);
+ $ossClient->setConnectTimeout(20);
+ } catch (OssException $e) {
+ assertFalse(true);
+ }
+ }
+
+ public function testConstrunct2()
+ {
+ try {
+ $ossClient = new OssClient('id', "", 'http://oss-cn-hangzhou.aliyuncs.com');
+ $this->assertFalse(true);
+ } catch (OssException $e) {
+ $this->assertEquals("access key secret is empty", $e->getMessage());
+ }
+ }
+
+ public function testConstrunct3()
+ {
+ try {
+ $ossClient = new OssClient("", 'key', 'http://oss-cn-hangzhou.aliyuncs.com');
+ $this->assertFalse(true);
+ } catch (OssException $e) {
+ $this->assertEquals("access key id is empty", $e->getMessage());
+ }
+ }
+
+ public function testConstrunct4()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "");
+ $this->assertFalse(true);
+ } catch (OssException $e) {
+ $this->assertEquals('endpoint is empty', $e->getMessage());
+ }
+ }
+
+ public function testConstrunct5()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "123.123.123.1");
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertTrue(false);
+ }
+ }
+
+ public function testConstrunct6()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "https://123.123.123.1");
+ $this->assertTrue($ossClient->isUseSSL());
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertTrue(false);
+ }
+
+ try {
+ $ossClient = new OssClient('id', 'key', "https://123.123.123.1:3128");
+ $this->assertTrue($ossClient->isUseSSL());
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertTrue(false);
+ }
+ }
+
+ public function testConstrunct7()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "http://123.123.123.1");
+ $this->assertFalse($ossClient->isUseSSL());
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertTrue(false);
+ }
+
+ try {
+ $ossClient = new OssClient('id', 'key', "http://123.123.123.1:3128");
+ $this->assertFalse($ossClient->isUseSSL());
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertTrue(false);
+ }
+ }
+
+ public function testConstrunct8()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "http://123.123.123.1", true);
+ $ossClient->listBuckets();
+ $this->assertFalse(true);
+ } catch (OssException $e) {
+ $this->assertFalse(false);
+ }
+ }
+
+ public function testConstrunct9()
+ {
+ try {
+ $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
+ $ossClient->listBuckets();
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+
+ public function testConstrunct10()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "http://ABC-COM.TEST.123.cn", true);
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertTrue(false);
+ }
+ }
+
+ public function testConstrunct11()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "oss-test.com\\aliyuncs.com");
+ $this->assertFalse(true);
+ } catch (OssException $e) {
+ $this->assertEquals('endpoint is invalid:'."oss-test.com\\aliyuncs.com", $e->getMessage());
+ }
+ }
+
+ public function testConstrunct12()
+ {
+ try {
+ $ossClient = new OssClient('id', 'key', "192.168.1.0:abc123");
+ $this->assertFalse(true);
+ } catch (OssException $e) {
+ $this->assertEquals('endpoint is invalid:'."192.168.1.0:abc123", $e->getMessage());
+ }
+ }
+
+ public function testSupportPutEmptyObject()
+ {
+ try {
+ $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $bucket = $this->bucket;
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret , $endpoint, false);
+ $ossClient->putObject($bucket,'test_emptybody','');
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ //use invalid sts-token, should fail.
+ try {
+ $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $bucket = $this->bucket;
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret , $endpoint, false, "invalid-sts-token");
+ $ossClient->putObject($bucket,'test_emptybody','');
+ $this->assertTrue(false);
+ } catch (OssException $e) {
+ $this->assertEquals('InvalidAccessKeyId', $e->getErrorCode());
+ }
+ }
+
+ public function testCreateObjectDir()
+ {
+ $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $bucket = $this->bucket;
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
+
+ try {
+ $object='test-dir';
+ $ossClient->createObjectDir($bucket,$object);
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+
+ try {
+ $object='0';
+ $ossClient->createObjectDir($bucket,$object);
+ $ossClient->putObject($bucket,$object, '');
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ var_dump($e);
+ $this->assertFalse(true);
+ }
+ }
+
+ public function testGetBucketCors()
+ {
+ try {
+ $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $bucket = getenv('OSS_BUCKET');
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
+ $ossClient->getBucketCors($bucket);
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+
+ public function testGetBucketCname()
+ {
+ try {
+ $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $bucket = $this->bucket;
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
+ $ossClient->getBucketCname($bucket);
+ $this->assertTrue(true);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+
+ public function testProxySupport()
+ {
+ $accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $bucket = getenv('OSS_BUCKET') . '-proxy';
+ $requestProxy = getenv('OSS_PROXY');
+ $key = 'test-proxy-srv-object';
+ $content = 'test-content';
+ $proxys = parse_url($requestProxy);
+
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false, null, $requestProxy);
+
+ $result = $ossClient->createBucket($bucket);
+ $this->checkProxy($result, $proxys);
+
+ $result = $ossClient->putObject($bucket, $key, $content);
+ $this->checkProxy($result, $proxys);
+ $result = $ossClient->getObject($bucket, $key);
+ $this->assertEquals($content, $result);
+
+ // list object
+ $objectListInfo = $ossClient->listObjects($bucket);
+ $objectList = $objectListInfo->getObjectList();
+ $this->assertNotNull($objectList);
+ $this->assertTrue(is_array($objectList));
+ $objects = array();
+ foreach ($objectList as $value) {
+ $objects[] = $value->getKey();
+ }
+ $this->assertEquals(1, count($objects));
+ $this->assertTrue(in_array($key, $objects));
+
+ $result = $ossClient->deleteObject($bucket, $key);
+ $this->checkProxy($result,$proxys);
+
+ $result = $ossClient->deleteBucket($bucket);
+ $this->checkProxy($result, $proxys);
+ }
+
+ private function checkProxy($result, $proxys)
+ {
+ $this->assertEquals($result['info']['primary_ip'], $proxys['host']);
+ $this->assertEquals($result['info']['primary_port'], $proxys['port']);
+ $this->assertTrue(array_key_exists('via', $result));
+ }
+
+ public function testIpEndpoint()
+ {
+ try {
+ $accessKeyId = 'sk' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = '192.168.1.1';
+ $bucket = getenv('OSS_BUCKET');
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
+ $object = "a.file";
+ $timeout = 3600;
+ $options = array('Content-Type' => 'txt');
+ $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
+ $this->assertTrue(strpos($signedUrl, '192.168.1.1/skyranch-php-test/a.file?') != false);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+
+ public function testCnameEndpoint()
+ {
+ try {
+ $accessKeyId = 'sk' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = 'cname.endpoint';
+ $bucket = getenv('OSS_BUCKET');
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, true);
+ $object = "a.file";
+ $timeout = 3600;
+ $options = array('Content-Type' => 'txt');
+ $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
+ $this->assertTrue(strpos($signedUrl, 'cname.endpoint/a.file?') != false);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+
+ public function testStsToken()
+ {
+ try {
+ $accessKeyId = 'sk' . getenv('OSS_ACCESS_KEY_ID') . ' ';
+ $accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
+ $endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
+ $bucket = getenv('OSS_BUCKET');
+ $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false, "test-token");
+ $object = "a.file";
+ $timeout = 3600;
+ $options = array('Content-Type' => 'txt');
+ $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
+ $this->assertTrue(strpos($signedUrl, 'security-token=test-token') != false);
+ } catch (OssException $e) {
+ $this->assertFalse(true);
+ }
+ }
+}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssUtilTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssUtilTest.php
index 6d6196c4f..598a7cc56 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssUtilTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssUtilTest.php
@@ -143,7 +143,7 @@ BBBB;
public function testReadDir()
{
- $list = OssUtil::readDir(__DIR__, ".|..|.svn|.git", true);
+ $list = OssUtil::readDir("./src", ".|..|.svn|.git", true);
$this->assertNotNull($list);
}
diff --git a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/PutSetDeleteResultTest.php b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/PutSetDeleteResultTest.php
index c87955e90..202f173f1 100644
--- a/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/PutSetDeleteResultTest.php
+++ b/src/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/PutSetDeleteResultTest.php
@@ -6,7 +6,7 @@ use OSS\Core\OssException;
use OSS\Http\ResponseCore;
use OSS\Result\PutSetDeleteResult;
-class PutSetDeleteResultTest extends \PHPUnit\Framework\TestCase
+class ResultTest extends \PHPUnit\Framework\TestCase
{
public function testNullResponse()
diff --git a/src/vendor/composer/autoload_psr4.php b/src/vendor/composer/autoload_psr4.php
index 6d496b001..d41f961ed 100644
--- a/src/vendor/composer/autoload_psr4.php
+++ b/src/vendor/composer/autoload_psr4.php
@@ -11,10 +11,10 @@ return array(
'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'),
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'),
- 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-queue/src', $vendorDir . '/topthink/think-template/src'),
+ 'think\\' => array($vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-queue/src'),
'thans\\filesystem\\' => array($vendorDir . '/thans/thinkphp-filesystem-cloud/src'),
'phpseclib3\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
- 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'),
+ 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'),
'liliuwei\\think\\' => array($vendorDir . '/liliuwei/thinkphp-jump/src'),
'extend\\' => array($baseDir . '/extend'),
'app\\' => array($baseDir . '/app'),
@@ -42,7 +42,7 @@ return array(
'Qcloud\\Cos\\' => array($vendorDir . '/qcloud/cos-sdk-v5/src'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
- 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
diff --git a/src/vendor/composer/autoload_static.php b/src/vendor/composer/autoload_static.php
index dae80959f..3eb591627 100644
--- a/src/vendor/composer/autoload_static.php
+++ b/src/vendor/composer/autoload_static.php
@@ -191,11 +191,11 @@ class ComposerStaticInit516d2ac39a060b91610bddcc729d2cf4
),
'think\\' =>
array (
- 0 => __DIR__ . '/..' . '/topthink/framework/src/think',
+ 0 => __DIR__ . '/..' . '/topthink/think-template/src',
1 => __DIR__ . '/..' . '/topthink/think-helper/src',
2 => __DIR__ . '/..' . '/topthink/think-orm/src',
- 3 => __DIR__ . '/..' . '/topthink/think-queue/src',
- 4 => __DIR__ . '/..' . '/topthink/think-template/src',
+ 3 => __DIR__ . '/..' . '/topthink/framework/src/think',
+ 4 => __DIR__ . '/..' . '/topthink/think-queue/src',
),
'thans\\filesystem\\' =>
array (
@@ -208,8 +208,8 @@ class ComposerStaticInit516d2ac39a060b91610bddcc729d2cf4
'phpDocumentor\\Reflection\\' =>
array (
0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src',
- 1 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
- 2 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
+ 1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src',
+ 2 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src',
),
'liliuwei\\think\\' =>
array (
@@ -321,8 +321,8 @@ class ComposerStaticInit516d2ac39a060b91610bddcc729d2cf4
),
'Psr\\Http\\Message\\' =>
array (
- 0 => __DIR__ . '/..' . '/psr/http-factory/src',
- 1 => __DIR__ . '/..' . '/psr/http-message/src',
+ 0 => __DIR__ . '/..' . '/psr/http-message/src',
+ 1 => __DIR__ . '/..' . '/psr/http-factory/src',
),
'Psr\\Http\\Client\\' =>
array (
diff --git a/src/vendor/composer/installed.json b/src/vendor/composer/installed.json
index 14bfefc1f..dfe66845b 100644
--- a/src/vendor/composer/installed.json
+++ b/src/vendor/composer/installed.json
@@ -6272,20 +6272,6 @@
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v4.4.41"
},
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
"install-path": "../symfony/var-dumper"
},
{
@@ -6876,7 +6862,13 @@
"type": "zip",
"url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
"reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444",
- "shasum": ""
+ "shasum": "",
+ "mirrors": [
+ {
+ "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+ "preferred": true
+ }
+ ]
},
"require": {
"php": ">=7.1.0",
@@ -6886,12 +6878,12 @@
"type": "library",
"extra": {
"think": {
- "config": {
- "trace": "src/config.php"
- },
"services": [
"think\\trace\\Service"
- ]
+ ],
+ "config": {
+ "trace": "src/config.php"
+ }
}
},
"installation-source": "dist",
@@ -6911,10 +6903,6 @@
}
],
"description": "thinkphp debug trace",
- "support": {
- "issues": "https://github.com/top-think/think-trace/issues",
- "source": "https://github.com/top-think/think-trace/tree/v1.4"
- },
"install-path": "../topthink/think-trace"
},
{
diff --git a/src/vendor/composer/installed.php b/src/vendor/composer/installed.php
index c2b0888e9..29ac800f0 100644
--- a/src/vendor/composer/installed.php
+++ b/src/vendor/composer/installed.php
@@ -1,9 +1,9 @@
array(
'name' => 'topthink/think',
- 'pretty_version' => '1.0.0+no-version-set',
- 'version' => '1.0.0.0',
- 'reference' => NULL,
+ 'pretty_version' => 'dev-main',
+ 'version' => 'dev-main',
+ 'reference' => 'e0aeea15f212c8fd39c805cda2d8616e4f4a6a29',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -908,9 +908,9 @@
'dev_requirement' => false,
),
'topthink/think' => array(
- 'pretty_version' => '1.0.0+no-version-set',
- 'version' => '1.0.0.0',
- 'reference' => NULL,
+ 'pretty_version' => 'dev-main',
+ 'version' => 'dev-main',
+ 'reference' => 'e0aeea15f212c8fd39c805cda2d8616e4f4a6a29',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
diff --git a/src/vendor/dragonmantank/cron-expression/README.md b/src/vendor/dragonmantank/cron-expression/README.md
index b9df3db5f..494652c84 100644
--- a/src/vendor/dragonmantank/cron-expression/README.md
+++ b/src/vendor/dragonmantank/cron-expression/README.md
@@ -1,7 +1,7 @@
PHP Cron Expression Parser
==========================
-[](https://packagist.org/packages/dragonmantank/cron-expression) [](https://packagist.org/packages/dragonmantank/cron-expression) [](https://github.com/dragonmantank/cron-expression/actions/workflows/tests.yml) [](https://github.styleci.io/repos/103715337)
+[](https://packagist.org/packages/dragonmantank/cron-expression) [](https://packagist.org/packages/dragonmantank/cron-expression) [](http://travis-ci.org/dragonmantank/cron-expression) [](https://github.styleci.io/repos/103715337)
The PHP cron expression parser can parse a CRON expression, determine if it is
due to run, calculate the next run date of the expression, and calculate the previous
@@ -55,65 +55,23 @@ CRON Expressions
A CRON expression is a string representing the schedule for a particular command to execute. The parts of a CRON schedule are as follows:
-```
-* * * * *
-- - - - -
-| | | | |
-| | | | |
-| | | | +----- day of week (0-7) (Sunday = 0 or 7) (or SUN-SAT)
-| | | +--------- month (1-12) (or JAN-DEC)
-| | +------------- day of month (1-31)
-| +----------------- hour (0-23)
-+--------------------- minute (0-59)
-```
+ * * * * *
+ - - - - -
+ | | | | |
+ | | | | |
+ | | | | +----- day of week (0 - 7) (Sunday=0 or 7)
+ | | | +---------- month (1 - 12)
+ | | +--------------- day of month (1 - 31)
+ | +-------------------- hour (0 - 23)
+ +------------------------- min (0 - 59)
-Each part of expression can also use wildcard, lists, ranges and steps:
+This library also supports a few macros:
-- wildcard - match always
- - `* * * * *` - At every minute.
- - day of week and day of month also support `?`, an alias to `*`
-- lists - match list of values, ranges and steps
- - e.g. `15,30 * * * *` - At minute 15 and 30.
-- ranges - match values in range
- - e.g. `1-9 * * * *` - At every minute from 1 through 9.
-- steps - match every nth value in range
- - e.g. `*/5 * * * *` - At every 5th minute.
- - e.g. `0-30/5 * * * *` - At every 5th minute from 0 through 30.
-- combinations
- - e.g. `0-14,30-44 * * * *` - At every minute from 0 through 14 and every minute from 30 through 44.
-
-You can also use macro instead of an expression:
-
-- `@yearly`, `@annually` - At 00:00 on 1st of January. (same as `0 0 1 1 *`)
-- `@monthly` - At 00:00 on day-of-month 1. (same as `0 0 1 * *`)
-- `@weekly` - At 00:00 on Sunday. (same as `0 0 * * 0`)
-- `@daily`, `@midnight` - At 00:00. (same as `0 0 * * *`)
-- `@hourly` - At minute 0. (same as `0 * * * *`)
-
-Day of month extra features:
-
-- nearest weekday - weekday (Monday-Friday) nearest to the given day
- - e.g. `* * 15W * *` - At every minute on a weekday nearest to the 15th.
- - If you were to specify `15W` as the value, the meaning is: "the nearest weekday to the 15th of the month"
- So if the 15th is a Saturday, the trigger will fire on Friday the 14th.
- If the 15th is a Sunday, the trigger will fire on Monday the 16th.
- If the 15th is a Tuesday, then it will fire on Tuesday the 15th.
- - However, if you specify `1W` as the value for day-of-month,
- and the 1st is a Saturday, the trigger will fire on Monday the 3rd,
- as it will not 'jump' over the boundary of a month's days.
-- last day of the month
- - e.g. `* * L * *` - At every minute on a last day-of-month.
-- last weekday of the month
- - e.g. `* * LW * *` - At every minute on a last weekday.
-
-Day of week extra features:
-
-- nth day
- - e.g. `* * * * 7#4` - At every minute on 4th Sunday.
- - 1-5
- - Every day of week repeats 4-5 times a month. To target the last one, use "last day" feature instead.
-- last day
- - e.g. `* * * * 7L` - At every minute on the last Sunday.
+* `@yearly`, `@annually` - Run once a year, midnight, Jan. 1 - `0 0 1 1 *`
+* `@monthly` - Run once a month, midnight, first of month - `0 0 1 * *`
+* `@weekly` - Run once a week, midnight on Sun - `0 0 * * 0`
+* `@daily`, `@midnight` - Run once a day, midnight - `0 0 * * *`
+* `@hourly` - Run once an hour, first minute - `0 * * * *`
Requirements
============
@@ -127,5 +85,3 @@ Projects that Use cron-expression
* Part of the [Laravel Framework](https://github.com/laravel/framework/)
* Available as a [Symfony Bundle - setono/cron-expression-bundle](https://github.com/Setono/CronExpressionBundle)
* Framework agnostic, PHP-based job scheduler - [Crunz](https://github.com/crunzphp/crunz)
-* Framework agnostic job scheduler - with locks, parallelism, per-second scheduling and more - [orisai/scheduler](https://github.com/orisai/scheduler)
-* Explain expression in English (and other languages) with [orisai/cron-expression-explainer](https://github.com/orisai/cron-expression-explainer)
diff --git a/src/vendor/dragonmantank/cron-expression/composer.json b/src/vendor/dragonmantank/cron-expression/composer.json
index fdb46ee41..657a5b47c 100644
--- a/src/vendor/dragonmantank/cron-expression/composer.json
+++ b/src/vendor/dragonmantank/cron-expression/composer.json
@@ -18,6 +18,7 @@
"require-dev": {
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
+ "phpstan/phpstan-webmozart-assert": "^1.0",
"phpstan/extension-installer": "^1.0"
},
"autoload": {
@@ -37,11 +38,6 @@
"phpstan": "./vendor/bin/phpstan analyze",
"test": "phpunit"
},
- "extra": {
- "branch-alias": {
- "dev-master": "3.x-dev"
- }
- },
"config": {
"allow-plugins": {
"ocramius/package-versions": true,
diff --git a/src/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php b/src/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php
index f3d8eb003..216ce432f 100644
--- a/src/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php
+++ b/src/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php
@@ -12,6 +12,7 @@ use Exception;
use InvalidArgumentException;
use LogicException;
use RuntimeException;
+use Webmozart\Assert\Assert;
/**
* CRON expression parser that can determine whether or not a CRON expression is
@@ -147,7 +148,7 @@ class CronExpression
/**
* @deprecated since version 3.0.2, use __construct instead.
*/
- public static function factory(string $expression, ?FieldFactoryInterface $fieldFactory = null): CronExpression
+ public static function factory(string $expression, FieldFactoryInterface $fieldFactory = null): CronExpression
{
/** @phpstan-ignore-next-line */
return new static($expression, $fieldFactory);
@@ -178,7 +179,7 @@ class CronExpression
* @param null|FieldFactoryInterface $fieldFactory Factory to create cron fields
* @throws InvalidArgumentException
*/
- public function __construct(string $expression, ?FieldFactoryInterface $fieldFactory = null)
+ public function __construct(string $expression, FieldFactoryInterface $fieldFactory = null)
{
$shortcut = strtolower($expression);
$expression = self::$registeredAliases[$shortcut] ?? $expression;
@@ -199,12 +200,7 @@ class CronExpression
public function setExpression(string $value): CronExpression
{
$split = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
-
- if (!\is_array($split)) {
- throw new InvalidArgumentException(
- $value . ' is not a valid CRON expression'
- );
- }
+ Assert::isArray($split);
$notEnoughParts = \count($split) < 5;
@@ -338,10 +334,7 @@ class CronExpression
$currentTime = new DateTime($currentTime);
}
- if (!$currentTime instanceof DateTime) {
- throw new InvalidArgumentException('invalid current time');
- }
-
+ Assert::isInstanceOf($currentTime, DateTime::class);
$currentTime->setTimezone(new DateTimeZone($timeZone));
$matches = [];
@@ -427,10 +420,7 @@ class CronExpression
$currentTime = new DateTime($currentTime);
}
- if (!$currentTime instanceof DateTime) {
- throw new InvalidArgumentException('invalid current time');
- }
-
+ Assert::isInstanceOf($currentTime, DateTime::class);
$currentTime->setTimezone(new DateTimeZone($timeZone));
// drop the seconds to 0
@@ -472,10 +462,7 @@ class CronExpression
$currentDate = new DateTime('now');
}
- if (!$currentDate instanceof DateTime) {
- throw new InvalidArgumentException('invalid current date');
- }
-
+ Assert::isInstanceOf($currentDate, DateTime::class);
$currentDate->setTimezone(new DateTimeZone($timeZone));
// Workaround for setTime causing an offset change: https://bugs.php.net/bug.php?id=81074
$currentDate = DateTime::createFromFormat("!Y-m-d H:iO", $currentDate->format("Y-m-d H:iP"), $currentDate->getTimezone());
diff --git a/src/vendor/ezyang/htmlpurifier/CHANGELOG.md b/src/vendor/ezyang/htmlpurifier/CHANGELOG.md
new file mode 100644
index 000000000..55cb9029c
--- /dev/null
+++ b/src/vendor/ezyang/htmlpurifier/CHANGELOG.md
@@ -0,0 +1,6 @@
+# [4.16.0](https://github.com/ezyang/htmlpurifier/compare/v4.15.0...v4.16.0) (2022-09-18)
+
+
+### Features
+
+* add semantic release ([#307](https://github.com/ezyang/htmlpurifier/issues/307)) ([db31243](https://github.com/ezyang/htmlpurifier/commit/db312435cb9d8d73395f75f9642a43ba6de5e903)), closes [#322](https://github.com/ezyang/htmlpurifier/issues/322) [#323](https://github.com/ezyang/htmlpurifier/issues/323) [#326](https://github.com/ezyang/htmlpurifier/issues/326) [#327](https://github.com/ezyang/htmlpurifier/issues/327) [#328](https://github.com/ezyang/htmlpurifier/issues/328) [#329](https://github.com/ezyang/htmlpurifier/issues/329) [#330](https://github.com/ezyang/htmlpurifier/issues/330) [#331](https://github.com/ezyang/htmlpurifier/issues/331) [#332](https://github.com/ezyang/htmlpurifier/issues/332) [#333](https://github.com/ezyang/htmlpurifier/issues/333) [#337](https://github.com/ezyang/htmlpurifier/issues/337) [#335](https://github.com/ezyang/htmlpurifier/issues/335) [ezyang/htmlpurifier#334](https://github.com/ezyang/htmlpurifier/issues/334) [#336](https://github.com/ezyang/htmlpurifier/issues/336) [#338](https://github.com/ezyang/htmlpurifier/issues/338)
diff --git a/src/vendor/ezyang/htmlpurifier/VERSION b/src/vendor/ezyang/htmlpurifier/VERSION
index 35e3d1bab..f029ee574 100644
--- a/src/vendor/ezyang/htmlpurifier/VERSION
+++ b/src/vendor/ezyang/htmlpurifier/VERSION
@@ -1 +1 @@
-4.19.0
\ No newline at end of file
+4.15.0
\ No newline at end of file
diff --git a/src/vendor/ezyang/htmlpurifier/composer.json b/src/vendor/ezyang/htmlpurifier/composer.json
index cfb715174..d75582950 100644
--- a/src/vendor/ezyang/htmlpurifier/composer.json
+++ b/src/vendor/ezyang/htmlpurifier/composer.json
@@ -13,7 +13,7 @@
}
],
"require": {
- "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0"
+ "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
@@ -38,8 +38,7 @@
"repositories": [
{
"type": "vcs",
- "url": "https://github.com/ezyang/simpletest.git",
- "no-api": true
+ "url": "https://github.com/ezyang/simpletest.git"
}
]
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
index 1f99a4aa2..47ee0133d 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php
@@ -7,7 +7,7 @@
* primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS
* FILE, changes will be overwritten the next time the script is run.
*
- * @version 4.19.0
+ * @version 4.15.0
*
* @warning
* You must *not* include any other HTML Purifier files before this file,
@@ -101,7 +101,6 @@ require 'HTMLPurifier/AttrDef/CSS/Length.php';
require 'HTMLPurifier/AttrDef/CSS/ListStyle.php';
require 'HTMLPurifier/AttrDef/CSS/Multiple.php';
require 'HTMLPurifier/AttrDef/CSS/Percentage.php';
-require 'HTMLPurifier/AttrDef/CSS/Ratio.php';
require 'HTMLPurifier/AttrDef/CSS/TextDecoration.php';
require 'HTMLPurifier/AttrDef/CSS/URI.php';
require 'HTMLPurifier/AttrDef/HTML/Bool.php';
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
index 31b5a0f79..26f061276 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php
@@ -19,7 +19,7 @@
*/
/*
- HTML Purifier 4.19.0 - Standards Compliant HTML Filtering
+ HTML Purifier 4.15.0 - Standards Compliant HTML Filtering
Copyright (C) 2006-2008 Edward Z. Yang
This library is free software; you can redistribute it and/or
@@ -58,12 +58,12 @@ class HTMLPurifier
* Version of HTML Purifier.
* @type string
*/
- public $version = '4.19.0';
+ public $version = '4.15.0';
/**
* Constant with version of HTML Purifier.
*/
- const VERSION = '4.19.0';
+ const VERSION = '4.15.0';
/**
* Global configuration object.
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php
index 8a417d246..94543f593 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php
@@ -95,7 +95,6 @@ require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Length.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/ListStyle.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Multiple.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Percentage.php';
-require_once $__dir . '/HTMLPurifier/AttrDef/CSS/Ratio.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/TextDecoration.php';
require_once $__dir . '/HTMLPurifier/AttrDef/CSS/URI.php';
require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php';
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php
index af6b8a05d..ad2cb90ad 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php
@@ -27,13 +27,6 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
$definition = $config->getCSSDefinition();
$allow_duplicates = $config->get("CSS.AllowDuplicates");
- $universal_attrdef = new HTMLPurifier_AttrDef_Enum(
- array(
- 'initial',
- 'inherit',
- 'unset',
- )
- );
// According to the CSS2.1 spec, the places where a
// non-delimiting semicolon can appear are in strings
@@ -103,13 +96,16 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
if (!$ok) {
continue;
}
- $result = $universal_attrdef->validate($value, $config, $context);
- if ($result === false) {
+ // inefficient call, since the validator will do this again
+ if (strtolower(trim($value)) !== 'inherit') {
+ // inherit works for everything (but only on the base property)
$result = $definition->info[$property]->validate(
$value,
$config,
$context
);
+ } else {
+ $result = 'inherit';
}
if ($result === false) {
continue;
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
index 799166bb9..74e24c881 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
@@ -10,21 +10,23 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
public function __construct()
{
- // Lowercase letters
- $l = range('a', 'z');
- // Uppercase letters
- $u = range('A', 'Z');
- // Digits
- $d = range('0', '9');
- // Special bytes used by UTF-8
- $b = array_map('chr', range(0x80, 0xFF));
- // All valid characters for the mask
- $c = array_merge($l, $u, $d, $b);
- // Concatenate all valid characters into a string
- // Use '_- ' as an initial value
- $this->mask = array_reduce($c, function ($carry, $value) {
- return $carry . $value;
- }, '_- ');
+ $this->mask = '_- ';
+ for ($c = 'a'; $c <= 'z'; $c++) {
+ $this->mask .= $c;
+ }
+ for ($c = 'A'; $c <= 'Z'; $c++) {
+ $this->mask .= $c;
+ }
+ for ($c = '0'; $c <= '9'; $c++) {
+ $this->mask .= $c;
+ } // cast-y, but should be fine
+ // special bytes used by UTF-8
+ for ($i = 0x80; $i <= 0xFF; $i++) {
+ // We don't bother excluding invalid bytes in this range,
+ // because the our restriction of well-formed UTF-8 will
+ // prevent these from ever occurring.
+ $this->mask .= chr($i);
+ }
/*
PHP's internal strcspn implementation is
@@ -195,7 +197,7 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
// transforms don't pose a security risk (as \\ and \"
// might--these escapes are not supported by most browsers).
// We could try to be clever and use single-quote wrapping
- // when there is a double quote present, but I have chosen
+ // when there is a double quote present, but I have choosen
// not to implement that. (NOTE: you can reduce the amount
// of escapes by one depending on what quoting style you use)
// $font = str_replace('\\', '\\5C ', $font);
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
index 3decf0c45..63fa04c15 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
@@ -25,7 +25,12 @@ class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef
'rev' => 'AllowedRev'
);
if (!isset($configLookup[$name])) {
- throw new Exception('Unrecognized attribute name for link relationship.');
+ trigger_error(
+ 'Unrecognized attribute name for link ' .
+ 'relationship.',
+ E_USER_ERROR
+ );
+ return;
}
$this->name = $configLookup[$name];
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php
index 17a97c1ec..1beeaa5d2 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php
@@ -63,18 +63,24 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
// This doesn't match I18N domain names, but we don't have proper IRI support,
// so force users to insert Punycode.
- // Underscores defined as Unreserved Characters in RFC 3986 are
- // allowed in a URI. There are cases where we want to consider a
- // URI containing "_" such as "_dmarc.example.com".
- // Underscores are not allowed in the default. If you want to
- // allow it, set Core.AllowHostnameUnderscore to true.
+ // There is not a good sense in which underscores should be
+ // allowed, since it's technically not! (And if you go as
+ // far to allow everything as specified by the DNS spec...
+ // well, that's literally everything, modulo some space limits
+ // for the components and the overall name (which, by the way,
+ // we are NOT checking!). So we (arbitrarily) decide this:
+ // let's allow underscores wherever we would have allowed
+ // hyphens, if they are enabled. This is a pretty good match
+ // for browser behavior, for example, a large number of browsers
+ // cannot handle foo_.example.com, but foo_bar.example.com is
+ // fairly well supported.
$underscore = $config->get('Core.AllowHostnameUnderscore') ? '_' : '';
// Based off of RFC 1738, but amended so that
// as per RFC 3696, the top label need only not be all numeric.
// The productions describing this are:
$a = '[a-z]'; // alpha
- $an = "[a-z0-9$underscore]"; // alphanum
+ $an = '[a-z0-9]'; // alphanum
$and = "[a-z0-9-$underscore]"; // alphanum | "-"
// domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
$domainlabel = "$an(?:$and*$an)?";
@@ -100,7 +106,7 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
// If we have Net_IDNA2 support, we can support IRIs by
// punycoding them. (This is the most portable thing to do,
// since otherwise we have to assume browsers support
- } elseif ($config->get('Core.EnableIDNA') && class_exists('Net_IDNA2')) {
+ } elseif ($config->get('Core.EnableIDNA')) {
$idna = new Net_IDNA2(array('encoding' => 'utf8', 'overlong' => false, 'strict' => true));
// we need to encode each period separately
$parts = explode('.', $string);
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php
index dc4ef62ee..f243793ee 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php
@@ -37,7 +37,7 @@ class HTMLPurifier_AttrDef_URI_IPv6 extends HTMLPurifier_AttrDef_URI_IPv4
}
}
- // IPv4-compatibility check
+ // IPv4-compatiblity check
if (preg_match('#(?<=:' . ')' . $this->ip4 . '$#s', $aIP, $find)) {
$aIP = substr($aIP, 0, 0 - strlen($find[0]));
$ip = explode('.', $find[0]);
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php
index d769c6fd2..d66c04a5b 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php
@@ -3,7 +3,7 @@
// this MUST be placed in post, as it assumes that any value in dir is valid
/**
- * Post-transform that ensures that bdo tags have the dir attribute set.
+ * Post-trasnform that ensures that bdo tags have the dir attribute set.
*/
class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
{
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php
index cc30ab8c3..dd63ea89c 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php
@@ -33,11 +33,7 @@ class HTMLPurifier_AttrTransform_TargetBlank extends HTMLPurifier_AttrTransform
// XXX Kind of inefficient
$url = $this->parser->parse($attr['href']);
-
- // Ignore invalid schemes (e.g. `javascript:`)
- if (!($scheme = $url->getSchemeObj($config, $context))) {
- return $attr;
- }
+ $scheme = $url->getSchemeObj($config, $context);
if ($scheme->browsable && !$url->isBenign($config, $context)) {
$attr['target'] = '_blank';
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php
index 62575ca65..e4429e86d 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php
@@ -77,7 +77,7 @@ class HTMLPurifier_AttrTypes
}
if (!isset($this->info[$type])) {
- throw new Exception('Cannot retrieve undefined attribute type ' . $type);
+ trigger_error('Cannot retrieve undefined attribute type ' . $type, E_USER_ERROR);
return;
}
return $this->info[$type]->make($string);
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php
index 350330bb5..f97dc93ed 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php
@@ -135,7 +135,7 @@ class HTMLPurifier_AttrValidator
// we'd also want slightly more complicated substitution
// involving an array as the return value,
// although we're not sure how colliding attributes would
- // resolve (certain ones would be completely overridden,
+ // resolve (certain ones would be completely overriden,
// others would prepend themselves).
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php
index 8805eccff..707122bb2 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php
@@ -5,7 +5,7 @@ if (!defined('HTMLPURIFIER_PREFIX')) {
define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/..'));
}
-// accommodations for versions earlier than 5.0.2
+// accomodations for versions earlier than 5.0.2
// borrowed from PHP_Compat, LGPL licensed, by Aidan Lister
if (!defined('PHP_EOL')) {
switch (strtoupper(substr(PHP_OS, 0, 3))) {
@@ -79,11 +79,44 @@ class HTMLPurifier_Bootstrap
public static function registerAutoload()
{
$autoload = array('HTMLPurifier_Bootstrap', 'autoload');
- if (spl_autoload_functions() === false) {
+ if (($funcs = spl_autoload_functions()) === false) {
spl_autoload_register($autoload);
- } else {
- // prepend flag exists, no need for shenanigans
- spl_autoload_register($autoload, true, true);
+ } elseif (function_exists('spl_autoload_unregister')) {
+ if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
+ // prepend flag exists, no need for shenanigans
+ spl_autoload_register($autoload, true, true);
+ } else {
+ $buggy = version_compare(PHP_VERSION, '5.2.11', '<');
+ $compat = version_compare(PHP_VERSION, '5.1.2', '<=') &&
+ version_compare(PHP_VERSION, '5.1.0', '>=');
+ foreach ($funcs as $func) {
+ if ($buggy && is_array($func)) {
+ // :TRICKY: There are some compatibility issues and some
+ // places where we need to error out
+ $reflector = new ReflectionMethod($func[0], $func[1]);
+ if (!$reflector->isStatic()) {
+ throw new Exception(
+ 'HTML Purifier autoloader registrar is not compatible
+ with non-static object methods due to PHP Bug #44144;
+ Please do not use HTMLPurifier.autoload.php (or any
+ file that includes this file); instead, place the code:
+ spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\'))
+ after your own autoloaders.'
+ );
+ }
+ // Suprisingly, spl_autoload_register supports the
+ // Class::staticMethod callback format, although call_user_func doesn't
+ if ($compat) {
+ $func = implode('::', $func);
+ }
+ }
+ spl_autoload_unregister($func);
+ }
+ spl_autoload_register($autoload);
+ foreach ($funcs as $func) {
+ spl_autoload_register($func);
+ }
+ }
}
}
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
index 923d6f3d0..3f08b81c5 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php
@@ -13,7 +13,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
* Assoc array of attribute name to definition object.
* @type HTMLPurifier_AttrDef[]
*/
- public $info = [];
+ public $info = array();
/**
* Constructs the info array. The meat of this class.
@@ -22,12 +22,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
protected function doSetup($config)
{
$this->info['text-align'] = new HTMLPurifier_AttrDef_Enum(
- ['left', 'right', 'center', 'justify'],
- false
- );
-
- $this->info['direction'] = new HTMLPurifier_AttrDef_Enum(
- ['ltr', 'rtl'],
+ array('left', 'right', 'center', 'justify'),
false
);
@@ -36,7 +31,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['border-right-style'] =
$this->info['border-left-style'] =
$this->info['border-top-style'] = new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'none',
'hidden',
'dotted',
@@ -47,42 +42,42 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'ridge',
'inset',
'outset'
- ],
+ ),
false
);
$this->info['border-style'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_style);
$this->info['clear'] = new HTMLPurifier_AttrDef_Enum(
- ['none', 'left', 'right', 'both'],
+ array('none', 'left', 'right', 'both'),
false
);
$this->info['float'] = new HTMLPurifier_AttrDef_Enum(
- ['none', 'left', 'right'],
+ array('none', 'left', 'right'),
false
);
$this->info['font-style'] = new HTMLPurifier_AttrDef_Enum(
- ['normal', 'italic', 'oblique'],
+ array('normal', 'italic', 'oblique'),
false
);
$this->info['font-variant'] = new HTMLPurifier_AttrDef_Enum(
- ['normal', 'small-caps'],
+ array('normal', 'small-caps'),
false
);
$uri_or_none = new HTMLPurifier_AttrDef_CSS_Composite(
- [
- new HTMLPurifier_AttrDef_Enum(['none']),
+ array(
+ new HTMLPurifier_AttrDef_Enum(array('none')),
new HTMLPurifier_AttrDef_CSS_URI()
- ]
+ )
);
$this->info['list-style-position'] = new HTMLPurifier_AttrDef_Enum(
- ['inside', 'outside'],
+ array('inside', 'outside'),
false
);
$this->info['list-style-type'] = new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'disc',
'circle',
'square',
@@ -92,7 +87,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'lower-alpha',
'upper-alpha',
'none'
- ],
+ ),
false
);
$this->info['list-style-image'] = $uri_or_none;
@@ -100,32 +95,34 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['list-style'] = new HTMLPurifier_AttrDef_CSS_ListStyle($config);
$this->info['text-transform'] = new HTMLPurifier_AttrDef_Enum(
- ['capitalize', 'uppercase', 'lowercase', 'none'],
+ array('capitalize', 'uppercase', 'lowercase', 'none'),
false
);
$this->info['color'] = new HTMLPurifier_AttrDef_CSS_Color();
$this->info['background-image'] = $uri_or_none;
$this->info['background-repeat'] = new HTMLPurifier_AttrDef_Enum(
- ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
+ array('repeat', 'repeat-x', 'repeat-y', 'no-repeat')
);
$this->info['background-attachment'] = new HTMLPurifier_AttrDef_Enum(
- ['scroll', 'fixed']
+ array('scroll', 'fixed')
);
$this->info['background-position'] = new HTMLPurifier_AttrDef_CSS_BackgroundPosition();
$this->info['background-size'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'auto',
'cover',
'contain',
- ]
+ 'initial',
+ 'inherit',
+ )
),
new HTMLPurifier_AttrDef_CSS_Percentage(),
new HTMLPurifier_AttrDef_CSS_Length()
- ]
+ )
);
$border_color =
@@ -134,10 +131,10 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['border-left-color'] =
$this->info['border-right-color'] =
$this->info['background-color'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
- new HTMLPurifier_AttrDef_Enum(['transparent']),
+ array(
+ new HTMLPurifier_AttrDef_Enum(array('transparent')),
new HTMLPurifier_AttrDef_CSS_Color()
- ]
+ )
);
$this->info['background'] = new HTMLPurifier_AttrDef_CSS_Background($config);
@@ -149,32 +146,32 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['border-bottom-width'] =
$this->info['border-left-width'] =
$this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
- new HTMLPurifier_AttrDef_Enum(['thin', 'medium', 'thick']),
+ array(
+ new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')),
new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative
- ]
+ )
);
$this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width);
$this->info['letter-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
- new HTMLPurifier_AttrDef_Enum(['normal']),
+ array(
+ new HTMLPurifier_AttrDef_Enum(array('normal')),
new HTMLPurifier_AttrDef_CSS_Length()
- ]
+ )
);
$this->info['word-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
- new HTMLPurifier_AttrDef_Enum(['normal']),
+ array(
+ new HTMLPurifier_AttrDef_Enum(array('normal')),
new HTMLPurifier_AttrDef_CSS_Length()
- ]
+ )
);
$this->info['font-size'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'xx-small',
'x-small',
'small',
@@ -184,20 +181,20 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'xx-large',
'larger',
'smaller'
- ]
+ )
),
new HTMLPurifier_AttrDef_CSS_Percentage(),
new HTMLPurifier_AttrDef_CSS_Length()
- ]
+ )
);
$this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
- new HTMLPurifier_AttrDef_Enum(['normal']),
+ array(
+ new HTMLPurifier_AttrDef_Enum(array('normal')),
new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true)
- ]
+ )
);
$margin =
@@ -205,11 +202,11 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['margin-bottom'] =
$this->info['margin-left'] =
$this->info['margin-right'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length(),
new HTMLPurifier_AttrDef_CSS_Percentage(),
- new HTMLPurifier_AttrDef_Enum(['auto'])
- ]
+ new HTMLPurifier_AttrDef_Enum(array('auto'))
+ )
);
$this->info['margin'] = new HTMLPurifier_AttrDef_CSS_Multiple($margin);
@@ -220,40 +217,41 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['padding-bottom'] =
$this->info['padding-left'] =
$this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true)
- ]
+ )
);
$this->info['padding'] = new HTMLPurifier_AttrDef_CSS_Multiple($padding);
$this->info['text-indent'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length(),
new HTMLPurifier_AttrDef_CSS_Percentage()
- ]
+ )
);
$trusted_wh = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true),
- new HTMLPurifier_AttrDef_Enum(['auto'])
- ]
+ new HTMLPurifier_AttrDef_Enum(array('auto', 'initial', 'inherit'))
+ )
);
$trusted_min_wh = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true),
- ]
+ new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit'))
+ )
);
$trusted_max_wh = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length('0'),
new HTMLPurifier_AttrDef_CSS_Percentage(true),
- new HTMLPurifier_AttrDef_Enum(['none'])
- ]
+ new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit'))
+ )
);
$max = $config->get('CSS.MaxImgLength');
@@ -265,10 +263,10 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'img',
// For img tags:
new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
- new HTMLPurifier_AttrDef_Enum(['auto'])
- ]
+ new HTMLPurifier_AttrDef_Enum(array('auto'))
+ )
),
// For everyone else:
$trusted_wh
@@ -280,7 +278,12 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
new HTMLPurifier_AttrDef_Switch(
'img',
// For img tags:
- new HTMLPurifier_AttrDef_CSS_Length('0', $max),
+ new HTMLPurifier_AttrDef_CSS_Composite(
+ array(
+ new HTMLPurifier_AttrDef_CSS_Length('0', $max),
+ new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit'))
+ )
+ ),
// For everyone else:
$trusted_min_wh
);
@@ -292,46 +295,22 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'img',
// For img tags:
new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length('0', $max),
- new HTMLPurifier_AttrDef_Enum(['none'])
- ]
+ new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit'))
+ )
),
// For everyone else:
$trusted_max_wh
);
- $this->info['aspect-ratio'] = new HTMLPurifier_AttrDef_CSS_Multiple(
- new HTMLPurifier_AttrDef_CSS_Composite([
- new HTMLPurifier_AttrDef_CSS_Ratio(),
- new HTMLPurifier_AttrDef_Enum(['auto']),
- ])
- );
-
- // text-decoration and related shorthands
$this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration();
- $this->info['text-decoration-line'] = new HTMLPurifier_AttrDef_Enum(
- ['none', 'underline', 'overline', 'line-through']
- );
-
- $this->info['text-decoration-style'] = new HTMLPurifier_AttrDef_Enum(
- ['solid', 'double', 'dotted', 'dashed', 'wavy']
- );
-
- $this->info['text-decoration-color'] = new HTMLPurifier_AttrDef_CSS_Color();
-
- $this->info['text-decoration-thickness'] = new HTMLPurifier_AttrDef_CSS_Composite([
- new HTMLPurifier_AttrDef_CSS_Length(),
- new HTMLPurifier_AttrDef_CSS_Percentage(),
- new HTMLPurifier_AttrDef_Enum(['auto', 'from-font'])
- ]);
-
$this->info['font-family'] = new HTMLPurifier_AttrDef_CSS_FontFamily();
// this could use specialized code
$this->info['font-weight'] = new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'normal',
'bold',
'bolder',
@@ -345,7 +324,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'700',
'800',
'900'
- ],
+ ),
false
);
@@ -361,21 +340,21 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
$this->info['border-right'] = new HTMLPurifier_AttrDef_CSS_Border($config);
$this->info['border-collapse'] = new HTMLPurifier_AttrDef_Enum(
- ['collapse', 'separate']
+ array('collapse', 'separate')
);
$this->info['caption-side'] = new HTMLPurifier_AttrDef_Enum(
- ['top', 'bottom']
+ array('top', 'bottom')
);
$this->info['table-layout'] = new HTMLPurifier_AttrDef_Enum(
- ['auto', 'fixed']
+ array('auto', 'fixed')
);
$this->info['vertical-align'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'baseline',
'sub',
'super',
@@ -384,11 +363,11 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'middle',
'bottom',
'text-bottom'
- ]
+ )
),
new HTMLPurifier_AttrDef_CSS_Length(),
new HTMLPurifier_AttrDef_CSS_Percentage()
- ]
+ )
);
$this->info['border-spacing'] = new HTMLPurifier_AttrDef_CSS_Multiple(new HTMLPurifier_AttrDef_CSS_Length(), 2);
@@ -396,7 +375,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
// These CSS properties don't work on many browsers, but we live
// in THE FUTURE!
$this->info['white-space'] = new HTMLPurifier_AttrDef_Enum(
- ['nowrap', 'normal', 'pre', 'pre-wrap', 'pre-line']
+ array('nowrap', 'normal', 'pre', 'pre-wrap', 'pre-line')
);
if ($config->get('CSS.Proprietary')) {
@@ -443,21 +422,21 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
// more CSS3
$this->info['page-break-after'] =
$this->info['page-break-before'] = new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'auto',
'always',
'avoid',
'left',
'right'
- ]
+ )
);
- $this->info['page-break-inside'] = new HTMLPurifier_AttrDef_Enum(['auto', 'avoid']);
+ $this->info['page-break-inside'] = new HTMLPurifier_AttrDef_Enum(array('auto', 'avoid'));
$border_radius = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Percentage(true), // disallow negative
new HTMLPurifier_AttrDef_CSS_Length('0') // disallow negative
- ]);
+ ));
$this->info['border-top-left-radius'] =
$this->info['border-top-right-radius'] =
@@ -474,7 +453,7 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
protected function doSetupTricky($config)
{
$this->info['display'] = new HTMLPurifier_AttrDef_Enum(
- [
+ array(
'inline',
'block',
'list-item',
@@ -493,12 +472,12 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
'table-cell',
'table-caption',
'none'
- ]
+ )
);
$this->info['visibility'] = new HTMLPurifier_AttrDef_Enum(
- ['visible', 'hidden', 'collapse']
+ array('visible', 'hidden', 'collapse')
);
- $this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(['visible', 'hidden', 'auto', 'scroll']);
+ $this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(array('visible', 'hidden', 'auto', 'scroll'));
$this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue();
}
@@ -508,23 +487,23 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
protected function doSetupTrusted($config)
{
$this->info['position'] = new HTMLPurifier_AttrDef_Enum(
- ['static', 'relative', 'absolute', 'fixed']
+ array('static', 'relative', 'absolute', 'fixed')
);
$this->info['top'] =
$this->info['left'] =
$this->info['right'] =
$this->info['bottom'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_CSS_Length(),
new HTMLPurifier_AttrDef_CSS_Percentage(),
- new HTMLPurifier_AttrDef_Enum(['auto']),
- ]
+ new HTMLPurifier_AttrDef_Enum(array('auto')),
+ )
);
$this->info['z-index'] = new HTMLPurifier_AttrDef_CSS_Composite(
- [
+ array(
new HTMLPurifier_AttrDef_Integer(),
- new HTMLPurifier_AttrDef_Enum(['auto']),
- ]
+ new HTMLPurifier_AttrDef_Enum(array('auto')),
+ )
);
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php
index d92205b32..67c7e9535 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php
@@ -190,9 +190,6 @@ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
$current_tr_tbody = null;
foreach($content as $node) {
- if (!isset($node->name)) {
- continue;
- }
switch ($node->name) {
case 'tbody':
$current_tr_tbody = null;
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
index 256408e2f..797d26877 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php
@@ -21,7 +21,7 @@ class HTMLPurifier_Config
* HTML Purifier's version
* @type string
*/
- public $version = '4.19.0';
+ public $version = '4.15.0';
/**
* Whether or not to automatically finalize
@@ -898,11 +898,7 @@ class HTMLPurifier_Config
break;
}
}
- if ($no == E_USER_ERROR) {
- throw new Exception($msg . $extra);
- } else {
- trigger_error($msg . $extra, $no);
- }
+ trigger_error($msg . $extra, $no);
}
/**
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php
index 42f660473..c3fe8cd4a 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php
@@ -72,7 +72,7 @@ class HTMLPurifier_ConfigSchema
$r = unserialize($contents);
if (!$r) {
$hash = sha1($contents);
- throw new Exception("Unserialization of configuration schema failed, sha1 of file was $hash");
+ trigger_error("Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR);
}
return $r;
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php
index 4902a56d9..127a39a67 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php
@@ -66,7 +66,7 @@ class HTMLPurifier_ConfigSchema_Interchange_Directive
public $version;
/**
- * ID of directive that supersedes this old directive.
+ * ID of directive that supercedes this old directive.
* Null if not deprecated.
* @type HTMLPurifier_ConfigSchema_Interchange_Id
*/
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser
index 34ea68371..a5426c736 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser
@@ -1 +1 @@
-O:25:"HTMLPurifier_ConfigSchema":3:{s:8:"defaults";a:130:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";N;s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:17:"Core.RemoveBlanks";b:0;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";N;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:18:"URI.AllowedSymbols";s:11:"!$&'()*+,;=";s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:19:"URI.SafeIframeHosts";N;s:20:"URI.SafeIframeRegexp";N;}s:12:"defaultPlist";O:25:"HTMLPurifier_PropertyList":3:{s:7:" * data";a:130:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";N;s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:17:"Core.RemoveBlanks";b:0;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";N;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:18:"URI.AllowedSymbols";s:11:"!$&'()*+,;=";s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:19:"URI.SafeIframeHosts";N;s:20:"URI.SafeIframeRegexp";N;}s:9:" * parent";N;s:8:" * cache";N;}s:4:"info";a:143:{s:19:"Attr.AllowedClasses";i:-8;s:24:"Attr.AllowedFrameTargets";i:8;s:15:"Attr.AllowedRel";i:8;s:15:"Attr.AllowedRev";i:8;s:18:"Attr.ClassUseCDATA";i:-7;s:20:"Attr.DefaultImageAlt";i:-1;s:24:"Attr.DefaultInvalidImage";i:1;s:27:"Attr.DefaultInvalidImageAlt";i:1;s:19:"Attr.DefaultTextDir";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:2:{s:3:"ltr";b:1;s:3:"rtl";b:1;}}s:13:"Attr.EnableID";i:7;s:17:"HTML.EnableAttrID";O:8:"stdClass":2:{s:3:"key";s:13:"Attr.EnableID";s:7:"isAlias";b:1;}s:21:"Attr.ForbiddenClasses";i:8;s:13:"Attr.ID.HTML5";i:-7;s:16:"Attr.IDBlacklist";i:9;s:22:"Attr.IDBlacklistRegexp";i:-1;s:13:"Attr.IDPrefix";i:1;s:18:"Attr.IDPrefixLocal";i:1;s:24:"AutoFormat.AutoParagraph";i:7;s:17:"AutoFormat.Custom";i:9;s:25:"AutoFormat.DisplayLinkURI";i:7;s:18:"AutoFormat.Linkify";i:7;s:33:"AutoFormat.PurifierLinkify.DocURL";i:1;s:37:"AutoFormatParam.PurifierLinkifyDocURL";O:8:"stdClass":2:{s:3:"key";s:33:"AutoFormat.PurifierLinkify.DocURL";s:7:"isAlias";b:1;}s:26:"AutoFormat.PurifierLinkify";i:7;s:32:"AutoFormat.RemoveEmpty.Predicate";i:10;s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";i:8;s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";i:7;s:22:"AutoFormat.RemoveEmpty";i:7;s:39:"AutoFormat.RemoveSpansWithoutAttributes";i:7;s:19:"CSS.AllowDuplicates";i:7;s:18:"CSS.AllowImportant";i:7;s:15:"CSS.AllowTricky";i:7;s:16:"CSS.AllowedFonts";i:-8;s:21:"CSS.AllowedProperties";i:-8;s:17:"CSS.DefinitionRev";i:5;s:23:"CSS.ForbiddenProperties";i:8;s:16:"CSS.MaxImgLength";i:-1;s:15:"CSS.Proprietary";i:7;s:11:"CSS.Trusted";i:7;s:20:"Cache.DefinitionImpl";i:-1;s:20:"Core.DefinitionCache";O:8:"stdClass":2:{s:3:"key";s:20:"Cache.DefinitionImpl";s:7:"isAlias";b:1;}s:20:"Cache.SerializerPath";i:-1;s:27:"Cache.SerializerPermissions";i:-5;s:22:"Core.AggressivelyFixLt";i:7;s:29:"Core.AggressivelyRemoveScript";i:7;s:28:"Core.AllowHostnameUnderscore";i:7;s:23:"Core.AllowParseManyTags";i:7;s:18:"Core.CollectErrors";i:7;s:18:"Core.ColorKeywords";i:10;s:30:"Core.ConvertDocumentToFragment";i:7;s:24:"Core.AcceptFullDocuments";O:8:"stdClass":2:{s:3:"key";s:30:"Core.ConvertDocumentToFragment";s:7:"isAlias";b:1;}s:36:"Core.DirectLexLineNumberSyncInterval";i:5;s:20:"Core.DisableExcludes";i:7;s:15:"Core.EnableIDNA";i:7;s:13:"Core.Encoding";i:2;s:26:"Core.EscapeInvalidChildren";i:7;s:22:"Core.EscapeInvalidTags";i:7;s:29:"Core.EscapeNonASCIICharacters";i:7;s:19:"Core.HiddenElements";i:8;s:13:"Core.Language";i:1;s:24:"Core.LegacyEntityDecoder";i:7;s:14:"Core.LexerImpl";i:-11;s:24:"Core.MaintainLineNumbers";i:-7;s:22:"Core.NormalizeNewlines";i:7;s:17:"Core.RemoveBlanks";i:7;s:21:"Core.RemoveInvalidImg";i:7;s:33:"Core.RemoveProcessingInstructions";i:7;s:25:"Core.RemoveScriptContents";i:-7;s:13:"Filter.Custom";i:9;s:34:"Filter.ExtractStyleBlocks.Escaping";i:7;s:33:"Filter.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:38:"FilterParam.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:31:"Filter.ExtractStyleBlocks.Scope";i:-1;s:30:"Filter.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:35:"FilterParam.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:34:"Filter.ExtractStyleBlocks.TidyImpl";i:-11;s:38:"FilterParam.ExtractStyleBlocksTidyImpl";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.TidyImpl";s:7:"isAlias";b:1;}s:25:"Filter.ExtractStyleBlocks";i:7;s:14:"Filter.YouTube";i:7;s:12:"HTML.Allowed";i:-4;s:22:"HTML.AllowedAttributes";i:-8;s:20:"HTML.AllowedComments";i:8;s:26:"HTML.AllowedCommentsRegexp";i:-1;s:20:"HTML.AllowedElements";i:-8;s:19:"HTML.AllowedModules";i:-8;s:23:"HTML.Attr.Name.UseCDATA";i:7;s:17:"HTML.BlockWrapper";i:1;s:16:"HTML.CoreModules";i:8;s:18:"HTML.CustomDoctype";i:-1;s:17:"HTML.DefinitionID";i:-1;s:18:"HTML.DefinitionRev";i:5;s:12:"HTML.Doctype";O:8:"stdClass":3:{s:4:"type";i:1;s:10:"allow_null";b:1;s:7:"allowed";a:5:{s:22:"HTML 4.01 Transitional";b:1;s:16:"HTML 4.01 Strict";b:1;s:22:"XHTML 1.0 Transitional";b:1;s:16:"XHTML 1.0 Strict";b:1;s:9:"XHTML 1.1";b:1;}}s:25:"HTML.FlashAllowFullScreen";i:7;s:24:"HTML.ForbiddenAttributes";i:8;s:22:"HTML.ForbiddenElements";i:8;s:10:"HTML.Forms";i:7;s:17:"HTML.MaxImgLength";i:-5;s:13:"HTML.Nofollow";i:7;s:11:"HTML.Parent";i:1;s:16:"HTML.Proprietary";i:7;s:14:"HTML.SafeEmbed";i:7;s:15:"HTML.SafeIframe";i:7;s:15:"HTML.SafeObject";i:7;s:18:"HTML.SafeScripting";i:8;s:11:"HTML.Strict";i:7;s:16:"HTML.TargetBlank";i:7;s:19:"HTML.TargetNoopener";i:7;s:21:"HTML.TargetNoreferrer";i:7;s:12:"HTML.TidyAdd";i:8;s:14:"HTML.TidyLevel";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:4:{s:4:"none";b:1;s:5:"light";b:1;s:6:"medium";b:1;s:5:"heavy";b:1;}}s:15:"HTML.TidyRemove";i:8;s:12:"HTML.Trusted";i:7;s:10:"HTML.XHTML";i:7;s:10:"Core.XHTML";O:8:"stdClass":2:{s:3:"key";s:10:"HTML.XHTML";s:7:"isAlias";b:1;}s:28:"Output.CommentScriptContents";i:7;s:26:"Core.CommentScriptContents";O:8:"stdClass":2:{s:3:"key";s:28:"Output.CommentScriptContents";s:7:"isAlias";b:1;}s:19:"Output.FixInnerHTML";i:7;s:18:"Output.FlashCompat";i:7;s:14:"Output.Newline";i:-1;s:15:"Output.SortAttr";i:7;s:17:"Output.TidyFormat";i:7;s:15:"Core.TidyFormat";O:8:"stdClass":2:{s:3:"key";s:17:"Output.TidyFormat";s:7:"isAlias";b:1;}s:17:"Test.ForceNoIconv";i:7;s:18:"URI.AllowedSchemes";i:8;s:18:"URI.AllowedSymbols";i:-1;s:8:"URI.Base";i:-1;s:17:"URI.DefaultScheme";i:-1;s:16:"URI.DefinitionID";i:-1;s:17:"URI.DefinitionRev";i:5;s:11:"URI.Disable";i:7;s:15:"Attr.DisableURI";O:8:"stdClass":2:{s:3:"key";s:11:"URI.Disable";s:7:"isAlias";b:1;}s:19:"URI.DisableExternal";i:7;s:28:"URI.DisableExternalResources";i:7;s:20:"URI.DisableResources";i:7;s:8:"URI.Host";i:-1;s:17:"URI.HostBlacklist";i:9;s:16:"URI.MakeAbsolute";i:7;s:9:"URI.Munge";i:-1;s:18:"URI.MungeResources";i:7;s:18:"URI.MungeSecretKey";i:-1;s:26:"URI.OverrideAllowedSchemes";i:7;s:19:"URI.SafeIframeHosts";i:-8;s:20:"URI.SafeIframeRegexp";i:-1;}}
\ No newline at end of file
+O:25:"HTMLPurifier_ConfigSchema":3:{s:8:"defaults";a:127:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:12:"defaultPlist";O:25:"HTMLPurifier_PropertyList":3:{s:7:" * data";a:127:{s:19:"Attr.AllowedClasses";N;s:24:"Attr.AllowedFrameTargets";a:0:{}s:15:"Attr.AllowedRel";a:0:{}s:15:"Attr.AllowedRev";a:0:{}s:18:"Attr.ClassUseCDATA";N;s:20:"Attr.DefaultImageAlt";N;s:24:"Attr.DefaultInvalidImage";s:0:"";s:27:"Attr.DefaultInvalidImageAlt";s:13:"Invalid image";s:19:"Attr.DefaultTextDir";s:3:"ltr";s:13:"Attr.EnableID";b:0;s:21:"Attr.ForbiddenClasses";a:0:{}s:13:"Attr.ID.HTML5";N;s:16:"Attr.IDBlacklist";a:0:{}s:22:"Attr.IDBlacklistRegexp";N;s:13:"Attr.IDPrefix";s:0:"";s:18:"Attr.IDPrefixLocal";s:0:"";s:24:"AutoFormat.AutoParagraph";b:0;s:17:"AutoFormat.Custom";a:0:{}s:25:"AutoFormat.DisplayLinkURI";b:0;s:18:"AutoFormat.Linkify";b:0;s:33:"AutoFormat.PurifierLinkify.DocURL";s:3:"#%s";s:26:"AutoFormat.PurifierLinkify";b:0;s:32:"AutoFormat.RemoveEmpty.Predicate";a:4:{s:8:"colgroup";a:0:{}s:2:"th";a:0:{}s:2:"td";a:0:{}s:6:"iframe";a:1:{i:0;s:3:"src";}}s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";a:2:{s:2:"td";b:1;s:2:"th";b:1;}s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";b:0;s:22:"AutoFormat.RemoveEmpty";b:0;s:39:"AutoFormat.RemoveSpansWithoutAttributes";b:0;s:19:"CSS.AllowDuplicates";b:0;s:18:"CSS.AllowImportant";b:0;s:15:"CSS.AllowTricky";b:0;s:16:"CSS.AllowedFonts";N;s:21:"CSS.AllowedProperties";N;s:17:"CSS.DefinitionRev";i:1;s:23:"CSS.ForbiddenProperties";a:0:{}s:16:"CSS.MaxImgLength";s:6:"1200px";s:15:"CSS.Proprietary";b:0;s:11:"CSS.Trusted";b:0;s:20:"Cache.DefinitionImpl";s:10:"Serializer";s:20:"Cache.SerializerPath";N;s:27:"Cache.SerializerPermissions";i:493;s:22:"Core.AggressivelyFixLt";b:1;s:29:"Core.AggressivelyRemoveScript";b:1;s:28:"Core.AllowHostnameUnderscore";b:0;s:23:"Core.AllowParseManyTags";b:0;s:18:"Core.CollectErrors";b:0;s:18:"Core.ColorKeywords";a:148:{s:9:"aliceblue";s:7:"#F0F8FF";s:12:"antiquewhite";s:7:"#FAEBD7";s:4:"aqua";s:7:"#00FFFF";s:10:"aquamarine";s:7:"#7FFFD4";s:5:"azure";s:7:"#F0FFFF";s:5:"beige";s:7:"#F5F5DC";s:6:"bisque";s:7:"#FFE4C4";s:5:"black";s:7:"#000000";s:14:"blanchedalmond";s:7:"#FFEBCD";s:4:"blue";s:7:"#0000FF";s:10:"blueviolet";s:7:"#8A2BE2";s:5:"brown";s:7:"#A52A2A";s:9:"burlywood";s:7:"#DEB887";s:9:"cadetblue";s:7:"#5F9EA0";s:10:"chartreuse";s:7:"#7FFF00";s:9:"chocolate";s:7:"#D2691E";s:5:"coral";s:7:"#FF7F50";s:14:"cornflowerblue";s:7:"#6495ED";s:8:"cornsilk";s:7:"#FFF8DC";s:7:"crimson";s:7:"#DC143C";s:4:"cyan";s:7:"#00FFFF";s:8:"darkblue";s:7:"#00008B";s:8:"darkcyan";s:7:"#008B8B";s:13:"darkgoldenrod";s:7:"#B8860B";s:8:"darkgray";s:7:"#A9A9A9";s:8:"darkgrey";s:7:"#A9A9A9";s:9:"darkgreen";s:7:"#006400";s:9:"darkkhaki";s:7:"#BDB76B";s:11:"darkmagenta";s:7:"#8B008B";s:14:"darkolivegreen";s:7:"#556B2F";s:10:"darkorange";s:7:"#FF8C00";s:10:"darkorchid";s:7:"#9932CC";s:7:"darkred";s:7:"#8B0000";s:10:"darksalmon";s:7:"#E9967A";s:12:"darkseagreen";s:7:"#8FBC8F";s:13:"darkslateblue";s:7:"#483D8B";s:13:"darkslategray";s:7:"#2F4F4F";s:13:"darkslategrey";s:7:"#2F4F4F";s:13:"darkturquoise";s:7:"#00CED1";s:10:"darkviolet";s:7:"#9400D3";s:8:"deeppink";s:7:"#FF1493";s:11:"deepskyblue";s:7:"#00BFFF";s:7:"dimgray";s:7:"#696969";s:7:"dimgrey";s:7:"#696969";s:10:"dodgerblue";s:7:"#1E90FF";s:9:"firebrick";s:7:"#B22222";s:11:"floralwhite";s:7:"#FFFAF0";s:11:"forestgreen";s:7:"#228B22";s:7:"fuchsia";s:7:"#FF00FF";s:9:"gainsboro";s:7:"#DCDCDC";s:10:"ghostwhite";s:7:"#F8F8FF";s:4:"gold";s:7:"#FFD700";s:9:"goldenrod";s:7:"#DAA520";s:4:"gray";s:7:"#808080";s:4:"grey";s:7:"#808080";s:5:"green";s:7:"#008000";s:11:"greenyellow";s:7:"#ADFF2F";s:8:"honeydew";s:7:"#F0FFF0";s:7:"hotpink";s:7:"#FF69B4";s:9:"indianred";s:7:"#CD5C5C";s:6:"indigo";s:7:"#4B0082";s:5:"ivory";s:7:"#FFFFF0";s:5:"khaki";s:7:"#F0E68C";s:8:"lavender";s:7:"#E6E6FA";s:13:"lavenderblush";s:7:"#FFF0F5";s:9:"lawngreen";s:7:"#7CFC00";s:12:"lemonchiffon";s:7:"#FFFACD";s:9:"lightblue";s:7:"#ADD8E6";s:10:"lightcoral";s:7:"#F08080";s:9:"lightcyan";s:7:"#E0FFFF";s:20:"lightgoldenrodyellow";s:7:"#FAFAD2";s:9:"lightgray";s:7:"#D3D3D3";s:9:"lightgrey";s:7:"#D3D3D3";s:10:"lightgreen";s:7:"#90EE90";s:9:"lightpink";s:7:"#FFB6C1";s:11:"lightsalmon";s:7:"#FFA07A";s:13:"lightseagreen";s:7:"#20B2AA";s:12:"lightskyblue";s:7:"#87CEFA";s:14:"lightslategray";s:7:"#778899";s:14:"lightslategrey";s:7:"#778899";s:14:"lightsteelblue";s:7:"#B0C4DE";s:11:"lightyellow";s:7:"#FFFFE0";s:4:"lime";s:7:"#00FF00";s:9:"limegreen";s:7:"#32CD32";s:5:"linen";s:7:"#FAF0E6";s:7:"magenta";s:7:"#FF00FF";s:6:"maroon";s:7:"#800000";s:16:"mediumaquamarine";s:7:"#66CDAA";s:10:"mediumblue";s:7:"#0000CD";s:12:"mediumorchid";s:7:"#BA55D3";s:12:"mediumpurple";s:7:"#9370DB";s:14:"mediumseagreen";s:7:"#3CB371";s:15:"mediumslateblue";s:7:"#7B68EE";s:17:"mediumspringgreen";s:7:"#00FA9A";s:15:"mediumturquoise";s:7:"#48D1CC";s:15:"mediumvioletred";s:7:"#C71585";s:12:"midnightblue";s:7:"#191970";s:9:"mintcream";s:7:"#F5FFFA";s:9:"mistyrose";s:7:"#FFE4E1";s:8:"moccasin";s:7:"#FFE4B5";s:11:"navajowhite";s:7:"#FFDEAD";s:4:"navy";s:7:"#000080";s:7:"oldlace";s:7:"#FDF5E6";s:5:"olive";s:7:"#808000";s:9:"olivedrab";s:7:"#6B8E23";s:6:"orange";s:7:"#FFA500";s:9:"orangered";s:7:"#FF4500";s:6:"orchid";s:7:"#DA70D6";s:13:"palegoldenrod";s:7:"#EEE8AA";s:9:"palegreen";s:7:"#98FB98";s:13:"paleturquoise";s:7:"#AFEEEE";s:13:"palevioletred";s:7:"#DB7093";s:10:"papayawhip";s:7:"#FFEFD5";s:9:"peachpuff";s:7:"#FFDAB9";s:4:"peru";s:7:"#CD853F";s:4:"pink";s:7:"#FFC0CB";s:4:"plum";s:7:"#DDA0DD";s:10:"powderblue";s:7:"#B0E0E6";s:6:"purple";s:7:"#800080";s:13:"rebeccapurple";s:7:"#663399";s:3:"red";s:7:"#FF0000";s:9:"rosybrown";s:7:"#BC8F8F";s:9:"royalblue";s:7:"#4169E1";s:11:"saddlebrown";s:7:"#8B4513";s:6:"salmon";s:7:"#FA8072";s:10:"sandybrown";s:7:"#F4A460";s:8:"seagreen";s:7:"#2E8B57";s:8:"seashell";s:7:"#FFF5EE";s:6:"sienna";s:7:"#A0522D";s:6:"silver";s:7:"#C0C0C0";s:7:"skyblue";s:7:"#87CEEB";s:9:"slateblue";s:7:"#6A5ACD";s:9:"slategray";s:7:"#708090";s:9:"slategrey";s:7:"#708090";s:4:"snow";s:7:"#FFFAFA";s:11:"springgreen";s:7:"#00FF7F";s:9:"steelblue";s:7:"#4682B4";s:3:"tan";s:7:"#D2B48C";s:4:"teal";s:7:"#008080";s:7:"thistle";s:7:"#D8BFD8";s:6:"tomato";s:7:"#FF6347";s:9:"turquoise";s:7:"#40E0D0";s:6:"violet";s:7:"#EE82EE";s:5:"wheat";s:7:"#F5DEB3";s:5:"white";s:7:"#FFFFFF";s:10:"whitesmoke";s:7:"#F5F5F5";s:6:"yellow";s:7:"#FFFF00";s:11:"yellowgreen";s:7:"#9ACD32";}s:30:"Core.ConvertDocumentToFragment";b:1;s:36:"Core.DirectLexLineNumberSyncInterval";i:0;s:20:"Core.DisableExcludes";b:0;s:15:"Core.EnableIDNA";b:0;s:13:"Core.Encoding";s:5:"utf-8";s:26:"Core.EscapeInvalidChildren";b:0;s:22:"Core.EscapeInvalidTags";b:0;s:29:"Core.EscapeNonASCIICharacters";b:0;s:19:"Core.HiddenElements";a:2:{s:6:"script";b:1;s:5:"style";b:1;}s:13:"Core.Language";s:2:"en";s:24:"Core.LegacyEntityDecoder";b:0;s:14:"Core.LexerImpl";N;s:24:"Core.MaintainLineNumbers";N;s:22:"Core.NormalizeNewlines";b:1;s:21:"Core.RemoveInvalidImg";b:1;s:33:"Core.RemoveProcessingInstructions";b:0;s:25:"Core.RemoveScriptContents";N;s:13:"Filter.Custom";a:0:{}s:34:"Filter.ExtractStyleBlocks.Escaping";b:1;s:31:"Filter.ExtractStyleBlocks.Scope";N;s:34:"Filter.ExtractStyleBlocks.TidyImpl";N;s:25:"Filter.ExtractStyleBlocks";b:0;s:14:"Filter.YouTube";b:0;s:12:"HTML.Allowed";N;s:22:"HTML.AllowedAttributes";N;s:20:"HTML.AllowedComments";a:0:{}s:26:"HTML.AllowedCommentsRegexp";N;s:20:"HTML.AllowedElements";N;s:19:"HTML.AllowedModules";N;s:23:"HTML.Attr.Name.UseCDATA";b:0;s:17:"HTML.BlockWrapper";s:1:"p";s:16:"HTML.CoreModules";a:7:{s:9:"Structure";b:1;s:4:"Text";b:1;s:9:"Hypertext";b:1;s:4:"List";b:1;s:22:"NonXMLCommonAttributes";b:1;s:19:"XMLCommonAttributes";b:1;s:16:"CommonAttributes";b:1;}s:18:"HTML.CustomDoctype";N;s:17:"HTML.DefinitionID";N;s:18:"HTML.DefinitionRev";i:1;s:12:"HTML.Doctype";N;s:25:"HTML.FlashAllowFullScreen";b:0;s:24:"HTML.ForbiddenAttributes";a:0:{}s:22:"HTML.ForbiddenElements";a:0:{}s:10:"HTML.Forms";b:0;s:17:"HTML.MaxImgLength";i:1200;s:13:"HTML.Nofollow";b:0;s:11:"HTML.Parent";s:3:"div";s:16:"HTML.Proprietary";b:0;s:14:"HTML.SafeEmbed";b:0;s:15:"HTML.SafeIframe";b:0;s:15:"HTML.SafeObject";b:0;s:18:"HTML.SafeScripting";a:0:{}s:11:"HTML.Strict";b:0;s:16:"HTML.TargetBlank";b:0;s:19:"HTML.TargetNoopener";b:1;s:21:"HTML.TargetNoreferrer";b:1;s:12:"HTML.TidyAdd";a:0:{}s:14:"HTML.TidyLevel";s:6:"medium";s:15:"HTML.TidyRemove";a:0:{}s:12:"HTML.Trusted";b:0;s:10:"HTML.XHTML";b:1;s:28:"Output.CommentScriptContents";b:1;s:19:"Output.FixInnerHTML";b:1;s:18:"Output.FlashCompat";b:0;s:14:"Output.Newline";N;s:15:"Output.SortAttr";b:0;s:17:"Output.TidyFormat";b:0;s:17:"Test.ForceNoIconv";b:0;s:18:"URI.AllowedSchemes";a:7:{s:4:"http";b:1;s:5:"https";b:1;s:6:"mailto";b:1;s:3:"ftp";b:1;s:4:"nntp";b:1;s:4:"news";b:1;s:3:"tel";b:1;}s:8:"URI.Base";N;s:17:"URI.DefaultScheme";s:4:"http";s:16:"URI.DefinitionID";N;s:17:"URI.DefinitionRev";i:1;s:11:"URI.Disable";b:0;s:19:"URI.DisableExternal";b:0;s:28:"URI.DisableExternalResources";b:0;s:20:"URI.DisableResources";b:0;s:8:"URI.Host";N;s:17:"URI.HostBlacklist";a:0:{}s:16:"URI.MakeAbsolute";b:0;s:9:"URI.Munge";N;s:18:"URI.MungeResources";b:0;s:18:"URI.MungeSecretKey";N;s:26:"URI.OverrideAllowedSchemes";b:1;s:20:"URI.SafeIframeRegexp";N;}s:9:" * parent";N;s:8:" * cache";N;}s:4:"info";a:140:{s:19:"Attr.AllowedClasses";i:-8;s:24:"Attr.AllowedFrameTargets";i:8;s:15:"Attr.AllowedRel";i:8;s:15:"Attr.AllowedRev";i:8;s:18:"Attr.ClassUseCDATA";i:-7;s:20:"Attr.DefaultImageAlt";i:-1;s:24:"Attr.DefaultInvalidImage";i:1;s:27:"Attr.DefaultInvalidImageAlt";i:1;s:19:"Attr.DefaultTextDir";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:2:{s:3:"ltr";b:1;s:3:"rtl";b:1;}}s:13:"Attr.EnableID";i:7;s:17:"HTML.EnableAttrID";O:8:"stdClass":2:{s:3:"key";s:13:"Attr.EnableID";s:7:"isAlias";b:1;}s:21:"Attr.ForbiddenClasses";i:8;s:13:"Attr.ID.HTML5";i:-7;s:16:"Attr.IDBlacklist";i:9;s:22:"Attr.IDBlacklistRegexp";i:-1;s:13:"Attr.IDPrefix";i:1;s:18:"Attr.IDPrefixLocal";i:1;s:24:"AutoFormat.AutoParagraph";i:7;s:17:"AutoFormat.Custom";i:9;s:25:"AutoFormat.DisplayLinkURI";i:7;s:18:"AutoFormat.Linkify";i:7;s:33:"AutoFormat.PurifierLinkify.DocURL";i:1;s:37:"AutoFormatParam.PurifierLinkifyDocURL";O:8:"stdClass":2:{s:3:"key";s:33:"AutoFormat.PurifierLinkify.DocURL";s:7:"isAlias";b:1;}s:26:"AutoFormat.PurifierLinkify";i:7;s:32:"AutoFormat.RemoveEmpty.Predicate";i:10;s:44:"AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions";i:8;s:33:"AutoFormat.RemoveEmpty.RemoveNbsp";i:7;s:22:"AutoFormat.RemoveEmpty";i:7;s:39:"AutoFormat.RemoveSpansWithoutAttributes";i:7;s:19:"CSS.AllowDuplicates";i:7;s:18:"CSS.AllowImportant";i:7;s:15:"CSS.AllowTricky";i:7;s:16:"CSS.AllowedFonts";i:-8;s:21:"CSS.AllowedProperties";i:-8;s:17:"CSS.DefinitionRev";i:5;s:23:"CSS.ForbiddenProperties";i:8;s:16:"CSS.MaxImgLength";i:-1;s:15:"CSS.Proprietary";i:7;s:11:"CSS.Trusted";i:7;s:20:"Cache.DefinitionImpl";i:-1;s:20:"Core.DefinitionCache";O:8:"stdClass":2:{s:3:"key";s:20:"Cache.DefinitionImpl";s:7:"isAlias";b:1;}s:20:"Cache.SerializerPath";i:-1;s:27:"Cache.SerializerPermissions";i:-5;s:22:"Core.AggressivelyFixLt";i:7;s:29:"Core.AggressivelyRemoveScript";i:7;s:28:"Core.AllowHostnameUnderscore";i:7;s:23:"Core.AllowParseManyTags";i:7;s:18:"Core.CollectErrors";i:7;s:18:"Core.ColorKeywords";i:10;s:30:"Core.ConvertDocumentToFragment";i:7;s:24:"Core.AcceptFullDocuments";O:8:"stdClass":2:{s:3:"key";s:30:"Core.ConvertDocumentToFragment";s:7:"isAlias";b:1;}s:36:"Core.DirectLexLineNumberSyncInterval";i:5;s:20:"Core.DisableExcludes";i:7;s:15:"Core.EnableIDNA";i:7;s:13:"Core.Encoding";i:2;s:26:"Core.EscapeInvalidChildren";i:7;s:22:"Core.EscapeInvalidTags";i:7;s:29:"Core.EscapeNonASCIICharacters";i:7;s:19:"Core.HiddenElements";i:8;s:13:"Core.Language";i:1;s:24:"Core.LegacyEntityDecoder";i:7;s:14:"Core.LexerImpl";i:-11;s:24:"Core.MaintainLineNumbers";i:-7;s:22:"Core.NormalizeNewlines";i:7;s:21:"Core.RemoveInvalidImg";i:7;s:33:"Core.RemoveProcessingInstructions";i:7;s:25:"Core.RemoveScriptContents";i:-7;s:13:"Filter.Custom";i:9;s:34:"Filter.ExtractStyleBlocks.Escaping";i:7;s:33:"Filter.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:38:"FilterParam.ExtractStyleBlocksEscaping";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.Escaping";s:7:"isAlias";b:1;}s:31:"Filter.ExtractStyleBlocks.Scope";i:-1;s:30:"Filter.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:35:"FilterParam.ExtractStyleBlocksScope";O:8:"stdClass":2:{s:3:"key";s:31:"Filter.ExtractStyleBlocks.Scope";s:7:"isAlias";b:1;}s:34:"Filter.ExtractStyleBlocks.TidyImpl";i:-11;s:38:"FilterParam.ExtractStyleBlocksTidyImpl";O:8:"stdClass":2:{s:3:"key";s:34:"Filter.ExtractStyleBlocks.TidyImpl";s:7:"isAlias";b:1;}s:25:"Filter.ExtractStyleBlocks";i:7;s:14:"Filter.YouTube";i:7;s:12:"HTML.Allowed";i:-4;s:22:"HTML.AllowedAttributes";i:-8;s:20:"HTML.AllowedComments";i:8;s:26:"HTML.AllowedCommentsRegexp";i:-1;s:20:"HTML.AllowedElements";i:-8;s:19:"HTML.AllowedModules";i:-8;s:23:"HTML.Attr.Name.UseCDATA";i:7;s:17:"HTML.BlockWrapper";i:1;s:16:"HTML.CoreModules";i:8;s:18:"HTML.CustomDoctype";i:-1;s:17:"HTML.DefinitionID";i:-1;s:18:"HTML.DefinitionRev";i:5;s:12:"HTML.Doctype";O:8:"stdClass":3:{s:4:"type";i:1;s:10:"allow_null";b:1;s:7:"allowed";a:5:{s:22:"HTML 4.01 Transitional";b:1;s:16:"HTML 4.01 Strict";b:1;s:22:"XHTML 1.0 Transitional";b:1;s:16:"XHTML 1.0 Strict";b:1;s:9:"XHTML 1.1";b:1;}}s:25:"HTML.FlashAllowFullScreen";i:7;s:24:"HTML.ForbiddenAttributes";i:8;s:22:"HTML.ForbiddenElements";i:8;s:10:"HTML.Forms";i:7;s:17:"HTML.MaxImgLength";i:-5;s:13:"HTML.Nofollow";i:7;s:11:"HTML.Parent";i:1;s:16:"HTML.Proprietary";i:7;s:14:"HTML.SafeEmbed";i:7;s:15:"HTML.SafeIframe";i:7;s:15:"HTML.SafeObject";i:7;s:18:"HTML.SafeScripting";i:8;s:11:"HTML.Strict";i:7;s:16:"HTML.TargetBlank";i:7;s:19:"HTML.TargetNoopener";i:7;s:21:"HTML.TargetNoreferrer";i:7;s:12:"HTML.TidyAdd";i:8;s:14:"HTML.TidyLevel";O:8:"stdClass":2:{s:4:"type";i:1;s:7:"allowed";a:4:{s:4:"none";b:1;s:5:"light";b:1;s:6:"medium";b:1;s:5:"heavy";b:1;}}s:15:"HTML.TidyRemove";i:8;s:12:"HTML.Trusted";i:7;s:10:"HTML.XHTML";i:7;s:10:"Core.XHTML";O:8:"stdClass":2:{s:3:"key";s:10:"HTML.XHTML";s:7:"isAlias";b:1;}s:28:"Output.CommentScriptContents";i:7;s:26:"Core.CommentScriptContents";O:8:"stdClass":2:{s:3:"key";s:28:"Output.CommentScriptContents";s:7:"isAlias";b:1;}s:19:"Output.FixInnerHTML";i:7;s:18:"Output.FlashCompat";i:7;s:14:"Output.Newline";i:-1;s:15:"Output.SortAttr";i:7;s:17:"Output.TidyFormat";i:7;s:15:"Core.TidyFormat";O:8:"stdClass":2:{s:3:"key";s:17:"Output.TidyFormat";s:7:"isAlias";b:1;}s:17:"Test.ForceNoIconv";i:7;s:18:"URI.AllowedSchemes";i:8;s:8:"URI.Base";i:-1;s:17:"URI.DefaultScheme";i:-1;s:16:"URI.DefinitionID";i:-1;s:17:"URI.DefinitionRev";i:5;s:11:"URI.Disable";i:7;s:15:"Attr.DisableURI";O:8:"stdClass":2:{s:3:"key";s:11:"URI.Disable";s:7:"isAlias";b:1;}s:19:"URI.DisableExternal";i:7;s:28:"URI.DisableExternalResources";i:7;s:20:"URI.DisableResources";i:7;s:8:"URI.Host";i:-1;s:17:"URI.HostBlacklist";i:9;s:16:"URI.MakeAbsolute";i:7;s:9:"URI.Munge";i:-1;s:18:"URI.MungeResources";i:7;s:18:"URI.MungeSecretKey";i:-1;s:26:"URI.OverrideAllowedSchemes";i:7;s:20:"URI.SafeIframeRegexp";i:-1;}}
\ No newline at end of file
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php
index d34299522..543e3f8f1 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php
@@ -142,11 +142,12 @@ class HTMLPurifier_ContentSets
if ($return !== false) {
return $return;
}
-
- throw new Exception(
+ // error-out
+ trigger_error(
'Could not determine which ChildDef class to instantiate',
E_USER_ERROR
);
+ return false;
}
/**
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php
index 5a0e7b91c..00e509c85 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php
@@ -24,7 +24,11 @@ class HTMLPurifier_Context
public function register($name, &$ref)
{
if (array_key_exists($name, $this->_storage)) {
- throw new Exception("Name $name produces collision, cannot re-register");
+ trigger_error(
+ "Name $name produces collision, cannot re-register",
+ E_USER_ERROR
+ );
+ return;
}
$this->_storage[$name] =& $ref;
}
@@ -39,7 +43,10 @@ class HTMLPurifier_Context
{
if (!array_key_exists($name, $this->_storage)) {
if (!$ignore_error) {
- throw new Exception("Attempted to retrieve non-existent variable $name");
+ trigger_error(
+ "Attempted to retrieve non-existent variable $name",
+ E_USER_ERROR
+ );
}
$var = null; // so we can return by reference
return $var;
@@ -54,7 +61,11 @@ class HTMLPurifier_Context
public function destroy($name)
{
if (!array_key_exists($name, $this->_storage)) {
- throw new Exception("Attempted to destroy non-existent variable $name");
+ trigger_error(
+ "Attempted to destroy non-existent variable $name",
+ E_USER_ERROR
+ );
+ return;
}
unset($this->_storage[$name]);
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php
index 6ba9ad2d9..b82c6bb20 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php
@@ -139,9 +139,8 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac
continue;
}
$key = substr($filename, 0, strlen($filename) - 4);
- $file = $dir . '/' . $filename;
- if ($this->isOld($key, $config) && file_exists($file)) {
- unlink($file);
+ if ($this->isOld($key, $config)) {
+ unlink($dir . '/' . $filename);
}
}
closedir($dh);
@@ -288,14 +287,13 @@ class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_DefinitionCac
} elseif (filegroup($dir) === posix_getgid()) {
$chmod = $chmod | 0070;
} else {
- // PHP's probably running as nobody, it is
- // not obvious how to fix this (777 is probably
- // bad if you are multi-user), let the user figure it out
- $chmod = null;
+ // PHP's probably running as nobody, so we'll
+ // need to give global permissions
+ $chmod = $chmod | 0777;
}
trigger_error(
- 'Directory ' . $dir . ' not writable. ' .
- ($chmod === null ? '' : 'Please chmod to ' . decoct($chmod)),
+ 'Directory ' . $dir . ' not writable, ' .
+ 'please chmod to ' . decoct($chmod),
E_USER_WARNING
);
} else {
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.15.0,1cb20df370bd0f944e5a3321cc5041119545d67d,1.ser b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.15.0,1cb20df370bd0f944e5a3321cc5041119545d67d,1.ser
new file mode 100644
index 000000000..e1f498187
Binary files /dev/null and b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.15.0,1cb20df370bd0f944e5a3321cc5041119545d67d,1.ser differ
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.15.0,b55df03349e7aaab0a2ad3ef8d72b34a72d0c414,1.ser b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.15.0,b55df03349e7aaab0a2ad3ef8d72b34a72d0c414,1.ser
new file mode 100644
index 000000000..e8e38349c
Binary files /dev/null and b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.15.0,b55df03349e7aaab0a2ad3ef8d72b34a72d0c414,1.ser differ
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/URI/4.15.0,3478238e680361cd87bf880f5b3cc50a1e7abc6c,1.ser b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/URI/4.15.0,3478238e680361cd87bf880f5b3cc50a1e7abc6c,1.ser
new file mode 100644
index 000000000..f6d3e812b
Binary files /dev/null and b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/URI/4.15.0,3478238e680361cd87bf880f5b3cc50a1e7abc6c,1.ser differ
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php
index 3a0f4616a..fd1cc9be4 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php
@@ -71,7 +71,7 @@ class HTMLPurifier_DefinitionCacheFactory
return $this->caches[$method][$type];
}
if (isset($this->implementations[$method]) &&
- class_exists($class = $this->implementations[$method])) {
+ class_exists($class = $this->implementations[$method], false)) {
$cache = new $class($type);
} else {
if ($method != 'Serializer') {
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php
index 9ad7b4b1e..acc1d64a6 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php
@@ -86,7 +86,7 @@ class HTMLPurifier_DoctypeRegistry
$doctype = $this->aliases[$doctype];
}
if (!isset($this->doctypes[$doctype])) {
- throw new Exception('Doctype ' . htmlspecialchars($doctype) . ' does not exist');
+ trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR);
$anon = new HTMLPurifier_Doctype($doctype);
return $anon;
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php
index 910181b20..d4791cc1b 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php
@@ -12,7 +12,7 @@ class HTMLPurifier_Encoder
*/
private function __construct()
{
- throw new Exception('Cannot instantiate encoder, call methods statically');
+ trigger_error('Cannot instantiate encoder, call methods statically', E_USER_ERROR);
}
/**
@@ -390,7 +390,7 @@ class HTMLPurifier_Encoder
$str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str);
if ($str === false) {
// $encoding is not a valid encoding
- throw new Exception('Invalid encoding ' . $encoding);
+ trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR);
return '';
}
// If the string is bjorked by Shift_JIS or a similar encoding
@@ -404,11 +404,12 @@ class HTMLPurifier_Encoder
}
$bug = HTMLPurifier_Encoder::testIconvTruncateBug();
if ($bug == self::ICONV_OK) {
- throw new Exception('Encoding not supported, please install iconv');
+ trigger_error('Encoding not supported, please install iconv', E_USER_ERROR);
} else {
- throw new Exception(
+ trigger_error(
'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' .
- 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541'
+ 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541',
+ E_USER_ERROR
);
}
}
@@ -453,7 +454,7 @@ class HTMLPurifier_Encoder
$str = mb_convert_encoding($str, 'ISO-8859-1', 'UTF-8');
return $str;
}
- throw new Exception('Encoding not supported');
+ trigger_error('Encoding not supported', E_USER_ERROR);
// You might be tempted to assume that the ASCII representation
// might be OK, however, this is *not* universally true over all
// encodings. So we take the conservative route here, rather
@@ -544,9 +545,10 @@ class HTMLPurifier_Encoder
} elseif (($c = strlen($r)) < 9000) {
$code = self::ICONV_TRUNCATES;
} elseif ($c > 9000) {
- throw new Exception(
+ trigger_error(
'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' .
- 'include your iconv version as per phpversion()'
+ 'include your iconv version as per phpversion()',
+ E_USER_ERROR
);
} else {
$code = self::ICONV_OK;
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php
index 1dcd10c7c..3ef2d09ec 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php
@@ -5,7 +5,7 @@
// $config or $context to the callback functions.
/**
- * Handles referencing and dereferencing character entities
+ * Handles referencing and derefencing character entities
*/
class HTMLPurifier_EntityParser
{
@@ -116,8 +116,8 @@ class HTMLPurifier_EntityParser
protected function entityCallback($matches)
{
$entity = $matches[0];
- $hex_part = isset($matches[1]) ? $matches[1] : null;
- $dec_part = isset($matches[2]) ? $matches[2] : null;
+ $hex_part = @$matches[1];
+ $dec_part = @$matches[2];
$named_part = empty($matches[3]) ? (empty($matches[4]) ? "" : $matches[4]) : $matches[3];
if ($hex_part !== NULL && $hex_part !== "") {
return HTMLPurifier_Encoder::unichr(hexdec($hex_part));
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php
index d52ae08dd..c1f41ee16 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php
@@ -4,7 +4,7 @@
* Represents a pre or post processing filter on HTML Purifier's output
*
* Sometimes, a little ad-hoc fixing of HTML has to be done before
- * it gets sent through HTML Purifier: you can use filters to achieve
+ * it gets sent through HTML Purifier: you can use filters to acheive
* this effect. For instance, YouTube videos can be preserved using
* this manner. You could have used a decorator for this task, but
* PHP's support for them is not terribly robust, so we're going
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
index e7e3cac1a..66f70b0fc 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
@@ -54,11 +54,6 @@ class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter
*/
private $_enum_attrdef;
- /**
- * @type HTMLPurifier_AttrDef_Enum
- */
- private $_universal_attrdef;
-
public function __construct()
{
$this->_tidy = new csstidy();
@@ -75,13 +70,6 @@ class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter
'focus'
)
);
- $this->_universal_attrdef = new HTMLPurifier_AttrDef_Enum(
- array(
- 'initial',
- 'inherit',
- 'unset',
- )
- );
}
/**
@@ -158,184 +146,175 @@ class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter
foreach ($this->_tidy->css as $k => $decls) {
// $decls are all CSS declarations inside an @ selector
$new_decls = array();
- if (is_array($decls)) {
- foreach ($decls as $selector => $style) {
- $selector = trim($selector);
- if ($selector === '') {
- continue;
- } // should not happen
- // Parse the selector
- // Here is the relevant part of the CSS grammar:
- //
- // ruleset
- // : selector [ ',' S* selector ]* '{' ...
- // selector
- // : simple_selector [ combinator selector | S+ [ combinator? selector ]? ]?
- // combinator
- // : '+' S*
- // : '>' S*
- // simple_selector
- // : element_name [ HASH | class | attrib | pseudo ]*
- // | [ HASH | class | attrib | pseudo ]+
- // element_name
- // : IDENT | '*'
- // ;
- // class
- // : '.' IDENT
- // ;
- // attrib
- // : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S*
- // [ IDENT | STRING ] S* ]? ']'
- // ;
- // pseudo
- // : ':' [ IDENT | FUNCTION S* [IDENT S*]? ')' ]
- // ;
- //
- // For reference, here are the relevant tokens:
- //
- // HASH #{name}
- // IDENT {ident}
- // INCLUDES ==
- // DASHMATCH |=
- // STRING {string}
- // FUNCTION {ident}\(
- //
- // And the lexical scanner tokens
- //
- // name {nmchar}+
- // nmchar [_a-z0-9-]|{nonascii}|{escape}
- // nonascii [\240-\377]
- // escape {unicode}|\\[^\r\n\f0-9a-f]
- // unicode \\{h}}{1,6}(\r\n|[ \t\r\n\f])?
- // ident -?{nmstart}{nmchar*}
- // nmstart [_a-z]|{nonascii}|{escape}
- // string {string1}|{string2}
- // string1 \"([^\n\r\f\\"]|\\{nl}|{escape})*\"
- // string2 \'([^\n\r\f\\"]|\\{nl}|{escape})*\'
- //
- // We'll implement a subset (in order to reduce attack
- // surface); in particular:
- //
- // - No Unicode support
- // - No escapes support
- // - No string support (by proxy no attrib support)
- // - element_name is matched against allowed
- // elements (some people might find this
- // annoying...)
- // - Pseudo-elements one of :first-child, :link,
- // :visited, :active, :hover, :focus
+ foreach ($decls as $selector => $style) {
+ $selector = trim($selector);
+ if ($selector === '') {
+ continue;
+ } // should not happen
+ // Parse the selector
+ // Here is the relevant part of the CSS grammar:
+ //
+ // ruleset
+ // : selector [ ',' S* selector ]* '{' ...
+ // selector
+ // : simple_selector [ combinator selector | S+ [ combinator? selector ]? ]?
+ // combinator
+ // : '+' S*
+ // : '>' S*
+ // simple_selector
+ // : element_name [ HASH | class | attrib | pseudo ]*
+ // | [ HASH | class | attrib | pseudo ]+
+ // element_name
+ // : IDENT | '*'
+ // ;
+ // class
+ // : '.' IDENT
+ // ;
+ // attrib
+ // : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S*
+ // [ IDENT | STRING ] S* ]? ']'
+ // ;
+ // pseudo
+ // : ':' [ IDENT | FUNCTION S* [IDENT S*]? ')' ]
+ // ;
+ //
+ // For reference, here are the relevant tokens:
+ //
+ // HASH #{name}
+ // IDENT {ident}
+ // INCLUDES ==
+ // DASHMATCH |=
+ // STRING {string}
+ // FUNCTION {ident}\(
+ //
+ // And the lexical scanner tokens
+ //
+ // name {nmchar}+
+ // nmchar [_a-z0-9-]|{nonascii}|{escape}
+ // nonascii [\240-\377]
+ // escape {unicode}|\\[^\r\n\f0-9a-f]
+ // unicode \\{h}}{1,6}(\r\n|[ \t\r\n\f])?
+ // ident -?{nmstart}{nmchar*}
+ // nmstart [_a-z]|{nonascii}|{escape}
+ // string {string1}|{string2}
+ // string1 \"([^\n\r\f\\"]|\\{nl}|{escape})*\"
+ // string2 \'([^\n\r\f\\"]|\\{nl}|{escape})*\'
+ //
+ // We'll implement a subset (in order to reduce attack
+ // surface); in particular:
+ //
+ // - No Unicode support
+ // - No escapes support
+ // - No string support (by proxy no attrib support)
+ // - element_name is matched against allowed
+ // elements (some people might find this
+ // annoying...)
+ // - Pseudo-elements one of :first-child, :link,
+ // :visited, :active, :hover, :focus
- // handle ruleset
- $selectors = array_map('trim', explode(',', $selector));
- $new_selectors = array();
- foreach ($selectors as $sel) {
- // split on +, > and spaces
- $basic_selectors = preg_split('/\s*([+> ])\s*/', $sel, -1, PREG_SPLIT_DELIM_CAPTURE);
- // even indices are chunks, odd indices are
- // delimiters
- $nsel = null;
- $delim = null; // guaranteed to be non-null after
- // two loop iterations
- for ($i = 0, $c = count($basic_selectors); $i < $c; $i++) {
- $x = $basic_selectors[$i];
- if ($i % 2) {
- // delimiter
- if ($x === ' ') {
- $delim = ' ';
- } else {
- $delim = ' ' . $x . ' ';
- }
+ // handle ruleset
+ $selectors = array_map('trim', explode(',', $selector));
+ $new_selectors = array();
+ foreach ($selectors as $sel) {
+ // split on +, > and spaces
+ $basic_selectors = preg_split('/\s*([+> ])\s*/', $sel, -1, PREG_SPLIT_DELIM_CAPTURE);
+ // even indices are chunks, odd indices are
+ // delimiters
+ $nsel = null;
+ $delim = null; // guaranteed to be non-null after
+ // two loop iterations
+ for ($i = 0, $c = count($basic_selectors); $i < $c; $i++) {
+ $x = $basic_selectors[$i];
+ if ($i % 2) {
+ // delimiter
+ if ($x === ' ') {
+ $delim = ' ';
} else {
- // simple selector
- $components = preg_split('/([#.:])/', $x, -1, PREG_SPLIT_DELIM_CAPTURE);
- $sdelim = null;
- $nx = null;
- for ($j = 0, $cc = count($components); $j < $cc; $j++) {
- $y = $components[$j];
- if ($j === 0) {
- if ($y === '*' || isset($html_definition->info[$y = strtolower($y)])) {
- $nx = $y;
- } else {
- // $nx stays null; this matters
- // if we don't manage to find
- // any valid selector content,
- // in which case we ignore the
- // outer $delim
- }
- } elseif ($j % 2) {
- // set delimiter
- $sdelim = $y;
+ $delim = ' ' . $x . ' ';
+ }
+ } else {
+ // simple selector
+ $components = preg_split('/([#.:])/', $x, -1, PREG_SPLIT_DELIM_CAPTURE);
+ $sdelim = null;
+ $nx = null;
+ for ($j = 0, $cc = count($components); $j < $cc; $j++) {
+ $y = $components[$j];
+ if ($j === 0) {
+ if ($y === '*' || isset($html_definition->info[$y = strtolower($y)])) {
+ $nx = $y;
} else {
- $attrdef = null;
- if ($sdelim === '#') {
- $attrdef = $this->_id_attrdef;
- } elseif ($sdelim === '.') {
- $attrdef = $this->_class_attrdef;
- } elseif ($sdelim === ':') {
- $attrdef = $this->_enum_attrdef;
- } else {
- throw new HTMLPurifier_Exception('broken invariant sdelim and preg_split');
- }
- $r = $attrdef->validate($y, $config, $context);
- if ($r !== false) {
- if ($r !== true) {
- $y = $r;
- }
- if ($nx === null) {
- $nx = '';
- }
- $nx .= $sdelim . $y;
- }
- }
- }
- if ($nx !== null) {
- if ($nsel === null) {
- $nsel = $nx;
- } else {
- $nsel .= $delim . $nx;
+ // $nx stays null; this matters
+ // if we don't manage to find
+ // any valid selector content,
+ // in which case we ignore the
+ // outer $delim
}
+ } elseif ($j % 2) {
+ // set delimiter
+ $sdelim = $y;
} else {
- // delimiters to the left of invalid
- // basic selector ignored
+ $attrdef = null;
+ if ($sdelim === '#') {
+ $attrdef = $this->_id_attrdef;
+ } elseif ($sdelim === '.') {
+ $attrdef = $this->_class_attrdef;
+ } elseif ($sdelim === ':') {
+ $attrdef = $this->_enum_attrdef;
+ } else {
+ throw new HTMLPurifier_Exception('broken invariant sdelim and preg_split');
+ }
+ $r = $attrdef->validate($y, $config, $context);
+ if ($r !== false) {
+ if ($r !== true) {
+ $y = $r;
+ }
+ if ($nx === null) {
+ $nx = '';
+ }
+ $nx .= $sdelim . $y;
+ }
}
}
- }
- if ($nsel !== null) {
- if (!empty($scopes)) {
- foreach ($scopes as $s) {
- $new_selectors[] = "$s $nsel";
+ if ($nx !== null) {
+ if ($nsel === null) {
+ $nsel = $nx;
+ } else {
+ $nsel .= $delim . $nx;
}
} else {
- $new_selectors[] = $nsel;
+ // delimiters to the left of invalid
+ // basic selector ignored
}
}
}
- if (empty($new_selectors)) {
+ if ($nsel !== null) {
+ if (!empty($scopes)) {
+ foreach ($scopes as $s) {
+ $new_selectors[] = "$s $nsel";
+ }
+ } else {
+ $new_selectors[] = $nsel;
+ }
+ }
+ }
+ if (empty($new_selectors)) {
+ continue;
+ }
+ $selector = implode(', ', $new_selectors);
+ foreach ($style as $name => $value) {
+ if (!isset($css_definition->info[$name])) {
+ unset($style[$name]);
continue;
}
- $selector = implode(', ', $new_selectors);
- foreach ($style as $name => $value) {
- if (!isset($css_definition->info[$name])) {
- unset($style[$name]);
- continue;
- }
- $uni_ret = $this->_universal_attrdef->validate($value, $config, $context);
- if ($uni_ret !== false) {
- $style[$name] = $uni_ret;
- continue;
- }
- $def = $css_definition->info[$name];
- $ret = $def->validate($value, $config, $context);
- if ($ret === false) {
- unset($style[$name]);
- } else {
- $style[$name] = $ret;
- }
+ $def = $css_definition->info[$name];
+ $ret = $def->validate($value, $config, $context);
+ if ($ret === false) {
+ unset($style[$name]);
+ } else {
+ $style[$name] = $ret;
}
- $new_decls[$selector] = $style;
}
- } else {
- continue;
+ $new_decls[$selector] = $style;
}
$new_css[$k] = $new_decls;
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php
index d86509ced..276d8362f 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php
@@ -19,7 +19,7 @@ class HTMLPurifier_Filter_YouTube extends HTMLPurifier_Filter
$pre_regex = '##s';
$pre_replace = '\1';
- return preg_replace($pre_regex, $pre_replace, (string)$html);
+ return preg_replace($pre_regex, $pre_replace, $html);
}
/**
@@ -31,7 +31,7 @@ class HTMLPurifier_Filter_YouTube extends HTMLPurifier_Filter
public function postFilter($html, $config, $context)
{
$post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#';
- return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), (string)$html);
+ return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html);
}
/**
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php
index 457fa9054..eb56e2dfa 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php
@@ -244,7 +244,7 @@ class HTMLPurifier_Generator
// whitespace (in fact, most don't, at least for attributes
// like alt, but an extra space at the end is barely
// noticeable). Still, we have a configuration knob for
- // this, since this transformation is not necessary if you
+ // this, since this transformation is not necesary if you
// don't process user input with innerHTML or you don't plan
// on supporting Internet Explorer.
if ($this->_innerHTMLFix) {
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php
index dc2c33c7f..9b7b334dd 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php
@@ -264,8 +264,9 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition
if (isset($this->info_content_sets['Block'][$block_wrapper])) {
$this->info_block_wrapper = $block_wrapper;
} else {
- throw new Exception(
- 'Cannot use non-block element as block wrapper'
+ trigger_error(
+ 'Cannot use non-block element as block wrapper',
+ E_USER_ERROR
);
}
@@ -275,7 +276,11 @@ class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition
$this->info_parent = $parent;
$this->info_parent_def = $def;
} else {
- throw new Exception('Cannot use unrecognized element as parent');
+ trigger_error(
+ 'Cannot use unrecognized element as parent',
+ E_USER_ERROR
+ );
+ $this->info_parent_def = $this->manager->getElement($this->info_parent, true);
}
// support template text
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php
index f02a563e7..a9042a357 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php
@@ -28,7 +28,7 @@ class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule
// HTML 4.01 specifies that ins/del must not contain block
// elements when used in an inline context, chameleon is
- // a complicated workaround to achieve this effect
+ // a complicated workaround to acheive this effect
// Inline context ! Block context (exclamation mark is
// separator, see getChildDef for parsing)
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php
index 71dfc7744..f7e7c91c0 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php
@@ -28,28 +28,22 @@ class HTMLPurifier_HTMLModule_Iframe extends HTMLPurifier_HTMLModule
if ($config->get('HTML.SafeIframe')) {
$this->safe = true;
}
- $attrs = array(
- 'src' => 'URI#embedded',
- 'width' => 'Length',
- 'height' => 'Length',
- 'name' => 'ID',
- 'scrolling' => 'Enum#yes,no,auto',
- 'frameborder' => 'Enum#0,1',
- 'longdesc' => 'URI',
- 'marginheight' => 'Pixels',
- 'marginwidth' => 'Pixels',
- );
-
- if ($config->get('HTML.Trusted')) {
- $attrs['allowfullscreen'] = 'Bool#allowfullscreen';
- }
-
$this->addElement(
'iframe',
'Inline',
'Flow',
'Common',
- $attrs
+ array(
+ 'src' => 'URI#embedded',
+ 'width' => 'Length',
+ 'height' => 'Length',
+ 'name' => 'ID',
+ 'scrolling' => 'Enum#yes,no,auto',
+ 'frameborder' => 'Enum#0,1',
+ 'longdesc' => 'URI',
+ 'marginheight' => 'Pixels',
+ 'marginwidth' => 'Pixels',
+ )
);
}
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php
index d1afde0f8..a0d48924d 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php
@@ -2,7 +2,7 @@
/**
* XHTML 1.1 Ruby Annotation Module, defines elements that indicate
- * short runs of text alongside base text for annotation or pronunciation.
+ * short runs of text alongside base text for annotation or pronounciation.
*/
class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule
{
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php
index bd926dc26..12173ba70 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy.php
@@ -112,8 +112,9 @@ class HTMLPurifier_HTMLModule_Tidy extends HTMLPurifier_HTMLModule
return;
}
if (!isset($this->fixesForLevel[$this->defaultLevel])) {
- throw new Exception(
- 'Default level ' . $this->defaultLevel . ' does not exist'
+ trigger_error(
+ 'Default level ' . $this->defaultLevel . ' does not exist',
+ E_USER_ERROR
);
return;
}
@@ -161,7 +162,8 @@ class HTMLPurifier_HTMLModule_Tidy extends HTMLPurifier_HTMLModule
$e->$type = $fix;
break;
default:
- throw new Exception("Fix type $type not supported");
+ trigger_error("Fix type $type not supported", E_USER_ERROR);
+ break;
}
}
}
@@ -219,7 +221,6 @@ class HTMLPurifier_HTMLModule_Tidy extends HTMLPurifier_HTMLModule
*/
public function makeFixes()
{
- return array();
}
}
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php
index 5b3f3d50c..a995161b2 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Tidy/Name.php
@@ -1,7 +1,7 @@
dir . '/Language/classes/' . $code . '.php';
- if (file_exists($file) || class_exists($class)) {
+ if (file_exists($file) || class_exists($class, false)) {
$lang = new $class($config, $context);
} else {
// Go fallback
@@ -173,8 +173,14 @@ class HTMLPurifier_LanguageFactory
// infinite recursion guard
if (isset($languages_seen[$code])) {
- throw new Exception('Circular fallback reference in language ' . $code);
+ trigger_error(
+ 'Circular fallback reference in language ' .
+ $code,
+ E_USER_ERROR
+ );
+ $fallback = 'en';
}
+ $language_seen[$code] = true;
// load the fallback recursively
$this->loadLanguage($fallback);
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php
index 793edc89a..c21f36491 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php
@@ -101,7 +101,7 @@ class HTMLPurifier_Lexer
break;
}
- if (class_exists('DOMDocument') &&
+ if (class_exists('DOMDocument', false) &&
method_exists('DOMDocument', 'loadHTML') &&
!extension_loaded('domxml')
) {
@@ -238,7 +238,7 @@ class HTMLPurifier_Lexer
*/
public function tokenizeHTML($string, $config, $context)
{
- throw new Exception('Call to abstract class');
+ trigger_error('Call to abstract class', E_USER_ERROR);
}
/**
@@ -269,6 +269,20 @@ class HTMLPurifier_Lexer
);
}
+ /**
+ * Special Internet Explorer conditional comments should be removed.
+ * @param string $string HTML string to process.
+ * @return string HTML with conditional comments removed.
+ */
+ protected static function removeIEConditional($string)
+ {
+ return preg_replace(
+ '##si', // probably should generalize for all strings
+ '',
+ $string
+ );
+ }
+
/**
* Callback function for escapeCDATA() that does the work.
*
@@ -309,6 +323,8 @@ class HTMLPurifier_Lexer
// escape CDATA
$html = $this->escapeCDATA($html);
+ $html = $this->removeIEConditional($html);
+
// extract body from document if applicable
if ($config->get('Core.ConvertDocumentToFragment')) {
$e = false;
diff --git a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php
index de79aaaec..ca5f25b84 100644
--- a/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php
+++ b/src/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php
@@ -52,7 +52,14 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
// attempt to armor stray angled brackets that cannot possibly
// form tags and thus are probably being used as emoticons
if ($config->get('Core.AggressivelyFixLt')) {
- $html = $this->aggressivelyFixLt($html);
+ $char = '[^a-z!\/]';
+ $comment = "/|\z)/is";
+ $html = preg_replace_callback($comment, array($this, 'callbackArmorCommentEntities'), $html);
+ do {
+ $old = $html;
+ $html = preg_replace("/<($char)/i", '<\\1', $html);
+ } while ($html !== $old);
+ $html = preg_replace_callback($comment, array($this, 'callbackUndoCommentSubst'), $html); // fix comments
}
// preprocess html, essential for UTF-8
@@ -65,9 +72,6 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
if ($config->get('Core.AllowParseManyTags') && defined('LIBXML_PARSEHUGE')) {
$options |= LIBXML_PARSEHUGE;
}
- if ($config->get('Core.RemoveBlanks') && defined('LIBXML_NOBLANKS')) {
- $options |= LIBXML_NOBLANKS;
- }
set_error_handler(array($this, 'muteErrorHandler'));
// loadHTML() fails on PHP 5.3 when second parameter is given
@@ -100,6 +104,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
* To iterate is human, to recurse divine - L. Peter Deutsch
* @param DOMNode $node DOMNode to be tokenized.
* @param HTMLPurifier_Token[] $tokens Array-list of already tokenized tokens.
+ * @return HTMLPurifier_Token of node appended to previously passed tokens.
*/
protected function tokenizeDOM($node, &$tokens, $config)
{
@@ -281,7 +286,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
*/
public function callbackUndoCommentSubst($matches)
{
- return '';
-
- while (($startPos = strpos($html, $startTag, $offset)) !== false) {
- $startPos += strlen($startTag); // Move past `
+ 页面自动 跳转 等待时间:
-
+ var interval = setInterval(function(){
+ var time = --wait.innerHTML;
+ if(time <= 0) {
+ location.href = href;
+ clearInterval(interval);
+ };
+ }, 1000);
+ })();
+