浏览代码

[IMPORTANT]Update composer vendors(remove unused libraries, encrypt autoload.php/Yii.php/View.php/BaseYii.php)

oubo 5 年之前
父节点
当前提交
f34d612439
共有 100 个文件被更改,包括 2331 次插入7506 次删除
  1. 12 34
      composer.json
  2. 290 3720
      composer.lock
  3. 3 0
      vendor/aliyuncs/oss-sdk-php/.gitignore
  4. 3 1
      vendor/aliyuncs/oss-sdk-php/.travis.yml
  5. 62 22
      vendor/aliyuncs/oss-sdk-php/CHANGELOG.md
  6. 149 0
      vendor/aliyuncs/oss-sdk-php/README-CN.md
  7. 64 66
      vendor/aliyuncs/oss-sdk-php/README.md
  8. 17 14
      vendor/aliyuncs/oss-sdk-php/phpunit.xml
  9. 0 167
      vendor/aliyuncs/oss-sdk-php/samples/Bucket.php
  10. 0 108
      vendor/aliyuncs/oss-sdk-php/samples/BucketCors.php
  11. 0 109
      vendor/aliyuncs/oss-sdk-php/samples/BucketLifecycle.php
  12. 0 95
      vendor/aliyuncs/oss-sdk-php/samples/BucketLogging.php
  13. 0 101
      vendor/aliyuncs/oss-sdk-php/samples/BucketReferer.php
  14. 0 92
      vendor/aliyuncs/oss-sdk-php/samples/BucketWebsite.php
  15. 0 84
      vendor/aliyuncs/oss-sdk-php/samples/Common.php
  16. 0 15
      vendor/aliyuncs/oss-sdk-php/samples/Config.php
  17. 0 182
      vendor/aliyuncs/oss-sdk-php/samples/MultipartUpload.php
  18. 0 437
      vendor/aliyuncs/oss-sdk-php/samples/Object.php
  19. 0 13
      vendor/aliyuncs/oss-sdk-php/samples/RunAll.php
  20. 0 143
      vendor/aliyuncs/oss-sdk-php/samples/Signature.php
  21. 4 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Core/MimeTypes.php
  22. 2 2
      vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssException.php
  23. 86 33
      vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php
  24. 78 120
      vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php
  25. 5 5
      vendor/aliyuncs/oss-sdk-php/src/OSS/Http/ResponseCore.php
  26. 7 7
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketInfo.php
  27. 3 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketListInfo.php
  28. 5 5
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php
  29. 9 9
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsRule.php
  30. 34 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelHistory.php
  31. 68 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelInfo.php
  32. 107 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelStatus.php
  33. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleAction.php
  34. 5 5
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleConfig.php
  35. 10 10
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleRule.php
  36. 121 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelConfig.php
  37. 59 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelHistory.php
  38. 107 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelInfo.php
  39. 107 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelListInfo.php
  40. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LoggingConfig.php
  41. 4 4
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php
  42. 3 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfo.php
  43. 4 4
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PrefixInfo.php
  44. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RefererConfig.php
  45. 74 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/StorageCapacityConfig.php
  46. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/UploadInfo.php
  47. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WebsiteConfig.php
  48. 2 2
      vendor/aliyuncs/oss-sdk-php/src/OSS/Model/XmlConfig.php
  49. 526 128
      vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php
  50. 1 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php
  51. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AppendResult.php
  52. 21 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CallbackResult.php
  53. 30 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CopyObjectResult.php
  54. 27 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectsResult.php
  55. 3 4
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ExistResult.php
  56. 0 15
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCnameResult.php
  57. 1 2
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCorsResult.php
  58. 4 4
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLifecycleResult.php
  59. 19 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php
  60. 19 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php
  61. 19 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelStatusResult.php
  62. 30 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLocationResult.php
  63. 3 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLoggingResult.php
  64. 3 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetRefererResult.php
  65. 34 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetStorageCapacityResult.php
  66. 3 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetWebsiteResult.php
  67. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/HeaderResult.php
  68. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateMultipartUploadResult.php
  69. 16 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListLiveChannelResult.php
  70. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListMultipartUploadResult.php
  71. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php
  72. 1 1
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListPartsResult.php
  73. 16 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutLiveChannelResult.php
  74. 4 3
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutSetDeleteResult.php
  75. 13 13
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php
  76. 24 0
      vendor/aliyuncs/oss-sdk-php/src/OSS/Result/SymlinkResult.php
  77. 0 59
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/AclResultTest.php
  78. 0 26
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BodyResultTest.php
  79. 0 79
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketCnameTest.php
  80. 0 21
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketInfoTest.php
  81. 0 77
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CnameConfigTest.php
  82. 0 70
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/Common.php
  83. 0 136
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ContentTypeTest.php
  84. 0 140
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CorsConfigTest.php
  85. 0 38
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ExistResultTest.php
  86. 0 67
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetCorsResultTest.php
  87. 0 59
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetLifecycleResultTest.php
  88. 0 51
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetLoggingResultTest.php
  89. 0 51
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetRefererResultTest.php
  90. 0 50
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetWebsiteResultTest.php
  91. 0 23
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/HeaderResultTest.php
  92. 0 88
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/HttpTest.php
  93. 0 47
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/InitiateMultipartUploadResultTest.php
  94. 0 130
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/LifecycleConfigTest.php
  95. 0 97
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListBucketsResultTest.php
  96. 0 114
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListMultipartUploadResultTest.php
  97. 0 151
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsResultTest.php
  98. 0 62
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListPartsResultTest.php
  99. 0 47
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/LoggingConfigTest.php
  100. 0 13
      vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/MimeTypesTest.php

+ 12 - 34
composer.json

@@ -12,34 +12,19 @@
         "irc": "irc://irc.freenode.net/yii",
         "source": "https://github.com/yiisoft/yii2"
     },
-    "minimum-stability": "dev",
+    "minimum-stability": "stable",
     "require": {
-        "php": ">=5.6.0",
-        "yiisoft/yii2": "~2.0.0",
-        "yiisoft/yii2-bootstrap": "~2.0.0",
-        "yiisoft/yii2-swiftmailer": "~2.0",
-        "yiisoft/yii2-redis": "~2.0.7",
-        "yiisoft/yii2-twig": "~2.0.0",
-        "yiisoft/yii2-mongodb": "~2.1.0",
-        "solarium/solarium": "~3.5",
-        "yiisoft/yii2-imagine": "~2.0.0",
-        "aliyuncs/oss-sdk-php": "~2.0.0",
-        "fabiang/xmpp": "^1.0@dev",
-        "phpoffice/phpspreadsheet": "~1.2",
-        "ext-imagick": "*",
-        "tecnickcom/tcpdf": "~6.2"
+        "php": "^7.4.0",
+        "yiisoft/yii2": "^2.0.0",
+        "yiisoft/yii2-redis": "^2.0.7",
+        "yiisoft/yii2-mongodb": "^2.1.0",
+        "solarium/solarium": "^5.1.6",
+        "yiisoft/yii2-imagine": "^2.0.0",
+        "aliyuncs/oss-sdk-php": "^2.3.1",
+        "phpoffice/phpspreadsheet": "~1.11.0",
+        "tecnickcom/tcpdf": "^6.3.5"
     },
     "require-dev": {
-        "yiisoft/yii2-debug": "~2.0.0",
-        "yiisoft/yii2-gii": "~2.0.0",
-        "yiisoft/yii2-faker": "~2.0.0",
-        "phpunit/phpunit-mock-objects": "~3.4",
-        "codeception/base": "*",
-        "codeception/verify": "*",
-        "facebook/webdriver": "^1.0.1",
-        "guzzlehttp/guzzle": ">=4.1.4 <7.0",
-        "flow/jsonpath": "dev-master",
-        "codeception/c3": "*"
     },
     "replace": {
         "bower-asset/jquery": "*",
@@ -60,14 +45,7 @@
             "npm-asset-library": "vendor/npm",
             "bower-asset-library": "vendor/bower"
         }
-    },
-    "scripts": {
-        "post-install-cmd": "php init --env=Development --overwrite=n"
-    },
-    "repositories": {
-        "packagist": {
-            "type": "composer",
-            "url": "https://packagist.phpcomposer.com"
-        }
     }
 }
+
+

文件差异内容过多而无法显示
+ 290 - 3720
composer.lock


+ 3 - 0
vendor/aliyuncs/oss-sdk-php/.gitignore

@@ -3,3 +3,6 @@ composer.lock
 doc
 output
 .idea
+.buildpath
+.project
+.settings

+ 3 - 1
vendor/aliyuncs/oss-sdk-php/.travis.yml

@@ -1,9 +1,10 @@
 language: php
 php:
+  - 7.1
+  - 7.0
   - 5.6
   - 5.5
   - 5.4
-  - 5.3
 install:
   - composer self-update
   - composer install --no-interaction
@@ -17,3 +18,4 @@ env:
     - secure: nEhsU8aUQqsAJeuger+boh51oTpeo4YNG7vUWbKxdwVDIrcLb+l7r7RvTlxU7mt8IZTWwicgri18mh+Wi04BwX4ulBA1SCs8jPbL51KEo5izoDGGtLSd2fuPHdslYSrwagrvq90EPnDT/7fHWn/TAoT+rueZzjNyCu5IGSgL3GnXaUThsJ82NMePL2YRdP4Q1qmtZPRFBOkOQ6F0heuV8fw8sLyTO3txaCQum9YneGxrWxOl/E8zB0qtlnPwLE8ogaHZMQh2/jThmTbI5UqwRTxV4f0qoD5eJYH+j0fslsSAjsg/HPnSuVcnccK3zSU+s2sV4dPCcISzECJvZEObwipfxOGhdqt5gMcxHhn8qVsbT97iIh106pG/BJCDgQd2EeVW8WfCi6cCuCKIMipvVkMypkmjQHWU1XaqPzILl7g5diW9Ctp2C4Akq5dYdrdu8IrnVK1ShtkQVaWU+S/Bht8VU5gYP7olPW/GdTz7sceU1NOIC4NPXqmWKbfavR98U5dkHMLMvzABYL1Q87h+KhPD1c14NUyw3YENUW7REiF/X5lERRm5H0kJ/1JqAa+AgeHQEGmPVuZV2s/na4b0S1479QRVmSM/6ZzXQpU+Y8jCRfETpUFA4S331369kirHgCqDlxyIntuEKrzivD02/O+5C3eJ0WHRz6QsN2/R4qg=
     - secure: ZTvzNXEZP4efl+a/3VGMmdabfUQp83v5/lecMns039Ro7UuZYPdtbPtpPnpjaTI6Htd22A4Rva5BU/3JCQJAyQvpbKNn5sGou2SmfQu3o0SyhggSB7gWjYAf707aW1j4bHYfP8IjDS5NjuVk3AqXeNSUuLRUXRmwSOB0lSYiRhiTJY+pUdBl382Hx4NbhIU/gmOzRoJCs7coTip8IURXYEHPi5dnDWluajxI+TgNXFccSgEleeQDJajYgXmpLb2EhSj8piipOnVgaCEE5bh5fbp32024Qq38SGHKcbfnwj2IInpZpZESJknRKoqAlFjdOJhork82dBcvAr5JxCBZKx5IuwXcTjxkQ6tRtBeqhPLPFuX3MQ8WrtU+wniPM0RCH/VoFkUKO7JGQDwmoi2AKago4PsuDs4P6Y6CeuOVpcso731GwwMNhIJcyrJJivXprQNEGsEw+9wLjU1qNYs6IIA3S/gPzFrNbdX5Wf8vxt0vLpgYvBNtPnLMejMtknuyfVzf5iKuVVoGPDTEz+ajs06+jfoPfm/4sLTaLghuVH7Adm74OpF769JQNnQYKwJuu4bNlcbLJChulCEMBOx7myqo/9O6RCTuqzHaGmVWNot4RGqRFHgJGl/JJf0WpAVitbhbRH3kGoyKb6jFM74CJbPsE7OORlJLDC3cdD3C8Pk=
     - secure: Qr5NR4CVzBKCQgRgMH0x772TPJ1+brx3UCvtRNu8fi4j3p8bz+HDMjBaBDSFmEB09nunLI55/8mj88/5GXmnpFs8+CPTkcW+QZOcxg3cxpI4SNmxoB12/ZawlFHAqSUaRRE7RUWVkY3KL8tIGjEZcFyUBQ1DVNX3OMpiKs3NLtHa7oUIknyBxdSokm4kpLhSXYe7WmO0vhuZbMZE0S1EISToiBS6AdhGUEbTLJ/vNsIDY07fu6+Vh3HxVbyUFPqUZGlkZpQ+2xMJ3kiqPBMrXtRF/IhhPjORDil6Ns9SQ8/AAlaCddvYvRaT4Pjv2/aX+t3l28qI1qmryPtWXpce5UXecWGYqdRpSJc6Y/pEt4m4FeeGoEFWnSPGIs7FRmeiis8q2rojGZ18i4vI/k4iHmqEBnTlMp3SWnRb9L1adJ8ZAWln8aC88gkQXm67w7+1CxLycerbYj9H1ugqHENuHcxv4uHUcZgEENX3EWatu8i9+K2IUuU/2zcmpu7qtsziYcoyW8DOOmYpJfXGMLtmF9+pqp/Tp6i0tltFSEfmY3N8o7xvv3enLvFHsjL+3ElFdd1blUPSrvZJHgA9M3lJ+QF1RJZCpJqgPlQ0XOZK1Bf4P46zpEj01wKaK4JQrkLPRXhbBOuIJn5O6WlFJyPX4+SaBfwTzb4AvM4aUg2TgTg=
+    - secure: Inw5ftA8fxvhMHRZwoZzATxn4WICJsCq7ZX4y2gI+b/8u0JQIsbLgY9WTYV+XdSxOoNwuVa1oUxEWI0aDORtXKC3XaIXXKrwndag0zxS77JEYwWvQsjM7BhEbF7MF7MYk8rRXpn6mbfGAT/NfqEOx91RCY8UKeMzD0oPkpkBnJ9Ekuod6JBBq+7j3v4mYUItA8pxvw7b4Pdd4z2xzjgOwNhJYMOCpts50DWZI+WXj0HvTYaMXe5mJJtORK5lsr0a9cbsBqAzE6l+3zGI8XkgHn130ux5XH3DE7hZBeti3ZNaO3d2Vv+496/1EObG0rSFk+z3dmNKqjMz4nh3bYIkdLMegwmgCWs2mvQhkwYhzmnPRHVSERrgZjSWnuKn2PKnBar6tui9KaLNgpo2j3jWpwMLJ3bGAfE5JtMppxAxNqj/q+YB2UZo7Mn7EDjkTDjgxCuazTJwWqH7xxCOykWPABBI17P3JaOXQJEK39LavpfSMm3kdmU0ocpUs7FniLuFm6xL71VxY1wHG10yskczEcFHZ3iyIyGM+xum4vbt5y6Yg+zfdExYQsbrxHDDZ3HbHY3tEU0WhM55vrC42NIXRWqXqJ8OAxpl4nivfx96eoBAThiUU9xXtZmh7WRFVYsstoGtxZwfk5+bi+oeVO9kih4xabwbgHgL9BTc1TR1C4U=

+ 62 - 22
vendor/aliyuncs/oss-sdk-php/CHANGELOG.md

@@ -1,5 +1,45 @@
 # ChangeLog - Aliyun OSS SDK for PHP
 
+## v2.3.1 / 2019-011-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
@@ -11,47 +51,47 @@
 
 ## v2.0.5
 
-* 增加Add/Delete/Get BucketCname接口
+* Added Add/Delete/Get BucketCname interface
 
 ## v2.0.4
 
-* 增加Put/Get Object Acl接口
+* Added Put/Get Object Acl interface
 
 ## v2.0.3
 
-* 修复Util中的常量定义在低于5.6的PHP版本中报错的问题
+* Fixing the constants in Util is defined in a PHP version that is less than 5.6.
 
 ## v2.0.2
 
-* 修复multipart上传时无法指定Content-Type的问题
+* The problem of content-type cannot be specified when restoring multipart uploads
 
 ## v2.0.1
 
-* 增加对ListObjects/ListMultipartUploads时特殊字符的处理
-* 提供接口获取OssException中的详细信息
+* 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版本
+* PHP 5.2 is no longer supported
 
-### 新增内容
+### Add the cotent
 
-* 引入命名空间
-* 接口命名修正,采用驼峰式命名
-* 接口入参修改,把常用参数从Options参数中提出来
-* 接口返回结果修改,对返回结果进行处理,用户可以直接得到容易处理的数据结构 
-* OssClient的构造函数变更
-* 支持CNAME和IP格式的Endpoint地址
-* 重新整理sample文件组织结构,使用function组织功能点
-* 增加设置连接超时,请求超时的接口
-* 去掉Object Group相关的已经过时的接口
-* OssException中的message改为英文
+* 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
 
-* object名称校验不完备
+* The object name is not complete

+ 149 - 0
vendor/aliyuncs/oss-sdk-php/README-CN.md

@@ -0,0 +1,149 @@
+# Aliyun OSS SDK for PHP
+
+[![Latest Stable Version](https://poser.pugx.org/aliyuncs/oss-sdk-php/v/stable)](https://packagist.org/packages/aliyuncs/oss-sdk-php)
+[![Build Status](https://travis-ci.org/aliyun/aliyun-oss-php-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-oss-php-sdk)
+[![Coverage Status](https://coveralls.io/repos/github/aliyun/aliyun-oss-php-sdk/badge.svg?branch=master)](https://coveralls.io/github/aliyun/aliyun-oss-php-sdk?branch=master)
+
+## [README of English](https://github.com/aliyun/aliyun-oss-php-sdk/blob/master/README.md)
+
+## 概述
+
+阿里云对象存储(Object Storage Service,简称OSS),是阿里云对外提供的海量、安全、低成本、高可靠的云存储服务。用户可以通过调用API,在任何应用、任何时间、任何地点上传和下载数据,也可以通过用户Web控制台对数据进行简单的管理。OSS适合存放任意文件类型,适合各种网站、开发企业及开发者使用。
+
+
+## 运行环境
+- PHP 5.3+
+- cURL extension
+
+提示:
+
+- Ubuntu下可以使用apt-get包管理器安装php的cURL扩展 `sudo apt-get install php5-curl`
+
+## 安装方法
+
+1. 如果您通过composer管理您的项目依赖,可以在你的项目根目录运行:
+
+        $ composer require aliyuncs/oss-sdk-php
+
+   或者在你的`composer.json`中声明对Aliyun OSS SDK for PHP的依赖:
+
+        "require": {
+            "aliyuncs/oss-sdk-php": "~2.0"
+        }
+
+   然后通过`composer install`安装依赖。composer安装完成后,在您的PHP代码中引入依赖即可:
+
+        require_once __DIR__ . '/vendor/autoload.php';
+
+2. 您也可以直接下载已经打包好的[phar文件][releases-page],然后在你
+   的代码中引入这个文件即可:
+
+        require_once '/path/to/oss-sdk-php.phar';
+
+3. 下载SDK源码,在您的代码中引入SDK目录下的`autoload.php`文件:
+
+        require_once '/path/to/oss-sdk/autoload.php';
+
+## 快速使用
+
+### 常用类
+
+| 类名 | 解释 |
+|:------------------|:------------------------------------|
+|OSS\OssClient | OSS客户端类,用户通过OssClient的实例调用接口 |
+|OSS\Core\OssException | OSS异常类,用户在使用的过程中,只需要注意这个异常|
+
+### OssClient初始化
+
+SDK的OSS操作通过OssClient类完成的,下面代码创建一个OssClient对象:
+
+```php
+<?php
+$accessKeyId = "<您从OSS获得的AccessKeyId>"; ;
+$accessKeySecret = "<您从OSS获得的AccessKeySecret>";
+$endpoint = "<您选定的OSS数据中心访问域名,例如oss-cn-hangzhou.aliyuncs.com>";
+try {
+    $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### 文件操作
+
+文件(又称对象,Object)是OSS中最基本的数据单元,您可以把它简单地理解为文件,用下面代码可以实现一个Object的上传:
+
+```php
+<?php
+$bucket = "<您使用的Bucket名字,注意命名规范>";
+$object = "<您使用的Object名字,注意命名规范>";
+$content = "Hello, OSS!"; // 上传的文件内容
+try {
+    $ossClient->putObject($bucket, $object, $content);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### 存储空间操作
+
+存储空间(又称Bucket)是一个用户用来管理所存储Object的存储空间,对于用户来说是一个管理Object的单元,所有的Object都必须隶属于某个Bucket。您可以按照下面的代码新建一个Bucket:
+
+```php
+<?php
+$bucket = "<您使用的Bucket名字,注意命名规范>";
+try {
+    $ossClient->createBucket($bucket);
+} catch (OssException $e) {
+    print $e->getMessage();
+}
+```
+
+### 返回结果处理
+
+OssClient提供的接口返回返回数据分为两种:
+
+* Put,Delete类接口,接口返回null,如果没有OssException,即可认为操作成功
+* Get,List类接口,接口返回对应的数据,如果没有OssException,即可认为操作成功,举个例子:
+
+```php
+<?php
+$bucketListInfo = $ossClient->listBuckets();
+$bucketList = $bucketListInfo->getBucketList();
+foreach($bucketList as $bucket) {
+    print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n");
+}
+```
+上面代码中的$bucketListInfo的数据类型是 `OSS\Model\BucketListInfo`
+
+
+### 运行Sample程序
+
+1. 修改 `samples/Config.php`, 补充配置信息
+2. 执行 `cd samples/ && php RunAll.php`
+
+### 运行单元测试
+
+1. 执行`composer install`下载依赖的库
+2. 设置环境变量
+
+        export OSS_ACCESS_KEY_ID=access-key-id
+        export OSS_ACCESS_KEY_SECRET=access-key-secret
+        export OSS_ENDPOINT=endpoint
+        export OSS_BUCKET=bucket-name
+
+3. 执行 `php vendor/bin/phpunit`
+
+## License
+
+- MIT
+
+## 联系我们
+
+- [阿里云OSS官方网站](http://oss.aliyun.com)
+- [阿里云OSS官方论坛](http://bbs.aliyun.com)
+- [阿里云OSS官方文档中心](http://www.aliyun.com/product/oss#Docs)
+- 阿里云官方技术支持:[提交工单](https://workorder.console.aliyun.com/#/ticket/createIndex)
+
+[releases-page]: https://github.com/aliyun/aliyun-oss-php-sdk/releases
+[phar-composer]: https://github.com/clue/phar-composer

+ 64 - 66
vendor/aliyuncs/oss-sdk-php/README.md

@@ -1,65 +1,67 @@
-# Aliyun OSS SDK for PHP
+# Alibaba Cloud OSS SDK for PHP
 
 [![Latest Stable Version](https://poser.pugx.org/aliyuncs/oss-sdk-php/v/stable)](https://packagist.org/packages/aliyuncs/oss-sdk-php)
 [![Build Status](https://travis-ci.org/aliyun/aliyun-oss-php-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-oss-php-sdk)
 [![Coverage Status](https://coveralls.io/repos/github/aliyun/aliyun-oss-php-sdk/badge.svg?branch=master)](https://coveralls.io/github/aliyun/aliyun-oss-php-sdk?branch=master)
 
-## 概述
+## [README of Chinese](https://github.com/aliyun/aliyun-oss-php-sdk/blob/master/README-CN.md)
 
-阿里云对象存储(Object Storage Service,简称OSS),是阿里云对外提供的海量、安全、低成本、高可靠的云存储服务。用户可以通过调用API,在任何应用、任何时间、任何地点上传和下载数据,也可以通过用户Web控制台对数据进行简单的管理。OSS适合存放任意文件类型,适合各种网站、开发企业及开发者使用。
+## Overview
 
+Alibaba Cloud Object Storage Service (OSS) is a cloud storage service provided by Alibaba Cloud, featuring a massive capacity, security, a low cost, and high reliability. You can upload and download data on any application anytime and anywhere by calling APIs, and perform simple management of data through the web console. The OSS can store any type of files and therefore applies to various websites, development enterprises and developers.
 
-## 运行环境
-- PHP 5.3+
-- cURL extension
 
-提示:
+## Run environment
+- PHP 5.3+.
+- cURL extension.
 
-- Ubuntu下可以使用apt-get包管理器安装php的cURL扩展 `sudo apt-get install php5-curl`
+Tips:
 
-## 安装方法
+- In Ubuntu, you can use the ***apt-get*** package manager to install the *PHP cURL extension*: `sudo apt-get install php5-curl`.
 
-1. 如果您通过composer管理您的项目依赖,可以在你的项目根目录运行:
+## Install OSS PHP SDK
 
-        $ composer require aliyuncs/oss-sdk-php
+- If you use the ***composer*** to manage project dependencies, run the following command in your project's root directory:
 
-   或者在你的`composer.json`中声明对Aliyun OSS SDK for PHP的依赖:
+        composer require aliyuncs/oss-sdk-php
+
+   You can also declare the dependency on Alibaba Cloud OSS SDK for PHP in the `composer.json` file.
 
         "require": {
             "aliyuncs/oss-sdk-php": "~2.0"
         }
 
-   然后通过`composer install`安装依赖。composer安装完成后,在您的PHP代码中引入依赖即可:
+   Then run `composer install` to install the dependency. After the Composer Dependency Manager is installed, import the dependency in your PHP code: 
 
         require_once __DIR__ . '/vendor/autoload.php';
 
-2. 您也可以直接下载已经打包好的[phar文件][releases-page],然后在你
-   的代码中引入这个文件即可:
+- You can also directly download the packaged [PHAR File][releases-page], and 
+   introduce the file to your code: 
 
         require_once '/path/to/oss-sdk-php.phar';
 
-3. 下载SDK源码,在您的代码中引入SDK目录下的`autoload.php`文件:
+- Download the SDK source code, and introduce the `autoload.php` file under the SDK directory to your code: 
 
         require_once '/path/to/oss-sdk/autoload.php';
 
-## 快速使用
+## Quick use
 
-### 常用类
+### Common classes
 
-| 类名 | 解释 |
+| Class | Explanation |
 |:------------------|:------------------------------------|
-|OSS\OssClient | OSS客户端类,用户通过OssClient的实例调用接口 |
-|OSS\Core\OssException | OSS异常类,用户在使用的过程中,只需要注意这个异常|
+|OSS\OSSClient | OSS client class. An OSSClient instance can be used to call the interface.  |
+|OSS\Core\OSSException |OSS Exception class . You only need to pay attention to this exception when you use the OSSClient. |
 
-### OssClient初始化
+### Initialize an OSSClient
 
-SDK的OSS操作通过OssClient类完成的,下面代码创建一个OssClient对象:
+The SDK's operations for the OSS are performed through the OSSClient class. The code below creates an OSSClient object:
 
 ```php
 <?php
-$accessKeyId = "<您从OSS获得的AccessKeyId>"; ;
-$accessKeySecret = "<您从OSS获得的AccessKeySecret>";
-$endpoint = "<您选定的OSS数据中心访问域名,例如oss-cn-hangzhou.aliyuncs.com>";
+$accessKeyId = "<AccessKeyID that you obtain from OSS>";
+$accessKeySecret = "<AccessKeySecret that you obtain from OSS>";
+$endpoint = "<Domain that you select to access an OSS data center, such as "oss-cn-hangzhou.aliyuncs.com>";
 try {
     $ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
 } catch (OssException $e) {
@@ -67,15 +69,15 @@ try {
 }
 ```
 
-### 文件操作
+### Operations on objects
 
-文件(又称对象,Object)是OSS中最基本的数据单元,您可以把它简单地理解为文件,用下面代码可以实现一个Object的上传:
+Objects are the most basic data units on the OSS. You can simply consider objects as files. The following code uploads an object:
 
 ```php
 <?php
-$bucket = "<您使用的Bucket名字,注意命名规范>";
-$object = "<您使用的Object名字,注意命名规范>";
-$content = "Hello, OSS!"; // 上传的文件内容
+$bucket= "<Name of the bucket in use. Pay attention to naming conventions>";
+$object = "<Name of the object in use. Pay attention to naming conventions>";
+$content = "Hello, OSS!"; // Content of the uploaded file
 try {
     $ossClient->putObject($bucket, $object, $content);
 } catch (OssException $e) {
@@ -83,13 +85,13 @@ try {
 }
 ```
 
-### 存储空间操作
+### Operations on buckets
 
-存储空间(又称Bucket)是一个用户用来管理所存储Object的存储空间,对于用户来说是一个管理Object的单元,所有的Object都必须隶属于某个Bucket。您可以按照下面的代码新建一个Bucket:
+Buckets are the space that you use to manage the stored objects. It is an object management unit for users. Each object must belong to a bucket. You can create a bucket with the following code:
 
 ```php
 <?php
-$bucket = "<您使用的Bucket名字,注意命名规范>";
+$bucket= "<Name of the bucket in use. Pay attention to naming conventions>";
 try {
     $ossClient->createBucket($bucket);
 } catch (OssException $e) {
@@ -97,56 +99,52 @@ try {
 }
 ```
 
-### 返回结果处理
+### Handle returned results
 
-OssClient提供的接口返回返回数据分为两种:
+The OSSClient provides the following two types of returned data from interfaces:
 
-* Put,Delete类接口,接口返回null,如果没有OssException,即可认为操作成功
-* Get,List类接口,接口返回对应的数据,如果没有OssException,即可认为操作成功,举个例子:
+- Put and Delete interfaces: The *PUT* and *DELETE* operations are deemed successful if *null* is returned by the interfaces without *OSSException*.
+- Get and List interfaces: The *GET* and *LIST* operations are deemed successful if the desired data is returned by the interfaces without *OSSException*. For example, 
 
-```php
-<?php
-$bucketListInfo = $ossClient->listBuckets();
-$bucketList = $bucketListInfo->getBucketList();
-foreach($bucketList as $bucket) {
-    print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n");
-}
-```
-上面代码中的$bucketListInfo的数据类型是 `OSS\Model\BucketListInfo`
+    ```php
+    <?php
+    $bucketListInfo = $ossClient->listBuckets();
+    $bucketList = $bucketListInfo->getBucketList();
+    foreach($bucketList as $bucket) {
+        print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n");
+    }
+    ```
+In the above code, $bucketListInfo falls into the 'OSS\Model\BucketListInfo' data type.
 
 
-### 运行Sample程序
+### Run a sample project
 
-1. 修改 `samples/Config.php`, 补充配置信息
-2. 执行 `cd samples/ && php RunAll.php`
+- Modify `samples/Config.php` to complete the configuration information. 
+- Run `cd samples/ && php RunAll.php`. 
 
-### 运行单元测试
+### Run a unit test
 
-1. 执行`composer install`下载依赖的库
-2. 设置环境变量
+- Run `composer install` to download the dependent libraries. 
+- Set the environment variable. 
 
         export OSS_ACCESS_KEY_ID=access-key-id
         export OSS_ACCESS_KEY_SECRET=access-key-secret
         export OSS_ENDPOINT=endpoint
         export OSS_BUCKET=bucket-name
 
-3. 执行 `php vendor/bin/phpunit`
+- Run `php vendor/bin/phpunit`
 
-## 贡献代码
+## License
 
-0. 开发流程参考:https://github.com/rockuw/oss-sdk-status#development-oss-members-only
-1. 提交代码后,确保travis CI是PASS的
-2. 每发布一个新的版本:
-  - 运行`build-phar.sh`生成相应的phar包(需要安装[phar-composer][phar-composer])
-  - 在[Release页面][releases-page]发布一个版本
-  - 将生成的phar包上传到相应的Release下面
+- MIT
 
-## 联系我们
+## Contact us
 
-- [阿里云OSS官方网站](http://oss.aliyun.com)
-- [阿里云OSS官方论坛](http://bbs.aliyun.com)
-- [阿里云OSS官方文档中心](http://www.aliyun.com/product/oss#Docs)
-- 阿里云官方技术支持:[提交工单](https://workorder.console.aliyun.com/#/ticket/createIndex)
+- [Alibaba Cloud OSS official website](http://oss.aliyun.com).
+- [Alibaba Cloud OSS official forum](http://bbs.aliyun.com).
+- [Alibaba Cloud OSS official documentation center](http://www.aliyun.com/product/oss#Docs).
+- Alibaba Cloud official technical support: [Submit a ticket](https://workorder.console.aliyun.com/#/ticket/createIndex).
 
 [releases-page]: https://github.com/aliyun/aliyun-oss-php-sdk/releases
 [phar-composer]: https://github.com/clue/phar-composer
+

+ 17 - 14
vendor/aliyuncs/oss-sdk-php/phpunit.xml

@@ -1,16 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xml>
+
 <phpunit>
-  <filter>
-    <whitelist>
-      <directory suffix=".php">./src</directory>
-    </whitelist>
-  </filter>
-  <logging>
-    <log type="coverage-clover" target="coverage.xml" />
-  </logging>
-  <testsuites>
-    <testsuite name="FunctionTest">
-      <directory>./tests</directory>
-      <exclude>./tests/OSS/Tests/BucketCnameTest.php</exclude>
-    </testsuite>
-  </testsuites>
+	<filter>
+		<whitelist>
+			<directory suffix=".php">./src</directory>
+		</whitelist>
+	</filter>
+	<logging>
+		<log type="coverage-clover" target="coverage.xml" />
+	</logging>
+	<testsuites>
+		<testsuite name="FunctionTest">
+			<directory>./tests</directory>
+			<exclude>./tests/OSS/Tests/BucketCnameTest.php</exclude>
+		</testsuite>
+	</testsuites>
 </phpunit>

+ 0 - 167
vendor/aliyuncs/oss-sdk-php/samples/Bucket.php

@@ -1,167 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-$bucket = Common::getBucketName();
-
-//******************************* 简单使用 ****************************************************************
-
-//创建bucket
-$ossClient->createBucket($bucket, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE);
-Common::println("bucket $bucket created");
-
-// 判断Bucket是否存在
-$doesExist = $ossClient->doesBucketExist($bucket);
-Common::println("bucket $bucket exist? " . ($doesExist ? "yes" : "no"));
-
-// 获取Bucket列表
-$bucketListInfo = $ossClient->listBuckets();
-
-// 设置bucket的ACL
-$ossClient->putBucketAcl($bucket, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE);
-Common::println("bucket $bucket acl put");
-// 获取bucket的ACL
-$acl = $ossClient->getBucketAcl($bucket);
-Common::println("bucket $bucket acl get: " . $acl);
-
-
-//******************************* 完整用法参考下面函数 ****************************************************
-
-createBucket($ossClient, $bucket);
-doesBucketExist($ossClient, $bucket);
-deleteBucket($ossClient, $bucket);
-putBucketAcl($ossClient, $bucket);
-getBucketAcl($ossClient, $bucket);
-listBuckets($ossClient);
-
-/**
- * 创建一个存储空间
- * acl 指的是bucket的访问控制权限,有三种,私有读写,公共读私有写,公共读写。
- * 私有读写就是只有bucket的拥有者或授权用户才有权限操作
- * 三种权限分别对应 (OssClient::OSS_ACL_TYPE_PRIVATE,OssClient::OSS_ACL_TYPE_PUBLIC_READ, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE)
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 要创建的存储空间名称
- * @return null
- */
-function createBucket($ossClient, $bucket)
-{
-    try {
-        $ossClient->createBucket($bucket, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- *  判断Bucket是否存在
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- */
-function doesBucketExist($ossClient, $bucket)
-{
-    try {
-        $res = $ossClient->doesBucketExist($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    if ($res === true) {
-        print(__FUNCTION__ . ": OK" . "\n");
-    } else {
-        print(__FUNCTION__ . ": FAILED" . "\n");
-    }
-}
-
-/**
- * 删除bucket,如果bucket不为空则bucket无法删除成功, 不为空表示bucket既没有object,也没有未完成的multipart上传时的parts
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 待删除的存储空间名称
- * @return null
- */
-function deleteBucket($ossClient, $bucket)
-{
-    try {
-        $ossClient->deleteBucket($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 设置bucket的acl配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function putBucketAcl($ossClient, $bucket)
-{
-    $acl = OssClient::OSS_ACL_TYPE_PRIVATE;
-    try {
-        $ossClient->putBucketAcl($bucket, $acl);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-
-/**
- * 获取bucket的acl配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getBucketAcl($ossClient, $bucket)
-{
-    try {
-        $res = $ossClient->getBucketAcl($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    print('acl: ' . $res);
-}
-
-
-/**
- * 列出用户所有的Bucket
- *
- * @param OssClient $ossClient OssClient实例
- * @return null
- */
-function listBuckets($ossClient)
-{
-    $bucketList = null;
-    try {
-        $bucketListInfo = $ossClient->listBuckets();
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    $bucketList = $bucketListInfo->getBucketList();
-    foreach ($bucketList as $bucket) {
-        print($bucket->getLocation() . "\t" . $bucket->getName() . "\t" . $bucket->getCreatedate() . "\n");
-    }
-}

+ 0 - 108
vendor/aliyuncs/oss-sdk-php/samples/BucketCors.php

@@ -1,108 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-use OSS\Model\CorsConfig;
-use OSS\Model\CorsRule;
-
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-$bucket = Common::getBucketName();
-
-
-//******************************* 简单使用 ****************************************************************
-
-// 设置cors配置
-$corsConfig = new CorsConfig();
-$rule = new CorsRule();
-$rule->addAllowedHeader("x-oss-header");
-$rule->addAllowedOrigin("http://www.b.com");
-$rule->addAllowedMethod("POST");
-$rule->setMaxAgeSeconds(10);
-$corsConfig->addRule($rule);
-$ossClient->putBucketCors($bucket, $corsConfig);
-Common::println("bucket $bucket corsConfig created:" . $corsConfig->serializeToXml());
-
-// 获取cors配置
-$corsConfig = $ossClient->getBucketCors($bucket);
-Common::println("bucket $bucket corsConfig fetched:" . $corsConfig->serializeToXml());
-
-// 删除cors配置
-$ossClient->deleteBucketCors($bucket);
-Common::println("bucket $bucket corsConfig deleted");
-
-//******************************* 完整用法参考下面函数  *****************************************************
-
-putBucketCors($ossClient, $bucket);
-getBucketCors($ossClient, $bucket);
-deleteBucketCors($ossClient, $bucket);
-getBucketCors($ossClient, $bucket);
-
-/**
- * 设置bucket的cors配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function putBucketCors($ossClient, $bucket)
-{
-    $corsConfig = new CorsConfig();
-    $rule = new CorsRule();
-    $rule->addAllowedHeader("x-oss-header");
-    $rule->addAllowedOrigin("http://www.b.com");
-    $rule->addAllowedMethod("POST");
-    $rule->setMaxAgeSeconds(10);
-    $corsConfig->addRule($rule);
-
-    try {
-        $ossClient->putBucketCors($bucket, $corsConfig);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 获取并打印bucket的cors配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getBucketCors($ossClient, $bucket)
-{
-    $corsConfig = null;
-    try {
-        $corsConfig = $ossClient->getBucketCors($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    print($corsConfig->serializeToXml() . "\n");
-}
-
-/**
- * 删除bucket的所有的cors配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function deleteBucketCors($ossClient, $bucket)
-{
-    try {
-        $ossClient->deleteBucketCors($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-

+ 0 - 109
vendor/aliyuncs/oss-sdk-php/samples/BucketLifecycle.php

@@ -1,109 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-use OSS\Model\LifecycleAction;
-use OSS\Model\LifecycleConfig;
-use OSS\Model\LifecycleRule;
-
-$bucket = Common::getBucketName();
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-
-//******************************* 简单使用 *******************************************************
-
-//设置lifecycle规则
-$lifecycleConfig = new LifecycleConfig();
-$actions = array();
-$actions[] = new LifecycleAction("Expiration", "Days", 3);
-$lifecycleRule = new LifecycleRule("delete obsoleted files", "obsoleted/", "Enabled", $actions);
-$lifecycleConfig->addRule($lifecycleRule);
-$ossClient->putBucketLifecycle($bucket, $lifecycleConfig);
-Common::println("bucket $bucket lifecycleConfig created:" . $lifecycleConfig->serializeToXml());
-
-//获取lifecycle规则
-$lifecycleConfig = $ossClient->getBucketLifecycle($bucket);
-Common::println("bucket $bucket lifecycleConfig fetched:" . $lifecycleConfig->serializeToXml());
-
-//删除bucket的lifecycle配置
-$ossClient->deleteBucketLifecycle($bucket);
-Common::println("bucket $bucket lifecycleConfig deleted");
-
-
-//***************************** 完整用法参考下面函数  ***********************************************
-
-putBucketLifecycle($ossClient, $bucket);
-getBucketLifecycle($ossClient, $bucket);
-deleteBucketLifecycle($ossClient, $bucket);
-getBucketLifecycle($ossClient, $bucket);
-
-/**
- * 设置bucket的生命周期配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function putBucketLifecycle($ossClient, $bucket)
-{
-    $lifecycleConfig = new LifecycleConfig();
-    $actions = array();
-    $actions[] = new LifecycleAction(OssClient::OSS_LIFECYCLE_EXPIRATION, OssClient::OSS_LIFECYCLE_TIMING_DAYS, 3);
-    $lifecycleRule = new LifecycleRule("delete obsoleted files", "obsoleted/", "Enabled", $actions);
-    $lifecycleConfig->addRule($lifecycleRule);
-    $actions = array();
-    $actions[] = new LifecycleAction(OssClient::OSS_LIFECYCLE_EXPIRATION, OssClient::OSS_LIFECYCLE_TIMING_DATE, '2022-10-12T00:00:00.000Z');
-    $lifecycleRule = new LifecycleRule("delete temporary files", "temporary/", "Enabled", $actions);
-    $lifecycleConfig->addRule($lifecycleRule);
-    try {
-        $ossClient->putBucketLifecycle($bucket, $lifecycleConfig);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 获取bucket的生命周期配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getBucketLifecycle($ossClient, $bucket)
-{
-    $lifecycleConfig = null;
-    try {
-        $lifecycleConfig = $ossClient->getBucketLifecycle($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    print($lifecycleConfig->serializeToXml() . "\n");
-}
-
-/**
- * 删除bucket的生命周期配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function deleteBucketLifecycle($ossClient, $bucket)
-{
-    try {
-        $ossClient->deleteBucketLifecycle($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-

+ 0 - 95
vendor/aliyuncs/oss-sdk-php/samples/BucketLogging.php

@@ -1,95 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-
-$bucket = Common::getBucketName();
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-
-//*******************************简单使用***************************************************************
-
-// 设置Bucket访问日志记录规则, 访问日志文件的存放位置是同bucket下的access.log前缀的文件
-$ossClient->putBucketLogging($bucket, $bucket, "access.log", array());
-Common::println("bucket $bucket lifecycleConfig created");
-
-// 获取Bucket访问日志记录规则
-$loggingConfig = $ossClient->getBucketLogging($bucket, array());
-Common::println("bucket $bucket lifecycleConfig fetched:" . $loggingConfig->serializeToXml());
-
-// 删除Bucket访问日志记录规则
-$loggingConfig = $ossClient->getBucketLogging($bucket, array());
-Common::println("bucket $bucket lifecycleConfig deleted");
-
-//******************************* 完整用法参考下面函数 ****************************************************
-
-putBucketLogging($ossClient, $bucket);
-getBucketLogging($ossClient, $bucket);
-deleteBucketLogging($ossClient, $bucket);
-getBucketLogging($ossClient, $bucket);
-
-/**
- * 设置bucket的Logging配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function putBucketLogging($ossClient, $bucket)
-{
-    $option = array();
-    //访问日志存放在本bucket下
-    $targetBucket = $bucket;
-    $targetPrefix = "access.log";
-
-    try {
-        $ossClient->putBucketLogging($bucket, $targetBucket, $targetPrefix, $option);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 获取bucket的Logging配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getBucketLogging($ossClient, $bucket)
-{
-    $loggingConfig = null;
-    $options = array();
-    try {
-        $loggingConfig = $ossClient->getBucketLogging($bucket, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    print($loggingConfig->serializeToXml() . "\n");
-}
-
-/**
- * 删除bucket的Logging配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function deleteBucketLogging($ossClient, $bucket)
-{
-    try {
-        $ossClient->deleteBucketLogging($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}

+ 0 - 101
vendor/aliyuncs/oss-sdk-php/samples/BucketReferer.php

@@ -1,101 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-use \OSS\Model\RefererConfig;
-
-$bucket = Common::getBucketName();
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-
-//******************************* 简单使用 ****************************************************************
-
-//设置referer白名单
-$refererConfig = new RefererConfig();
-$refererConfig->setAllowEmptyReferer(true);
-$refererConfig->addReferer("www.aliiyun.com");
-$refererConfig->addReferer("www.aliiyuncs.com");
-$ossClient->putBucketReferer($bucket, $refererConfig);
-Common::println("bucket $bucket refererConfig created:" . $refererConfig->serializeToXml());
-//获取Referer白名单
-$refererConfig = $ossClient->getBucketReferer($bucket);
-Common::println("bucket $bucket refererConfig fetched:" . $refererConfig->serializeToXml());
-
-//删除referer白名单
-$refererConfig = new RefererConfig();
-$ossClient->putBucketReferer($bucket, $refererConfig);
-Common::println("bucket $bucket refererConfig deleted");
-
-
-//******************************* 完整用法参考下面函数 ****************************************************
-
-putBucketReferer($ossClient, $bucket);
-getBucketReferer($ossClient, $bucket);
-deleteBucketReferer($ossClient, $bucket);
-getBucketReferer($ossClient, $bucket);
-
-/**
- * 设置bucket的防盗链配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function putBucketReferer($ossClient, $bucket)
-{
-    $refererConfig = new RefererConfig();
-    $refererConfig->setAllowEmptyReferer(true);
-    $refererConfig->addReferer("www.aliiyun.com");
-    $refererConfig->addReferer("www.aliiyuncs.com");
-    try {
-        $ossClient->putBucketReferer($bucket, $refererConfig);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 获取bucket的防盗链配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getBucketReferer($ossClient, $bucket)
-{
-    $refererConfig = null;
-    try {
-        $refererConfig = $ossClient->getBucketReferer($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    print($refererConfig->serializeToXml() . "\n");
-}
-
-/**
- * 删除bucket的防盗链配置
- * Referer白名单不能直接清空,只能通过重新设置来覆盖之前的规则。
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function deleteBucketReferer($ossClient, $bucket)
-{
-    $refererConfig = new RefererConfig();
-    try {
-        $ossClient->putBucketReferer($bucket, $refererConfig);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}

+ 0 - 92
vendor/aliyuncs/oss-sdk-php/samples/BucketWebsite.php

@@ -1,92 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-use OSS\Model\WebsiteConfig;
-
-$bucket = Common::getBucketName();
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-
-//*******************************简单使用***************************************************************
-
-// 设置Bucket的静态网站托管模式
-$websiteConfig = new WebsiteConfig("index.html", "error.html");
-$ossClient->putBucketWebsite($bucket, $websiteConfig);
-Common::println("bucket $bucket websiteConfig created:" . $websiteConfig->serializeToXml());
-
-// 查看Bucket的静态网站托管状态
-$websiteConfig = $ossClient->getBucketWebsite($bucket);
-Common::println("bucket $bucket websiteConfig fetched:" . $websiteConfig->serializeToXml());
-
-// 删除Bucket的静态网站托管模式
-$ossClient->deleteBucketWebsite($bucket);
-Common::println("bucket $bucket websiteConfig deleted");
-
-//******************************* 完整用法参考下面函数 ****************************************************
-
-putBucketWebsite($ossClient, $bucket);
-getBucketWebsite($ossClient, $bucket);
-deleteBucketWebsite($ossClient, $bucket);
-getBucketWebsite($ossClient, $bucket);
-
-/**
- * 设置bucket的静态网站托管模式配置
- *
- * @param $ossClient OssClient
- * @param  $bucket string 存储空间名称
- * @return null
- */
-function putBucketWebsite($ossClient, $bucket)
-{
-    $websiteConfig = new WebsiteConfig("index.html", "error.html");
-    try {
-        $ossClient->putBucketWebsite($bucket, $websiteConfig);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 获取bucket的静态网站托管状态
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getBucketWebsite($ossClient, $bucket)
-{
-    $websiteConfig = null;
-    try {
-        $websiteConfig = $ossClient->getBucketWebsite($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    print($websiteConfig->serializeToXml() . "\n");
-}
-
-/**
- * 删除bucket的静态网站托管模式配置
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function deleteBucketWebsite($ossClient, $bucket)
-{
-    try {
-        $ossClient->deleteBucketWebsite($bucket);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}

+ 0 - 84
vendor/aliyuncs/oss-sdk-php/samples/Common.php

@@ -1,84 +0,0 @@
-<?php
-
-if (is_file(__DIR__ . '/../autoload.php')) {
-    require_once __DIR__ . '/../autoload.php';
-}
-if (is_file(__DIR__ . '/../vendor/autoload.php')) {
-    require_once __DIR__ . '/../vendor/autoload.php';
-}
-require_once __DIR__ . '/Config.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-
-/**
- * Class Common
- *
- * 示例程序【Samples/*.php】 的Common类,用于获取OssClient实例和其他公用方法
- */
-class Common
-{
-    const endpoint = Config::OSS_ENDPOINT;
-    const accessKeyId = Config::OSS_ACCESS_ID;
-    const accessKeySecret = Config::OSS_ACCESS_KEY;
-    const bucket = Config::OSS_TEST_BUCKET;
-
-    /**
-     * 根据Config配置,得到一个OssClient实例
-     *
-     * @return OssClient 一个OssClient实例
-     */
-    public static function getOssClient()
-    {
-        try {
-            $ossClient = new OssClient(self::accessKeyId, self::accessKeySecret, self::endpoint, false);
-        } catch (OssException $e) {
-            printf(__FUNCTION__ . "creating OssClient instance: FAILED\n");
-            printf($e->getMessage() . "\n");
-            return null;
-        }
-        return $ossClient;
-    }
-
-    public static function getBucketName()
-    {
-        return self::bucket;
-    }
-
-    /**
-     * 工具方法,创建一个存储空间,如果发生异常直接exit
-     */
-    public static function createBucket()
-    {
-        $ossClient = self::getOssClient();
-        if (is_null($ossClient)) exit(1);
-        $bucket = self::getBucketName();
-        $acl = OssClient::OSS_ACL_TYPE_PUBLIC_READ;
-        try {
-            $ossClient->createBucket($bucket, $acl);
-        } catch (OssException $e) {
-
-            $message = $e->getMessage();
-            if (\OSS\Core\OssUtil::startsWith($message, 'http status: 403')) {
-                echo "Please Check your AccessKeyId and AccessKeySecret" . "\n";
-                exit(0);
-            } elseif (strpos($message, "BucketAlreadyExists") !== false) {
-                echo "Bucket already exists. Please check whether the bucket belongs to you, or it was visited with correct endpoint. " . "\n";
-                exit(0);
-            }
-            printf(__FUNCTION__ . ": FAILED\n");
-            printf($e->getMessage() . "\n");
-            return;
-        }
-        print(__FUNCTION__ . ": OK" . "\n");
-    }
-
-    public static function println($message)
-    {
-        if (!empty($message)) {
-            echo strval($message) . "\n";
-        }
-    }
-}
-
-Common::createBucket();

+ 0 - 15
vendor/aliyuncs/oss-sdk-php/samples/Config.php

@@ -1,15 +0,0 @@
-<?php
-
-/**
- * Class Config
- *
- * 执行Sample示例所需要的配置,用户在这里配置好Endpoint,AccessId, AccessKey和Sample示例操作的
- * bucket后,便可以直接运行RunAll.php, 运行所有的samples
- */
-final class Config
-{
-    const OSS_ACCESS_ID = '';
-    const OSS_ACCESS_KEY = '';
-    const OSS_ENDPOINT = '';
-    const OSS_TEST_BUCKET = '';
-}

+ 0 - 182
vendor/aliyuncs/oss-sdk-php/samples/MultipartUpload.php

@@ -1,182 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssUtil;
-use OSS\Core\OssException;
-
-$bucket = Common::getBucketName();
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-
-//*******************************简单使用***************************************************************
-
-/**
- * 查看完整用法中的 "putObjectByRawApis"函数,查看使用基础的分片上传api进行文件上传,用户可以基于这个自行实现断点续传等功能
- */
-
-// 使用分片上传接口上传文件, 接口会根据文件大小决定是使用普通上传还是分片上传
-$ossClient->multiuploadFile($bucket, "file.php", __FILE__, array());
-Common::println("local file " . __FILE__ . " is uploaded to the bucket $bucket, file.php");
-
-
-// 上传本地目录到bucket内的targetdir子目录中
-$ossClient->uploadDir($bucket, "targetdir", __DIR__);
-Common::println("local dir " . __DIR__ . " is uploaded to the bucket $bucket, targetdir/");
-
-
-// 列出当前未完成的分片上传
-$listMultipartUploadInfo = $ossClient->listMultipartUploads($bucket, array());
-
-
-//******************************* 完整用法参考下面函数 ****************************************************
-
-multiuploadFile($ossClient, $bucket);
-putObjectByRawApis($ossClient, $bucket);
-uploadDir($ossClient, $bucket);
-listMultipartUploads($ossClient, $bucket);
-
-/**
- * 通过multipart上传文件
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function multiuploadFile($ossClient, $bucket)
-{
-    $object = "test/multipart-test.txt";
-    $file = __FILE__;
-    $options = array();
-
-    try {
-        $ossClient->multiuploadFile($bucket, $object, $file, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ":  OK" . "\n");
-}
-
-/**
- * 使用基本的api分阶段进行分片上传
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @throws OssException
- */
-function putObjectByRawApis($ossClient, $bucket)
-{
-    $object = "test/multipart-test.txt";
-    /**
-     *  step 1. 初始化一个分块上传事件, 也就是初始化上传Multipart, 获取upload id
-     */
-    try {
-        $uploadId = $ossClient->initiateMultipartUpload($bucket, $object);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": initiateMultipartUpload FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": initiateMultipartUpload OK" . "\n");
-    /*
-     * step 2. 上传分片
-     */
-    $partSize = 10 * 1024 * 1024;
-    $uploadFile = __FILE__;
-    $uploadFileSize = filesize($uploadFile);
-    $pieces = $ossClient->generateMultiuploadParts($uploadFileSize, $partSize);
-    $responseUploadPart = array();
-    $uploadPosition = 0;
-    $isCheckMd5 = true;
-    foreach ($pieces as $i => $piece) {
-        $fromPos = $uploadPosition + (integer)$piece[$ossClient::OSS_SEEK_TO];
-        $toPos = (integer)$piece[$ossClient::OSS_LENGTH] + $fromPos - 1;
-        $upOptions = array(
-            $ossClient::OSS_FILE_UPLOAD => $uploadFile,
-            $ossClient::OSS_PART_NUM => ($i + 1),
-            $ossClient::OSS_SEEK_TO => $fromPos,
-            $ossClient::OSS_LENGTH => $toPos - $fromPos + 1,
-            $ossClient::OSS_CHECK_MD5 => $isCheckMd5,
-        );
-        if ($isCheckMd5) {
-            $contentMd5 = OssUtil::getMd5SumForFile($uploadFile, $fromPos, $toPos);
-            $upOptions[$ossClient::OSS_CONTENT_MD5] = $contentMd5;
-        }
-        //2. 将每一分片上传到OSS
-        try {
-            $responseUploadPart[] = $ossClient->uploadPart($bucket, $object, $uploadId, $upOptions);
-        } catch (OssException $e) {
-            printf(__FUNCTION__ . ": initiateMultipartUpload, uploadPart - part#{$i} FAILED\n");
-            printf($e->getMessage() . "\n");
-            return;
-        }
-        printf(__FUNCTION__ . ": initiateMultipartUpload, uploadPart - part#{$i} OK\n");
-    }
-    $uploadParts = array();
-    foreach ($responseUploadPart as $i => $eTag) {
-        $uploadParts[] = array(
-            'PartNumber' => ($i + 1),
-            'ETag' => $eTag,
-        );
-    }
-    /**
-     * step 3. 完成上传
-     */
-    try {
-        $ossClient->completeMultipartUpload($bucket, $object, $uploadId, $uploadParts);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": completeMultipartUpload FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    printf(__FUNCTION__ . ": completeMultipartUpload OK\n");
-}
-
-/**
- * 按照目录上传文件
- *
- * @param OssClient $ossClient OssClient
- * @param string $bucket 存储空间名称
- *
- */
-function uploadDir($ossClient, $bucket)
-{
-    $localDirectory = ".";
-    $prefix = "samples/codes";
-    try {
-        $ossClient->uploadDir($bucket, $prefix, $localDirectory);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    printf(__FUNCTION__ . ": completeMultipartUpload OK\n");
-}
-
-/**
- * 获取当前未完成的分片上传列表
- *
- * @param $ossClient OssClient
- * @param $bucket   string
- */
-function listMultipartUploads($ossClient, $bucket)
-{
-    $options = array(
-        'max-uploads' => 100,
-        'key-marker' => '',
-        'prefix' => '',
-        'upload-id-marker' => ''
-    );
-    try {
-        $listMultipartUploadInfo = $ossClient->listMultipartUploads($bucket, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": listMultipartUploads FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    printf(__FUNCTION__ . ": listMultipartUploads OK\n");
-    $listUploadInfo = $listMultipartUploadInfo->getUploads();
-    var_dump($listUploadInfo);
-}

+ 0 - 437
vendor/aliyuncs/oss-sdk-php/samples/Object.php

@@ -1,437 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-
-$bucket = Common::getBucketName();
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-//*******************************简单使用***************************************************************
-
-// 简单上传变量的内容到文件
-$ossClient->putObject($bucket, "b.file", "hi, oss");
-Common::println("b.file is created");
-
-// 上传本地文件
-$ossClient->uploadFile($bucket, "c.file", __FILE__);
-Common::println("c.file is created");
-
-// 下载object到本地变量
-$content = $ossClient->getObject($bucket, "b.file");
-Common::println("b.file is fetched, the content is: " . $content);
-
-
-// 下载object到本地文件
-$options = array(
-    OssClient::OSS_FILE_DOWNLOAD => "./c.file.localcopy",
-);
-$ossClient->getObject($bucket, "c.file", $options);
-Common::println("b.file is fetched to the local file: c.file.localcopy");
-
-// 拷贝object
-$ossClient->copyObject($bucket, "c.file", $bucket, "c.file.copy");
-Common::println("c.file is copied to c.file.copy");
-
-// 判断object是否存在
-$doesExist = $ossClient->doesObjectExist($bucket, "c.file.copy");
-Common::println("file c.file.copy exist? " . ($doesExist ? "yes" : "no"));
-
-// 删除object
-$ossClient->deleteObject($bucket, "c.file.copy");
-Common::println("c.file.copy is deleted");
-
-// 判断object是否存在
-$doesExist = $ossClient->doesObjectExist($bucket, "c.file.copy");
-Common::println("file c.file.copy exist? " . ($doesExist ? "yes" : "no"));
-
-// 批量删除object
-$ossClient->deleteObjects($bucket, array("b.file", "c.file"));
-Common::println("b.file, c.file are deleted");
-
-sleep(2);
-unlink("c.file.localcopy");
-
-//******************************* 完整用法参考下面函数 ****************************************************
-
-listObjects($ossClient, $bucket);
-listAllObjects($ossClient, $bucket);
-createObjectDir($ossClient, $bucket);
-putObject($ossClient, $bucket);
-uploadFile($ossClient, $bucket);
-getObject($ossClient, $bucket);
-getObjectToLocalFile($ossClient, $bucket);
-copyObject($ossClient, $bucket);
-modifyMetaForObject($ossClient, $bucket);
-getObjectMeta($ossClient, $bucket);
-deleteObject($ossClient, $bucket);
-deleteObjects($ossClient, $bucket);
-doesObjectExist($ossClient, $bucket);
-
-/**
- * 创建虚拟目录
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function createObjectDir($ossClient, $bucket)
-{
-    try {
-        $ossClient->createObjectDir($bucket, "dir");
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 把本地变量的内容到文件
- *
- * 简单上传,上传指定变量的内存值作为object的内容
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function putObject($ossClient, $bucket)
-{
-    $object = "oss-php-sdk-test/upload-test-object-name.txt";
-    $content = file_get_contents(__FILE__);
-    $options = array();
-    try {
-        $ossClient->putObject($bucket, $object, $content, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-
-/**
- * 上传指定的本地文件内容
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function uploadFile($ossClient, $bucket)
-{
-    $object = "oss-php-sdk-test/upload-test-object-name.txt";
-    $filePath = __FILE__;
-    $options = array();
-
-    try {
-        $ossClient->uploadFile($bucket, $object, $filePath, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 列出Bucket内所有目录和文件, 注意如果符合条件的文件数目超过设置的max-keys, 用户需要使用返回的nextMarker作为入参,通过
- * 循环调用ListObjects得到所有的文件,具体操作见下面的 listAllObjects 示例
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function listObjects($ossClient, $bucket)
-{
-    $prefix = 'oss-php-sdk-test/';
-    $delimiter = '/';
-    $nextMarker = '';
-    $maxkeys = 1000;
-    $options = array(
-        'delimiter' => $delimiter,
-        'prefix' => $prefix,
-        'max-keys' => $maxkeys,
-        'marker' => $nextMarker,
-    );
-    try {
-        $listObjectInfo = $ossClient->listObjects($bucket, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    $objectList = $listObjectInfo->getObjectList(); // 文件列表
-    $prefixList = $listObjectInfo->getPrefixList(); // 目录列表
-    if (!empty($objectList)) {
-        print("objectList:\n");
-        foreach ($objectList as $objectInfo) {
-            print($objectInfo->getKey() . "\n");
-        }
-    }
-    if (!empty($prefixList)) {
-        print("prefixList: \n");
-        foreach ($prefixList as $prefixInfo) {
-            print($prefixInfo->getPrefix() . "\n");
-        }
-    }
-}
-
-/**
- * 列出Bucket内所有目录和文件, 根据返回的nextMarker循环得到所有Objects
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function listAllObjects($ossClient, $bucket)
-{
-    //构造dir下的文件和虚拟目录
-    for ($i = 0; $i < 100; $i += 1) {
-        $ossClient->putObject($bucket, "dir/obj" . strval($i), "hi");
-        $ossClient->createObjectDir($bucket, "dir/obj" . strval($i));
-    }
-
-    $prefix = 'dir/';
-    $delimiter = '/';
-    $nextMarker = '';
-    $maxkeys = 30;
-
-    while (true) {
-        $options = array(
-            'delimiter' => $delimiter,
-            'prefix' => $prefix,
-            'max-keys' => $maxkeys,
-            'marker' => $nextMarker,
-        );
-        var_dump($options);
-        try {
-            $listObjectInfo = $ossClient->listObjects($bucket, $options);
-        } catch (OssException $e) {
-            printf(__FUNCTION__ . ": FAILED\n");
-            printf($e->getMessage() . "\n");
-            return;
-        }
-        // 得到nextMarker,从上一次listObjects读到的最后一个文件的下一个文件开始继续获取文件列表
-        $nextMarker = $listObjectInfo->getNextMarker();
-        $listObject = $listObjectInfo->getObjectList();
-        $listPrefix = $listObjectInfo->getPrefixList();
-        var_dump(count($listObject));
-        var_dump(count($listPrefix));
-        if ($nextMarker === '') {
-            break;
-        }
-    }
-}
-
-/**
- * 获取object的内容
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getObject($ossClient, $bucket)
-{
-    $object = "oss-php-sdk-test/upload-test-object-name.txt";
-    $options = array();
-    try {
-        $content = $ossClient->getObject($bucket, $object, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    if (file_get_contents(__FILE__) === $content) {
-        print(__FUNCTION__ . ": FileContent checked OK" . "\n");
-    } else {
-        print(__FUNCTION__ . ": FileContent checked FAILED" . "\n");
-    }
-}
-
-/**
- * get_object_to_local_file
- *
- * 获取object
- * 将object下载到指定的文件
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getObjectToLocalFile($ossClient, $bucket)
-{
-    $object = "oss-php-sdk-test/upload-test-object-name.txt";
-    $localfile = "upload-test-object-name.txt";
-    $options = array(
-        OssClient::OSS_FILE_DOWNLOAD => $localfile,
-    );
-
-    try {
-        $ossClient->getObject($bucket, $object, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK, please check localfile: 'upload-test-object-name.txt'" . "\n");
-    if (file_get_contents($localfile) === file_get_contents(__FILE__)) {
-        print(__FUNCTION__ . ": FileContent checked OK" . "\n");
-    } else {
-        print(__FUNCTION__ . ": FileContent checked FAILED" . "\n");
-    }
-    if (file_exists($localfile)) {
-        unlink($localfile);
-    }
-}
-
-/**
- * 拷贝object
- * 当目的object和源object完全相同时,表示修改object的meta信息
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function copyObject($ossClient, $bucket)
-{
-    $fromBucket = $bucket;
-    $fromObject = "oss-php-sdk-test/upload-test-object-name.txt";
-    $toBucket = $bucket;
-    $toObject = $fromObject . '.copy';
-    $options = array();
-
-    try {
-        $ossClient->copyObject($fromBucket, $fromObject, $toBucket, $toObject, $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 修改Object Meta
- * 利用copyObject接口的特性:当目的object和源object完全相同时,表示修改object的meta信息
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function modifyMetaForObject($ossClient, $bucket)
-{
-    $fromBucket = $bucket;
-    $fromObject = "oss-php-sdk-test/upload-test-object-name.txt";
-    $toBucket = $bucket;
-    $toObject = $fromObject;
-    $copyOptions = array(
-        OssClient::OSS_HEADERS => array(
-            'Cache-Control' => 'max-age=60',
-            'Content-Disposition' => 'attachment; filename="xxxxxx"',
-        ),
-    );
-    try {
-        $ossClient->copyObject($fromBucket, $fromObject, $toBucket, $toObject, $copyOptions);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 获取object meta, 也就是getObjectMeta接口
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function getObjectMeta($ossClient, $bucket)
-{
-    $object = "oss-php-sdk-test/upload-test-object-name.txt";
-    try {
-        $objectMeta = $ossClient->getObjectMeta($bucket, $object);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    if (isset($objectMeta[strtolower('Content-Disposition')]) &&
-        'attachment; filename="xxxxxx"' === $objectMeta[strtolower('Content-Disposition')]
-    ) {
-        print(__FUNCTION__ . ": ObjectMeta checked OK" . "\n");
-    } else {
-        print(__FUNCTION__ . ": ObjectMeta checked FAILED" . "\n");
-    }
-}
-
-/**
- * 删除object
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function deleteObject($ossClient, $bucket)
-{
-    $object = "oss-php-sdk-test/upload-test-object-name.txt";
-    try {
-        $ossClient->deleteObject($bucket, $object);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-
-/**
- * 批量删除object
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function deleteObjects($ossClient, $bucket)
-{
-    $objects = array();
-    $objects[] = "oss-php-sdk-test/upload-test-object-name.txt";
-    $objects[] = "oss-php-sdk-test/upload-test-object-name.txt.copy";
-    try {
-        $ossClient->deleteObjects($bucket, $objects);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-}
-
-/**
- * 判断object是否存在
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- */
-function doesObjectExist($ossClient, $bucket)
-{
-    $object = "oss-php-sdk-test/upload-test-object-name.txt";
-    try {
-        $exist = $ossClient->doesObjectExist($bucket, $object);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": OK" . "\n");
-    var_dump($exist);
-}
-

+ 0 - 13
vendor/aliyuncs/oss-sdk-php/samples/RunAll.php

@@ -1,13 +0,0 @@
-<?php
-
-error_reporting(E_ALL | E_NOTICE);
-
-require_once __DIR__ . '/Bucket.php';
-require_once __DIR__ . '/BucketCors.php';
-require_once __DIR__ . '/BucketLifecycle.php';
-require_once __DIR__ . '/BucketReferer.php';
-require_once __DIR__ . '/BucketLogging.php';
-require_once __DIR__ . '/BucketWebsite.php';
-require_once __DIR__ . '/Signature.php';
-require_once __DIR__ . '/Object.php';
-require_once __DIR__ . '/MultipartUpload.php';

+ 0 - 143
vendor/aliyuncs/oss-sdk-php/samples/Signature.php

@@ -1,143 +0,0 @@
-<?php
-require_once __DIR__ . '/Common.php';
-
-use OSS\Http\RequestCore;
-use OSS\Http\ResponseCore;
-use OSS\OssClient;
-use OSS\Core\OssException;
-
-$bucket = Common::getBucketName();
-$ossClient = Common::getOssClient();
-if (is_null($ossClient)) exit(1);
-
-//******************************* 简单使用 ***************************************************************
-
-$ossClient->uploadFile($bucket, "a.file", __FILE__);
-
-// 生成GetObject的签名url,用户可以使用这个url直接在浏览器下载
-$signedUrl = $ossClient->signUrl($bucket, "a.file", 3600);
-Common::println($signedUrl);
-
-// 生成用于putObject的签名URL,用户可以直接用put方法使用这个url上传文件到 "a.file"
-$signedUrl = $ossClient->signUrl($bucket, "a.file", "3600", "PUT");
-Common::println($signedUrl);
-
-// 生成从本地文件上传PutObject的签名url, 用户可以直接使用这个url把本地文件上传到 "a.file"
-$signedUrl = $ossClient->signUrl($bucket, "a.file", 3600, "PUT", array('Content-Type' => 'txt'));
-Common::println($signedUrl);
-
-//******************************* 完整用法参考下面函数 ****************************************************
-
-getSignedUrlForPuttingObject($ossClient, $bucket);
-getSignedUrlForPuttingObjectFromFile($ossClient, $bucket);
-getSignedUrlForGettingObject($ossClient, $bucket);
-
-/**
- * 生成GetObject的签名url,主要用于私有权限下的读访问控制
- *
- * @param $ossClient OssClient OssClient实例
- * @param $bucket string 存储空间名称
- * @return null
- */
-function getSignedUrlForGettingObject($ossClient, $bucket)
-{
-    $object = "test/test-signature-test-upload-and-download.txt";
-    $timeout = 3600;
-    try {
-        $signedUrl = $ossClient->signUrl($bucket, $object, $timeout);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": signedUrl: " . $signedUrl . "\n");
-    /**
-     * 可以类似的代码来访问签名的URL,也可以输入到浏览器中去访问
-     */
-    $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());
-    if ($res->isOK()) {
-        print(__FUNCTION__ . ": OK" . "\n");
-    } else {
-        print(__FUNCTION__ . ": FAILED" . "\n");
-    };
-}
-
-/**
- * 生成PutObject的签名url,主要用于私有权限下的写访问控制
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @return null
- * @throws OssException
- */
-function getSignedUrlForPuttingObject($ossClient, $bucket)
-{
-    $object = "test/test-signature-test-upload-and-download.txt";
-    $timeout = 3600;
-    $options = NULL;
-    try {
-        $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT");
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": signedUrl: " . $signedUrl . "\n");
-    $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());
-    if ($res->isOK()) {
-        print(__FUNCTION__ . ": OK" . "\n");
-    } else {
-        print(__FUNCTION__ . ": FAILED" . "\n");
-    };
-}
-
-/**
- * 生成PutObject的签名url,主要用于私有权限下的写访问控制, 用户可以利用生成的signedUrl
- * 从文件上传文件
- *
- * @param OssClient $ossClient OssClient实例
- * @param string $bucket 存储空间名称
- * @throws OssException
- */
-function getSignedUrlForPuttingObjectFromFile($ossClient, $bucket)
-{
-    $file = __FILE__;
-    $object = "test/test-signature-test-upload-and-download.txt";
-    $timeout = 3600;
-    $options = array('Content-Type' => 'txt');
-    try {
-        $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, "PUT", $options);
-    } catch (OssException $e) {
-        printf(__FUNCTION__ . ": FAILED\n");
-        printf($e->getMessage() . "\n");
-        return;
-    }
-    print(__FUNCTION__ . ": signedUrl: " . $signedUrl . "\n");
-
-    $request = new RequestCore($signedUrl);
-    $request->set_method('PUT');
-    $request->add_header('Content-Type', 'txt');
-    $request->set_read_file($file);
-    $request->set_read_stream_size(filesize($file));
-    $request->send_request();
-    $res = new ResponseCore($request->get_response_header(),
-        $request->get_response_body(), $request->get_response_code());
-    if ($res->isOK()) {
-        print(__FUNCTION__ . ": OK" . "\n");
-    } else {
-        print(__FUNCTION__ . ": FAILED" . "\n");
-    };
-}

+ 4 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Core/MimeTypes.php

@@ -5,16 +5,17 @@ namespace OSS\Core;
 /**
  * Class MimeTypes
  *
- * 在上传文件的时候,根据文件的缺省名,得到其对应的Content-type
+ * The map of a file's extention name to its corresponding Content-Type value in the file upload request.
+ * If the file extention name is not predefined in this class, getMimetype() returns null.
  *
  * @package OSS\Core
  */
 class MimeTypes
 {
     /**
-     * 根据文件名,获取http协议header中的content-type应该填写的数据
+     * Get the content-type value of http header from the file's extension name.
      *
-     * @param string $name 缺省名
+     * @param string $name Default file extension name.
      * @return string content-type
      */
     public static function getMimetype($name)

+ 2 - 2
vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssException.php

@@ -5,8 +5,8 @@ namespace OSS\Core;
 /**
  * Class OssException
  *
- * OssClient在使用的时候,所抛出的异常,用户在使用OssClient的时候,要Try住相关代码,
- * try的Exception应该是OssException,其中会得到相关异常原因
+ * This is the class that OSSClient is expected to thrown, which the caller needs to handle properly.
+ * It has the OSS specific errors which is useful for troubleshooting.
  *
  * @package OSS\Core
  */

+ 86 - 33
vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php

@@ -5,7 +5,7 @@ namespace OSS\Core;
 /**
  * Class OssUtil
  *
- * Oss工具类,主要供OssClient使用,用户也可以使用本类进行返回结果的格式化
+ * Oss Util class for OssClient. The caller could use it for formating the result from OssClient.
  *
  * @package OSS
  */
@@ -20,10 +20,10 @@ class OssUtil
     const OSS_MIN_PART_SIZE = 102400; // 100KB
 
     /**
-     * 生成query params
+     * Generate query params
      *
-     * @param array $options 关联数组
-     * @return string 返回诸如 key1=value1&key2=value2
+     * @param array $options: a key-value pair array.
+     * @return string: the key-value list in the format such as key1=value1&key2=value2
      */
     public static function toQueryString($options = array())
     {
@@ -38,7 +38,7 @@ class OssUtil
     }
 
     /**
-     * 转义字符替换
+     * Html encoding '<', '>', '&', '\', '"' in subject parameter. 
      *
      * @param string $subject
      * @return string
@@ -51,7 +51,7 @@ class OssUtil
     }
 
     /**
-     * 检查是否是中文编码
+     * Check whether the string includes any chinese character
      *
      * @param $str
      * @return int
@@ -62,10 +62,10 @@ class OssUtil
     }
 
     /**
-     * 检测是否GB2312编码
+     * Checks if the string is encoded by GB2312.
      *
      * @param string $str
-     * @return boolean false UTF-8编码  TRUE GB2312编码
+     * @return boolean false UTF-8 encoding  TRUE GB2312 encoding
      */
     public static function isGb2312($str)
     {
@@ -87,7 +87,7 @@ class OssUtil
     }
 
     /**
-     * 检测是否GBK编码
+     * Checks if the string is encoded by GBK
      *
      * @param string $str
      * @param boolean $gbk
@@ -114,13 +114,13 @@ class OssUtil
     }
 
     /**
-     * 检验bucket名称是否合法
-     * bucket的命名规范:
-     * 1. 只能包括小写字母,数字
-     * 2. 必须以小写字母或者数字开头
-     * 3. 长度必须在3-63字节之间
+     * 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名称
+     * @param string $bucket Bucket name
      * @return boolean
      */
     public static function validateBucket($bucket)
@@ -133,11 +133,11 @@ class OssUtil
     }
 
     /**
-     * 检验object名称是否合法
-     * object命名规范:
-     * 1. 规则长度必须在1-1023字节之间
-     * 2. 使用UTF-8编码
-     * 3. 不能以 "/" "\\"开头
+     * 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
@@ -155,7 +155,7 @@ class OssUtil
 
 
     /**
-     * 判断字符串$str是不是以$findMe开始
+     * Checks if $str starts with $findMe
      *
      * @param string $str
      * @param string $findMe
@@ -170,8 +170,22 @@ class OssUtil
         }
     }
 
+
     /**
-     * 检验$options
+     * Generate the xml message of createBucketXmlBody.
+     *
+     * @param string $storageClass
+     * @return string
+     */
+    public static function createBucketXmlBody($storageClass)
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration></CreateBucketConfiguration>');
+        $xml->addChild('StorageClass',  $storageClass);
+        return $xml->asXML();
+    }
+
+    /**
+     * validate $options
      *
      * @param array $options
      * @throws OssException
@@ -186,7 +200,7 @@ class OssUtil
     }
 
     /**
-     * 检查上传文件的内容是否合法
+     * check whether the Content is valid.
      *
      * @param $content string
      * @throws OssException
@@ -199,7 +213,7 @@ class OssUtil
     }
 
     /**
-     * 校验BUCKET/OBJECT/OBJECT GROUP是否为空
+     * Check if BUCKET/OBJECT/OBJECT GROUP is empty.
      *
      * @param  string $name
      * @param  string $errMsg
@@ -214,7 +228,7 @@ class OssUtil
     }
 
     /**
-     * 仅供测试使用的接口,请勿使用
+     * This is a method for test only. DO NOT USE.
      *
      * @param $filename
      * @param $size
@@ -255,7 +269,7 @@ BBB;
     }
 
     /**
-     * 得到文件的md5编码
+     * Get MD5 of the file.
      *
      * @param $filename
      * @param $from_pos
@@ -305,7 +319,7 @@ BBB;
     }
 
     /**
-     * 检测是否windows系统,因为windows系统默认编码为GBK
+     * Check if the OS is Windows. The default encoding in Windows is GBK.
      *
      * @return bool
      */
@@ -315,7 +329,9 @@ BBB;
     }
 
     /**
-     * 主要是由于windows系统编码是gbk,遇到中文时候,如果不进行转换处理会出现找不到文件的问题
+     * 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
@@ -329,9 +345,9 @@ BBB;
     }
 
     /**
-     * 判断用户输入的endpoint是否是 xxx.xxx.xxx.xxx:port 或者 xxx.xxx.xxx.xxx的ip格式
+     * Check if the endpoint is in the IPv4 format, such as xxx.xxx.xxx.xxx:port or xxx.xxx.xxx.xxx.
      *
-     * @param string $endpoint 需要做判断的endpoint
+     * @param string $endpoint The endpoint to check.
      * @return boolean
      */
     public static function isIPFormat($endpoint)
@@ -347,7 +363,44 @@ BBB;
     }
 
     /**
-     * 生成DeleteMultiObjects接口的xml消息
+     * 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);
+        }
+        
+        return $str;
+    }
+
+    /**
+     * Generate the xml message of DeleteMultiObjects.
      *
      * @param string[] $objects
      * @param bool $quiet
@@ -366,7 +419,7 @@ BBB;
     }
 
     /**
-     * 生成CompleteMultipartUpload接口的xml消息
+     * Generate the xml message of CompleteMultipartUpload.
      *
      * @param array[] $listParts
      * @return string
@@ -383,7 +436,7 @@ BBB;
     }
 
     /**
-     * 读取目录
+     * Read the directory, return a associative array in which the MD5 is the named key and the <path,filanme> is the value.
      *
      * @param string $dir
      * @param string $exclude

+ 78 - 120
vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php

@@ -3,7 +3,7 @@ namespace OSS\Http;
 
 
 /**
- * Handles all HTTP requests using cURL and manages the responses.
+ * Handle all HTTP requests using cURL and manages the responses.
  *
  * @version 2011.06.07
  * @copyright 2006-2011 Ryan Parman
@@ -23,6 +23,21 @@ class RequestCore
      * The headers being sent in the request.
      */
     public $request_headers;
+   
+    /**
+     * The raw response callback headers
+     */
+    public $response_raw_headers;
+
+    /**
+     * Response body when error occurs
+     */
+    public $response_error_body;
+
+    /**
+     *The hander of write file
+     */
+    public $write_file_handle; 
 
     /**
      * The body being sent in the request.
@@ -54,18 +69,13 @@ class RequestCore
      */
     public $response_info;
 
-    /**
-     * The handle for the cURL object.
-     */
-    public $curl_handle;
-
     /**
      * The method by which the request is being made.
      */
     public $method;
 
     /**
-     * Stores the proxy settings to use for the request.
+     * Store the proxy settings to use for the request.
      */
     public $proxy = null;
 
@@ -160,14 +170,14 @@ class RequestCore
     public $registered_streaming_write_callback = null;
 
     /**
-     * 请求超时时间, 默认是5184000秒,6天
+     * The request timeout time, which is 5,184,000 seconds,that is, 6 days by default
      *
      * @var int
      */
     public $timeout = 5184000;
 
     /**
-     * 连接超时时间,默认是10秒
+     * The connection timeout time, which is 10 seconds by default
      *
      * @var int
      */
@@ -206,7 +216,7 @@ class RequestCore
     // CONSTRUCTOR/DESTRUCTOR
 
     /**
-     * Constructs a new instance of this class.
+     * Construct a new instance of this class.
      *
      * @param string $url (Optional) The URL to request or service endpoint to query.
      * @param string $proxy (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
@@ -239,7 +249,7 @@ class RequestCore
     }
 
     /**
-     * Destructs the instance. Closes opened file handles.
+     * Destruct the instance. Closes opened file handles.
      *
      * @return $this A reference to the current instance.
      */
@@ -261,7 +271,7 @@ class RequestCore
     // REQUEST METHODS
 
     /**
-     * Sets the credentials to use for authentication.
+     * Set the credentials to use for authentication.
      *
      * @param string $user (Required) The username to authenticate with.
      * @param string $pass (Required) The password to authenticate with.
@@ -275,7 +285,7 @@ class RequestCore
     }
 
     /**
-     * Adds a custom HTTP header to the cURL request.
+     * Add a custom HTTP header to the cURL request.
      *
      * @param string $key (Required) The custom HTTP header to set.
      * @param mixed $value (Required) The value to assign to the custom HTTP header.
@@ -288,7 +298,7 @@ class RequestCore
     }
 
     /**
-     * Removes an HTTP header from the cURL request.
+     * Remove an HTTP header from the cURL request.
      *
      * @param string $key (Required) The custom HTTP header to set.
      * @return $this A reference to the current instance.
@@ -314,7 +324,7 @@ class RequestCore
     }
 
     /**
-     * Sets a custom useragent string for the class.
+     * Set a custom useragent string for the class.
      *
      * @param string $ua (Required) The useragent string to use.
      * @return $this A reference to the current instance.
@@ -363,7 +373,7 @@ class RequestCore
     }
 
     /**
-     * Sets the length in bytes to read from the stream while streaming up.
+     * Set the length in bytes to read from the stream while streaming up.
      *
      * @param integer $size (Required) The length in bytes to read from the stream.
      * @return $this A reference to the current instance.
@@ -376,7 +386,7 @@ class RequestCore
     }
 
     /**
-     * Sets the resource to read from while streaming up. Reads the stream from its current position until
+     * Set the resource to read from while streaming up. Reads the stream from its current position until
      * EOF or `$size` bytes have been read. If `$size` is not given it will be determined by <php:fstat()> and
      * <php:ftell()>.
      *
@@ -404,7 +414,7 @@ class RequestCore
     }
 
     /**
-     * Sets the file to read from while streaming up.
+     * Set the file to read from while streaming up.
      *
      * @param string $location (Required) The readable location to read from.
      * @return $this A reference to the current instance.
@@ -418,7 +428,7 @@ class RequestCore
     }
 
     /**
-     * Sets the resource to write to while streaming down.
+     * Set the resource to write to while streaming down.
      *
      * @param resource $resource (Required) The writeable resource to write to.
      * @return $this A reference to the current instance.
@@ -431,7 +441,7 @@ class RequestCore
     }
 
     /**
-     * Sets the file to write to while streaming down.
+     * Set the file to write to while streaming down.
      *
      * @param string $location (Required) The writeable location to write to.
      * @return $this A reference to the current instance.
@@ -439,9 +449,6 @@ class RequestCore
     public function set_write_file($location)
     {
         $this->write_file = $location;
-        $write_file_handle = fopen($location, 'w');
-
-        return $this->set_write_stream($write_file_handle);
     }
 
     /**
@@ -473,6 +480,28 @@ class RequestCore
         return $this;
     }
 
+    /**
+     * A callback function that is invoked by cURL for streaming up.
+     *
+     * @param resource $curl_handle (Required) The cURL handle for the request.
+     * @param resource $header_content (Required) The header callback result.
+     * @return headers from a stream.
+     */
+   public function streaming_header_callback($curl_handle, $header_content)
+   {
+        $code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
+
+        if (isset($this->write_file) && intval($code) / 100 == 2 && !isset($this->write_file_handle))
+        {
+            $this->write_file_handle = fopen($this->write_file, 'w');
+            $this->set_write_stream($this->write_file_handle);
+        }
+
+        $this->response_raw_headers .= $header_content;
+        return strlen($header_content); 
+    }
+        
+
     /**
      * Register a callback function to execute whenever a data stream is read from using
      * <CFRequest::streaming_read_callback()>.
@@ -571,10 +600,18 @@ class RequestCore
      */
     public function streaming_write_callback($curl_handle, $data)
     {
+        $code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
+        
+        if (intval($code) / 100 != 2)
+        {
+            $this->response_error_body .= $data;
+            return strlen($data);
+        }
+
         $length = strlen($data);
         $written_total = 0;
         $written_last = 0;
-
+        
         while ($written_total < $length) {
             $written_last = fwrite($this->write_stream, substr($data, $written_total));
 
@@ -594,7 +631,7 @@ class RequestCore
     }
 
     /**
-     * Prepares and adds the details of the cURL request. This can be passed along to a <php:curl_multi_exec()>
+     * Prepare and adds the details of the cURL request. This can be passed along to a <php:curl_multi_exec()>
      * function.
      *
      * @return resource The handle for the cURL object.
@@ -617,6 +654,7 @@ class RequestCore
         curl_setopt($curl_handle, CURLOPT_NOSIGNAL, true);
         curl_setopt($curl_handle, CURLOPT_REFERER, $this->request_url);
         curl_setopt($curl_handle, CURLOPT_USERAGENT, $this->useragent);
+        curl_setopt($curl_handle, CURLOPT_HEADERFUNCTION, array($this, 'streaming_header_callback'));
         curl_setopt($curl_handle, CURLOPT_READFUNCTION, array($this, 'streaming_read_callback'));
 
         // Verification of the SSL cert
@@ -647,8 +685,6 @@ class RequestCore
 
         // Enable a proxy connection if requested.
         if ($this->proxy) {
-            curl_setopt($curl_handle, CURLOPT_HTTPPROXYTUNNEL, true);
-
             $host = $this->proxy['host'];
             $host .= ($this->proxy['port']) ? ':' . $this->proxy['port'] : '';
             curl_setopt($curl_handle, CURLOPT_PROXY, $host);
@@ -715,7 +751,7 @@ class RequestCore
 
             default: // Assumed GET
                 curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, $this->method);
-                if (isset($this->write_stream)) {
+                if (isset($this->write_stream) || isset($this->write_file)) {
                     curl_setopt($curl_handle, CURLOPT_WRITEFUNCTION, array($this, 'streaming_write_callback'));
                     curl_setopt($curl_handle, CURLOPT_HEADER, false);
                 } else {
@@ -747,18 +783,23 @@ class RequestCore
     {
         // Accept a custom one if it's passed.
         if ($curl_handle && $response) {
-            $this->curl_handle = $curl_handle;
             $this->response = $response;
         }
 
         // As long as this came back as a valid resource...
-        if (is_resource($this->curl_handle)) {
+        if (is_resource($curl_handle)) {
             // Determine what's what.
-            $header_size = curl_getinfo($this->curl_handle, CURLINFO_HEADER_SIZE);
+            $header_size = curl_getinfo($curl_handle, CURLINFO_HEADER_SIZE);
             $this->response_headers = substr($this->response, 0, $header_size);
             $this->response_body = substr($this->response, $header_size);
-            $this->response_code = curl_getinfo($this->curl_handle, CURLINFO_HTTP_CODE);
-            $this->response_info = curl_getinfo($this->curl_handle);
+            $this->response_code = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
+            $this->response_info = curl_getinfo($curl_handle);
+            
+            if (intval($this->response_code) / 100 != 2 && isset($this->write_file))
+            {
+                $this->response_headers = $this->response_raw_headers;
+                $this->response_body = $this->response_error_body;
+            }
 
             // Parse out the headers
             $this->response_headers = explode("\r\n\r\n", trim($this->response_headers));
@@ -775,11 +816,10 @@ class RequestCore
 
             // Reset the headers to the appropriate property.
             $this->response_headers = $header_assoc;
-            $this->response_headers['_info'] = $this->response_info;
-            $this->response_headers['_info']['method'] = $this->method;
-
+            $this->response_headers['info'] = $this->response_info;
+            $this->response_headers['info']['method'] = $this->method;
+            
             if ($curl_handle && $response) {
-                //return new $this->response_class($this->response_headers, $this->response_body, $this->response_code, $this->curl_handle);
                 return new ResponseCore($this->response_headers, $this->response_body, $this->response_code);
             }
         }
@@ -789,7 +829,7 @@ class RequestCore
     }
 
     /**
-     * Sends the request, calling necessary utility functions to update built-in properties.
+     * Send the request, calling necessary utility functions to update built-in properties.
      *
      * @param boolean $parse (Optional) Whether to parse the response with ResponseCore or not.
      * @return string The resulting unparsed data from the request.
@@ -816,88 +856,6 @@ class RequestCore
         return $this->response;
     }
 
-    /**
-     * Sends the request using <php:curl_multi_exec()>, enabling parallel requests. Uses the "rolling" method.
-     *
-     * @param array $handles (Required) An indexed array of cURL handles to process simultaneously.
-     * @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
-     *    <li><code>callback</code> - <code>string|array</code> - Optional - The string name of a function to pass the response data to. If this is a method, pass an array where the <code>[0]</code> index is the class and the <code>[1]</code> index is the method name.</li>
-     *    <li><code>limit</code> - <code>integer</code> - Optional - The number of simultaneous requests to make. This can be useful for scaling around slow server responses. Defaults to trusting cURLs judgement as to how many to use.</li></ul>
-     * @return array Post-processed cURL responses.
-     */
-    public function send_multi_request($handles, $opt = null)
-    {
-        set_time_limit(0);
-
-        // Skip everything if there are no handles to process.
-        if (count($handles) === 0) return array();
-
-        if (!$opt) $opt = array();
-
-        // Initialize any missing options
-        $limit = isset($opt['limit']) ? $opt['limit'] : -1;
-
-        // Initialize
-        $handle_list = $handles;
-        $http = new $this->request_class();
-        $multi_handle = curl_multi_init();
-        $handles_post = array();
-        $added = count($handles);
-        $last_handle = null;
-        $count = 0;
-        $i = 0;
-
-        // Loop through the cURL handles and add as many as it set by the limit parameter.
-        while ($i < $added) {
-            if ($limit > 0 && $i >= $limit) break;
-            curl_multi_add_handle($multi_handle, array_shift($handles));
-            $i++;
-        }
-
-        do {
-            $active = false;
-
-            // Start executing and wait for a response.
-            while (($status = curl_multi_exec($multi_handle, $active)) === CURLM_CALL_MULTI_PERFORM) {
-                // Start looking for possible responses immediately when we have to add more handles
-                if (count($handles) > 0) break;
-            }
-
-            // Figure out which requests finished.
-            $to_process = array();
-
-            while ($done = curl_multi_info_read($multi_handle)) {
-                // Since curl_errno() isn't reliable for handles that were in multirequests, we check the 'result' of the info read, which contains the curl error number, (listed here http://curl.haxx.se/libcurl/c/libcurl-errors.html )
-                if ($done['result'] > 0) {
-                    throw new RequestCore_Exception('cURL resource: ' . (string)$done['handle'] . '; cURL error: ' . curl_error($done['handle']) . ' (' . $done['result'] . ')');
-                } // Because curl_multi_info_read() might return more than one message about a request, we check to see if this request is already in our array of completed requests
-                elseif (!isset($to_process[(int)$done['handle']])) {
-                    $to_process[(int)$done['handle']] = $done;
-                }
-            }
-
-            // Actually deal with the request
-            foreach ($to_process as $pkey => $done) {
-                $response = $http->process_response($done['handle'], curl_multi_getcontent($done['handle']));
-                $key = array_search($done['handle'], $handle_list, true);
-                $handles_post[$key] = $response;
-
-                if (count($handles) > 0) {
-                    curl_multi_add_handle($multi_handle, array_shift($handles));
-                }
-
-                curl_multi_remove_handle($multi_handle, $done['handle']);
-                curl_close($done['handle']);
-            }
-        } while ($active || count($handles_post) < $added);
-
-        curl_multi_close($multi_handle);
-
-        ksort($handles_post, SORT_NUMERIC);
-        return $handles_post;
-    }
-
-
     /*%******************************************************************************************%*/
     // RESPONSE METHODS
 

+ 5 - 5
vendor/aliyuncs/oss-sdk-php/src/OSS/Http/ResponseCore.php

@@ -8,25 +8,25 @@ namespace OSS\Http;
 class ResponseCore
 {
     /**
-     * Stores the HTTP header information.
+     * Store the HTTP header information.
      */
     public $header;
 
     /**
-     * Stores the SimpleXML response.
+     * Store the SimpleXML response.
      */
     public $body;
 
     /**
-     * Stores the HTTP response code.
+     * Store the HTTP response code.
      */
     public $status;
 
     /**
-     * Constructs a new instance of this class.
+     * Construct a new instance of this class.
      *
      * @param array $header (Required) Associative array of HTTP headers (typically returned by <RequestCore::get_response_header()>).
-     * @param string $body (Required) XML-formatted response from AWS.
+     * @param string $body (Required) XML-formatted response from OSS.
      * @param integer $status (Optional) HTTP response status code from the request.
      * @return Mixed Contains an <php:array> `header` property (HTTP headers as an associative array), a <php:SimpleXMLElement> or <php:string> `body` property, and an <php:integer> `status` code.
      */

+ 7 - 7
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketInfo.php

@@ -4,7 +4,7 @@ namespace OSS\Model;
 
 
 /**
- * Bucket信息,ListBuckets接口返回数据
+ * Bucket information class. This is the type of element in BucketListInfo's
  *
  * Class BucketInfo
  * @package OSS\Model
@@ -26,7 +26,7 @@ class BucketInfo
     }
 
     /**
-     * 得到bucket所在的region
+     * Get bucket location
      *
      * @return string
      */
@@ -36,7 +36,7 @@ class BucketInfo
     }
 
     /**
-     * 得到bucket的名称
+     * Get bucket name
      *
      * @return string
      */
@@ -46,7 +46,7 @@ class BucketInfo
     }
 
     /**
-     * 得到bucket的创建时间
+     * Get bucket creation time.
      *
      * @return string
      */
@@ -56,20 +56,20 @@ class BucketInfo
     }
 
     /**
-     * bucket所在的region
+     * bucket region
      *
      * @var string
      */
     private $location;
     /**
-     * bucket的名称
+     * bucket name
      *
      * @var string
      */
     private $name;
 
     /**
-     * bucket的创建事件
+     * bucket creation time
      *
      * @var string
      */

+ 3 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketListInfo.php

@@ -5,7 +5,7 @@ namespace OSS\Model;
 /**
  * Class BucketListInfo
  *
- * ListBuckets接口返回的数据类型
+ * It's the type of return value of ListBuckets.
  *
  * @package OSS\Model
  */
@@ -21,7 +21,7 @@ class BucketListInfo
     }
 
     /**
-     * 得到BucketInfo列表
+     * Get the BucketInfo list
      *
      * @return BucketInfo[]
      */
@@ -31,7 +31,7 @@ class BucketListInfo
     }
 
     /**
-     * BucketInfo信息列表
+     * BucketInfo list
      *
      * @var array
      */

+ 5 - 5
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php

@@ -22,7 +22,7 @@ class CorsConfig implements XmlConfig
     }
 
     /**
-     * 得到CorsRule列表
+     * Get CorsRule list
      *
      * @return CorsRule[]
      */
@@ -33,7 +33,7 @@ class CorsConfig implements XmlConfig
 
 
     /**
-     * 添加一条CorsRule
+     * Add a new CorsRule
      *
      * @param CorsRule $rule
      * @throws OssException
@@ -47,7 +47,7 @@ class CorsConfig implements XmlConfig
     }
 
     /**
-     * 从xml数据中解析出CorsConfig
+     * Parse CorsConfig from the xml.
      *
      * @param string $strXml
      * @throws OssException
@@ -78,7 +78,7 @@ class CorsConfig implements XmlConfig
     }
 
     /**
-     * 生成xml字符串
+     * Serialize the object into xml string.
      *
      * @return string
      */
@@ -105,7 +105,7 @@ class CorsConfig implements XmlConfig
     const OSS_MAX_RULES = 10;
 
     /**
-     * orsRule列表
+     * CorsRule list
      *
      * @var CorsRule[]
      */

+ 9 - 9
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsRule.php

@@ -13,7 +13,7 @@ use OSS\Core\OssException;
 class CorsRule
 {
     /**
-     * Rule中增加一条allowedOrigin
+     * Add an allowedOrigin rule
      *
      * @param string $allowedOrigin
      */
@@ -25,7 +25,7 @@ class CorsRule
     }
 
     /**
-     * Rule中增加一条allowedMethod
+     * Add an allowedMethod rule
      *
      * @param string $allowedMethod
      */
@@ -37,7 +37,7 @@ class CorsRule
     }
 
     /**
-     * Rule中增加一条allowedHeader
+     * Add an allowedHeader rule
      *
      * @param string $allowedHeader
      */
@@ -49,7 +49,7 @@ class CorsRule
     }
 
     /**
-     * Rule中增加一条exposeHeader
+     * Add an exposeHeader rule
      *
      * @param string $exposeHeader
      */
@@ -77,7 +77,7 @@ class CorsRule
     }
 
     /**
-     * 得到AllowedHeaders列表
+     * Get the AllowedHeaders list
      *
      * @return string[]
      */
@@ -87,7 +87,7 @@ class CorsRule
     }
 
     /**
-     * 得到AllowedOrigins列表
+     * Get the AllowedOrigins list
      *
      * @return string[]
      */
@@ -97,7 +97,7 @@ class CorsRule
     }
 
     /**
-     * 得到AllowedMethods列表
+     * Get the AllowedMethods list
      *
      * @return string[]
      */
@@ -107,7 +107,7 @@ class CorsRule
     }
 
     /**
-     * 得到ExposeHeaders列表
+     * Get the ExposeHeaders list
      *
      * @return string[]
      */
@@ -117,7 +117,7 @@ class CorsRule
     }
 
     /**
-     * 根据提供的xmlRule, 把this按照一定的规则插入到$xmlRule中
+     * Serialize all the rules into the xml represented by parameter $xmlRule
      *
      * @param \SimpleXMLElement $xmlRule
      * @throws OssException

+ 34 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelHistory.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class GetLiveChannelHistory
+ * @package OSS\Model
+ */
+class GetLiveChannelHistory implements XmlConfig
+{
+     public function getLiveRecordList()
+    {
+        return $this->liveRecordList;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+
+        if (isset($xml->LiveRecord)) {
+            foreach ($xml->LiveRecord as $record) {
+            $liveRecord = new LiveChannelHistory();
+            $liveRecord->parseFromXmlNode($record);
+            $this->liveRecordList[] = $liveRecord;
+           }
+        }
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $liveRecordList = array();
+}

+ 68 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelInfo.php

@@ -0,0 +1,68 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class GetLiveChannelInfo
+ * @package OSS\Model
+ */
+class GetLiveChannelInfo implements XmlConfig
+{
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getType()
+    {
+        return $this->type;
+    }
+  
+    public function getFragDuration()
+    {
+        return $this->fragDuration;
+    }
+   
+    public function getFragCount()
+    {
+        return $this->fragCount;
+    }
+   
+    public function getPlayListName()
+    {
+        return $this->playlistName;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+
+        $this->description = strval($xml->Description);
+        $this->status = strval($xml->Status);
+
+        if (isset($xml->Target)) {
+            foreach ($xml->Target as $target) {
+            $this->type = strval($target->Type);
+            $this->fragDuration = strval($target->FragDuration);
+            $this->fragCount = strval($target->FragCount);
+            $this->playlistName = strval($target->PlaylistName);
+           }
+        }
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $description;
+    private $status;
+    private $type;
+    private $fragDuration;
+    private $fragCount;
+    private $playlistName;
+}

+ 107 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelStatus.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class GetLiveChannelStatus
+ * @package OSS\Model
+ */
+class GetLiveChannelStatus implements XmlConfig
+{
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getConnectedTime()
+    {
+        return $this->connectedTime;
+    }
+
+    public function getRemoteAddr()
+    {
+        return $this->remoteAddr;
+    }
+
+    public function getVideoWidth()
+    {
+        return $this->videoWidth;
+    }
+    public function getVideoHeight()
+    {
+        return $this->videoHeight;
+    }
+    public function getVideoFrameRate()
+    {
+        return $this->videoFrameRate;
+    }
+    public function getVideoBandwidth()
+    {
+        return $this->videoBandwidth;
+    }
+    public function getVideoCodec()
+    {
+        return $this->videoCodec;
+    }
+
+    public function getAudioBandwidth()
+    {
+        return $this->audioBandwidth;
+    }
+    public function getAudioSampleRate()
+    {
+        return $this->audioSampleRate;
+    }
+    public function getAudioCodec()
+    {
+        return $this->audioCodec;
+    }
+
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->status = strval($xml->Status);
+        $this->connectedTime = strval($xml->ConnectedTime);
+        $this->remoteAddr = strval($xml->RemoteAddr);
+
+        if (isset($xml->Video)) {
+            foreach ($xml->Video as $video) {
+            $this->videoWidth = intval($video->Width);
+            $this->videoHeight = intval($video->Height);
+            $this->videoFrameRate = intval($video->FrameRate);
+            $this->videoBandwidth = intval($video->Bandwidth);
+            $this->videoCodec = strval($video->Codec);
+           }
+        }
+        
+        if (isset($xml->Video)) {
+            foreach ($xml->Audio as $audio) {
+            $this->audioBandwidth = intval($audio->Bandwidth);
+            $this->audioSampleRate = intval($audio->SampleRate);
+            $this->audioCodec = strval($audio->Codec);
+           }
+        }
+
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $status;
+    private $connectedTime;
+    private $remoteAddr;
+
+    private $videoWidth;
+    private $videoHeight;
+    private $videoFrameRate;
+    private $videoBandwidth;
+    private $videoCodec;
+
+    private $audioBandwidth;
+    private $audioSampleRate;
+    private $audioCodec;
+    
+
+}

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleAction.php

@@ -71,7 +71,7 @@ class LifecycleAction
     }
 
     /**
-     * appendToXml 把actions插入到xml中
+     * Use appendToXml to insert actions into xml.
      *
      * @param \SimpleXMLElement $xmlRule
      */

+ 5 - 5
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleConfig.php

@@ -13,7 +13,7 @@ use OSS\Core\OssException;
 class LifecycleConfig implements XmlConfig
 {
     /**
-     * 从xml数据中解析出LifecycleConfig
+     * Parse the xml into this object.
      *
      * @param string $strXml
      * @throws OssException
@@ -48,7 +48,7 @@ class LifecycleConfig implements XmlConfig
 
 
     /**
-     * 生成xml字符串
+     * Serialize the object to xml
      *
      * @return string
      */
@@ -65,7 +65,7 @@ class LifecycleConfig implements XmlConfig
 
     /**
      *
-     * 添加LifecycleRule
+     * Add a LifecycleRule
      *
      * @param LifecycleRule $lifecycleRule
      * @throws OssException
@@ -79,7 +79,7 @@ class LifecycleConfig implements XmlConfig
     }
 
     /**
-     *  将配置转换成字符串,便于用户查看
+     *  Serialize the object into xml string.
      *
      * @return string
      */
@@ -89,7 +89,7 @@ class LifecycleConfig implements XmlConfig
     }
 
     /**
-     * 得到所有的生命周期规则
+     * Get all lifecycle rules.
      *
      * @return LifecycleRule[]
      */

+ 10 - 10
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleRule.php

@@ -12,7 +12,7 @@ namespace OSS\Model;
 class LifecycleRule
 {
     /**
-     * 得到规则ID
+     * Get Id
      *
      * @return string
      */
@@ -22,7 +22,7 @@ class LifecycleRule
     }
 
     /**
-     * @param string $id 规则ID
+     * @param string $id Rule Id
      */
     public function setId($id)
     {
@@ -30,7 +30,7 @@ class LifecycleRule
     }
 
     /**
-     * 得到文件前缀
+     * Get a file prefix
      *
      * @return string
      */
@@ -40,9 +40,9 @@ class LifecycleRule
     }
 
     /**
-     * 设置文件前缀
+     * Set a file prefix
      *
-     * @param string $prefix 文件前缀
+     * @param string $prefix The file prefix
      */
     public function setPrefix($prefix)
     {
@@ -50,7 +50,7 @@ class LifecycleRule
     }
 
     /**
-     * Lifecycle规则的状态
+     * Get Lifecycle status
      *
      * @return string
      */
@@ -60,7 +60,7 @@ class LifecycleRule
     }
 
     /**
-     * 设置Lifecycle规则状态
+     * Set Lifecycle status
      *
      * @param string $status
      */
@@ -90,9 +90,9 @@ class LifecycleRule
     /**
      * LifecycleRule constructor.
      *
-     * @param string $id 规则ID
-     * @param string $prefix 文件前缀
-     * @param string $status 规则状态,可选[self::LIFECYCLE_STATUS_ENABLED, self::LIFECYCLE_STATUS_DISABLED]
+     * @param string $id rule Id
+     * @param string $prefix File prefix
+     * @param string $status Rule status, which has the following valid values: [self::LIFECYCLE_STATUS_ENABLED, self::LIFECYCLE_STATUS_DISABLED]
      * @param LifecycleAction[] $actions
      */
     public function __construct($id, $prefix, $status, $actions)

+ 121 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelConfig.php

@@ -0,0 +1,121 @@
+<?php
+
+namespace OSS\Model;
+
+
+/**
+ * Class LiveChannelConfig
+ * @package OSS\Model
+ */
+class LiveChannelConfig implements XmlConfig
+{
+    public function __construct($option = array())
+    {
+        if (isset($option['description'])) {
+            $this->description = $option['description'];
+        }
+        if (isset($option['status'])) {
+            $this->status = $option['status'];
+        }
+        if (isset($option['type'])) {
+            $this->type = $option['type'];
+        }
+        if (isset($option['fragDuration'])) {
+            $this->fragDuration = $option['fragDuration'];
+        }
+        if (isset($option['fragCount'])) {
+            $this->fragCount = $option['fragCount'];
+        }
+        if (isset($option['playListName'])) {
+            $this->playListName = $option['playListName'];
+        }
+    }
+
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    public function getFragDuration()
+    {
+        return $this->fragDuration;
+    }
+
+    public function getFragCount()
+    {
+        return $this->fragCount;
+    }
+
+    public function getPlayListName()
+    {
+        return $this->playListName;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->description = strval($xml->Description);
+        $this->status = strval($xml->Status);
+        $target = $xml->Target;
+        $this->type = strval($target->Type);
+        $this->fragDuration = intval($target->FragDuration);
+        $this->fragCount = intval($target->FragCount);
+        $this->playListName = strval($target->PlayListName);
+    }
+
+    public function serializeToXml()
+    {
+        $strXml = <<<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<LiveChannelConfiguration>
+</LiveChannelConfiguration>
+EOF;
+        $xml = new \SimpleXMLElement($strXml);
+        if (isset($this->description)) {
+            $xml->addChild('Description', $this->description);
+        }
+
+        if (isset($this->status)) {
+            $xml->addChild('Status', $this->status);
+        }
+
+        $node = $xml->addChild('Target');
+        $node->addChild('Type', $this->type);
+
+        if (isset($this->fragDuration)) {
+            $node->addChild('FragDuration', $this->fragDuration);
+        }
+
+        if (isset($this->fragCount)) {
+            $node->addChild('FragCount', $this->fragCount);
+        }
+
+        if (isset($this->playListName)) {
+            $node->addChild('PlayListName', $this->playListName);
+        }
+
+        return $xml->asXML();
+    }
+
+    public function __toString()
+    {
+        return $this->serializeToXml();
+    }
+    
+    private $description;
+    private $status = "enabled";
+    private $type;
+    private $fragDuration = 5;
+    private $fragCount = 3;
+    private $playListName = "playlist.m3u8";
+}

+ 59 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelHistory.php

@@ -0,0 +1,59 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class LiveChannelHistory
+ * @package OSS\Model
+ *
+ */
+class LiveChannelHistory implements XmlConfig
+{
+    public function __construct()
+    {
+    }
+
+    public function getStartTime()
+    {
+        return $this->startTime;
+    }
+
+    public function getEndTime()
+    {
+        return $this->endTime;
+    }
+
+    public function getRemoteAddr()
+    {
+        return $this->remoteAddr;
+    }
+
+    public function parseFromXmlNode($xml)
+    {
+        if (isset($xml->StartTime)) {
+            $this->startTime = strval($xml->StartTime);
+        }
+
+        if (isset($xml->EndTime)) {
+            $this->endTime = strval($xml->EndTime);
+        }
+
+        if (isset($xml->RemoteAddr)) {
+            $this->remoteAddr = strval($xml->RemoteAddr);
+        }
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->parseFromXmlNode($xml);
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $startTime;
+    private $endTime;
+    private $remoteAddr;
+}

+ 107 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelInfo.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace OSS\Model;
+/**
+ * Class LiveChannelInfo
+ * @package OSS\Model
+ *
+ */
+class LiveChannelInfo implements XmlConfig
+{
+    public function __construct($name = null, $description = null)
+    {
+        $this->name = $name;
+        $this->description = $description;
+        $this->publishUrls = array();
+        $this->playUrls = array();
+    }
+
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    public function getPublishUrls()
+    {
+        return $this->publishUrls;
+    }
+
+    public function getPlayUrls()
+    {
+        return $this->playUrls;
+    }
+
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    public function getLastModified()
+    {
+        return $this->lastModified;
+    }
+
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    public function setDescription($description)
+    {
+        $this->description = $description;
+    }
+
+    public function parseFromXmlNode($xml)
+    {
+        if (isset($xml->Name)) {
+            $this->name = strval($xml->Name);
+        }
+
+        if (isset($xml->Description)) {
+            $this->description = strval($xml->Description);
+        }
+
+        if (isset($xml->Status)) {
+            $this->status = strval($xml->Status);
+        }
+
+        if (isset($xml->LastModified)) {
+            $this->lastModified = strval($xml->LastModified);
+        }
+
+        if (isset($xml->PublishUrls)) {
+            foreach ($xml->PublishUrls as $url) {
+                $this->publishUrls[] = strval($url->Url);
+            }
+        }
+
+        if (isset($xml->PlayUrls)) {
+            foreach ($xml->PlayUrls as $url) {
+                $this->playUrls[] = strval($url->Url);
+            }
+        }
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+        $this->parseFromXmlNode($xml);
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $name;
+    private $description;
+    private $publishUrls;
+    private $playUrls;
+    private $status;
+    private $lastModified;
+}

+ 107 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelListInfo.php

@@ -0,0 +1,107 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class LiveChannelListInfo
+ *
+ * The data returned by ListBucketLiveChannels
+ *
+ * @package OSS\Model
+ * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
+ */
+class LiveChannelListInfo implements XmlConfig
+{
+    /**
+     * @return string
+     */
+    public function getBucketName()
+    {
+        return $this->bucket;
+    }
+
+    public function setBucketName($name)
+    {
+        $this->bucket = $name;
+    }
+
+    /**
+     * @return string
+     */
+    public function getPrefix()
+    {
+        return $this->prefix;
+    }
+
+    /**
+     * @return string
+     */
+    public function getMarker()
+    {
+        return $this->marker;
+    }
+
+    /**
+     * @return int
+     */
+    public function getMaxKeys()
+    {
+        return $this->maxKeys;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getIsTruncated()
+    {
+        return $this->isTruncated;
+    }
+
+    /**
+     * @return LiveChannelInfo[]
+     */
+    public function getChannelList()
+    {
+        return $this->channelList;
+    }
+
+    /**
+     * @return string
+     */
+    public function getNextMarker()
+    {
+        return $this->nextMarker;
+    }
+
+    public function parseFromXml($strXml)
+    {
+        $xml = simplexml_load_string($strXml);
+
+        $this->prefix = strval($xml->Prefix);
+        $this->marker = strval($xml->Marker);
+        $this->maxKeys = intval($xml->MaxKeys);
+        $this->isTruncated = (strval($xml->IsTruncated) == 'true');
+        $this->nextMarker = strval($xml->NextMarker);
+
+        if (isset($xml->LiveChannel)) {
+            foreach ($xml->LiveChannel as $chan) {
+                $channel = new LiveChannelInfo();
+                $channel->parseFromXmlNode($chan);
+                $this->channelList[] = $channel;
+            }
+        }
+    }
+
+    public function serializeToXml()
+    {
+        throw new OssException("Not implemented.");
+    }
+    
+    private $bucket = '';
+    private $prefix = '';
+    private $marker = '';
+    private $nextMarker = '';
+    private $maxKeys = 100;
+    private $isTruncated = 'false';
+    private $channelList = array();
+}

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LoggingConfig.php

@@ -42,7 +42,7 @@ class LoggingConfig implements XmlConfig
     }
 
     /**
-     *  序列化成xml字符串
+     *  Serialize to xml string
      *
      */
     public function serializeToXml()

+ 4 - 4
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php

@@ -6,11 +6,11 @@ namespace OSS\Model;
  *
  * Class ObjectInfo
  *
- * listObjects接口中返回的Object列表中的类
+ * The element type of ObjectListInfo, which is the return value type of listObjects
  *
- * listObjects接口返回数据中包含两个Array
- * 一个是拿到的Object列表【可以理解成对应文件系统中的文件列表】
- * 一个是拿到的Prefix列表【可以理解成对应文件系统中的目录列表】
+ * The return value of listObjects includes two arrays
+ * One is the returned ObjectListInfo, which is similar to a file list in a file system.
+ * The other is the returned prefix list, which is similar to a folder list in a file system.
  *
  * @package OSS\Model
  */

+ 3 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfo.php

@@ -5,7 +5,7 @@ namespace OSS\Model;
 /**
  * Class ObjectListInfo
  *
- * ListObjects接口返回数据
+ * The class of return value of ListObjects
  *
  * @package OSS\Model
  * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
@@ -87,7 +87,7 @@ class ObjectListInfo
     }
 
     /**
-     * 返回ListObjects接口返回数据中的ObjectInfo列表
+     * Get the ObjectInfo list.
      *
      * @return ObjectInfo[]
      */
@@ -97,7 +97,7 @@ class ObjectListInfo
     }
 
     /**
-     * 返回ListObjects接口返回数据中的PrefixInfo列表
+     * Get the PrefixInfo list
      *
      * @return PrefixInfo[]
      */

+ 4 - 4
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PrefixInfo.php

@@ -5,10 +5,10 @@ namespace OSS\Model;
 /**
  * Class PrefixInfo
  *
- * listObjects接口中返回的Prefix列表中的类
- * listObjects接口返回数据中包含两个Array:
- * 一个是拿到的Object列表【可以理解成对应文件系统中的文件列表
- * 一个是拿到的Prefix列表【可以理解成对应文件系统中的目录列表
+ * ListObjects return Prefix list of classes
+ * The returned data contains two arrays
+ * One is to get the list of objects【Can be understood as the corresponding file system file list
+ * One is to get Prefix list【Can be understood as the corresponding file system directory list
  *
  * @package OSS\Model
  * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RefererConfig.php

@@ -29,7 +29,7 @@ class RefererConfig implements XmlConfig
 
 
     /**
-     * 把RefererConfig序列化成xml
+     * serialize the RefererConfig object into xml string
      *
      * @return string
      */

+ 74 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/StorageCapacityConfig.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace OSS\Model;
+
+/**
+ * Class StorageCapacityConfig
+ *
+ * @package OSS\Model
+ * @link http://docs.alibaba-inc.com/pages/viewpage.action?pageId=271614763
+ */
+class StorageCapacityConfig implements XmlConfig
+{
+    /**
+     * StorageCapacityConfig constructor.
+     *
+     * @param int $storageCapacity            
+     */
+    public function __construct($storageCapacity)
+    {
+        $this->storageCapacity = $storageCapacity;
+    }
+
+    /**
+     * Not implemented
+     */
+    public function parseFromXml($strXml)
+    {
+        throw new OssException("Not implemented.");
+    }
+
+    /**
+     * Serialize StorageCapacityConfig into xml
+     *
+     * @return string
+     */
+    public function serializeToXml()
+    {
+        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketUserQos></BucketUserQos>');
+        $xml->addChild('StorageCapacity', strval($this->storageCapacity));
+        return $xml->asXML();
+    }
+
+    /**
+     * To string
+     *
+     * @return string
+     */
+    function __toString()
+    {
+        return $this->serializeToXml();
+    }
+
+    /**
+     * Set storage capacity
+     *
+     * @param int $storageCapacity            
+     */
+    public function setStorageCapacity($storageCapacity)
+    {
+        $this->storageCapacity = $storageCapacity;
+    }
+
+    /**
+     * Get storage capacity
+     * 
+     * @return int
+     */
+    public function getStorageCapacity()
+    {
+        return $this->storageCapacity;
+    }
+
+    private $storageCapacity = 0;
+}

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/UploadInfo.php

@@ -5,7 +5,7 @@ namespace OSS\Model;
 /**
  * Class UploadInfo
  *
- * ListMultipartUpload接口得到的UploadInfo
+ * The return value of ListMultipartUpload
  *
  * @package OSS\Model
  */

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WebsiteConfig.php

@@ -40,7 +40,7 @@ class WebsiteConfig implements XmlConfig
     }
 
     /**
-     * 把WebsiteConfig序列化成xml
+     * Serialize the WebsiteConfig object into xml string.
      *
      * @return string
      * @throws OssException

+ 2 - 2
vendor/aliyuncs/oss-sdk-php/src/OSS/Model/XmlConfig.php

@@ -10,7 +10,7 @@ interface XmlConfig
 {
 
     /**
-     * 接口定义,实现此接口的类都需要实现从xml数据解析的函数
+     * Interface method: Parse the object from the xml.
      *
      * @param string $strXml
      * @return null
@@ -18,7 +18,7 @@ interface XmlConfig
     public function parseFromXml($strXml);
 
     /**
-     * 接口定义,实现此接口的类,都需要实现把子类序列化成xml字符串的接口
+     * Interface method: Serialize the object into xml.
      *
      * @return string
      */

文件差异内容过多而无法显示
+ 526 - 128
vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php


+ 1 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php

@@ -3,11 +3,9 @@
 namespace OSS\Result;
 
 use OSS\Core\OssException;
-use OSS\Tests\OssExceptionTest;
 
 /**
- * Class AclResult getBucketAcl接口返回结果类,封装了
- * 返回的xml数据的解析
+ * The type of the return value of getBucketAcl, it wraps the data parsed from xml.
  *
  * @package OSS\Result
  */

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AppendResult.php

@@ -11,7 +11,7 @@ use OSS\Core\OssException;
 class AppendResult extends Result
 {
     /**
-     * 结果中part的next-append-position
+     * Get the value of next-append-position from append's response headers
      *
      * @return int
      * @throws OssException

+ 21 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CallbackResult.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace OSS\Result;
+
+
+/**
+ * Class CallbackResult
+ * @package OSS\Result
+ */
+class CallbackResult extends PutSetDeleteResult
+{
+    protected function isResponseOk()
+    {
+        $status = $this->rawResponse->status;
+        if ((int)(intval($status) / 100) == 2 && (int)(intval($status)) !== 203) {
+            return true;
+        }
+        return false;
+    }
+
+}

+ 30 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CopyObjectResult.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace OSS\Result;
+
+
+/**
+ * Class CopyObjectResult
+ * @package OSS\Result
+ */
+class CopyObjectResult extends Result
+{
+    /**
+     * @return array()
+     */
+    protected function parseDataFromResponse()
+    {
+        $body = $this->rawResponse->body;
+        $xml = simplexml_load_string($body); 
+        $result = array();
+        
+        if (isset($xml->LastModified)) {
+            $result[] = $xml->LastModified;
+        }
+        if (isset($xml->ETag)) {
+            $result[] = $xml->ETag;
+        }
+
+         return $result;
+    }
+}

+ 27 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectsResult.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace OSS\Result;
+
+
+/**
+ * Class DeleteObjectsResult
+ * @package OSS\Result
+ */
+class DeleteObjectsResult extends Result
+{
+    /**
+     * @return array()
+     */
+    protected function parseDataFromResponse()
+    {
+        $body = $this->rawResponse->body;
+        $xml = simplexml_load_string($body); 
+        $objects = array();
+
+        if (isset($xml->Deleted)) {
+            foreach($xml->Deleted as $deleteKey)
+                $objects[] = $deleteKey->Key;
+        }
+        return $objects;
+    }
+}

+ 3 - 4
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ExistResult.php

@@ -3,8 +3,7 @@
 namespace OSS\Result;
 
 /**
- * Class ExistResult 检查bucket和object是否存在的返回结果,
- * 根据返回response的http status判断
+ * Class ExistResult checks if bucket or object exists, according to the http status in response headers.
  * @package OSS\Result
  */
 class ExistResult extends Result
@@ -18,8 +17,8 @@ class ExistResult extends Result
     }
 
     /**
-     * 根据返回http状态码判断,[200-299]即认为是OK, 判断是否存在的接口,404也认为是一种
-     * 有效响应
+     * Check if the response status is OK according to the http status code.
+     * [200-299]: OK; [404]: Not found. It means the object or bucket is not found--it's a valid response too.
      *
      * @return bool
      */

+ 0 - 15
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCnameResult.php

@@ -16,19 +16,4 @@ class GetCnameResult extends Result
         $config->parseFromXml($content);
         return $config;
     }
-
-    /**
-     * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种
-     * 有效响应
-     *
-     * @return bool
-     */
-    protected function isResponseOk()
-    {
-        $status = $this->rawResponse->status;
-        if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
-            return true;
-        }
-        return false;
-    }
 }

+ 1 - 2
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCorsResult.php

@@ -18,8 +18,7 @@ class GetCorsResult extends Result
     }
 
     /**
-     * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种
-     * 有效响应
+     * Check if the response is OK, according to the http status. [200-299]:OK, the Cors config could be got; [404]: not found--no Cors config.
      *
      * @return bool
      */

+ 4 - 4
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLifecycleResult.php

@@ -12,7 +12,7 @@ use OSS\Model\LifecycleConfig;
 class GetLifecycleResult extends Result
 {
     /**
-     *  解析Lifestyle数据
+     *  Parse the LifecycleConfig object from the response
      *
      * @return LifecycleConfig
      */
@@ -25,8 +25,8 @@ class GetLifecycleResult extends Result
     }
 
     /**
-     * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种
-     * 有效响应
+     * Check if the response is OK according to the http status.
+     * [200-299]: OK, and the LifecycleConfig could be got; [404] The Life cycle config is not found.
      *
      * @return bool
      */
@@ -38,4 +38,4 @@ class GetLifecycleResult extends Result
         }
         return false;
     }
-}
+}

+ 19 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Model\GetLiveChannelHistory;
+
+class GetLiveChannelHistoryResult extends Result
+{
+    /**
+     * @return
+     */
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        $channelList = new GetLiveChannelHistory();
+        $channelList->parseFromXml($content);
+        return $channelList;
+    }
+}

+ 19 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Model\GetLiveChannelInfo;
+
+class GetLiveChannelInfoResult extends Result
+{
+    /**
+     * @return
+     */
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        $channelList = new GetLiveChannelInfo();
+        $channelList->parseFromXml($content);
+        return $channelList;
+    }
+}

+ 19 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelStatusResult.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Model\GetLiveChannelStatus;
+
+class GetLiveChannelStatusResult extends Result
+{
+    /**
+     * @return
+     */
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        $channelList = new GetLiveChannelStatus();
+        $channelList->parseFromXml($content);
+        return $channelList;
+    }
+}

+ 30 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLocationResult.php

@@ -0,0 +1,30 @@
+<?php
+namespace OSS\Result;
+
+use OSS\Core\OssException;
+
+/**
+ * Class GetLocationResult getBucketLocation interface returns the result class, encapsulated
+ * The returned xml data is parsed
+ *
+ * @package OSS\Result
+ */
+class GetLocationResult extends Result
+{
+
+    /**
+     * Parse data from response
+     * 
+     * @return string
+     * @throws OssException
+     */
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        if (empty($content)) {
+            throw new OssException("body is null");
+        }
+        $xml = simplexml_load_string($content);
+        return $xml;
+    }
+}

+ 3 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLoggingResult.php

@@ -12,7 +12,7 @@ use OSS\Model\LoggingConfig;
 class GetLoggingResult extends Result
 {
     /**
-     * 解析LoggingConfig数据
+     * Parse LoggingConfig data
      *
      * @return LoggingConfig
      */
@@ -25,8 +25,8 @@ class GetLoggingResult extends Result
     }
 
     /**
-     * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种
-     * 有效响应
+     * Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
+     * 404 is also considered a valid response
      *
      * @return bool
      */

+ 3 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetRefererResult.php

@@ -12,7 +12,7 @@ use OSS\Model\RefererConfig;
 class GetRefererResult extends Result
 {
     /**
-     * 解析RefererConfig数据
+     * Parse RefererConfig data
      *
      * @return RefererConfig
      */
@@ -25,8 +25,8 @@ class GetRefererResult extends Result
     }
 
     /**
-     * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种
-     * 有效响应
+     * Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
+     * 404 is also considered a valid response
      *
      * @return bool
      */

+ 34 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetStorageCapacityResult.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Core\OssException;
+
+/**
+ * Class AclResult  GetBucketAcl interface returns the result class, encapsulated
+ * The returned xml data is parsed
+ *
+ * @package OSS\Result
+ */
+class GetStorageCapacityResult extends Result
+{
+    /**
+     * Parse data from response
+     * 
+     * @return string
+     * @throws OssException
+     */
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        if (empty($content)) {
+            throw new OssException("body is null");
+        }
+        $xml = simplexml_load_string($content);
+        if (isset($xml->StorageCapacity)) {
+            return intval($xml->StorageCapacity);
+        } else {
+            throw new OssException("xml format exception");
+        }
+    }
+}

+ 3 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetWebsiteResult.php

@@ -11,7 +11,7 @@ use OSS\Model\WebsiteConfig;
 class GetWebsiteResult extends Result
 {
     /**
-     * 解析WebsiteConfig数据
+     * Parse WebsiteConfig data
      *
      * @return WebsiteConfig
      */
@@ -24,8 +24,8 @@ class GetWebsiteResult extends Result
     }
 
     /**
-     * 根据返回http状态码判断,[200-299]即认为是OK, 获取bucket相关配置的接口,404也认为是一种
-     * 有效响应
+     * Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
+     * 404 is also considered a valid response
      *
      * @return bool
      */

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/HeaderResult.php

@@ -11,7 +11,7 @@ namespace OSS\Result;
 class HeaderResult extends Result
 {
     /**
-     * 把返回的ResponseCore中的header作为返回数据
+     * The returned ResponseCore header is used as the return data
      *
      * @return array
      */

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateMultipartUploadResult.php

@@ -12,7 +12,7 @@ use OSS\Core\OssException;
 class InitiateMultipartUploadResult extends Result
 {
     /**
-     * 结果中获取uploadId并返回
+     * Get uploadId in result and return
      *
      * @throws OssException
      * @return string

+ 16 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListLiveChannelResult.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Model\LiveChannelListInfo;
+
+class ListLiveChannelResult extends Result
+{
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        $channelList = new LiveChannelListInfo();
+        $channelList->parseFromXml($content);
+        return $channelList;
+    }
+}

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListMultipartUploadResult.php

@@ -14,7 +14,7 @@ use OSS\Model\UploadInfo;
 class ListMultipartUploadResult extends Result
 {
     /**
-     * 解析从ListMultipartUpload接口的返回数据
+     * Parse the return data from the ListMultipartUpload interface
      *
      * @return ListMultipartUploadInfo
      */

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php

@@ -14,7 +14,7 @@ use OSS\Model\PrefixInfo;
 class ListObjectsResult extends Result
 {
     /**
-     * 解析ListObjects接口返回的xml数据
+     * Parse the xml data returned by the ListObjects interface
      *
      * return ObjectListInfo
      */

+ 1 - 1
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListPartsResult.php

@@ -13,7 +13,7 @@ use OSS\Model\PartInfo;
 class ListPartsResult extends Result
 {
     /**
-     * 解析ListParts接口返回的xml数据
+     * Parse the xml data returned by the ListParts interface
      *
      * @return ListPartsInfo
      */

+ 16 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutLiveChannelResult.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Model\LiveChannelInfo;
+
+class PutLiveChannelResult extends Result
+{
+    protected function parseDataFromResponse()
+    {
+        $content = $this->rawResponse->body;
+        $channel = new LiveChannelInfo();
+        $channel->parseFromXml($content);
+        return $channel;
+    }
+}

+ 4 - 3
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutSetDeleteResult.php

@@ -10,10 +10,11 @@ namespace OSS\Result;
 class PutSetDeleteResult extends Result
 {
     /**
-     * @return null
+     * @return array()
      */
     protected function parseDataFromResponse()
     {
-        return null;
+        $body = array('body' => $this->rawResponse->body);
+        return array_merge($this->rawResponse->header, $body);
     }
-}
+}

+ 13 - 13
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php

@@ -7,8 +7,8 @@ use OSS\Http\ResponseCore;
 
 
 /**
- * Class Result, 操作结果类的基类,不同的请求在处理返回数据的时候有不同的逻辑,
- * 具体的解析逻辑推迟到子类实现
+ * Class Result, The result class of The operation of the base class, different requests in dealing with the return of data have different logic,
+ * The specific parsing logic postponed to subclass implementation
  *
  * @package OSS\Model
  */
@@ -29,7 +29,7 @@ abstract class Result
     }
 
     /**
-     * 获取requestId
+     * Get requestId
      *
      * @return string
      */
@@ -46,7 +46,7 @@ abstract class Result
     }
 
     /**
-     * 得到返回数据,不同的请求返回数据格式不同
+     * Get the returned data, different request returns the data format is different
      *
      * $return mixed
      */
@@ -56,14 +56,14 @@ abstract class Result
     }
 
     /**
-     * 由子类实现,不同的请求返回数据有不同的解析逻辑,由子类实现
+     * Subclass implementation, different requests return data has different analytical logic, implemented by subclasses
      *
      * @return mixed
      */
     abstract protected function parseDataFromResponse();
 
     /**
-     * 操作是否成功
+     * Whether the operation is successful
      *
      * @return mixed
      */
@@ -99,7 +99,7 @@ abstract class Result
     }
 
     /**
-     * 尝试从body中获取错误Message
+     * Try to get the error message from body
      *
      * @param $body
      * @return string
@@ -117,7 +117,7 @@ abstract class Result
     }
 
     /**
-     * 尝试从body中获取错误Code
+     * Try to get the error Code from body
      *
      * @param $body
      * @return string
@@ -135,7 +135,7 @@ abstract class Result
     }
 
     /**
-     * 根据返回http状态码判断,[200-299]即认为是OK
+     * Judging from the return http status code, [200-299] that is OK
      *
      * @return bool
      */
@@ -149,7 +149,7 @@ abstract class Result
     }
 
     /**
-     * 返回原始的返回数据
+     * Return the original return data
      *
      * @return ResponseCore
      */
@@ -159,15 +159,15 @@ abstract class Result
     }
 
     /**
-     * 标示请求是否成功
+     * Indicate whether the request is successful
      */
     protected $isOk = false;
     /**
-     * 由子类解析过的数据
+     * Data parsed by subclasses
      */
     protected $parsedData = null;
     /**
-     * 存放auth函数返回的原始Response
+     * Store the original Response returned by the auth function
      *
      * @var ResponseCore
      */

+ 24 - 0
vendor/aliyuncs/oss-sdk-php/src/OSS/Result/SymlinkResult.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace OSS\Result;
+
+use OSS\Core\OssException;
+use OSS\OssClient;
+
+/**
+ *
+ * @package OSS\Result
+ */
+class SymlinkResult extends Result
+{
+    /**
+     * @return string
+     * @throws OssException
+     */
+    protected function parseDataFromResponse()
+    {
+        $this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET] = rawurldecode($this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET]);
+        return $this->rawResponse->header;
+    }
+}
+

+ 0 - 59
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/AclResultTest.php

@@ -1,59 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Result\AclResult;
-use OSS\Core\OssException;
-use OSS\Http\ResponseCore;
-
-class AclResultTest extends \PHPUnit_Framework_TestCase
-{
-
-    private $validXml = <<<BBBB
-<?xml version="1.0" ?>
-<AccessControlPolicy>
-    <Owner>
-        <ID>00220120222</ID>
-        <DisplayName>user_example</DisplayName>
-    </Owner>
-    <AccessControlList>
-        <Grant>public-read</Grant>
-    </AccessControlList>
-</AccessControlPolicy>
-BBBB;
-
-    private $invalidXml = <<<BBBB
-<?xml version="1.0" ?>
-<AccessControlPolicy>
-</AccessControlPolicy>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new AclResult($response);
-        $this->assertEquals("public-read", $result->getData());
-    }
-
-    public function testParseNullXml()
-    {
-        $response = new ResponseCore(array(), "", 200);
-        try {
-            new AclResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-            $this->assertEquals('body is null', $e->getMessage());
-        }
-    }
-
-    public function testParseInvalidXml()
-    {
-        $response = new ResponseCore(array(), $this->invalidXml, 200);
-        try {
-            new AclResult($response);
-            $this->assertFalse(true);
-        } catch (OssException $e) {
-            $this->assertEquals("xml format exception", $e->getMessage());
-        }
-    }
-}

+ 0 - 26
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BodyResultTest.php

@@ -1,26 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Http\ResponseCore;
-use OSS\Result\BodyResult;
-
-
-class BodyResultTest extends \PHPUnit_Framework_TestCase
-{
-    public function testParseValid200()
-    {
-        $response = new ResponseCore(array(), "hi", 200);
-        $result = new BodyResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertEquals($result->getData(), "hi");
-    }
-
-    public function testParseInvalid404()
-    {
-        $response = new ResponseCore(array(), null, 200);
-        $result = new BodyResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertEquals($result->getData(), "");
-    }
-}

+ 0 - 79
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketCnameTest.php

@@ -1,79 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Model\CnameConfig;
-use OSS\Core\OssException;
-
-class BucketCnameTest extends \PHPUnit_Framework_TestCase
-{
-    private $bucketName;
-    private $client;
-
-    public function setUp()
-    {
-        $this->client = Common::getOssClient();
-        $this->bucketName = 'php-sdk-test-bucket-' . strval(rand(0, 10));
-        $this->client->createBucket($this->bucketName);
-    }
-
-    public function tearDown()
-    {
-        $this->client->deleteBucket($this->bucketName);
-    }
-
-    public function testBucketWithoutCname()
-    {
-        $cnameConfig = $this->client->getBucketCname($this->bucketName);
-        $this->assertEquals(0, count($cnameConfig->getCnames()));
-    }
-
-    public function testAddCname()
-    {
-        $this->client->addBucketCname($this->bucketName, 'www.baidu.com');
-        $this->client->addBucketCname($this->bucketName, 'www.qq.com');
-
-        $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()
-    {
-        $this->client->addBucketCname($this->bucketName, 'www.baidu.com');
-        $this->client->addBucketCname($this->bucketName, 'www.qq.com');
-
-        $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']);
-    }
-}

+ 0 - 21
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BucketInfoTest.php

@@ -1,21 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Model\BucketInfo;
-
-/**
- * Class BucketInfoTest
- * @package OSS\Tests
- */
-class BucketInfoTest extends \PHPUnit_Framework_TestCase
-{
-    public function testConstruct()
-    {
-        $bucketInfo = new BucketInfo('cn-beijing', 'name', 'today');
-        $this->assertNotNull($bucketInfo);
-        $this->assertEquals('cn-beijing', $bucketInfo->getLocation());
-        $this->assertEquals('name', $bucketInfo->getName());
-        $this->assertEquals('today', $bucketInfo->getCreateDate());
-    }
-}

+ 0 - 77
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CnameConfigTest.php

@@ -1,77 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Model\CnameConfig;
-use OSS\Core\OssException;
-
-class CnameConfigTest extends \PHPUnit_Framework_TestCase
-{
-    private $xml1 = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<BucketCnameConfiguration>
-  <Cname>
-    <Domain>www.foo.com</Domain>
-    <Status>enabled</Status>
-    <LastModified>20150101</LastModified>
-  </Cname>
-  <Cname>
-    <Domain>bar.com</Domain>
-    <Status>disabled</Status>
-    <LastModified>20160101</LastModified>
-  </Cname>
-</BucketCnameConfiguration>
-BBBB;
-
-    public function testFromXml()
-    {
-        $cnameConfig = new CnameConfig();
-        $cnameConfig->parseFromXml($this->xml1);
-
-        $cnames = $cnameConfig->getCnames();
-        $this->assertEquals(2, count($cnames));
-        $this->assertEquals('www.foo.com', $cnames[0]['Domain']);
-        $this->assertEquals('enabled', $cnames[0]['Status']);
-        $this->assertEquals('20150101', $cnames[0]['LastModified']);
-
-        $this->assertEquals('bar.com', $cnames[1]['Domain']);
-        $this->assertEquals('disabled', $cnames[1]['Status']);
-        $this->assertEquals('20160101', $cnames[1]['LastModified']);
-    }
-
-    public function testToXml()
-    {
-        $cnameConfig = new CnameConfig();
-        $cnameConfig->addCname('www.foo.com');
-        $cnameConfig->addCname('bar.com');
-
-        $xml = $cnameConfig->serializeToXml();
-        $comp = new CnameConfig();
-        $comp->parseFromXml($xml);
-
-        $cnames1 = $cnameConfig->getCnames();
-        $cnames2 = $comp->getCnames();
-
-        $this->assertEquals(count($cnames1), count($cnames2));
-        $this->assertEquals(count($cnames1[0]), count($cnames2[0]));
-        $this->assertEquals(1, count($cnames1[0]));
-        $this->assertEquals($cnames1[0]['Domain'], $cnames2[0]['Domain']);
-    }
-
-    public function testCnameNumberLimit()
-    {
-        $cnameConfig = new CnameConfig();
-        for ($i = 0; $i < CnameConfig::OSS_MAX_RULES; $i += 1) {
-            $cnameConfig->addCname(strval($i) . '.foo.com');
-        }
-        try {
-            $cnameConfig->addCname('www.foo.com');
-            $this->assertFalse(true);
-        } catch (OssException $e) {
-            $this->assertEquals(
-                $e->getMessage(),
-                "num of cname in the config exceeds self::OSS_MAX_RULES: " . strval(CnameConfig::OSS_MAX_RULES));
-        }
-    }
-}

+ 0 - 70
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/Common.php

@@ -1,70 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-require_once __DIR__ . '/../../../autoload.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-
-/**
- * Class Common
- *
- * 示例程序【Samples/*.php】 的Common类,用于获取OssClient实例和其他公用方法
- */
-class Common
-{
-    /**
-     * 根据Config配置,得到一个OssClient实例
-     *
-     * @return OssClient 一个OssClient实例
-     */
-    public static function getOssClient()
-    {
-        try {
-            $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 $ossClient;
-    }
-
-    public static function getBucketName()
-    {
-        return getenv('OSS_BUCKET');
-    }
-
-    /**
-     * 工具方法,创建一个bucket
-     */
-    public static function createBucket()
-    {
-        $ossClient = self::getOssClient();
-        if (is_null($ossClient)) exit(1);
-        $bucket = self::getBucketName();
-        $acl = OssClient::OSS_ACL_TYPE_PUBLIC_READ;
-        try {
-            $ossClient->createBucket($bucket, $acl);
-        } catch (OssException $e) {
-            printf(__FUNCTION__ . ": FAILED\n");
-            printf($e->getMessage() . "\n");
-            return;
-        }
-        print(__FUNCTION__ . ": OK" . "\n");
-    }
-
-    /**
-     * Wait for bucket meta sync
-     */
-    public static function waitMetaSync()
-    {
-        if (getenv('TRAVIS')) {
-            sleep(30);
-        }
-    }
-}

+ 0 - 136
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ContentTypeTest.php

@@ -1,136 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-require_once __DIR__ . '/Common.php';
-
-use OSS\OssClient;
-use OSS\Core\OssException;
-
-class ContentTypeTest extends \PHPUnit_Framework_TestCase
-{
-    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 = Common::getOssClient();
-        $headers = $client->getObjectMeta($bucket, $object);
-        return $headers['content-type'];
-    }
-
-    public function testByFileName()
-    {
-        $client = Common::getOssClient();
-        $bucket = Common::getBucketName();
-
-        $file = '/tmp/x.html';
-        $object = 'test/x';
-        $this->runCmd('touch ' . $file);
-
-        $client->uploadFile($bucket, $object, $file);
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('text/html', $type);
-
-        $file = '/tmp/x.json';
-        $object = 'test/y';
-        $this->runCmd('dd if=/dev/random of=' . $file . ' bs=1024 count=100');
-
-        $client->multiuploadFile($bucket, $object, $file, array('partSize' => 100));
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('application/json', $type);
-    }
-
-    public function testByObjectKey()
-    {
-        $client = Common::getOssClient();
-        $bucket = Common::getBucketName();
-
-        $object = "test/x.txt";
-        $client->putObject($bucket, $object, "hello world");
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('text/plain', $type);
-
-        $file = '/tmp/x.html';
-        $object = 'test/x.txt';
-        $this->runCmd('touch ' . $file);
-
-        $client->uploadFile($bucket, $object, $file);
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('text/html', $type);
-
-        $file = '/tmp/x.none';
-        $object = 'test/x.txt';
-        $this->runCmd('touch ' . $file);
-
-        $client->uploadFile($bucket, $object, $file);
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('text/plain', $type);
-
-        $file = '/tmp/x.mp3';
-        $object = 'test/y.json';
-        $this->runCmd('dd if=/dev/random of=' . $file . ' bs=1024 count=100');
-
-        $client->multiuploadFile($bucket, $object, $file, array('partSize' => 100));
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('audio/mpeg', $type);
-
-        $file = '/tmp/x.none';
-        $object = 'test/y.json';
-        $this->runCmd('dd if=/dev/random of=' . $file . ' bs=1024 count=100');
-
-        $client->multiuploadFile($bucket, $object, $file, array('partSize' => 100));
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('application/json', $type);
-    }
-
-    public function testByUser()
-    {
-        $client = Common::getOssClient();
-        $bucket = Common::getBucketName();
-
-        $object = "test/x.txt";
-        $client->putObject($bucket, $object, "hello world", array(
-            'Content-Type' => 'text/html'
-        ));
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('text/html', $type);
-
-        $file = '/tmp/x.html';
-        $object = 'test/x';
-        $this->runCmd('touch ' . $file);
-
-        $client->uploadFile($bucket, $object, $file, array(
-            'Content-Type' => 'application/json'
-        ));
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('application/json', $type);
-
-        $file = '/tmp/x.json';
-        $object = 'test/y';
-        $this->runCmd('dd if=/dev/random of=' . $file . ' bs=1024 count=100');
-
-        $client->multiuploadFile($bucket, $object, $file, array(
-            'partSize' => 100,
-            'Content-Type' => 'audio/mpeg'
-        ));
-        $type = $this->getContentType($bucket, $object);
-
-        $this->assertEquals('audio/mpeg', $type);
-    }
-}

+ 0 - 140
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/CorsConfigTest.php

@@ -1,140 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Model\CorsConfig;
-use OSS\Model\CorsRule;
-use OSS\Core\OssException;
-
-class CorsConfigTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<CORSConfiguration>
-<CORSRule>
-<AllowedOrigin>http://www.b.com</AllowedOrigin>
-<AllowedOrigin>http://www.a.com</AllowedOrigin>
-<AllowedOrigin>http://www.a.com</AllowedOrigin>
-<AllowedMethod>GET</AllowedMethod>
-<AllowedMethod>PUT</AllowedMethod>
-<AllowedMethod>POST</AllowedMethod>
-<AllowedHeader>x-oss-test</AllowedHeader>
-<AllowedHeader>x-oss-test2</AllowedHeader>
-<AllowedHeader>x-oss-test2</AllowedHeader>
-<AllowedHeader>x-oss-test3</AllowedHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<ExposeHeader>x-oss-test2</ExposeHeader>
-<MaxAgeSeconds>10</MaxAgeSeconds>
-</CORSRule>
-<CORSRule>
-<AllowedOrigin>http://www.b.com</AllowedOrigin>
-<AllowedMethod>GET</AllowedMethod>
-<AllowedHeader>x-oss-test</AllowedHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<MaxAgeSeconds>110</MaxAgeSeconds>
-</CORSRule>
-</CORSConfiguration>
-BBBB;
-
-    private $validXml2 = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<CORSConfiguration>
-<CORSRule>
-<AllowedOrigin>http://www.b.com</AllowedOrigin>
-<AllowedOrigin>http://www.a.com</AllowedOrigin>
-<AllowedOrigin>http://www.a.com</AllowedOrigin>
-<AllowedMethod>GET</AllowedMethod>
-<AllowedMethod>PUT</AllowedMethod>
-<AllowedMethod>POST</AllowedMethod>
-<AllowedHeader>x-oss-test</AllowedHeader>
-<AllowedHeader>x-oss-test2</AllowedHeader>
-<AllowedHeader>x-oss-test2</AllowedHeader>
-<AllowedHeader>x-oss-test3</AllowedHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<ExposeHeader>x-oss-test2</ExposeHeader>
-<MaxAgeSeconds>10</MaxAgeSeconds>
-</CORSRule>
-</CORSConfiguration>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $corsConfig = new CorsConfig();
-        $corsConfig->parseFromXml($this->validXml);
-        $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());
-    }
-
-    public function testParseValidXml2()
-    {
-        $corsConfig = new CorsConfig();
-        $corsConfig->parseFromXml($this->validXml2);
-        $this->assertEquals($this->cleanXml($this->validXml2), $this->cleanXml($corsConfig->serializeToXml()));
-    }
-
-    public function testCreateCorsConfigFromMoreThan10Rules()
-    {
-        $corsConfig = new CorsConfig();
-        $rule = new CorsRule();
-        for ($i = 0; $i < CorsConfig::OSS_MAX_RULES; $i += 1) {
-            $corsConfig->addRule($rule);
-        }
-        try {
-            $corsConfig->addRule($rule);
-            $this->assertFalse(true);
-        } catch (OssException $e) {
-            $this->assertEquals($e->getMessage(), "num of rules in the config exceeds self::OSS_MAX_RULES: " . strval(CorsConfig::OSS_MAX_RULES));
-        }
-    }
-
-    public function testCreateCorsConfigParamAbsent()
-    {
-        $corsConfig = new CorsConfig();
-        $rule = new CorsRule();
-        $corsConfig->addRule($rule);
-
-        try {
-            $xml = $corsConfig->serializeToXml();
-            $this->assertFalse(true);
-        } catch (OssException $e) {
-            $this->assertEquals($e->getMessage(), "maxAgeSeconds is not set in the Rule");
-        }
-    }
-
-    public function testCreateCorsConfigFromScratch()
-    {
-        $corsConfig = new CorsConfig();
-        $rule = new CorsRule();
-        $rule->addAllowedHeader("x-oss-test");
-        $rule->addAllowedHeader("x-oss-test2");
-        $rule->addAllowedHeader("x-oss-test2");
-        $rule->addAllowedHeader("x-oss-test3");
-        $rule->addAllowedOrigin("http://www.b.com");
-        $rule->addAllowedOrigin("http://www.a.com");
-        $rule->addAllowedOrigin("http://www.a.com");
-        $rule->addAllowedMethod("GET");
-        $rule->addAllowedMethod("PUT");
-        $rule->addAllowedMethod("POST");
-        $rule->addExposeHeader("x-oss-test1");
-        $rule->addExposeHeader("x-oss-test1");
-        $rule->addExposeHeader("x-oss-test2");
-        $rule->setMaxAgeSeconds(10);
-        $corsConfig->addRule($rule);
-        $this->assertEquals($this->cleanXml($this->validXml2), $this->cleanXml($corsConfig->serializeToXml()));
-        $this->assertEquals($this->cleanXml($this->validXml2), $this->cleanXml(strval($corsConfig)));
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-}

+ 0 - 38
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ExistResultTest.php

@@ -1,38 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Result\ExistResult;
-use OSS\Http\ResponseCore;
-use OSS\Core\OssException;
-
-class ExistResultTest extends \PHPUnit_Framework_TestCase
-{
-    public function testParseValid200()
-    {
-        $response = new ResponseCore(array(), "", 200);
-        $result = new ExistResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertEquals($result->getData(), true);
-    }
-
-    public function testParseInvalid404()
-    {
-        $response = new ResponseCore(array(), "", 404);
-        $result = new ExistResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertEquals($result->getData(), false);
-    }
-
-    public function testInvalidResponse()
-    {
-        $response = new ResponseCore(array(), "", 300);
-        try {
-            new ExistResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-
-        }
-    }
-}

+ 0 - 67
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetCorsResultTest.php

@@ -1,67 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Core\OssException;
-use OSS\Result\GetCorsResult;
-use OSS\Http\ResponseCore;
-
-class GetCorsResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<CORSConfiguration>
-<CORSRule>
-<AllowedOrigin>http://www.b.com</AllowedOrigin>
-<AllowedOrigin>http://www.a.com</AllowedOrigin>
-<AllowedOrigin>http://www.a.com</AllowedOrigin>
-<AllowedMethod>GET</AllowedMethod>
-<AllowedMethod>PUT</AllowedMethod>
-<AllowedMethod>POST</AllowedMethod>
-<AllowedHeader>x-oss-test</AllowedHeader>
-<AllowedHeader>x-oss-test2</AllowedHeader>
-<AllowedHeader>x-oss-test2</AllowedHeader>
-<AllowedHeader>x-oss-test3</AllowedHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<ExposeHeader>x-oss-test2</ExposeHeader>
-<MaxAgeSeconds>10</MaxAgeSeconds>
-</CORSRule>
-<CORSRule>
-<AllowedOrigin>http://www.b.com</AllowedOrigin>
-<AllowedMethod>GET</AllowedMethod>
-<AllowedHeader>x-oss-test</AllowedHeader>
-<ExposeHeader>x-oss-test1</ExposeHeader>
-<MaxAgeSeconds>110</MaxAgeSeconds>
-</CORSRule>
-</CORSConfiguration>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new GetCorsResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $corsConfig = $result->getData();
-        $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($corsConfig->serializeToXml()));
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-
-    public function testInvalidResponse()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 300);
-        try {
-            new GetCorsResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-
-        }
-    }
-}

+ 0 - 59
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetLifecycleResultTest.php

@@ -1,59 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Http\ResponseCore;
-use OSS\Core\OssException;
-use OSS\Model\LifecycleConfig;
-use OSS\Result\GetLifecycleResult;
-
-class GetLifecycleResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<LifecycleConfiguration>
-<Rule>
-<ID>delete obsoleted files</ID>
-<Prefix>obsoleted/</Prefix>
-<Status>Enabled</Status>
-<Expiration><Days>3</Days></Expiration>
-</Rule>
-<Rule>
-<ID>delete temporary files</ID>
-<Prefix>temporary/</Prefix>
-<Status>Enabled</Status>
-<Expiration><Date>2022-10-12T00:00:00.000Z</Date></Expiration>
-<Expiration2><Date>2022-10-12T00:00:00.000Z</Date></Expiration2>
-</Rule>
-</LifecycleConfiguration>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new GetLifecycleResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $lifecycleConfig = $result->getData();
-        $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($lifecycleConfig->serializeToXml()));
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-
-    public function testInvalidResponse()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 300);
-        try {
-            new GetLifecycleResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-
-        }
-    }
-
-}

+ 0 - 51
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetLoggingResultTest.php

@@ -1,51 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Result\GetLoggingResult;
-use OSS\Http\ResponseCore;
-use OSS\Core\OssException;
-
-
-class GetLoggingResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<BucketLoggingStatus>
-<LoggingEnabled>
-<TargetBucket>TargetBucket</TargetBucket>
-<TargetPrefix>TargetPrefix</TargetPrefix>
-</LoggingEnabled>
-</BucketLoggingStatus>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new GetLoggingResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $loggingConfig = $result->getData();
-        $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($loggingConfig->serializeToXml()));
-        $this->assertEquals("TargetBucket", $loggingConfig->getTargetBucket());
-        $this->assertEquals("TargetPrefix", $loggingConfig->getTargetPrefix());
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-
-    public function testInvalidResponse()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 300);
-        try {
-            new GetLoggingResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-
-        }
-    }
-}

+ 0 - 51
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetRefererResultTest.php

@@ -1,51 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Result\GetRefererResult;
-use OSS\Http\ResponseCore;
-use OSS\Core\OssException;
-
-
-class GetRefererResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<RefererConfiguration>
-<AllowEmptyReferer>true</AllowEmptyReferer>
-<RefererList>
-<Referer>http://www.aliyun.com</Referer>
-<Referer>https://www.aliyun.com</Referer>
-<Referer>http://www.*.com</Referer>
-<Referer>https://www.?.aliyuncs.com</Referer>
-</RefererList>
-</RefererConfiguration>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new GetRefererResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $refererConfig = $result->getData();
-        $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($refererConfig->serializeToXml()));
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-
-    public function testInvalidResponse()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 300);
-        try {
-            new GetRefererResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-
-        }
-    }
-}

+ 0 - 50
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetWebsiteResultTest.php

@@ -1,50 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Result\GetWebsiteResult;
-use OSS\Http\ResponseCore;
-use OSS\Core\OssException;
-
-class GetWebsiteResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<WebsiteConfiguration>
-<IndexDocument>
-<Suffix>index.html</Suffix>
-</IndexDocument>
-<ErrorDocument>
-<Key>errorDocument.html</Key>
-</ErrorDocument>
-</WebsiteConfiguration>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new GetWebsiteResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $websiteConfig = $result->getData();
-        $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($websiteConfig->serializeToXml()));
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-
-    public function testInvalidResponse()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 300);
-        try {
-            new GetWebsiteResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-
-        }
-    }
-}

+ 0 - 23
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/HeaderResultTest.php

@@ -1,23 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Result\HeaderResult;
-use OSS\Http\ResponseCore;
-
-/**
- * Class HeaderResultTest
- * @package OSS\Tests
- */
-class HeaderResultTest extends \PHPUnit_Framework_TestCase
-{
-    public function testGetHeader()
-    {
-        $response = new ResponseCore(array('key' => 'value'), "", 200);
-        $result = new HeaderResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertTrue(is_array($result->getData()));
-        $data = $result->getData();
-        $this->assertEquals($data['key'], 'value');
-    }
-}

+ 0 - 88
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/HttpTest.php

@@ -1,88 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Http\RequestCore;
-use OSS\Http\ResponseCore;
-use OSS\Http\RequestCore_Exception;
-use Symfony\Component\Config\Definition\Exception\Exception;
-
-class HttpTest extends \PHPUnit_Framework_TestCase
-{
-
-    public function testResponseCore()
-    {
-        $res = new ResponseCore(null, "", 500);
-        $this->assertFalse($res->isOK());
-        $this->assertTrue($res->isOK(500));
-    }
-
-    public function testGet()
-    {
-        $httpCore = new RequestCore("http://www.baidu.com");
-        $httpResponse = $httpCore->send_request();
-        $this->assertNotNull($httpResponse);
-    }
-
-    public function testSetProxyAndTimeout()
-    {
-        $httpCore = new RequestCore("http://www.baidu.com");
-        $httpCore->set_proxy("1.0.2.1:8888");
-        $httpCore->connect_timeout = 1;
-        try {
-            $httpResponse = $httpCore->send_request();
-            $this->assertTrue(false);
-        } catch (RequestCore_Exception $e) {
-
-        }
-    }
-
-    public function testSendMultiRequest()
-    {
-        $httpCore = new RequestCore("http://www.baidu.com");
-        $ch1 = curl_init("http://www.baidu.com");
-        curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1);
-        $ch2 = curl_init("http://cn.bing.com");
-        curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
-        @$result = $httpCore->send_multi_request(array($ch1, $ch2));
-        $this->assertNotNull($result);
-    }
-
-    public function testGetParseTrue()
-    {
-        $httpCore = new RequestCore("http://www.baidu.com");
-        $httpCore->curlopts = array(CURLOPT_HEADER => true);
-        $url = $httpCore->send_request(true);
-        foreach ($httpCore->get_response_header() as $key => $value) {
-            $this->assertEquals($httpCore->get_response_header($key), $value);
-        }
-        $this->assertNotNull($url);
-    }
-
-    public function testParseResponse()
-    {
-        $httpCore = new RequestCore("http://www.baidu.com");
-        $response = $httpCore->send_request();
-        $parsed = $httpCore->process_response(null, $response);
-        $this->assertNotNull($parsed);
-    }
-
-    public function testExceptionGet()
-    {
-        $httpCore = null;
-        $exception = false;
-        try {
-            $httpCore = new RequestCore("http://www.notexistsitexx.com");
-            $httpCore->set_body("");
-            $httpCore->set_method("GET");
-            $httpCore->connect_timeout = 10;
-            $httpCore->timeout = 10;
-            $res = $httpCore->send_request();
-        } catch (RequestCore_Exception $e) {
-            $exception = true;
-        }
-        $this->assertTrue($exception);
-    }
-}
-
-

+ 0 - 47
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/InitiateMultipartUploadResultTest.php

@@ -1,47 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Core\OssException;
-use OSS\Result\InitiateMultipartUploadResult;
-use OSS\Http\ResponseCore;
-
-class InitiateMultipartUploadResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<InitiateMultipartUploadResult xmlns="http://doc.oss-cn-hangzhou.aliyuncs.com">
-    <Bucket> multipart_upload</Bucket>
-    <Key>multipart.data</Key>
-    <UploadId>0004B9894A22E5B1888A1E29F8236E2D</UploadId>
-</InitiateMultipartUploadResult>
-BBBB;
-
-    private $invalidXml = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<InitiateMultipartUploadResult xmlns="http://doc.oss-cn-hangzhou.aliyuncs.com">
-    <Bucket> multipart_upload</Bucket>
-    <Key>multipart.data</Key>
-</InitiateMultipartUploadResult>
-BBBB;
-
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new InitiateMultipartUploadResult($response);
-        $this->assertEquals("0004B9894A22E5B1888A1E29F8236E2D", $result->getData());
-    }
-
-    public function testParseInvalidXml()
-    {
-        $response = new ResponseCore(array(), $this->invalidXml, 200);
-        try {
-            $result = new InitiateMultipartUploadResult($response);
-            $this->assertTrue(false);
-        } catch (OssException $e) {
-
-        }
-    }
-}

+ 0 - 130
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/LifecycleConfigTest.php

@@ -1,130 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Core\OssException;
-use OSS\Model\LifecycleAction;
-use OSS\Model\LifecycleConfig;
-use OSS\Model\LifecycleRule;
-
-class LifecycleConfigTest extends \PHPUnit_Framework_TestCase
-{
-
-    private $validLifecycle = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<LifecycleConfiguration>
-<Rule>
-<ID>delete obsoleted files</ID>
-<Prefix>obsoleted/</Prefix>
-<Status>Enabled</Status>
-<Expiration><Days>3</Days></Expiration>
-</Rule>
-<Rule>
-<ID>delete temporary files</ID>
-<Prefix>temporary/</Prefix>
-<Status>Enabled</Status>
-<Expiration><Date>2022-10-12T00:00:00.000Z</Date></Expiration>
-<Expiration2><Date>2022-10-12T00:00:00.000Z</Date></Expiration2>
-</Rule>
-</LifecycleConfiguration>
-BBBB;
-
-    private $validLifecycle2 = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<LifecycleConfiguration>
-<Rule><ID>delete temporary files</ID>
-<Prefix>temporary/</Prefix>
-<Status>Enabled</Status>
-<Expiration><Date>2022-10-12T00:00:00.000Z</Date></Expiration>
-<Expiration2><Date>2022-10-12T00:00:00.000Z</Date></Expiration2>
-</Rule>
-</LifecycleConfiguration>
-BBBB;
-
-    private $nullLifecycle = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<LifecycleConfiguration/>
-BBBB;
-
-    public function testConstructValidConfig()
-    {
-        $lifecycleConfig = new LifecycleConfig();
-        $actions = array();
-        $actions[] = new LifecycleAction("Expiration", "Days", 3);
-        $lifecycleRule = new LifecycleRule("delete obsoleted files", "obsoleted/", "Enabled", $actions);
-        $lifecycleConfig->addRule($lifecycleRule);
-        $actions = array();
-        $actions[] = new LifecycleAction("Expiration", "Date", '2022-10-12T00:00:00.000Z');
-        $actions[] = new LifecycleAction("Expiration2", "Date", '2022-10-12T00:00:00.000Z');
-        $lifecycleRule = new LifecycleRule("delete temporary files", "temporary/", "Enabled", $actions);
-        $lifecycleConfig->addRule($lifecycleRule);
-        try {
-            $lifecycleConfig->addRule(null);
-            $this->assertFalse(true);
-        } catch (OssException $e) {
-            $this->assertEquals('lifecycleRule is null', $e->getMessage());
-        }
-        $this->assertEquals($this->cleanXml(strval($lifecycleConfig)), $this->cleanXml($this->validLifecycle));
-    }
-
-    public function testParseValidXml()
-    {
-        $lifecycleConfig = new LifecycleConfig();
-        $lifecycleConfig->parseFromXml($this->validLifecycle);
-        $this->assertEquals($this->cleanXml($lifecycleConfig->serializeToXml()), $this->cleanXml($this->validLifecycle));
-        $this->assertEquals(2, count($lifecycleConfig->getRules()));
-        $rules = $lifecycleConfig->getRules();
-        $this->assertEquals('delete temporary files', $rules[1]->getId());
-    }
-
-    public function testParseValidXml2()
-    {
-        $lifecycleConfig = new LifecycleConfig();
-        $lifecycleConfig->parseFromXml($this->validLifecycle2);
-        $this->assertEquals($this->cleanXml($lifecycleConfig->serializeToXml()), $this->cleanXml($this->validLifecycle2));
-        $this->assertEquals(1, count($lifecycleConfig->getRules()));
-        $rules = $lifecycleConfig->getRules();
-        $this->assertEquals('delete temporary files', $rules[0]->getId());
-    }
-
-    public function testParseNullXml()
-    {
-        $lifecycleConfig = new LifecycleConfig();
-        $lifecycleConfig->parseFromXml($this->nullLifecycle);
-        $this->assertEquals($this->cleanXml($lifecycleConfig->serializeToXml()), $this->cleanXml($this->nullLifecycle));
-        $this->assertEquals(0, count($lifecycleConfig->getRules()));
-    }
-
-    public function testLifecycleRule()
-    {
-        $lifecycleRule = new LifecycleRule("x", "x", "x", array('x'));
-        $lifecycleRule->setId("id");
-        $lifecycleRule->setPrefix("prefix");
-        $lifecycleRule->setStatus("Enabled");
-        $lifecycleRule->setActions(array());
-
-        $this->assertEquals('id', $lifecycleRule->getId());
-        $this->assertEquals('prefix', $lifecycleRule->getPrefix());
-        $this->assertEquals('Enabled', $lifecycleRule->getStatus());
-        $this->assertEmpty($lifecycleRule->getActions());
-    }
-
-    public function testLifecycleAction()
-    {
-        $action = new LifecycleAction('x', 'x', 'x');
-        $this->assertEquals($action->getAction(), 'x');
-        $this->assertEquals($action->getTimeSpec(), 'x');
-        $this->assertEquals($action->getTimeValue(), 'x');
-        $action->setAction('y');
-        $action->setTimeSpec('y');
-        $action->setTimeValue('y');
-        $this->assertEquals($action->getAction(), 'y');
-        $this->assertEquals($action->getTimeSpec(), 'y');
-        $this->assertEquals($action->getTimeValue(), 'y');
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-}

+ 0 - 97
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListBucketsResultTest.php

@@ -1,97 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Core\OssException;
-use OSS\Http\ResponseCore;
-use OSS\Result\ListBucketsResult;
-
-class ListBucketsResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListAllMyBucketsResult>
-  <Owner>
-    <ID>ut_test_put_bucket</ID>
-    <DisplayName>ut_test_put_bucket</DisplayName>
-  </Owner>
-  <Buckets>
-    <Bucket>
-      <Location>oss-cn-hangzhou-a</Location>
-      <Name>xz02tphky6fjfiuc0</Name>
-      <CreationDate>2014-05-15T11:18:32.000Z</CreationDate>
-    </Bucket>
-    <Bucket>
-      <Location>oss-cn-hangzhou-a</Location>
-      <Name>xz02tphky6fjfiuc1</Name>
-      <CreationDate>2014-05-15T11:18:32.000Z</CreationDate>
-    </Bucket>
-  </Buckets>
-</ListAllMyBucketsResult>
-BBBB;
-
-    private $nullXml = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListAllMyBucketsResult>
-  <Owner>
-    <ID>ut_test_put_bucket</ID>
-    <DisplayName>ut_test_put_bucket</DisplayName>
-  </Owner>
-  <Buckets>
-  </Buckets>
-</ListAllMyBucketsResult>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new ListBucketsResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $bucketListInfo = $result->getData();
-        $this->assertEquals(2, count($bucketListInfo->getBucketList()));
-    }
-
-    public function testParseNullXml()
-    {
-        $response = new ResponseCore(array(), $this->nullXml, 200);
-        $result = new ListBucketsResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $bucketListInfo = $result->getData();
-        $this->assertEquals(0, count($bucketListInfo->getBucketList()));
-    }
-
-    public function test403()
-    {
-        $errorHeader = array(
-            'x-oss-request-id' => '1a2b-3c4d'
-        );
-
-        $errorBody = <<< BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<Error>
-  <Code>NoSuchBucket</Code>
-  <Message>The specified bucket does not exist.</Message>
-  <RequestId>566B870D207FB3044302EB0A</RequestId>
-  <HostId>hello.oss-test.aliyun-inc.com</HostId>
-  <BucketName>hello</BucketName>
-</Error>
-BBBB;
-        $response = new ResponseCore($errorHeader, $errorBody, 403);
-        try {
-            new ListBucketsResult($response);
-        } catch (OssException $e) {
-            $this->assertEquals(
-                $e->getMessage(),
-                'NoSuchBucket: The specified bucket does not exist. RequestId: 1a2b-3c4d');
-            $this->assertEquals($e->getHTTPStatus(), '403');
-            $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(), $errorBody);
-        }
-    }
-}

+ 0 - 114
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListMultipartUploadResultTest.php

@@ -1,114 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Result\ListMultipartUploadResult;
-use OSS\Http\ResponseCore;
-
-/**
- * Class ListMultipartUploadResultTest
- * @package OSS\Tests
- */
-class ListMultipartUploadResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListMultipartUploadsResult xmlns="http://doc.oss-cn-hangzhou.aliyuncs.com">
-    <Bucket>oss-example</Bucket>
-    <KeyMarker>xx</KeyMarker>
-    <UploadIdMarker>3</UploadIdMarker>
-    <NextKeyMarker>oss.avi</NextKeyMarker>
-    <NextUploadIdMarker>0004B99B8E707874FC2D692FA5D77D3F</NextUploadIdMarker>
-    <Delimiter>x</Delimiter>
-    <Prefix>xx</Prefix>
-    <MaxUploads>1000</MaxUploads>
-    <IsTruncated>false</IsTruncated>
-    <Upload>
-        <Key>multipart.data</Key>
-        <UploadId>0004B999EF518A1FE585B0C9360DC4C8</UploadId>
-        <Initiated>2012-02-23T04:18:23.000Z</Initiated>
-    </Upload>
-    <Upload>
-        <Key>multipart.data</Key>
-        <UploadId>0004B999EF5A239BB9138C6227D69F95</UploadId>
-        <Initiated>2012-02-23T04:18:23.000Z</Initiated>
-    </Upload>
-    <Upload>
-        <Key>oss.avi</Key>
-        <UploadId>0004B99B8E707874FC2D692FA5D77D3F</UploadId>
-        <Initiated>2012-02-23T06:14:27.000Z</Initiated>
-    </Upload>
-</ListMultipartUploadsResult>
-BBBB;
-
-    private $validXmlWithEncodedKey = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListMultipartUploadsResult xmlns="http://doc.oss-cn-hangzhou.aliyuncs.com">
-    <Bucket>oss-example</Bucket>
-    <EncodingType>url</EncodingType>
-    <KeyMarker>php%2Bkey-marker</KeyMarker>
-    <UploadIdMarker>3</UploadIdMarker>
-    <NextKeyMarker>php%2Bnext-key-marker</NextKeyMarker>
-    <NextUploadIdMarker>0004B99B8E707874FC2D692FA5D77D3F</NextUploadIdMarker>
-    <Delimiter>%2F</Delimiter>
-    <Prefix>php%2Bprefix</Prefix>
-    <MaxUploads>1000</MaxUploads>
-    <IsTruncated>true</IsTruncated>
-    <Upload>
-        <Key>php%2Bkey-1</Key>
-        <UploadId>0004B999EF518A1FE585B0C9360DC4C8</UploadId>
-        <Initiated>2012-02-23T04:18:23.000Z</Initiated>
-    </Upload>
-    <Upload>
-        <Key>php%2Bkey-2</Key>
-        <UploadId>0004B999EF5A239BB9138C6227D69F95</UploadId>
-        <Initiated>2012-02-23T04:18:23.000Z</Initiated>
-    </Upload>
-    <Upload>
-        <Key>php%2Bkey-3</Key>
-        <UploadId>0004B99B8E707874FC2D692FA5D77D3F</UploadId>
-        <Initiated>2012-02-23T06:14:27.000Z</Initiated>
-    </Upload>
-</ListMultipartUploadsResult>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new ListMultipartUploadResult($response);
-        $listMultipartUploadInfo = $result->getData();
-        $this->assertEquals("oss-example", $listMultipartUploadInfo->getBucket());
-        $this->assertEquals("xx", $listMultipartUploadInfo->getKeyMarker());
-        $this->assertEquals(3, $listMultipartUploadInfo->getUploadIdMarker());
-        $this->assertEquals("oss.avi", $listMultipartUploadInfo->getNextKeyMarker());
-        $this->assertEquals("0004B99B8E707874FC2D692FA5D77D3F", $listMultipartUploadInfo->getNextUploadIdMarker());
-        $this->assertEquals("x", $listMultipartUploadInfo->getDelimiter());
-        $this->assertEquals("xx", $listMultipartUploadInfo->getPrefix());
-        $this->assertEquals(1000, $listMultipartUploadInfo->getMaxUploads());
-        $this->assertEquals("false", $listMultipartUploadInfo->getIsTruncated());
-        $uploads = $listMultipartUploadInfo->getUploads();
-        $this->assertEquals("multipart.data", $uploads[0]->getKey());
-        $this->assertEquals("0004B999EF518A1FE585B0C9360DC4C8", $uploads[0]->getUploadId());
-        $this->assertEquals("2012-02-23T04:18:23.000Z", $uploads[0]->getInitiated());
-    }
-
-    public function testParseValidXmlWithEncodedKey()
-    {
-        $response = new ResponseCore(array(), $this->validXmlWithEncodedKey, 200);
-        $result = new ListMultipartUploadResult($response);
-        $listMultipartUploadInfo = $result->getData();
-        $this->assertEquals("oss-example", $listMultipartUploadInfo->getBucket());
-        $this->assertEquals("php+key-marker", $listMultipartUploadInfo->getKeyMarker());
-        $this->assertEquals("php+next-key-marker", $listMultipartUploadInfo->getNextKeyMarker());
-        $this->assertEquals(3, $listMultipartUploadInfo->getUploadIdMarker());
-        $this->assertEquals("0004B99B8E707874FC2D692FA5D77D3F", $listMultipartUploadInfo->getNextUploadIdMarker());
-        $this->assertEquals("/", $listMultipartUploadInfo->getDelimiter());
-        $this->assertEquals("php+prefix", $listMultipartUploadInfo->getPrefix());
-        $this->assertEquals(1000, $listMultipartUploadInfo->getMaxUploads());
-        $this->assertEquals("true", $listMultipartUploadInfo->getIsTruncated());
-        $uploads = $listMultipartUploadInfo->getUploads();
-        $this->assertEquals("php+key-1", $uploads[0]->getKey());
-        $this->assertEquals("0004B999EF518A1FE585B0C9360DC4C8", $uploads[0]->getUploadId());
-        $this->assertEquals("2012-02-23T04:18:23.000Z", $uploads[0]->getInitiated());
-    }
-}

+ 0 - 151
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListObjectsResultTest.php

@@ -1,151 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-
-use OSS\Result\ListObjectsResult;
-use OSS\Http\ResponseCore;
-
-class ListObjectsResultTest extends \PHPUnit_Framework_TestCase
-{
-
-    private $validXml1 = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListBucketResult>
-  <Name>testbucket-hf</Name>
-  <Prefix></Prefix>
-  <Marker></Marker>
-  <MaxKeys>1000</MaxKeys>
-  <Delimiter>/</Delimiter>
-  <IsTruncated>false</IsTruncated>
-  <CommonPrefixes>
-    <Prefix>oss-php-sdk-test/</Prefix>
-  </CommonPrefixes>
-  <CommonPrefixes>
-    <Prefix>test/</Prefix>
-  </CommonPrefixes>
-</ListBucketResult>
-BBBB;
-
-    private $validXml2 = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListBucketResult>
-  <Name>testbucket-hf</Name>
-  <Prefix>oss-php-sdk-test/</Prefix>
-  <Marker>xx</Marker>
-  <MaxKeys>1000</MaxKeys>
-  <Delimiter>/</Delimiter>
-  <IsTruncated>false</IsTruncated>
-  <Contents>
-    <Key>oss-php-sdk-test/upload-test-object-name.txt</Key>
-    <LastModified>2015-11-18T03:36:00.000Z</LastModified>
-    <ETag>"89B9E567E7EB8815F2F7D41851F9A2CD"</ETag>
-    <Type>Normal</Type>
-    <Size>13115</Size>
-    <StorageClass>Standard</StorageClass>
-    <Owner>
-      <ID>cname_user</ID>
-      <DisplayName>cname_user</DisplayName>
-    </Owner>
-  </Contents>
-</ListBucketResult>
-BBBB;
-
-    private $validXmlWithEncodedKey = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListBucketResult>
-  <Name>testbucket-hf</Name>
-  <EncodingType>url</EncodingType>
-  <Prefix>php%2Fprefix</Prefix>
-  <Marker>php%2Fmarker</Marker>
-  <NextMarker>php%2Fnext-marker</NextMarker>
-  <MaxKeys>1000</MaxKeys>
-  <Delimiter>%2F</Delimiter>
-  <IsTruncated>true</IsTruncated>
-  <Contents>
-    <Key>php/a%2Bb</Key>
-    <LastModified>2015-11-18T03:36:00.000Z</LastModified>
-    <ETag>"89B9E567E7EB8815F2F7D41851F9A2CD"</ETag>
-    <Type>Normal</Type>
-    <Size>13115</Size>
-    <StorageClass>Standard</StorageClass>
-    <Owner>
-      <ID>cname_user</ID>
-      <DisplayName>cname_user</DisplayName>
-    </Owner>
-  </Contents>
-</ListBucketResult>
-BBBB;
-
-    public function testParseValidXml1()
-    {
-        $response = new ResponseCore(array(), $this->validXml1, 200);
-        $result = new ListObjectsResult($response);
-        $this->assertTrue($result->isOK());
-        $this->assertNotNull($result->getData());
-        $this->assertNotNull($result->getRawResponse());
-        $objectListInfo = $result->getData();
-        $this->assertEquals(2, count($objectListInfo->getPrefixList()));
-        $this->assertEquals(0, count($objectListInfo->getObjectList()));
-        $this->assertEquals('testbucket-hf', $objectListInfo->getBucketName());
-        $this->assertEquals('', $objectListInfo->getPrefix());
-        $this->assertEquals('', $objectListInfo->getMarker());
-        $this->assertEquals(1000, $objectListInfo->getMaxKeys());
-        $this->assertEquals('/', $objectListInfo->getDelimiter());
-        $this->assertEquals('false', $objectListInfo->getIsTruncated());
-        $prefixes = $objectListInfo->getPrefixList();
-        $this->assertEquals('oss-php-sdk-test/', $prefixes[0]->getPrefix());
-        $this->assertEquals('test/', $prefixes[1]->getPrefix());
-    }
-
-    public function testParseValidXml2()
-    {
-        $response = new ResponseCore(array(), $this->validXml2, 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('oss-php-sdk-test/', $objectListInfo->getPrefix());
-        $this->assertEquals('xx', $objectListInfo->getMarker());
-        $this->assertEquals(1000, $objectListInfo->getMaxKeys());
-        $this->assertEquals('/', $objectListInfo->getDelimiter());
-        $this->assertEquals('false', $objectListInfo->getIsTruncated());
-        $objects = $objectListInfo->getObjectList();
-        $this->assertEquals('oss-php-sdk-test/upload-test-object-name.txt', $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());
-    }
-
-    public function testParseValidXmlWithEncodedKey()
-    {
-        $response = new ResponseCore(array(), $this->validXmlWithEncodedKey, 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());
-    }
-}

+ 0 - 62
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/ListPartsResultTest.php

@@ -1,62 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Result\ListPartsResult;
-use OSS\Http\ResponseCore;
-
-/**
- * Class ListPartsResultTest
- * @package OSS\Tests
- */
-class ListPartsResultTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="UTF-8"?>
-<ListPartsResult xmlns="http://doc.oss-cn-hangzhou.aliyuncs.com">
-    <Bucket>multipart_upload</Bucket>
-    <Key>multipart.data</Key>
-    <UploadId>0004B999EF5A239BB9138C6227D69F95</UploadId>
-    <NextPartNumberMarker>5</NextPartNumberMarker>
-    <MaxParts>1000</MaxParts>
-    <IsTruncated>false</IsTruncated>
-    <Part>
-        <PartNumber>1</PartNumber>
-        <LastModified>2012-02-23T07:01:34.000Z</LastModified>
-        <ETag>&quot;3349DC700140D7F86A078484278075A9&quot;</ETag>
-        <Size>6291456</Size>
-    </Part>
-    <Part>
-        <PartNumber>2</PartNumber>
-        <LastModified>2012-02-23T07:01:12.000Z</LastModified>
-        <ETag>&quot;3349DC700140D7F86A078484278075A9&quot;</ETag>
-        <Size>6291456</Size>
-    </Part>
-    <Part>
-        <PartNumber>5</PartNumber>
-        <LastModified>2012-02-23T07:02:03.000Z</LastModified>
-        <ETag>&quot;7265F4D211B56873A381D321F586E4A9&quot;</ETag>
-        <Size>1024</Size>
-    </Part>
-</ListPartsResult>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $response = new ResponseCore(array(), $this->validXml, 200);
-        $result = new ListPartsResult($response);
-        $listPartsInfo = $result->getData();
-        $this->assertEquals("multipart_upload", $listPartsInfo->getBucket());
-        $this->assertEquals("multipart.data", $listPartsInfo->getKey());
-        $this->assertEquals("0004B999EF5A239BB9138C6227D69F95", $listPartsInfo->getUploadId());
-        $this->assertEquals(5, $listPartsInfo->getNextPartNumberMarker());
-        $this->assertEquals(1000, $listPartsInfo->getMaxParts());
-        $this->assertEquals("false", $listPartsInfo->getIsTruncated());
-        $this->assertEquals(3, count($listPartsInfo->getListPart()));
-        $parts = $listPartsInfo->getListPart();
-        $this->assertEquals(1, $parts[0]->getPartNumber());
-        $this->assertEquals('2012-02-23T07:01:34.000Z', $parts[0]->getLastModified());
-        $this->assertEquals('"3349DC700140D7F86A078484278075A9"', $parts[0]->getETag());
-        $this->assertEquals(6291456, $parts[0]->getSize());
-    }
-}

+ 0 - 47
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/LoggingConfigTest.php

@@ -1,47 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Model\LoggingConfig;
-
-class LoggingConfigTest extends \PHPUnit_Framework_TestCase
-{
-    private $validXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<BucketLoggingStatus>
-<LoggingEnabled>
-<TargetBucket>TargetBucket</TargetBucket>
-<TargetPrefix>TargetPrefix</TargetPrefix>
-</LoggingEnabled>
-</BucketLoggingStatus>
-BBBB;
-
-    private $nullXml = <<<BBBB
-<?xml version="1.0" encoding="utf-8"?>
-<BucketLoggingStatus/>
-BBBB;
-
-    public function testParseValidXml()
-    {
-        $loggingConfig = new LoggingConfig();
-        $loggingConfig->parseFromXml($this->validXml);
-        $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml(strval($loggingConfig)));
-    }
-
-    public function testConstruct()
-    {
-        $loggingConfig = new LoggingConfig('TargetBucket', 'TargetPrefix');
-        $this->assertEquals($this->cleanXml($this->validXml), $this->cleanXml($loggingConfig->serializeToXml()));
-    }
-
-    public function testFailedConstruct()
-    {
-        $loggingConfig = new LoggingConfig('TargetBucket', null);
-        $this->assertEquals($this->cleanXml($this->nullXml), $this->cleanXml($loggingConfig->serializeToXml()));
-    }
-
-    private function cleanXml($xml)
-    {
-        return str_replace("\n", "", str_replace("\r", "", $xml));
-    }
-}

+ 0 - 13
vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/MimeTypesTest.php

@@ -1,13 +0,0 @@
-<?php
-
-namespace OSS\Tests;
-
-use OSS\Core\MimeTypes;
-
-class MimeTypesTest extends \PHPUnit_Framework_TestCase
-{
-    public function testGetMimeType()
-    {
-        $this->assertEquals('application/xml', MimeTypes::getMimetype('file.xml'));
-    }
-}

部分文件因为文件数量过多而无法显示