diff --git a/config/module.php b/config/module.php
index 9062b4b9b..8ff7081d0 100644
--- a/config/module.php
+++ b/config/module.php
@@ -53,9 +53,9 @@
'Cms' => [
'enable' => true,
],
- // 'DataAliyunOssFe' => [
- // 'enable' => true,
- // ],
+ 'DataAliyunOssFe' => [
+ 'enable' => true,
+ ],
// 'Recommend' => [
// 'enable' => true,
// ],
diff --git a/module/DataAliyunOssFe/Admin/Controller/ConfigController.php b/module/DataAliyunOssFe/Admin/Controller/ConfigController.php
new file mode 100644
index 000000000..e169a3cc1
--- /dev/null
+++ b/module/DataAliyunOssFe/Admin/Controller/ConfigController.php
@@ -0,0 +1,126 @@
+pageTitle('阿里云OSS存储(前端直传)');
+ /** @var HasFields $builder */
+ $builder->layoutPanel('公共配置', function ($builder) {
+ /** @var HasFields $builder */
+ $builder->switch('DataAliyunOssFe_Enable', '启用');
+ $builder->select('DataAliyunOssFe_Region', '地区')
+ ->options([
+ 'cn-hangzhou' => '华东1(杭州)',
+ 'cn-shanghai' => '华东2(上海)',
+ 'cn-qingdao' => '华北1(青岛)',
+ 'cn-beijing' => '华北2(北京)',
+ 'cn-zhangjiakou' => '华北3(张家口)',
+ 'cn-huhehaote' => '华北5(呼和浩特)',
+ 'cn-shenzhen' => '华南1(深圳)',
+ 'cn-hongkong' => '中国(香港)',
+ 'ap-southeast-1' => '亚太东南1(新加坡)',
+ 'ap-southeast-2' => '亚太东南2(悉尼)',
+ 'ap-southeast-3' => '亚太东南3(吉隆坡)',
+ 'ap-southeast-5' => '亚太东南5(雅加达)',
+ 'ap-south-1' => '亚太南部1(孟买)',
+ 'ap-northeast-1' => '亚太东北1(东京)',
+ 'ap-northeast-2' => '亚太东北2(首尔)',
+ 'ap-south-1' => '亚太南部1(孟买)',
+ 'eu-central-1' => '欧洲中部1(法兰克福)',
+ 'eu-west-1' => '欧洲西部1(伦敦)',
+ 'me-east-1' => '中东东部1(迪拜)',
+ 'us-west-1' => '美国西部1(硅谷)',
+ 'us-east-1' => '美国东部1(弗吉尼亚)',
+ 'ap-northeast-1' => '亚太东北1(东京)',
+ 'ap-southeast-1' => '亚太东南1(新加坡)',
+ 'ap-southeast-2' => '亚太东南2(悉尼)',
+ ]);
+ $builder->text('DataAliyunOssFe_Bucket', 'Bucket');
+ $builder->text('DataAliyunOssFe_Endpoint', 'Endpoint')
+ ->help('格式为 oss-cn-xxx.aliyuncs.com');
+ $builder->text('DataAliyunOssFe_Domain', 'Bucket域名')
+ ->help('如果您的OSS开启了CDN加速,可直接配置CDN域名(如 http://xxx.oss-cn-xxx.aliyuncs.com)')
+ ->ruleUrl();
+ });
+
+ $builder->layoutPanel('服务端配置', function ($builder) {
+ /** @var HasFields $builder */
+
+ $builder->html('', '配置说明')->htmlContentFromMarkdown(
+ '
+**用于 OSS 文件的增删改查管理**
+
+需要开通 OSS 上传权限,权限策略参考内容如下:
+
+```
+{
+ "Version": "1",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Action": [
+ "oss:Get*",
+ "oss:Put*",
+ "oss:DeleteObject"
+ ],
+ "Resource": [
+ "acs:oss:*:*:test-oss",
+ "acs:oss:*:*:test-oss/*"
+ ]
+ }
+ ]
+}
+```
+'
+ );
+ $builder->text('DataAliyunOssFe_AccessKeyId', 'AccessKeyId');
+ $builder->text('DataAliyunOssFe_AccessKeySecret', 'AccessKeySecret');
+ });
+
+ $builder->layoutPanel('前端配置', function ($builder) {
+ /** @var HasFields $builder */
+ $builder->html('', '账号说明')->htmlContentFromMarkdown(
+ '
+**用户前端受限的上传权限**
+
+需要开通
+
+① OSS 上传权限,权限策略参考内容如下:
+
+```json
+{
+ "Version": "1",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Action": "oss:PutObject",
+ "Resource": "acs:oss:*:*:test-oss/data_temp/*"
+ }
+ ]
+}
+```
+
+② STS 服务权限
+
+需要开通 AliyunSTSAssumeRoleAccess 系统策略。
+'
+ );
+ $builder->text('DataAliyunOssFe_Front_AccessKeyId', 'AccessKeyId');
+ $builder->text('DataAliyunOssFe_Front_AccessKeySecret', 'AccessKeySecret');
+ $builder->text('DataAliyunOssFe_Front_StsEndpoint', 'StsEndpoint')
+ ->help('例如 sts.cn-shanghai.aliyuncs.com ,查看对应地区 Endpoint');
+ $builder->text('DataAliyunOssFe_Front_RoleArn', 'RoleArn')
+ ->help('例如 acs:ram::148316xxxxxxxxx:role/ms-oss-test-fe');
+ });
+
+ $builder->formClass('wide');
+ return $builder->perform();
+ }
+}
diff --git a/module/DataAliyunOssFe/Admin/routes.php b/module/DataAliyunOssFe/Admin/routes.php
new file mode 100644
index 000000000..0bdb09ab4
--- /dev/null
+++ b/module/DataAliyunOssFe/Admin/routes.php
@@ -0,0 +1,6 @@
+match(['get', 'post'], 'data_aliyun_oss_fe/config', 'ConfigController@index');
+
diff --git a/module/DataAliyunOssFe/Core/DataAliyunOssFeDataStorage.php b/module/DataAliyunOssFe/Core/DataAliyunOssFeDataStorage.php
new file mode 100644
index 000000000..6a4c4d8f0
--- /dev/null
+++ b/module/DataAliyunOssFe/Core/DataAliyunOssFeDataStorage.php
@@ -0,0 +1,225 @@
+client = new OssClient(
+ $this->option['accessKeyId'],
+ $this->option['accessKeySecret'],
+ $this->option['endpoint']
+ );
+ $this->bucket = $this->option['bucket'];
+ }
+
+ public function driverName()
+ {
+ return 'AliyunOss';
+ }
+
+
+ public function has($file)
+ {
+ try {
+ $ret = $this->client->getObjectMeta($this->bucket, $file);
+ if (empty($ret['etag'])) {
+ return false;
+ }
+ return true;
+ } catch (\Exception $e) {
+ return false;
+ }
+ }
+
+ public function move($from, $to)
+ {
+ try {
+ $this->client->copyObject($this->bucket, $from, $this->bucket, $to);
+ } catch (OssException $e) {
+ if (str_contains($e->getMessage(), 'NoSuchKey')) {
+ } else {
+ throw $e;
+ }
+ }
+ try {
+ $this->client->deleteObject($this->bucket, $from);
+ } catch (\Exception $e) {
+ if (str_contains($e->getMessage(), 'NoSuchKey')) {
+ } else {
+ throw $e;
+ }
+ }
+ }
+
+ public function delete($file)
+ {
+ try {
+ $ret = $this->client->deleteObject($this->bucket, $file);
+ } catch (\Exception $e) {
+ if (str_contains($e->getMessage(), 'NoSuchKey')) {
+ } else {
+ throw $e;
+ }
+ }
+ }
+
+ public function put($file, $content)
+ {
+ $this->client->putObject($this->bucket, $file, $content);
+ }
+
+ public function get($file)
+ {
+ return $this->client->getObject($this->bucket, $file);
+ }
+
+ public function size($file)
+ {
+ try {
+ $ret = $this->client->getObjectMeta($this->bucket, $file);
+ return intval($ret['content-length']);
+ } catch (\Exception $e) {
+ return 0;
+ }
+ }
+
+ public function getUploadConfig()
+ {
+ return Cache::remember('DataAliyunOssFe:Config', 30, function () {
+ DataAliyunOssFeUtil::init();
+ $bucket = modstart_config('DataAliyunOssFe_Bucket');
+ $config = new Config([
+ "accessKeyId" => modstart_config('DataAliyunOssFe_Front_AccessKeyId'),
+ "accessKeySecret" => modstart_config('DataAliyunOssFe_Front_AccessKeySecret'),
+ ]);
+
+ $config->endpoint = modstart_config('DataAliyunOssFe_Front_StsEndpoint');
+ $client = new Sts($config);
+
+ $assumeRoleRequest = new AssumeRoleRequest([
+ // roleArn填写步骤2获取的角色ARN
+ "roleArn" => modstart_config('DataAliyunOssFe_Front_RoleArn'),
+ // roleSessionName用于自定义角色会话名称,用来区分不同的令牌,例如填写为sessiontest。
+ "roleSessionName" => "upload-to-data-temp",
+ // durationSeconds用于设置临时访问凭证有效时间单位为秒,最小值为900,最大值以当前角色设定的最大会话时间为准。本示例指定有效时间为3000秒。
+ "durationSeconds" => 3600,
+ // policy填写自定义权限策略,用于进一步限制STS临时访问凭证的权限。
+ // 如果不指定Policy,则返回的STS临时访问凭证默认拥有指定角色的所有权限。
+ // 临时访问凭证最后获得的权限是步骤4设置的角色权限和该Policy设置权限的交集。
+ "policy" => '{
+ "Version": "1",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Action": "oss:PutObject",
+ "Resource": "acs:oss:*:*:' . $bucket . '/data_temp/*"
+ }
+ ]
+}',
+ ]);
+ $runtime = new RuntimeOptions([]);
+ $result = $client->assumeRoleWithOptions($assumeRoleRequest, $runtime);
+ return [
+ 'region' => 'oss-' . modstart_config('DataAliyunOssFe_Region'),
+ 'bucket' => $bucket,
+ 'accessKeyId' => $result->body->credentials->accessKeyId,
+ 'accessKeySecret' => $result->body->credentials->accessKeySecret,
+ 'securityToken' => $result->body->credentials->securityToken,
+ 'expiration' => $result->body->credentials->expiration,
+ ];
+ });
+ }
+
+ public function multiPartInit($param)
+ {
+ $token = $this->multiPartInitToken($param);
+ $this->uploadChunkTokenAndUpdateToken($token);
+ $token['uploadConfig'] = $this->getUploadConfig();
+ return Response::generateSuccessData($token);
+ }
+
+ public function multiPartUploadEnd($param)
+ {
+ $category = $param['category'];
+ $token = $this->multiPartInitToken($param);
+ BizException::throwsIfEmpty('DataAliyunOssFe.TokenEmpty', $token);
+ DataFileUploadedEvent::fire('AliyunOss', $category, $token['fullPath'], isset($param['eventOpt']) ? $param['eventOpt'] : []);
+ $dataTemp = $this->repository->addTemp($category, $token['path'], $token['name'], $token['size'], empty($token['md5']) ? null : $token['md5']);
+ $data['data'] = $dataTemp;
+ $data['path'] = $token['fullPath'];
+ $data['preview'] = $this->getDriverFullPath($token['fullPath']);
+ $data['finished'] = true;
+ $this->uploadChunkTokenAndDeleteToken($token);
+ return Response::generateSuccessData($data);
+ }
+
+ public function domain()
+ {
+ return modstart_config()->getWithEnv('DataAliyunOssFe_Domain');
+ }
+
+ public function domainInternal()
+ {
+ return modstart_config()->getWithEnv('DataAliyunOssFe_DomainInternal', modstart_config()->getWithEnv('DataAliyunOssFe_Domain'));
+ }
+
+
+ public function updateDriverDomain($data)
+ {
+ $update = [
+ 'driver' => 'AliyunOss',
+ 'domain' => $this->domain(),
+ ];
+ $this->repository->updateData($data['id'], $update);
+ return array_merge($data, $update);
+ }
+
+ public function getDriverFullPath($path)
+ {
+ $path = parent::getDriverFullPath($path);
+ if (PathUtil::isPublicNetPath($path)) {
+ return $path;
+ }
+ return $this->domain() . $path;
+ }
+
+ /**
+ * @param $path
+ * @return mixed|string
+ * @deprecated delete at 2024-04-25
+ */
+ public function getDriverFullPathInternal($path)
+ {
+ $path = parent::getDriverFullPathInternal($path);
+ if (PathUtil::isPublicNetPath($path)) {
+ return $path;
+ }
+ return $this->domainInternal() . $path;
+ }
+
+
+}
diff --git a/module/DataAliyunOssFe/Core/ModuleServiceProvider.php b/module/DataAliyunOssFe/Core/ModuleServiceProvider.php
new file mode 100644
index 000000000..ee4074803
--- /dev/null
+++ b/module/DataAliyunOssFe/Core/ModuleServiceProvider.php
@@ -0,0 +1,67 @@
+ L('Site Manage'),
+ 'icon' => 'cog',
+ 'sort' => 400,
+ 'children' => [
+ [
+ 'title' => '阿里云OSS存储(前端直传)',
+ 'url' => '\Module\DataAliyunOssFe\Admin\Controller\ConfigController@index',
+ ],
+ ]
+ ]
+ ];
+ });
+ if (modstart_config('DataAliyunOssFe_Enable', false)) {
+ $this->app['config']->set('DataStorageDriver', 'DataStorage_DataAliyunOssFe');
+ DataStorageType::register('DataAliyunOssFe', '阿里云OSS云存储(前端直传)');
+ $this->app->bind('DataStorage_DataAliyunOssFe', function () {
+ $option = [];
+ $option['accessKeyId'] = modstart_config()->getWithEnv('DataAliyunOssFe_AccessKeyId');
+ $option['accessKeySecret'] = modstart_config()->getWithEnv('DataAliyunOssFe_AccessKeySecret');
+ $option['endpoint'] = modstart_config()->getWithEnv('DataAliyunOssFe_Endpoint');
+ $option['bucket'] = modstart_config()->getWithEnv('DataAliyunOssFe_Bucket');
+ $storage = new DataAliyunOssFeDataStorage($option);
+ $storage->init();
+ return $storage;
+ });
+ }
+
+ ModStartHook::subscribe('UploadScript', function ($param = []) {
+ return RenderUtil::view('module::DataAliyunOssFe.View.inc.script', [
+ 'param' => $param,
+ ]);
+ });
+ }
+
+ /**
+ * Register any application services.
+ *
+ * @return void
+ */
+ public function register()
+ {
+
+ }
+}
diff --git a/module/DataAliyunOssFe/Docs/module/content.md b/module/DataAliyunOssFe/Docs/module/content.md
new file mode 100644
index 000000000..bd08c5b9d
--- /dev/null
+++ b/module/DataAliyunOssFe/Docs/module/content.md
@@ -0,0 +1,15 @@
+## 模块介绍
+
+阿里云OSS是优秀的第三方云存储提供商,该模块提供了全站系统上传支持存储到阿里云OSS的功能。
+
+## 功能特性
+
+- 全站文件上传支持
+- 大文件上传支持
+- 断点上传支持
+
+## 参考资料
+
+在使用阿里云OSS之前请先到阿里云添加 [OSS服务](https://www.aliyun.com/product/oss),具体开通方式可参考阿里云开通文档
+
+{ADMIN_MENUS}
diff --git a/module/DataAliyunOssFe/Docs/release.md b/module/DataAliyunOssFe/Docs/release.md
new file mode 100644
index 000000000..1c2a61f1d
--- /dev/null
+++ b/module/DataAliyunOssFe/Docs/release.md
@@ -0,0 +1,3 @@
+## 1.0.0 初版发布
+
+- 初版发布
diff --git a/module/DataAliyunOssFe/SDK/vendor/adbario/php-dot-notation/src/Dot.php b/module/DataAliyunOssFe/SDK/vendor/adbario/php-dot-notation/src/Dot.php
new file mode 100644
index 000000000..3cd1c5017
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/adbario/php-dot-notation/src/Dot.php
@@ -0,0 +1,623 @@
+
+ * @link https://github.com/adbario/php-dot-notation
+ * @license https://github.com/adbario/php-dot-notation/blob/2.x/LICENSE.md (MIT License)
+ */
+namespace Adbar;
+
+use Countable;
+use ArrayAccess;
+use ArrayIterator;
+use JsonSerializable;
+use IteratorAggregate;
+
+/**
+ * Dot
+ *
+ * This class provides a dot notation access and helper functions for
+ * working with arrays of data. Inspired by Laravel Collection.
+ */
+class Dot implements ArrayAccess, Countable, IteratorAggregate, JsonSerializable
+{
+ /**
+ * The stored items
+ *
+ * @var array
+ */
+ protected $items = [];
+
+
+ /**
+ * The delimiter (alternative to a '.') to be used.
+ *
+ * @var string
+ */
+ protected $delimiter = '.';
+
+
+ /**
+ * Create a new Dot instance
+ *
+ * @param mixed $items
+ * @param string $delimiter
+ */
+ public function __construct($items = [], $delimiter = '.')
+ {
+ $this->items = $this->getArrayItems($items);
+ $this->delimiter = strlen($delimiter) ? $delimiter : '.';
+ }
+
+ /**
+ * Set a given key / value pair or pairs
+ * if the key doesn't exist already
+ *
+ * @param array|int|string $keys
+ * @param mixed $value
+ */
+ public function add($keys, $value = null)
+ {
+ if (is_array($keys)) {
+ foreach ($keys as $key => $value) {
+ $this->add($key, $value);
+ }
+ } elseif (is_null($this->get($keys))) {
+ $this->set($keys, $value);
+ }
+ }
+
+ /**
+ * Return all the stored items
+ *
+ * @return array
+ */
+ public function all()
+ {
+ return $this->items;
+ }
+
+ /**
+ * Delete the contents of a given key or keys
+ *
+ * @param array|int|string|null $keys
+ */
+ public function clear($keys = null)
+ {
+ if (is_null($keys)) {
+ $this->items = [];
+
+ return;
+ }
+
+ $keys = (array) $keys;
+
+ foreach ($keys as $key) {
+ $this->set($key, []);
+ }
+ }
+
+ /**
+ * Delete the given key or keys
+ *
+ * @param array|int|string $keys
+ */
+ public function delete($keys)
+ {
+ $keys = (array) $keys;
+
+ foreach ($keys as $key) {
+ if ($this->exists($this->items, $key)) {
+ unset($this->items[$key]);
+
+ continue;
+ }
+
+ $items = &$this->items;
+ $segments = explode($this->delimiter, $key);
+ $lastSegment = array_pop($segments);
+
+ foreach ($segments as $segment) {
+ if (!isset($items[$segment]) || !is_array($items[$segment])) {
+ continue 2;
+ }
+
+ $items = &$items[$segment];
+ }
+
+ unset($items[$lastSegment]);
+ }
+ }
+
+ /**
+ * Checks if the given key exists in the provided array.
+ *
+ * @param array $array Array to validate
+ * @param int|string $key The key to look for
+ *
+ * @return bool
+ */
+ protected function exists($array, $key)
+ {
+ return array_key_exists($key, $array);
+ }
+
+ /**
+ * Flatten an array with the given character as a key delimiter
+ *
+ * @param string $delimiter
+ * @param array|null $items
+ * @param string $prepend
+ * @return array
+ */
+ public function flatten($delimiter = '.', $items = null, $prepend = '')
+ {
+ $flatten = [];
+
+ if (is_null($items)) {
+ $items = $this->items;
+ }
+
+ if (!func_num_args()) {
+ $delimiter = $this->delimiter;
+ }
+
+ foreach ($items as $key => $value) {
+ if (is_array($value) && !empty($value)) {
+ $flatten = array_merge(
+ $flatten,
+ $this->flatten($delimiter, $value, $prepend.$key.$delimiter)
+ );
+ } else {
+ $flatten[$prepend.$key] = $value;
+ }
+ }
+
+ return $flatten;
+ }
+
+ /**
+ * Return the value of a given key
+ *
+ * @param int|string|null $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function get($key = null, $default = null)
+ {
+ if (is_null($key)) {
+ return $this->items;
+ }
+
+ if ($this->exists($this->items, $key)) {
+ return $this->items[$key];
+ }
+
+ if (strpos($key, $this->delimiter) === false) {
+ return $default;
+ }
+
+ $items = $this->items;
+
+ foreach (explode($this->delimiter, $key) as $segment) {
+ if (!is_array($items) || !$this->exists($items, $segment)) {
+ return $default;
+ }
+
+ $items = &$items[$segment];
+ }
+
+ return $items;
+ }
+
+ /**
+ * Return the given items as an array
+ *
+ * @param mixed $items
+ * @return array
+ */
+ protected function getArrayItems($items)
+ {
+ if (is_array($items)) {
+ return $items;
+ } elseif ($items instanceof self) {
+ return $items->all();
+ }
+
+ return (array) $items;
+ }
+
+ /**
+ * Check if a given key or keys exists
+ *
+ * @param array|int|string $keys
+ * @return bool
+ */
+ public function has($keys)
+ {
+ $keys = (array) $keys;
+
+ if (!$this->items || $keys === []) {
+ return false;
+ }
+
+ foreach ($keys as $key) {
+ $items = $this->items;
+
+ if ($this->exists($items, $key)) {
+ continue;
+ }
+
+ foreach (explode($this->delimiter, $key) as $segment) {
+ if (!is_array($items) || !$this->exists($items, $segment)) {
+ return false;
+ }
+
+ $items = $items[$segment];
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Check if a given key or keys are empty
+ *
+ * @param array|int|string|null $keys
+ * @return bool
+ */
+ public function isEmpty($keys = null)
+ {
+ if (is_null($keys)) {
+ return empty($this->items);
+ }
+
+ $keys = (array) $keys;
+
+ foreach ($keys as $key) {
+ if (!empty($this->get($key))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Merge a given array or a Dot object with the given key
+ * or with the whole Dot object
+ *
+ * @param array|string|self $key
+ * @param array|self $value
+ */
+ public function merge($key, $value = [])
+ {
+ if (is_array($key)) {
+ $this->items = array_merge($this->items, $key);
+ } elseif (is_string($key)) {
+ $items = (array) $this->get($key);
+ $value = array_merge($items, $this->getArrayItems($value));
+
+ $this->set($key, $value);
+ } elseif ($key instanceof self) {
+ $this->items = array_merge($this->items, $key->all());
+ }
+ }
+
+ /**
+ * Recursively merge a given array or a Dot object with the given key
+ * or with the whole Dot object.
+ *
+ * Duplicate keys are converted to arrays.
+ *
+ * @param array|string|self $key
+ * @param array|self $value
+ */
+ public function mergeRecursive($key, $value = [])
+ {
+ if (is_array($key)) {
+ $this->items = array_merge_recursive($this->items, $key);
+ } elseif (is_string($key)) {
+ $items = (array) $this->get($key);
+ $value = array_merge_recursive($items, $this->getArrayItems($value));
+
+ $this->set($key, $value);
+ } elseif ($key instanceof self) {
+ $this->items = array_merge_recursive($this->items, $key->all());
+ }
+ }
+
+ /**
+ * Recursively merge a given array or a Dot object with the given key
+ * or with the whole Dot object.
+ *
+ * Instead of converting duplicate keys to arrays, the value from
+ * given array will replace the value in Dot object.
+ *
+ * @param array|string|self $key
+ * @param array|self $value
+ */
+ public function mergeRecursiveDistinct($key, $value = [])
+ {
+ if (is_array($key)) {
+ $this->items = $this->arrayMergeRecursiveDistinct($this->items, $key);
+ } elseif (is_string($key)) {
+ $items = (array) $this->get($key);
+ $value = $this->arrayMergeRecursiveDistinct($items, $this->getArrayItems($value));
+
+ $this->set($key, $value);
+ } elseif ($key instanceof self) {
+ $this->items = $this->arrayMergeRecursiveDistinct($this->items, $key->all());
+ }
+ }
+
+ /**
+ * Merges two arrays recursively. In contrast to array_merge_recursive,
+ * duplicate keys are not converted to arrays but rather overwrite the
+ * value in the first array with the duplicate value in the second array.
+ *
+ * @param array $array1 Initial array to merge
+ * @param array $array2 Array to recursively merge
+ * @return array
+ */
+ protected function arrayMergeRecursiveDistinct(array $array1, array $array2)
+ {
+ $merged = &$array1;
+
+ foreach ($array2 as $key => $value) {
+ if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {
+ $merged[$key] = $this->arrayMergeRecursiveDistinct($merged[$key], $value);
+ } else {
+ $merged[$key] = $value;
+ }
+ }
+
+ return $merged;
+ }
+
+ /**
+ * Return the value of a given key and
+ * delete the key
+ *
+ * @param int|string|null $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function pull($key = null, $default = null)
+ {
+ if (is_null($key)) {
+ $value = $this->all();
+ $this->clear();
+
+ return $value;
+ }
+
+ $value = $this->get($key, $default);
+ $this->delete($key);
+
+ return $value;
+ }
+
+ /**
+ * Push a given value to the end of the array
+ * in a given key
+ *
+ * @param mixed $key
+ * @param mixed $value
+ */
+ public function push($key, $value = null)
+ {
+ if (is_null($value)) {
+ $this->items[] = $key;
+
+ return;
+ }
+
+ $items = $this->get($key);
+
+ if (is_array($items) || is_null($items)) {
+ $items[] = $value;
+ $this->set($key, $items);
+ }
+ }
+
+ /**
+ * Replace all values or values within the given key
+ * with an array or Dot object
+ *
+ * @param array|string|self $key
+ * @param array|self $value
+ */
+ public function replace($key, $value = [])
+ {
+ if (is_array($key)) {
+ $this->items = array_replace($this->items, $key);
+ } elseif (is_string($key)) {
+ $items = (array) $this->get($key);
+ $value = array_replace($items, $this->getArrayItems($value));
+
+ $this->set($key, $value);
+ } elseif ($key instanceof self) {
+ $this->items = array_replace($this->items, $key->all());
+ }
+ }
+
+ /**
+ * Set a given key / value pair or pairs
+ *
+ * @param array|int|string $keys
+ * @param mixed $value
+ */
+ public function set($keys, $value = null)
+ {
+ if (is_array($keys)) {
+ foreach ($keys as $key => $value) {
+ $this->set($key, $value);
+ }
+
+ return;
+ }
+
+ $items = &$this->items;
+
+ foreach (explode($this->delimiter, $keys) as $key) {
+ if (!isset($items[$key]) || !is_array($items[$key])) {
+ $items[$key] = [];
+ }
+
+ $items = &$items[$key];
+ }
+
+ $items = $value;
+ }
+
+ /**
+ * Replace all items with a given array
+ *
+ * @param mixed $items
+ */
+ public function setArray($items)
+ {
+ $this->items = $this->getArrayItems($items);
+ }
+
+ /**
+ * Replace all items with a given array as a reference
+ *
+ * @param array $items
+ */
+ public function setReference(array &$items)
+ {
+ $this->items = &$items;
+ }
+
+ /**
+ * Return the value of a given key or all the values as JSON
+ *
+ * @param mixed $key
+ * @param int $options
+ * @return string
+ */
+ public function toJson($key = null, $options = 0)
+ {
+ if (is_string($key)) {
+ return json_encode($this->get($key), $options);
+ }
+
+ $options = $key === null ? 0 : $key;
+
+ return json_encode($this->items, $options);
+ }
+
+ /*
+ * --------------------------------------------------------------
+ * ArrayAccess interface
+ * --------------------------------------------------------------
+ */
+
+ /**
+ * Check if a given key exists
+ *
+ * @param int|string $key
+ * @return bool
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetExists($key)
+ {
+ return $this->has($key);
+ }
+
+ /**
+ * Return the value of a given key
+ *
+ * @param int|string $key
+ * @return mixed
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($key)
+ {
+ return $this->get($key);
+ }
+
+ /**
+ * Set a given value to the given key
+ *
+ * @param int|string|null $key
+ * @param mixed $value
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetSet($key, $value)
+ {
+ if (is_null($key)) {
+ $this->items[] = $value;
+
+ return;
+ }
+
+ $this->set($key, $value);
+ }
+
+ /**
+ * Delete the given key
+ *
+ * @param int|string $key
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetUnset($key)
+ {
+ $this->delete($key);
+ }
+
+ /*
+ * --------------------------------------------------------------
+ * Countable interface
+ * --------------------------------------------------------------
+ */
+
+ /**
+ * Return the number of items in a given key
+ *
+ * @param int|string|null $key
+ * @return int
+ */
+ #[\ReturnTypeWillChange]
+ public function count($key = null)
+ {
+ return count($this->get($key));
+ }
+
+ /*
+ * --------------------------------------------------------------
+ * IteratorAggregate interface
+ * --------------------------------------------------------------
+ */
+
+ /**
+ * Get an iterator for the stored items
+ *
+ * @return \ArrayIterator
+ */
+ #[\ReturnTypeWillChange]
+ public function getIterator()
+ {
+ return new ArrayIterator($this->items);
+ }
+
+ /*
+ * --------------------------------------------------------------
+ * JsonSerializable interface
+ * --------------------------------------------------------------
+ */
+
+ /**
+ * Return items for JSON serialization
+ *
+ * @return array
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return $this->items;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/adbario/php-dot-notation/src/helpers.php b/module/DataAliyunOssFe/SDK/vendor/adbario/php-dot-notation/src/helpers.php
new file mode 100644
index 000000000..bebb9527d
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/adbario/php-dot-notation/src/helpers.php
@@ -0,0 +1,24 @@
+
+ * @link https://github.com/adbario/php-dot-notation
+ * @license https://github.com/adbario/php-dot-notation/blob/2.x/LICENSE.md (MIT License)
+ */
+
+use Adbar\Dot;
+
+if (! function_exists('dot')) {
+ /**
+ * Create a new Dot object with the given items and optional delimiter
+ *
+ * @param mixed $items
+ * @param string $delimiter
+ * @return \Adbar\Dot
+ */
+ function dot($items, $delimiter = '.')
+ {
+ return new Dot($items, $delimiter);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/AccessKeyCredential.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/AccessKeyCredential.php
new file mode 100644
index 000000000..6d7d7c97e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/AccessKeyCredential.php
@@ -0,0 +1,72 @@
+accessKeyId = $access_key_id;
+ $this->accessKeySecret = $access_key_secret;
+ }
+
+ /**
+ * @return string
+ */
+ public function getAccessKeyId()
+ {
+ return $this->accessKeyId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getAccessKeySecret()
+ {
+ return $this->accessKeySecret;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return "$this->accessKeyId#$this->accessKeySecret";
+ }
+
+ /**
+ * @return ShaHmac1Signature
+ */
+ public function getSignature()
+ {
+ return new ShaHmac1Signature();
+ }
+
+ public function getSecurityToken()
+ {
+ return '';
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/BearerTokenCredential.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/BearerTokenCredential.php
new file mode 100644
index 000000000..c38fb8c2c
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/BearerTokenCredential.php
@@ -0,0 +1,53 @@
+bearerToken = $bearer_token;
+ }
+
+ /**
+ * @return string
+ */
+ public function getBearerToken()
+ {
+ return $this->bearerToken;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return "bearerToken#$this->bearerToken";
+ }
+
+ /**
+ * @return BearerTokenSignature
+ */
+ public function getSignature()
+ {
+ return new BearerTokenSignature();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credential.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credential.php
new file mode 100644
index 000000000..3916c1d61
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credential.php
@@ -0,0 +1,183 @@
+ AccessKeyCredential::class,
+ 'sts' => StsCredential::class,
+ 'ecs_ram_role' => EcsRamRoleCredential::class,
+ 'ram_role_arn' => RamRoleArnCredential::class,
+ 'rsa_key_pair' => RsaKeyPairCredential::class,
+ 'bearer' => BearerTokenCredential::class,
+ ];
+
+ /**
+ * @var AccessKeyCredential|BearerTokenCredential|EcsRamRoleCredential|RamRoleArnCredential|RsaKeyPairCredential
+ */
+ protected $credential;
+
+ /**
+ * @var string
+ */
+ protected $type;
+
+ /**
+ * Credential constructor.
+ *
+ * @param array|Config $config
+ *
+ * @throws ReflectionException
+ */
+ public function __construct($config = [])
+ {
+ if ($config instanceof Config) {
+ $config = $this->parse($config);
+ }
+ if ($config !== []) {
+ $this->config = array_change_key_case($config);
+ $this->parseConfig();
+ } else {
+ $this->credential = Credentials::get()->getCredential();
+ }
+ }
+
+ /**
+ * @param Config $config
+ *
+ * @return array
+ */
+ private function parse($config)
+ {
+ $config = get_object_vars($config);
+ $res = [];
+ foreach ($config as $key => $value) {
+ $res[$this->toUnderScore($key)] = $value;
+ }
+ return $res;
+ }
+
+ private function toUnderScore($str)
+ {
+ $dstr = preg_replace_callback('/([A-Z]+)/', function ($matchs) {
+ return '_' . strtolower($matchs[0]);
+ }, $str);
+ return trim(preg_replace('/_{2,}/', '_', $dstr), '_');
+ }
+
+ /**
+ * @throws ReflectionException
+ */
+ private function parseConfig()
+ {
+ if (!isset($this->config['type'])) {
+ throw new InvalidArgumentException('Missing required type option');
+ }
+
+ $this->type = $this->config['type'];
+ if (!isset($this->types[$this->type])) {
+ throw new InvalidArgumentException(
+ 'Invalid type option, support: ' .
+ implode(', ', array_keys($this->types))
+ );
+ }
+
+ $class = new ReflectionClass($this->types[$this->type]);
+ $parameters = [];
+ /**
+ * @var $parameter ReflectionParameter
+ */
+ foreach ($class->getConstructor()->getParameters() as $parameter) {
+ $parameters[] = $this->getValue($parameter);
+ }
+
+ $this->credential = $class->newInstance(...$parameters);
+ }
+
+ /**
+ * @param ReflectionParameter $parameter
+ *
+ * @return string|array
+ * @throws ReflectionException
+ */
+ protected function getValue(ReflectionParameter $parameter)
+ {
+ if ($parameter->name === 'config' || $parameter->name === 'credential') {
+ return $this->config;
+ }
+
+ foreach ($this->config as $key => $value) {
+ if (strtolower($parameter->name) === $key) {
+ return $value;
+ }
+ }
+
+ if ($parameter->isDefaultValueAvailable()) {
+ return $parameter->getDefaultValue();
+ }
+
+ throw new InvalidArgumentException("Missing required {$parameter->name} option in config for {$this->type}");
+ }
+
+ /**
+ * @return AccessKeyCredential|BearerTokenCredential|EcsRamRoleCredential|RamRoleArnCredential|RsaKeyPairCredential
+ */
+ public function getCredential()
+ {
+ return $this->credential;
+ }
+
+ /**
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+
+ /**
+ * @param string $name
+ * @param array $arguments
+ *
+ * @return mixed
+ */
+ public function __call($name, $arguments)
+ {
+ return $this->credential->$name($arguments);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credential/Config.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credential/Config.php
new file mode 100644
index 000000000..3fa1608da
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credential/Config.php
@@ -0,0 +1,50 @@
+ $v) {
+ $this->{$k} = $v;
+ }
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credentials.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credentials.php
new file mode 100644
index 000000000..11e68abff
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Credentials.php
@@ -0,0 +1,102 @@
+roleName = $role_name;
+ }
+
+ /**
+ * @return string
+ * @throws GuzzleException
+ * @throws Exception
+ */
+ public function getRoleName()
+ {
+ if ($this->roleName !== null) {
+ return $this->roleName;
+ }
+
+ $this->roleName = $this->getRoleNameFromMeta();
+
+ return $this->roleName;
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ */
+ public function getRoleNameFromMeta()
+ {
+ $options = [
+ 'http_errors' => false,
+ 'timeout' => 1,
+ 'connect_timeout' => 1,
+ ];
+
+ $result = Request::createClient()->request(
+ 'GET',
+ 'http://100.100.100.200/latest/meta-data/ram/security-credentials/',
+ $options
+ );
+
+ if ($result->getStatusCode() === 404) {
+ throw new InvalidArgumentException('The role name was not found in the instance');
+ }
+
+ if ($result->getStatusCode() !== 200) {
+ throw new RuntimeException('Error retrieving credentials from result: ' . $result->getBody());
+ }
+
+ $role_name = (string)$result;
+ if (!$role_name) {
+ throw new RuntimeException('Error retrieving credentials from result is empty');
+ }
+
+ return $role_name;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return "roleName#$this->roleName";
+ }
+
+ /**
+ * @return ShaHmac1Signature
+ */
+ public function getSignature()
+ {
+ return new ShaHmac1Signature();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getAccessKeyId()
+ {
+ return $this->getSessionCredential()->getAccessKeyId();
+ }
+
+ /**
+ * @return StsCredential
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ protected function getSessionCredential()
+ {
+ return (new EcsRamRoleProvider($this))->get();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getAccessKeySecret()
+ {
+ return $this->getSessionCredential()->getAccessKeySecret();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getSecurityToken()
+ {
+ return $this->getSessionCredential()->getSecurityToken();
+ }
+
+ /**
+ * @return int
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getExpiration()
+ {
+ return $this->getSessionCredential()->getExpiration();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Filter.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Filter.php
new file mode 100644
index 000000000..61b39e0ad
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Filter.php
@@ -0,0 +1,134 @@
+ $value) {
+ if (is_int($key)) {
+ $result[] = $value;
+ continue;
+ }
+
+ if (isset($result[$key]) && is_array($result[$key])) {
+ $result[$key] = self::merge(
+ [$result[$key], $value]
+ );
+ continue;
+ }
+
+ $result[$key] = $value;
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param $filename
+ *
+ * @return bool
+ */
+ public static function inOpenBasedir($filename)
+ {
+ $open_basedir = ini_get('open_basedir');
+ if (!$open_basedir) {
+ return true;
+ }
+
+ $dirs = explode(PATH_SEPARATOR, $open_basedir);
+
+ return empty($dirs) || self::inDir($filename, $dirs);
+ }
+
+ /**
+ * @param string $filename
+ * @param array $dirs
+ *
+ * @return bool
+ */
+ public static function inDir($filename, array $dirs)
+ {
+ foreach ($dirs as $dir) {
+ if ($dir[strlen($dir) - 1] !== DIRECTORY_SEPARATOR) {
+ $dir .= DIRECTORY_SEPARATOR;
+ }
+
+ if (0 === strpos($filename, $dir)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @return bool
+ */
+ public static function isWindows()
+ {
+ return PATH_SEPARATOR === ';';
+ }
+
+ /**
+ * @param $key
+ *
+ * @return bool|mixed
+ */
+ public static function envNotEmpty($key)
+ {
+ $value = self::env($key, false);
+ if ($value) {
+ return $value;
+ }
+
+ return false;
+ }
+
+ /**
+ * Gets the value of an environment variable.
+ *
+ * @param string $key
+ * @param mixed $default
+ *
+ * @return mixed
+ */
+ public static function env($key, $default = null)
+ {
+ $value = getenv($key);
+
+ if ($value === false) {
+ return self::value($default);
+ }
+
+ if (self::envSubstr($value)) {
+ return substr($value, 1, -1);
+ }
+
+ return self::envConversion($value);
+ }
+
+ /**
+ * Return the default value of the given value.
+ *
+ * @param mixed $value
+ *
+ * @return mixed
+ */
+ public static function value($value)
+ {
+ return $value instanceof Closure ? $value() : $value;
+ }
+
+ /**
+ * @param $value
+ *
+ * @return bool
+ */
+ public static function envSubstr($value)
+ {
+ return ($valueLength = strlen($value)) > 1
+ && strpos($value, '"') === 0
+ && $value[$valueLength - 1] === '"';
+ }
+
+ /**
+ * @param $value
+ *
+ * @return bool|string|null
+ */
+ public static function envConversion($value)
+ {
+ $key = strtolower($value);
+
+ if ($key === 'null' || $key === '(null)') {
+ return null;
+ }
+
+ $list = [
+ 'true' => true,
+ '(true)' => true,
+ 'false' => false,
+ '(false)' => false,
+ 'empty' => '',
+ '(empty)' => '',
+ ];
+
+ return isset($list[$key]) ? $list[$key] : $value;
+ }
+
+ /**
+ * Gets the environment's HOME directory.
+ *
+ * @return null|string
+ */
+ public static function getHomeDirectory()
+ {
+ if (getenv('HOME')) {
+ return getenv('HOME');
+ }
+
+ return (getenv('HOMEDRIVE') && getenv('HOMEPATH'))
+ ? getenv('HOMEDRIVE') . getenv('HOMEPATH')
+ : null;
+ }
+
+ /**
+ * @param mixed ...$parameters
+ *
+ * @codeCoverageIgnore
+ */
+ public static function dd(...$parameters)
+ {
+ dump(...$parameters);
+ exit;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/MockTrait.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/MockTrait.php
new file mode 100644
index 000000000..a590ac78a
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/MockTrait.php
@@ -0,0 +1,98 @@
+ 'access_key',
+ 'access_key_id' => $accessKeyId,
+ 'access_key_secret' => $accessKeySecret,
+ ]
+ );
+ }
+ };
+ }
+
+ /**
+ * @return string
+ */
+ public static function getDefaultName()
+ {
+ $name = Helper::envNotEmpty('ALIBABA_CLOUD_PROFILE');
+
+ if ($name) {
+ return $name;
+ }
+
+ return 'default';
+ }
+
+ /**
+ * @return Closure
+ */
+ public static function ini()
+ {
+ return static function () {
+ $filename = Helper::envNotEmpty('ALIBABA_CLOUD_CREDENTIALS_FILE');
+ if (!$filename) {
+ $filename = self::getDefaultFile();
+ }
+
+ if (!Helper::inOpenBasedir($filename)) {
+ return;
+ }
+
+ if ($filename !== self::getDefaultFile() && (!\is_readable($filename) || !\is_file($filename))) {
+ throw new RuntimeException(
+ 'Credentials file is not readable: ' . $filename
+ );
+ }
+
+ $file_array = \parse_ini_file($filename, true);
+
+ if (\is_array($file_array) && !empty($file_array)) {
+ foreach (\array_change_key_case($file_array) as $name => $configures) {
+ Credentials::set($name, $configures);
+ }
+ }
+ };
+ }
+
+ /**
+ * Get the default credential file.
+ *
+ * @return string
+ */
+ public static function getDefaultFile()
+ {
+ return Helper::getHomeDirectory() .
+ DIRECTORY_SEPARATOR .
+ '.alibabacloud' .
+ DIRECTORY_SEPARATOR .
+ 'credentials';
+ }
+
+ /**
+ * @return Closure
+ */
+ public static function instance()
+ {
+ return static function () {
+ $instance = Helper::envNotEmpty('ALIBABA_CLOUD_ECS_METADATA');
+ if ($instance) {
+ Credentials::set(
+ self::getDefaultName(),
+ [
+ 'type' => 'ecs_ram_role',
+ 'role_name' => $instance,
+ ]
+ );
+ }
+ };
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/EcsRamRoleProvider.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/EcsRamRoleProvider.php
new file mode 100644
index 000000000..828bdadef
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/EcsRamRoleProvider.php
@@ -0,0 +1,94 @@
+getCredentialsInCache();
+
+ if ($result === null) {
+ $result = $this->request();
+
+ if (!isset($result['AccessKeyId'], $result['AccessKeySecret'], $result['SecurityToken'])) {
+ throw new RuntimeException($this->error);
+ }
+
+ $this->cache($result->toArray());
+ }
+
+ return new StsCredential(
+ $result['AccessKeyId'],
+ $result['AccessKeySecret'],
+ strtotime($result['Expiration']),
+ $result['SecurityToken']
+ );
+ }
+
+ /**
+ * Get credentials by request.
+ *
+ * @return ResponseInterface
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function request()
+ {
+ $credential = $this->credential;
+ $url = $this->uri . $credential->getRoleName();
+
+ $options = [
+ 'http_errors' => false,
+ 'timeout' => 1,
+ 'connect_timeout' => 1,
+ ];
+
+ $result = Request::createClient()->request('GET', $url, $options);
+
+ if ($result->getStatusCode() === 404) {
+ $message = 'The role was not found in the instance';
+ throw new InvalidArgumentException($message);
+ }
+
+ if ($result->getStatusCode() !== 200) {
+ throw new RuntimeException('Error retrieving credentials from result: ' . $result->toJson());
+ }
+
+ return $result;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/Provider.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/Provider.php
new file mode 100644
index 000000000..e1e869d54
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/Provider.php
@@ -0,0 +1,82 @@
+credential = $credential;
+ $this->config = $config;
+ }
+
+ /**
+ * Get the credentials from the cache in the validity period.
+ *
+ * @return array|null
+ */
+ public function getCredentialsInCache()
+ {
+ if (isset(self::$credentialsCache[(string)$this->credential])) {
+ $result = self::$credentialsCache[(string)$this->credential];
+ if (\strtotime($result['Expiration']) - \time() >= $this->expirationSlot) {
+ return $result;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Cache credentials.
+ *
+ * @param array $credential
+ */
+ protected function cache(array $credential)
+ {
+ self::$credentialsCache[(string)$this->credential] = $credential;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php
new file mode 100644
index 000000000..c6a872939
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php
@@ -0,0 +1,49 @@
+getCredentialsInCache();
+
+ if (null === $credential) {
+ $result = (new AssumeRole($this->credential))->request();
+
+ if ($result->getStatusCode() !== 200) {
+ throw new RuntimeException(isset($result['Message']) ? $result['Message'] : (string)$result->getBody());
+ }
+
+ if (!isset($result['Credentials']['AccessKeyId'],
+ $result['Credentials']['AccessKeySecret'],
+ $result['Credentials']['SecurityToken'])) {
+ throw new RuntimeException($this->error);
+ }
+
+ $credential = $result['Credentials'];
+ $this->cache($credential);
+ }
+
+ return new StsCredential(
+ $credential['AccessKeyId'],
+ $credential['AccessKeySecret'],
+ strtotime($credential['Expiration']),
+ $credential['SecurityToken']
+ );
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/RsaKeyPairProvider.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/RsaKeyPairProvider.php
new file mode 100644
index 000000000..c2d03fc2d
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Providers/RsaKeyPairProvider.php
@@ -0,0 +1,53 @@
+getCredentialsInCache();
+
+ if ($credential === null) {
+ $result = (new GenerateSessionAccessKey($this->credential))->request();
+
+ if ($result->getStatusCode() !== 200) {
+ throw new RuntimeException(isset($result['Message']) ? $result['Message'] : (string)$result->getBody());
+ }
+
+ if (!isset($result['SessionAccessKey']['SessionAccessKeyId'],
+ $result['SessionAccessKey']['SessionAccessKeySecret'])) {
+ throw new RuntimeException($this->error);
+ }
+
+ $credential = $result['SessionAccessKey'];
+ $this->cache($credential);
+ }
+
+ return new StsCredential(
+ $credential['SessionAccessKeyId'],
+ $credential['SessionAccessKeySecret'],
+ strtotime($credential['Expiration'])
+ );
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/RamRoleArnCredential.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/RamRoleArnCredential.php
new file mode 100644
index 000000000..b82c608fb
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/RamRoleArnCredential.php
@@ -0,0 +1,218 @@
+filterParameters($credential);
+ $this->filterPolicy($credential);
+
+ Filter::accessKey($credential['access_key_id'], $credential['access_key_secret']);
+
+ $this->config = $config;
+ $this->accessKeyId = $credential['access_key_id'];
+ $this->accessKeySecret = $credential['access_key_secret'];
+ $this->roleArn = $credential['role_arn'];
+ $this->roleSessionName = $credential['role_session_name'];
+ }
+
+ /**
+ * @param array $credential
+ */
+ private function filterParameters(array $credential)
+ {
+ if (!isset($credential['access_key_id'])) {
+ throw new InvalidArgumentException('Missing required access_key_id option in config for ram_role_arn');
+ }
+
+ if (!isset($credential['access_key_secret'])) {
+ throw new InvalidArgumentException('Missing required access_key_secret option in config for ram_role_arn');
+ }
+
+ if (!isset($credential['role_arn'])) {
+ throw new InvalidArgumentException('Missing required role_arn option in config for ram_role_arn');
+ }
+
+ if (!isset($credential['role_session_name'])) {
+ throw new InvalidArgumentException('Missing required role_session_name option in config for ram_role_arn');
+ }
+ }
+
+ /**
+ * @param array $credential
+ */
+ private function filterPolicy(array $credential)
+ {
+ if (isset($credential['policy'])) {
+ if (is_string($credential['policy'])) {
+ $this->policy = $credential['policy'];
+ }
+
+ if (is_array($credential['policy'])) {
+ $this->policy = json_encode($credential['policy']);
+ }
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * @return string
+ */
+ public function getRoleArn()
+ {
+ return $this->roleArn;
+ }
+
+ /**
+ * @return string
+ */
+ public function getRoleSessionName()
+ {
+ return $this->roleSessionName;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPolicy()
+ {
+ return $this->policy;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return "$this->accessKeyId#$this->accessKeySecret#$this->roleArn#$this->roleSessionName";
+ }
+
+ /**
+ * @return ShaHmac1Signature
+ */
+ public function getSignature()
+ {
+ return new ShaHmac1Signature();
+ }
+
+ /**
+ * @return string
+ */
+ public function getOriginalAccessKeyId()
+ {
+ return $this->accessKeyId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getOriginalAccessKeySecret()
+ {
+ return $this->accessKeySecret;
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getAccessKeyId()
+ {
+ return $this->getSessionCredential()->getAccessKeyId();
+ }
+
+ /**
+ * @return StsCredential
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ protected function getSessionCredential()
+ {
+ return (new RamRoleArnProvider($this))->get();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getAccessKeySecret()
+ {
+ return $this->getSessionCredential()->getAccessKeySecret();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getSecurityToken()
+ {
+ return $this->getSessionCredential()->getSecurityToken();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getExpiration()
+ {
+ return $this->getSessionCredential()->getExpiration();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/AssumeRole.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/AssumeRole.php
new file mode 100644
index 000000000..962a7334f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/AssumeRole.php
@@ -0,0 +1,37 @@
+signature = new ShaHmac1Signature();
+ $this->credential = $arnCredential;
+ $this->uri = $this->uri->withHost('sts.aliyuncs.com');
+ $this->options['verify'] = false;
+ $this->options['query']['RoleArn'] = $arnCredential->getRoleArn();
+ $this->options['query']['RoleSessionName'] = $arnCredential->getRoleSessionName();
+ $this->options['query']['DurationSeconds'] = Provider::DURATION_SECONDS;
+ $this->options['query']['AccessKeyId'] = $this->credential->getOriginalAccessKeyId();
+ $this->options['query']['Version'] = '2015-04-01';
+ $this->options['query']['Action'] = 'AssumeRole';
+ $this->options['query']['RegionId'] = 'cn-hangzhou';
+ if ($arnCredential->getPolicy()) {
+ $this->options['query']['Policy'] = $arnCredential->getPolicy();
+ }
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php
new file mode 100644
index 000000000..35db58597
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php
@@ -0,0 +1,33 @@
+signature = new ShaHmac256WithRsaSignature();
+ $this->credential = $credential;
+ $this->uri = $this->uri->withHost('sts.ap-northeast-1.aliyuncs.com');
+ $this->options['verify'] = false;
+ $this->options['query']['Version'] = '2015-04-01';
+ $this->options['query']['Action'] = 'GenerateSessionAccessKey';
+ $this->options['query']['RegionId'] = 'cn-hangzhou';
+ $this->options['query']['AccessKeyId'] = $credential->getPublicKeyId();
+ $this->options['query']['PublicKeyId'] = $credential->getPublicKeyId();
+ $this->options['query']['DurationSeconds'] = Provider::DURATION_SECONDS;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/Request.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/Request.php
new file mode 100644
index 000000000..1bf1418ff
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Request/Request.php
@@ -0,0 +1,155 @@
+uri = (new Uri())->withScheme('https');
+ $this->options['http_errors'] = false;
+ $this->options['connect_timeout'] = self::CONNECT_TIMEOUT;
+ $this->options['timeout'] = self::TIMEOUT;
+
+ // Turn on debug mode based on environment variable.
+ if (strtolower(Helper::env('DEBUG')) === 'sdk') {
+ $this->options['debug'] = true;
+ }
+ }
+
+ /**
+ * @return ResponseInterface
+ * @throws Exception
+ */
+ public function request()
+ {
+ $this->options['query']['Format'] = 'JSON';
+ $this->options['query']['SignatureMethod'] = $this->signature->getMethod();
+ $this->options['query']['SignatureVersion'] = $this->signature->getVersion();
+ $this->options['query']['SignatureNonce'] = self::uuid(json_encode($this->options['query']));
+ $this->options['query']['Timestamp'] = gmdate('Y-m-d\TH:i:s\Z');
+ $this->options['query']['Signature'] = $this->signature->sign(
+ self::signString('GET', $this->options['query']),
+ $this->credential->getOriginalAccessKeySecret() . '&'
+ );
+ return self::createClient()->request('GET', (string)$this->uri, $this->options);
+ }
+
+ /**
+ * @param string $salt
+ *
+ * @return string
+ */
+ public static function uuid($salt)
+ {
+ return md5($salt . uniqid(md5(microtime(true)), true));
+ }
+
+ /**
+ * @param string $method
+ * @param array $parameters
+ *
+ * @return string
+ */
+ public static function signString($method, array $parameters)
+ {
+ ksort($parameters);
+ $canonicalized = '';
+ foreach ($parameters as $key => $value) {
+ $canonicalized .= '&' . self::percentEncode($key) . '=' . self::percentEncode($value);
+ }
+
+ return $method . '&%2F&' . self::percentEncode(substr($canonicalized, 1));
+ }
+
+ /**
+ * @param string $string
+ *
+ * @return null|string|string[]
+ */
+ private static function percentEncode($string)
+ {
+ $result = rawurlencode($string);
+ $result = str_replace(['+', '*'], ['%20', '%2A'], $result);
+ $result = preg_replace('/%7E/', '~', $result);
+
+ return $result;
+ }
+
+ /**
+ * @return Client
+ * @throws Exception
+ */
+ public static function createClient()
+ {
+ if (Credentials::hasMock()) {
+ $stack = HandlerStack::create(Credentials::getMock());
+ } else {
+ $stack = HandlerStack::create();
+ }
+
+ $stack->push(Middleware::mapResponse(static function (ResponseInterface $response) {
+ return new Response($response);
+ }));
+
+ self::$config['handler'] = $stack;
+
+ return new Client(self::$config);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/RsaKeyPairCredential.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/RsaKeyPairCredential.php
new file mode 100644
index 000000000..bb47f6b46
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/RsaKeyPairCredential.php
@@ -0,0 +1,158 @@
+publicKeyId = $public_key_id;
+ $this->config = $config;
+ try {
+ $this->privateKey = file_get_contents($private_key_file);
+ } catch (Exception $exception) {
+ throw new InvalidArgumentException($exception->getMessage());
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * @return string
+ */
+ public function getOriginalAccessKeyId()
+ {
+ return $this->getPublicKeyId();
+ }
+
+ /**
+ * @return string
+ */
+ public function getPublicKeyId()
+ {
+ return $this->publicKeyId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getOriginalAccessKeySecret()
+ {
+ return $this->getPrivateKey();
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getPrivateKey()
+ {
+ return $this->privateKey;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return "publicKeyId#$this->publicKeyId";
+ }
+
+ /**
+ * @return ShaHmac1Signature
+ */
+ public function getSignature()
+ {
+ return new ShaHmac1Signature();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getAccessKeyId()
+ {
+ return $this->getSessionCredential()->getAccessKeyId();
+ }
+
+ /**
+ * @return StsCredential
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ protected function getSessionCredential()
+ {
+ return (new RsaKeyPairProvider($this))->get();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getAccessKeySecret()
+ {
+ return $this->getSessionCredential()->getAccessKeySecret();
+ }
+
+ /**
+ * @return string
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getSecurityToken()
+ {
+ return $this->getSessionCredential()->getSecurityToken();
+ }
+
+ /**
+ * @return int
+ * @throws Exception
+ * @throws GuzzleException
+ */
+ public function getExpiration()
+ {
+ return $this->getSessionCredential()->getExpiration();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Signature/BearerTokenSignature.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Signature/BearerTokenSignature.php
new file mode 100644
index 000000000..1d67a803b
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Signature/BearerTokenSignature.php
@@ -0,0 +1,47 @@
+getMessage()
+ );
+ }
+
+ return base64_encode($binarySignature);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Signature/SignatureInterface.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Signature/SignatureInterface.php
new file mode 100644
index 000000000..9dfb73b2f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/credentials/src/Signature/SignatureInterface.php
@@ -0,0 +1,34 @@
+accessKeyId = $access_key_id;
+ $this->accessKeySecret = $access_key_secret;
+ $this->expiration = $expiration;
+ $this->securityToken = $security_token;
+ }
+
+ /**
+ * @return int
+ */
+ public function getExpiration()
+ {
+ return $this->expiration;
+ }
+
+ /**
+ * @return string
+ */
+ public function getAccessKeyId()
+ {
+ return $this->accessKeyId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getAccessKeySecret()
+ {
+ return $this->accessKeySecret;
+ }
+
+ /**
+ * @return string
+ */
+ public function getSecurityToken()
+ {
+ return $this->securityToken;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return "$this->accessKeyId#$this->accessKeySecret#$this->securityToken";
+ }
+
+ /**
+ * @return ShaHmac1Signature
+ */
+ public function getSignature()
+ {
+ return new ShaHmac1Signature();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/autoload.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/autoload.php
new file mode 100644
index 000000000..526c18825
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/autoload.php
@@ -0,0 +1,15 @@
+ '',
+ 'accessKeySecret' => '',
+ 'securityToken' => '',
+ 'protocol' => 'http',
+ 'method' => '',
+ 'regionId' => '',
+ 'readTimeout' => '',
+ 'connectTimeout' => '',
+ 'httpProxy' => '',
+ 'httpsProxy' => '',
+ 'credential' => '',
+ 'endpoint' => '',
+ 'noProxy' => '',
+ 'maxIdleConns' => '',
+ 'network' => '',
+ 'userAgent' => '',
+ 'suffix' => '',
+ 'socks5Proxy' => '',
+ 'socks5NetWork' => '',
+ 'endpointType' => '',
+ 'openPlatformEndpoint' => '',
+ 'type' => '',
+ 'signatureVersion' => '',
+ 'signatureAlgorithm' => '',
+ 'key' => '',
+ 'cert' => '',
+ 'ca' => '',
+ ];
+ public function validate()
+ {
+ }
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->accessKeyId) {
+ $res['accessKeyId'] = $this->accessKeyId;
+ }
+ if (null !== $this->accessKeySecret) {
+ $res['accessKeySecret'] = $this->accessKeySecret;
+ }
+ if (null !== $this->securityToken) {
+ $res['securityToken'] = $this->securityToken;
+ }
+ if (null !== $this->protocol) {
+ $res['protocol'] = $this->protocol;
+ }
+ if (null !== $this->method) {
+ $res['method'] = $this->method;
+ }
+ if (null !== $this->regionId) {
+ $res['regionId'] = $this->regionId;
+ }
+ if (null !== $this->readTimeout) {
+ $res['readTimeout'] = $this->readTimeout;
+ }
+ if (null !== $this->connectTimeout) {
+ $res['connectTimeout'] = $this->connectTimeout;
+ }
+ if (null !== $this->httpProxy) {
+ $res['httpProxy'] = $this->httpProxy;
+ }
+ if (null !== $this->httpsProxy) {
+ $res['httpsProxy'] = $this->httpsProxy;
+ }
+ if (null !== $this->credential) {
+ $res['credential'] = null !== $this->credential ? $this->credential->toMap() : null;
+ }
+ if (null !== $this->endpoint) {
+ $res['endpoint'] = $this->endpoint;
+ }
+ if (null !== $this->noProxy) {
+ $res['noProxy'] = $this->noProxy;
+ }
+ if (null !== $this->maxIdleConns) {
+ $res['maxIdleConns'] = $this->maxIdleConns;
+ }
+ if (null !== $this->network) {
+ $res['network'] = $this->network;
+ }
+ if (null !== $this->userAgent) {
+ $res['userAgent'] = $this->userAgent;
+ }
+ if (null !== $this->suffix) {
+ $res['suffix'] = $this->suffix;
+ }
+ if (null !== $this->socks5Proxy) {
+ $res['socks5Proxy'] = $this->socks5Proxy;
+ }
+ if (null !== $this->socks5NetWork) {
+ $res['socks5NetWork'] = $this->socks5NetWork;
+ }
+ if (null !== $this->endpointType) {
+ $res['endpointType'] = $this->endpointType;
+ }
+ if (null !== $this->openPlatformEndpoint) {
+ $res['openPlatformEndpoint'] = $this->openPlatformEndpoint;
+ }
+ if (null !== $this->type) {
+ $res['type'] = $this->type;
+ }
+ if (null !== $this->signatureVersion) {
+ $res['signatureVersion'] = $this->signatureVersion;
+ }
+ if (null !== $this->signatureAlgorithm) {
+ $res['signatureAlgorithm'] = $this->signatureAlgorithm;
+ }
+ if (null !== $this->globalParameters) {
+ $res['globalParameters'] = null !== $this->globalParameters ? $this->globalParameters->toMap() : null;
+ }
+ if (null !== $this->key) {
+ $res['key'] = $this->key;
+ }
+ if (null !== $this->cert) {
+ $res['cert'] = $this->cert;
+ }
+ if (null !== $this->ca) {
+ $res['ca'] = $this->ca;
+ }
+ return $res;
+ }
+ /**
+ * @param array $map
+ * @return Config
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['accessKeyId'])) {
+ $model->accessKeyId = $map['accessKeyId'];
+ }
+ if (isset($map['accessKeySecret'])) {
+ $model->accessKeySecret = $map['accessKeySecret'];
+ }
+ if (isset($map['securityToken'])) {
+ $model->securityToken = $map['securityToken'];
+ }
+ if (isset($map['protocol'])) {
+ $model->protocol = $map['protocol'];
+ }
+ if (isset($map['method'])) {
+ $model->method = $map['method'];
+ }
+ if (isset($map['regionId'])) {
+ $model->regionId = $map['regionId'];
+ }
+ if (isset($map['readTimeout'])) {
+ $model->readTimeout = $map['readTimeout'];
+ }
+ if (isset($map['connectTimeout'])) {
+ $model->connectTimeout = $map['connectTimeout'];
+ }
+ if (isset($map['httpProxy'])) {
+ $model->httpProxy = $map['httpProxy'];
+ }
+ if (isset($map['httpsProxy'])) {
+ $model->httpsProxy = $map['httpsProxy'];
+ }
+ if (isset($map['credential'])) {
+ $model->credential = Credential::fromMap($map['credential']);
+ }
+ if (isset($map['endpoint'])) {
+ $model->endpoint = $map['endpoint'];
+ }
+ if (isset($map['noProxy'])) {
+ $model->noProxy = $map['noProxy'];
+ }
+ if (isset($map['maxIdleConns'])) {
+ $model->maxIdleConns = $map['maxIdleConns'];
+ }
+ if (isset($map['network'])) {
+ $model->network = $map['network'];
+ }
+ if (isset($map['userAgent'])) {
+ $model->userAgent = $map['userAgent'];
+ }
+ if (isset($map['suffix'])) {
+ $model->suffix = $map['suffix'];
+ }
+ if (isset($map['socks5Proxy'])) {
+ $model->socks5Proxy = $map['socks5Proxy'];
+ }
+ if (isset($map['socks5NetWork'])) {
+ $model->socks5NetWork = $map['socks5NetWork'];
+ }
+ if (isset($map['endpointType'])) {
+ $model->endpointType = $map['endpointType'];
+ }
+ if (isset($map['openPlatformEndpoint'])) {
+ $model->openPlatformEndpoint = $map['openPlatformEndpoint'];
+ }
+ if (isset($map['type'])) {
+ $model->type = $map['type'];
+ }
+ if (isset($map['signatureVersion'])) {
+ $model->signatureVersion = $map['signatureVersion'];
+ }
+ if (isset($map['signatureAlgorithm'])) {
+ $model->signatureAlgorithm = $map['signatureAlgorithm'];
+ }
+ if (isset($map['globalParameters'])) {
+ $model->globalParameters = GlobalParameters::fromMap($map['globalParameters']);
+ }
+ if (isset($map['key'])) {
+ $model->key = $map['key'];
+ }
+ if (isset($map['cert'])) {
+ $model->cert = $map['cert'];
+ }
+ if (isset($map['ca'])) {
+ $model->ca = $map['ca'];
+ }
+ return $model;
+ }
+ /**
+ * @description accesskey id
+ * @var string
+ */
+ public $accessKeyId;
+
+ /**
+ * @description accesskey secret
+ * @var string
+ */
+ public $accessKeySecret;
+
+ /**
+ * @description security token
+ * @example a.txt
+ * @var string
+ */
+ public $securityToken;
+
+ /**
+ * @description http protocol
+ * @example http
+ * @var string
+ */
+ public $protocol;
+
+ /**
+ * @description http method
+ * @example GET
+ * @var string
+ */
+ public $method;
+
+ /**
+ * @description region id
+ * @example cn-hangzhou
+ * @var string
+ */
+ public $regionId;
+
+ /**
+ * @description read timeout
+ * @example 10
+ * @var int
+ */
+ public $readTimeout;
+
+ /**
+ * @description connect timeout
+ * @example 10
+ * @var int
+ */
+ public $connectTimeout;
+
+ /**
+ * @description http proxy
+ * @example http://localhost
+ * @var string
+ */
+ public $httpProxy;
+
+ /**
+ * @description https proxy
+ * @example https://localhost
+ * @var string
+ */
+ public $httpsProxy;
+
+ /**
+ * @description credential
+ * @example
+ * @var Credential
+ */
+ public $credential;
+
+ /**
+ * @description endpoint
+ * @example cs.aliyuncs.com
+ * @var string
+ */
+ public $endpoint;
+
+ /**
+ * @description proxy white list
+ * @example http://localhost
+ * @var string
+ */
+ public $noProxy;
+
+ /**
+ * @description max idle conns
+ * @example 3
+ * @var int
+ */
+ public $maxIdleConns;
+
+ /**
+ * @description network for endpoint
+ * @example public
+ * @var string
+ */
+ public $network;
+
+ /**
+ * @description user agent
+ * @example Alibabacloud/1
+ * @var string
+ */
+ public $userAgent;
+
+ /**
+ * @description suffix for endpoint
+ * @example aliyun
+ * @var string
+ */
+ public $suffix;
+
+ /**
+ * @description socks5 proxy
+ * @var string
+ */
+ public $socks5Proxy;
+
+ /**
+ * @description socks5 network
+ * @example TCP
+ * @var string
+ */
+ public $socks5NetWork;
+
+ /**
+ * @description endpoint type
+ * @example internal
+ * @var string
+ */
+ public $endpointType;
+
+ /**
+ * @description OpenPlatform endpoint
+ * @example openplatform.aliyuncs.com
+ * @var string
+ */
+ public $openPlatformEndpoint;
+
+ /**
+ * @description credential type
+ * @example access_key
+ * @deprecated
+ * @var string
+ */
+ public $type;
+
+ /**
+ * @description Signature Version
+ * @example v1
+ * @var string
+ */
+ public $signatureVersion;
+
+ /**
+ * @description Signature Algorithm
+ * @example ACS3-HMAC-SHA256
+ * @var string
+ */
+ public $signatureAlgorithm;
+
+ /**
+ * @description Global Parameters
+ * @var GlobalParameters
+ */
+ public $globalParameters;
+
+ /**
+ * @description privite key for client certificate
+ * @example MIIEvQ
+ * @var string
+ */
+ public $key;
+
+ /**
+ * @description client certificate
+ * @example -----BEGIN CERTIFICATE-----
+xxx-----END CERTIFICATE-----
+ * @var string
+ */
+ public $cert;
+
+ /**
+ * @description server certificate
+ * @example -----BEGIN CERTIFICATE-----
+xxx-----END CERTIFICATE-----
+ * @var string
+ */
+ public $ca;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/GlobalParameters.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/GlobalParameters.php
new file mode 100644
index 000000000..37505de14
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/GlobalParameters.php
@@ -0,0 +1,42 @@
+headers) {
+ $res['headers'] = $this->headers;
+ }
+ if (null !== $this->queries) {
+ $res['queries'] = $this->queries;
+ }
+ return $res;
+ }
+ /**
+ * @param array $map
+ * @return GlobalParameters
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['headers'])) {
+ $model->headers = $map['headers'];
+ }
+ if (isset($map['queries'])) {
+ $model->queries = $map['queries'];
+ }
+ return $model;
+ }
+ public $headers;
+
+ public $queries;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/OpenApiRequest.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/OpenApiRequest.php
new file mode 100644
index 000000000..2796eca32
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/OpenApiRequest.php
@@ -0,0 +1,74 @@
+headers) {
+ $res['headers'] = $this->headers;
+ }
+ if (null !== $this->query) {
+ $res['query'] = $this->query;
+ }
+ if (null !== $this->body) {
+ $res['body'] = $this->body;
+ }
+ if (null !== $this->stream) {
+ $res['stream'] = $this->stream;
+ }
+ if (null !== $this->hostMap) {
+ $res['hostMap'] = $this->hostMap;
+ }
+ if (null !== $this->endpointOverride) {
+ $res['endpointOverride'] = $this->endpointOverride;
+ }
+ return $res;
+ }
+ /**
+ * @param array $map
+ * @return OpenApiRequest
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['headers'])) {
+ $model->headers = $map['headers'];
+ }
+ if (isset($map['query'])) {
+ $model->query = $map['query'];
+ }
+ if (isset($map['body'])) {
+ $model->body = $map['body'];
+ }
+ if (isset($map['stream'])) {
+ $model->stream = $map['stream'];
+ }
+ if (isset($map['hostMap'])) {
+ $model->hostMap = $map['hostMap'];
+ }
+ if (isset($map['endpointOverride'])) {
+ $model->endpointOverride = $map['endpointOverride'];
+ }
+ return $model;
+ }
+ public $headers;
+
+ public $query;
+
+ public $body;
+
+ public $stream;
+
+ public $hostMap;
+
+ public $endpointOverride;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/Params.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/Params.php
new file mode 100644
index 000000000..3838659f2
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/Models/Params.php
@@ -0,0 +1,130 @@
+action, true);
+ Model::validateRequired('version', $this->version, true);
+ Model::validateRequired('protocol', $this->protocol, true);
+ Model::validateRequired('pathname', $this->pathname, true);
+ Model::validateRequired('method', $this->method, true);
+ Model::validateRequired('authType', $this->authType, true);
+ Model::validateRequired('bodyType', $this->bodyType, true);
+ Model::validateRequired('reqBodyType', $this->reqBodyType, true);
+ }
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->action) {
+ $res['action'] = $this->action;
+ }
+ if (null !== $this->version) {
+ $res['version'] = $this->version;
+ }
+ if (null !== $this->protocol) {
+ $res['protocol'] = $this->protocol;
+ }
+ if (null !== $this->pathname) {
+ $res['pathname'] = $this->pathname;
+ }
+ if (null !== $this->method) {
+ $res['method'] = $this->method;
+ }
+ if (null !== $this->authType) {
+ $res['authType'] = $this->authType;
+ }
+ if (null !== $this->bodyType) {
+ $res['bodyType'] = $this->bodyType;
+ }
+ if (null !== $this->reqBodyType) {
+ $res['reqBodyType'] = $this->reqBodyType;
+ }
+ if (null !== $this->style) {
+ $res['style'] = $this->style;
+ }
+ return $res;
+ }
+ /**
+ * @param array $map
+ * @return Params
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['action'])) {
+ $model->action = $map['action'];
+ }
+ if (isset($map['version'])) {
+ $model->version = $map['version'];
+ }
+ if (isset($map['protocol'])) {
+ $model->protocol = $map['protocol'];
+ }
+ if (isset($map['pathname'])) {
+ $model->pathname = $map['pathname'];
+ }
+ if (isset($map['method'])) {
+ $model->method = $map['method'];
+ }
+ if (isset($map['authType'])) {
+ $model->authType = $map['authType'];
+ }
+ if (isset($map['bodyType'])) {
+ $model->bodyType = $map['bodyType'];
+ }
+ if (isset($map['reqBodyType'])) {
+ $model->reqBodyType = $map['reqBodyType'];
+ }
+ if (isset($map['style'])) {
+ $model->style = $map['style'];
+ }
+ return $model;
+ }
+ /**
+ * @var string
+ */
+ public $action;
+
+ /**
+ * @var string
+ */
+ public $version;
+
+ /**
+ * @var string
+ */
+ public $protocol;
+
+ /**
+ * @var string
+ */
+ public $pathname;
+
+ /**
+ * @var string
+ */
+ public $method;
+
+ /**
+ * @var string
+ */
+ public $authType;
+
+ /**
+ * @var string
+ */
+ public $bodyType;
+
+ /**
+ * @var string
+ */
+ public $reqBodyType;
+
+ public $style;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/OpenApiClient.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/OpenApiClient.php
new file mode 100644
index 000000000..69aeda1e7
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/darabonba-openapi/src/OpenApiClient.php
@@ -0,0 +1,1183 @@
+ "ParameterMissing",
+ "message" => "'config' can not be unset"
+ ]);
+ }
+ if (!Utils::empty_($config->accessKeyId) && !Utils::empty_($config->accessKeySecret)) {
+ if (!Utils::empty_($config->securityToken)) {
+ $config->type = "sts";
+ } else {
+ $config->type = "access_key";
+ }
+ $credentialConfig = new Config([
+ "accessKeyId" => $config->accessKeyId,
+ "type" => $config->type,
+ "accessKeySecret" => $config->accessKeySecret
+ ]);
+ $credentialConfig->securityToken = $config->securityToken;
+ $this->_credential = new Credential($credentialConfig);
+ } else if (!Utils::isUnset($config->credential)) {
+ $this->_credential = $config->credential;
+ }
+ $this->_endpoint = $config->endpoint;
+ $this->_endpointType = $config->endpointType;
+ $this->_network = $config->network;
+ $this->_suffix = $config->suffix;
+ $this->_protocol = $config->protocol;
+ $this->_method = $config->method;
+ $this->_regionId = $config->regionId;
+ $this->_userAgent = $config->userAgent;
+ $this->_readTimeout = $config->readTimeout;
+ $this->_connectTimeout = $config->connectTimeout;
+ $this->_httpProxy = $config->httpProxy;
+ $this->_httpsProxy = $config->httpsProxy;
+ $this->_noProxy = $config->noProxy;
+ $this->_socks5Proxy = $config->socks5Proxy;
+ $this->_socks5NetWork = $config->socks5NetWork;
+ $this->_maxIdleConns = $config->maxIdleConns;
+ $this->_signatureVersion = $config->signatureVersion;
+ $this->_signatureAlgorithm = $config->signatureAlgorithm;
+ $this->_globalParameters = $config->globalParameters;
+ $this->_key = $config->key;
+ $this->_cert = $config->cert;
+ $this->_ca = $config->ca;
+ }
+
+ /**
+ * Encapsulate the request and invoke the network
+ * @param string $action api name
+ * @param string $version product version
+ * @param string $protocol http or https
+ * @param string $method e.g. GET
+ * @param string $authType authorization type e.g. AK
+ * @param string $bodyType response body type e.g. String
+ * @param OpenApiRequest $request object of OpenApiRequest
+ * @param RuntimeOptions $runtime which controls some details of call api, such as retry times
+ * @return array the response
+ * @throws TeaError
+ * @throws Exception
+ * @throws TeaUnableRetryError
+ */
+ public function doRPCRequest($action, $version, $protocol, $method, $authType, $bodyType, $request, $runtime)
+ {
+ $request->validate();
+ $runtime->validate();
+ $_runtime = [
+ "timeouted" => "retry",
+ "key" => Utils::defaultString($runtime->key, $this->_key),
+ "cert" => Utils::defaultString($runtime->cert, $this->_cert),
+ "ca" => Utils::defaultString($runtime->ca, $this->_ca),
+ "readTimeout" => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout),
+ "connectTimeout" => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout),
+ "httpProxy" => Utils::defaultString($runtime->httpProxy, $this->_httpProxy),
+ "httpsProxy" => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy),
+ "noProxy" => Utils::defaultString($runtime->noProxy, $this->_noProxy),
+ "socks5Proxy" => Utils::defaultString($runtime->socks5Proxy, $this->_socks5Proxy),
+ "socks5NetWork" => Utils::defaultString($runtime->socks5NetWork, $this->_socks5NetWork),
+ "maxIdleConns" => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns),
+ "retry" => [
+ "retryable" => $runtime->autoretry,
+ "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3)
+ ],
+ "backoff" => [
+ "policy" => Utils::defaultString($runtime->backoffPolicy, "no"),
+ "period" => Utils::defaultNumber($runtime->backoffPeriod, 1)
+ ],
+ "ignoreSSL" => $runtime->ignoreSSL
+ ];
+ $_lastRequest = null;
+ $_lastException = null;
+ $_now = time();
+ $_retryTimes = 0;
+ while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
+ if ($_retryTimes > 0) {
+ $_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
+ if ($_backoffTime > 0) {
+ Tea::sleep($_backoffTime);
+ }
+ }
+ $_retryTimes = $_retryTimes + 1;
+ try {
+ $_request = new Request();
+ $_request->protocol = Utils::defaultString($this->_protocol, $protocol);
+ $_request->method = $method;
+ $_request->pathname = "/";
+ $globalQueries = [];
+ $globalHeaders = [];
+ if (!Utils::isUnset($this->_globalParameters)) {
+ $globalParams = $this->_globalParameters;
+ if (!Utils::isUnset($globalParams->queries)) {
+ $globalQueries = $globalParams->queries;
+ }
+ if (!Utils::isUnset($globalParams->headers)) {
+ $globalHeaders = $globalParams->headers;
+ }
+ }
+ $_request->query = Tea::merge([
+ "Action" => $action,
+ "Format" => "json",
+ "Version" => $version,
+ "Timestamp" => OpenApiUtilClient::getTimestamp(),
+ "SignatureNonce" => Utils::getNonce()
+ ], $globalQueries, $request->query);
+ $headers = $this->getRpcHeaders();
+ if (Utils::isUnset($headers)) {
+ // endpoint is setted in product client
+ $_request->headers = Tea::merge([
+ "host" => $this->_endpoint,
+ "x-acs-version" => $version,
+ "x-acs-action" => $action,
+ "user-agent" => $this->getUserAgent()
+ ], $globalHeaders);
+ } else {
+ $_request->headers = Tea::merge([
+ "host" => $this->_endpoint,
+ "x-acs-version" => $version,
+ "x-acs-action" => $action,
+ "user-agent" => $this->getUserAgent()
+ ], $globalHeaders, $headers);
+ }
+ if (!Utils::isUnset($request->body)) {
+ $m = Utils::assertAsMap($request->body);
+ $tmp = Utils::anyifyMapValue(OpenApiUtilClient::query($m));
+ $_request->body = Utils::toFormString($tmp);
+ $_request->headers["content-type"] = "application/x-www-form-urlencoded";
+ }
+ if (!Utils::equalString($authType, "Anonymous")) {
+ $accessKeyId = $this->getAccessKeyId();
+ $accessKeySecret = $this->getAccessKeySecret();
+ $securityToken = $this->getSecurityToken();
+ if (!Utils::empty_($securityToken)) {
+ $_request->query["SecurityToken"] = $securityToken;
+ }
+ $_request->query["SignatureMethod"] = "HMAC-SHA1";
+ $_request->query["SignatureVersion"] = "1.0";
+ $_request->query["AccessKeyId"] = $accessKeyId;
+ $t = null;
+ if (!Utils::isUnset($request->body)) {
+ $t = Utils::assertAsMap($request->body);
+ }
+ $signedParam = Tea::merge($_request->query, OpenApiUtilClient::query($t));
+ $_request->query["Signature"] = OpenApiUtilClient::getRPCSignature($signedParam, $_request->method, $accessKeySecret);
+ }
+ $_lastRequest = $_request;
+ $_response = Tea::send($_request, $_runtime);
+ if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) {
+ $_res = Utils::readAsJSON($_response->body);
+ $err = Utils::assertAsMap($_res);
+ $requestId = self::defaultAny(@$err["RequestId"], @$err["requestId"]);
+ @$err["statusCode"] = $_response->statusCode;
+ throw new TeaError([
+ "code" => "" . (string) (self::defaultAny(@$err["Code"], @$err["code"])) . "",
+ "message" => "code: " . (string) ($_response->statusCode) . ", " . (string) (self::defaultAny(@$err["Message"], @$err["message"])) . " request id: " . (string) ($requestId) . "",
+ "data" => $err,
+ "description" => "" . (string) (self::defaultAny(@$err["Description"], @$err["description"])) . "",
+ "accessDeniedDetail" => self::defaultAny(@$err["AccessDeniedDetail"], @$err["accessDeniedDetail"])
+ ]);
+ }
+ if (Utils::equalString($bodyType, "binary")) {
+ $resp = [
+ "body" => $_response->body,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ return $resp;
+ } else if (Utils::equalString($bodyType, "byte")) {
+ $byt = Utils::readAsBytes($_response->body);
+ return [
+ "body" => $byt,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "string")) {
+ $str = Utils::readAsString($_response->body);
+ return [
+ "body" => $str,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "json")) {
+ $obj = Utils::readAsJSON($_response->body);
+ $res = Utils::assertAsMap($obj);
+ return [
+ "body" => $res,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "array")) {
+ $arr = Utils::readAsJSON($_response->body);
+ return [
+ "body" => $arr,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else {
+ return [
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ }
+ } catch (Exception $e) {
+ if (!($e instanceof TeaError)) {
+ $e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
+ }
+ if (Tea::isRetryable($e)) {
+ $_lastException = $e;
+ continue;
+ }
+ throw $e;
+ }
+ }
+ throw new TeaUnableRetryError($_lastRequest, $_lastException);
+ }
+
+ /**
+ * Encapsulate the request and invoke the network
+ * @param string $action api name
+ * @param string $version product version
+ * @param string $protocol http or https
+ * @param string $method e.g. GET
+ * @param string $authType authorization type e.g. AK
+ * @param string $pathname pathname of every api
+ * @param string $bodyType response body type e.g. String
+ * @param OpenApiRequest $request object of OpenApiRequest
+ * @param RuntimeOptions $runtime which controls some details of call api, such as retry times
+ * @return array the response
+ * @throws TeaError
+ * @throws Exception
+ * @throws TeaUnableRetryError
+ */
+ public function doROARequest($action, $version, $protocol, $method, $authType, $pathname, $bodyType, $request, $runtime)
+ {
+ $request->validate();
+ $runtime->validate();
+ $_runtime = [
+ "timeouted" => "retry",
+ "key" => Utils::defaultString($runtime->key, $this->_key),
+ "cert" => Utils::defaultString($runtime->cert, $this->_cert),
+ "ca" => Utils::defaultString($runtime->ca, $this->_ca),
+ "readTimeout" => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout),
+ "connectTimeout" => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout),
+ "httpProxy" => Utils::defaultString($runtime->httpProxy, $this->_httpProxy),
+ "httpsProxy" => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy),
+ "noProxy" => Utils::defaultString($runtime->noProxy, $this->_noProxy),
+ "socks5Proxy" => Utils::defaultString($runtime->socks5Proxy, $this->_socks5Proxy),
+ "socks5NetWork" => Utils::defaultString($runtime->socks5NetWork, $this->_socks5NetWork),
+ "maxIdleConns" => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns),
+ "retry" => [
+ "retryable" => $runtime->autoretry,
+ "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3)
+ ],
+ "backoff" => [
+ "policy" => Utils::defaultString($runtime->backoffPolicy, "no"),
+ "period" => Utils::defaultNumber($runtime->backoffPeriod, 1)
+ ],
+ "ignoreSSL" => $runtime->ignoreSSL
+ ];
+ $_lastRequest = null;
+ $_lastException = null;
+ $_now = time();
+ $_retryTimes = 0;
+ while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
+ if ($_retryTimes > 0) {
+ $_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
+ if ($_backoffTime > 0) {
+ Tea::sleep($_backoffTime);
+ }
+ }
+ $_retryTimes = $_retryTimes + 1;
+ try {
+ $_request = new Request();
+ $_request->protocol = Utils::defaultString($this->_protocol, $protocol);
+ $_request->method = $method;
+ $_request->pathname = $pathname;
+ $globalQueries = [];
+ $globalHeaders = [];
+ if (!Utils::isUnset($this->_globalParameters)) {
+ $globalParams = $this->_globalParameters;
+ if (!Utils::isUnset($globalParams->queries)) {
+ $globalQueries = $globalParams->queries;
+ }
+ if (!Utils::isUnset($globalParams->headers)) {
+ $globalHeaders = $globalParams->headers;
+ }
+ }
+ $_request->headers = Tea::merge([
+ "date" => Utils::getDateUTCString(),
+ "host" => $this->_endpoint,
+ "accept" => "application/json",
+ "x-acs-signature-nonce" => Utils::getNonce(),
+ "x-acs-signature-method" => "HMAC-SHA1",
+ "x-acs-signature-version" => "1.0",
+ "x-acs-version" => $version,
+ "x-acs-action" => $action,
+ "user-agent" => Utils::getUserAgent($this->_userAgent)
+ ], $globalHeaders, $request->headers);
+ if (!Utils::isUnset($request->body)) {
+ $_request->body = Utils::toJSONString($request->body);
+ $_request->headers["content-type"] = "application/json; charset=utf-8";
+ }
+ $_request->query = $globalQueries;
+ if (!Utils::isUnset($request->query)) {
+ $_request->query = Tea::merge($_request->query, $request->query);
+ }
+ if (!Utils::equalString($authType, "Anonymous")) {
+ $accessKeyId = $this->getAccessKeyId();
+ $accessKeySecret = $this->getAccessKeySecret();
+ $securityToken = $this->getSecurityToken();
+ if (!Utils::empty_($securityToken)) {
+ $_request->headers["x-acs-accesskey-id"] = $accessKeyId;
+ $_request->headers["x-acs-security-token"] = $securityToken;
+ }
+ $stringToSign = OpenApiUtilClient::getStringToSign($_request);
+ $_request->headers["authorization"] = "acs " . $accessKeyId . ":" . OpenApiUtilClient::getROASignature($stringToSign, $accessKeySecret) . "";
+ }
+ $_lastRequest = $_request;
+ $_response = Tea::send($_request, $_runtime);
+ if (Utils::equalNumber($_response->statusCode, 204)) {
+ return [
+ "headers" => $_response->headers
+ ];
+ }
+ if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) {
+ $_res = Utils::readAsJSON($_response->body);
+ $err = Utils::assertAsMap($_res);
+ $requestId = self::defaultAny(@$err["RequestId"], @$err["requestId"]);
+ $requestId = self::defaultAny($requestId, @$err["requestid"]);
+ @$err["statusCode"] = $_response->statusCode;
+ throw new TeaError([
+ "code" => "" . (string) (self::defaultAny(@$err["Code"], @$err["code"])) . "",
+ "message" => "code: " . (string) ($_response->statusCode) . ", " . (string) (self::defaultAny(@$err["Message"], @$err["message"])) . " request id: " . (string) ($requestId) . "",
+ "data" => $err,
+ "description" => "" . (string) (self::defaultAny(@$err["Description"], @$err["description"])) . "",
+ "accessDeniedDetail" => self::defaultAny(@$err["AccessDeniedDetail"], @$err["accessDeniedDetail"])
+ ]);
+ }
+ if (Utils::equalString($bodyType, "binary")) {
+ $resp = [
+ "body" => $_response->body,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ return $resp;
+ } else if (Utils::equalString($bodyType, "byte")) {
+ $byt = Utils::readAsBytes($_response->body);
+ return [
+ "body" => $byt,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "string")) {
+ $str = Utils::readAsString($_response->body);
+ return [
+ "body" => $str,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "json")) {
+ $obj = Utils::readAsJSON($_response->body);
+ $res = Utils::assertAsMap($obj);
+ return [
+ "body" => $res,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "array")) {
+ $arr = Utils::readAsJSON($_response->body);
+ return [
+ "body" => $arr,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else {
+ return [
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ }
+ } catch (Exception $e) {
+ if (!($e instanceof TeaError)) {
+ $e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
+ }
+ if (Tea::isRetryable($e)) {
+ $_lastException = $e;
+ continue;
+ }
+ throw $e;
+ }
+ }
+ throw new TeaUnableRetryError($_lastRequest, $_lastException);
+ }
+
+ /**
+ * Encapsulate the request and invoke the network with form body
+ * @param string $action api name
+ * @param string $version product version
+ * @param string $protocol http or https
+ * @param string $method e.g. GET
+ * @param string $authType authorization type e.g. AK
+ * @param string $pathname pathname of every api
+ * @param string $bodyType response body type e.g. String
+ * @param OpenApiRequest $request object of OpenApiRequest
+ * @param RuntimeOptions $runtime which controls some details of call api, such as retry times
+ * @return array the response
+ * @throws TeaError
+ * @throws Exception
+ * @throws TeaUnableRetryError
+ */
+ public function doROARequestWithForm($action, $version, $protocol, $method, $authType, $pathname, $bodyType, $request, $runtime)
+ {
+ $request->validate();
+ $runtime->validate();
+ $_runtime = [
+ "timeouted" => "retry",
+ "key" => Utils::defaultString($runtime->key, $this->_key),
+ "cert" => Utils::defaultString($runtime->cert, $this->_cert),
+ "ca" => Utils::defaultString($runtime->ca, $this->_ca),
+ "readTimeout" => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout),
+ "connectTimeout" => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout),
+ "httpProxy" => Utils::defaultString($runtime->httpProxy, $this->_httpProxy),
+ "httpsProxy" => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy),
+ "noProxy" => Utils::defaultString($runtime->noProxy, $this->_noProxy),
+ "socks5Proxy" => Utils::defaultString($runtime->socks5Proxy, $this->_socks5Proxy),
+ "socks5NetWork" => Utils::defaultString($runtime->socks5NetWork, $this->_socks5NetWork),
+ "maxIdleConns" => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns),
+ "retry" => [
+ "retryable" => $runtime->autoretry,
+ "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3)
+ ],
+ "backoff" => [
+ "policy" => Utils::defaultString($runtime->backoffPolicy, "no"),
+ "period" => Utils::defaultNumber($runtime->backoffPeriod, 1)
+ ],
+ "ignoreSSL" => $runtime->ignoreSSL
+ ];
+ $_lastRequest = null;
+ $_lastException = null;
+ $_now = time();
+ $_retryTimes = 0;
+ while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
+ if ($_retryTimes > 0) {
+ $_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
+ if ($_backoffTime > 0) {
+ Tea::sleep($_backoffTime);
+ }
+ }
+ $_retryTimes = $_retryTimes + 1;
+ try {
+ $_request = new Request();
+ $_request->protocol = Utils::defaultString($this->_protocol, $protocol);
+ $_request->method = $method;
+ $_request->pathname = $pathname;
+ $globalQueries = [];
+ $globalHeaders = [];
+ if (!Utils::isUnset($this->_globalParameters)) {
+ $globalParams = $this->_globalParameters;
+ if (!Utils::isUnset($globalParams->queries)) {
+ $globalQueries = $globalParams->queries;
+ }
+ if (!Utils::isUnset($globalParams->headers)) {
+ $globalHeaders = $globalParams->headers;
+ }
+ }
+ $_request->headers = Tea::merge([
+ "date" => Utils::getDateUTCString(),
+ "host" => $this->_endpoint,
+ "accept" => "application/json",
+ "x-acs-signature-nonce" => Utils::getNonce(),
+ "x-acs-signature-method" => "HMAC-SHA1",
+ "x-acs-signature-version" => "1.0",
+ "x-acs-version" => $version,
+ "x-acs-action" => $action,
+ "user-agent" => Utils::getUserAgent($this->_userAgent)
+ ], $globalHeaders, $request->headers);
+ if (!Utils::isUnset($request->body)) {
+ $m = Utils::assertAsMap($request->body);
+ $_request->body = OpenApiUtilClient::toForm($m);
+ $_request->headers["content-type"] = "application/x-www-form-urlencoded";
+ }
+ $_request->query = $globalQueries;
+ if (!Utils::isUnset($request->query)) {
+ $_request->query = Tea::merge($_request->query, $request->query);
+ }
+ if (!Utils::equalString($authType, "Anonymous")) {
+ $accessKeyId = $this->getAccessKeyId();
+ $accessKeySecret = $this->getAccessKeySecret();
+ $securityToken = $this->getSecurityToken();
+ if (!Utils::empty_($securityToken)) {
+ $_request->headers["x-acs-accesskey-id"] = $accessKeyId;
+ $_request->headers["x-acs-security-token"] = $securityToken;
+ }
+ $stringToSign = OpenApiUtilClient::getStringToSign($_request);
+ $_request->headers["authorization"] = "acs " . $accessKeyId . ":" . OpenApiUtilClient::getROASignature($stringToSign, $accessKeySecret) . "";
+ }
+ $_lastRequest = $_request;
+ $_response = Tea::send($_request, $_runtime);
+ if (Utils::equalNumber($_response->statusCode, 204)) {
+ return [
+ "headers" => $_response->headers
+ ];
+ }
+ if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) {
+ $_res = Utils::readAsJSON($_response->body);
+ $err = Utils::assertAsMap($_res);
+ @$err["statusCode"] = $_response->statusCode;
+ throw new TeaError([
+ "code" => "" . (string) (self::defaultAny(@$err["Code"], @$err["code"])) . "",
+ "message" => "code: " . (string) ($_response->statusCode) . ", " . (string) (self::defaultAny(@$err["Message"], @$err["message"])) . " request id: " . (string) (self::defaultAny(@$err["RequestId"], @$err["requestId"])) . "",
+ "data" => $err,
+ "description" => "" . (string) (self::defaultAny(@$err["Description"], @$err["description"])) . "",
+ "accessDeniedDetail" => self::defaultAny(@$err["AccessDeniedDetail"], @$err["accessDeniedDetail"])
+ ]);
+ }
+ if (Utils::equalString($bodyType, "binary")) {
+ $resp = [
+ "body" => $_response->body,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ return $resp;
+ } else if (Utils::equalString($bodyType, "byte")) {
+ $byt = Utils::readAsBytes($_response->body);
+ return [
+ "body" => $byt,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "string")) {
+ $str = Utils::readAsString($_response->body);
+ return [
+ "body" => $str,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "json")) {
+ $obj = Utils::readAsJSON($_response->body);
+ $res = Utils::assertAsMap($obj);
+ return [
+ "body" => $res,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($bodyType, "array")) {
+ $arr = Utils::readAsJSON($_response->body);
+ return [
+ "body" => $arr,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else {
+ return [
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ }
+ } catch (Exception $e) {
+ if (!($e instanceof TeaError)) {
+ $e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
+ }
+ if (Tea::isRetryable($e)) {
+ $_lastException = $e;
+ continue;
+ }
+ throw $e;
+ }
+ }
+ throw new TeaUnableRetryError($_lastRequest, $_lastException);
+ }
+
+ /**
+ * Encapsulate the request and invoke the network
+ * @param Params $params
+ * @param OpenApiRequest $request object of OpenApiRequest
+ * @param RuntimeOptions $runtime which controls some details of call api, such as retry times
+ * @return array the response
+ * @throws TeaError
+ * @throws Exception
+ * @throws TeaUnableRetryError
+ */
+ public function doRequest($params, $request, $runtime)
+ {
+ $params->validate();
+ $request->validate();
+ $runtime->validate();
+ $_runtime = [
+ "timeouted" => "retry",
+ "key" => Utils::defaultString($runtime->key, $this->_key),
+ "cert" => Utils::defaultString($runtime->cert, $this->_cert),
+ "ca" => Utils::defaultString($runtime->ca, $this->_ca),
+ "readTimeout" => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout),
+ "connectTimeout" => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout),
+ "httpProxy" => Utils::defaultString($runtime->httpProxy, $this->_httpProxy),
+ "httpsProxy" => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy),
+ "noProxy" => Utils::defaultString($runtime->noProxy, $this->_noProxy),
+ "socks5Proxy" => Utils::defaultString($runtime->socks5Proxy, $this->_socks5Proxy),
+ "socks5NetWork" => Utils::defaultString($runtime->socks5NetWork, $this->_socks5NetWork),
+ "maxIdleConns" => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns),
+ "retry" => [
+ "retryable" => $runtime->autoretry,
+ "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3)
+ ],
+ "backoff" => [
+ "policy" => Utils::defaultString($runtime->backoffPolicy, "no"),
+ "period" => Utils::defaultNumber($runtime->backoffPeriod, 1)
+ ],
+ "ignoreSSL" => $runtime->ignoreSSL
+ ];
+ $_lastRequest = null;
+ $_lastException = null;
+ $_now = time();
+ $_retryTimes = 0;
+ while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
+ if ($_retryTimes > 0) {
+ $_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
+ if ($_backoffTime > 0) {
+ Tea::sleep($_backoffTime);
+ }
+ }
+ $_retryTimes = $_retryTimes + 1;
+ try {
+ $_request = new Request();
+ $_request->protocol = Utils::defaultString($this->_protocol, $params->protocol);
+ $_request->method = $params->method;
+ $_request->pathname = $params->pathname;
+ $globalQueries = [];
+ $globalHeaders = [];
+ if (!Utils::isUnset($this->_globalParameters)) {
+ $globalParams = $this->_globalParameters;
+ if (!Utils::isUnset($globalParams->queries)) {
+ $globalQueries = $globalParams->queries;
+ }
+ if (!Utils::isUnset($globalParams->headers)) {
+ $globalHeaders = $globalParams->headers;
+ }
+ }
+ $_request->query = Tea::merge($globalQueries, $request->query);
+ // endpoint is setted in product client
+ $_request->headers = Tea::merge([
+ "host" => $this->_endpoint,
+ "x-acs-version" => $params->version,
+ "x-acs-action" => $params->action,
+ "user-agent" => $this->getUserAgent(),
+ "x-acs-date" => OpenApiUtilClient::getTimestamp(),
+ "x-acs-signature-nonce" => Utils::getNonce(),
+ "accept" => "application/json"
+ ], $globalHeaders, $request->headers);
+ if (Utils::equalString($params->style, "RPC")) {
+ $headers = $this->getRpcHeaders();
+ if (!Utils::isUnset($headers)) {
+ $_request->headers = Tea::merge($_request->headers, $headers);
+ }
+ }
+ $signatureAlgorithm = Utils::defaultString($this->_signatureAlgorithm, "ACS3-HMAC-SHA256");
+ $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash(Utils::toBytes(""), $signatureAlgorithm));
+ if (!Utils::isUnset($request->stream)) {
+ $tmp = Utils::readAsBytes($request->stream);
+ $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash($tmp, $signatureAlgorithm));
+ $_request->body = $tmp;
+ $_request->headers["content-type"] = "application/octet-stream";
+ } else {
+ if (!Utils::isUnset($request->body)) {
+ if (Utils::equalString($params->reqBodyType, "byte")) {
+ $byteObj = Utils::assertAsBytes($request->body);
+ $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash($byteObj, $signatureAlgorithm));
+ $_request->body = $byteObj;
+ } else if (Utils::equalString($params->reqBodyType, "json")) {
+ $jsonObj = Utils::toJSONString($request->body);
+ $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash(Utils::toBytes($jsonObj), $signatureAlgorithm));
+ $_request->body = $jsonObj;
+ $_request->headers["content-type"] = "application/json; charset=utf-8";
+ } else {
+ $m = Utils::assertAsMap($request->body);
+ $formObj = OpenApiUtilClient::toForm($m);
+ $hashedRequestPayload = OpenApiUtilClient::hexEncode(OpenApiUtilClient::hash(Utils::toBytes($formObj), $signatureAlgorithm));
+ $_request->body = $formObj;
+ $_request->headers["content-type"] = "application/x-www-form-urlencoded";
+ }
+ }
+ }
+ $_request->headers["x-acs-content-sha256"] = $hashedRequestPayload;
+ if (!Utils::equalString($params->authType, "Anonymous")) {
+ $authType = $this->getType();
+ if (Utils::equalString($authType, "bearer")) {
+ $bearerToken = $this->getBearerToken();
+ $_request->headers["x-acs-bearer-token"] = $bearerToken;
+ } else {
+ $accessKeyId = $this->getAccessKeyId();
+ $accessKeySecret = $this->getAccessKeySecret();
+ $securityToken = $this->getSecurityToken();
+ if (!Utils::empty_($securityToken)) {
+ $_request->headers["x-acs-accesskey-id"] = $accessKeyId;
+ $_request->headers["x-acs-security-token"] = $securityToken;
+ }
+ $_request->headers["Authorization"] = OpenApiUtilClient::getAuthorization($_request, $signatureAlgorithm, $hashedRequestPayload, $accessKeyId, $accessKeySecret);
+ }
+ }
+ $_lastRequest = $_request;
+ $_response = Tea::send($_request, $_runtime);
+ if (Utils::is4xx($_response->statusCode) || Utils::is5xx($_response->statusCode)) {
+ $_res = Utils::readAsJSON($_response->body);
+ $err = Utils::assertAsMap($_res);
+ @$err["statusCode"] = $_response->statusCode;
+ throw new TeaError([
+ "code" => "" . (string) (self::defaultAny(@$err["Code"], @$err["code"])) . "",
+ "message" => "code: " . (string) ($_response->statusCode) . ", " . (string) (self::defaultAny(@$err["Message"], @$err["message"])) . " request id: " . (string) (self::defaultAny(@$err["RequestId"], @$err["requestId"])) . "",
+ "data" => $err,
+ "description" => "" . (string) (self::defaultAny(@$err["Description"], @$err["description"])) . "",
+ "accessDeniedDetail" => self::defaultAny(@$err["AccessDeniedDetail"], @$err["accessDeniedDetail"])
+ ]);
+ }
+ if (Utils::equalString($params->bodyType, "binary")) {
+ $resp = [
+ "body" => $_response->body,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ return $resp;
+ } else if (Utils::equalString($params->bodyType, "byte")) {
+ $byt = Utils::readAsBytes($_response->body);
+ return [
+ "body" => $byt,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($params->bodyType, "string")) {
+ $str = Utils::readAsString($_response->body);
+ return [
+ "body" => $str,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($params->bodyType, "json")) {
+ $obj = Utils::readAsJSON($_response->body);
+ $res = Utils::assertAsMap($obj);
+ return [
+ "body" => $res,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else if (Utils::equalString($params->bodyType, "array")) {
+ $arr = Utils::readAsJSON($_response->body);
+ return [
+ "body" => $arr,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ } else {
+ $anything = Utils::readAsString($_response->body);
+ return [
+ "body" => $anything,
+ "headers" => $_response->headers,
+ "statusCode" => $_response->statusCode
+ ];
+ }
+ } catch (Exception $e) {
+ if (!($e instanceof TeaError)) {
+ $e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
+ }
+ if (Tea::isRetryable($e)) {
+ $_lastException = $e;
+ continue;
+ }
+ throw $e;
+ }
+ }
+ throw new TeaUnableRetryError($_lastRequest, $_lastException);
+ }
+
+ /**
+ * Encapsulate the request and invoke the network
+ * @param Params $params
+ * @param OpenApiRequest $request object of OpenApiRequest
+ * @param RuntimeOptions $runtime which controls some details of call api, such as retry times
+ * @return array the response
+ * @throws TeaError
+ * @throws Exception
+ * @throws TeaUnableRetryError
+ */
+ public function execute($params, $request, $runtime)
+ {
+ $params->validate();
+ $request->validate();
+ $runtime->validate();
+ $_runtime = [
+ "timeouted" => "retry",
+ "key" => Utils::defaultString($runtime->key, $this->_key),
+ "cert" => Utils::defaultString($runtime->cert, $this->_cert),
+ "ca" => Utils::defaultString($runtime->ca, $this->_ca),
+ "readTimeout" => Utils::defaultNumber($runtime->readTimeout, $this->_readTimeout),
+ "connectTimeout" => Utils::defaultNumber($runtime->connectTimeout, $this->_connectTimeout),
+ "httpProxy" => Utils::defaultString($runtime->httpProxy, $this->_httpProxy),
+ "httpsProxy" => Utils::defaultString($runtime->httpsProxy, $this->_httpsProxy),
+ "noProxy" => Utils::defaultString($runtime->noProxy, $this->_noProxy),
+ "socks5Proxy" => Utils::defaultString($runtime->socks5Proxy, $this->_socks5Proxy),
+ "socks5NetWork" => Utils::defaultString($runtime->socks5NetWork, $this->_socks5NetWork),
+ "maxIdleConns" => Utils::defaultNumber($runtime->maxIdleConns, $this->_maxIdleConns),
+ "retry" => [
+ "retryable" => $runtime->autoretry,
+ "maxAttempts" => Utils::defaultNumber($runtime->maxAttempts, 3)
+ ],
+ "backoff" => [
+ "policy" => Utils::defaultString($runtime->backoffPolicy, "no"),
+ "period" => Utils::defaultNumber($runtime->backoffPeriod, 1)
+ ],
+ "ignoreSSL" => $runtime->ignoreSSL
+ ];
+ $_lastRequest = null;
+ $_lastException = null;
+ $_now = time();
+ $_retryTimes = 0;
+ while (Tea::allowRetry(@$_runtime["retry"], $_retryTimes, $_now)) {
+ if ($_retryTimes > 0) {
+ $_backoffTime = Tea::getBackoffTime(@$_runtime["backoff"], $_retryTimes);
+ if ($_backoffTime > 0) {
+ Tea::sleep($_backoffTime);
+ }
+ }
+ $_retryTimes = $_retryTimes + 1;
+ try {
+ $_request = new Request();
+ // spi = new Gateway();//Gateway implements SPI,这一步在产品 SDK 中实例化
+ $headers = $this->getRpcHeaders();
+ $globalQueries = [];
+ $globalHeaders = [];
+ if (!Utils::isUnset($this->_globalParameters)) {
+ $globalParams = $this->_globalParameters;
+ if (!Utils::isUnset($globalParams->queries)) {
+ $globalQueries = $globalParams->queries;
+ }
+ if (!Utils::isUnset($globalParams->headers)) {
+ $globalHeaders = $globalParams->headers;
+ }
+ }
+ $requestContext = new \Darabonba\GatewaySpi\Models\InterceptorContext\request([
+ "headers" => Tea::merge($globalHeaders, $request->headers, $headers),
+ "query" => Tea::merge($globalQueries, $request->query),
+ "body" => $request->body,
+ "stream" => $request->stream,
+ "hostMap" => $request->hostMap,
+ "pathname" => $params->pathname,
+ "productId" => $this->_productId,
+ "action" => $params->action,
+ "version" => $params->version,
+ "protocol" => Utils::defaultString($this->_protocol, $params->protocol),
+ "method" => Utils::defaultString($this->_method, $params->method),
+ "authType" => $params->authType,
+ "bodyType" => $params->bodyType,
+ "reqBodyType" => $params->reqBodyType,
+ "style" => $params->style,
+ "credential" => $this->_credential,
+ "signatureVersion" => $this->_signatureVersion,
+ "signatureAlgorithm" => $this->_signatureAlgorithm,
+ "userAgent" => $this->getUserAgent()
+ ]);
+ $configurationContext = new configuration([
+ "regionId" => $this->_regionId,
+ "endpoint" => Utils::defaultString($request->endpointOverride, $this->_endpoint),
+ "endpointRule" => $this->_endpointRule,
+ "endpointMap" => $this->_endpointMap,
+ "endpointType" => $this->_endpointType,
+ "network" => $this->_network,
+ "suffix" => $this->_suffix
+ ]);
+ $interceptorContext = new InterceptorContext([
+ "request" => $requestContext,
+ "configuration" => $configurationContext
+ ]);
+ $attributeMap = new AttributeMap([]);
+ // 1. spi.modifyConfiguration(context: SPI.InterceptorContext, attributeMap: SPI.AttributeMap);
+ $this->_spi->modifyConfiguration($interceptorContext, $attributeMap);
+ // 2. spi.modifyRequest(context: SPI.InterceptorContext, attributeMap: SPI.AttributeMap);
+ $this->_spi->modifyRequest($interceptorContext, $attributeMap);
+ $_request->protocol = $interceptorContext->request->protocol;
+ $_request->method = $interceptorContext->request->method;
+ $_request->pathname = $interceptorContext->request->pathname;
+ $_request->query = $interceptorContext->request->query;
+ $_request->body = $interceptorContext->request->stream;
+ $_request->headers = $interceptorContext->request->headers;
+ $_lastRequest = $_request;
+ $_response = Tea::send($_request, $_runtime);
+ $responseContext = new response([
+ "statusCode" => $_response->statusCode,
+ "headers" => $_response->headers,
+ "body" => $_response->body
+ ]);
+ $interceptorContext->response = $responseContext;
+ // 3. spi.modifyResponse(context: SPI.InterceptorContext, attributeMap: SPI.AttributeMap);
+ $this->_spi->modifyResponse($interceptorContext, $attributeMap);
+ return [
+ "headers" => $interceptorContext->response->headers,
+ "statusCode" => $interceptorContext->response->statusCode,
+ "body" => $interceptorContext->response->deserializedBody
+ ];
+ } catch (Exception $e) {
+ if (!($e instanceof TeaError)) {
+ $e = new TeaError([], $e->getMessage(), $e->getCode(), $e);
+ }
+ if (Tea::isRetryable($e)) {
+ $_lastException = $e;
+ continue;
+ }
+ throw $e;
+ }
+ }
+ throw new TeaUnableRetryError($_lastRequest, $_lastException);
+ }
+
+ /**
+ * @param Params $params
+ * @param OpenApiRequest $request
+ * @param RuntimeOptions $runtime
+ * @return array
+ * @throws TeaError
+ */
+ public function callApi($params, $request, $runtime)
+ {
+ if (Utils::isUnset($params)) {
+ throw new TeaError([
+ "code" => "ParameterMissing",
+ "message" => "'params' can not be unset"
+ ]);
+ }
+ if (Utils::isUnset($this->_signatureAlgorithm) || !Utils::equalString($this->_signatureAlgorithm, "v2")) {
+ return $this->doRequest($params, $request, $runtime);
+ } else if (Utils::equalString($params->style, "ROA") && Utils::equalString($params->reqBodyType, "json")) {
+ return $this->doROARequest($params->action, $params->version, $params->protocol, $params->method, $params->authType, $params->pathname, $params->bodyType, $request, $runtime);
+ } else if (Utils::equalString($params->style, "ROA")) {
+ return $this->doROARequestWithForm($params->action, $params->version, $params->protocol, $params->method, $params->authType, $params->pathname, $params->bodyType, $request, $runtime);
+ } else {
+ return $this->doRPCRequest($params->action, $params->version, $params->protocol, $params->method, $params->authType, $params->bodyType, $request, $runtime);
+ }
+ }
+
+ /**
+ * Get user agent
+ * @return string user agent
+ */
+ public function getUserAgent()
+ {
+ $userAgent = Utils::getUserAgent($this->_userAgent);
+ return $userAgent;
+ }
+
+ /**
+ * Get accesskey id by using credential
+ * @return string accesskey id
+ */
+ public function getAccessKeyId()
+ {
+ if (Utils::isUnset($this->_credential)) {
+ return '';
+ }
+ $accessKeyId = $this->_credential->getAccessKeyId();
+ return $accessKeyId;
+ }
+
+ /**
+ * Get accesskey secret by using credential
+ * @return string accesskey secret
+ */
+ public function getAccessKeySecret()
+ {
+ if (Utils::isUnset($this->_credential)) {
+ return '';
+ }
+ $secret = $this->_credential->getAccessKeySecret();
+ return $secret;
+ }
+
+ /**
+ * Get security token by using credential
+ * @return string security token
+ */
+ public function getSecurityToken()
+ {
+ if (Utils::isUnset($this->_credential)) {
+ return '';
+ }
+ $token = $this->_credential->getSecurityToken();
+ return $token;
+ }
+
+ /**
+ * Get bearer token by credential
+ * @return string bearer token
+ */
+ public function getBearerToken()
+ {
+ if (Utils::isUnset($this->_credential)) {
+ return '';
+ }
+ $token = $this->_credential->getBearerToken();
+ return $token;
+ }
+
+ /**
+ * Get credential type by credential
+ * @return string credential type e.g. access_key
+ */
+ public function getType()
+ {
+ if (Utils::isUnset($this->_credential)) {
+ return '';
+ }
+ $authType = $this->_credential->getType();
+ return $authType;
+ }
+
+ /**
+ * If inputValue is not null, return it or return defaultValue
+ * @param mixed $inputValue users input value
+ * @param mixed $defaultValue default value
+ * @return any the final result
+ */
+ public static function defaultAny($inputValue, $defaultValue)
+ {
+ if (Utils::isUnset($inputValue)) {
+ return $defaultValue;
+ }
+ return $inputValue;
+ }
+
+ /**
+ * If the endpointRule and config.endpoint are empty, throw error
+ * @param \Darabonba\OpenApi\Models\Config $config config contains the necessary information to create a client
+ * @return void
+ * @throws TeaError
+ */
+ public function checkConfig($config)
+ {
+ if (Utils::empty_($this->_endpointRule) && Utils::empty_($config->endpoint)) {
+ throw new TeaError([
+ "code" => "ParameterMissing",
+ "message" => "'config.endpoint' can not be empty"
+ ]);
+ }
+ }
+
+ /**
+ * set gateway client
+ * @param Client $spi
+ * @return void
+ */
+ public function setGatewayClient($spi)
+ {
+ $this->_spi = $spi;
+ }
+
+ /**
+ * set RPC header for debug
+ * @param string[] $headers headers for debug, this header can be used only once.
+ * @return void
+ */
+ public function setRpcHeaders($headers)
+ {
+ $this->_headers = $headers;
+ }
+
+ /**
+ * get RPC header for debug
+ * @return array
+ */
+ public function getRpcHeaders()
+ {
+ $headers = $this->_headers;
+ $this->_headers = null;
+ return $headers;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/endpoint-util/src/Endpoint.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/endpoint-util/src/Endpoint.php
new file mode 100644
index 000000000..5afa676c5
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/endpoint-util/src/Endpoint.php
@@ -0,0 +1,61 @@
+..aliyuncs.com';
+ const CENTRAL_RULES = '.aliyuncs.com';
+
+ /**
+ * @param string $product required
+ * @param string $regionId optional It will be required when endpoint type is 'regional'
+ * @param string $endpointType optional regional|central
+ * @param string $network optional
+ * @param string $suffix optional
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return string
+ */
+ public static function getEndpointRules($product, $regionId, $endpointType = '', $network = '', $suffix = '')
+ {
+ if (empty($product)) {
+ throw new \InvalidArgumentException('Product name cannot be empty.');
+ }
+ $endpoint = self::REGIONAL_RULES;
+ if (self::ENDPOINT_TYPE_REGIONAL === $endpointType) {
+ if (empty($regionId)) {
+ throw new \InvalidArgumentException('RegionId is empty, please set a valid RegionId');
+ }
+ $endpoint = self::render($endpoint, 'region_id', strtolower($regionId));
+ } elseif (self::ENDPOINT_TYPE_CENTRAL === $endpointType) {
+ $endpoint = self::CENTRAL_RULES;
+ } else {
+ throw new \InvalidArgumentException('Invalid EndpointType');
+ }
+ if (!empty($network) && 'public' !== $network) {
+ $endpoint = self::render($endpoint, 'network', '-' . $network);
+ } else {
+ $endpoint = self::render($endpoint, 'network', '');
+ }
+ if (!empty($suffix)) {
+ $endpoint = self::render($endpoint, 'suffix', '-' . $suffix);
+ } else {
+ $endpoint = self::render($endpoint, 'suffix', '');
+ }
+
+ return self::render($endpoint, 'product', strtolower($product));
+ }
+
+ private static function render($str, $tag, $replace)
+ {
+ return str_replace('<' . $tag . '>', $replace, $str);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/openapi-util/autoload.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/openapi-util/autoload.php
new file mode 100644
index 000000000..b787ba0e2
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/openapi-util/autoload.php
@@ -0,0 +1,17 @@
+toMap();
+ $map = self::exceptStream($map);
+ $newContent = $content::fromMap($map);
+ $class = new \ReflectionClass($newContent);
+ foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
+ $name = $property->getName();
+ if (!$property->isStatic()) {
+ $content->{$name} = $property->getValue($newContent);
+ }
+ }
+ }
+
+ private static function exceptStream($map)
+ {
+ if ($map instanceof StreamInterface) {
+ return null;
+ } elseif (\is_array($map)) {
+ $data = [];
+ foreach ($map as $k => $v) {
+ if (null !== $v) {
+ $item = self::exceptStream($v);
+ if (null !== $item) {
+ $data[$k] = $item;
+ }
+ } else {
+ $data[$k] = $v;
+ }
+ }
+ return $data;
+ }
+ return $map;
+ }
+
+ /**
+ * Get the string to be signed according to request.
+ *
+ * @param Request $request which contains signed messages
+ *
+ * @return string the signed string
+ */
+ public static function getStringToSign($request)
+ {
+ $pathname = $request->pathname ?: '';
+ $query = $request->query ?: [];
+
+ $accept = isset($request->headers['accept']) ? $request->headers['accept'] : '';
+ $contentMD5 = isset($request->headers['content-md5']) ? $request->headers['content-md5'] : '';
+ $contentType = isset($request->headers['content-type']) ? $request->headers['content-type'] : '';
+ $date = isset($request->headers['date']) ? $request->headers['date'] : '';
+
+ $result = $request->method . "\n" .
+ $accept . "\n" .
+ $contentMD5 . "\n" .
+ $contentType . "\n" .
+ $date . "\n";
+
+ $canonicalizedHeaders = self::getCanonicalizedHeaders($request->headers);
+ $canonicalizedResource = self::getCanonicalizedResource($pathname, $query);
+
+ return $result . $canonicalizedHeaders . $canonicalizedResource;
+ }
+
+ /**
+ * Get signature according to stringToSign, secret.
+ *
+ * @param string $stringToSign the signed string
+ * @param string $secret accesskey secret
+ *
+ * @return string the signature
+ */
+ public static function getROASignature($stringToSign, $secret)
+ {
+ return base64_encode(hash_hmac('sha1', $stringToSign, $secret, true));
+ }
+
+ /**
+ * Parse filter into a form string.
+ *
+ * @param array $filter object
+ *
+ * @return string the string
+ */
+ public static function toForm($filter)
+ {
+ $query = $filter;
+ if (null === $query) {
+ return '';
+ }
+ if ($query instanceof Model) {
+ $query = $query->toMap();
+ }
+ $tmp = [];
+ foreach ($query as $k => $v) {
+ if (0 !== strpos($k, '_')) {
+ $tmp[$k] = $v;
+ }
+ }
+ $res = self::flatten($tmp);
+ ksort($res);
+
+ return http_build_query($res);
+ }
+
+ /**
+ * Get timestamp.
+ *
+ * @return string the timestamp string
+ */
+ public static function getTimestamp()
+ {
+ return gmdate('Y-m-d\\TH:i:s\\Z');
+ }
+
+ /**
+ * Parse filter into a object which's type is map[string]string.
+ *
+ * @param array $filter query param
+ *
+ * @return array the object
+ */
+ public static function query($filter)
+ {
+ if (null === $filter) {
+ return [];
+ }
+ $dict = $filter;
+ if ($dict instanceof Model) {
+ $dict = $dict->toMap();
+ }
+ $tmp = [];
+ foreach ($dict as $k => $v) {
+ if (0 !== strpos($k, '_')) {
+ $tmp[$k] = $v;
+ }
+ }
+
+ return self::flatten($tmp);
+ }
+
+ /**
+ * Get signature according to signedParams, method and secret.
+ *
+ * @param array $signedParams params which need to be signed
+ * @param string $method http method e.g. GET
+ * @param string $secret AccessKeySecret
+ *
+ * @return string the signature
+ */
+ public static function getRPCSignature($signedParams, $method, $secret)
+ {
+ $secret .= '&';
+ $strToSign = self::getRpcStrToSign($method, $signedParams);
+
+ $signMethod = 'HMAC-SHA1';
+
+ return self::encode($signMethod, $strToSign, $secret);
+ }
+
+ /**
+ * Parse object into a string with specified style.
+ *
+ * @style specified style e.g. repeatList
+ *
+ * @param mixed $object the object
+ * @param string $prefix the prefix string
+ * @param string $style
+ *
+ * @return string the string
+ */
+ public static function arrayToStringWithSpecifiedStyle($object, $prefix, $style)
+ {
+ if (null === $object) {
+ return '';
+ }
+ if ('repeatList' === $style) {
+ return self::toForm([$prefix => $object]);
+ }
+ if ('simple' == $style || 'spaceDelimited' == $style || 'pipeDelimited' == $style) {
+ $strs = self::flatten($object);
+
+ switch ($style) {
+ case 'spaceDelimited':
+ return implode(' ', $strs);
+
+ case 'pipeDelimited':
+ return implode('|', $strs);
+
+ default:
+ return implode(',', $strs);
+ }
+ } elseif ('json' === $style) {
+ self::parse($object, $parsed);
+ return json_encode($parsed);
+ }
+
+ return '';
+ }
+
+ /**
+ * Transform input as array.
+ *
+ * @param mixed $input
+ *
+ * @return array
+ */
+ public static function parseToArray($input)
+ {
+ self::parse($input, $result);
+
+ return $result;
+ }
+
+ /**
+ * Transform input as map.
+ *
+ * @param mixed $input
+ *
+ * @return array
+ */
+ public static function parseToMap($input)
+ {
+ self::parse($input, $result);
+
+ return $result;
+ }
+
+ public static function getEndpoint($endpoint, $useAccelerate, $endpointType = 'public')
+ {
+ if ('internal' == $endpointType) {
+ $tmp = explode('.', $endpoint);
+ $tmp[0] .= '-internal';
+ $endpoint = implode('.', $tmp);
+ }
+ if ($useAccelerate && 'accelerate' == $endpointType) {
+ return 'oss-accelerate.aliyuncs.com';
+ }
+
+ return $endpoint;
+ }
+
+ /**
+ * Encode raw with base16.
+ *
+ * @param int[] $raw encoding data
+ *
+ * @return string encoded string
+ */
+ public static function hexEncode($raw)
+ {
+ if (is_array($raw)) {
+ $raw = Utils::toString($raw);
+ }
+ return bin2hex($raw);
+ }
+
+ /**
+ * Hash the raw data with signatureAlgorithm.
+ *
+ * @param int[] $raw hashing data
+ * @param string $signatureAlgorithm the autograph method
+ *
+ * @return array hashed bytes
+ */
+ public static function hash($raw, $signatureAlgorithm)
+ {
+ $str = Utils::toString($raw);
+
+ switch ($signatureAlgorithm) {
+ case 'ACS3-HMAC-SHA256':
+ case 'ACS3-RSA-SHA256':
+ $res = hash('sha256', $str, true);
+ return Utils::toBytes($res);
+ case 'ACS3-HMAC-SM3':
+ $res = self::sm3($str);
+ return Utils::toBytes(hex2bin($res));
+ }
+
+ return [];
+ }
+
+ /**
+ * Get the authorization.
+ *
+ * @param Request $request request params
+ * @param string $signatureAlgorithm the autograph method
+ * @param string $payload the hashed request
+ * @param string $accesskey the accessKey string
+ * @param string $accessKeySecret the accessKeySecret string
+ *
+ * @return string authorization string
+ * @throws \ErrorException
+ *
+ */
+ public static function getAuthorization($request, $signatureAlgorithm, $payload, $accesskey, $accessKeySecret)
+ {
+ $canonicalURI = $request->pathname ? $request->pathname : '/';
+ $query = $request->query ?: [];
+ $method = strtoupper($request->method);
+ $canonicalQueryString = self::getCanonicalQueryString($query);
+ $signHeaders = [];
+ foreach ($request->headers as $k => $v) {
+ $k = strtolower($k);
+ if (0 === strpos($k, 'x-acs-') || 'host' === $k || 'content-type' === $k) {
+ $signHeaders[$k] = $v;
+ }
+ }
+ ksort($signHeaders);
+ $headers = [];
+ foreach ($request->headers as $k => $v) {
+ $k = strtolower($k);
+ if (0 === strpos($k, 'x-acs-') || 'host' === $k || 'content-type' === $k) {
+ $headers[$k] = trim($v);
+ }
+ }
+ $canonicalHeaderString = '';
+ ksort($headers);
+ foreach ($headers as $k => $v) {
+ $canonicalHeaderString .= $k . ':' . trim(self::filter($v)) . "\n";
+ }
+ if (empty($canonicalHeaderString)) {
+ $canonicalHeaderString = "\n";
+ }
+
+ $canonicalRequest = $method . "\n" . $canonicalURI . "\n" . $canonicalQueryString . "\n" .
+ $canonicalHeaderString . "\n" . implode(';', array_keys($signHeaders)) . "\n" . $payload;
+ $strtosign = $signatureAlgorithm . "\n" . self::hexEncode(self::hash(Utils::toBytes($canonicalRequest), $signatureAlgorithm));
+ $signature = self::sign($accessKeySecret, $strtosign, $signatureAlgorithm);
+ $signature = self::hexEncode($signature);
+
+ return $signatureAlgorithm .
+ ' Credential=' . $accesskey .
+ ',SignedHeaders=' . implode(';', array_keys($signHeaders)) .
+ ',Signature=' . $signature;
+ }
+
+ public static function sign($secret, $str, $algorithm)
+ {
+ $result = '';
+ switch ($algorithm) {
+ case 'ACS3-HMAC-SHA256':
+ $result = hash_hmac('sha256', $str, $secret, true);
+ break;
+ case 'ACS3-HMAC-SM3':
+ $result = self::hmac_sm3($str, $secret, true);
+ break;
+ case 'ACS3-RSA-SHA256':
+ $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" . $secret . "\n-----END RSA PRIVATE KEY-----";
+ @openssl_sign($str, $result, $privateKey, OPENSSL_ALGO_SHA256);
+ }
+
+ return Utils::toBytes($result);
+ }
+
+ /**
+ * Get encoded path.
+ *
+ * @param string $path the raw path
+ *
+ * @return string encoded path
+ */
+ public static function getEncodePath($path)
+ {
+ $tmp = explode('/', $path);
+ foreach ($tmp as &$t) {
+ $t = rawurlencode($t);
+ }
+
+ return implode('/', $tmp);
+ }
+
+ /**
+ * Get encoded param.
+ *
+ * @param string $param the raw param
+ *
+ * @return string encoded param
+ */
+ public static function getEncodeParam($param)
+ {
+ return rawurlencode($param);
+ }
+
+ private static function getRpcStrToSign($method, $query)
+ {
+ ksort($query);
+
+ $params = [];
+ foreach ($query as $k => $v) {
+ if (null !== $v) {
+ $k = rawurlencode($k);
+ $v = rawurlencode($v);
+ $params[] = $k . '=' . (string)$v;
+ }
+ }
+ $str = implode('&', $params);
+
+ return $method . '&' . rawurlencode('/') . '&' . rawurlencode($str);
+ }
+
+ private static function encode($signMethod, $strToSign, $secret)
+ {
+ switch ($signMethod) {
+ case 'HMAC-SHA256':
+ return base64_encode(hash_hmac('sha256', $strToSign, $secret, true));
+
+ default:
+ return base64_encode(hash_hmac('sha1', $strToSign, $secret, true));
+ }
+ }
+
+ /**
+ * @param array $items
+ * @param string $delimiter
+ * @param string $prepend
+ *
+ * @return array
+ */
+ private static function flatten($items = [], $delimiter = '.', $prepend = '')
+ {
+ $flatten = [];
+
+ foreach ($items as $key => $value) {
+ $pos = \is_int($key) ? $key + 1 : $key;
+
+ if ($value instanceof Model) {
+ $value = $value->toMap();
+ } elseif (\is_object($value)) {
+ $value = get_object_vars($value);
+ }
+
+ if (\is_array($value) && !empty($value)) {
+ $flatten = array_merge(
+ $flatten,
+ self::flatten($value, $delimiter, $prepend . $pos . $delimiter)
+ );
+ } else {
+ if (\is_bool($value)) {
+ $value = true === $value ? 'true' : 'false';
+ }
+ $flatten[$prepend . $pos] = $value;
+ }
+ }
+
+ return $flatten;
+ }
+
+ private static function getCanonicalizedHeaders($headers, $prefix = 'x-acs-')
+ {
+ ksort($headers);
+ $str = '';
+ foreach ($headers as $k => $v) {
+ if (0 === strpos(strtolower($k), $prefix)) {
+ $str .= $k . ':' . trim(self::filter($v)) . "\n";
+ }
+ }
+
+ return $str;
+ }
+
+ private static function getCanonicalizedResource($pathname, $query)
+ {
+ if (0 === \count($query)) {
+ return $pathname;
+ }
+ ksort($query);
+ $tmp = [];
+ foreach ($query as $k => $v) {
+ if (!empty($v)) {
+ $tmp[] = $k . '=' . $v;
+ } else {
+ $tmp[] = $k;
+ }
+ }
+
+ return $pathname . '?' . implode('&', $tmp);
+ }
+
+ private static function parse($input, &$output)
+ {
+ if (null === $input || '' === $input) {
+ $output = [];
+ }
+ $recursive = function ($input) use (&$recursive) {
+ if ($input instanceof Model) {
+ $input = $input->toMap();
+ } elseif (\is_object($input)) {
+ $input = get_object_vars($input);
+ }
+ if (!\is_array($input)) {
+ return $input;
+ }
+ $data = [];
+ foreach ($input as $k => $v) {
+ $data[$k] = $recursive($v);
+ }
+
+ return $data;
+ };
+ $output = $recursive($input);
+ if (!\is_array($output)) {
+ $output = [$output];
+ }
+ }
+
+ private static function filter($str)
+ {
+ return str_replace(["\t", "\n", "\r", "\f"], '', $str);
+ }
+
+ private static function hmac_sm3($data, $key, $raw_output = false)
+ {
+ $pack = 'H' . \strlen(self::sm3('test'));
+ $blocksize = 64;
+ if (\strlen($key) > $blocksize) {
+ $key = pack($pack, self::sm3($key));
+ }
+ $key = str_pad($key, $blocksize, \chr(0x00));
+ $ipad = $key ^ str_repeat(\chr(0x36), $blocksize);
+ $opad = $key ^ str_repeat(\chr(0x5C), $blocksize);
+ $hmac = self::sm3($opad . pack($pack, self::sm3($ipad . $data)));
+
+ return $raw_output ? pack($pack, $hmac) : $hmac;
+ }
+
+ private static function sm3($message)
+ {
+ return (new Sm3())->sign($message);
+ }
+
+ private static function getCanonicalQueryString($query)
+ {
+ ksort($query);
+
+ $params = [];
+ foreach ($query as $k => $v) {
+ if (null === $v) {
+ continue;
+ }
+ $str = rawurlencode($k);
+ if ('' !== $v && null !== $v) {
+ $str .= '=' . rawurlencode($v);
+ } else {
+ $str .= '=';
+ }
+ $params[] = $str;
+ }
+
+ return implode('&', $params);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/autoload.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/autoload.php
new file mode 100644
index 000000000..f81b54e8f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/autoload.php
@@ -0,0 +1,17 @@
+ 'DurationSeconds',
+ 'externalId' => 'ExternalId',
+ 'policy' => 'Policy',
+ 'roleArn' => 'RoleArn',
+ 'roleSessionName' => 'RoleSessionName',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->durationSeconds) {
+ $res['DurationSeconds'] = $this->durationSeconds;
+ }
+ if (null !== $this->externalId) {
+ $res['ExternalId'] = $this->externalId;
+ }
+ if (null !== $this->policy) {
+ $res['Policy'] = $this->policy;
+ }
+ if (null !== $this->roleArn) {
+ $res['RoleArn'] = $this->roleArn;
+ }
+ if (null !== $this->roleSessionName) {
+ $res['RoleSessionName'] = $this->roleSessionName;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleRequest
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['DurationSeconds'])) {
+ $model->durationSeconds = $map['DurationSeconds'];
+ }
+ if (isset($map['ExternalId'])) {
+ $model->externalId = $map['ExternalId'];
+ }
+ if (isset($map['Policy'])) {
+ $model->policy = $map['Policy'];
+ }
+ if (isset($map['RoleArn'])) {
+ $model->roleArn = $map['RoleArn'];
+ }
+ if (isset($map['RoleSessionName'])) {
+ $model->roleSessionName = $map['RoleSessionName'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponse.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponse.php
new file mode 100644
index 000000000..d9a60c6e1
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponse.php
@@ -0,0 +1,74 @@
+ 'headers',
+ 'statusCode' => 'statusCode',
+ 'body' => 'body',
+ ];
+
+ public function validate()
+ {
+ Model::validateRequired('headers', $this->headers, true);
+ Model::validateRequired('statusCode', $this->statusCode, true);
+ Model::validateRequired('body', $this->body, true);
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->headers) {
+ $res['headers'] = $this->headers;
+ }
+ if (null !== $this->statusCode) {
+ $res['statusCode'] = $this->statusCode;
+ }
+ if (null !== $this->body) {
+ $res['body'] = null !== $this->body ? $this->body->toMap() : null;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleResponse
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['headers'])) {
+ $model->headers = $map['headers'];
+ }
+ if (isset($map['statusCode'])) {
+ $model->statusCode = $map['statusCode'];
+ }
+ if (isset($map['body'])) {
+ $model->body = AssumeRoleResponseBody::fromMap($map['body']);
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody.php
new file mode 100644
index 000000000..8b8273aa3
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody.php
@@ -0,0 +1,81 @@
+ 'AssumedRoleUser',
+ 'credentials' => 'Credentials',
+ 'requestId' => 'RequestId',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->assumedRoleUser) {
+ $res['AssumedRoleUser'] = null !== $this->assumedRoleUser ? $this->assumedRoleUser->toMap() : null;
+ }
+ if (null !== $this->credentials) {
+ $res['Credentials'] = null !== $this->credentials ? $this->credentials->toMap() : null;
+ }
+ if (null !== $this->requestId) {
+ $res['RequestId'] = $this->requestId;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleResponseBody
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['AssumedRoleUser'])) {
+ $model->assumedRoleUser = assumedRoleUser::fromMap($map['AssumedRoleUser']);
+ }
+ if (isset($map['Credentials'])) {
+ $model->credentials = credentials::fromMap($map['Credentials']);
+ }
+ if (isset($map['RequestId'])) {
+ $model->requestId = $map['RequestId'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody/assumedRoleUser.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody/assumedRoleUser.php
new file mode 100644
index 000000000..eeec68c24
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody/assumedRoleUser.php
@@ -0,0 +1,67 @@
+ 'Arn',
+ 'assumedRoleId' => 'AssumedRoleId',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->arn) {
+ $res['Arn'] = $this->arn;
+ }
+ if (null !== $this->assumedRoleId) {
+ $res['AssumedRoleId'] = $this->assumedRoleId;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return assumedRoleUser
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['Arn'])) {
+ $model->arn = $map['Arn'];
+ }
+ if (isset($map['AssumedRoleId'])) {
+ $model->assumedRoleId = $map['AssumedRoleId'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody/credentials.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody/credentials.php
new file mode 100644
index 000000000..284728c7d
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleResponseBody/credentials.php
@@ -0,0 +1,100 @@
+ Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens.
+ * @example ********
+ *
+ * @var string
+ */
+ public $securityToken;
+ protected $_name = [
+ 'accessKeyId' => 'AccessKeyId',
+ 'accessKeySecret' => 'AccessKeySecret',
+ 'expiration' => 'Expiration',
+ 'securityToken' => 'SecurityToken',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->accessKeyId) {
+ $res['AccessKeyId'] = $this->accessKeyId;
+ }
+ if (null !== $this->accessKeySecret) {
+ $res['AccessKeySecret'] = $this->accessKeySecret;
+ }
+ if (null !== $this->expiration) {
+ $res['Expiration'] = $this->expiration;
+ }
+ if (null !== $this->securityToken) {
+ $res['SecurityToken'] = $this->securityToken;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return credentials
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['AccessKeyId'])) {
+ $model->accessKeyId = $map['AccessKeyId'];
+ }
+ if (isset($map['AccessKeySecret'])) {
+ $model->accessKeySecret = $map['AccessKeySecret'];
+ }
+ if (isset($map['Expiration'])) {
+ $model->expiration = $map['Expiration'];
+ }
+ if (isset($map['SecurityToken'])) {
+ $model->securityToken = $map['SecurityToken'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCRequest.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCRequest.php
new file mode 100644
index 000000000..9a36af01f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCRequest.php
@@ -0,0 +1,148 @@
+ You must enter the original OIDC token. You do not need to enter the Base64-encoded OIDC token.
+ * @example eyJraWQiOiJKQzl3eHpyaHFKMGd0****
+ *
+ * @var string
+ */
+ public $OIDCToken;
+
+ /**
+ * @description The policy that specifies the permissions of the returned STS token. You can use this parameter to grant the STS token fewer permissions than the permissions granted to the RAM role.
+ *
+ * If you specify this parameter, the permissions of the returned STS token are the permissions that are included in the value of this parameter and owned by the RAM role.
+ * If you do not specify this parameter, the returned STS token has all the permissions of the RAM role.
+ *
+ * The value must be 1 to 2,048 characters in length.
+ * @example {"Statement": [{"Action": ["*"],"Effect": "Allow","Resource": ["*"]}],"Version":"1"}
+ *
+ * @var string
+ */
+ public $policy;
+
+ /**
+ * @description The ARN of the RAM role.
+ *
+ * You can view the ARN in the RAM console or by calling operations.
+ *
+ * For more information about how to view the ARN in the RAM console, see [How do I view the ARN of the RAM role?](~~39744~~)
+ * For more information about how to view the ARN by calling operations, see [ListRoles](~~28713~~) or [GetRole](~~28711~~).
+ *
+ * @example acs:ram::113511544585****:role/testoidc
+ *
+ * @var string
+ */
+ public $roleArn;
+
+ /**
+ * @description The custom name of the role session.
+ *
+ * The value must be 2 to 64 characters in length.
+ * @example TestOidcAssumedRoleSession
+ *
+ * @var string
+ */
+ public $roleSessionName;
+ protected $_name = [
+ 'durationSeconds' => 'DurationSeconds',
+ 'OIDCProviderArn' => 'OIDCProviderArn',
+ 'OIDCToken' => 'OIDCToken',
+ 'policy' => 'Policy',
+ 'roleArn' => 'RoleArn',
+ 'roleSessionName' => 'RoleSessionName',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->durationSeconds) {
+ $res['DurationSeconds'] = $this->durationSeconds;
+ }
+ if (null !== $this->OIDCProviderArn) {
+ $res['OIDCProviderArn'] = $this->OIDCProviderArn;
+ }
+ if (null !== $this->OIDCToken) {
+ $res['OIDCToken'] = $this->OIDCToken;
+ }
+ if (null !== $this->policy) {
+ $res['Policy'] = $this->policy;
+ }
+ if (null !== $this->roleArn) {
+ $res['RoleArn'] = $this->roleArn;
+ }
+ if (null !== $this->roleSessionName) {
+ $res['RoleSessionName'] = $this->roleSessionName;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleWithOIDCRequest
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['DurationSeconds'])) {
+ $model->durationSeconds = $map['DurationSeconds'];
+ }
+ if (isset($map['OIDCProviderArn'])) {
+ $model->OIDCProviderArn = $map['OIDCProviderArn'];
+ }
+ if (isset($map['OIDCToken'])) {
+ $model->OIDCToken = $map['OIDCToken'];
+ }
+ if (isset($map['Policy'])) {
+ $model->policy = $map['Policy'];
+ }
+ if (isset($map['RoleArn'])) {
+ $model->roleArn = $map['RoleArn'];
+ }
+ if (isset($map['RoleSessionName'])) {
+ $model->roleSessionName = $map['RoleSessionName'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponse.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponse.php
new file mode 100644
index 000000000..766f89ca2
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponse.php
@@ -0,0 +1,74 @@
+ 'headers',
+ 'statusCode' => 'statusCode',
+ 'body' => 'body',
+ ];
+
+ public function validate()
+ {
+ Model::validateRequired('headers', $this->headers, true);
+ Model::validateRequired('statusCode', $this->statusCode, true);
+ Model::validateRequired('body', $this->body, true);
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->headers) {
+ $res['headers'] = $this->headers;
+ }
+ if (null !== $this->statusCode) {
+ $res['statusCode'] = $this->statusCode;
+ }
+ if (null !== $this->body) {
+ $res['body'] = null !== $this->body ? $this->body->toMap() : null;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleWithOIDCResponse
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['headers'])) {
+ $model->headers = $map['headers'];
+ }
+ if (isset($map['statusCode'])) {
+ $model->statusCode = $map['statusCode'];
+ }
+ if (isset($map['body'])) {
+ $model->body = AssumeRoleWithOIDCResponseBody::fromMap($map['body']);
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody.php
new file mode 100644
index 000000000..3cdc486a7
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody.php
@@ -0,0 +1,96 @@
+ 'AssumedRoleUser',
+ 'credentials' => 'Credentials',
+ 'OIDCTokenInfo' => 'OIDCTokenInfo',
+ 'requestId' => 'RequestId',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->assumedRoleUser) {
+ $res['AssumedRoleUser'] = null !== $this->assumedRoleUser ? $this->assumedRoleUser->toMap() : null;
+ }
+ if (null !== $this->credentials) {
+ $res['Credentials'] = null !== $this->credentials ? $this->credentials->toMap() : null;
+ }
+ if (null !== $this->OIDCTokenInfo) {
+ $res['OIDCTokenInfo'] = null !== $this->OIDCTokenInfo ? $this->OIDCTokenInfo->toMap() : null;
+ }
+ if (null !== $this->requestId) {
+ $res['RequestId'] = $this->requestId;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleWithOIDCResponseBody
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['AssumedRoleUser'])) {
+ $model->assumedRoleUser = assumedRoleUser::fromMap($map['AssumedRoleUser']);
+ }
+ if (isset($map['Credentials'])) {
+ $model->credentials = credentials::fromMap($map['Credentials']);
+ }
+ if (isset($map['OIDCTokenInfo'])) {
+ $model->OIDCTokenInfo = OIDCTokenInfo::fromMap($map['OIDCTokenInfo']);
+ }
+ if (isset($map['RequestId'])) {
+ $model->requestId = $map['RequestId'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/OIDCTokenInfo.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/OIDCTokenInfo.php
new file mode 100644
index 000000000..7972ebf61
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/OIDCTokenInfo.php
@@ -0,0 +1,122 @@
+ 'ClientIds',
+ 'expirationTime' => 'ExpirationTime',
+ 'issuanceTime' => 'IssuanceTime',
+ 'issuer' => 'Issuer',
+ 'subject' => 'Subject',
+ 'verificationInfo' => 'VerificationInfo',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->clientIds) {
+ $res['ClientIds'] = $this->clientIds;
+ }
+ if (null !== $this->expirationTime) {
+ $res['ExpirationTime'] = $this->expirationTime;
+ }
+ if (null !== $this->issuanceTime) {
+ $res['IssuanceTime'] = $this->issuanceTime;
+ }
+ if (null !== $this->issuer) {
+ $res['Issuer'] = $this->issuer;
+ }
+ if (null !== $this->subject) {
+ $res['Subject'] = $this->subject;
+ }
+ if (null !== $this->verificationInfo) {
+ $res['VerificationInfo'] = $this->verificationInfo;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return OIDCTokenInfo
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['ClientIds'])) {
+ $model->clientIds = $map['ClientIds'];
+ }
+ if (isset($map['ExpirationTime'])) {
+ $model->expirationTime = $map['ExpirationTime'];
+ }
+ if (isset($map['IssuanceTime'])) {
+ $model->issuanceTime = $map['IssuanceTime'];
+ }
+ if (isset($map['Issuer'])) {
+ $model->issuer = $map['Issuer'];
+ }
+ if (isset($map['Subject'])) {
+ $model->subject = $map['Subject'];
+ }
+ if (isset($map['VerificationInfo'])) {
+ $model->verificationInfo = $map['VerificationInfo'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/assumedRoleUser.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/assumedRoleUser.php
new file mode 100644
index 000000000..b2b3b8bd5
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/assumedRoleUser.php
@@ -0,0 +1,67 @@
+ 'Arn',
+ 'assumedRoleId' => 'AssumedRoleId',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->arn) {
+ $res['Arn'] = $this->arn;
+ }
+ if (null !== $this->assumedRoleId) {
+ $res['AssumedRoleId'] = $this->assumedRoleId;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return assumedRoleUser
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['Arn'])) {
+ $model->arn = $map['Arn'];
+ }
+ if (isset($map['AssumedRoleId'])) {
+ $model->assumedRoleId = $map['AssumedRoleId'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/credentials.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/credentials.php
new file mode 100644
index 000000000..5594a0bf8
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithOIDCResponseBody/credentials.php
@@ -0,0 +1,100 @@
+ Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens.
+ * @example CAIShwJ1q6Ft5B2yfSjIr5bSEsj4g7BihPWGWHz****
+ *
+ * @var string
+ */
+ public $securityToken;
+ protected $_name = [
+ 'accessKeyId' => 'AccessKeyId',
+ 'accessKeySecret' => 'AccessKeySecret',
+ 'expiration' => 'Expiration',
+ 'securityToken' => 'SecurityToken',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->accessKeyId) {
+ $res['AccessKeyId'] = $this->accessKeyId;
+ }
+ if (null !== $this->accessKeySecret) {
+ $res['AccessKeySecret'] = $this->accessKeySecret;
+ }
+ if (null !== $this->expiration) {
+ $res['Expiration'] = $this->expiration;
+ }
+ if (null !== $this->securityToken) {
+ $res['SecurityToken'] = $this->securityToken;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return credentials
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['AccessKeyId'])) {
+ $model->accessKeyId = $map['AccessKeyId'];
+ }
+ if (isset($map['AccessKeySecret'])) {
+ $model->accessKeySecret = $map['AccessKeySecret'];
+ }
+ if (isset($map['Expiration'])) {
+ $model->expiration = $map['Expiration'];
+ }
+ if (isset($map['SecurityToken'])) {
+ $model->securityToken = $map['SecurityToken'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLRequest.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLRequest.php
new file mode 100644
index 000000000..6d843e962
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLRequest.php
@@ -0,0 +1,131 @@
+ A complete SAML response rather than a single SAMLAssertion field must be retrieved from the external IdP.
+ * @example base64_encoded_saml_assertion
+ *
+ * @var string
+ */
+ public $SAMLAssertion;
+
+ /**
+ * @description The Alibaba Cloud Resource Name (ARN) of the SAML IdP that is created in the RAM console.
+ *
+ * You can view the ARN in the RAM console or by calling operations.
+ *
+ * For more information about how to view the ARN in the RAM console, see [How do I view the ARN of a RAM role?](~~116795~~)
+ * For more information about how to view the ARN by calling operations, see [GetSAMLProvider](~~186833~~) or [ListSAMLProviders](~~186851~~).
+ *
+ * @example acs:ram::123456789012****:saml-provider/company1
+ *
+ * @var string
+ */
+ public $SAMLProviderArn;
+ protected $_name = [
+ 'durationSeconds' => 'DurationSeconds',
+ 'policy' => 'Policy',
+ 'roleArn' => 'RoleArn',
+ 'SAMLAssertion' => 'SAMLAssertion',
+ 'SAMLProviderArn' => 'SAMLProviderArn',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->durationSeconds) {
+ $res['DurationSeconds'] = $this->durationSeconds;
+ }
+ if (null !== $this->policy) {
+ $res['Policy'] = $this->policy;
+ }
+ if (null !== $this->roleArn) {
+ $res['RoleArn'] = $this->roleArn;
+ }
+ if (null !== $this->SAMLAssertion) {
+ $res['SAMLAssertion'] = $this->SAMLAssertion;
+ }
+ if (null !== $this->SAMLProviderArn) {
+ $res['SAMLProviderArn'] = $this->SAMLProviderArn;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleWithSAMLRequest
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['DurationSeconds'])) {
+ $model->durationSeconds = $map['DurationSeconds'];
+ }
+ if (isset($map['Policy'])) {
+ $model->policy = $map['Policy'];
+ }
+ if (isset($map['RoleArn'])) {
+ $model->roleArn = $map['RoleArn'];
+ }
+ if (isset($map['SAMLAssertion'])) {
+ $model->SAMLAssertion = $map['SAMLAssertion'];
+ }
+ if (isset($map['SAMLProviderArn'])) {
+ $model->SAMLProviderArn = $map['SAMLProviderArn'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponse.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponse.php
new file mode 100644
index 000000000..ef9664023
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponse.php
@@ -0,0 +1,74 @@
+ 'headers',
+ 'statusCode' => 'statusCode',
+ 'body' => 'body',
+ ];
+
+ public function validate()
+ {
+ Model::validateRequired('headers', $this->headers, true);
+ Model::validateRequired('statusCode', $this->statusCode, true);
+ Model::validateRequired('body', $this->body, true);
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->headers) {
+ $res['headers'] = $this->headers;
+ }
+ if (null !== $this->statusCode) {
+ $res['statusCode'] = $this->statusCode;
+ }
+ if (null !== $this->body) {
+ $res['body'] = null !== $this->body ? $this->body->toMap() : null;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleWithSAMLResponse
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['headers'])) {
+ $model->headers = $map['headers'];
+ }
+ if (isset($map['statusCode'])) {
+ $model->statusCode = $map['statusCode'];
+ }
+ if (isset($map['body'])) {
+ $model->body = AssumeRoleWithSAMLResponseBody::fromMap($map['body']);
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody.php
new file mode 100644
index 000000000..bf4bc5ddc
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody.php
@@ -0,0 +1,96 @@
+ 'AssumedRoleUser',
+ 'credentials' => 'Credentials',
+ 'requestId' => 'RequestId',
+ 'SAMLAssertionInfo' => 'SAMLAssertionInfo',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->assumedRoleUser) {
+ $res['AssumedRoleUser'] = null !== $this->assumedRoleUser ? $this->assumedRoleUser->toMap() : null;
+ }
+ if (null !== $this->credentials) {
+ $res['Credentials'] = null !== $this->credentials ? $this->credentials->toMap() : null;
+ }
+ if (null !== $this->requestId) {
+ $res['RequestId'] = $this->requestId;
+ }
+ if (null !== $this->SAMLAssertionInfo) {
+ $res['SAMLAssertionInfo'] = null !== $this->SAMLAssertionInfo ? $this->SAMLAssertionInfo->toMap() : null;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return AssumeRoleWithSAMLResponseBody
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['AssumedRoleUser'])) {
+ $model->assumedRoleUser = assumedRoleUser::fromMap($map['AssumedRoleUser']);
+ }
+ if (isset($map['Credentials'])) {
+ $model->credentials = credentials::fromMap($map['Credentials']);
+ }
+ if (isset($map['RequestId'])) {
+ $model->requestId = $map['RequestId'];
+ }
+ if (isset($map['SAMLAssertionInfo'])) {
+ $model->SAMLAssertionInfo = SAMLAssertionInfo::fromMap($map['SAMLAssertionInfo']);
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/SAMLAssertionInfo.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/SAMLAssertionInfo.php
new file mode 100644
index 000000000..fe15f757b
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/SAMLAssertionInfo.php
@@ -0,0 +1,99 @@
+ 'Issuer',
+ 'recipient' => 'Recipient',
+ 'subject' => 'Subject',
+ 'subjectType' => 'SubjectType',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->issuer) {
+ $res['Issuer'] = $this->issuer;
+ }
+ if (null !== $this->recipient) {
+ $res['Recipient'] = $this->recipient;
+ }
+ if (null !== $this->subject) {
+ $res['Subject'] = $this->subject;
+ }
+ if (null !== $this->subjectType) {
+ $res['SubjectType'] = $this->subjectType;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return SAMLAssertionInfo
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['Issuer'])) {
+ $model->issuer = $map['Issuer'];
+ }
+ if (isset($map['Recipient'])) {
+ $model->recipient = $map['Recipient'];
+ }
+ if (isset($map['Subject'])) {
+ $model->subject = $map['Subject'];
+ }
+ if (isset($map['SubjectType'])) {
+ $model->subjectType = $map['SubjectType'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/assumedRoleUser.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/assumedRoleUser.php
new file mode 100644
index 000000000..884b2a7cc
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/assumedRoleUser.php
@@ -0,0 +1,67 @@
+ 'Arn',
+ 'assumedRoleId' => 'AssumedRoleId',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->arn) {
+ $res['Arn'] = $this->arn;
+ }
+ if (null !== $this->assumedRoleId) {
+ $res['AssumedRoleId'] = $this->assumedRoleId;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return assumedRoleUser
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['Arn'])) {
+ $model->arn = $map['Arn'];
+ }
+ if (isset($map['AssumedRoleId'])) {
+ $model->assumedRoleId = $map['AssumedRoleId'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/credentials.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/credentials.php
new file mode 100644
index 000000000..1d5b16300
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/AssumeRoleWithSAMLResponseBody/credentials.php
@@ -0,0 +1,100 @@
+ Alibaba Cloud STS does not impose limits on the length of STS tokens. We strongly recommend that you do not specify a maximum length for STS tokens.
+ * @example ********
+ *
+ * @var string
+ */
+ public $securityToken;
+ protected $_name = [
+ 'accessKeyId' => 'AccessKeyId',
+ 'accessKeySecret' => 'AccessKeySecret',
+ 'expiration' => 'Expiration',
+ 'securityToken' => 'SecurityToken',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->accessKeyId) {
+ $res['AccessKeyId'] = $this->accessKeyId;
+ }
+ if (null !== $this->accessKeySecret) {
+ $res['AccessKeySecret'] = $this->accessKeySecret;
+ }
+ if (null !== $this->expiration) {
+ $res['Expiration'] = $this->expiration;
+ }
+ if (null !== $this->securityToken) {
+ $res['SecurityToken'] = $this->securityToken;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return credentials
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['AccessKeyId'])) {
+ $model->accessKeyId = $map['AccessKeyId'];
+ }
+ if (isset($map['AccessKeySecret'])) {
+ $model->accessKeySecret = $map['AccessKeySecret'];
+ }
+ if (isset($map['Expiration'])) {
+ $model->expiration = $map['Expiration'];
+ }
+ if (isset($map['SecurityToken'])) {
+ $model->securityToken = $map['SecurityToken'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/GetCallerIdentityResponse.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/GetCallerIdentityResponse.php
new file mode 100644
index 000000000..a9e3e699c
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/GetCallerIdentityResponse.php
@@ -0,0 +1,74 @@
+ 'headers',
+ 'statusCode' => 'statusCode',
+ 'body' => 'body',
+ ];
+
+ public function validate()
+ {
+ Model::validateRequired('headers', $this->headers, true);
+ Model::validateRequired('statusCode', $this->statusCode, true);
+ Model::validateRequired('body', $this->body, true);
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->headers) {
+ $res['headers'] = $this->headers;
+ }
+ if (null !== $this->statusCode) {
+ $res['statusCode'] = $this->statusCode;
+ }
+ if (null !== $this->body) {
+ $res['body'] = null !== $this->body ? $this->body->toMap() : null;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return GetCallerIdentityResponse
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['headers'])) {
+ $model->headers = $map['headers'];
+ }
+ if (isset($map['statusCode'])) {
+ $model->statusCode = $map['statusCode'];
+ }
+ if (isset($map['body'])) {
+ $model->body = GetCallerIdentityResponseBody::fromMap($map['body']);
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/GetCallerIdentityResponseBody.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/GetCallerIdentityResponseBody.php
new file mode 100644
index 000000000..11c2ca285
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Models/GetCallerIdentityResponseBody.php
@@ -0,0 +1,133 @@
+ 'AccountId',
+ 'arn' => 'Arn',
+ 'identityType' => 'IdentityType',
+ 'principalId' => 'PrincipalId',
+ 'requestId' => 'RequestId',
+ 'roleId' => 'RoleId',
+ 'userId' => 'UserId',
+ ];
+
+ public function validate()
+ {
+ }
+
+ public function toMap()
+ {
+ $res = [];
+ if (null !== $this->accountId) {
+ $res['AccountId'] = $this->accountId;
+ }
+ if (null !== $this->arn) {
+ $res['Arn'] = $this->arn;
+ }
+ if (null !== $this->identityType) {
+ $res['IdentityType'] = $this->identityType;
+ }
+ if (null !== $this->principalId) {
+ $res['PrincipalId'] = $this->principalId;
+ }
+ if (null !== $this->requestId) {
+ $res['RequestId'] = $this->requestId;
+ }
+ if (null !== $this->roleId) {
+ $res['RoleId'] = $this->roleId;
+ }
+ if (null !== $this->userId) {
+ $res['UserId'] = $this->userId;
+ }
+
+ return $res;
+ }
+
+ /**
+ * @param array $map
+ *
+ * @return GetCallerIdentityResponseBody
+ */
+ public static function fromMap($map = [])
+ {
+ $model = new self();
+ if (isset($map['AccountId'])) {
+ $model->accountId = $map['AccountId'];
+ }
+ if (isset($map['Arn'])) {
+ $model->arn = $map['Arn'];
+ }
+ if (isset($map['IdentityType'])) {
+ $model->identityType = $map['IdentityType'];
+ }
+ if (isset($map['PrincipalId'])) {
+ $model->principalId = $map['PrincipalId'];
+ }
+ if (isset($map['RequestId'])) {
+ $model->requestId = $map['RequestId'];
+ }
+ if (isset($map['RoleId'])) {
+ $model->roleId = $map['RoleId'];
+ }
+ if (isset($map['UserId'])) {
+ $model->userId = $map['UserId'];
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Sts.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Sts.php
new file mode 100644
index 000000000..2f636e7e6
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/sts-20150401/src/Sts.php
@@ -0,0 +1,335 @@
+_signatureAlgorithm = 'v2';
+ $this->_endpointRule = 'regional';
+ $this->_endpointMap = [
+ 'ap-northeast-2-pop' => 'sts.aliyuncs.com',
+ 'cn-beijing-finance-1' => 'sts.aliyuncs.com',
+ 'cn-beijing-finance-pop' => 'sts.aliyuncs.com',
+ 'cn-beijing-gov-1' => 'sts.aliyuncs.com',
+ 'cn-beijing-nu16-b01' => 'sts.aliyuncs.com',
+ 'cn-edge-1' => 'sts.aliyuncs.com',
+ 'cn-fujian' => 'sts.aliyuncs.com',
+ 'cn-haidian-cm12-c01' => 'sts.aliyuncs.com',
+ 'cn-hangzhou-bj-b01' => 'sts.aliyuncs.com',
+ 'cn-hangzhou-finance' => 'sts.aliyuncs.com',
+ 'cn-hangzhou-internal-prod-1' => 'sts.aliyuncs.com',
+ 'cn-hangzhou-internal-test-1' => 'sts.aliyuncs.com',
+ 'cn-hangzhou-internal-test-2' => 'sts.aliyuncs.com',
+ 'cn-hangzhou-internal-test-3' => 'sts.aliyuncs.com',
+ 'cn-hangzhou-test-306' => 'sts.aliyuncs.com',
+ 'cn-hongkong-finance-pop' => 'sts.aliyuncs.com',
+ 'cn-huhehaote-nebula-1' => 'sts.aliyuncs.com',
+ 'cn-north-2-gov-1' => 'sts-vpc.cn-north-2-gov-1.aliyuncs.com',
+ 'cn-qingdao-nebula' => 'sts.aliyuncs.com',
+ 'cn-shanghai-et15-b01' => 'sts.aliyuncs.com',
+ 'cn-shanghai-et2-b01' => 'sts.aliyuncs.com',
+ 'cn-shanghai-inner' => 'sts.aliyuncs.com',
+ 'cn-shanghai-internal-test-1' => 'sts.aliyuncs.com',
+ 'cn-shenzhen-finance-1' => 'sts-vpc.cn-shenzhen-finance-1.aliyuncs.com',
+ 'cn-shenzhen-inner' => 'sts.aliyuncs.com',
+ 'cn-shenzhen-st4-d01' => 'sts.aliyuncs.com',
+ 'cn-shenzhen-su18-b01' => 'sts.aliyuncs.com',
+ 'cn-wuhan' => 'sts.aliyuncs.com',
+ 'cn-yushanfang' => 'sts.aliyuncs.com',
+ 'cn-zhangbei' => 'sts.aliyuncs.com',
+ 'cn-zhangbei-na61-b01' => 'sts.aliyuncs.com',
+ 'cn-zhangjiakou-na62-a01' => 'sts.aliyuncs.com',
+ 'cn-zhengzhou-nebula-1' => 'sts.aliyuncs.com',
+ 'eu-west-1-oxs' => 'sts.aliyuncs.com',
+ 'rus-west-1-pop' => 'sts.aliyuncs.com',
+ ];
+ $this->checkConfig($config);
+ $this->_endpoint = $this->getEndpoint('sts', $this->_regionId, $this->_endpointRule, $this->_network, $this->_suffix, $this->_endpointMap, $this->_endpoint);
+ }
+
+ /**
+ * @param string $productId
+ * @param string $regionId
+ * @param string $endpointRule
+ * @param string $network
+ * @param string $suffix
+ * @param string[] $endpointMap
+ * @param string $endpoint
+ *
+ * @return string
+ */
+ public function getEndpoint($productId, $regionId, $endpointRule, $network, $suffix, $endpointMap, $endpoint)
+ {
+ if (!Utils::empty_($endpoint)) {
+ return $endpoint;
+ }
+ if (!Utils::isUnset($endpointMap) && !Utils::empty_(@$endpointMap[$regionId])) {
+ return @$endpointMap[$regionId];
+ }
+
+ return Endpoint::getEndpointRules($productId, $regionId, $endpointRule, $network, $suffix);
+ }
+
+ /**
+ * ### Prerequisites
+ * * You cannot use an Alibaba Cloud account to call this operation. The requester of this operation can only be a RAM user or RAM role. Make sure that the AliyunSTSAssumeRoleAccess policy is attached to the requester. After this policy is attached to the requester, the requester has the management permissions on STS.
+ * * If you do not attach the AliyunSTSAssumeRoleAccess policy to the requester, the following error message is returned:
+ * * `You are not authorized to do this action. You should be authorized by RAM.`
+ * * You can refer to the following information to troubleshoot the error:
+ * * * Cause of the error: The policy that is required to assume a RAM role is not attached to the requester. To resolve this issue, attach the AliyunSTSAssumeRoleAccess policy or a custom policy to the requester. For more information, see [Can I specify the RAM role that a RAM user can assume?](~~39744~~) and [Grant permissions to a RAM user](~~116146~~).
+ * * * Cause of the error: The requester is not authorized to assume the RAM role. To resolve this issue, add the requester to the Principal element in the trust policy of the RAM role For more information, see [Edit the trust policy of a RAM role](~~116819~~).
+ * * ### Best practices
+ * * An STS token is valid for a period of time after it is issued, and the number of STS tokens that can be issued within an interval is also limited. Therefore, we recommend that you configure a proper validity period for an STS token and repeatedly use the token within this period. This prevents frequent issuing of STS tokens from adversely affecting your services if a large number of requests are sent. For more information about the limit, see [Is the number of STS API requests limited?](~~39744~~) You can configure the `DurationSeconds` parameter to specify a validity period for an STS token.
+ * * When you upload or download Object Storage Service (OSS) objects on mobile devices, a large number of STS API requests are sent. In this case, repeated use of an STS token may not meet your business requirements. To avoid the limit on STS API requests from affecting access to OSS, you can **add a signature to the URL of an OSS object**. For more information, see [Add signatures to URLs](~~31952~~) and [Obtain signature information from the server and upload data to OSS](~~31926~~).
+ * *
+ * @param AssumeRoleRequest $request AssumeRoleRequest
+ * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions
+ *
+ * @return AssumeRoleResponse AssumeRoleResponse
+ */
+ public function assumeRoleWithOptions($request, $runtime)
+ {
+ Utils::validateModel($request);
+ $query = [];
+ if (!Utils::isUnset($request->durationSeconds)) {
+ $query['DurationSeconds'] = $request->durationSeconds;
+ }
+ if (!Utils::isUnset($request->externalId)) {
+ $query['ExternalId'] = $request->externalId;
+ }
+ if (!Utils::isUnset($request->policy)) {
+ $query['Policy'] = $request->policy;
+ }
+ if (!Utils::isUnset($request->roleArn)) {
+ $query['RoleArn'] = $request->roleArn;
+ }
+ if (!Utils::isUnset($request->roleSessionName)) {
+ $query['RoleSessionName'] = $request->roleSessionName;
+ }
+ $req = new OpenApiRequest([
+ 'query' => OpenApiUtilClient::query($query),
+ ]);
+ $params = new Params([
+ 'action' => 'AssumeRole',
+ 'version' => '2015-04-01',
+ 'protocol' => 'HTTPS',
+ 'pathname' => '/',
+ 'method' => 'POST',
+ 'authType' => 'AK',
+ 'style' => 'RPC',
+ 'reqBodyType' => 'formData',
+ 'bodyType' => 'json',
+ ]);
+
+ return AssumeRoleResponse::fromMap($this->callApi($params, $req, $runtime));
+ }
+
+ /**
+ * ### Prerequisites
+ * * You cannot use an Alibaba Cloud account to call this operation. The requester of this operation can only be a RAM user or RAM role. Make sure that the AliyunSTSAssumeRoleAccess policy is attached to the requester. After this policy is attached to the requester, the requester has the management permissions on STS.
+ * * If you do not attach the AliyunSTSAssumeRoleAccess policy to the requester, the following error message is returned:
+ * * `You are not authorized to do this action. You should be authorized by RAM.`
+ * * You can refer to the following information to troubleshoot the error:
+ * * * Cause of the error: The policy that is required to assume a RAM role is not attached to the requester. To resolve this issue, attach the AliyunSTSAssumeRoleAccess policy or a custom policy to the requester. For more information, see [Can I specify the RAM role that a RAM user can assume?](~~39744~~) and [Grant permissions to a RAM user](~~116146~~).
+ * * * Cause of the error: The requester is not authorized to assume the RAM role. To resolve this issue, add the requester to the Principal element in the trust policy of the RAM role For more information, see [Edit the trust policy of a RAM role](~~116819~~).
+ * * ### Best practices
+ * * An STS token is valid for a period of time after it is issued, and the number of STS tokens that can be issued within an interval is also limited. Therefore, we recommend that you configure a proper validity period for an STS token and repeatedly use the token within this period. This prevents frequent issuing of STS tokens from adversely affecting your services if a large number of requests are sent. For more information about the limit, see [Is the number of STS API requests limited?](~~39744~~) You can configure the `DurationSeconds` parameter to specify a validity period for an STS token.
+ * * When you upload or download Object Storage Service (OSS) objects on mobile devices, a large number of STS API requests are sent. In this case, repeated use of an STS token may not meet your business requirements. To avoid the limit on STS API requests from affecting access to OSS, you can **add a signature to the URL of an OSS object**. For more information, see [Add signatures to URLs](~~31952~~) and [Obtain signature information from the server and upload data to OSS](~~31926~~).
+ * *
+ * @param AssumeRoleRequest $request AssumeRoleRequest
+ *
+ * @return AssumeRoleResponse AssumeRoleResponse
+ */
+ public function assumeRole($request)
+ {
+ $runtime = new RuntimeOptions([]);
+
+ return $this->assumeRoleWithOptions($request, $runtime);
+ }
+
+ /**
+ * ### Prerequisites
+ * * * An OIDC token is obtained from an external identity provider (IdP).
+ * * * An OIDC IdP is created in the RAM console. For more information, see [Create an OIDC IdP](~~327123~~) or [CreateOIDCProvider](~~327135~~).
+ * * * A RAM role whose trusted entity is an OIDC IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](~~116805~~) or [CreateRole](~~28710~~).
+ * *
+ * @param AssumeRoleWithOIDCRequest $request AssumeRoleWithOIDCRequest
+ * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions
+ *
+ * @return AssumeRoleWithOIDCResponse AssumeRoleWithOIDCResponse
+ */
+ public function assumeRoleWithOIDCWithOptions($request, $runtime)
+ {
+ Utils::validateModel($request);
+ $query = [];
+ if (!Utils::isUnset($request->durationSeconds)) {
+ $query['DurationSeconds'] = $request->durationSeconds;
+ }
+ if (!Utils::isUnset($request->OIDCProviderArn)) {
+ $query['OIDCProviderArn'] = $request->OIDCProviderArn;
+ }
+ if (!Utils::isUnset($request->OIDCToken)) {
+ $query['OIDCToken'] = $request->OIDCToken;
+ }
+ if (!Utils::isUnset($request->policy)) {
+ $query['Policy'] = $request->policy;
+ }
+ if (!Utils::isUnset($request->roleArn)) {
+ $query['RoleArn'] = $request->roleArn;
+ }
+ if (!Utils::isUnset($request->roleSessionName)) {
+ $query['RoleSessionName'] = $request->roleSessionName;
+ }
+ $req = new OpenApiRequest([
+ 'query' => OpenApiUtilClient::query($query),
+ ]);
+ $params = new Params([
+ 'action' => 'AssumeRoleWithOIDC',
+ 'version' => '2015-04-01',
+ 'protocol' => 'HTTPS',
+ 'pathname' => '/',
+ 'method' => 'POST',
+ 'authType' => 'Anonymous',
+ 'style' => 'RPC',
+ 'reqBodyType' => 'formData',
+ 'bodyType' => 'json',
+ ]);
+
+ return AssumeRoleWithOIDCResponse::fromMap($this->callApi($params, $req, $runtime));
+ }
+
+ /**
+ * ### Prerequisites
+ * * * An OIDC token is obtained from an external identity provider (IdP).
+ * * * An OIDC IdP is created in the RAM console. For more information, see [Create an OIDC IdP](~~327123~~) or [CreateOIDCProvider](~~327135~~).
+ * * * A RAM role whose trusted entity is an OIDC IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](~~116805~~) or [CreateRole](~~28710~~).
+ * *
+ * @param AssumeRoleWithOIDCRequest $request AssumeRoleWithOIDCRequest
+ *
+ * @return AssumeRoleWithOIDCResponse AssumeRoleWithOIDCResponse
+ */
+ public function assumeRoleWithOIDC($request)
+ {
+ $runtime = new RuntimeOptions([]);
+
+ return $this->assumeRoleWithOIDCWithOptions($request, $runtime);
+ }
+
+ /**
+ * ###
+ * * * A SAML response is obtained from an external identity provider (IdP).
+ * * * A SAML IdP is created in the RAM console. For more information, see [Create a SAML IdP](~~116083~~) or [CreateSAMLProvider](~~186846~~).
+ * * * A RAM role whose trusted entity is a SAML IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](~~116805~~) or [CreateRole](~~28710~~).
+ * *
+ * @param AssumeRoleWithSAMLRequest $request AssumeRoleWithSAMLRequest
+ * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions
+ *
+ * @return AssumeRoleWithSAMLResponse AssumeRoleWithSAMLResponse
+ */
+ public function assumeRoleWithSAMLWithOptions($request, $runtime)
+ {
+ Utils::validateModel($request);
+ $query = [];
+ if (!Utils::isUnset($request->durationSeconds)) {
+ $query['DurationSeconds'] = $request->durationSeconds;
+ }
+ if (!Utils::isUnset($request->policy)) {
+ $query['Policy'] = $request->policy;
+ }
+ if (!Utils::isUnset($request->roleArn)) {
+ $query['RoleArn'] = $request->roleArn;
+ }
+ if (!Utils::isUnset($request->SAMLAssertion)) {
+ $query['SAMLAssertion'] = $request->SAMLAssertion;
+ }
+ if (!Utils::isUnset($request->SAMLProviderArn)) {
+ $query['SAMLProviderArn'] = $request->SAMLProviderArn;
+ }
+ $req = new OpenApiRequest([
+ 'query' => OpenApiUtilClient::query($query),
+ ]);
+ $params = new Params([
+ 'action' => 'AssumeRoleWithSAML',
+ 'version' => '2015-04-01',
+ 'protocol' => 'HTTPS',
+ 'pathname' => '/',
+ 'method' => 'POST',
+ 'authType' => 'Anonymous',
+ 'style' => 'RPC',
+ 'reqBodyType' => 'formData',
+ 'bodyType' => 'json',
+ ]);
+
+ return AssumeRoleWithSAMLResponse::fromMap($this->callApi($params, $req, $runtime));
+ }
+
+ /**
+ * ###
+ * * * A SAML response is obtained from an external identity provider (IdP).
+ * * * A SAML IdP is created in the RAM console. For more information, see [Create a SAML IdP](~~116083~~) or [CreateSAMLProvider](~~186846~~).
+ * * * A RAM role whose trusted entity is a SAML IdP is created in the RAM console. For more information, see [Create a RAM role for a trusted IdP](~~116805~~) or [CreateRole](~~28710~~).
+ * *
+ * @param AssumeRoleWithSAMLRequest $request AssumeRoleWithSAMLRequest
+ *
+ * @return AssumeRoleWithSAMLResponse AssumeRoleWithSAMLResponse
+ */
+ public function assumeRoleWithSAML($request)
+ {
+ $runtime = new RuntimeOptions([]);
+
+ return $this->assumeRoleWithSAMLWithOptions($request, $runtime);
+ }
+
+ /**
+ * @param RuntimeOptions $runtime
+ *
+ * @return GetCallerIdentityResponse
+ */
+ public function getCallerIdentityWithOptions($runtime)
+ {
+ $req = new OpenApiRequest([]);
+ $params = new Params([
+ 'action' => 'GetCallerIdentity',
+ 'version' => '2015-04-01',
+ 'protocol' => 'HTTPS',
+ 'pathname' => '/',
+ 'method' => 'POST',
+ 'authType' => 'AK',
+ 'style' => 'RPC',
+ 'reqBodyType' => 'formData',
+ 'bodyType' => 'json',
+ ]);
+
+ return GetCallerIdentityResponse::fromMap($this->callApi($params, $req, $runtime));
+ }
+
+ /**
+ * @return GetCallerIdentityResponse
+ */
+ public function getCallerIdentity()
+ {
+ $runtime = new RuntimeOptions([]);
+
+ return $this->getCallerIdentityWithOptions($runtime);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea-utils/src/Utils.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea-utils/src/Utils.php
new file mode 100644
index 000000000..13ca84ffc
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea-utils/src/Utils.php
@@ -0,0 +1,600 @@
+isSeekable()) {
+ $stream->rewind();
+ }
+
+ return $stream->getContents();
+ }
+
+ /**
+ * Read data from a readable stream, and parse it by JSON format.
+ *
+ * @param StreamInterface $stream the readable stream
+ *
+ * @return array the parsed result
+ */
+ public static function readAsJSON($stream)
+ {
+ return self::parseJSON(self::readAsString($stream));
+ }
+
+ /**
+ * Generate a nonce string.
+ *
+ * @return string the nonce string
+ */
+ public static function getNonce()
+ {
+ return md5(uniqid() . uniqid(md5(microtime(true)), true));
+ }
+
+ /**
+ * Get an UTC format string by current date, e.g. 'Thu, 06 Feb 2020 07:32:54 GMT'.
+ *
+ * @return string the UTC format string
+ */
+ public static function getDateUTCString()
+ {
+ return gmdate('D, d M Y H:i:s T');
+ }
+
+ /**
+ * If not set the real, use default value.
+ *
+ * @param string $real
+ * @param string $default
+ *
+ * @return string
+ */
+ public static function defaultString($real, $default = '')
+ {
+ return null === $real ? $default : $real;
+ }
+
+ /**
+ * If not set the real, use default value.
+ *
+ * @param int $real
+ * @param int $default
+ *
+ * @return int the return number
+ */
+ public static function defaultNumber($real, $default = 0)
+ {
+ if (null === $real) {
+ return $default;
+ }
+
+ return (int) $real;
+ }
+
+ /**
+ * Format a map to form string, like a=a%20b%20c.
+ *
+ * @param array|object $query
+ *
+ * @return string the form string
+ */
+ public static function toFormString($query)
+ {
+ if (null === $query) {
+ return '';
+ }
+
+ if (\is_object($query)) {
+ $query = json_decode(self::toJSONString($query), true);
+ }
+
+ return str_replace('+', '%20', http_build_query($query));
+ }
+
+ /**
+ * If not set the real, use default value.
+ *
+ * @param array|Model $object
+ *
+ * @return string the return string
+ */
+ public static function toJSONString($object)
+ {
+ if (is_string($object)) {
+ return $object;
+ }
+
+ if ($object instanceof Model) {
+ $object = $object->toMap();
+ }
+
+ return json_encode($object, JSON_UNESCAPED_UNICODE + JSON_UNESCAPED_SLASHES);
+ }
+
+ /**
+ * Check the string is empty?
+ *
+ * @param string $val
+ *
+ * @return bool if string is null or zero length, return true
+ *
+ * @deprecated
+ */
+ public static function _empty($val)
+ {
+ return empty($val);
+ }
+
+ /**
+ * Check the string is empty?
+ *
+ * @param string $val
+ *
+ * @return bool if string is null or zero length, return true
+ *
+ * @deprecated
+ */
+ public static function emptyWithSuffix($val)
+ {
+ return empty($val);
+ }
+
+ /**
+ * Check the string is empty?
+ *
+ * @param string $val
+ *
+ * @return bool if string is null or zero length, return true
+ */
+ public static function empty_($val)
+ {
+ return empty($val);
+ }
+
+ /**
+ * Check one string equals another one?
+ *
+ * @param int $left
+ * @param int $right
+ *
+ * @return bool if equals, return true
+ */
+ public static function equalString($left, $right)
+ {
+ return $left === $right;
+ }
+
+ /**
+ * Check one number equals another one?
+ *
+ * @param int $left
+ * @param int $right
+ *
+ * @return bool if equals, return true
+ */
+ public static function equalNumber($left, $right)
+ {
+ return $left === $right;
+ }
+
+ /**
+ * Check one value is unset.
+ *
+ * @param mixed $value
+ *
+ * @return bool if unset, return true
+ */
+ public static function isUnset(&$value = null)
+ {
+ return !isset($value) || null === $value;
+ }
+
+ /**
+ * Stringify the value of map.
+ *
+ * @param array $map
+ *
+ * @return array the new stringified map
+ */
+ public static function stringifyMapValue($map)
+ {
+ if (null === $map) {
+ return [];
+ }
+ foreach ($map as &$node) {
+ if (is_numeric($node)) {
+ $node = (string) $node;
+ } elseif (null === $node) {
+ $node = '';
+ } elseif (\is_bool($node)) {
+ $node = true === $node ? 'true' : 'false';
+ } elseif (\is_object($node)) {
+ $node = json_decode(json_encode($node), true);
+ }
+ }
+
+ return $map;
+ }
+
+ /**
+ * Anyify the value of map.
+ *
+ * @param array $m
+ *
+ * @return array the new anyfied map
+ */
+ public static function anyifyMapValue($m)
+ {
+ return $m;
+ }
+
+ /**
+ * Assert a value, if it is a boolean, return it, otherwise throws.
+ *
+ * @param mixed $value
+ *
+ * @return bool the boolean value
+ */
+ public static function assertAsBoolean($value)
+ {
+ if (\is_bool($value)) {
+ return $value;
+ }
+
+ throw new \InvalidArgumentException('It is not a boolean value.');
+ }
+
+ /**
+ * Assert a value, if it is a string, return it, otherwise throws.
+ *
+ * @param mixed $value
+ *
+ * @return string the string value
+ */
+ public static function assertAsString($value)
+ {
+ if (\is_string($value)) {
+ return $value;
+ }
+
+ throw new \InvalidArgumentException('It is not a string value.');
+ }
+
+ private static function is_bytes($value)
+ {
+ if (!\is_array($value)) {
+ return false;
+ }
+ $i = 0;
+ foreach ($value as $k => $ord) {
+ if ($k !== $i) {
+ return false;
+ }
+ if (!\is_int($ord)) {
+ return false;
+ }
+ if ($ord < 0 || $ord > 255) {
+ return false;
+ }
+ ++$i;
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert a value, if it is a bytes, return it, otherwise throws.
+ *
+ * @param mixed $value
+ *
+ * @return bytes the bytes value
+ */
+ public static function assertAsBytes($value)
+ {
+ if (self::is_bytes($value)) {
+ return $value;
+ }
+
+ throw new \InvalidArgumentException('It is not a bytes value.');
+ }
+
+ /**
+ * Assert a value, if it is a number, return it, otherwise throws.
+ *
+ * @param mixed $value
+ *
+ * @return int the number value
+ */
+ public static function assertAsNumber($value)
+ {
+ if (\is_numeric($value)) {
+ return $value;
+ }
+
+ throw new \InvalidArgumentException('It is not a number value.');
+ }
+
+ /**
+ * Assert a value, if it is a integer, return it, otherwise throws
+ * @param mixed $value
+ * @return int the integer value
+ */
+ public static function assertAsInteger($value){
+ if (\is_int($value)) {
+ return $value;
+ }
+
+ throw new \InvalidArgumentException('It is not a int value.');
+ }
+
+ /**
+ * Assert a value, if it is a map, return it, otherwise throws.
+ *
+ * @param $any
+ *
+ * @return array the map value
+ */
+ public static function assertAsMap($any)
+ {
+ if (\is_array($any)) {
+ return $any;
+ }
+
+ throw new \InvalidArgumentException('It is not a map value.');
+ }
+
+ public static function assertAsArray($any){
+ if (\is_array($any)) {
+ return $any;
+ }
+
+ throw new \InvalidArgumentException('It is not a array value.');
+ }
+
+ /**
+ * Get user agent, if it userAgent is not null, splice it with defaultUserAgent and return, otherwise return
+ * defaultUserAgent.
+ *
+ * @param string $userAgent
+ *
+ * @return string the string value
+ */
+ public static function getUserAgent($userAgent = '')
+ {
+ if (empty(self::$defaultUserAgent)) {
+ self::$defaultUserAgent = sprintf('AlibabaCloud (%s; %s) PHP/%s Core/3.1 TeaDSL/1', PHP_OS, \PHP_SAPI, PHP_VERSION);
+ }
+ if (!empty($userAgent)) {
+ return self::$defaultUserAgent . ' ' . $userAgent;
+ }
+
+ return self::$defaultUserAgent;
+ }
+
+ /**
+ * If the code between 200 and 300, return true, or return false.
+ *
+ * @param int $code
+ *
+ * @return bool
+ */
+ public static function is2xx($code)
+ {
+ return $code >= 200 && $code < 300;
+ }
+
+ /**
+ * If the code between 300 and 400, return true, or return false.
+ *
+ * @param int $code
+ *
+ * @return bool
+ */
+ public static function is3xx($code)
+ {
+ return $code >= 300 && $code < 400;
+ }
+
+ /**
+ * If the code between 400 and 500, return true, or return false.
+ *
+ * @param int $code
+ *
+ * @return bool
+ */
+ public static function is4xx($code)
+ {
+ return $code >= 400 && $code < 500;
+ }
+
+ /**
+ * If the code between 500 and 600, return true, or return false.
+ *
+ * @param int $code
+ *
+ * @return bool
+ */
+ public static function is5xx($code)
+ {
+ return $code >= 500 && $code < 600;
+ }
+
+ /**
+ * Validate model.
+ *
+ * @param Model $model
+ */
+ public static function validateModel($model)
+ {
+ if (null !== $model) {
+ $model->validate();
+ }
+ }
+
+ /**
+ * Model transforms to map[string]any.
+ *
+ * @param Model $model
+ *
+ * @return array
+ */
+ public static function toMap($model)
+ {
+ if (null === $model) {
+ return [];
+ }
+ $map = $model->toMap();
+ $names = $model->getName();
+ $vars = get_object_vars($model);
+ foreach ($vars as $k => $v) {
+ if (false !== strpos($k, 'Shrink') && !isset($names[$k])) {
+ // A field that has the suffix `Shrink` and is not a Model class property.
+ $targetKey = ucfirst(substr($k, 0, \strlen($k) - 6));
+ if (isset($map[$targetKey])) {
+ // $targetKey exists in $map.
+ $map[$targetKey] = $v;
+ }
+ }
+ }
+
+ return $map;
+ }
+
+ /**
+ * Suspends the current thread for the specified number of milliseconds.
+ *
+ * @param int $millisecond
+ */
+ public static function sleep($millisecond)
+ {
+ usleep($millisecond * 1000);
+ }
+
+ /**
+ * Transform input as array.
+ *
+ * @param mixed $input
+ *
+ * @return array
+ */
+ public static function toArray($input)
+ {
+ if (\is_array($input)) {
+ foreach ($input as $k => &$v) {
+ $v = self::toArray($v);
+ }
+ } elseif ($input instanceof Model) {
+ $input = $input->toMap();
+ foreach ($input as $k => &$v) {
+ $v = self::toArray($v);
+ }
+ }
+
+ return $input;
+ }
+
+ /**
+ * Assert a value, if it is a readable, return it, otherwise throws.
+ *
+ * @param mixed $value
+ *
+ * @return Stream the readable value
+ */
+ public static function assertAsReadable($value)
+ {
+ if (\is_string($value)) {
+ return new Stream(
+ fopen('data://text/plain;base64,' .
+ base64_encode($value), 'r')
+ );
+ }
+ if ($value instanceof Stream) {
+ return $value;
+ }
+
+ throw new \InvalidArgumentException('It is not a stream value.');
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea-utils/src/Utils/RuntimeOptions.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea-utils/src/Utils/RuntimeOptions.php
new file mode 100644
index 000000000..de107fb0f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea-utils/src/Utils/RuntimeOptions.php
@@ -0,0 +1,261 @@
+ 'autoretry',
+ 'ignoreSSL' => 'ignoreSSL',
+ 'key' => 'key',
+ 'cert' => 'cert',
+ 'ca' => 'ca',
+ 'maxAttempts' => 'max_attempts',
+ 'backoffPolicy' => 'backoff_policy',
+ 'backoffPeriod' => 'backoff_period',
+ 'readTimeout' => 'readTimeout',
+ 'connectTimeout' => 'connectTimeout',
+ 'httpProxy' => 'httpProxy',
+ 'httpsProxy' => 'httpsProxy',
+ 'noProxy' => 'noProxy',
+ 'maxIdleConns' => 'maxIdleConns',
+ 'localAddr' => 'localAddr',
+ 'socks5Proxy' => 'socks5Proxy',
+ 'socks5NetWork' => 'socks5NetWork',
+ 'keepAlive' => 'keepAlive',
+ ];
+ public function validate() {}
+ public function toMap() {
+ $res = [];
+ if (null !== $this->autoretry) {
+ $res['autoretry'] = $this->autoretry;
+ }
+ if (null !== $this->ignoreSSL) {
+ $res['ignoreSSL'] = $this->ignoreSSL;
+ }
+ if (null !== $this->key) {
+ $res['key'] = $this->key;
+ }
+ if (null !== $this->cert) {
+ $res['cert'] = $this->cert;
+ }
+ if (null !== $this->ca) {
+ $res['ca'] = $this->ca;
+ }
+ if (null !== $this->maxAttempts) {
+ $res['max_attempts'] = $this->maxAttempts;
+ }
+ if (null !== $this->backoffPolicy) {
+ $res['backoff_policy'] = $this->backoffPolicy;
+ }
+ if (null !== $this->backoffPeriod) {
+ $res['backoff_period'] = $this->backoffPeriod;
+ }
+ if (null !== $this->readTimeout) {
+ $res['readTimeout'] = $this->readTimeout;
+ }
+ if (null !== $this->connectTimeout) {
+ $res['connectTimeout'] = $this->connectTimeout;
+ }
+ if (null !== $this->httpProxy) {
+ $res['httpProxy'] = $this->httpProxy;
+ }
+ if (null !== $this->httpsProxy) {
+ $res['httpsProxy'] = $this->httpsProxy;
+ }
+ if (null !== $this->noProxy) {
+ $res['noProxy'] = $this->noProxy;
+ }
+ if (null !== $this->maxIdleConns) {
+ $res['maxIdleConns'] = $this->maxIdleConns;
+ }
+ if (null !== $this->localAddr) {
+ $res['localAddr'] = $this->localAddr;
+ }
+ if (null !== $this->socks5Proxy) {
+ $res['socks5Proxy'] = $this->socks5Proxy;
+ }
+ if (null !== $this->socks5NetWork) {
+ $res['socks5NetWork'] = $this->socks5NetWork;
+ }
+ if (null !== $this->keepAlive) {
+ $res['keepAlive'] = $this->keepAlive;
+ }
+ return $res;
+ }
+ /**
+ * @param array $map
+ * @return RuntimeOptions
+ */
+ public static function fromMap($map = []) {
+ $model = new self();
+ if(isset($map['autoretry'])){
+ $model->autoretry = $map['autoretry'];
+ }
+ if(isset($map['ignoreSSL'])){
+ $model->ignoreSSL = $map['ignoreSSL'];
+ }
+ if(isset($map['key'])){
+ $model->key = $map['key'];
+ }
+ if(isset($map['cert'])){
+ $model->cert = $map['cert'];
+ }
+ if(isset($map['ca'])){
+ $model->ca = $map['ca'];
+ }
+ if(isset($map['max_attempts'])){
+ $model->maxAttempts = $map['max_attempts'];
+ }
+ if(isset($map['backoff_policy'])){
+ $model->backoffPolicy = $map['backoff_policy'];
+ }
+ if(isset($map['backoff_period'])){
+ $model->backoffPeriod = $map['backoff_period'];
+ }
+ if(isset($map['readTimeout'])){
+ $model->readTimeout = $map['readTimeout'];
+ }
+ if(isset($map['connectTimeout'])){
+ $model->connectTimeout = $map['connectTimeout'];
+ }
+ if(isset($map['httpProxy'])){
+ $model->httpProxy = $map['httpProxy'];
+ }
+ if(isset($map['httpsProxy'])){
+ $model->httpsProxy = $map['httpsProxy'];
+ }
+ if(isset($map['noProxy'])){
+ $model->noProxy = $map['noProxy'];
+ }
+ if(isset($map['maxIdleConns'])){
+ $model->maxIdleConns = $map['maxIdleConns'];
+ }
+ if(isset($map['localAddr'])){
+ $model->localAddr = $map['localAddr'];
+ }
+ if(isset($map['socks5Proxy'])){
+ $model->socks5Proxy = $map['socks5Proxy'];
+ }
+ if(isset($map['socks5NetWork'])){
+ $model->socks5NetWork = $map['socks5NetWork'];
+ }
+ if(isset($map['keepAlive'])){
+ $model->keepAlive = $map['keepAlive'];
+ }
+ return $model;
+ }
+ /**
+ * @description whether to try again
+ * @var bool
+ */
+ public $autoretry;
+
+ /**
+ * @description ignore SSL validation
+ * @var bool
+ */
+ public $ignoreSSL;
+
+ /**
+ * @description privite key for client certificate
+ * @var string
+ */
+ public $key;
+
+ /**
+ * @description client certificate
+ * @var string
+ */
+ public $cert;
+
+ /**
+ * @description server certificate
+ * @var string
+ */
+ public $ca;
+
+ /**
+ * @description maximum number of retries
+ * @var int
+ */
+ public $maxAttempts;
+
+ /**
+ * @description backoff policy
+ * @var string
+ */
+ public $backoffPolicy;
+
+ /**
+ * @description backoff period
+ * @var int
+ */
+ public $backoffPeriod;
+
+ /**
+ * @description read timeout
+ * @var int
+ */
+ public $readTimeout;
+
+ /**
+ * @description connect timeout
+ * @var int
+ */
+ public $connectTimeout;
+
+ /**
+ * @description http proxy url
+ * @var string
+ */
+ public $httpProxy;
+
+ /**
+ * @description https Proxy url
+ * @var string
+ */
+ public $httpsProxy;
+
+ /**
+ * @description agent blacklist
+ * @var string
+ */
+ public $noProxy;
+
+ /**
+ * @description maximum number of connections
+ * @var int
+ */
+ public $maxIdleConns;
+
+ /**
+ * @description local addr
+ * @var string
+ */
+ public $localAddr;
+
+ /**
+ * @description SOCKS5 proxy
+ * @var string
+ */
+ public $socks5Proxy;
+
+ /**
+ * @description SOCKS5 netWork
+ * @var string
+ */
+ public $socks5NetWork;
+
+ /**
+ * @description whether to enable keep-alive
+ * @var bool
+ */
+ public $keepAlive;
+
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Exception/TeaError.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Exception/TeaError.php
new file mode 100644
index 000000000..f4ef0d9a9
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Exception/TeaError.php
@@ -0,0 +1,53 @@
+errorInfo = $errorInfo;
+ if (!empty($errorInfo)) {
+ $properties = ['name', 'message', 'code', 'data', 'description', 'accessDeniedDetail'];
+ foreach ($properties as $property) {
+ if (isset($errorInfo[$property])) {
+ $this->{$property} = $errorInfo[$property];
+ if ($property === 'data' && isset($errorInfo['data']['statusCode'])) {
+ $this->statusCode = $errorInfo['data']['statusCode'];
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function getErrorInfo()
+ {
+ return $this->errorInfo;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Exception/TeaRetryError.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Exception/TeaRetryError.php
new file mode 100644
index 000000000..30aa7f8ef
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Exception/TeaRetryError.php
@@ -0,0 +1,21 @@
+getErrorInfo();
+ }
+ parent::__construct($error_info, $lastException->getMessage(), $lastException->getCode(), $lastException);
+ $this->lastRequest = $lastRequest;
+ $this->lastException = $lastException;
+ }
+
+ public function getLastRequest()
+ {
+ return $this->lastRequest;
+ }
+
+ public function getLastException()
+ {
+ return $this->lastException;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Helper.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Helper.php
new file mode 100644
index 000000000..f1c0fd4fc
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Helper.php
@@ -0,0 +1,112 @@
+ $ord) {
+ if ($k !== $i) {
+ return false;
+ }
+ if (!\is_int($ord)) {
+ return false;
+ }
+ if ($ord < 0 || $ord > 255) {
+ return false;
+ }
+ ++$i;
+ }
+
+ return true;
+ }
+
+ /**
+ * Convert a bytes to string(utf8).
+ *
+ * @param array $bytes
+ *
+ * @return string the return string
+ */
+ public static function toString($bytes)
+ {
+ $str = '';
+ foreach ($bytes as $ch) {
+ $str .= \chr($ch);
+ }
+
+ return $str;
+ }
+
+ /**
+ * @return array
+ */
+ public static function merge(array $arrays)
+ {
+ $result = [];
+ foreach ($arrays as $array) {
+ foreach ($array as $key => $value) {
+ if (\is_int($key)) {
+ $result[] = $value;
+
+ continue;
+ }
+
+ if (isset($result[$key]) && \is_array($result[$key])) {
+ $result[$key] = self::merge(
+ [$result[$key], $value]
+ );
+
+ continue;
+ }
+
+ $result[$key] = $value;
+ }
+ }
+
+ return $result;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Model.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Model.php
new file mode 100644
index 000000000..538b55c53
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Model.php
@@ -0,0 +1,114 @@
+ $v) {
+ $this->{$k} = $v;
+ }
+ }
+ }
+
+ public function getName($name = null)
+ {
+ if (null === $name) {
+ return $this->_name;
+ }
+
+ return isset($this->_name[$name]) ? $this->_name[$name] : $name;
+ }
+
+ public function toMap()
+ {
+ $map = get_object_vars($this);
+ foreach ($map as $k => $m) {
+ if (0 === strpos($k, '_')) {
+ unset($map[$k]);
+ }
+ }
+ $res = [];
+ foreach ($map as $k => $v) {
+ $name = isset($this->_name[$k]) ? $this->_name[$k] : $k;
+ $res[$name] = $v;
+ }
+
+ return $res;
+ }
+
+ public function validate()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $k => $v) {
+ if (isset($this->_required[$k]) && $this->_required[$k] && empty($v)) {
+ throw new \InvalidArgumentException("{$k} is required.");
+ }
+ }
+ }
+
+ public static function validateRequired($fieldName, $field, $val = null)
+ {
+ if (true === $val && null === $field) {
+ throw new \InvalidArgumentException($fieldName . ' is required');
+ }
+ }
+
+ public static function validateMaxLength($fieldName, $field, $val = null)
+ {
+ if (null !== $field && \strlen($field) > (int) $val) {
+ throw new \InvalidArgumentException($fieldName . ' is exceed max-length: ' . $val);
+ }
+ }
+
+ public static function validateMinLength($fieldName, $field, $val = null)
+ {
+ if (null !== $field && \strlen($field) < (int) $val) {
+ throw new \InvalidArgumentException($fieldName . ' is less than min-length: ' . $val);
+ }
+ }
+
+ public static function validatePattern($fieldName, $field, $regex = '')
+ {
+ if (null !== $field && '' !== $field && !preg_match("/^{$regex}$/", $field)) {
+ throw new \InvalidArgumentException($fieldName . ' is not match ' . $regex);
+ }
+ }
+
+ public static function validateMaximum($fieldName, $field, $val)
+ {
+ if (null !== $field && $field > $val) {
+ throw new \InvalidArgumentException($fieldName . ' cannot be greater than ' . $val);
+ }
+ }
+
+ public static function validateMinimum($fieldName, $field, $val)
+ {
+ if (null !== $field && $field < $val) {
+ throw new \InvalidArgumentException($fieldName . ' cannot be less than ' . $val);
+ }
+ }
+
+ /**
+ * @param array $map
+ * @param Model $model
+ *
+ * @return mixed
+ */
+ public static function toModel($map, $model)
+ {
+ $names = $model->getName();
+ $names = array_flip($names);
+ foreach ($map as $key => $value) {
+ $name = isset($names[$key]) ? $names[$key] : $key;
+ $model->{$name} = $value;
+ }
+
+ return $model;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Parameter.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Parameter.php
new file mode 100644
index 000000000..324a95d5e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Parameter.php
@@ -0,0 +1,50 @@
+toArray());
+ }
+
+ /**
+ * @return array
+ */
+ public function getRealParameters()
+ {
+ $array = [];
+ $obj = new ReflectionObject($this);
+ $properties = $obj->getProperties();
+
+ foreach ($properties as $property) {
+ $docComment = $property->getDocComment();
+ $key = trim(Helper::findFromString($docComment, '@real', "\n"));
+ $value = $property->getValue($this);
+ $array[$key] = $value;
+ }
+
+ return $array;
+ }
+
+ /**
+ * @return array
+ */
+ public function toArray()
+ {
+ return $this->getRealParameters();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Request.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Request.php
new file mode 100644
index 000000000..db49142e3
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Request.php
@@ -0,0 +1,123 @@
+method = $method;
+ }
+
+ /**
+ * These fields are compatible if you define other fields.
+ * Mainly for compatibility situations where the code generator cannot generate set properties.
+ *
+ * @return PsrRequest
+ */
+ public function getPsrRequest()
+ {
+ $this->assertQuery($this->query);
+
+ $request = clone $this;
+
+ $uri = $request->getUri();
+ if ($this->query) {
+ $uri = $uri->withQuery(http_build_query($this->query));
+ }
+
+ if ($this->port) {
+ $uri = $uri->withPort($this->port);
+ }
+
+ if ($this->protocol) {
+ $uri = $uri->withScheme($this->protocol);
+ }
+
+ if ($this->pathname) {
+ $uri = $uri->withPath($this->pathname);
+ }
+
+ if (isset($this->headers['host'])) {
+ $uri = $uri->withHost($this->headers['host']);
+ }
+
+ $request = $request->withUri($uri);
+ $request = $request->withMethod($this->method);
+
+ if ('' !== $this->body && null !== $this->body) {
+ if ($this->body instanceof StreamInterface) {
+ $request = $request->withBody($this->body);
+ } else {
+ $body = $this->body;
+ if (Helper::isBytes($this->body)) {
+ $body = Helper::toString($this->body);
+ }
+ if (\function_exists('\GuzzleHttp\Psr7\stream_for')) {
+ // @deprecated stream_for will be removed in guzzlehttp/psr7:2.0
+ $request = $request->withBody(\GuzzleHttp\Psr7\stream_for($body));
+ } else {
+ $request = $request->withBody(\GuzzleHttp\Psr7\Utils::streamFor($body));
+ }
+ }
+ }
+
+ if ($this->headers) {
+ foreach ($this->headers as $key => $value) {
+ $request = $request->withHeader($key, $value);
+ }
+ }
+
+ return $request;
+ }
+
+ /**
+ * @param array $query
+ */
+ private function assertQuery($query)
+ {
+ if (!\is_array($query) && $query !== null) {
+ throw new InvalidArgumentException('Query must be array.');
+ }
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Response.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Response.php
new file mode 100644
index 000000000..cb446e74e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Response.php
@@ -0,0 +1,372 @@
+getStatusCode(),
+ $response->getHeaders(),
+ $response->getBody(),
+ $response->getProtocolVersion(),
+ $response->getReasonPhrase()
+ );
+ $this->headers = $response->getHeaders();
+ $this->body = $response->getBody();
+ $this->statusCode = $response->getStatusCode();
+ if ($this->body->isSeekable()) {
+ $this->body->seek(0);
+ }
+
+ if (Helper::isJson((string) $this->getBody())) {
+ $this->dot = new Dot($this->toArray());
+ } else {
+ $this->dot = new Dot();
+ }
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->getBody();
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return null|mixed
+ */
+ public function __get($name)
+ {
+ $data = $this->dot->all();
+ if (!isset($data[$name])) {
+ return null;
+ }
+
+ return json_decode(json_encode($data))->{$name};
+ }
+
+ /**
+ * @param string $name
+ * @param mixed $value
+ */
+ public function __set($name, $value)
+ {
+ $this->dot->set($name, $value);
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return bool
+ */
+ public function __isset($name)
+ {
+ return $this->dot->has($name);
+ }
+
+ /**
+ * @param $offset
+ */
+ public function __unset($offset)
+ {
+ $this->dot->delete($offset);
+ }
+
+ /**
+ * @return array
+ */
+ public function toArray()
+ {
+ return \GuzzleHttp\json_decode((string) $this->getBody(), true);
+ }
+
+ /**
+ * @param array|int|string $keys
+ * @param mixed $value
+ */
+ public function add($keys, $value = null)
+ {
+ return $this->dot->add($keys, $value);
+ }
+
+ /**
+ * @return array
+ */
+ public function all()
+ {
+ return $this->dot->all();
+ }
+
+ /**
+ * @param null|array|int|string $keys
+ */
+ public function clear($keys = null)
+ {
+ return $this->dot->clear($keys);
+ }
+
+ /**
+ * @param array|int|string $keys
+ */
+ public function delete($keys)
+ {
+ return $this->dot->delete($keys);
+ }
+
+ /**
+ * @param string $delimiter
+ * @param null|array $items
+ * @param string $prepend
+ *
+ * @return array
+ */
+ public function flatten($delimiter = '.', $items = null, $prepend = '')
+ {
+ return $this->dot->flatten($delimiter, $items, $prepend);
+ }
+
+ /**
+ * @param null|int|string $key
+ * @param mixed $default
+ *
+ * @return mixed
+ */
+ public function get($key = null, $default = null)
+ {
+ return $this->dot->get($key, $default);
+ }
+
+ /**
+ * @param array|int|string $keys
+ *
+ * @return bool
+ */
+ public function has($keys)
+ {
+ return $this->dot->has($keys);
+ }
+
+ /**
+ * @param null|array|int|string $keys
+ *
+ * @return bool
+ */
+ public function isEmpty($keys = null)
+ {
+ return $this->dot->isEmpty($keys);
+ }
+
+ /**
+ * @param array|self|string $key
+ * @param array|self $value
+ */
+ public function merge($key, $value = [])
+ {
+ return $this->dot->merge($key, $value);
+ }
+
+ /**
+ * @param array|self|string $key
+ * @param array|self $value
+ */
+ public function mergeRecursive($key, $value = [])
+ {
+ return $this->dot->mergeRecursive($key, $value);
+ }
+
+ /**
+ * @param array|self|string $key
+ * @param array|self $value
+ */
+ public function mergeRecursiveDistinct($key, $value = [])
+ {
+ return $this->dot->mergeRecursiveDistinct($key, $value);
+ }
+
+ /**
+ * @param null|int|string $key
+ * @param mixed $default
+ *
+ * @return mixed
+ */
+ public function pull($key = null, $default = null)
+ {
+ return $this->dot->pull($key, $default);
+ }
+
+ /**
+ * @param null|int|string $key
+ * @param mixed $value
+ *
+ * @return mixed
+ */
+ public function push($key = null, $value = null)
+ {
+ return $this->dot->push($key, $value);
+ }
+
+ /**
+ * Replace all values or values within the given key
+ * with an array or Dot object.
+ *
+ * @param array|self|string $key
+ * @param array|self $value
+ */
+ public function replace($key, $value = [])
+ {
+ return $this->dot->replace($key, $value);
+ }
+
+ /**
+ * Set a given key / value pair or pairs.
+ *
+ * @param array|int|string $keys
+ * @param mixed $value
+ */
+ public function set($keys, $value = null)
+ {
+ return $this->dot->set($keys, $value);
+ }
+
+ /**
+ * Replace all items with a given array.
+ *
+ * @param mixed $items
+ */
+ public function setArray($items)
+ {
+ return $this->dot->setArray($items);
+ }
+
+ /**
+ * Replace all items with a given array as a reference.
+ */
+ public function setReference(array &$items)
+ {
+ return $this->dot->setReference($items);
+ }
+
+ /**
+ * Return the value of a given key or all the values as JSON.
+ *
+ * @param mixed $key
+ * @param int $options
+ *
+ * @return string
+ */
+ public function toJson($key = null, $options = 0)
+ {
+ return $this->dot->toJson($key, $options);
+ }
+
+ /**
+ * Retrieve an external iterator.
+ */
+ #[\ReturnTypeWillChange]
+ public function getIterator()
+ {
+ return $this->dot->getIterator();
+ }
+
+ /**
+ * Whether a offset exists.
+ *
+ * @param $offset
+ *
+ * @return bool
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetExists($offset)
+ {
+ return $this->dot->offsetExists($offset);
+ }
+
+ /**
+ * Offset to retrieve.
+ *
+ * @param $offset
+ *
+ * @return mixed
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->dot->offsetGet($offset);
+ }
+
+ /**
+ * Offset to set.
+ *
+ * @param $offset
+ * @param $value
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetSet($offset, $value)
+ {
+ $this->dot->offsetSet($offset, $value);
+ }
+
+ /**
+ * Offset to unset.
+ *
+ * @param $offset
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetUnset($offset)
+ {
+ $this->dot->offsetUnset($offset);
+ }
+
+ /**
+ * Count elements of an object.
+ *
+ * @param null $key
+ *
+ * @return int
+ */
+ #[\ReturnTypeWillChange]
+ public function count($key = null)
+ {
+ return $this->dot->count($key);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Tea.php b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Tea.php
new file mode 100644
index 000000000..a138ad9a8
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/alibabacloud/tea/src/Tea.php
@@ -0,0 +1,287 @@
+getPsrRequest();
+ }
+
+ $config = self::resolveConfig($config);
+
+ $res = self::client()->send(
+ $request,
+ $config
+ );
+
+ return new Response($res);
+ }
+
+ /**
+ * @return PromiseInterface
+ */
+ public static function sendAsync(RequestInterface $request, array $config = [])
+ {
+ if (method_exists($request, 'getPsrRequest')) {
+ $request = $request->getPsrRequest();
+ }
+
+ $config = self::resolveConfig($config);
+
+ return self::client()->sendAsync(
+ $request,
+ $config
+ );
+ }
+
+ /**
+ * @return Client
+ */
+ public static function client(array $config = [])
+ {
+ if (isset(self::$config['handler'])) {
+ $stack = self::$config['handler'];
+ } else {
+ $stack = HandlerStack::create();
+ $stack->push(Middleware::mapResponse(static function (ResponseInterface $response) {
+ return new Response($response);
+ }));
+ }
+
+ self::$config['handler'] = $stack;
+
+ if (!isset(self::$config['on_stats'])) {
+ self::$config['on_stats'] = function (TransferStats $stats) {
+ Response::$info = $stats->getHandlerStats();
+ };
+ }
+
+ $new_config = Helper::merge([self::$config, $config]);
+
+ return new Client($new_config);
+ }
+
+ /**
+ * @param string $method
+ * @param string|UriInterface $uri
+ * @param array $options
+ *
+ * @throws GuzzleException
+ *
+ * @return ResponseInterface
+ */
+ public static function request($method, $uri, $options = [])
+ {
+ return self::client()->request($method, $uri, $options);
+ }
+
+ /**
+ * @param string $method
+ * @param string $uri
+ * @param array $options
+ *
+ * @throws GuzzleException
+ *
+ * @return string
+ */
+ public static function string($method, $uri, $options = [])
+ {
+ return (string) self::client()->request($method, $uri, $options)
+ ->getBody();
+ }
+
+ /**
+ * @param string $method
+ * @param string|UriInterface $uri
+ * @param array $options
+ *
+ * @return PromiseInterface
+ */
+ public static function requestAsync($method, $uri, $options = [])
+ {
+ return self::client()->requestAsync($method, $uri, $options);
+ }
+
+ /**
+ * @param string|UriInterface $uri
+ * @param array $options
+ *
+ * @throws GuzzleException
+ *
+ * @return null|mixed
+ */
+ public static function getHeaders($uri, $options = [])
+ {
+ return self::request('HEAD', $uri, $options)->getHeaders();
+ }
+
+ /**
+ * @param string|UriInterface $uri
+ * @param string $key
+ * @param null|mixed $default
+ *
+ * @throws GuzzleException
+ *
+ * @return null|mixed
+ */
+ public static function getHeader($uri, $key, $default = null)
+ {
+ $headers = self::getHeaders($uri);
+
+ return isset($headers[$key][0]) ? $headers[$key][0] : $default;
+ }
+
+ /**
+ * @param int $retryTimes
+ * @param float $now
+ *
+ * @return bool
+ */
+ public static function allowRetry(array $runtime, $retryTimes, $now)
+ {
+ unset($now);
+ if (!isset($retryTimes) || null === $retryTimes || !\is_numeric($retryTimes)) {
+ return false;
+ }
+ if ($retryTimes > 0 && (empty($runtime) || !isset($runtime['retryable']) || !$runtime['retryable'] || !isset($runtime['maxAttempts']))) {
+ return false;
+ }
+ $maxAttempts = $runtime['maxAttempts'];
+ $retry = empty($maxAttempts) ? 0 : (int) $maxAttempts;
+
+ return $retry >= $retryTimes;
+ }
+
+ /**
+ * @param int $retryTimes
+ *
+ * @return int
+ */
+ public static function getBackoffTime(array $runtime, $retryTimes)
+ {
+ $backOffTime = 0;
+ $policy = isset($runtime['policy']) ? $runtime['policy'] : '';
+
+ if (empty($policy) || 'no' == $policy) {
+ return $backOffTime;
+ }
+
+ $period = isset($runtime['period']) ? $runtime['period'] : '';
+ if (null !== $period && '' !== $period) {
+ $backOffTime = (int) $period;
+ if ($backOffTime <= 0) {
+ return $retryTimes;
+ }
+ }
+
+ return $backOffTime;
+ }
+
+ public static function sleep($time)
+ {
+ sleep($time);
+ }
+
+ public static function isRetryable($retry, $retryTimes = 0)
+ {
+ if ($retry instanceof TeaError) {
+ return true;
+ }
+ if (\is_array($retry)) {
+ $max = isset($retry['maxAttempts']) ? (int) ($retry['maxAttempts']) : 3;
+
+ return $retryTimes <= $max;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param mixed|Model[] ...$item
+ *
+ * @return mixed
+ */
+ public static function merge(...$item)
+ {
+ $tmp = [];
+ $n = 0;
+ foreach ($item as $i) {
+ if (\is_object($i)) {
+ if ($i instanceof Model) {
+ $i = $i->toMap();
+ } else {
+ $i = json_decode(json_encode($i), true);
+ }
+ }
+ if (null === $i) {
+ continue;
+ }
+ if (\is_array($i)) {
+ $tmp[$n++] = $i;
+ }
+ }
+
+ if (\count($tmp)) {
+ return \call_user_func_array('array_merge', $tmp);
+ }
+
+ return [];
+ }
+
+ private static function resolveConfig(array $config = [])
+ {
+ $options = new Dot(['http_errors' => false]);
+ if (isset($config['httpProxy']) && !empty($config['httpProxy'])) {
+ $options->set('proxy.http', $config['httpProxy']);
+ }
+ if (isset($config['httpsProxy']) && !empty($config['httpsProxy'])) {
+ $options->set('proxy.https', $config['httpsProxy']);
+ }
+ if (isset($config['noProxy']) && !empty($config['noProxy'])) {
+ $options->set('proxy.no', $config['noProxy']);
+ }
+ if (isset($config['ignoreSSL']) && !empty($config['ignoreSSL'])) {
+ $options->set('verify',!((bool)$config['ignoreSSL']));
+ }
+ // readTimeout&connectTimeout unit is millisecond
+ $read_timeout = isset($config['readTimeout']) && !empty($config['readTimeout']) ? (int) $config['readTimeout'] : 0;
+ $con_timeout = isset($config['connectTimeout']) && !empty($config['connectTimeout']) ? (int) $config['connectTimeout'] : 0;
+ // timeout unit is second
+ $options->set('timeout', ($read_timeout + $con_timeout) / 1000);
+
+ return $options->all();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/autoload.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/autoload.php
new file mode 100644
index 000000000..ec132011c
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/autoload.php
@@ -0,0 +1,11 @@
+ 1) {
+ $ext = strtolower(end($parts));
+ if (isset(self::$mime_types[$ext])) {
+ return self::$mime_types[$ext];
+ }
+ }
+
+ return null;
+ }
+
+ private static $mime_types = array(
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+ 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+ 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+ 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+ 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+ 'apk' => 'application/vnd.android.package-archive',
+ 'hqx' => 'application/mac-binhex40',
+ 'cpt' => 'application/mac-compactpro',
+ 'doc' => 'application/msword',
+ 'ogg' => 'audio/ogg',
+ 'pdf' => 'application/pdf',
+ 'rtf' => 'text/rtf',
+ 'mif' => 'application/vnd.mif',
+ 'xls' => 'application/vnd.ms-excel',
+ 'ppt' => 'application/vnd.ms-powerpoint',
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'odb' => 'application/vnd.oasis.opendocument.database',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+ 'odi' => 'application/vnd.oasis.opendocument.image',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'odm' => 'application/vnd.oasis.opendocument.text-master',
+ 'ott' => 'application/vnd.oasis.opendocument.text-template',
+ 'oth' => 'application/vnd.oasis.opendocument.text-web',
+ 'sxw' => 'application/vnd.sun.xml.writer',
+ 'stw' => 'application/vnd.sun.xml.writer.template',
+ 'sxc' => 'application/vnd.sun.xml.calc',
+ 'stc' => 'application/vnd.sun.xml.calc.template',
+ 'sxd' => 'application/vnd.sun.xml.draw',
+ 'std' => 'application/vnd.sun.xml.draw.template',
+ 'sxi' => 'application/vnd.sun.xml.impress',
+ 'sti' => 'application/vnd.sun.xml.impress.template',
+ 'sxg' => 'application/vnd.sun.xml.writer.global',
+ 'sxm' => 'application/vnd.sun.xml.math',
+ 'sis' => 'application/vnd.symbian.install',
+ 'wbxml' => 'application/vnd.wap.wbxml',
+ 'wmlc' => 'application/vnd.wap.wmlc',
+ 'wmlsc' => 'application/vnd.wap.wmlscriptc',
+ 'bcpio' => 'application/x-bcpio',
+ 'torrent' => 'application/x-bittorrent',
+ 'bz2' => 'application/x-bzip2',
+ 'vcd' => 'application/x-cdlink',
+ 'pgn' => 'application/x-chess-pgn',
+ 'cpio' => 'application/x-cpio',
+ 'csh' => 'application/x-csh',
+ 'dvi' => 'application/x-dvi',
+ 'spl' => 'application/x-futuresplash',
+ 'gtar' => 'application/x-gtar',
+ 'hdf' => 'application/x-hdf',
+ 'jar' => 'application/java-archive',
+ 'jnlp' => 'application/x-java-jnlp-file',
+ 'js' => 'application/javascript',
+ 'json' => 'application/json',
+ 'ksp' => 'application/x-kspread',
+ 'chrt' => 'application/x-kchart',
+ 'kil' => 'application/x-killustrator',
+ 'latex' => 'application/x-latex',
+ 'rpm' => 'application/x-rpm',
+ 'sh' => 'application/x-sh',
+ 'shar' => 'application/x-shar',
+ 'swf' => 'application/x-shockwave-flash',
+ 'sit' => 'application/x-stuffit',
+ 'sv4cpio' => 'application/x-sv4cpio',
+ 'sv4crc' => 'application/x-sv4crc',
+ 'tar' => 'application/x-tar',
+ 'tcl' => 'application/x-tcl',
+ 'tex' => 'application/x-tex',
+ 'man' => 'application/x-troff-man',
+ 'me' => 'application/x-troff-me',
+ 'ms' => 'application/x-troff-ms',
+ 'ustar' => 'application/x-ustar',
+ 'src' => 'application/x-wais-source',
+ 'zip' => 'application/zip',
+ 'm3u' => 'audio/x-mpegurl',
+ 'ra' => 'audio/x-pn-realaudio',
+ 'wav' => 'audio/x-wav',
+ 'wma' => 'audio/x-ms-wma',
+ 'wax' => 'audio/x-ms-wax',
+ 'pdb' => 'chemical/x-pdb',
+ 'xyz' => 'chemical/x-xyz',
+ 'bmp' => 'image/bmp',
+ 'gif' => 'image/gif',
+ 'ief' => 'image/ief',
+ 'png' => 'image/png',
+ 'wbmp' => 'image/vnd.wap.wbmp',
+ 'ras' => 'image/x-cmu-raster',
+ 'pnm' => 'image/x-portable-anymap',
+ 'pbm' => 'image/x-portable-bitmap',
+ 'pgm' => 'image/x-portable-graymap',
+ 'ppm' => 'image/x-portable-pixmap',
+ 'rgb' => 'image/x-rgb',
+ 'xbm' => 'image/x-xbitmap',
+ 'xpm' => 'image/x-xpixmap',
+ 'xwd' => 'image/x-xwindowdump',
+ 'css' => 'text/css',
+ 'rtx' => 'text/richtext',
+ 'tsv' => 'text/tab-separated-values',
+ 'jad' => 'text/vnd.sun.j2me.app-descriptor',
+ 'wml' => 'text/vnd.wap.wml',
+ 'wmls' => 'text/vnd.wap.wmlscript',
+ 'etx' => 'text/x-setext',
+ 'mxu' => 'video/vnd.mpegurl',
+ 'flv' => 'video/x-flv',
+ 'wm' => 'video/x-ms-wm',
+ 'wmv' => 'video/x-ms-wmv',
+ 'wmx' => 'video/x-ms-wmx',
+ 'wvx' => 'video/x-ms-wvx',
+ 'avi' => 'video/x-msvideo',
+ 'movie' => 'video/x-sgi-movie',
+ 'ice' => 'x-conference/x-cooltalk',
+ '3gp' => 'video/3gpp',
+ 'ai' => 'application/postscript',
+ 'aif' => 'audio/x-aiff',
+ 'aifc' => 'audio/x-aiff',
+ 'aiff' => 'audio/x-aiff',
+ 'asc' => 'text/plain',
+ 'atom' => 'application/atom+xml',
+ 'au' => 'audio/basic',
+ 'bin' => 'application/octet-stream',
+ 'cdf' => 'application/x-netcdf',
+ 'cgm' => 'image/cgm',
+ 'class' => 'application/octet-stream',
+ 'dcr' => 'application/x-director',
+ 'dif' => 'video/x-dv',
+ 'dir' => 'application/x-director',
+ 'djv' => 'image/vnd.djvu',
+ 'djvu' => 'image/vnd.djvu',
+ 'dll' => 'application/octet-stream',
+ 'dmg' => 'application/octet-stream',
+ 'dms' => 'application/octet-stream',
+ 'dtd' => 'application/xml-dtd',
+ 'dv' => 'video/x-dv',
+ 'dxr' => 'application/x-director',
+ 'eps' => 'application/postscript',
+ 'exe' => 'application/octet-stream',
+ 'ez' => 'application/andrew-inset',
+ 'gram' => 'application/srgs',
+ 'grxml' => 'application/srgs+xml',
+ 'gz' => 'application/x-gzip',
+ 'htm' => 'text/html',
+ 'html' => 'text/html',
+ 'ico' => 'image/x-icon',
+ 'ics' => 'text/calendar',
+ 'ifb' => 'text/calendar',
+ 'iges' => 'model/iges',
+ 'igs' => 'model/iges',
+ 'jp2' => 'image/jp2',
+ 'jpe' => 'image/jpeg',
+ 'jpeg' => 'image/jpeg',
+ 'jpg' => 'image/jpeg',
+ 'kar' => 'audio/midi',
+ 'lha' => 'application/octet-stream',
+ 'lzh' => 'application/octet-stream',
+ 'm4a' => 'audio/mp4a-latm',
+ 'm4p' => 'audio/mp4a-latm',
+ 'm4u' => 'video/vnd.mpegurl',
+ 'm4v' => 'video/x-m4v',
+ 'mac' => 'image/x-macpaint',
+ 'mathml' => 'application/mathml+xml',
+ 'mesh' => 'model/mesh',
+ 'mid' => 'audio/midi',
+ 'midi' => 'audio/midi',
+ 'mov' => 'video/quicktime',
+ 'mp2' => 'audio/mpeg',
+ 'mp3' => 'audio/mpeg',
+ 'mp4' => 'video/mp4',
+ 'mpe' => 'video/mpeg',
+ 'mpeg' => 'video/mpeg',
+ 'mpg' => 'video/mpeg',
+ 'mpga' => 'audio/mpeg',
+ 'msh' => 'model/mesh',
+ 'nc' => 'application/x-netcdf',
+ 'oda' => 'application/oda',
+ 'ogv' => 'video/ogv',
+ 'pct' => 'image/pict',
+ 'pic' => 'image/pict',
+ 'pict' => 'image/pict',
+ 'pnt' => 'image/x-macpaint',
+ 'pntg' => 'image/x-macpaint',
+ 'ps' => 'application/postscript',
+ 'qt' => 'video/quicktime',
+ 'qti' => 'image/x-quicktime',
+ 'qtif' => 'image/x-quicktime',
+ 'ram' => 'audio/x-pn-realaudio',
+ 'rdf' => 'application/rdf+xml',
+ 'rm' => 'application/vnd.rn-realmedia',
+ 'roff' => 'application/x-troff',
+ 'sgm' => 'text/sgml',
+ 'sgml' => 'text/sgml',
+ 'silo' => 'model/mesh',
+ 'skd' => 'application/x-koan',
+ 'skm' => 'application/x-koan',
+ 'skp' => 'application/x-koan',
+ 'skt' => 'application/x-koan',
+ 'smi' => 'application/smil',
+ 'smil' => 'application/smil',
+ 'snd' => 'audio/basic',
+ 'so' => 'application/octet-stream',
+ 'svg' => 'image/svg+xml',
+ 't' => 'application/x-troff',
+ 'texi' => 'application/x-texinfo',
+ 'texinfo' => 'application/x-texinfo',
+ 'tif' => 'image/tiff',
+ 'tiff' => 'image/tiff',
+ 'tr' => 'application/x-troff',
+ 'txt' => 'text/plain',
+ 'vrml' => 'model/vrml',
+ 'vxml' => 'application/voicexml+xml',
+ 'webm' => 'video/webm',
+ 'webp' => 'image/webp',
+ 'wrl' => 'model/vrml',
+ 'xht' => 'application/xhtml+xml',
+ 'xhtml' => 'application/xhtml+xml',
+ 'xml' => 'application/xml',
+ 'xsl' => 'application/xml',
+ 'xslt' => 'application/xslt+xml',
+ 'xul' => 'application/vnd.mozilla.xul+xml',
+ );
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssException.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssException.php
new file mode 100644
index 000000000..2320c9e8a
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssException.php
@@ -0,0 +1,54 @@
+details = $details;
+ } else {
+ $message = $details;
+ parent::__construct($message);
+ }
+ }
+
+ public function getHTTPStatus()
+ {
+ return isset($this->details['status']) ? $this->details['status'] : '';
+ }
+
+ public function getRequestId()
+ {
+ return isset($this->details['request-id']) ? $this->details['request-id'] : '';
+ }
+
+ public function getErrorCode()
+ {
+ return isset($this->details['code']) ? $this->details['code'] : '';
+ }
+
+ public function getErrorMessage()
+ {
+ return isset($this->details['message']) ? $this->details['message'] : '';
+ }
+
+ public function getDetails()
+ {
+ return isset($this->details['body']) ? $this->details['body'] : '';
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php
new file mode 100644
index 000000000..e70609a37
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php
@@ -0,0 +1,543 @@
+ $value) {
+ if (is_string($key) && !is_array($value)) {
+ if (strlen($value) > 0) {
+ $temp[] = rawurlencode($key) . '=' . rawurlencode($value);
+ } else {
+ $temp[] = rawurlencode($key);
+ }
+ }
+ }
+ return implode('&', $temp);
+ }
+
+ /**
+ * Html encoding '<', '>', '&', '\', '"' in subject parameter.
+ *
+ * @param string $subject
+ * @return string
+ */
+ public static function sReplace($subject)
+ {
+ $search = array('<', '>', '&', '\'', '"');
+ $replace = array('<', '>', '&', ''', '"');
+ return str_replace($search, $replace, $subject);
+ }
+
+ /**
+ * Check whether the string includes any chinese character
+ *
+ * @param $str
+ * @return int
+ */
+ public static function chkChinese($str)
+ {
+ return preg_match('/[\x80-\xff]./', $str);
+ }
+
+ /**
+ * Checks if the string is encoded by GB2312.
+ *
+ * @param string $str
+ * @return boolean false UTF-8 encoding TRUE GB2312 encoding
+ */
+ public static function isGb2312($str)
+ {
+ for ($i = 0; $i < strlen($str); $i++) {
+ $v = ord($str[$i]);
+ if ($v > 127) {
+ if (($v >= 228) && ($v <= 233)) {
+ if (($i + 2) >= (strlen($str) - 1)) return true; // not enough characters
+ $v1 = ord($str[$i + 1]);
+ $v2 = ord($str[$i + 2]);
+ if (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191))
+ return false;
+ else
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks if the string is encoded by GBK
+ *
+ * @param string $str
+ * @param boolean $gbk
+ * @return boolean
+ */
+ public static function checkChar($str, $gbk = true)
+ {
+ for ($i = 0; $i < strlen($str); $i++) {
+ $v = ord($str[$i]);
+ if ($v > 127) {
+ if (($v >= 228) && ($v <= 233)) {
+ if (($i + 2) >= (strlen($str) - 1)) return $gbk ? true : FALSE; // not enough characters
+ $v1 = ord($str[$i + 1]);
+ $v2 = ord($str[$i + 2]);
+ if ($gbk) {
+ return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? FALSE : TRUE;//GBK
+ } else {
+ return (($v1 >= 128) && ($v1 <= 191) && ($v2 >= 128) && ($v2 <= 191)) ? TRUE : FALSE;
+ }
+ }
+ }
+ }
+ return $gbk ? TRUE : FALSE;
+ }
+
+ /**
+ * Checks if the bucket name is valid
+ * bucket naming rules
+ * 1. Can only include lowercase letters, numbers, or dashes
+ * 2. Must start and end with lowercase letters or numbers
+ * 3. Must be within a length from 3 to 63 bytes.
+ *
+ * @param string $bucket Bucket name
+ * @return boolean
+ */
+ public static function validateBucket($bucket)
+ {
+ $pattern = '/^[a-z0-9][a-z0-9-]{2,62}$/';
+ if (!preg_match($pattern, $bucket)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Checks if object name is valid
+ * object naming rules:
+ * 1. Must be within a length from 1 to 1023 bytes
+ * 2. Cannot start with '/' or '\\'.
+ * 3. Must be encoded in UTF-8.
+ *
+ * @param string $object Object名称
+ * @return boolean
+ */
+ public static function validateObject($object)
+ {
+ $pattern = '/^.{1,1023}$/';
+ if (!preg_match($pattern, $object) ||
+ self::startsWith($object, '/') || self::startsWith($object, '\\')
+ ) {
+ return false;
+ }
+ return true;
+ }
+
+
+ /**
+ * Checks if $str starts with $findMe
+ *
+ * @param string $str
+ * @param string $findMe
+ * @return bool
+ */
+ public static function startsWith($str, $findMe)
+ {
+ if (strpos($str, $findMe) === 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+
+ /**
+ * Generate the xml message of createBucketXmlBody.
+ *
+ * @param string $storageClass
+ * @return string
+ */
+ public static function createBucketXmlBody($storageClass)
+ {
+ $xml = new \SimpleXMLElement('');
+ $xml->addChild('StorageClass', $storageClass);
+ return $xml->asXML();
+ }
+
+ /**
+ * validate $options
+ *
+ * @param array $options
+ * @throws OssException
+ */
+ public static function validateOptions($options)
+ {
+ //$options
+ if ($options != NULL && !is_array($options)) {
+ throw new OssException ($options . ':' . 'option must be array');
+ }
+ }
+
+ /**
+ * check whether the Content is valid.
+ *
+ * @param $content string
+ * @throws OssException
+ */
+ public static function validateContent($content)
+ {
+ if (empty($content)) {
+ throw new OssException("http body content is invalid");
+ }
+ }
+
+ /**
+ * Check if BUCKET/OBJECT/OBJECT GROUP is empty.
+ *
+ * @param string $name
+ * @param string $errMsg
+ * @throws OssException
+ * @return void
+ */
+ public static function throwOssExceptionWithMessageIfEmpty($name, $errMsg)
+ {
+ if (empty($name)) {
+ if (is_string($name) && $name == '0')
+ return;
+ throw new OssException($errMsg);
+ }
+ }
+
+ /**
+ * This is a method for test only. DO NOT USE.
+ *
+ * @param $filename
+ * @param $size
+ */
+ public static function generateFile($filename, $size)
+ {
+ if (file_exists($filename) && $size == sprintf('%u',filesize($filename))) {
+ echo $filename . " already exists, no need to create again. ";
+ return;
+ }
+ $part_size = 1 * 1024 * 1024;
+ $fp = fopen($filename, "w");
+ $characters = << 0) {
+ if ($size < $part_size) {
+ $write_size = $size;
+ } else {
+ $write_size = $part_size;
+ }
+ $size -= $write_size;
+ $a = $characters[rand(0, $charactersLength - 1)];
+ $content = str_repeat($a, $write_size);
+ $flag = fwrite($fp, $content);
+ if (!$flag) {
+ echo "write to " . $filename . " failed. ";
+ break;
+ }
+ }
+ } else {
+ echo "open " . $filename . " failed. ";
+ }
+ fclose($fp);
+ }
+
+ /**
+ * Get MD5 of the file.
+ *
+ * @param $filename
+ * @param $from_pos
+ * @param $to_pos
+ * @return string
+ */
+ public static function getMd5SumForFile($filename, $from_pos, $to_pos)
+ {
+ $content_md5 = "";
+ if (($to_pos - $from_pos) > self::OSS_MAX_PART_SIZE) {
+ return $content_md5;
+ }
+ $filesize = sprintf('%u',filesize($filename));
+ if ($from_pos >= $filesize || $to_pos >= $filesize || $from_pos < 0 || $to_pos < 0) {
+ return $content_md5;
+ }
+
+ $total_length = $to_pos - $from_pos + 1;
+ $buffer = 8192;
+ $left_length = $total_length;
+ if (!file_exists($filename)) {
+ return $content_md5;
+ }
+
+ if (false === $fh = fopen($filename, 'rb')) {
+ return $content_md5;
+ }
+
+ fseek($fh, $from_pos);
+ $data = '';
+ while (!feof($fh)) {
+ if ($left_length >= $buffer) {
+ $read_length = $buffer;
+ } else {
+ $read_length = $left_length;
+ }
+ if ($read_length <= 0) {
+ break;
+ } else {
+ $data .= fread($fh, $read_length);
+ $left_length = $left_length - $read_length;
+ }
+ }
+ fclose($fh);
+ $content_md5 = base64_encode(md5($data, true));
+ return $content_md5;
+ }
+
+ /**
+ * Check if the OS is Windows. The default encoding in Windows is GBK.
+ *
+ * @return bool
+ */
+ public static function isWin()
+ {
+ return strtoupper(substr(PHP_OS, 0, 3)) == "WIN";
+ }
+
+ /**
+ * Encodes the file path from GBK to UTF-8.
+ * The default encoding in Windows is GBK.
+ * And if the file path is in Chinese, the file would not be found without the transcoding to UTF-8.
+ *
+ * @param $file_path
+ * @return string
+ */
+ public static function encodePath($file_path)
+ {
+ if (self::chkChinese($file_path) && self::isWin()) {
+ $file_path = iconv('utf-8', 'gbk', $file_path);
+ }
+ return $file_path;
+ }
+
+ /**
+ * Check if the endpoint is in the IPv4 format, such as xxx.xxx.xxx.xxx:port or xxx.xxx.xxx.xxx.
+ *
+ * @param string $endpoint The endpoint to check.
+ * @return boolean
+ */
+ public static function isIPFormat($endpoint)
+ {
+ $ip_array = explode(":", $endpoint);
+ $hostname = $ip_array[0];
+ $ret = filter_var($hostname, FILTER_VALIDATE_IP);
+ if (!$ret) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Get the host:port from endpoint.
+ *
+ * @param string $endpoint the endpoint.
+ * @return string
+ * @throws OssException
+ */
+ public static function getHostPortFromEndpoint($endpoint)
+ {
+ $str = $endpoint;
+ $pos = strpos($str, "://");
+ if ($pos !== false) {
+ $str = substr($str, $pos+3);
+ }
+
+ $pos = strpos($str, '#');
+ if ($pos !== false) {
+ $str = substr($str, 0, $pos);
+ }
+
+ $pos = strpos($str, '?');
+ if ($pos !== false) {
+ $str = substr($str, 0, $pos);
+ }
+
+ $pos = strpos($str, '/');
+ if ($pos !== false) {
+ $str = substr($str, 0, $pos);
+ }
+
+ $pos = strpos($str, '@');
+ if ($pos !== false) {
+ $str = substr($str, $pos+1);
+ }
+
+ if (!preg_match('/^[\w.-]+(:[0-9]+)?$/', $str)) {
+ throw new OssException("endpoint is invalid:" . $endpoint);
+ }
+
+ return $str;
+ }
+
+ /**
+ * Generate the xml message of DeleteMultiObjects.
+ *
+ * @param string[] $objects
+ * @param bool $quiet
+ * @return string
+ */
+ public static function createDeleteObjectsXmlBody($objects, $quiet)
+ {
+ $xml = new \SimpleXMLElement('');
+ $xml->addChild('Quiet', $quiet);
+ foreach ($objects as $object) {
+ $sub_object = $xml->addChild('Object');
+ $object = OssUtil::sReplace($object);
+ $sub_object->addChild('Key', $object);
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * Generate the xml message of DeleteMultiObjects.
+ *
+ * @param DeleteObjectInfo[] $objects
+ * @param bool $quiet
+ * @return string
+ */
+ public static function createDeleteObjectVersionsXmlBody($objects, $quiet)
+ {
+ $xml = new \SimpleXMLElement('');
+ $xml->addChild('Quiet', $quiet);
+ foreach ($objects as $object) {
+ $sub_object = $xml->addChild('Object');
+ $key = OssUtil::sReplace($object->getKey());
+ $sub_object->addChild('Key', $key);
+ $versionId = $object->getVersionId();
+ if (!empty($versionId)) {
+ $sub_object->addChild('VersionId', $object->getVersionId());
+ }
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * Generate the xml message of CompleteMultipartUpload.
+ *
+ * @param array[] $listParts
+ * @return string
+ */
+ public static function createCompleteMultipartUploadXmlBody($listParts)
+ {
+ $xml = new \SimpleXMLElement('');
+ foreach ($listParts as $node) {
+ $part = $xml->addChild('Part');
+ $part->addChild('PartNumber', $node['PartNumber']);
+ $part->addChild('ETag', $node['ETag']);
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * Read the directory, return a associative array in which the MD5 is the named key and the is the value.
+ *
+ * @param string $dir
+ * @param string $exclude
+ * @param bool $recursive
+ * @return string[]
+ */
+ public static function readDir($dir, $exclude = ".|..|.svn|.git", $recursive = false)
+ {
+ $file_list_array = array();
+ $base_path = $dir;
+ $exclude_array = explode("|", $exclude);
+ $exclude_array = array_unique(array_merge($exclude_array, array('.', '..')));
+
+ if ($recursive) {
+ foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)) as $new_file) {
+ if ($new_file->isDir()) continue;
+ $object = str_replace($base_path, '', $new_file);
+ if (!in_array(strtolower($object), $exclude_array)) {
+ $object = ltrim($object, '/');
+ if (is_file($new_file)) {
+ $key = md5($new_file . $object, false);
+ $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
+ }
+ }
+ }
+ } else if ($handle = opendir($dir)) {
+ while (false !== ($file = readdir($handle))) {
+ if (!in_array(strtolower($file), $exclude_array)) {
+ $new_file = $dir . '/' . $file;
+ $object = $file;
+ $object = ltrim($object, '/');
+ if (is_file($new_file)) {
+ $key = md5($new_file . $object, false);
+ $file_list_array[$key] = array('path' => $new_file, 'file' => $object,);
+ }
+ }
+ }
+ closedir($handle);
+ }
+ return $file_list_array;
+ }
+
+ /**
+ * Decode key based on the encoding type
+ *
+ * @param string $key
+ * @param string $encoding
+ * @return string
+ */
+ public static function decodeKey($key, $encoding)
+ {
+ if ($encoding == "") {
+ return $key;
+ }
+
+ if ($encoding == "url") {
+ return rawurldecode($key);
+ } else {
+ throw new OssException("Unrecognized encoding type: " . $encoding);
+ }
+ }
+
+ public static function unparseUrl($parsed_url) {
+ $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
+ $host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
+ $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
+ $path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
+ $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
+ return "$scheme$host$port$path$query";
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Credentials/Credentials.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Credentials/Credentials.php
new file mode 100644
index 000000000..2a8ffb518
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Credentials/Credentials.php
@@ -0,0 +1,63 @@
+key = trim($key);
+ $this->secret = trim($secret);
+ $this->token = $token;
+ }
+
+
+ /**
+ * @return string
+ */
+ public function getAccessKeyId()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getAccessKeySecret()
+ {
+ return $this->secret;
+ }
+
+ /**
+ * @return string|null
+ */
+ public function getSecurityToken()
+ {
+ return $this->token;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Credentials/CredentialsProvider.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Credentials/CredentialsProvider.php
new file mode 100644
index 000000000..b2fde836f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Credentials/CredentialsProvider.php
@@ -0,0 +1,11 @@
+credentials = new Credentials($key, $secret, $token);
+ }
+
+ /**
+ * @return Credentials
+ */
+ public function getCredentials()
+ {
+ return $this->credentials;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php
new file mode 100644
index 000000000..58bb21506
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php
@@ -0,0 +1,898 @@
+).
+ */
+ public $request_class = 'OSS\Http\RequestCore';
+
+ /**
+ * The default class to use for HTTP Responses (defaults to ).
+ */
+ public $response_class = 'OSS\Http\ResponseCore';
+
+ /**
+ * Default useragent string to use.
+ */
+ public $useragent = 'RequestCore/1.4.3';
+
+ /**
+ * File to read from while streaming up.
+ */
+ public $read_file = null;
+
+ /**
+ * The resource to read from while streaming up.
+ */
+ public $read_stream = null;
+
+ /**
+ * The size of the stream to read from.
+ */
+ public $read_stream_size = null;
+
+ /**
+ * The length already read from the stream.
+ */
+ public $read_stream_read = 0;
+
+ /**
+ * File to write to while streaming down.
+ */
+ public $write_file = null;
+
+ /**
+ * The resource to write to while streaming down.
+ */
+ public $write_stream = null;
+
+ /**
+ * Stores the intended starting seek position.
+ */
+ public $seek_position = null;
+
+ /**
+ * The location of the cacert.pem file to use.
+ */
+ public $cacert_location = false;
+
+ /**
+ * The state of SSL certificate verification.
+ */
+ public $ssl_verification = true;
+
+ /**
+ * The user-defined callback function to call when a stream is read from.
+ */
+ public $registered_streaming_read_callback = null;
+
+ /**
+ * The user-defined callback function to call when a stream is written to.
+ */
+ public $registered_streaming_write_callback = null;
+
+ /**
+ * The request timeout time, which is 5,184,000 seconds,that is, 60 days by default
+ *
+ * @var int
+ */
+ public $timeout = 5184000;
+
+ /**
+ * The connection timeout time, which is 10 seconds by default
+ *
+ * @var int
+ */
+ public $connect_timeout = 10;
+
+ /*%******************************************************************************************%*/
+ // CONSTANTS
+
+ /**
+ * GET HTTP Method
+ */
+ const HTTP_GET = 'GET';
+
+ /**
+ * POST HTTP Method
+ */
+ const HTTP_POST = 'POST';
+
+ /**
+ * PUT HTTP Method
+ */
+ const HTTP_PUT = 'PUT';
+
+ /**
+ * DELETE HTTP Method
+ */
+ const HTTP_DELETE = 'DELETE';
+
+ /**
+ * HEAD HTTP Method
+ */
+ const HTTP_HEAD = 'HEAD';
+
+
+ /*%******************************************************************************************%*/
+ // CONSTRUCTOR/DESTRUCTOR
+
+ /**
+ * 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`
+ * @param array $helpers (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.
+ * @return $this A reference to the current instance.
+ */
+ public function __construct($url = null, $proxy = null, $helpers = null)
+ {
+ // Set some default values.
+ $this->request_url = $url;
+ $this->method = self::HTTP_GET;
+ $this->request_headers = array();
+ $this->request_body = '';
+
+ // Set a new Request class if one was set.
+ if (isset($helpers['request']) && !empty($helpers['request'])) {
+ $this->request_class = $helpers['request'];
+ }
+
+ // Set a new Request class if one was set.
+ if (isset($helpers['response']) && !empty($helpers['response'])) {
+ $this->response_class = $helpers['response'];
+ }
+
+ if ($proxy) {
+ $this->set_proxy($proxy);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Destruct the instance. Closes opened file handles.
+ *
+ * @return $this A reference to the current instance.
+ */
+ public function __destruct()
+ {
+ if (isset($this->read_file) && isset($this->read_stream)) {
+ fclose($this->read_stream);
+ }
+
+ if (isset($this->write_file) && isset($this->write_stream)) {
+ fclose($this->write_stream);
+ }
+
+ return $this;
+ }
+
+
+ /*%******************************************************************************************%*/
+ // REQUEST METHODS
+
+ /**
+ * 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.
+ * @return $this A reference to the current instance.
+ */
+ public function set_credentials($user, $pass)
+ {
+ $this->username = $user;
+ $this->password = $pass;
+ return $this;
+ }
+
+ /**
+ * 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.
+ * @return $this A reference to the current instance.
+ */
+ public function add_header($key, $value)
+ {
+ $this->request_headers[$key] = $value;
+ return $this;
+ }
+
+ /**
+ * 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.
+ */
+ public function remove_header($key)
+ {
+ if (isset($this->request_headers[$key])) {
+ unset($this->request_headers[$key]);
+ }
+ return $this;
+ }
+
+ /**
+ * Set the method type for the request.
+ *
+ * @param string $method (Required) One of the following constants: , , , , .
+ * @return $this A reference to the current instance.
+ */
+ public function set_method($method)
+ {
+ $this->method = strtoupper($method);
+ return $this;
+ }
+
+ /**
+ * 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.
+ */
+ public function set_useragent($ua)
+ {
+ $this->useragent = $ua;
+ return $this;
+ }
+
+ /**
+ * Set the body to send in the request.
+ *
+ * @param string $body (Required) The textual content to send along in the body of the request.
+ * @return $this A reference to the current instance.
+ */
+ public function set_body($body)
+ {
+ $this->request_body = $body;
+ return $this;
+ }
+
+ /**
+ * Set the URL to make the request to.
+ *
+ * @param string $url (Required) The URL to make the request to.
+ * @return $this A reference to the current instance.
+ */
+ public function set_request_url($url)
+ {
+ $this->request_url = $url;
+ return $this;
+ }
+
+ /**
+ * Set additional CURLOPT settings. These will merge with the default settings, and override if
+ * there is a duplicate.
+ *
+ * @param array $curlopts (Optional) A set of key-value pairs that set `CURLOPT` options. These will merge with the existing CURLOPTs, and ones passed here will override the defaults. Keys should be the `CURLOPT_*` constants, not strings.
+ * @return $this A reference to the current instance.
+ */
+ public function set_curlopts($curlopts)
+ {
+ $this->curlopts = $curlopts;
+ return $this;
+ }
+
+ /**
+ * 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.
+ */
+ public function set_read_stream_size($size)
+ {
+ $this->read_stream_size = $size;
+
+ return $this;
+ }
+
+ /**
+ * 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 and
+ * .
+ *
+ * @param resource $resource (Required) The readable resource to read from.
+ * @param integer $size (Optional) The size of the stream to read.
+ * @return $this A reference to the current instance.
+ */
+ public function set_read_stream($resource, $size = null)
+ {
+ if (!isset($size) || $size < 0) {
+ $stats = fstat($resource);
+
+ if ($stats && $stats['size'] >= 0) {
+ $position = ftell($resource);
+
+ if ($position !== false && $position >= 0) {
+ $size = $stats['size'] - $position;
+ }
+ }
+ }
+
+ $this->read_stream = $resource;
+
+ return $this->set_read_stream_size($size);
+ }
+
+ /**
+ * 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.
+ */
+ public function set_read_file($location)
+ {
+ $this->read_file = $location;
+ $read_file_handle = fopen($location, 'r');
+
+ return $this->set_read_stream($read_file_handle);
+ }
+
+ /**
+ * 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.
+ */
+ public function set_write_stream($resource)
+ {
+ $this->write_stream = $resource;
+
+ return $this;
+ }
+
+ /**
+ * 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.
+ */
+ public function set_write_file($location)
+ {
+ $this->write_file = $location;
+ }
+
+ /**
+ * Set the proxy to use for making requests.
+ *
+ * @param string $proxy (Required) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`
+ * @return $this A reference to the current instance.
+ */
+ public function set_proxy($proxy)
+ {
+ $proxy = parse_url($proxy);
+ $proxy['user'] = isset($proxy['user']) ? $proxy['user'] : null;
+ $proxy['pass'] = isset($proxy['pass']) ? $proxy['pass'] : null;
+ $proxy['port'] = isset($proxy['port']) ? $proxy['port'] : null;
+ $this->proxy = $proxy;
+ return $this;
+ }
+
+ /**
+ * Set the intended starting seek position.
+ *
+ * @param integer $position (Required) The byte-position of the stream to begin reading from.
+ * @return $this A reference to the current instance.
+ */
+ public function set_seek_position($position)
+ {
+ $this->seek_position = isset($position) ? (integer)$position : null;
+
+ 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
+ * .
+ *
+ * The user-defined callback function should accept three arguments:
+ *
+ *
+ *
$curl_handle - resource - Required - The cURL handle resource that represents the in-progress transfer.
+ *
$file_handle - resource - Required - The file handle resource that represents the file on the local file system.
+ *
$length - integer - Required - The length in kilobytes of the data chunk that was transferred.
+ *
+ *
+ * @param string|array|function $callback (Required) The callback function is called by , so you can pass the following values:
+ *
The name of a global function to execute, passed as a string.
+ *
A method to execute, passed as array('ClassName', 'MethodName').
+ *
An anonymous function (PHP 5.3+).
+ * @return $this A reference to the current instance.
+ */
+ public function register_streaming_read_callback($callback)
+ {
+ $this->registered_streaming_read_callback = $callback;
+
+ return $this;
+ }
+
+ /**
+ * Register a callback function to execute whenever a data stream is written to using
+ * .
+ *
+ * The user-defined callback function should accept two arguments:
+ *
+ *
+ *
$curl_handle - resource - Required - The cURL handle resource that represents the in-progress transfer.
+ *
$length - integer - Required - The length in kilobytes of the data chunk that was transferred.
+ *
+ *
+ * @param string|array|function $callback (Required) The callback function is called by , so you can pass the following values:
+ *
The name of a global function to execute, passed as a string.
+ *
A method to execute, passed as array('ClassName', 'MethodName').
+ *
An anonymous function (PHP 5.3+).
+ * @return $this A reference to the current instance.
+ */
+ public function register_streaming_write_callback($callback)
+ {
+ $this->registered_streaming_write_callback = $callback;
+
+ return $this;
+ }
+
+
+ /*%******************************************************************************************%*/
+ // PREPARE, SEND, AND PROCESS REQUEST
+
+ /**
+ * A callback function that is invoked by cURL for streaming up.
+ *
+ * @param resource $curl_handle (Required) The cURL handle for the request.
+ * @param resource $file_handle (Required) The open file handle resource.
+ * @param integer $length (Required) The maximum number of bytes to read.
+ * @return binary Binary data from a stream.
+ */
+ public function streaming_read_callback($curl_handle, $file_handle, $length)
+ {
+ // Once we've sent as much as we're supposed to send...
+ if ($this->read_stream_read >= $this->read_stream_size) {
+ // Send EOF
+ return '';
+ }
+
+ // If we're at the beginning of an upload and need to seek...
+ if ($this->read_stream_read == 0 && isset($this->seek_position) && $this->seek_position !== ftell($this->read_stream)) {
+ if (fseek($this->read_stream, $this->seek_position) !== 0) {
+ throw new RequestCore_Exception('The stream does not support seeking and is either not at the requested position or the position is unknown.');
+ }
+ }
+
+ $read = fread($this->read_stream, min($this->read_stream_size - $this->read_stream_read, $length)); // Remaining upload data or cURL's requested chunk size
+ $this->read_stream_read += strlen($read);
+
+ $out = $read === false ? '' : $read;
+
+ // Execute callback function
+ if ($this->registered_streaming_read_callback) {
+ call_user_func($this->registered_streaming_read_callback, $curl_handle, $file_handle, $out);
+ }
+
+ return $out;
+ }
+
+ /**
+ * A callback function that is invoked by cURL for streaming down.
+ *
+ * @param resource $curl_handle (Required) The cURL handle for the request.
+ * @param binary $data (Required) The data to write.
+ * @return integer The number of bytes written.
+ */
+ 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));
+
+ if ($written_last === false) {
+ return $written_total;
+ }
+
+ $written_total += $written_last;
+ }
+
+ // Execute callback function
+ if ($this->registered_streaming_write_callback) {
+ call_user_func($this->registered_streaming_write_callback, $curl_handle, $written_total);
+ }
+
+ return $written_total;
+ }
+
+ /**
+ * Prepare and adds the details of the cURL request. This can be passed along to a
+ * function.
+ *
+ * @return resource The handle for the cURL object.
+ *
+ */
+ public function prep_request()
+ {
+ $curl_handle = curl_init();
+
+ // Set default options.
+ curl_setopt($curl_handle, CURLOPT_URL, $this->request_url);
+ curl_setopt($curl_handle, CURLOPT_FILETIME, true);
+ curl_setopt($curl_handle, CURLOPT_FRESH_CONNECT, false);
+// curl_setopt($curl_handle, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
+ curl_setopt($curl_handle, CURLOPT_MAXREDIRS, 5);
+ curl_setopt($curl_handle, CURLOPT_HEADER, true);
+ curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curl_handle, CURLOPT_TIMEOUT, $this->timeout);
+ curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, $this->connect_timeout);
+ 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
+ if ($this->ssl_verification) {
+ curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, true);
+ curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, 2);
+ } else {
+ curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, false);
+ }
+
+ // chmod the file as 0755
+ if ($this->cacert_location === true) {
+ curl_setopt($curl_handle, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
+ } elseif (is_string($this->cacert_location)) {
+ curl_setopt($curl_handle, CURLOPT_CAINFO, $this->cacert_location);
+ }
+
+ // Debug mode
+ if ($this->debug_mode) {
+ curl_setopt($curl_handle, CURLOPT_VERBOSE, true);
+ }
+
+ // Handle open_basedir & safe mode
+ if (!ini_get('safe_mode') && !ini_get('open_basedir')) {
+ curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
+ }
+
+ // Enable a proxy connection if requested.
+ if ($this->proxy) {
+ $host = $this->proxy['host'];
+ $host .= ($this->proxy['port']) ? ':' . $this->proxy['port'] : '';
+ curl_setopt($curl_handle, CURLOPT_PROXY, $host);
+
+ if (isset($this->proxy['user']) && isset($this->proxy['pass'])) {
+ curl_setopt($curl_handle, CURLOPT_PROXYUSERPWD, $this->proxy['user'] . ':' . $this->proxy['pass']);
+ }
+ }
+
+ // Set credentials for HTTP Basic/Digest Authentication.
+ if ($this->username && $this->password) {
+ curl_setopt($curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+ curl_setopt($curl_handle, CURLOPT_USERPWD, $this->username . ':' . $this->password);
+ }
+
+ // Handle the encoding if we can.
+ if (extension_loaded('zlib')) {
+ curl_setopt($curl_handle, CURLOPT_ENCODING, '');
+ }
+
+ // Process custom headers
+ if (isset($this->request_headers) && count($this->request_headers)) {
+ $temp_headers = array();
+
+ foreach ($this->request_headers as $k => $v) {
+ $temp_headers[] = $k . ': ' . $v;
+ }
+
+ // fix "Expect: 100-continue"
+ $temp_headers[] = 'Expect:';
+ curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $temp_headers);
+ }
+
+ switch ($this->method) {
+ case self::HTTP_PUT:
+ //unset($this->read_stream);
+ curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'PUT');
+ if (isset($this->read_stream)) {
+ if (!isset($this->read_stream_size) || $this->read_stream_size < 0) {
+ throw new RequestCore_Exception('The stream size for the streaming upload cannot be determined.');
+ }
+ curl_setopt($curl_handle, CURLOPT_INFILESIZE, $this->read_stream_size);
+ curl_setopt($curl_handle, CURLOPT_UPLOAD, true);
+ } else {
+ curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);
+ }
+ break;
+
+ case self::HTTP_POST:
+ curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'POST');
+ if (isset($this->read_stream)) {
+ if (!isset($this->read_stream_size) || $this->read_stream_size < 0) {
+ throw new RequestCore_Exception('The stream size for the streaming upload cannot be determined.');
+ }
+ curl_setopt($curl_handle, CURLOPT_INFILESIZE, $this->read_stream_size);
+ curl_setopt($curl_handle, CURLOPT_UPLOAD, true);
+ } else {
+ curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);
+ }
+ break;
+
+ case self::HTTP_HEAD:
+ curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, self::HTTP_HEAD);
+ curl_setopt($curl_handle, CURLOPT_NOBODY, 1);
+ break;
+
+ default: // Assumed GET
+ curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, $this->method);
+ 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 {
+ curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);
+ }
+ break;
+ }
+
+ // Merge in the CURLOPTs
+ if (isset($this->curlopts) && sizeof($this->curlopts) > 0) {
+ foreach ($this->curlopts as $k => $v) {
+ curl_setopt($curl_handle, $k, $v);
+ }
+ }
+
+ return $curl_handle;
+ }
+
+ /**
+ * Take the post-processed cURL data and break it down into useful header/body/info chunks. Uses the
+ * data stored in the `curl_handle` and `response` properties unless replacement data is passed in via
+ * parameters.
+ *
+ * @param resource|\CurlHandle|null|false $curl_handle (Optional) The reference to the already executed cURL request. Receive CurlHandle instance from PHP8.0
+ * @param string $response (Optional) The actual response content itself that needs to be parsed.
+ * @return ResponseCore A object containing a parsed HTTP response.
+ */
+ public function process_response($curl_handle = null, $response = null)
+ {
+ // Accept a custom one if it's passed.
+ if ($curl_handle && $response) {
+ $this->response = $response;
+ }
+
+ // As long as this came back as a valid resource or CurlHandle instance...
+ if (is_resource($curl_handle) || (is_object($curl_handle) && in_array(get_class($curl_handle),array('CurlHandle','Swoole\Curl\Handler', 'Swoole\Coroutine\Curl\Handle'),true))) {
+ // Determine what's what.
+ $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($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));
+ $this->response_headers = array_pop($this->response_headers);
+ $this->response_headers = explode("\r\n", $this->response_headers);
+ array_shift($this->response_headers);
+
+ // Loop through and split up the headers.
+ $header_assoc = array();
+ foreach ($this->response_headers as $header) {
+ $kv = explode(': ', $header);
+ $header_assoc[strtolower($kv[0])] = isset($kv[1]) ? $kv[1] : '';
+ }
+
+ // 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;
+
+ if ($curl_handle && $response) {
+ return new ResponseCore($this->response_headers, $this->response_body, $this->response_code);
+ }
+ }
+
+ // Return false
+ return false;
+ }
+
+ /**
+ * 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.
+ */
+ public function send_request($parse = false)
+ {
+ set_time_limit(0);
+
+ $curl_handle = $this->prep_request();
+ $this->response = curl_exec($curl_handle);
+
+ if ($this->response === false) {
+ throw new RequestCore_Exception('cURL error: ' . curl_error($curl_handle) . ' (' . curl_errno($curl_handle) . ')');
+ }
+
+ $parsed_response = $this->process_response($curl_handle, $this->response);
+
+ curl_close($curl_handle);
+ unset($curl_handle);
+
+ if ($parse) {
+ return $parsed_response;
+ }
+
+ return $this->response;
+ }
+
+ /*%******************************************************************************************%*/
+ // RESPONSE METHODS
+
+ /**
+ * Get the HTTP response headers from the request.
+ *
+ * @param string $header (Optional) A specific header value to return. Defaults to all headers.
+ * @return string|array All or selected header values.
+ */
+ public function get_response_header($header = null)
+ {
+ if ($header) {
+ return $this->response_headers[strtolower($header)];
+ }
+ return $this->response_headers;
+ }
+
+ /**
+ * Get the HTTP response body from the request.
+ *
+ * @return string The response body.
+ */
+ public function get_response_body()
+ {
+ return $this->response_body;
+ }
+
+ /**
+ * Get the HTTP response code from the request.
+ *
+ * @return string The HTTP response code.
+ */
+ public function get_response_code()
+ {
+ return $this->response_code;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore_Exception.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore_Exception.php
new file mode 100644
index 000000000..cb4e83c65
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore_Exception.php
@@ -0,0 +1,8 @@
+).
+ * @param string $body (Required) XML-formatted response from OSS.
+ * @param integer $status (Optional) HTTP response status code from the request.
+ * @return Mixed Contains an `header` property (HTTP headers as an associative array), a or `body` property, and an `status` code.
+ */
+ public function __construct($header, $body, $status = null)
+ {
+ $this->header = $header;
+ $this->body = $body;
+ $this->status = $status;
+
+ return $this;
+ }
+
+ /**
+ * Did we receive the status code we expected?
+ *
+ * @param integer|array $codes (Optional) The status code(s) to expect. Pass an for a single acceptable value, or an of integers for multiple acceptable values.
+ * @return boolean Whether we received the expected status code or not.
+ */
+ public function isOK($codes = array(200, 201, 204, 206))
+ {
+ if (is_array($codes)) {
+ return in_array($this->status, $codes);
+ }
+
+ return $this->status === $codes;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketInfo.php
new file mode 100644
index 000000000..e211eed65
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketInfo.php
@@ -0,0 +1,181 @@
+location = $location;
+ $this->createDate = $createDate;
+ $this->name = $name;
+ }
+
+ /**
+ * Get bucket location
+ *
+ * @return string
+ */
+ public function getLocation()
+ {
+ return $this->location;
+ }
+
+ /**
+ * Get bucket name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Get bucket creation time.
+ *
+ * @return string
+ */
+ public function getCreateDate()
+ {
+ return $this->createDate;
+ }
+
+ /**
+ * Get bucket storage class.
+ *
+ * @return string
+ */
+ public function getStorageClass()
+ {
+ return $this->storageClass;
+ }
+
+ /**
+ * Get bucket extranet endpoint.
+ *
+ * @return string
+ */
+ public function getExtranetEndpoint()
+ {
+ return $this->extranetEndpoint;
+ }
+
+ /**
+ * Get bucket intranet endpoint.
+ *
+ * @return string
+ */
+ public function getIntranetEndpoint()
+ {
+ return $this->intranetEndpoint;
+ }
+
+ /**
+ * Get bucket intranet endpoint.
+ *
+ * @return string
+ */
+ public function getRegion()
+ {
+ return $this->region;
+ }
+
+
+ /**
+ * Parse bucket information from node.
+ *
+ * @param xml $xml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXmlNode($xml)
+ {
+ if (isset($xml->Location)) {
+ $this->location = strval($xml->Location);
+ }
+ if (isset($xml->Name)) {
+ $this->name = strval($xml->Name);
+ }
+ if (isset($xml->CreationDate)) {
+ $this->createDate = strval($xml->CreationDate);
+ }
+ if (isset($xml->StorageClass)) {
+ $this->storageClass = strval($xml->StorageClass);
+ }
+ if (isset($xml->ExtranetEndpoint)) {
+ $this->extranetEndpoint = strval($xml->ExtranetEndpoint);
+ }
+ if (isset($xml->IntranetEndpoint)) {
+ $this->intranetEndpoint = strval($xml->IntranetEndpoint);
+ }
+ if (isset($xml->IntranetEndpoint)) {
+ $this->intranetEndpoint = strval($xml->IntranetEndpoint);
+ }
+ if (isset($xml->Region)) {
+ $this->region = strval($xml->Region);
+ }
+ }
+
+ /**
+ * bucket region
+ *
+ * @var string
+ */
+ private $location;
+ /**
+ * bucket name
+ *
+ * @var string
+ */
+ private $name;
+
+ /**
+ * bucket creation time
+ *
+ * @var string
+ */
+ private $createDate;
+
+ /**
+ * bucket storage class
+ *
+ * @var string
+ */
+ private $storageClass;
+
+ /**
+ * bucket extranet endpoint
+ *
+ * @var string
+ */
+ private $extranetEndpoint;
+
+ /**
+ * bucket intranet endpoint
+ *
+ * @var string
+ */
+ private $intranetEndpoint;
+
+ /**
+ * bucket region
+ *
+ * @var string
+ */
+ private $region;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketListInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketListInfo.php
new file mode 100644
index 000000000..ce03a0d7e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketListInfo.php
@@ -0,0 +1,39 @@
+bucketList = $bucketList;
+ }
+
+ /**
+ * Get the BucketInfo list
+ *
+ * @return BucketInfo[]
+ */
+ public function getBucketList()
+ {
+ return $this->bucketList;
+ }
+
+ /**
+ * BucketInfo list
+ *
+ * @var array
+ */
+ private $bucketList = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketStat.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketStat.php
new file mode 100644
index 000000000..60c7e55c8
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/BucketStat.php
@@ -0,0 +1,331 @@
+storage;
+ }
+
+ /**
+ * Get object count
+ *
+ * @return int
+ */
+ public function getObjectCount()
+ {
+ return $this->objectCount;
+ }
+
+ /**
+ * Get multipart upload count.
+ *
+ * @return int
+ */
+ public function getMultipartUploadCount()
+ {
+ return $this->multipartUploadCount;
+ }
+
+ /**
+ * Get live channel count
+ *
+ * @return int
+ */
+ public function getLiveChannelCount()
+ {
+ return $this->liveChannelCount;
+ }
+
+ /**
+ * Get last modified time
+ *
+ * @return int
+ */
+ public function getLastModifiedTime()
+ {
+ return $this->lastModifiedTime;
+ }
+
+ /**
+ * Get standard storage
+ *
+ * @return int
+ */
+ public function getStandardStorage()
+ {
+ return $this->standardStorage;
+ }
+
+ /**
+ * Get standard object count
+ *
+ * @return int
+ */
+ public function getStandardObjectCount()
+ {
+ return $this->standardObjectCount;
+ }
+
+ /**
+ * Get infrequent access storage
+ *
+ * @return int
+ */
+ public function getInfrequentAccessStorage()
+ {
+ return $this->infrequentAccessStorage;
+ }
+
+ /**
+ * Get infrequent access real storage
+ *
+ * @return int
+ */
+ public function getInfrequentAccessRealStorage()
+ {
+ return $this->infrequentAccessRealStorage;
+ }
+
+ /**
+ * Get infrequent access object count
+ *
+ * @return int
+ */
+ public function getInfrequentAccessObjectCount()
+ {
+ return $this->infrequentAccessObjectCount;
+ }
+
+ /**
+ * Get archive storage
+ *
+ * @return int
+ */
+ public function getArchiveStorage()
+ {
+ return $this->archiveStorage;
+ }
+
+ /**
+ * Get archive real storage
+ *
+ * @return int
+ */
+ public function getArchiveRealStorage()
+ {
+ return $this->archiveRealStorage;
+ }
+ /**
+ * Get archive object count
+ *
+ * @return int
+ */
+ public function getArchiveObjectCount()
+ {
+ return $this->archiveObjectCount;
+ }
+
+ /**
+ * Get cold archive storage
+ *
+ * @return int
+ */
+ public function getColdArchiveStorage()
+ {
+ return $this->coldArchiveStorage;
+ }
+
+ /**
+ * Get cold archive real storage
+ *
+ * @return int
+ */
+ public function getColdArchiveRealStorage()
+ {
+ return $this->coldArchiveRealStorage;
+ }
+
+ /**
+ * Get cold archive object count
+ *
+ * @return int
+ */
+ public function getColdArchiveObjectCount()
+ {
+ return $this->coldArchiveObjectCount;
+ }
+
+ /**
+ * Parse stat from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (isset($xml->Storage) ) {
+ $this->storage = intval($xml->Storage);
+ }
+ if (isset($xml->ObjectCount) ) {
+ $this->objectCount = intval($xml->ObjectCount);
+ }
+ if (isset($xml->MultipartUploadCount) ) {
+ $this->multipartUploadCount = intval($xml->MultipartUploadCount);
+ }
+ if (isset($xml->LiveChannelCount) ) {
+ $this->liveChannelCount = intval($xml->LiveChannelCount);
+ }
+ if (isset($xml->LastModifiedTime) ) {
+ $this->lastModifiedTime = intval($xml->LastModifiedTime);
+ }
+ if (isset($xml->StandardStorage) ) {
+ $this->standardStorage = intval($xml->StandardStorage);
+ }
+ if (isset($xml->StandardObjectCount) ) {
+ $this->standardObjectCount = intval($xml->StandardObjectCount);
+ }
+ if (isset($xml->InfrequentAccessStorage) ) {
+ $this->infrequentAccessStorage = intval($xml->InfrequentAccessStorage);
+ }
+ if (isset($xml->InfrequentAccessRealStorage) ) {
+ $this->infrequentAccessRealStorage = intval($xml->InfrequentAccessRealStorage);
+ }
+ if (isset($xml->InfrequentAccessObjectCount) ) {
+ $this->infrequentAccessObjectCount = intval($xml->InfrequentAccessObjectCount);
+ }
+ if (isset($xml->ArchiveStorage) ) {
+ $this->archiveStorage = intval($xml->ArchiveStorage);
+ }
+ if (isset($xml->ArchiveRealStorage) ) {
+ $this->archiveRealStorage = intval($xml->ArchiveRealStorage);
+ }
+ if (isset($xml->ArchiveObjectCount) ) {
+ $this->archiveObjectCount = intval($xml->ArchiveObjectCount);
+ }
+ if (isset($xml->ColdArchiveStorage) ) {
+ $this->coldArchiveStorage = intval($xml->ColdArchiveStorage);
+ }
+ if (isset($xml->ColdArchiveRealStorage) ) {
+ $this->coldArchiveRealStorage = intval($xml->ColdArchiveRealStorage);
+ }
+ if (isset($xml->ColdArchiveObjectCount) ) {
+ $this->coldArchiveObjectCount = intval($xml->ColdArchiveObjectCount);
+ }
+ }
+
+ /**
+ * current storage
+ *
+ * @var int
+ */
+ private $storage;
+ /**
+ * object count
+ *
+ * @var int
+ */
+ private $objectCount;
+
+ /**
+ * multipart upload count
+ *
+ * @var int
+ */
+ private $multipartUploadCount;
+
+ /**
+ * live channel count
+ * @var int
+ */
+ private $liveChannelCount;
+
+ /**
+ * last modified time
+ * @var int
+ */
+ private $lastModifiedTime;
+
+ /**
+ * standard storage
+ * @var int
+ */
+ private $standardStorage;
+
+ /**
+ * standard object count
+ * @var int
+ */
+ private $standardObjectCount;
+
+ /**
+ * infrequent access storage
+ * @var int
+ */
+ private $infrequentAccessStorage;
+
+ /**
+ * infrequent access real storage
+ * @var int
+ */
+ private $infrequentAccessRealStorage;
+
+ /**
+ * infrequent access object Count
+ * @var int
+ */
+ private $infrequentAccessObjectCount;
+
+ /**
+ * archive storage
+ * @var int
+ */
+ private $archiveStorage;
+
+ /**
+ * archive real storage
+ * @var int
+ */
+ private $archiveRealStorage;
+
+ /**
+ * archive object count
+ * @var int
+ */
+ private $archiveObjectCount;
+
+ /**
+ * cold archive storage
+ * @var int
+ */
+ private $coldArchiveStorage;
+
+ /**
+ * cold archive real storage
+ * @var int
+ */
+ private $coldArchiveRealStorage;
+
+ /**
+ * cold archive object count
+ * @var int
+ */
+ private $coldArchiveObjectCount;
+
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CnameConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CnameConfig.php
new file mode 100644
index 000000000..f3597d2f0
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CnameConfig.php
@@ -0,0 +1,99 @@
+cnameList = array();
+ }
+
+ /**
+ * @return array
+ * @example
+ * array(2) {
+ * [0]=>
+ * array(3) {
+ * ["Domain"]=>
+ * string(11) "www.foo.com"
+ * ["Status"]=>
+ * string(7) "enabled"
+ * ["LastModified"]=>
+ * string(8) "20150101"
+ * }
+ * [1]=>
+ * array(3) {
+ * ["Domain"]=>
+ * string(7) "bar.com"
+ * ["Status"]=>
+ * string(8) "disabled"
+ * ["LastModified"]=>
+ * string(8) "20160101"
+ * }
+ * }
+ */
+ public function getCnames()
+ {
+ return $this->cnameList;
+ }
+
+
+ public function addCname($cname)
+ {
+ if (count($this->cnameList) >= self::OSS_MAX_RULES) {
+ throw new OssException(
+ "num of cname in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES));
+ }
+ $this->cnameList[] = array('Domain' => $cname);
+ }
+
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (!isset($xml->Cname)) return;
+ foreach ($xml->Cname as $entry) {
+ $cname = array();
+ foreach ($entry as $key => $value) {
+ $cname[strval($key)] = strval($value);
+ }
+ $this->cnameList[] = $cname;
+ }
+ }
+
+ public function serializeToXml()
+ {
+ $strXml = <<
+
+
+EOF;
+ $xml = new \SimpleXMLElement($strXml);
+ foreach ($this->cnameList as $cname) {
+ $node = $xml->addChild('Cname');
+ foreach ($cname as $key => $value) {
+ $node->addChild($key, $value);
+ }
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ const OSS_MAX_RULES = 10;
+
+ private $cnameList = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CnameTokenInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CnameTokenInfo.php
new file mode 100644
index 000000000..295cfbdd4
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CnameTokenInfo.php
@@ -0,0 +1,105 @@
+bucket;
+ }
+
+ /**
+ * Get cname
+ *
+ * @return string
+ */
+ public function getCname()
+ {
+ return $this->cname;
+ }
+
+ /**
+ * Get token.
+ *
+ * @return string
+ */
+ public function getToken()
+ {
+ return $this->token;
+ }
+
+ /**
+ * Get expireTime.
+ *
+ * @return string
+ */
+ public function getExpireTime()
+ {
+ return $this->expireTime;
+ }
+
+ /**
+ * Parse cname token from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (isset($xml->Bucket) ) {
+ $this->bucket = strval($xml->Bucket);
+ }
+ if (isset($xml->Cname) ) {
+ $this->cname = strval($xml->Cname);
+ }
+ if (isset($xml->Token) ) {
+ $this->token = strval($xml->Token);
+ }
+ if (isset($xml->ExpireTime) ) {
+ $this->expireTime = strval($xml->ExpireTime);
+ }
+ }
+
+ /**
+ * bucket name
+ *
+ * @var string
+ */
+ private $bucket;
+ /**
+ * cname
+ *
+ * @var string
+ */
+ private $cname;
+
+ /**
+ * token
+ *
+ * @var string
+ */
+ private $token;
+
+ /**
+ * expire time
+ *
+ * @var string
+ */
+ private $expireTime;
+
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php
new file mode 100644
index 000000000..e0f18923f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php
@@ -0,0 +1,140 @@
+rules = array();
+ }
+
+ /**
+ * Get CorsRule list
+ *
+ * @return CorsRule[]
+ */
+ public function getRules()
+ {
+ return $this->rules;
+ }
+
+
+ /**
+ * Add a new CorsRule
+ *
+ * @param CorsRule $rule
+ * @throws OssException
+ */
+ public function addRule($rule)
+ {
+ if (count($this->rules) >= self::OSS_MAX_RULES) {
+ throw new OssException("num of rules in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES));
+ }
+ $this->rules[] = $rule;
+ }
+ /**
+ * @param boolean $value
+ */
+ public function setResponseVary($value)
+ {
+ $this->responseVary = $value;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function getResponseVary(){
+ if (isset($this->responseVary)) {
+ return $this->responseVary;
+ }
+ return false;
+ }
+
+ /**
+ * Parse CorsConfig from the xml.
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if(isset($xml->ResponseVary)){
+ $this->responseVary =
+ (strval($xml->ResponseVary) === 'TRUE' || strval($xml->ResponseVary) === 'true') ? true : false;
+ }
+ if (!isset($xml->CORSRule)) return;
+ foreach ($xml->CORSRule as $rule) {
+ $corsRule = new CorsRule();
+ foreach ($rule as $key => $value) {
+ if ($key === self::OSS_CORS_ALLOWED_HEADER) {
+ $corsRule->addAllowedHeader(strval($value));
+ } elseif ($key === self::OSS_CORS_ALLOWED_METHOD) {
+ $corsRule->addAllowedMethod(strval($value));
+ } elseif ($key === self::OSS_CORS_ALLOWED_ORIGIN) {
+ $corsRule->addAllowedOrigin(strval($value));
+ } elseif ($key === self::OSS_CORS_EXPOSE_HEADER) {
+ $corsRule->addExposeHeader(strval($value));
+ } elseif ($key === self::OSS_CORS_MAX_AGE_SECONDS) {
+ $corsRule->setMaxAgeSeconds(strval($value));
+ }
+ }
+ $this->addRule($corsRule);
+ }
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ foreach ($this->rules as $rule) {
+ $xmlRule = $xml->addChild('CORSRule');
+ $rule->appendToXml($xmlRule);
+ }
+ if(isset($this->responseVary)){
+ if ($this->responseVary) {
+ $xml->addChild('ResponseVary', 'true');
+ } else {
+ $xml->addChild('ResponseVary', 'false');
+ }
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ const OSS_CORS_ALLOWED_ORIGIN = 'AllowedOrigin';
+ const OSS_CORS_ALLOWED_METHOD = 'AllowedMethod';
+ const OSS_CORS_ALLOWED_HEADER = 'AllowedHeader';
+ const OSS_CORS_EXPOSE_HEADER = 'ExposeHeader';
+ const OSS_CORS_MAX_AGE_SECONDS = 'MaxAgeSeconds';
+ const OSS_MAX_RULES = 10;
+
+ /**
+ * CorsRule list
+ *
+ * @var CorsRule[]
+ */
+ private $rules = array();
+ private $responseVary;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsRule.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsRule.php
new file mode 100644
index 000000000..08353a0c0
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/CorsRule.php
@@ -0,0 +1,150 @@
+allowedOrigins[] = $allowedOrigin;
+ }
+ }
+
+ /**
+ * Add an allowedMethod rule
+ *
+ * @param string $allowedMethod
+ */
+ public function addAllowedMethod($allowedMethod)
+ {
+ if (!empty($allowedMethod)) {
+ $this->allowedMethods[] = $allowedMethod;
+ }
+ }
+
+ /**
+ * Add an allowedHeader rule
+ *
+ * @param string $allowedHeader
+ */
+ public function addAllowedHeader($allowedHeader)
+ {
+ if (!empty($allowedHeader)) {
+ $this->allowedHeaders[] = $allowedHeader;
+ }
+ }
+
+ /**
+ * Add an exposeHeader rule
+ *
+ * @param string $exposeHeader
+ */
+ public function addExposeHeader($exposeHeader)
+ {
+ if (!empty($exposeHeader)) {
+ $this->exposeHeaders[] = $exposeHeader;
+ }
+ }
+
+ /**
+ * @return int
+ */
+ public function getMaxAgeSeconds()
+ {
+ return $this->maxAgeSeconds;
+ }
+
+ /**
+ * @param int $maxAgeSeconds
+ */
+ public function setMaxAgeSeconds($maxAgeSeconds)
+ {
+ $this->maxAgeSeconds = $maxAgeSeconds;
+ }
+
+ /**
+ * Get the AllowedHeaders list
+ *
+ * @return string[]
+ */
+ public function getAllowedHeaders()
+ {
+ return $this->allowedHeaders;
+ }
+
+ /**
+ * Get the AllowedOrigins list
+ *
+ * @return string[]
+ */
+ public function getAllowedOrigins()
+ {
+ return $this->allowedOrigins;
+ }
+
+ /**
+ * Get the AllowedMethods list
+ *
+ * @return string[]
+ */
+ public function getAllowedMethods()
+ {
+ return $this->allowedMethods;
+ }
+
+ /**
+ * Get the ExposeHeaders list
+ *
+ * @return string[]
+ */
+ public function getExposeHeaders()
+ {
+ return $this->exposeHeaders;
+ }
+
+ /**
+ * Serialize all the rules into the xml represented by parameter $xmlRule
+ *
+ * @param \SimpleXMLElement $xmlRule
+ * @throws OssException
+ */
+ public function appendToXml(&$xmlRule)
+ {
+ if (!isset($this->maxAgeSeconds)) {
+ throw new OssException("maxAgeSeconds is not set in the Rule");
+ }
+ foreach ($this->allowedOrigins as $allowedOrigin) {
+ $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_ORIGIN, $allowedOrigin);
+ }
+ foreach ($this->allowedMethods as $allowedMethod) {
+ $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_METHOD, $allowedMethod);
+ }
+ foreach ($this->allowedHeaders as $allowedHeader) {
+ $xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_HEADER, $allowedHeader);
+ }
+ foreach ($this->exposeHeaders as $exposeHeader) {
+ $xmlRule->addChild(CorsConfig::OSS_CORS_EXPOSE_HEADER, $exposeHeader);
+ }
+ $xmlRule->addChild(CorsConfig::OSS_CORS_MAX_AGE_SECONDS, strval($this->maxAgeSeconds));
+ }
+
+ private $allowedHeaders = array();
+ private $allowedOrigins = array();
+ private $allowedMethods = array();
+ private $exposeHeaders = array();
+ private $maxAgeSeconds = null;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeleteMarkerInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeleteMarkerInfo.php
new file mode 100644
index 000000000..c129e99f5
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeleteMarkerInfo.php
@@ -0,0 +1,65 @@
+key = $key;
+ $this->versionId = $versionId;
+ $this->lastModified = $lastModified;
+ $this->isLatest = $isLatest;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getVersionId()
+ {
+ return $this->versionId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getLastModified()
+ {
+ return $this->lastModified;
+ }
+
+ /**
+ * @return string
+ */
+ public function getIsLatest()
+ {
+ return $this->isLatest;
+ }
+
+ private $key = "";
+ private $versionId = "";
+ private $lastModified = "";
+ private $isLatest = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeleteObjectInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeleteObjectInfo.php
new file mode 100644
index 000000000..806eafbec
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeleteObjectInfo.php
@@ -0,0 +1,41 @@
+key = $key;
+ $this->versionId = $versionId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getVersionId()
+ {
+ return $this->versionId;
+ }
+
+ private $key = "";
+ private $versionId = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeletedObjectInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeletedObjectInfo.php
new file mode 100644
index 000000000..6bba39a46
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/DeletedObjectInfo.php
@@ -0,0 +1,63 @@
+key = $key;
+ $this->versionId = $versionId;
+ $this->deleteMarker = $deleteMarker;
+ $this->deleteMarkerVersionId = $deleteMarkerVersionId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getVersionId()
+ {
+ return $this->versionId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDeleteMarker()
+ {
+ return $this->deleteMarker;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDeleteMarkerVersionId()
+ {
+ return $this->deleteMarkerVersionId;
+ }
+
+ private $key = "";
+ private $versionId = "";
+ private $deleteMarker = "";
+ private $deleteMarkerVersionId = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ExtendWormConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ExtendWormConfig.php
new file mode 100644
index 000000000..5e62287f4
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ExtendWormConfig.php
@@ -0,0 +1,64 @@
+day = $day;
+ }
+
+ /**
+ * Parse ExtendWormConfig from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ throw new OssException("Not implemented.");
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ if (isset($this->day)) {
+ $xml->addChild('RetentionPeriodInDays', $this->day);
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return int
+ */
+ public function getDay()
+ {
+ return $this->day;
+ }
+
+ private $day = 0;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelHistory.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelHistory.php
new file mode 100644
index 000000000..e6d518a9c
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelHistory.php
@@ -0,0 +1,37 @@
+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();
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelInfo.php
new file mode 100644
index 000000000..0b5edfc4d
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelInfo.php
@@ -0,0 +1,68 @@
+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;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelStatus.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelStatus.php
new file mode 100644
index 000000000..2ee7a68b2
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelStatus.php
@@ -0,0 +1,107 @@
+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;
+
+
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/InitiateWormConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/InitiateWormConfig.php
new file mode 100644
index 000000000..572ceed02
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/InitiateWormConfig.php
@@ -0,0 +1,64 @@
+day = $day;
+ }
+
+ /**
+ * Parse InitiateWormConfig from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ throw new OssException("Not implemented.");
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ if (isset($this->day)) {
+ $xml->addChild('RetentionPeriodInDays', $this->day);
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return int
+ */
+ public function getDay()
+ {
+ return $this->day;
+ }
+
+ private $day = 0;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleAction.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleAction.php
new file mode 100644
index 000000000..a0e212692
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleAction.php
@@ -0,0 +1,88 @@
+action = $action;
+ $this->timeSpec = $timeSpec;
+ $this->timeValue = $timeValue;
+ }
+
+ /**
+ * @return LifecycleAction
+ */
+ public function getAction()
+ {
+ return $this->action;
+ }
+
+ /**
+ * @param string $action
+ */
+ public function setAction($action)
+ {
+ $this->action = $action;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTimeSpec()
+ {
+ return $this->timeSpec;
+ }
+
+ /**
+ * @param string $timeSpec
+ */
+ public function setTimeSpec($timeSpec)
+ {
+ $this->timeSpec = $timeSpec;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTimeValue()
+ {
+ return $this->timeValue;
+ }
+
+ /**
+ * @param string $timeValue
+ */
+ public function setTimeValue($timeValue)
+ {
+ $this->timeValue = $timeValue;
+ }
+
+ /**
+ * Use appendToXml to insert actions into xml.
+ *
+ * @param \SimpleXMLElement $xmlRule
+ */
+ public function appendToXml(&$xmlRule)
+ {
+ $xmlAction = $xmlRule->addChild($this->action);
+ $xmlAction->addChild($this->timeSpec, $this->timeValue);
+ }
+
+ private $action;
+ private $timeSpec;
+ private $timeValue;
+
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleConfig.php
new file mode 100644
index 000000000..f2d2dc33c
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleConfig.php
@@ -0,0 +1,107 @@
+rules = array();
+ $xml = simplexml_load_string($strXml);
+ if (!isset($xml->Rule)) return;
+ $this->rules = array();
+ foreach ($xml->Rule as $rule) {
+ $id = strval($rule->ID);
+ $prefix = strval($rule->Prefix);
+ $status = strval($rule->Status);
+ $actions = array();
+ foreach ($rule as $key => $value) {
+ if ($key === 'ID' || $key === 'Prefix' || $key === 'Status') continue;
+ $action = $key;
+ $timeSpec = null;
+ $timeValue = null;
+ foreach ($value as $timeSpecKey => $timeValueValue) {
+ $timeSpec = $timeSpecKey;
+ $timeValue = strval($timeValueValue);
+ }
+ $actions[] = new LifecycleAction($action, $timeSpec, $timeValue);
+ }
+ $this->rules[] = new LifecycleRule($id, $prefix, $status, $actions);
+ }
+ return;
+ }
+
+
+ /**
+ * Serialize the object to xml
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+
+ $xml = new \SimpleXMLElement('');
+ foreach ($this->rules as $rule) {
+ $xmlRule = $xml->addChild('Rule');
+ $rule->appendToXml($xmlRule);
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ *
+ * Add a LifecycleRule
+ *
+ * @param LifecycleRule $lifecycleRule
+ * @throws OssException
+ */
+ public function addRule($lifecycleRule)
+ {
+ if (!isset($lifecycleRule)) {
+ throw new OssException("lifecycleRule is null");
+ }
+ $this->rules[] = $lifecycleRule;
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * Get all lifecycle rules.
+ *
+ * @return LifecycleRule[]
+ */
+ public function getRules()
+ {
+ return $this->rules;
+ }
+
+ /**
+ * @var LifecycleRule[]
+ */
+ private $rules;
+}
+
+
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleRule.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleRule.php
new file mode 100644
index 000000000..73c6cc353
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleRule.php
@@ -0,0 +1,126 @@
+id;
+ }
+
+ /**
+ * @param string $id Rule Id
+ */
+ public function setId($id)
+ {
+ $this->id = $id;
+ }
+
+ /**
+ * Get a file prefix
+ *
+ * @return string
+ */
+ public function getPrefix()
+ {
+ return $this->prefix;
+ }
+
+ /**
+ * Set a file prefix
+ *
+ * @param string $prefix The file prefix
+ */
+ public function setPrefix($prefix)
+ {
+ $this->prefix = $prefix;
+ }
+
+ /**
+ * Get Lifecycle status
+ *
+ * @return string
+ */
+ public function getStatus()
+ {
+ return $this->status;
+ }
+
+ /**
+ * Set Lifecycle status
+ *
+ * @param string $status
+ */
+ public function setStatus($status)
+ {
+ $this->status = $status;
+ }
+
+ /**
+ *
+ * @return LifecycleAction[]
+ */
+ public function getActions()
+ {
+ return $this->actions;
+ }
+
+ /**
+ * @param LifecycleAction[] $actions
+ */
+ public function setActions($actions)
+ {
+ $this->actions = $actions;
+ }
+
+
+ /**
+ * LifecycleRule constructor.
+ *
+ * @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)
+ {
+ $this->id = $id;
+ $this->prefix = $prefix;
+ $this->status = $status;
+ $this->actions = $actions;
+ }
+
+ /**
+ * @param \SimpleXMLElement $xmlRule
+ */
+ public function appendToXml(&$xmlRule)
+ {
+ $xmlRule->addChild('ID', $this->id);
+ $xmlRule->addChild('Prefix', $this->prefix);
+ $xmlRule->addChild('Status', $this->status);
+ foreach ($this->actions as $action) {
+ $action->appendToXml($xmlRule);
+ }
+ }
+
+ private $id;
+ private $prefix;
+ private $status;
+ private $actions = array();
+
+ const LIFECYCLE_STATUS_ENABLED = 'Enabled';
+ const LIFECYCLE_STATUS_DISABLED = 'Disabled';
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ListMultipartUploadInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ListMultipartUploadInfo.php
new file mode 100644
index 000000000..105d005b2
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ListMultipartUploadInfo.php
@@ -0,0 +1,134 @@
+bucket = $bucket;
+ $this->keyMarker = $keyMarker;
+ $this->uploadIdMarker = $uploadIdMarker;
+ $this->nextKeyMarker = $nextKeyMarker;
+ $this->nextUploadIdMarker = $nextUploadIdMarker;
+ $this->delimiter = $delimiter;
+ $this->prefix = $prefix;
+ $this->maxUploads = $maxUploads;
+ $this->isTruncated = $isTruncated;
+ $this->uploads = $uploads;
+ }
+
+ /**
+ * 得到bucket名称
+ *
+ * @return string
+ */
+ public function getBucket()
+ {
+ return $this->bucket;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKeyMarker()
+ {
+ return $this->keyMarker;
+ }
+
+ /**
+ *
+ * @return string
+ */
+ public function getUploadIdMarker()
+ {
+ return $this->uploadIdMarker;
+ }
+
+ /**
+ * @return string
+ */
+ public function getNextKeyMarker()
+ {
+ return $this->nextKeyMarker;
+ }
+
+ /**
+ * @return string
+ */
+ public function getNextUploadIdMarker()
+ {
+ return $this->nextUploadIdMarker;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDelimiter()
+ {
+ return $this->delimiter;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPrefix()
+ {
+ return $this->prefix;
+ }
+
+ /**
+ * @return int
+ */
+ public function getMaxUploads()
+ {
+ return $this->maxUploads;
+ }
+
+ /**
+ * @return string
+ */
+ public function getIsTruncated()
+ {
+ return $this->isTruncated;
+ }
+
+ /**
+ * @return UploadInfo[]
+ */
+ public function getUploads()
+ {
+ return $this->uploads;
+ }
+
+ private $bucket = "";
+ private $keyMarker = "";
+ private $uploadIdMarker = "";
+ private $nextKeyMarker = "";
+ private $nextUploadIdMarker = "";
+ private $delimiter = "";
+ private $prefix = "";
+ private $maxUploads = 0;
+ private $isTruncated = "false";
+ private $uploads = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ListPartsInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ListPartsInfo.php
new file mode 100644
index 000000000..f1d10ee9e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ListPartsInfo.php
@@ -0,0 +1,97 @@
+bucket = $bucket;
+ $this->key = $key;
+ $this->uploadId = $uploadId;
+ $this->nextPartNumberMarker = $nextPartNumberMarker;
+ $this->maxParts = $maxParts;
+ $this->isTruncated = $isTruncated;
+ $this->listPart = $listPart;
+ }
+
+ /**
+ * @return string
+ */
+ public function getBucket()
+ {
+ return $this->bucket;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getUploadId()
+ {
+ return $this->uploadId;
+ }
+
+ /**
+ * @return int
+ */
+ public function getNextPartNumberMarker()
+ {
+ return $this->nextPartNumberMarker;
+ }
+
+ /**
+ * @return int
+ */
+ public function getMaxParts()
+ {
+ return $this->maxParts;
+ }
+
+ /**
+ * @return string
+ */
+ public function getIsTruncated()
+ {
+ return $this->isTruncated;
+ }
+
+ /**
+ * @return array
+ */
+ public function getListPart()
+ {
+ return $this->listPart;
+ }
+
+ private $bucket = "";
+ private $key = "";
+ private $uploadId = "";
+ private $nextPartNumberMarker = 0;
+ private $maxParts = 0;
+ private $isTruncated = "";
+ private $listPart = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelConfig.php
new file mode 100644
index 000000000..dadedc911
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelConfig.php
@@ -0,0 +1,121 @@
+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 = 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";
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelHistory.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelHistory.php
new file mode 100644
index 000000000..1c1fd4dbc
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelHistory.php
@@ -0,0 +1,59 @@
+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;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelInfo.php
new file mode 100644
index 000000000..c63ec54d6
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelInfo.php
@@ -0,0 +1,107 @@
+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;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelListInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelListInfo.php
new file mode 100644
index 000000000..f4ee02f64
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelListInfo.php
@@ -0,0 +1,107 @@
+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();
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LoggingConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LoggingConfig.php
new file mode 100644
index 000000000..ed9fb1dbb
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/LoggingConfig.php
@@ -0,0 +1,86 @@
+targetBucket = $targetBucket;
+ $this->targetPrefix = $targetPrefix;
+ }
+
+ /**
+ * @param $strXml
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (!isset($xml->LoggingEnabled)) return;
+ foreach ($xml->LoggingEnabled as $status) {
+ foreach ($status as $key => $value) {
+ if ($key === 'TargetBucket') {
+ $this->targetBucket = strval($value);
+ } elseif ($key === 'TargetPrefix') {
+ $this->targetPrefix = strval($value);
+ }
+ }
+ break;
+ }
+ }
+
+ /**
+ * Serialize to xml string
+ *
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ if (isset($this->targetBucket) && isset($this->targetPrefix)) {
+ $loggingEnabled = $xml->addChild('LoggingEnabled');
+ $loggingEnabled->addChild('TargetBucket', $this->targetBucket);
+ $loggingEnabled->addChild('TargetPrefix', $this->targetPrefix);
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return string
+ */
+ public function getTargetBucket()
+ {
+ return $this->targetBucket;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTargetPrefix()
+ {
+ return $this->targetPrefix;
+ }
+
+ private $targetBucket = "";
+ private $targetPrefix = "";
+
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php
new file mode 100644
index 000000000..9e538bf2a
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php
@@ -0,0 +1,129 @@
+key = $key;
+ $this->lastModified = $lastModified;
+ $this->eTag = $eTag;
+ $this->type = $type;
+ $this->size = $size;
+ $this->storageClass = $storageClass;
+ $this->owner = $owner;
+ $this->restoreInfo = $restoreInfo;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getLastModified()
+ {
+ return $this->lastModified;
+ }
+
+ /**
+ * @return string
+ */
+ public function getETag()
+ {
+ return $this->eTag;
+ }
+
+ /**
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * php7 && 64bit can use it
+ * @return int
+ */
+ public function getSize()
+ {
+ return (int)$this->size;
+ }
+
+
+ /**
+ * php5.x or 32bit must use it
+ * @return string
+ */
+ public function getSizeStr()
+ {
+ return $this->size;
+ }
+
+ /**
+ * @return string
+ */
+ public function getStorageClass()
+ {
+ return $this->storageClass;
+ }
+
+ /**
+ * @return string
+ */
+ public function getRestoreInfo()
+ {
+ return $this->restoreInfo;
+ }
+
+
+ /**
+ * @return Owner|null
+ */
+ public function getOwner()
+ {
+ return $this->owner;
+ }
+
+ private $key = "";
+ private $lastModified = "";
+ private $eTag = "";
+ private $type = "";
+ private $size = "0";
+ private $storageClass = "";
+ /**
+ * @var Owner
+ */
+ private $owner;
+ private $restoreInfo;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfo.php
new file mode 100644
index 000000000..81c5d27b9
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfo.php
@@ -0,0 +1,126 @@
+bucketName = $bucketName;
+ $this->prefix = $prefix;
+ $this->marker = $marker;
+ $this->nextMarker = $nextMarker;
+ $this->maxKeys = $maxKeys;
+ $this->delimiter = $delimiter;
+ $this->isTruncated = $isTruncated;
+ $this->objectList = $objectList;
+ $this->prefixList = $prefixList;
+ }
+
+ /**
+ * @return string
+ */
+ public function getBucketName()
+ {
+ return $this->bucketName;
+ }
+
+ /**
+ * @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 string
+ */
+ public function getDelimiter()
+ {
+ return $this->delimiter;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getIsTruncated()
+ {
+ return $this->isTruncated;
+ }
+
+ /**
+ * Get the ObjectInfo list.
+ *
+ * @return ObjectInfo[]
+ */
+ public function getObjectList()
+ {
+ return $this->objectList;
+ }
+
+ /**
+ * Get the PrefixInfo list
+ *
+ * @return PrefixInfo[]
+ */
+ public function getPrefixList()
+ {
+ return $this->prefixList;
+ }
+
+ /**
+ * @return string
+ */
+ public function getNextMarker()
+ {
+ return $this->nextMarker;
+ }
+
+ private $bucketName = "";
+ private $prefix = "";
+ private $marker = "";
+ private $nextMarker = "";
+ private $maxKeys = 0;
+ private $delimiter = "";
+ private $isTruncated = null;
+ private $objectList = array();
+ private $prefixList = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfoV2.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfoV2.php
new file mode 100644
index 000000000..c1fef22c4
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfoV2.php
@@ -0,0 +1,147 @@
+bucketName = $bucketName;
+ $this->prefix = $prefix;
+ $this->maxKeys = $maxKeys;
+ $this->delimiter = $delimiter;
+ $this->isTruncated = $isTruncated;
+ $this->objectList = $objectList;
+ $this->prefixList = $prefixList;
+ $this->continuationToken = $continuationToken;
+ $this->nextContinuationToken = $nextContinuationToken;
+ $this->startAfter = $startAfter;
+ $this->keyCount = $keyCount;
+ }
+
+ /**
+ * @return string
+ */
+ public function getBucketName()
+ {
+ return $this->bucketName;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPrefix()
+ {
+ return $this->prefix;
+ }
+
+ /**
+ * @return int
+ */
+ public function getMaxKeys()
+ {
+ return $this->maxKeys;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDelimiter()
+ {
+ return $this->delimiter;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getIsTruncated()
+ {
+ return $this->isTruncated;
+ }
+
+ /**
+ * Get the ObjectInfo list.
+ *
+ * @return ObjectInfo[]
+ */
+ public function getObjectList()
+ {
+ return $this->objectList;
+ }
+
+ /**
+ * Get the PrefixInfo list
+ *
+ * @return PrefixInfo[]
+ */
+ public function getPrefixList()
+ {
+ return $this->prefixList;
+ }
+
+ /**
+ * @return string
+ */
+ public function getContinuationToken()
+ {
+ return $this->continuationToken;
+ }
+
+ /**
+ * @return string
+ */
+ public function getNextContinuationToken()
+ {
+ return $this->nextContinuationToken;
+ }
+
+ /**
+ * @return string
+ */
+ public function getStartAfter()
+ {
+ return $this->startAfter;
+ }
+
+ /**
+ * @return int
+ */
+ public function getKeyCount()
+ {
+ return $this->keyCount;
+ }
+
+ private $bucketName = "";
+ private $prefix = "";
+ private $maxKeys = 0;
+ private $delimiter = "";
+ private $isTruncated = null;
+ private $objectList = array();
+ private $prefixList = array();
+ private $nextContinuationToken = "";
+ private $continuationToken = "";
+ private $startAfter = "";
+ private $keyCount = 0;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionInfo.php
new file mode 100644
index 000000000..663bd0b39
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionInfo.php
@@ -0,0 +1,125 @@
+key = $key;
+ $this->versionId = $versionId;
+ $this->lastModified = $lastModified;
+ $this->eTag = $eTag;
+ $this->type = $type;
+ $this->size = $size;
+ $this->storageClass = $storageClass;
+ $this->isLatest = $isLatest;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getVersionId()
+ {
+ return $this->versionId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getLastModified()
+ {
+ return $this->lastModified;
+ }
+
+ /**
+ * @return string
+ */
+ public function getETag()
+ {
+ return $this->eTag;
+ }
+
+ /**
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * php7 && 64bit can use it
+ * @return int
+ */
+ public function getSize()
+ {
+ return (int)$this->size;
+ }
+
+
+ /**
+ * php5.x or 32bit must use it
+ * @return string
+ */
+ public function getSizeStr()
+ {
+ return $this->size;
+ }
+
+ /**
+ * @return string
+ */
+ public function getStorageClass()
+ {
+ return $this->storageClass;
+ }
+
+ /**
+ * @return string
+ */
+ public function getIsLatest()
+ {
+ return $this->isLatest;
+ }
+
+ private $key = "";
+ private $versionId = "";
+ private $lastModified = "";
+ private $eTag = "";
+ private $type = "";
+ private $size = "0";
+ private $storageClass = "";
+ private $isLatest = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionListInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionListInfo.php
new file mode 100644
index 000000000..f976b7e60
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectVersionListInfo.php
@@ -0,0 +1,162 @@
+bucketName = $bucketName;
+ $this->prefix = $prefix;
+ $this->keyMarker = $keyMarker;
+ $this->nextKeyMarker = $nextKeyMarker;
+ $this->versionIdMarker = $versionIdMarker;
+ $this->nextVersionIdMarker = $nextVersionIdMarker;
+ $this->maxKeys = $maxKeys;
+ $this->delimiter = $delimiter;
+ $this->isTruncated = $isTruncated;
+ $this->objectVersionList = $objectversionList;
+ $this->deleteMarkerList = $deleteMarkerList;
+ $this->prefixList = $prefixList;
+ }
+
+ /**
+ * @return string
+ */
+ public function getBucketName()
+ {
+ return $this->bucketName;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPrefix()
+ {
+ return $this->prefix;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKeyMarker()
+ {
+ return $this->keyMarker;
+ }
+
+ /**
+ * @return string
+ */
+ public function getNextKeyMarker()
+ {
+ return $this->nextKeyMarker;
+ }
+
+ /**
+ * @return string
+ */
+ public function getVersionIdMarker()
+ {
+ return $this->versionIdMarker;
+ }
+
+ /**
+ * @return string
+ */
+ public function getNextVersionIdMarker()
+ {
+ return $this->nextVersionIdMarker;
+ }
+
+ /**
+ * @return int
+ */
+ public function getMaxKeys()
+ {
+ return $this->maxKeys;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDelimiter()
+ {
+ return $this->delimiter;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getIsTruncated()
+ {
+ return $this->isTruncated;
+ }
+
+ /**
+ * Get the ObjectVersionInfo list.
+ *
+ * @return ObjectVersionInfo[]
+ */
+ public function getObjectVersionList()
+ {
+ return $this->objectVersionList;
+ }
+
+ /**
+ * Get the DeleteMarkerInfo list.
+ *
+ * @return DeleteMarkerInfo[]
+ */
+ public function getDeleteMarkerList()
+ {
+ return $this->deleteMarkerList;
+ }
+
+ /**
+ * Get the PrefixInfo list
+ *
+ * @return PrefixInfo[]
+ */
+ public function getPrefixList()
+ {
+ return $this->prefixList;
+ }
+
+ private $bucketName = "";
+ private $prefix = "";
+ private $keyMarker = "";
+ private $nextKeyMarker = "";
+ private $versionIdMarker = "";
+ private $nextVersionIdMarker = "";
+ private $maxKeys = 0;
+ private $delimiter = "";
+ private $isTruncated = null;
+ private $objectVersionList = array();
+ private $deleteMarkerList = array();
+ private $prefixList = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/Owner.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/Owner.php
new file mode 100644
index 000000000..5de8bcfc3
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/Owner.php
@@ -0,0 +1,46 @@
+id = $id;
+ $this->displayName = $displayName;
+ }
+
+ /**
+ * @return string
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDisplayName()
+ {
+ return $this->displayName;
+ }
+
+ private $id;
+ private $displayName;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PartInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PartInfo.php
new file mode 100644
index 000000000..07df57687
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PartInfo.php
@@ -0,0 +1,74 @@
+partNumber = $partNumber;
+ $this->lastModified = $lastModified;
+ $this->eTag = $eTag;
+ $this->size = $size;
+ }
+
+ /**
+ * @return int
+ */
+ public function getPartNumber()
+ {
+ return $this->partNumber;
+ }
+
+ /**
+ * @return string
+ */
+ public function getLastModified()
+ {
+ return $this->lastModified;
+ }
+
+ /**
+ * @return string
+ */
+ public function getETag()
+ {
+ return $this->eTag;
+ }
+
+ /**
+ * php7 && 64bit can use it
+ * @return int
+ */
+ public function getSize()
+ {
+ return (int)$this->size;
+ }
+
+
+ /**
+ * php5.x or 32bit must use it
+ * @return string
+ */
+ public function getSizeStr()
+ {
+ return $this->size;
+ }
+
+ private $partNumber = 0;
+ private $lastModified = "";
+ private $eTag = "";
+ private $size = "0";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PrefixInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PrefixInfo.php
new file mode 100644
index 000000000..27920b9f6
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/PrefixInfo.php
@@ -0,0 +1,36 @@
+prefix = $prefix;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPrefix()
+ {
+ return $this->prefix;
+ }
+
+ private $prefix;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RefererConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RefererConfig.php
new file mode 100644
index 000000000..083014396
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RefererConfig.php
@@ -0,0 +1,93 @@
+AllowEmptyReferer)) return;
+ if (!isset($xml->RefererList)) return;
+ $this->allowEmptyReferer =
+ (strval($xml->AllowEmptyReferer) === 'TRUE' || strval($xml->AllowEmptyReferer) === 'true') ? true : false;
+
+ foreach ($xml->RefererList->Referer as $key => $refer) {
+ $this->refererList[] = strval($refer);
+ }
+ }
+
+
+ /**
+ * serialize the RefererConfig object into xml string
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ if ($this->allowEmptyReferer) {
+ $xml->addChild('AllowEmptyReferer', 'true');
+ } else {
+ $xml->addChild('AllowEmptyReferer', 'false');
+ }
+ $refererList = $xml->addChild('RefererList');
+ foreach ($this->refererList as $referer) {
+ $refererList->addChild('Referer', $referer);
+ }
+ return $xml->asXML();
+ }
+
+ /**
+ * @return string
+ */
+ function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @param boolean $allowEmptyReferer
+ */
+ public function setAllowEmptyReferer($allowEmptyReferer)
+ {
+ $this->allowEmptyReferer = $allowEmptyReferer;
+ }
+
+ /**
+ * @param string $referer
+ */
+ public function addReferer($referer)
+ {
+ $this->refererList[] = $referer;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function isAllowEmptyReferer()
+ {
+ return $this->allowEmptyReferer;
+ }
+
+ /**
+ * @return array
+ */
+ public function getRefererList()
+ {
+ return $this->refererList;
+ }
+
+ private $allowEmptyReferer = true;
+ private $refererList = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RequestPaymentConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RequestPaymentConfig.php
new file mode 100644
index 000000000..6b32060d3
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RequestPaymentConfig.php
@@ -0,0 +1,68 @@
+payer = $payer;
+ }
+
+ /**
+ * Parse ServerSideEncryptionConfig from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (isset($xml->Payer)) {
+ $this->payer = strval($xml->Payer);
+ }
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ if (isset($this->payer)) {
+ $xml->addChild('Payer', $this->payer);
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return string
+ */
+ public function getPayer()
+ {
+ return $this->payer;
+ }
+
+ private $payer = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RestoreConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RestoreConfig.php
new file mode 100644
index 000000000..156852a4a
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RestoreConfig.php
@@ -0,0 +1,77 @@
+day = $day;
+ $this->tier = $tier;
+ }
+
+ /**
+ * Parse RestoreConfig from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ throw new OssException("Not implemented.");
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ $xml->addChild('Days', strval($this->day));
+ if (isset($this->tier)) {
+ $xml_param = $xml->addChild('JobParameters');
+ $xml_param->addChild('Tier', $this->tier);
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return int
+ */
+ public function getDay()
+ {
+ return $this->day;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTier()
+ {
+ return $this->tier;
+ }
+
+ private $day = 1;
+ private $tier = 'Standard';
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ServerSideEncryptionConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ServerSideEncryptionConfig.php
new file mode 100644
index 000000000..e3a190b8f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/ServerSideEncryptionConfig.php
@@ -0,0 +1,91 @@
+sseAlgorithm = $sseAlgorithm;
+ $this->kmsMasterKeyID = $kmsMasterKeyID;
+ }
+
+ /**
+ * Parse ServerSideEncryptionConfig from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (!isset($xml->ApplyServerSideEncryptionByDefault)) return;
+ foreach ($xml->ApplyServerSideEncryptionByDefault as $default) {
+ foreach ($default as $key => $value) {
+ if ($key === 'SSEAlgorithm') {
+ $this->sseAlgorithm = strval($value);
+ } elseif ($key === 'KMSMasterKeyID') {
+ $this->kmsMasterKeyID = strval($value);
+ }
+ }
+ break;
+ }
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ $default = $xml->addChild('ApplyServerSideEncryptionByDefault');
+ if (isset($this->sseAlgorithm)) {
+ $default->addChild('SSEAlgorithm', $this->sseAlgorithm);
+ }
+ if (isset($this->kmsMasterKeyID)) {
+ $default->addChild('KMSMasterKeyID', $this->kmsMasterKeyID);
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return string
+ */
+ public function getSSEAlgorithm()
+ {
+ return $this->sseAlgorithm;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKMSMasterKeyID()
+ {
+ return $this->kmsMasterKeyID;
+ }
+
+ private $sseAlgorithm = "";
+ private $kmsMasterKeyID = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/StorageCapacityConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/StorageCapacityConfig.php
new file mode 100644
index 000000000..39a9e72b8
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/StorageCapacityConfig.php
@@ -0,0 +1,76 @@
+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->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;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/Tag.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/Tag.php
new file mode 100644
index 000000000..509bd6e71
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/Tag.php
@@ -0,0 +1,41 @@
+key = $key;
+ $this->value = $value;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ private $key = "";
+ private $value = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/TaggingConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/TaggingConfig.php
new file mode 100644
index 000000000..09fa32300
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/TaggingConfig.php
@@ -0,0 +1,89 @@
+tags = array();
+ }
+
+ /**
+ * Get Tag list
+ *
+ * @return Tag[]
+ */
+ public function getTags()
+ {
+ return $this->tags;
+ }
+
+
+ /**
+ * Add a new Tag
+ *
+ * @param Tag $tag
+ * @throws OssException
+ */
+ public function addTag($tag)
+ {
+ $this->tags[] = $tag;
+ }
+
+ /**
+ * Parse TaggingConfig from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (!isset($xml->TagSet) || !isset($xml->TagSet->Tag)) return;
+ foreach ($xml->TagSet->Tag as $tag) {
+ $this->addTag(new Tag($tag->Key, $tag->Value));
+ }
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ $xmlTagSet = $xml->addChild('TagSet');
+ foreach ($this->tags as $tag) {
+ $xmlTag = $xmlTagSet->addChild('Tag');
+ $xmlTag->addChild('Key', strval($tag->getKey()));
+ $xmlTag->addChild('Value', strval($tag->getValue()));
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * Tag list
+ *
+ * @var Tag[]
+ */
+ private $tags = array();
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/TransferAccelerationConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/TransferAccelerationConfig.php
new file mode 100644
index 000000000..187fb2424
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/TransferAccelerationConfig.php
@@ -0,0 +1,73 @@
+Enabled)) {
+ $this->enabled = (strval($xml->Enabled) === 'TRUE' || strval($xml->Enabled) === 'true') ? true : false;
+ }
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ if (isset($this->enabled)) {
+ if($this->enabled === true){
+ $xml->addChild('Enabled','true');
+ } else {
+ $xml->addChild('Enabled','false');
+ }
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+
+ /**
+ * @return bool
+ */
+ public function getEnabled()
+ {
+ return $this->enabled;
+ }
+
+ /**
+ * @param boolean enabled
+ */
+ public function setEnabled($enabled)
+ {
+ $this->enabled = $enabled;
+ }
+
+ /**
+ * @var $enabled boolean
+ */
+ private $enabled = false;
+}
+
+
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/UploadInfo.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/UploadInfo.php
new file mode 100644
index 000000000..49aa414e9
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/UploadInfo.php
@@ -0,0 +1,55 @@
+key = $key;
+ $this->uploadId = $uploadId;
+ $this->initiated = $initiated;
+ }
+
+ /**
+ * @return string
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @return string
+ */
+ public function getUploadId()
+ {
+ return $this->uploadId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getInitiated()
+ {
+ return $this->initiated;
+ }
+
+ private $key = "";
+ private $uploadId = "";
+ private $initiated = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/VersioningConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/VersioningConfig.php
new file mode 100644
index 000000000..992a80fea
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/VersioningConfig.php
@@ -0,0 +1,67 @@
+status = $status;
+ }
+
+ /**
+ * Parse VersioningConfig from the xml.
+ *
+ * @param string $strXml
+ * @throws OssException
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (isset($xml->Status)) {
+ $this->status = strval($xml->Status);
+ }
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ if (isset($this->status)) {
+ $xml->addChild('Status', $this->status);
+ }
+ return $xml->asXML();
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return string
+ */
+ public function getStatus()
+ {
+ return $this->status;
+ }
+
+ private $status = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WebsiteConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WebsiteConfig.php
new file mode 100644
index 000000000..e298eb460
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WebsiteConfig.php
@@ -0,0 +1,76 @@
+indexDocument = $indexDocument;
+ $this->errorDocument = $errorDocument;
+ }
+
+ /**
+ * @param string $strXml
+ * @return null
+ */
+ public function parseFromXml($strXml)
+ {
+ $xml = simplexml_load_string($strXml);
+ if (isset($xml->IndexDocument) && isset($xml->IndexDocument->Suffix)) {
+ $this->indexDocument = strval($xml->IndexDocument->Suffix);
+ }
+ if (isset($xml->ErrorDocument) && isset($xml->ErrorDocument->Key)) {
+ $this->errorDocument = strval($xml->ErrorDocument->Key);
+ }
+ }
+
+ /**
+ * Serialize the WebsiteConfig object into xml string.
+ *
+ * @return string
+ * @throws OssException
+ */
+ public function serializeToXml()
+ {
+ $xml = new \SimpleXMLElement('');
+ $index_document_part = $xml->addChild('IndexDocument');
+ $error_document_part = $xml->addChild('ErrorDocument');
+ $index_document_part->addChild('Suffix', $this->indexDocument);
+ $error_document_part->addChild('Key', $this->errorDocument);
+ return $xml->asXML();
+ }
+
+ /**
+ * @return string
+ */
+ public function getIndexDocument()
+ {
+ return $this->indexDocument;
+ }
+
+ /**
+ * @return string
+ */
+ public function getErrorDocument()
+ {
+ return $this->errorDocument;
+ }
+
+ private $indexDocument = "";
+ private $errorDocument = "";
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WormConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WormConfig.php
new file mode 100644
index 000000000..6a489560a
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/WormConfig.php
@@ -0,0 +1,90 @@
+WormId)) {
+ $this->wormId = strval($xml->WormId);
+ }
+ if (isset($xml->State)) {
+ $this->state = strval($xml->State);
+ }
+ if (isset($xml->RetentionPeriodInDays)) {
+ $this->day = intval($xml->RetentionPeriodInDays);
+ }
+ if (isset($xml->CreationDate)) {
+ $this->creationDate = strval($xml->CreationDate);
+ }
+ }
+
+ /**
+ * Serialize the object into xml string.
+ *
+ * @return string
+ */
+ public function serializeToXml()
+ {
+ throw new OssException("Not implemented.");
+ }
+
+ public function __toString()
+ {
+ return $this->serializeToXml();
+ }
+
+ /**
+ * @return string
+ */
+ public function getWormId()
+ {
+ return $this->wormId;
+ }
+
+ /**
+ * @return string
+ */
+ public function getState()
+ {
+ return $this->state;
+ }
+
+ /**
+ * @return int
+ */
+ public function getDay()
+ {
+ return $this->day;
+ }
+
+ /**
+ * @return string
+ */
+ public function getCreationDate()
+ {
+ return $this->creationDate;
+ }
+
+ private $wormId = '';
+ private $state = '';
+ private $creationDate = '';
+ private $day = 0;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/XmlConfig.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/XmlConfig.php
new file mode 100644
index 000000000..8c0a0db1c
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/XmlConfig.php
@@ -0,0 +1,27 @@
+ $endpoint,
+ 'cname' => $isCName,
+ 'request_proxy' => $requestProxy,
+ 'provider' => $provider
+ );
+ $this->__initNewClient($config);
+ }
+
+ /**
+ * @param array $config
+ * @throws OssException
+ */
+ private function __initNewClient($config = array())
+ {
+ $isCName = isset($config['cname']) ? $config['cname'] : false;
+ $endpoint = isset($config['endpoint']) ? $config['endpoint'] : '';
+ $requestProxy = isset($config['request_proxy']) ? $config['request_proxy'] : null;
+ $provider = isset($config['provider']) ? $config['provider'] : '';
+ if (empty($endpoint)) {
+ throw new OssException("endpoint is empty");
+ }
+ $this->hostname = $this->checkEndpoint($endpoint, $isCName);
+ $this->requestProxy = $requestProxy;
+ if (!$provider instanceof CredentialsProvider) {
+ throw new OssException("provider must be an instance of CredentialsProvider");
+ }
+ $this->provider = $provider;
+
+ $this->region = isset($config['region']) ? $config['region'] : '';
+ $this->cloudBoxId = isset($config['cloudBoxId']) ? $config['cloudBoxId'] : '';
+
+ // $enableStrictObjName
+ $this->enableStrictObjName = true;
+ if (isset($config['strictObjectName'])) {
+ if ($config['strictObjectName'] === false) {
+ $this->enableStrictObjName = false;
+ }
+ }
+
+ // sign version
+ $signatureVersion = self::OSS_SIGNATURE_VERSION_V1;
+ if (isset($config['signatureVersion']) && $config['signatureVersion'] === self::OSS_SIGNATURE_VERSION_V4) {
+ $signatureVersion = self::OSS_SIGNATURE_VERSION_V4;
+ }
+ if ($signatureVersion === self::OSS_SIGNATURE_VERSION_V4) {
+ $this->enableStrictObjName = false;
+ $this->signer = new SignerV4();
+ } else {
+ $this->signer = new SignerV1();
+ }
+
+ //checkObjectEncoding
+ $this->checkObjectEncoding = false;
+ if (isset($config['checkObjectEncoding'])) {
+ if ($config['checkObjectEncoding'] === true) {
+ $this->checkObjectEncoding = true;
+ }
+ }
+
+ //filePathCompatible
+ $this->filePathCompatible = false;
+ if (version_compare(phpversion(), '7.0.0', '<')) {
+ if (OssUtil::isWin()) {
+ $this->filePathCompatible = true;
+ }
+ }
+ if (isset($config['filePathCompatible'])) {
+ if ($config['filePathCompatible'] === true) {
+ $this->filePathCompatible = true;
+ } else if ($config['filePathCompatible'] === false) {
+ $this->filePathCompatible = false;
+ }
+ }
+
+ self::checkEnv();
+ }
+
+ /**
+ * Lists the Bucket [GetService]. Not applicable if the endpoint is CName (because CName must be binded to a specific bucket).
+ *
+ * @param array $options
+ * @return BucketListInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function listBuckets($options = NULL)
+ {
+ if ($this->hostType === self::OSS_HOST_TYPE_CNAME) {
+ throw new OssException("operation is not permitted with CName host");
+ }
+ $this->precheckOptions($options);
+ $options[self::OSS_BUCKET] = '';
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $response = $this->auth($options);
+ $result = new ListBucketsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Creates bucket,The ACL of the bucket created by default is OssClient::OSS_ACL_TYPE_PRIVATE
+ *
+ * @param string $bucket
+ * @param string $acl
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function createBucket($bucket, $acl = self::OSS_ACL_TYPE_PRIVATE, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_HEADERS][self::OSS_ACL] = $acl;
+ if (isset($options[self::OSS_STORAGE])) {
+ $this->precheckStorage($options[self::OSS_STORAGE]);
+ $options[self::OSS_CONTENT] = OssUtil::createBucketXmlBody($options[self::OSS_STORAGE]);
+ unset($options[self::OSS_STORAGE]);
+ }
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes bucket
+ * The deletion will not succeed if the bucket is not empty (either has objects or parts)
+ * To delete a bucket, all its objects and parts must be deleted first.
+ *
+ * @param string $bucket
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucket($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Checks if a bucket exists
+ *
+ * @param string $bucket
+ * @return bool|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function doesBucketExist($bucket)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'acl';
+ $response = $this->auth($options);
+ $result = new ExistResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get the data center location information for the bucket
+ *
+ * @param string $bucket
+ * @param array $options
+ * @return string|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketLocation($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'location';
+ $response = $this->auth($options);
+ $result = new GetLocationResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get the Meta information for the Bucket
+ *
+ * @param string $bucket
+ * @param array $options Refer to the SDK documentation
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketMeta($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_HEAD;
+ $response = $this->auth($options);
+ $result = new HeaderResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the bucket ACL
+ *
+ * @param string $bucket
+ * @param array $options
+ * @return string|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketAcl($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'acl';
+ $response = $this->auth($options);
+ $result = new AclResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the bucket ACL
+ *
+ * @param string $bucket bucket name
+ * @param string $acl access permissions, valid values are ['private', 'public-read', 'public-read-write']
+ * @param array $options by default is empty
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketAcl($bucket, $acl, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_HEADERS][self::OSS_ACL] = $acl;
+ $options[self::OSS_SUB_RESOURCE] = 'acl';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets object ACL
+ *
+ * @param string $bucket
+ * @param string $object
+ * @param array $options
+ * @return string|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getObjectAcl($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options, true);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = 'acl';
+ $response = $this->auth($options);
+ $result = new AclResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the object ACL
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $acl access permissions, valid values are ['default', 'private', 'public-read', 'public-read-write']
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putObjectAcl($bucket, $object, $acl, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options, true);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_HEADERS][self::OSS_OBJECT_ACL] = $acl;
+ $options[self::OSS_SUB_RESOURCE] = 'acl';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the bucket logging config
+ *
+ * @param string $bucket bucket name
+ * @param array $options by default is empty
+ * @return LoggingConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketLogging($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'logging';
+ $response = $this->auth($options);
+ $result = new GetLoggingResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the bycket logging config. Only owner can call this API.
+ *
+ * @param string $bucket bucket name
+ * @param string $targetBucket The logging file's bucket
+ * @param string $targetPrefix The logging file's prefix
+ * @param array $options By default is empty.
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketLogging($bucket, $targetBucket, $targetPrefix, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $this->precheckBucket($targetBucket, 'targetbucket is not allowed empty');
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'logging';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+
+ $loggingConfig = new LoggingConfig($targetBucket, $targetPrefix);
+ $options[self::OSS_CONTENT] = $loggingConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the bucket logging config
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketLogging($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_SUB_RESOURCE] = 'logging';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the website config in bucket---that is could make the bucket as a static website once the CName is binded.
+ *
+ * @param string $bucket bucket name
+ * @param WebsiteConfig $websiteConfig
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketWebsite($bucket, $websiteConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'website';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $websiteConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the website config in the bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return WebsiteConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketWebsite($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'website';
+ $response = $this->auth($options);
+ $result = new GetWebsiteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the website config in the bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketWebsite($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_SUB_RESOURCE] = 'website';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the cross-origin-resource-sharing (CORS) rule. It would overwrite the originl one.
+ *
+ * @param string $bucket bucket name
+ * @param CorsConfig $corsConfig CORS config. Check out the details from OSS API document
+ * @param array $options array
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketCors($bucket, $corsConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'cors';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $corsConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the bucket CORS config
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return CorsConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketCors($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'cors';
+ $response = $this->auth($options);
+ $result = new GetCorsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the bucket's CORS config and disable the CORS on the bucket.
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketCors($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_SUB_RESOURCE] = 'cors';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Bind a CName for the bucket
+ *
+ * @param string $bucket bucket name
+ * @param string $cname
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function addBucketCname($bucket, $cname, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $cnameConfig = new CnameConfig();
+ $cnameConfig->addCname($cname);
+ $options[self::OSS_CONTENT] = $cnameConfig->serializeToXml();
+ $options[self::OSS_COMP] = 'add';
+ $options[self::OSS_CNAME] = '';
+
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the binded CName list of the bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return CnameConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketCname($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_CNAME] = '';
+ $response = $this->auth($options);
+ $result = new GetCnameResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Remove a CName binding from the bucket
+ *
+ * @param string $bucket bucket name
+ * @param CnameConfig $cname
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketCname($bucket, $cname, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $cnameConfig = new CnameConfig();
+ $cnameConfig->addCname($cname);
+ $options[self::OSS_CONTENT] = $cnameConfig->serializeToXml();
+ $options[self::OSS_COMP] = 'delete';
+ $options[self::OSS_CNAME] = '';
+
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * create a cname token for a bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return CnameTokenInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function createBucketCnameToken($bucket, $cname, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $cnameConfig = new CnameConfig();
+ $cnameConfig->addCname($cname);
+ $options[self::OSS_CONTENT] = $cnameConfig->serializeToXml();
+ $options[self::OSS_COMP] = 'token';
+ $options[self::OSS_CNAME] = '';
+ $response = $this->auth($options);
+ $result = new CreateBucketCnameTokenResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * get a cname token for a bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return CnameTokenInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketCnameToken($bucket, $cname, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_COMP] = 'token';
+ $options[self::OSS_CNAME] = $cname;
+ $response = $this->auth($options);
+ $result = new GetBucketCnameTokenResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Creates a Live Channel under a bucket
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param LiveChannelConfig $channelConfig
+ * @param array $options
+ * @return LiveChannelInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketLiveChannel($bucket, $channelName, $channelConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $channelName;
+ $options[self::OSS_SUB_RESOURCE] = 'live';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $channelConfig->serializeToXml();
+
+ $response = $this->auth($options);
+ $result = new PutLiveChannelResult($response);
+ $info = $result->getData();
+ $info->setName($channelName);
+ $info->setDescription($channelConfig->getDescription());
+
+ return $info;
+ }
+
+ /**
+ * Sets the LiveChannel status
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param string channelStatus $channelStatus enabled or disabled
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putLiveChannelStatus($bucket, $channelName, $channelStatus, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $channelName;
+ $options[self::OSS_SUB_RESOURCE] = 'live';
+ $options[self::OSS_LIVE_CHANNEL_STATUS] = $channelStatus;
+
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the LiveChannel information by the channel name
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param array $options
+ * @return GetLiveChannelInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getLiveChannelInfo($bucket, $channelName, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = $channelName;
+ $options[self::OSS_SUB_RESOURCE] = 'live';
+
+ $response = $this->auth($options);
+ $result = new GetLiveChannelInfoResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the status of LiveChannel
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param array $options
+ * @return GetLiveChannelStatus|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getLiveChannelStatus($bucket, $channelName, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = $channelName;
+ $options[self::OSS_SUB_RESOURCE] = 'live';
+ $options[self::OSS_COMP] = 'stat';
+
+ $response = $this->auth($options);
+ $result = new GetLiveChannelStatusResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the LiveChannel pushing streaming record
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param array $options
+ * @return GetLiveChannelHistory|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getLiveChannelHistory($bucket, $channelName, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = $channelName;
+ $options[self::OSS_SUB_RESOURCE] = 'live';
+ $options[self::OSS_COMP] = 'history';
+
+ $response = $this->auth($options);
+ $result = new GetLiveChannelHistoryResult($response);
+ return $result->getData();
+ }
+
+ /**
+ *Gets the live channel list under a bucket.
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return LiveChannelListInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function listBucketLiveChannels($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'live';
+ $options[self::OSS_QUERY_STRING] = array(
+ 'prefix' => isset($options['prefix']) ? $options['prefix'] : '',
+ 'marker' => isset($options['marker']) ? $options['marker'] : '',
+ 'max-keys' => isset($options['max-keys']) ? $options['max-keys'] : '',
+ );
+ $response = $this->auth($options);
+ $result = new ListLiveChannelResult($response);
+ $list = $result->getData();
+ $list->setBucketName($bucket);
+
+ return $list;
+ }
+
+ /**
+ * Creates a play list file for the LiveChannel
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param string $playlistName The playlist name, must end with ".m3u8".
+ * @param array $setTime startTime and EndTime in unix time. No more than 1 day.
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function postVodPlaylist($bucket, $channelName, $playlistName, $setTime)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = $channelName . '/' . $playlistName;
+ $options[self::OSS_SUB_RESOURCE] = 'vod';
+ $options[self::OSS_LIVE_CHANNEL_END_TIME] = $setTime['EndTime'];
+ $options[self::OSS_LIVE_CHANNEL_START_TIME] = $setTime['StartTime'];
+
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the Bucket LiveChannel
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketLiveChannel($bucket, $channelName, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = $channelName;
+ $options[self::OSS_SUB_RESOURCE] = 'live';
+
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Generates the signed pushing streaming url
+ *
+ * @param string $bucket bucket name
+ * @param string channelName $channelName
+ * @param int timeout timeout value in seconds
+ * @param array $options
+ * @return string The signed pushing streaming url
+ * @throws OssException
+ */
+ public function signRtmpUrl($bucket, $channelName, $timeout = 60, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $channelName, $options, false);
+ $expires = time() + $timeout;
+ $proto = 'rtmp://';
+ $hostname = $this->generateHostname($bucket);
+ $cano_params = '';
+ $query_items = array();
+ $params = isset($options['params']) ? $options['params'] : array();
+ uksort($params, 'strnatcasecmp');
+ foreach ($params as $key => $value) {
+ $cano_params = $cano_params . $key . ':' . $value . "\n";
+ $query_items[] = rawurlencode($key) . '=' . rawurlencode($value);
+ }
+ $resource = '/' . $bucket . '/' . $channelName;
+
+ $string_to_sign = $expires . "\n" . $cano_params . $resource;
+ $cred = $this->provider->getCredentials();
+ $this->checkCredentials($cred);
+
+ $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $cred->getAccessKeySecret(), true));
+
+ $query_items[] = 'OSSAccessKeyId=' . rawurlencode($cred->getAccessKeyId());
+ $query_items[] = 'Expires=' . rawurlencode($expires);
+ $query_items[] = 'Signature=' . rawurlencode($signature);
+
+ return $proto . $hostname . '/live/' . $channelName . '?' . implode('&', $query_items);
+ }
+
+ /**
+ * Generates the signed pushing streaming url
+ *
+ * @param string $bucket bucket name
+ * @param string $channelName channel name
+ * @param int $expiration expiration time of the Url, unix epoch, since 1970.1.1 00.00.00 UTC
+ * @param array $options
+ * @return string The signed pushing streaming url
+ * @throws OssException
+ */
+ public function generatePresignedRtmpUrl($bucket, $channelName, $expiration, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $channelName, $options, false);
+ $proto = 'rtmp://';
+ $hostname = $this->generateHostname($bucket);
+ $cano_params = '';
+ $query_items = array();
+ $params = isset($options['params']) ? $options['params'] : array();
+ uksort($params, 'strnatcasecmp');
+ foreach ($params as $key => $value) {
+ $cano_params = $cano_params . $key . ':' . $value . "\n";
+ $query_items[] = rawurlencode($key) . '=' . rawurlencode($value);
+ }
+ $resource = '/' . $bucket . '/' . $channelName;
+
+ $string_to_sign = $expiration . "\n" . $cano_params . $resource;
+ $cred = $this->provider->getCredentials();
+ $this->checkCredentials($cred);
+
+ $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $cred->getAccessKeySecret(), true));
+
+ $query_items[] = 'OSSAccessKeyId=' . rawurlencode($cred->getAccessKeyId());
+ $query_items[] = 'Expires=' . rawurlencode($expiration);
+ $query_items[] = 'Signature=' . rawurlencode($signature);
+
+ return $proto . $hostname . '/live/' . $channelName . '?' . implode('&', $query_items);
+ }
+
+ /**
+ * Precheck the CORS request. Before sending a CORS request, a preflight request (OPTIONS) is sent with the specific origin.
+ * HTTP METHOD and headers information are sent to OSS as well for evaluating if the CORS request is allowed.
+ *
+ * Note: OSS could enable the CORS on the bucket by calling putBucketCors. Once CORS is enabled, the OSS could evaluate accordingto the preflight request.
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $origin the origin of the request
+ * @param string $request_method The actual HTTP method which will be used in CORS request
+ * @param string $request_headers The actual HTTP headers which will be used in CORS request
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function optionsObject($bucket, $object, $origin, $request_method, $request_headers, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_OPTIONS;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_HEADERS][self::OSS_OPTIONS_ORIGIN] = $origin;
+ $options[self::OSS_HEADERS][self::OSS_OPTIONS_REQUEST_HEADERS] = $request_headers;
+ $options[self::OSS_HEADERS][self::OSS_OPTIONS_REQUEST_METHOD] = $request_method;
+ $response = $this->auth($options);
+ $result = new HeaderResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the bucket's lifecycle config
+ *
+ * @param string $bucket bucket name
+ * @param LifecycleConfig $lifecycleConfig LifecycleConfig instance
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketLifecycle($bucket, $lifecycleConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'lifecycle';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $lifecycleConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets bucket's lifecycle config
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return LifecycleConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketLifecycle($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'lifecycle';
+ $response = $this->auth($options);
+ $result = new GetLifecycleResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the bucket's lifecycle config
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketLifecycle($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_SUB_RESOURCE] = 'lifecycle';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets a bucket's referer, which has a whitelist of referrer and specifies if empty referer is allowed.
+ * Checks out API document for more details about "Bucket Referer"
+ *
+ * @param string $bucket bucket name
+ * @param RefererConfig $refererConfig
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketReferer($bucket, $refererConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'referer';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $refererConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the bucket's Referer
+ * Checks out API document for more details about "Bucket Referer"
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return RefererConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketReferer($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'referer';
+ $response = $this->auth($options);
+ $result = new GetRefererResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Set the size of the bucket,the unit is GB
+ * When the capacity of the bucket is bigger than the set, it's forbidden to continue writing
+ *
+ * @param string $bucket bucket name
+ * @param int $storageCapacity
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketStorageCapacity($bucket, $storageCapacity, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'qos';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $storageCapacityConfig = new StorageCapacityConfig($storageCapacity);
+ $options[self::OSS_CONTENT] = $storageCapacityConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get the capacity of the bucket, the unit is GB
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return int|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketStorageCapacity($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'qos';
+ $response = $this->auth($options);
+ $result = new GetStorageCapacityResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get the information of the bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return BucketInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketInfo($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'bucketInfo';
+ $response = $this->auth($options);
+ $result = new GetBucketInfoResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get the stat of the bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return BucketStat|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketStat($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'stat';
+ $response = $this->auth($options);
+ $result = new GetBucketStatResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the bucket's policy
+ *
+ * @param string $bucket bucket name
+ * @param string $policy policy json format content
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketPolicy($bucket, $policy, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'policy';
+ $options[self::OSS_CONTENT_TYPE] = 'application/json';
+ $options[self::OSS_CONTENT] = $policy;
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets bucket's policy
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return string|null policy json content
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketPolicy($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'policy';
+ $response = $this->auth($options);
+ $result = new BodyResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the bucket's policy
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketPolicy($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_SUB_RESOURCE] = 'policy';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the bucket's encryption
+ *
+ * @param string $bucket bucket name
+ * @param ServerSideEncryptionConfig $sseConfig
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketEncryption($bucket, $sseConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'encryption';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $sseConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets bucket's encryption
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return ServerSideEncryptionConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketEncryption($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'encryption';
+ $response = $this->auth($options);
+ $result = new GetBucketEncryptionResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the bucket's encryption
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketEncryption($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_SUB_RESOURCE] = 'encryption';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Set the request playment of the bucket, Can be BucketOwner and Requester
+ *
+ * @param string $bucket bucket name
+ * @param string $payer
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketRequestPayment($bucket, $payer, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'requestPayment';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $config = new RequestPaymentConfig($payer);
+ $options[self::OSS_CONTENT] = $config->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get the request playment of the bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return string|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketRequestPayment($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'requestPayment';
+ $response = $this->auth($options);
+ $result = new GetBucketRequestPaymentResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the bucket's tags
+ *
+ * @param string $bucket bucket name
+ * @param TaggingConfig $taggingConfig
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketTags($bucket, $taggingConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $taggingConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets bucket's tags
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return TaggingConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketTags($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
+ $response = $this->auth($options);
+ $result = new GetBucketTagsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the bucket's tags
+ * If want to delete specified tags for a bucket, please set the $tags
+ *
+ * @param string $bucket bucket name
+ * @param tag[] $tags (optional)
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteBucketTags($bucket, $tags = NULL, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ if (empty($tags)) {
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
+ } else {
+ $value = '';
+ foreach ($tags as $tag) {
+ $value .= $tag->getKey() . ',';
+ }
+ $value = rtrim($value, ',');
+ $options[self::OSS_TAGGING] = $value;
+ }
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Set the versioning of the bucket, Can be BucketOwner and Requester
+ *
+ * @param string $bucket bucket name
+ * @param string $status
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putBucketVersioning($bucket, $status, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'versioning';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $config = new VersioningConfig($status);
+ $options[self::OSS_CONTENT] = $config->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get the versioning of the bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return string|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketVersioning($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'versioning';
+ $response = $this->auth($options);
+ $result = new GetBucketVersioningResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Initialize a bucket's worm
+ *
+ * @param string $bucket bucket name
+ * @param int $day
+ * @param array $options
+ * @return string|null returns upload id
+ * @throws OssException|RequestCore_Exception
+ */
+ public function initiateBucketWorm($bucket, $day, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_SUB_RESOURCE] = 'worm';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $config = new InitiateWormConfig($day);
+ $options[self::OSS_CONTENT] = $config->serializeToXml();
+ $response = $this->auth($options);
+ $result = new InitiateBucketWormResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Aborts the bucket's worm
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function abortBucketWorm($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_SUB_RESOURCE] = 'worm';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Complete a bucket's worm
+ *
+ * @param string $bucket bucket name
+ * @param string $wormId
+ * @param array $options
+ * @return string|null returns upload id
+ * @throws OssException|RequestCore_Exception
+ */
+ public function completeBucketWorm($bucket, $wormId, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_WORM_ID] = $wormId;
+ $options[self::OSS_CONTENT] = '';
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Extend a bucket's worm
+ *
+ * @param string $bucket bucket name
+ * @param string $wormId
+ * @param int $day
+ * @param array $options
+ * @return string|null returns upload id
+ * @throws OssException|RequestCore_Exception
+ */
+ public function extendBucketWorm($bucket, $wormId, $day, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_WORM_ID] = $wormId;
+ $options[self::OSS_SUB_RESOURCE] = 'wormExtend';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $config = new ExtendWormConfig($day);
+ $options[self::OSS_CONTENT] = $config->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Get a bucket's worm
+ *
+ * @param string $bucket bucket name
+ * @param array $options
+ * @return string|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketWorm($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'worm';
+ $response = $this->auth($options);
+ $result = new GetBucketWormResult($response);
+ return $result->getData();
+ }
+
+
+ /**
+ * Put Bucket TransferAcceleration
+ * @param $bucket
+ * @param $enabled boolean
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+
+ public function putBucketTransferAcceleration($bucket, $enabled, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_SUB_RESOURCE] = 'transferAcceleration';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $config = new TransferAccelerationConfig();
+ $config->setEnabled($enabled);
+ $options[self::OSS_CONTENT] = $config->serializeToXml();
+ $response = $this->auth($options);
+ $result = new HeaderResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Put Bucket TransferAcceleration
+ * @param $bucket
+ * @param array $options
+ * @return boolean|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getBucketTransferAcceleration($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'transferAcceleration';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $response = $this->auth($options);
+ $result = new GetBucketTransferAccelerationResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Lists the bucket's object list (in ObjectListInfo)
+ *
+ * @param string $bucket
+ * @param array $options are defined below:
+ * $options = array(
+ * 'max-keys' => specifies max object count to return. By default is 100 and max value could be 1000.
+ * 'prefix' => specifies the key prefix the returned objects must have. Note that the returned keys still contain the prefix.
+ * 'delimiter' => The delimiter of object name for grouping object. When it's specified, listObjects will differeniate the object and folder. And it will return subfolder's objects.
+ * 'marker' => The key of returned object must be greater than the 'marker'.
+ *)
+ * Prefix and marker are for filtering and paging. Their length must be less than 256 bytes
+ * @return ObjectListInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function listObjects($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $query = isset($options[self::OSS_QUERY_STRING]) ? $options[self::OSS_QUERY_STRING] : array();
+ $options[self::OSS_QUERY_STRING] = array_merge(
+ $query,
+ array(self::OSS_ENCODING_TYPE => self::OSS_ENCODING_TYPE_URL,
+ self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
+ self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
+ self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
+ self::OSS_MARKER => isset($options[self::OSS_MARKER]) ? $options[self::OSS_MARKER] : '')
+ );
+
+ $response = $this->auth($options);
+ $result = new ListObjectsResult($response);
+ return $result->getData();
+ }
+
+
+ /**
+ * Lists the bucket's object list v2 (in ObjectListInfoV2)
+ *
+ * @param string $bucket
+ * @param array $options are defined below:
+ * $options = array(
+ * 'max-keys' => specifies max object count to return. By default is 100 and max value could be 1000.
+ * 'prefix' => specifies the key prefix the returned objects must have. Note that the returned keys still contain the prefix.
+ * 'delimiter' => The delimiter of object name for grouping object. When it's specified, listObjects will differeniate the object and folder. And it will return subfolder's objects.
+ * 'start-after' => The key of returned object must be greater than the 'start-after'.
+ * 'continuation-token' => The token from which the list operation must start.
+ *)
+ * Prefix, start-after and continuation-token are for filtering and paging. Their length must be less than 256 bytes
+ * @return ObjectListInfoV2|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function listObjectsV2($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $query = isset($options[self::OSS_QUERY_STRING]) ? $options[self::OSS_QUERY_STRING] : array();
+ $temp = array(
+ self::OSS_LIST_TYPE => 2,
+ self::OSS_ENCODING_TYPE => self::OSS_ENCODING_TYPE_URL,
+ self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
+ self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
+ self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
+ self::OSS_START_AFTER => isset($options[self::OSS_START_AFTER]) ? $options[self::OSS_START_AFTER] : '',
+ );
+ if (isset($options[self::OSS_CONTINUATION_TOKEN])) {
+ $temp[self::OSS_CONTINUATION_TOKEN] = $options[self::OSS_CONTINUATION_TOKEN];
+ }
+ $options[self::OSS_QUERY_STRING] = array_merge(
+ $query, $temp
+ );
+ $response = $this->auth($options);
+ $result = new ListObjectsV2Result($response);
+ return $result->getData();
+ }
+
+ /**
+ * Lists the bucket's object with version information (in ObjectListInfo)
+ *
+ * @param string $bucket
+ * @param array $options are defined below:
+ * $options = array(
+ * 'max-keys' => specifies max object count to return. By default is 100 and max value could be 1000.
+ * 'prefix' => specifies the key prefix the returned objects must have. Note that the returned keys still contain the prefix.
+ * 'delimiter' => The delimiter of object name for grouping object. When it's specified, listObjectVersions will differeniate the object and folder. And it will return subfolder's objects.
+ * 'key-marker' => The key of returned object must be greater than the 'key-marker'.
+ * 'version-id-marker' => The version id of returned object must be greater than the 'version-id-marker'.
+ *)
+ * Prefix and marker are for filtering and paging. Their length must be less than 256 bytes
+ * @return ObjectVersionListInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function listObjectVersions($bucket, $options = NULL)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_SUB_RESOURCE] = 'versions';
+ $query = isset($options[self::OSS_QUERY_STRING]) ? $options[self::OSS_QUERY_STRING] : array();
+ $options[self::OSS_QUERY_STRING] = array_merge(
+ $query,
+ array(self::OSS_ENCODING_TYPE => self::OSS_ENCODING_TYPE_URL,
+ self::OSS_DELIMITER => isset($options[self::OSS_DELIMITER]) ? $options[self::OSS_DELIMITER] : '/',
+ self::OSS_PREFIX => isset($options[self::OSS_PREFIX]) ? $options[self::OSS_PREFIX] : '',
+ self::OSS_MAX_KEYS => isset($options[self::OSS_MAX_KEYS]) ? $options[self::OSS_MAX_KEYS] : self::OSS_MAX_KEYS_VALUE,
+ self::OSS_KEY_MARKER => isset($options[self::OSS_KEY_MARKER]) ? $options[self::OSS_KEY_MARKER] : '',
+ self::OSS_VERSION_ID_MARKER => isset($options[self::OSS_VERSION_ID_MARKER]) ? $options[self::OSS_VERSION_ID_MARKER] : '')
+ );
+
+ $response = $this->auth($options);
+ $result = new ListObjectVersionsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Creates a virtual 'folder' in OSS. The name should not end with '/' because the method will append the name with a '/' anyway.
+ *
+ * Internal use only.
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function createObjectDir($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $object . '/';
+ $options[self::OSS_CONTENT_LENGTH] = array(self::OSS_CONTENT_LENGTH => 0);
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Uploads the $content object to OSS.
+ *
+ * @param string $bucket bucket name
+ * @param string $object objcet name
+ * @param string $content The content object
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putObject($bucket, $object, $content, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+
+ $options[self::OSS_CONTENT] = $content;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $object;
+
+ if (!isset($options[self::OSS_LENGTH])) {
+ $options[self::OSS_CONTENT_LENGTH] = strlen($options[self::OSS_CONTENT]);
+ } else {
+ $options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
+ }
+
+ $is_check_md5 = $this->isCheckMD5($options);
+ if ($is_check_md5) {
+ $content_md5 = base64_encode(md5($content, true));
+ $options[self::OSS_CONTENT_MD5] = $content_md5;
+ }
+
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object);
+ }
+ $response = $this->auth($options);
+
+ if (isset($options[self::OSS_CALLBACK]) && !empty($options[self::OSS_CALLBACK])) {
+ $result = new CallbackResult($response);
+ } else {
+ $result = new PutSetDeleteResult($response);
+ }
+
+ return $result->getData();
+ }
+
+
+ /**
+ * creates symlink
+ * @param string $bucket bucket name
+ * @param string $symlink symlink name
+ * @param string $targetObject targetObject name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putSymlink($bucket, $symlink, $targetObject, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $symlink, $options);
+
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $symlink;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_SYMLINK;
+ $options[self::OSS_HEADERS][self::OSS_SYMLINK_TARGET] = rawurlencode($targetObject);
+
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets symlink
+ * @param string $bucket bucket name
+ * @param string $symlink symlink name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getSymlink($bucket, $symlink, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $symlink, $options);
+
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = $symlink;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_SYMLINK;
+
+ $response = $this->auth($options);
+ $result = new SymlinkResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Uploads a local file
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $file local file path
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function uploadFile($bucket, $object, $file, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ OssUtil::throwOssExceptionWithMessageIfEmpty($file, "file path is invalid");
+ $file = $this->encodeFilePath($file);
+ if (!file_exists($file)) {
+ throw new OssException($file . " file does not exist");
+ }
+ $options[self::OSS_FILE_UPLOAD] = $file;
+ $file_size = sprintf('%u', filesize($options[self::OSS_FILE_UPLOAD]));
+ $is_check_md5 = $this->isCheckMD5($options);
+ if ($is_check_md5) {
+ $content_md5 = base64_encode(md5_file($options[self::OSS_FILE_UPLOAD], true));
+ $options[self::OSS_CONTENT_MD5] = $content_md5;
+ }
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object, $file);
+ }
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_CONTENT_LENGTH] = $file_size;
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Uploads object from file handle
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param resource $handle file handle
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function uploadStream($bucket, $object, $handle, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ if (!is_resource($handle)) {
+ throw new OssException("The handle must be an opened stream");
+ }
+ $options[self::OSS_FILE_UPLOAD] = $handle;
+ if ($this->isCheckMD5($options)) {
+ rewind($handle);
+ $ctx = hash_init('md5');
+ hash_update_stream($ctx, $handle);
+ $content_md5 = base64_encode(hash_final($ctx, true));
+ rewind($handle);
+ $options[self::OSS_CONTENT_MD5] = $content_md5;
+ }
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object);
+ }
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ if (!isset($options[self::OSS_CONTENT_LENGTH])) {
+ $stat = fstat($handle);
+ $options[self::OSS_CONTENT_LENGTH] = $stat[self::OSS_SIZE];
+ }
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Append the object with the content at the specified position.
+ * The specified position is typically the lengh of the current file.
+ * @param string $bucket bucket name
+ * @param string $object objcet name
+ * @param string $content content to append
+ * @param array $options
+ * @return int|null next append position
+ * @throws OssException|RequestCore_Exception
+ */
+ public function appendObject($bucket, $object, $content, $position, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+
+ $options[self::OSS_CONTENT] = $content;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = 'append';
+ $options[self::OSS_POSITION] = strval($position);
+ if (!isset($options[self::OSS_LENGTH])) {
+ $options[self::OSS_CONTENT_LENGTH] = strlen($options[self::OSS_CONTENT]);
+ } else {
+ $options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
+ }
+
+ $is_check_md5 = $this->isCheckMD5($options);
+ if ($is_check_md5) {
+ $content_md5 = base64_encode(md5($content, true));
+ $options[self::OSS_CONTENT_MD5] = $content_md5;
+ }
+
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object);
+ }
+ $response = $this->auth($options);
+ $result = new AppendResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Append the object with a local file
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $file The local file path to append with
+ * @param array $options
+ * @return int|null next append position
+ * @throws OssException|RequestCore_Exception
+ */
+ public function appendFile($bucket, $object, $file, $position, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+
+ OssUtil::throwOssExceptionWithMessageIfEmpty($file, "file path is invalid");
+ $file = $this->encodeFilePath($file);
+ if (!file_exists($file)) {
+ throw new OssException($file . " file does not exist");
+ }
+ $options[self::OSS_FILE_UPLOAD] = $file;
+ $file_size = sprintf('%u', filesize($options[self::OSS_FILE_UPLOAD]));
+ $is_check_md5 = $this->isCheckMD5($options);
+ if ($is_check_md5) {
+ $content_md5 = base64_encode(md5_file($options[self::OSS_FILE_UPLOAD], true));
+ $options[self::OSS_CONTENT_MD5] = $content_md5;
+ }
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object, $file);
+ }
+
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_CONTENT_LENGTH] = $file_size;
+ $options[self::OSS_SUB_RESOURCE] = 'append';
+ $options[self::OSS_POSITION] = strval($position);
+
+ $response = $this->auth($options);
+ $result = new AppendResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Copy from an existing OSS object to another OSS object. If the target object exists already, it will be overwritten.
+ *
+ * @param string $fromBucket Source bucket name
+ * @param string $fromObject Source object name
+ * @param string $toBucket Target bucket name
+ * @param string $toObject Target object name
+ * @param array $options
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function copyObject($fromBucket, $fromObject, $toBucket, $toObject, $options = NULL)
+ {
+ $this->precheckCommon($fromBucket, $fromObject, $options);
+ $this->precheckCommon($toBucket, $toObject, $options);
+ $options[self::OSS_BUCKET] = $toBucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $toObject;
+ $param = '/' . $fromBucket . '/' . rawurlencode($fromObject);
+ if (isset($options[self::OSS_VERSION_ID])) {
+ $param = $param . '?versionId=' . $options[self::OSS_VERSION_ID];
+ unset($options[self::OSS_VERSION_ID]);
+ }
+ $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = $param;
+ $response = $this->auth($options);
+ $result = new CopyObjectResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets Object metadata
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $options Checks out the SDK document for the detail
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getObjectMeta($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_HEAD;
+ $options[self::OSS_OBJECT] = $object;
+ $response = $this->auth($options);
+ $result = new HeaderResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the simplified metadata of a object.
+ * Simplified metadata includes ETag, Size, LastModified.
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $options Checks out the SDK document for the detail
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getSimplifiedObjectMeta($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_HEAD;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = 'objectMeta';
+ $response = $this->auth($options);
+ $result = new HeaderResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes a object
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteObject($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_OBJECT] = $object;
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes multiple objects in a bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $objects object list
+ * @param array $options
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteObjects($bucket, $objects, $options = null)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ if (!is_array($objects) || !$objects) {
+ throw new OssException('objects must be array');
+ }
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_SUB_RESOURCE] = 'delete';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $quiet = 'false';
+ if (isset($options['quiet'])) {
+ if (is_bool($options['quiet'])) { //Boolean
+ $quiet = $options['quiet'] ? 'true' : 'false';
+ } elseif (is_string($options['quiet'])) { // string
+ $quiet = ($options['quiet'] === 'true') ? 'true' : 'false';
+ }
+ }
+ $xmlBody = OssUtil::createDeleteObjectsXmlBody($objects, $quiet);
+ $options[self::OSS_CONTENT] = $xmlBody;
+ $response = $this->auth($options);
+ $result = new DeleteObjectsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes multiple objects with version id in a bucket
+ *
+ * @param string $bucket bucket name
+ * @param array $objects DeleteObjectInfo list
+ * @param array $options
+ * @return DeletedObjectInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteObjectVersions($bucket, $objects, $options = null)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ if (!is_array($objects) || !$objects) {
+ throw new OssException('objects must be array');
+ }
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_SUB_RESOURCE] = 'delete';
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $quiet = 'false';
+ if (isset($options['quiet'])) {
+ if (is_bool($options['quiet'])) { //Boolean
+ $quiet = $options['quiet'] ? 'true' : 'false';
+ } elseif (is_string($options['quiet'])) { // string
+ $quiet = ($options['quiet'] === 'true') ? 'true' : 'false';
+ }
+ }
+ $xmlBody = OssUtil::createDeleteObjectVersionsXmlBody($objects, $quiet);
+ $options[self::OSS_CONTENT] = $xmlBody;
+ $response = $this->auth($options);
+ $result = new DeleteObjectVersionsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets Object content
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param array $options It must contain ALIOSS::OSS_FILE_DOWNLOAD. And ALIOSS::OSS_RANGE is optional and empty means to download the whole file.
+ * @return string|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getObject($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_OBJECT] = $object;
+ if (isset($options[self::OSS_LAST_MODIFIED])) {
+ $options[self::OSS_HEADERS][self::OSS_IF_MODIFIED_SINCE] = $options[self::OSS_LAST_MODIFIED];
+ unset($options[self::OSS_LAST_MODIFIED]);
+ }
+ if (isset($options[self::OSS_ETAG])) {
+ $options[self::OSS_HEADERS][self::OSS_IF_NONE_MATCH] = $options[self::OSS_ETAG];
+ unset($options[self::OSS_ETAG]);
+ }
+ if (isset($options[self::OSS_RANGE])) {
+ $range = $options[self::OSS_RANGE];
+ $options[self::OSS_HEADERS][self::OSS_RANGE] = "bytes=$range";
+ unset($options[self::OSS_RANGE]);
+ }
+ $response = $this->auth($options);
+ $result = new BodyResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Checks if the object exists
+ * It's implemented by getObjectMeta().
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param array $options
+ * @return bool|null True:object exists; False:object does not exist
+ * @throws OssException|RequestCore_Exception|
+ */
+ public function doesObjectExist($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_HEAD;
+ $options[self::OSS_OBJECT] = $object;
+ $response = $this->auth($options);
+ $result = new ExistResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Object reading for Archive type
+ * Use Restore to enable the server to perform the thawing task
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function restoreObject($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_RESTORE;
+ if (isset($options[self::OSS_RESTORE_CONFIG])) {
+ $config = $options[self::OSS_RESTORE_CONFIG];
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $config->serializeToXml();
+ }
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Sets the object tagging
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param TaggingConfig $taggingConfig
+ * @return array|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function putObjectTagging($bucket, $object, $taggingConfig, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options, true);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ $options[self::OSS_CONTENT] = $taggingConfig->serializeToXml();
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the object tagging
+ *
+ * @param string $bucket
+ * @param string $object
+ * @return TaggingConfig|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function getObjectTagging($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options, true);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
+ $response = $this->auth($options);
+ $result = new GetBucketTagsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Deletes the object tagging
+ *
+ * @param string $bucket
+ * @param string $object
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function deleteObjectTagging($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options, true);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = self::OSS_TAGGING;
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Processes the object
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $process process script
+ * @return string|null process result, json format
+ * @throws OssException|RequestCore_Exception|
+ */
+ public function processObject($bucket, $object, $process, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = 'x-oss-process';
+ $options[self::OSS_CONTENT_TYPE] = 'application/octet-stream';
+ $options[self::OSS_CONTENT] = 'x-oss-process=' . $process;
+ $response = $this->auth($options);
+ $result = new BodyResult($response);
+ return $result->getData();
+ }
+
+
+ /**
+ * Async Process the object
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $asyncProcess async process script
+ * @param null $options
+ * @return string|null process result, json format
+ * @throws OssException
+ * @throws RequestCore_Exception
+ */
+ public function asyncProcessObject($bucket, $object, $asyncProcess, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = 'x-oss-async-process';
+ $options[self::OSS_CONTENT_TYPE] = 'application/octet-stream';
+ $options[self::OSS_CONTENT] = 'x-oss-async-process='.$asyncProcess;
+ $response = $this->auth($options);
+ $result = new BodyResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the part size according to the preferred part size.
+ * If the specified part size is too small or too big, it will return a min part or max part size instead.
+ * Otherwise returns the specified part size.
+ * @param int $partSize
+ * @return int
+ */
+ private function computePartSize($partSize)
+ {
+ $partSize = (integer)$partSize;
+ if ($partSize <= self::OSS_MIN_PART_SIZE) {
+ $partSize = self::OSS_MIN_PART_SIZE;
+ } elseif ($partSize > self::OSS_MAX_PART_SIZE) {
+ $partSize = self::OSS_MAX_PART_SIZE;
+ }
+ return $partSize;
+ }
+
+ /**
+ * Computes the parts count, size and start position according to the file size and the part size.
+ * It must be only called by upload_Part().
+ *
+ * @param integer $file_size File size
+ * @param integer $partSize part size. Default is 5MB
+ * @return array An array contains key-value pairs--the key is `seekTo`and value is `length`.
+ */
+ public function generateMultiuploadParts($file_size, $partSize = 5242880)
+ {
+ $i = 0;
+ $size_count = $file_size;
+ $values = array();
+ $partSize = $this->computePartSize($partSize);
+ while ($size_count > 0) {
+ $size_count -= $partSize;
+ $values[] = array(
+ self::OSS_SEEK_TO => ($partSize * $i),
+ self::OSS_LENGTH => (($size_count > 0) ? $partSize : ($size_count + $partSize)),
+ );
+ $i++;
+ }
+ return $values;
+ }
+
+ /**
+ * Initialize a multi-part upload
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param array $options Key-Value array
+ * @return string|null returns upload id
+ * @throws OssException|RequestCore_Exception
+ */
+ public function initiateMultipartUpload($bucket, $object, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_SUB_RESOURCE] = 'uploads';
+ $options[self::OSS_CONTENT] = '';
+
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object);
+ }
+ if (!isset($options[self::OSS_HEADERS])) {
+ $options[self::OSS_HEADERS] = array();
+ }
+ $response = $this->auth($options);
+ $result = new InitiateMultipartUploadResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Upload a part in a multiparts upload.
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $uploadId
+ * @param array $options Key-Value array
+ * @return string|null eTag
+ * @throws OssException|RequestCore_Exception
+ */
+ public function uploadPart($bucket, $object, $uploadId, $options = null)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $this->precheckParam($options, self::OSS_FILE_UPLOAD, __FUNCTION__);
+ $this->precheckParam($options, self::OSS_PART_NUM, __FUNCTION__);
+
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_UPLOAD_ID] = $uploadId;
+
+ if (isset($options[self::OSS_LENGTH])) {
+ $options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
+ }
+ $response = $this->auth($options);
+ $result = new UploadPartResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Gets the uploaded parts.
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $uploadId uploadId
+ * @param array $options Key-Value array
+ * @return ListPartsInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function listParts($bucket, $object, $uploadId, $options = null)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_UPLOAD_ID] = $uploadId;
+ $options[self::OSS_QUERY_STRING] = array();
+ foreach (array('max-parts', 'part-number-marker') as $param) {
+ if (isset($options[$param])) {
+ $options[self::OSS_QUERY_STRING][$param] = $options[$param];
+ unset($options[$param]);
+ }
+ }
+ $response = $this->auth($options);
+ $result = new ListPartsResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Abort a multiparts upload
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $uploadId uploadId
+ * @param array $options Key-Value name
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function abortMultipartUpload($bucket, $object, $uploadId, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_UPLOAD_ID] = $uploadId;
+ $response = $this->auth($options);
+ $result = new PutSetDeleteResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Completes a multiparts upload, after all parts are uploaded.
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $uploadId uploadId
+ * @param array $listParts array( array("PartNumber"=> int, "ETag"=>string))
+ * @param array $options Key-Value array
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function completeMultipartUpload($bucket, $object, $uploadId, $listParts, $options = NULL)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_POST;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_OBJECT] = $object;
+ $options[self::OSS_UPLOAD_ID] = $uploadId;
+ $options[self::OSS_CONTENT_TYPE] = 'application/xml';
+ if (is_array($listParts)) {
+ $options[self::OSS_CONTENT] = OssUtil::createCompleteMultipartUploadXmlBody($listParts);
+ } else {
+ $options[self::OSS_CONTENT] = "";
+ }
+
+ $response = $this->auth($options);
+ if (isset($options[self::OSS_CALLBACK]) && !empty($options[self::OSS_CALLBACK])) {
+ $result = new CallbackResult($response);
+ } else {
+ $result = new PutSetDeleteResult($response);
+ }
+ return $result->getData();
+ }
+
+ /**
+ * Lists all ongoing multipart upload events, which means all initialized but not completed or aborted multipart uploads.
+ *
+ * @param string $bucket bucket
+ * @param array $options key-value array--expected keys are 'delimiter', 'key-marker', 'max-uploads', 'prefix', 'upload-id-marker'
+ * @return ListMultipartUploadInfo|null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function listMultipartUploads($bucket, $options = null)
+ {
+ $this->precheckCommon($bucket, NULL, $options, false);
+ $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
+ $options[self::OSS_BUCKET] = $bucket;
+ $options[self::OSS_SUB_RESOURCE] = 'uploads';
+
+ foreach (array('delimiter', 'key-marker', 'max-uploads', 'prefix', 'upload-id-marker') as $param) {
+ if (isset($options[$param])) {
+ $options[self::OSS_QUERY_STRING][$param] = $options[$param];
+ unset($options[$param]);
+ }
+ }
+ $query = isset($options[self::OSS_QUERY_STRING]) ? $options[self::OSS_QUERY_STRING] : array();
+ $options[self::OSS_QUERY_STRING] = array_merge(
+ $query,
+ array(self::OSS_ENCODING_TYPE => self::OSS_ENCODING_TYPE_URL)
+ );
+
+ $response = $this->auth($options);
+ $result = new ListMultipartUploadResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * Copy an existing file as a part
+ *
+ * @param string $fromBucket source bucket name
+ * @param string $fromObject source object name
+ * @param string $toBucket target bucket name
+ * @param string $toObject target object name
+ * @param int $partNumber Part number
+ * @param string $uploadId Upload Id
+ * @param array $options Key-Value array---it should have 'start' or 'end' key to specify the range of the source object to copy. If it's not specifed, the whole object is copied.
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function uploadPartCopy($fromBucket, $fromObject, $toBucket, $toObject, $partNumber, $uploadId, $options = NULL)
+ {
+ $this->precheckCommon($fromBucket, $fromObject, $options);
+ $this->precheckCommon($toBucket, $toObject, $options);
+
+ //If $options['isFullCopy'] is not set, copy from the beginning
+ $start_range = "0";
+ if (isset($options['start'])) {
+ $start_range = $options['start'];
+ }
+ $end_range = "";
+ if (isset($options['end'])) {
+ $end_range = $options['end'];
+ }
+ $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
+ $options[self::OSS_BUCKET] = $toBucket;
+ $options[self::OSS_OBJECT] = $toObject;
+ $options[self::OSS_PART_NUM] = $partNumber;
+ $options[self::OSS_UPLOAD_ID] = $uploadId;
+
+ if (!isset($options[self::OSS_HEADERS])) {
+ $options[self::OSS_HEADERS] = array();
+ }
+
+ $param = '/' . $fromBucket . '/' . rawurlencode($fromObject);
+ if (isset($options[self::OSS_VERSION_ID])) {
+ $param = $param . '?versionId=' . $options[self::OSS_VERSION_ID];
+ unset($options[self::OSS_VERSION_ID]);
+ }
+
+ $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE] = $param;
+ $options[self::OSS_HEADERS][self::OSS_OBJECT_COPY_SOURCE_RANGE] = "bytes=" . $start_range . "-" . $end_range;
+ $response = $this->auth($options);
+ $result = new UploadPartResult($response);
+ return $result->getData();
+ }
+
+ /**
+ * A higher level API for uploading a file with multipart upload. It consists of initialization, parts upload and completion.
+ *
+ * @param string $bucket bucket name
+ * @param string $object object name
+ * @param string $file The local file to upload
+ * @param array $options Key-Value array
+ * @return null
+ * @throws OssException|RequestCore_Exception
+ */
+ public function multiuploadFile($bucket, $object, $file, $options = null)
+ {
+ $this->precheckCommon($bucket, $object, $options);
+ if (isset($options[self::OSS_LENGTH])) {
+ $options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
+ unset($options[self::OSS_LENGTH]);
+ }
+ if (empty($file)) {
+ throw new OssException("parameter invalid, file is empty");
+ }
+ $uploadFile = $this->encodeFilePath($file);
+ if (!isset($options[self::OSS_CONTENT_TYPE])) {
+ $options[self::OSS_CONTENT_TYPE] = $this->getMimeType($object, $uploadFile);
+ }
+
+ $upload_position = isset($options[self::OSS_SEEK_TO]) ? (integer)$options[self::OSS_SEEK_TO] : 0;
+
+ if (isset($options[self::OSS_CONTENT_LENGTH])) {
+ $upload_file_size = (integer)$options[self::OSS_CONTENT_LENGTH];
+ } else {
+ $upload_file_size = sprintf('%u', filesize($uploadFile));
+
+ if ($upload_file_size !== false) {
+ $upload_file_size -= $upload_position;
+ }
+ }
+
+ if ($upload_position === false || !isset($upload_file_size) || $upload_file_size === false || $upload_file_size < 0) {
+ throw new OssException('The size of `fileUpload` cannot be determined in ' . __FUNCTION__ . '().');
+ }
+ // Computes the part size and assign it to options.
+ if (isset($options[self::OSS_PART_SIZE])) {
+ $options[self::OSS_PART_SIZE] = $this->computePartSize($options[self::OSS_PART_SIZE]);
+ } else {
+ $options[self::OSS_PART_SIZE] = self::OSS_MID_PART_SIZE;
+ }
+
+ $is_check_md5 = $this->isCheckMD5($options);
+ // if the file size is less than part size, use simple file upload.
+ if ($upload_file_size < $options[self::OSS_PART_SIZE] && !isset($options[self::OSS_UPLOAD_ID])) {
+ return $this->uploadFile($bucket, $object, $uploadFile, $options);
+ }
+
+ // Using multipart upload, initialize if no OSS_UPLOAD_ID is specified in options.
+ if (isset($options[self::OSS_UPLOAD_ID])) {
+ $uploadId = $options[self::OSS_UPLOAD_ID];
+ } else {
+ // initialize
+ $uploadId = $this->initiateMultipartUpload($bucket, $object, $options);
+ }
+
+ // generates the parts information and upload them one by one
+ $pieces = $this->generateMultiuploadParts($upload_file_size, (integer)$options[self::OSS_PART_SIZE]);
+ $response_upload_part = array();
+ foreach ($pieces as $i => $piece) {
+ $from_pos = $upload_position + (integer)$piece[self::OSS_SEEK_TO];
+ $to_pos = (integer)$piece[self::OSS_LENGTH] + $from_pos - 1;
+ $up_options = array(
+ self::OSS_FILE_UPLOAD => $uploadFile,
+ self::OSS_PART_NUM => ($i + 1),
+ self::OSS_SEEK_TO => $from_pos,
+ self::OSS_LENGTH => $to_pos - $from_pos + 1,
+ self::OSS_CHECK_MD5 => $is_check_md5,
+ );
+ if ($is_check_md5) {
+ $content_md5 = OssUtil::getMd5SumForFile($uploadFile, $from_pos, $to_pos);
+ $up_options[self::OSS_CONTENT_MD5] = $content_md5;
+ }
+ $response_upload_part[] = $this->uploadPart($bucket, $object, $uploadId, $up_options);
+ }
+
+ $uploadParts = array();
+ foreach ($response_upload_part as $i => $etag) {
+ $uploadParts[] = array(
+ 'PartNumber' => ($i + 1),
+ 'ETag' => $etag,
+ );
+ }
+
+ //build complete options
+ $cmp_options = null;
+ if (isset($options[self::OSS_HEADERS]) && isset($options[self::OSS_HEADERS][self::OSS_REQUEST_PAYER])) {
+ $cmp_options = array(
+ OssClient::OSS_HEADERS => array(
+ OssClient::OSS_REQUEST_PAYER => $options[self::OSS_HEADERS][self::OSS_REQUEST_PAYER],
+ ));
+ }
+ return $this->completeMultipartUpload($bucket, $object, $uploadId, $uploadParts, $cmp_options);
+ }
+
+ /**
+ * Uploads the local directory to the specified bucket into specified folder (prefix)
+ *
+ * @param string $bucket bucket name
+ * @param string $prefix The object key prefix. Typically it's folder name. The name should not end with '/' as the API appends it automatically.
+ * @param string $localDirectory The local directory to upload
+ * @param string $exclude To excluded directories
+ * @param bool $recursive Recursive flag. True: Recursively upload all datas under the local directory; False: only upload first layer's files.
+ * @param bool $checkMd5
+ * @return array Returns two list: array("succeededList" => array("object"), "failedList" => array("object"=>"errorMessage"))
+ * @throws OssException
+ */
+ public function uploadDir($bucket, $prefix, $localDirectory, $exclude = '.|..|.svn|.git', $recursive = false, $checkMd5 = true)
+ {
+ $retArray = array("succeededList" => array(), "failedList" => array());
+ if (empty($bucket)) throw new OssException("parameter error, bucket is empty");
+ if (!is_string($prefix)) throw new OssException("parameter error, prefix is not string");
+ if (empty($localDirectory)) throw new OssException("parameter error, localDirectory is empty");
+ $directory = $localDirectory;
+ $directory = $this->encodeFilePath($directory);
+ //If it's not the local directory, throw OSSException.
+ if (!is_dir($directory)) {
+ throw new OssException('parameter error: ' . $directory . ' is not a directory, please check it');
+ }
+ //read directory
+ $file_list_array = OssUtil::readDir($directory, $exclude, $recursive);
+ if (!$file_list_array) {
+ throw new OssException($directory . ' is empty...');
+ }
+ foreach ($file_list_array as $k => $item) {
+ if (is_dir($item['path'])) {
+ continue;
+ }
+ $options = array(
+ self::OSS_PART_SIZE => self::OSS_MIN_PART_SIZE,
+ self::OSS_CHECK_MD5 => $checkMd5,
+ );
+ //mbstring to utf-8
+ $fileName = $this->decodeFilePath($item['file']);
+ $realObject = (!empty($prefix) ? $prefix . '/' : '') . $fileName;
+
+ try {
+ $this->multiuploadFile($bucket, $realObject, $item['path'], $options);
+ $retArray["succeededList"][] = $realObject;
+ } catch (OssException $e) {
+ $retArray["failedList"][$realObject] = $e->getMessage();
+ }
+ }
+ return $retArray;
+ }
+
+ /**
+ * Sign URL with specified expiration time in seconds (timeout) and HTTP method.
+ * The signed URL could be used to access the object directly.
+ *
+ * @param string $bucket
+ * @param string $object
+ * @param int $timeout expiration time in seconds.
+ * @param string $method
+ * @param array $options Key-Value array
+ * @return string
+ * @throws OssException
+ */
+ public function signUrl($bucket, $object, $timeout = 60, $method = self::OSS_HTTP_GET, $options = NULL)
+ {
+ $expiration = time() + $timeout;
+ return $this->generatePresignedUrl($bucket, $object, $expiration, $method, $options);
+ }
+
+ /**
+ * Sign URL with specified expiration time in seconds and HTTP method.
+ * The signed URL could be used to access the object directly.
+ *
+ * @param string $bucket
+ * @param string $object
+ * @param int $expiration expiration time of the Url, unix epoch, since 1970.1.1 00.00.00 UTC
+ * @param string $method
+ * @param array $options Key-Value array
+ * @return string
+ * @throws OssException
+ */
+ public function generatePresignedUrl($bucket, $object, $expiration, $method = self::OSS_HTTP_GET, $options = NULL)
+ {
+ $this->precheckObjectExt($object, $this->enableStrictObjName);
+ $this->precheckCommon($bucket, $object, $options);
+ $cred = $this->provider->getCredentials();
+ //method
+ if (self::OSS_HTTP_GET !== $method && self::OSS_HTTP_PUT !== $method) {
+ throw new OssException("method is invalid");
+ }
+ // Should https or http be used?
+ $scheme = $this->useSSL ? 'https://' : 'http://';
+ // gets the host name. If the host name is public domain or private domain, form a third level domain by prefixing the bucket name on the domain name.
+ $hostname = $this->generateHostname($bucket);
+ $path = $this->generatePath($bucket, $object);
+ $headers = $this->generateHeaders($options, '');
+ $query_string = $this->generateQueryString($options);
+ $query_string = empty($query_string) ? '' : '?' . $query_string;
+ $requestUrl = $scheme . $hostname . $path . $query_string;
+ //Creates the request
+ $request = new RequestCore($requestUrl);
+ $request->set_method($method);
+ if (isset($options[self::OSS_CALLBACK])) {
+ $headers[self::OSS_CALLBACK] = base64_encode($options[self::OSS_CALLBACK]);
+ }
+ if (isset($options[self::OSS_CALLBACK_VAR])) {
+ $headers[self::OSS_CALLBACK_VAR] = base64_encode($options[self::OSS_CALLBACK_VAR]);
+ }
+ foreach ($headers as $header_key => $header_value) {
+ $header_value = trim($header_value);
+ if (empty($header_value)) {
+ continue;
+ }
+ $request->add_header($header_key, $header_value);
+ }
+ $signingOpt = array(
+ 'bucket' => $bucket,
+ 'key' => $object,
+ 'region' => $this->getRegion(),
+ 'product' => $this->getProduct(),
+ 'expiration' => $expiration,
+ );
+ $this->signer->presign($request, $cred, $signingOpt);
+ return $request->request_url;
+ }
+
+ /**
+ * validates options. Create a empty array if it's NULL.
+ *
+ * @param array $options
+ * @throws OssException
+ */
+ private function precheckOptions(&$options)
+ {
+ OssUtil::validateOptions($options);
+ if (!$options) {
+ $options = array();
+ }
+ }
+
+ /**
+ * Validates bucket parameter
+ *
+ * @param string $bucket
+ * @param string $errMsg
+ * @throws OssException
+ */
+ private function precheckBucket($bucket, $errMsg = 'bucket is not allowed empty')
+ {
+ OssUtil::throwOssExceptionWithMessageIfEmpty($bucket, $errMsg);
+ if (!OssUtil::validateBucket($bucket)) {
+ throw new OssException('"' . $bucket . '"' . 'bucket name is invalid');
+ }
+ }
+
+ /**
+ * validates object parameter
+ *
+ * @param string $object
+ * @throws OssException
+ */
+ private function precheckObject($object)
+ {
+ OssUtil::throwOssExceptionWithMessageIfEmpty($object, "object name is empty");
+ if (!OssUtil::validateObject($object)) {
+ throw new OssException('"' . $object . '"' . ' object name is invalid');
+ }
+ }
+
+ /**
+ * validates object name start with ? or not
+ * @param $object string
+ * @param $strict boolean
+ * @throws OssException
+ */
+ private function precheckObjectExt($object, $strict)
+ {
+ $this->precheckObject($object);
+ if ($strict) {
+ if (is_string($object) && $object[0] === "?") {
+ throw new OssException('"' . $object . '"' . ' object name cannot start with `?`');
+ }
+ }
+ }
+
+ /**
+ * Check option restore
+ *
+ * @param $storage string
+ * @throws OssException
+ */
+ private function precheckStorage($storage)
+ {
+ if (is_string($storage)) {
+ switch ($storage) {
+ case self::OSS_STORAGE_ARCHIVE:
+ return;
+ case self::OSS_STORAGE_IA:
+ return;
+ case self::OSS_STORAGE_STANDARD:
+ return;
+ case self::OSS_STORAGE_COLDARCHIVE:
+ return;
+ default:
+ break;
+ }
+ }
+ throw new OssException('storage name is invalid');
+ }
+
+ /**
+ * Validates bucket,options parameters and optionally validate object parameter.
+ *
+ * @param string $bucket
+ * @param string $object
+ * @param array $options
+ * @param bool $isCheckObject
+ */
+ private function precheckCommon($bucket, $object, &$options, $isCheckObject = true)
+ {
+ if ($isCheckObject) {
+ $this->precheckObject($object);
+ }
+ $this->precheckOptions($options);
+ $this->precheckBucket($bucket);
+ }
+
+ /**
+ * checks parameters
+ *
+ * @param array $options
+ * @param string $param
+ * @param string $funcName
+ * @throws OssException
+ */
+ private function precheckParam($options, $param, $funcName)
+ {
+ if (!isset($options[$param])) {
+ throw new OssException('The `' . $param . '` options is required in ' . $funcName . '().');
+ }
+ }
+
+ /**
+ * Checks md5
+ *
+ * @param array $options
+ * @return bool|null
+ */
+ private function isCheckMD5($options)
+ {
+ return $this->getValue($options, self::OSS_CHECK_MD5, false, true, true);
+ }
+
+ /**
+ * Gets value of the specified key from the options
+ *
+ * @param array $options
+ * @param string $key
+ * @param string $default
+ * @param bool $isCheckEmpty
+ * @param bool $isCheckBool
+ * @return bool|null
+ */
+ private function getValue($options, $key, $default = NULL, $isCheckEmpty = false, $isCheckBool = false)
+ {
+ $value = $default;
+ if (isset($options[$key])) {
+ if ($isCheckEmpty) {
+ if (!empty($options[$key])) {
+ $value = $options[$key];
+ }
+ } else {
+ $value = $options[$key];
+ }
+ unset($options[$key]);
+ }
+ if ($isCheckBool) {
+ if ($value !== true && $value !== false) {
+ $value = false;
+ }
+ }
+ return $value;
+ }
+
+ /**
+ * Gets mimetype
+ *
+ * @param string $object
+ * @return string
+ */
+ private function getMimeType($object, $file = null)
+ {
+ if (!is_null($file)) {
+ $type = MimeTypes::getMimetype($file);
+ if (!is_null($type)) {
+ return $type;
+ }
+ }
+
+ $type = MimeTypes::getMimetype($object);
+ if (!is_null($type)) {
+ return $type;
+ }
+
+ return self::DEFAULT_CONTENT_TYPE;
+ }
+
+ /**
+ * Validates and executes the request according to OSS API protocol.
+ *
+ * @param array $options
+ * @return ResponseCore|string
+ * @throws OssException
+ * @throws RequestCore_Exception
+ */
+ private function auth($options)
+ {
+ OssUtil::validateOptions($options);
+ //Object Encoding
+ $this->authPrecheckObjectEncoding($options);
+ //Validates ACL
+ $this->authPrecheckAcl($options);
+ $cred = $this->provider->getCredentials();
+ $this->checkCredentials($cred);
+
+ $bucket = isset($options[self::OSS_BUCKET]) ? $options[self::OSS_BUCKET] : '';
+ $object = isset($options[self::OSS_OBJECT]) ? $options[self::OSS_OBJECT] : '';
+
+ // Should https or http be used?
+ $scheme = $this->useSSL ? 'https://' : 'http://';
+ // gets the host name. If the host name is public domain or private domain, form a third level domain by prefixing the bucket name on the domain name.
+ $hostname = $this->generateHostname($bucket);
+ $path = $this->generatePath($bucket, $object);
+ $headers = $this->generateHeaders($options, $hostname);
+ $query_string = $this->generateQueryString($options);
+ $query_string = empty($query_string) ? '' : '?' . $query_string;
+ $requestUrl = $scheme . $hostname . $path . $query_string;
+
+ //Creates the request
+ $request = new RequestCore($requestUrl, $this->requestProxy);
+ $request->set_useragent($this->generateUserAgent());
+ // Streaming uploads
+ if (isset($options[self::OSS_FILE_UPLOAD])) {
+ if (is_resource($options[self::OSS_FILE_UPLOAD])) {
+ $length = null;
+
+ if (isset($options[self::OSS_CONTENT_LENGTH])) {
+ $length = $options[self::OSS_CONTENT_LENGTH];
+ } elseif (isset($options[self::OSS_SEEK_TO])) {
+ $stats = fstat($options[self::OSS_FILE_UPLOAD]);
+ if ($stats && $stats[self::OSS_SIZE] >= 0) {
+ $length = $stats[self::OSS_SIZE] - (integer)$options[self::OSS_SEEK_TO];
+ }
+ }
+ $request->set_read_stream($options[self::OSS_FILE_UPLOAD], $length);
+ } else {
+ $request->set_read_file($options[self::OSS_FILE_UPLOAD]);
+ $length = $request->read_stream_size;
+ if (isset($options[self::OSS_CONTENT_LENGTH])) {
+ $length = $options[self::OSS_CONTENT_LENGTH];
+ } elseif (isset($options[self::OSS_SEEK_TO]) && isset($length)) {
+ $length -= (integer)$options[self::OSS_SEEK_TO];
+ }
+ $request->set_read_stream_size($length);
+ }
+ }
+ if (isset($options[self::OSS_SEEK_TO])) {
+ $request->set_seek_position((integer)$options[self::OSS_SEEK_TO]);
+ }
+ if (isset($options[self::OSS_FILE_DOWNLOAD])) {
+ if (is_resource($options[self::OSS_FILE_DOWNLOAD])) {
+ $request->set_write_stream($options[self::OSS_FILE_DOWNLOAD]);
+ } else {
+ $request->set_write_file($options[self::OSS_FILE_DOWNLOAD]);
+ }
+ }
+ if (isset($options[self::OSS_METHOD])) {
+ $request->set_method($options[self::OSS_METHOD]);
+ }
+ if (isset($options[self::OSS_CONTENT])) {
+ $request->set_body($options[self::OSS_CONTENT]);
+ if (isset($headers[self::OSS_CONTENT_TYPE]) && $headers[self::OSS_CONTENT_TYPE] === 'application/x-www-form-urlencoded') {
+ $headers[self::OSS_CONTENT_TYPE] = 'application/octet-stream';
+ }
+
+ $headers[self::OSS_CONTENT_LENGTH] = strlen($options[self::OSS_CONTENT]);
+ $headers[self::OSS_CONTENT_MD5] = base64_encode(md5($options[self::OSS_CONTENT], true));
+ }
+
+ if (isset($options[self::OSS_CALLBACK])) {
+ $headers[self::OSS_CALLBACK] = base64_encode($options[self::OSS_CALLBACK]);
+ }
+ if (isset($options[self::OSS_CALLBACK_VAR])) {
+ $headers[self::OSS_CALLBACK_VAR] = base64_encode($options[self::OSS_CALLBACK_VAR]);
+ }
+
+ if (!isset($headers[self::OSS_ACCEPT_ENCODING])) {
+ $headers[self::OSS_ACCEPT_ENCODING] = '';
+ }
+
+ if (!isset($headers[self::OSS_CONTENT_TYPE])) {
+ $headers[self::OSS_CONTENT_TYPE] = self::DEFAULT_CONTENT_TYPE;
+ }
+
+ foreach ($headers as $header_key => $header_value) {
+ $header_value = trim($header_value);
+ if (empty($header_value)) {
+ continue;
+ }
+ $request->add_header($header_key, $header_value);
+ }
+
+ // sign request
+ $signingOpt = array(
+ 'bucket' => $bucket,
+ 'key' => $object,
+ 'region' => $this->getRegion(),
+ 'product' => $this->getProduct(),
+ );
+ if (isset($options[self::OSS_ADDITIONAL_HEADERS])) {
+ $signingOpt['additionalHeaders'] = $options[self::OSS_ADDITIONAL_HEADERS];
+ }
+
+ $this->signer->sign($request, $cred, $signingOpt);
+ $string_to_sign = isset($signingOpt['string_to_sign']) ? $signingOpt['string_to_sign'] : '';
+
+ if ($this->timeout !== 0) {
+ $request->timeout = $this->timeout;
+ }
+ if ($this->connectTimeout !== 0) {
+ $request->connect_timeout = $this->connectTimeout;
+ }
+
+ try {
+ $request->send_request();
+ } catch (RequestCore_Exception $e) {
+ throw(new OssException('RequestCoreException: ' . $e->getMessage()));
+ }
+ $response_header = $request->get_response_header();
+ $response_header['oss-request-url'] = $requestUrl;
+ $response_header['oss-redirects'] = $this->redirects;
+ $response_header['oss-stringtosign'] = $string_to_sign;
+ $response_header['oss-requestheaders'] = $request->request_headers;
+
+ $data = new ResponseCore($response_header, $request->get_response_body(), $request->get_response_code());
+ //retry if OSS Internal Error
+ if ((integer)$request->get_response_code() === 500) {
+ if ($this->redirects <= $this->maxRetries) {
+ //Sets the sleep time betwen each retry.
+ $delay = (integer)(pow(4, $this->redirects) * 100000);
+ usleep($delay);
+ $this->redirects++;
+ $data = $this->auth($options);
+ }
+ }
+
+ $this->redirects = 0;
+ return $data;
+ }
+
+ /**
+ * Sets the max retry count
+ *
+ * @param int $maxRetries
+ * @return void
+ */
+ public function setMaxTries($maxRetries = 3)
+ {
+ $this->maxRetries = $maxRetries;
+ }
+
+ /**
+ * Gets the max retry count
+ *
+ * @return int
+ */
+ public function getMaxRetries()
+ {
+ return $this->maxRetries;
+ }
+
+ /**
+ * Enaable/disable STS in the URL. This is to determine the $sts value passed from constructor take effect or not.
+ *
+ * @param boolean $enable
+ */
+ public function setSignStsInUrl($enable)
+ {
+ }
+
+ /**
+ * @return boolean
+ */
+ public function isUseSSL()
+ {
+ return $this->useSSL;
+ }
+
+ /**
+ * @param boolean $useSSL
+ */
+ public function setUseSSL($useSSL)
+ {
+ $this->useSSL = $useSSL;
+ }
+
+ /**
+ * Checks the object's encoding. Convert it to UTF8 if it's in GBK or GB2312
+ *
+ * @param mixed $options parameter
+ */
+ private function authPrecheckObjectEncoding(&$options)
+ {
+ if ($this->checkObjectEncoding !== true) {
+ return;
+ }
+
+ if (!isset($options[self::OSS_OBJECT])) {
+ return;
+ }
+
+ try {
+ $tmp_object = $options[self::OSS_OBJECT];
+ $encoding = array('UTF-8','GB2312', 'GBK');
+ $encode = mb_detect_encoding($tmp_object, $encoding);
+ if ($encode === 'UTF-8' || $encode === false) {
+ return;
+ }
+ $tmp_object = iconv($encode, "UTF-8", $tmp_object);
+ if ($tmp_object === false) {
+ return;
+ }
+ $options[self::OSS_OBJECT] = $tmp_object;
+ } catch (\Exception $e) {
+ //IGNORE
+ }
+ }
+
+ /**
+ * Checks if the ACL is one of the 3 predefined one. Throw OSSException if not.
+ *
+ * @param $options
+ * @throws OssException
+ */
+ private function authPrecheckAcl($options)
+ {
+ if (isset($options[self::OSS_HEADERS][self::OSS_ACL]) && !empty($options[self::OSS_HEADERS][self::OSS_ACL])) {
+ if (!in_array(strtolower($options[self::OSS_HEADERS][self::OSS_ACL]), self::$OSS_ACL_TYPES)) {
+ throw new OssException($options[self::OSS_HEADERS][self::OSS_ACL] . ':' . 'acl is invalid(private,public-read,public-read-write)');
+ }
+ }
+ }
+
+ /**
+ * Gets the host name for the current request.
+ * It could be either a third level domain (prefixed by bucket name) or second level domain if it's CName or IP
+ *
+ * @param $bucket
+ * @return string The host name without the protocol scheem (e.g. https://)
+ */
+ private function generateHostname($bucket)
+ {
+ if ($this->hostType === self::OSS_HOST_TYPE_IP || $this->hostType === self::OSS_HOST_TYPE_PATH_STYLE) {
+ $hostname = $this->hostname;
+ } elseif ($this->hostType === self::OSS_HOST_TYPE_CNAME) {
+ $hostname = $this->hostname;
+ } else {
+ // Private domain or public domain
+ $hostname = ($bucket == '') ? $this->hostname : ($bucket . '.') . $this->hostname;
+ }
+ return $hostname;
+ }
+
+ /**
+ * Gets the Uri path in the current request
+ *
+ * @param $bucket
+ * @param $object
+ * @return string return the resource uri.
+ */
+ private function generatePath($bucket, $object)
+ {
+ $paths = array();
+ // +bucket
+ if ('' !== $bucket) {
+ if ($this->hostType === self::OSS_HOST_TYPE_IP || $this->hostType === self::OSS_HOST_TYPE_PATH_STYLE) {
+ $paths[] = $bucket;
+ }
+ }
+ // + object
+ if ('' !== $object && '/' !== $object) {
+ $paths[] = str_replace(array('%2F'), array('/'), rawurlencode($object));
+ }
+ return '/' . implode('/', $paths);
+ }
+
+ /**
+ * generates query string
+ *
+ * @param mixed $options
+ * @return string
+ */
+ private function generateQueryString($options)
+ {
+ //query parameters
+ $query = array();
+ $queryList = array(
+ self::OSS_PART_NUM,
+ self::OSS_UPLOAD_ID,
+ self::OSS_COMP,
+ self::OSS_LIVE_CHANNEL_STATUS,
+ self::OSS_LIVE_CHANNEL_START_TIME,
+ self::OSS_LIVE_CHANNEL_END_TIME,
+ self::OSS_PROCESS,
+ self::OSS_POSITION,
+ self::OSS_SYMLINK,
+ self::OSS_RESTORE,
+ self::OSS_TAGGING,
+ self::OSS_WORM_ID,
+ self::OSS_TRAFFIC_LIMIT,
+ self::OSS_VERSION_ID,
+ self::OSS_CONTINUATION_TOKEN,
+ self::OSS_CNAME,
+ );
+ foreach ($queryList as $item) {
+ if (isset($options[$item])) {
+ $query[$item] = $options[$item];
+ }
+ }
+ if (isset($options[self::OSS_QUERY_STRING])) {
+ $query = array_merge($query, $options[self::OSS_QUERY_STRING]);
+ }
+ if (isset($options[self::OSS_SUB_RESOURCE])) {
+ $query[$options[self::OSS_SUB_RESOURCE]] = '';
+ }
+ return OssUtil::toQueryString($query);
+ }
+
+ /**
+ * Initialize headers
+ *
+ * @param mixed $options
+ * @param string $hostname hostname
+ * @return array
+ */
+ private function generateHeaders($options, $hostname)
+ {
+ $headers = array();
+
+ if (!empty($hostname)) {
+ $headers[self::OSS_HOST] = $hostname;
+ }
+
+ if (isset($options[self::OSS_CONTENT_TYPE])) {
+ $headers[self::OSS_CONTENT_TYPE] = $options[self::OSS_CONTENT_TYPE];
+ }
+
+ if (isset($options[self::OSS_DATE])) {
+ $headers[self::OSS_DATE] = $options[self::OSS_DATE];
+ }
+
+ if (isset($options[self::OSS_CONTENT_MD5])) {
+ $headers[self::OSS_CONTENT_MD5] = $options[self::OSS_CONTENT_MD5];
+ }
+
+ //Merge HTTP headers
+ if (isset($options[self::OSS_HEADERS])) {
+ $headers = array_merge($headers, $options[self::OSS_HEADERS]);
+ }
+ return $headers;
+ }
+
+ /**
+ * Generates UserAgent
+ *
+ * @return string
+ */
+ private function generateUserAgent()
+ {
+ return self::OSS_NAME . "/" . self::OSS_VERSION . " (" . php_uname('s') . "/" . php_uname('r') . "/" . php_uname('m') . ";" . PHP_VERSION . ")";
+ }
+
+ /**
+ * Checks endpoint type and returns the endpoint without the protocol schema.
+ * Figures out the domain's type (ip, cname or private/public domain).
+ *
+ * @param string $endpoint
+ * @param boolean $isCName
+ * @return string The domain name without the protocol schema.
+ * @throws OssException
+ */
+ private function checkEndpoint($endpoint, $isCName)
+ {
+ $ret_endpoint = null;
+ if (strpos($endpoint, 'http://') === 0) {
+ $ret_endpoint = substr($endpoint, strlen('http://'));
+ } elseif (strpos($endpoint, 'https://') === 0) {
+ $ret_endpoint = substr($endpoint, strlen('https://'));
+ $this->useSSL = true;
+ } else {
+ $ret_endpoint = $endpoint;
+ }
+
+ $ret_endpoint = OssUtil::getHostPortFromEndpoint($ret_endpoint);
+
+ if ($isCName) {
+ $this->hostType = self::OSS_HOST_TYPE_CNAME;
+ } elseif (OssUtil::isIPFormat($ret_endpoint)) {
+ $this->hostType = self::OSS_HOST_TYPE_IP;
+ } else {
+ $this->hostType = self::OSS_HOST_TYPE_NORMAL;
+ }
+ return $ret_endpoint;
+ }
+
+ /**
+ * @param Credentials $credential
+ * @throws OssException
+ */
+ private function checkCredentials($credential)
+ {
+ if (empty($credential)) {
+ throw new OssException("credentials is empty.");
+ }
+ if (strlen($credential->getAccessKeyId()) == 0) {
+ throw new OssException("access key id is empty");
+ }
+ if (strlen($credential->getAccessKeySecret()) == 0) {
+ throw new OssException("access key secret is empty");
+ }
+ }
+
+ /**
+ * For get Sign Product
+ * @return string
+ */
+ private function getProduct()
+ {
+ if (!empty($this->cloudBoxId)) {
+ return self::OSS_CLOUDBOX_PRODUCT;
+ }
+ return self::OSS_DEFAULT_PRODUCT;
+ }
+
+ /**
+ * For get Sign Region
+ * @return mixed
+ */
+ private function getRegion()
+ {
+ if (!empty($this->cloudBoxId)) {
+ return $this->cloudBoxId;
+ }
+ return $this->region;
+ }
+
+ /**
+ * Encodes the file path from UTF-8 to GBK.
+ *
+ * @param $filepath
+ * @return string
+ */
+ private function encodeFilePath($filepath)
+ {
+ if ($this->filePathCompatible !== true) {
+ return $filepath;
+ }
+
+ if (empty($filepath)) {
+ return $filepath;
+ }
+
+ try {
+ $encoding = array('UTF-8','GB2312', 'GBK');
+ $encode = mb_detect_encoding($filepath, $encoding);
+ if ($encode !== 'UTF-8') {
+ return $filepath;
+ }
+ $tmp = iconv($encode, 'GBK', $filepath);
+ if ($tmp !== false) {
+ $filepath = $tmp;
+ }
+ } catch (\Exception $e) {
+ //IGNORE
+ }
+ return $filepath;
+ }
+
+ /**
+ * Decodes the file path from GBK to UTF-8.
+ *
+ * @param $filepath
+ * @return string
+ */
+ private function decodeFilePath($filepath)
+ {
+ if ($this->filePathCompatible !== true) {
+ return $filepath;
+ }
+ if (empty($filepath)) {
+ return $filepath;
+ }
+
+ try {
+ $encoding = array('UTF-8','GB2312', 'GBK');
+ $encode = mb_detect_encoding($filepath, $encoding);
+ if ($encode === 'UTF-8' || $encode === false) {
+ return $filepath;
+ }
+ $tmp = iconv($encode, 'UTF-8', $filepath);
+ if ($tmp !== false) {
+ $filepath = $tmp;
+ }
+ } catch (\Exception $e) {
+ //IGNORE
+ }
+ return $filepath;
+ }
+
+ /**
+ * Check if all dependent extensions are installed correctly.
+ * For now only "curl" is needed.
+ * @throws OssException
+ */
+ public static function checkEnv()
+ {
+ if (function_exists('get_loaded_extensions')) {
+ //Test curl extension
+ $enabled_extension = array("curl");
+ $extensions = get_loaded_extensions();
+ if ($extensions) {
+ foreach ($enabled_extension as $item) {
+ if (!in_array($item, $extensions)) {
+ throw new OssException("Extension {" . $item . "} is not installed or not enabled, please check your php env.");
+ }
+ }
+ } else {
+ throw new OssException("function get_loaded_extensions not found.");
+ }
+ } else {
+ throw new OssException('Function get_loaded_extensions has been disabled, please check php config.');
+ }
+ }
+
+ /**
+ * Sets the http's timeout (in seconds)
+ *
+ * @param int $timeout
+ */
+ public function setTimeout($timeout)
+ {
+ $this->timeout = $timeout;
+ }
+
+ /**
+ * Sets the http's connection timeout (in seconds)
+ *
+ * @param int $connectTimeout
+ */
+ public function setConnectTimeout($connectTimeout)
+ {
+ $this->connectTimeout = $connectTimeout;
+ }
+
+ // Constants for Life cycle
+ const OSS_LIFECYCLE_EXPIRATION = "Expiration";
+ const OSS_LIFECYCLE_TIMING_DAYS = "Days";
+ const OSS_LIFECYCLE_TIMING_DATE = "Date";
+ //OSS Internal constants
+ const OSS_BUCKET = 'bucket';
+ const OSS_OBJECT = 'object';
+ const OSS_HEADERS = OssUtil::OSS_HEADERS;
+ const OSS_ADDITIONAL_HEADERS = 'additionalHeaders';
+ const OSS_METHOD = 'method';
+ const OSS_QUERY = 'query';
+ const OSS_BASENAME = 'basename';
+ const OSS_MAX_KEYS = 'max-keys';
+ const OSS_UPLOAD_ID = 'uploadId';
+ const OSS_PART_NUM = 'partNumber';
+ const OSS_COMP = 'comp';
+ const OSS_LIVE_CHANNEL_STATUS = 'status';
+ const OSS_LIVE_CHANNEL_START_TIME = 'startTime';
+ const OSS_LIVE_CHANNEL_END_TIME = 'endTime';
+ const OSS_POSITION = 'position';
+ const OSS_MAX_KEYS_VALUE = 100;
+ const OSS_MAX_OBJECT_GROUP_VALUE = OssUtil::OSS_MAX_OBJECT_GROUP_VALUE;
+ const OSS_MAX_PART_SIZE = OssUtil::OSS_MAX_PART_SIZE;
+ const OSS_MID_PART_SIZE = OssUtil::OSS_MID_PART_SIZE;
+ const OSS_MIN_PART_SIZE = OssUtil::OSS_MIN_PART_SIZE;
+ const OSS_FILE_SLICE_SIZE = 8192;
+ const OSS_PREFIX = 'prefix';
+ const OSS_DELIMITER = 'delimiter';
+ const OSS_MARKER = 'marker';
+ const OSS_FETCH_OWNER = 'fetch-owner';
+ const OSS_START_AFTER = 'start-after';
+ const OSS_CONTINUATION_TOKEN = 'continuation-token';
+ const OSS_ACCEPT_ENCODING = 'Accept-Encoding';
+ const OSS_CONTENT_MD5 = 'Content-Md5';
+ const OSS_SELF_CONTENT_MD5 = 'x-oss-meta-md5';
+ const OSS_CONTENT_TYPE = 'Content-Type';
+ const OSS_CONTENT_LENGTH = 'Content-Length';
+ const OSS_IF_MODIFIED_SINCE = 'If-Modified-Since';
+ const OSS_IF_UNMODIFIED_SINCE = 'If-Unmodified-Since';
+ const OSS_IF_MATCH = 'If-Match';
+ const OSS_IF_NONE_MATCH = 'If-None-Match';
+ const OSS_CACHE_CONTROL = 'Cache-Control';
+ const OSS_EXPIRES = 'Expires';
+
+ const OSS_CONTENT_COING = 'Content-Coding';
+ const OSS_CONTENT_DISPOSTION = 'Content-Disposition';
+ const OSS_RANGE = 'range';
+ const OSS_ETAG = 'etag';
+ const OSS_LAST_MODIFIED = 'lastmodified';
+ const OS_CONTENT_RANGE = 'Content-Range';
+ const OSS_CONTENT = OssUtil::OSS_CONTENT;
+ const OSS_BODY = 'body';
+ const OSS_LENGTH = OssUtil::OSS_LENGTH;
+ const OSS_HOST = 'Host';
+ const OSS_DATE = 'Date';
+ const OSS_AUTHORIZATION = 'Authorization';
+ const OSS_FILE_DOWNLOAD = 'fileDownload';
+ const OSS_FILE_UPLOAD = 'fileUpload';
+ const OSS_PART_SIZE = 'partSize';
+ const OSS_SEEK_TO = 'seekTo';
+ const OSS_SIZE = 'size';
+ const OSS_QUERY_STRING = 'query_string';
+ const OSS_SUB_RESOURCE = 'sub_resource';
+ const OSS_DEFAULT_PREFIX = 'x-oss-';
+ const OSS_CHECK_MD5 = 'checkmd5';
+ const OSS_CHECK_OBJECT = 'checkobject';
+ const DEFAULT_CONTENT_TYPE = 'application/octet-stream';
+ const OSS_SYMLINK_TARGET = 'x-oss-symlink-target';
+ const OSS_SYMLINK = 'symlink';
+ const OSS_HTTP_CODE = 'http_code';
+ const OSS_REQUEST_ID = 'x-oss-request-id';
+ const OSS_INFO = 'info';
+ const OSS_STORAGE = 'storage';
+ const OSS_RESTORE = 'restore';
+ const OSS_STORAGE_STANDARD = 'Standard';
+ const OSS_STORAGE_IA = 'IA';
+ const OSS_STORAGE_ARCHIVE = 'Archive';
+ const OSS_STORAGE_COLDARCHIVE = 'ColdArchive';
+ const OSS_TAGGING = 'tagging';
+ const OSS_WORM_ID = 'wormId';
+ const OSS_RESTORE_CONFIG = 'restore-config';
+ const OSS_KEY_MARKER = 'key-marker';
+ const OSS_VERSION_ID_MARKER = 'version-id-marker';
+ const OSS_VERSION_ID = 'versionId';
+ const OSS_HEADER_VERSION_ID = 'x-oss-version-id';
+ const OSS_CNAME = 'cname';
+
+ //private URLs
+ const OSS_URL_ACCESS_KEY_ID = 'OSSAccessKeyId';
+ const OSS_URL_EXPIRES = 'Expires';
+ const OSS_URL_SIGNATURE = 'Signature';
+ //HTTP METHOD
+ const OSS_HTTP_GET = 'GET';
+ const OSS_HTTP_PUT = 'PUT';
+ const OSS_HTTP_HEAD = 'HEAD';
+ const OSS_HTTP_POST = 'POST';
+ const OSS_HTTP_DELETE = 'DELETE';
+ const OSS_HTTP_OPTIONS = 'OPTIONS';
+ //Others
+ const OSS_ACL = 'x-oss-acl';
+ const OSS_OBJECT_ACL = 'x-oss-object-acl';
+ const OSS_OBJECT_GROUP = 'x-oss-file-group';
+ const OSS_MULTI_PART = 'uploads';
+ const OSS_MULTI_DELETE = 'delete';
+ const OSS_OBJECT_COPY_SOURCE = 'x-oss-copy-source';
+ const OSS_OBJECT_COPY_SOURCE_RANGE = "x-oss-copy-source-range";
+ const OSS_PROCESS = "x-oss-process";
+ const OSS_CALLBACK = "x-oss-callback";
+ const OSS_CALLBACK_VAR = "x-oss-callback-var";
+ const OSS_REQUEST_PAYER = "x-oss-request-payer";
+ const OSS_TRAFFIC_LIMIT = "x-oss-traffic-limit";
+ //Constants for STS SecurityToken
+ const OSS_SECURITY_TOKEN = "x-oss-security-token";
+ const OSS_ACL_TYPE_PRIVATE = 'private';
+ const OSS_ACL_TYPE_PUBLIC_READ = 'public-read';
+ const OSS_ACL_TYPE_PUBLIC_READ_WRITE = 'public-read-write';
+ const OSS_ENCODING_TYPE = "encoding-type";
+ const OSS_ENCODING_TYPE_URL = "url";
+
+ const OSS_LIST_TYPE = "list-type";
+
+ // Domain Types
+ const OSS_HOST_TYPE_NORMAL = "normal";//http://bucket.oss-cn-hangzhou.aliyuncs.com/object
+ const OSS_HOST_TYPE_IP = "ip"; //http://1.1.1.1/bucket/object
+ const OSS_HOST_TYPE_SPECIAL = 'special'; //http://bucket.guizhou.gov/object
+ const OSS_HOST_TYPE_CNAME = "cname"; //http://mydomain.com/object
+ const OSS_HOST_TYPE_PATH_STYLE = "path-style"; //http://oss-cn-hangzhou.aliyuncs.com/bucket/object
+ //OSS ACL array
+ static $OSS_ACL_TYPES = array(
+ self::OSS_ACL_TYPE_PRIVATE,
+ self::OSS_ACL_TYPE_PUBLIC_READ,
+ self::OSS_ACL_TYPE_PUBLIC_READ_WRITE
+ );
+ // OssClient version information
+ const OSS_NAME = "aliyun-sdk-php";
+ const OSS_VERSION = "2.7.1";
+ const OSS_BUILD = "20240228";
+ const OSS_AUTHOR = "";
+ const OSS_OPTIONS_ORIGIN = 'Origin';
+ const OSS_OPTIONS_REQUEST_METHOD = 'Access-Control-Request-Method';
+ const OSS_OPTIONS_REQUEST_HEADERS = 'Access-Control-Request-Headers';
+
+ // signatrue version information
+ const OSS_SIGNATURE_VERSION_V1 = "v1";
+ const OSS_SIGNATURE_VERSION_V4 = "v4";
+ const OSS_DEFAULT_PRODUCT = "oss";
+ const OSS_CLOUDBOX_PRODUCT = "oss-cloudbox";
+
+ //use ssl flag
+ private $useSSL = false;
+ private $maxRetries = 3;
+ private $redirects = 0;
+
+ // user's domain type. It could be one of the four: OSS_HOST_TYPE_NORMAL, OSS_HOST_TYPE_IP, OSS_HOST_TYPE_SPECIAL, OSS_HOST_TYPE_CNAME
+ private $hostType = self::OSS_HOST_TYPE_NORMAL;
+ private $requestProxy = null;
+ /**
+ * @var CredentialsProvider
+ */
+ private $provider;
+ private $hostname;
+ private $enableStrictObjName;
+ private $timeout = 0;
+ private $connectTimeout = 0;
+ private $cloudBoxId = null;
+ private $region = null;
+ /**
+ * @var SignerV1|SignerV4
+ */
+ private $signer;
+
+ private $checkObjectEncoding = false;
+
+ private $filePathCompatible;
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php
new file mode 100644
index 000000000..7061ff090
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php
@@ -0,0 +1,31 @@
+rawResponse->body;
+ if (empty($content)) {
+ throw new OssException("body is null");
+ }
+ $xml = simplexml_load_string($content);
+ if (isset($xml->AccessControlList->Grant)) {
+ return strval($xml->AccessControlList->Grant);
+ } else {
+ throw new OssException("xml format exception");
+ }
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AppendResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AppendResult.php
new file mode 100644
index 000000000..d898d585e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/AppendResult.php
@@ -0,0 +1,27 @@
+rawResponse->header;
+ if (isset($header["x-oss-next-append-position"])) {
+ return intval($header["x-oss-next-append-position"]);
+ }
+ throw new OssException("cannot get next-append-position");
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/BodyResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/BodyResult.php
new file mode 100644
index 000000000..44ba15ef5
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/BodyResult.php
@@ -0,0 +1,19 @@
+rawResponse->body) ? "" : $this->rawResponse->body;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CallbackResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CallbackResult.php
new file mode 100644
index 000000000..514e985c2
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CallbackResult.php
@@ -0,0 +1,21 @@
+rawResponse->status;
+ if ((int)(intval($status) / 100) == 2 && (int)(intval($status)) !== 203) {
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CopyObjectResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CopyObjectResult.php
new file mode 100644
index 000000000..6ed67c612
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CopyObjectResult.php
@@ -0,0 +1,30 @@
+rawResponse->body;
+ $xml = simplexml_load_string($body);
+ $result = array();
+
+ if (isset($xml->LastModified)) {
+ $result[] = $xml->LastModified;
+ }
+ if (isset($xml->ETag)) {
+ $result[] = $xml->ETag;
+ }
+
+ return array_merge($result, $this->rawResponse->header);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CreateBucketCnameTokenResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CreateBucketCnameTokenResult.php
new file mode 100644
index 000000000..a38ca0d51
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/CreateBucketCnameTokenResult.php
@@ -0,0 +1,19 @@
+rawResponse->body;
+ $info = new CnameTokenInfo();
+ $info->parseFromXml($content);
+ return $info;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectVersionsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectVersionsResult.php
new file mode 100644
index 000000000..69f52a735
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectVersionsResult.php
@@ -0,0 +1,39 @@
+rawResponse->body);
+ $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
+ return $this->parseDeletedList($xml, $encodingType);
+ }
+
+ private function parseDeletedList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->Deleted)) {
+ foreach ($xml->Deleted as $content) {
+ $key = isset($content->Key) ? strval($content->Key) : "";
+ $key = OssUtil::decodeKey($key, $encodingType);
+ $versionId = isset($content->VersionId) ? strval($content->VersionId) : "";
+ $deleteMarker = isset($content->DeleteMarker) ? strval($content->DeleteMarker) : "";
+ $deleteMarkerVersionId = isset($content->DeleteMarkerVersionId) ? strval($content->DeleteMarkerVersionId) : "";
+ $retList[] = new DeletedObjectInfo($key, $versionId, $deleteMarker, $deleteMarkerVersionId);
+ }
+ }
+ return $retList;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectsResult.php
new file mode 100644
index 000000000..dc373b854
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectsResult.php
@@ -0,0 +1,27 @@
+rawResponse->body;
+ $xml = simplexml_load_string($body);
+ $objects = array();
+
+ if (isset($xml->Deleted)) {
+ foreach($xml->Deleted as $deleteKey)
+ $objects[] = $deleteKey->Key;
+ }
+ return $objects;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ExistResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ExistResult.php
new file mode 100644
index 000000000..e9522d4f5
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ExistResult.php
@@ -0,0 +1,34 @@
+rawResponse->status) === 200 ? true : false;
+ }
+
+ /**
+ * 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
+ */
+ protected function isResponseOk()
+ {
+ $status = $this->rawResponse->status;
+ if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
+ return true;
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketCnameTokenResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketCnameTokenResult.php
new file mode 100644
index 000000000..b524d3fb8
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketCnameTokenResult.php
@@ -0,0 +1,19 @@
+rawResponse->body;
+ $info = new CnameTokenInfo();
+ $info->parseFromXml($content);
+ return $info;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketEncryptionResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketEncryptionResult.php
new file mode 100644
index 000000000..3987cc927
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketEncryptionResult.php
@@ -0,0 +1,26 @@
+rawResponse->body;
+ $config = new ServerSideEncryptionConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketInfoResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketInfoResult.php
new file mode 100644
index 000000000..d467851cb
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketInfoResult.php
@@ -0,0 +1,37 @@
+rawResponse->body;
+ if (empty($content)) {
+ throw new OssException("body is null");
+ }
+ $xml = simplexml_load_string($content);
+ if (isset($xml->Bucket)) {
+ $info = new BucketInfo();
+ $info->parseFromXmlNode($xml->Bucket);
+ return $info;
+ } else {
+ throw new OssException("xml format exception");
+ }
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketRequestPaymentResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketRequestPaymentResult.php
new file mode 100644
index 000000000..5107de3f6
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketRequestPaymentResult.php
@@ -0,0 +1,26 @@
+rawResponse->body;
+ $config = new RequestPaymentConfig();
+ $config->parseFromXml($content);
+ return $config->getPayer();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketStatResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketStatResult.php
new file mode 100644
index 000000000..aa310cf1f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketStatResult.php
@@ -0,0 +1,26 @@
+rawResponse->body;
+ $stat = new BucketStat();
+ $stat->parseFromXml($content);
+ return $stat;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketTagsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketTagsResult.php
new file mode 100644
index 000000000..59b4dd790
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketTagsResult.php
@@ -0,0 +1,26 @@
+rawResponse->body;
+ $config = new TaggingConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketTransferAccelerationResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketTransferAccelerationResult.php
new file mode 100644
index 000000000..a300d625e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketTransferAccelerationResult.php
@@ -0,0 +1,22 @@
+rawResponse->body;
+ $config = new TransferAccelerationConfig();
+ $config->parseFromXml($content);
+ return $config->getEnabled();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketVersioningResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketVersioningResult.php
new file mode 100644
index 000000000..225190c21
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketVersioningResult.php
@@ -0,0 +1,26 @@
+rawResponse->body;
+ $config = new VersioningConfig();
+ $config->parseFromXml($content);
+ return $config->getStatus();
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketWormResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketWormResult.php
new file mode 100644
index 000000000..958720417
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketWormResult.php
@@ -0,0 +1,26 @@
+rawResponse->body;
+ $config = new WormConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCnameResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCnameResult.php
new file mode 100644
index 000000000..eed01f902
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCnameResult.php
@@ -0,0 +1,19 @@
+rawResponse->body;
+ $config = new CnameConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCorsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCorsResult.php
new file mode 100644
index 000000000..8fb10ea33
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetCorsResult.php
@@ -0,0 +1,34 @@
+rawResponse->body;
+ $config = new CorsConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+
+ /**
+ * 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
+ */
+ protected function isResponseOk()
+ {
+ $status = $this->rawResponse->status;
+ if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
+ return true;
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLifecycleResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLifecycleResult.php
new file mode 100644
index 000000000..e0a9595f2
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLifecycleResult.php
@@ -0,0 +1,41 @@
+rawResponse->body;
+ $config = new LifecycleConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+
+ /**
+ * 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
+ */
+ protected function isResponseOk()
+ {
+ $status = $this->rawResponse->status;
+ if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php
new file mode 100644
index 000000000..5d5bc927d
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php
@@ -0,0 +1,19 @@
+rawResponse->body;
+ $channelList = new GetLiveChannelHistory();
+ $channelList->parseFromXml($content);
+ return $channelList;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php
new file mode 100644
index 000000000..cefe460ab
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php
@@ -0,0 +1,19 @@
+rawResponse->body;
+ $channelList = new GetLiveChannelInfo();
+ $channelList->parseFromXml($content);
+ return $channelList;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelStatusResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelStatusResult.php
new file mode 100644
index 000000000..6b8a60f59
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelStatusResult.php
@@ -0,0 +1,19 @@
+rawResponse->body;
+ $channelList = new GetLiveChannelStatus();
+ $channelList->parseFromXml($content);
+ return $channelList;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLocationResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLocationResult.php
new file mode 100644
index 000000000..a0c512957
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLocationResult.php
@@ -0,0 +1,30 @@
+rawResponse->body;
+ if (empty($content)) {
+ throw new OssException("body is null");
+ }
+ $xml = simplexml_load_string($content);
+ return $xml;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLoggingResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLoggingResult.php
new file mode 100644
index 000000000..eab8c645f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLoggingResult.php
@@ -0,0 +1,41 @@
+rawResponse->body;
+ $config = new LoggingConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+
+ /**
+ * 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
+ */
+ protected function isResponseOk()
+ {
+ $status = $this->rawResponse->status;
+ if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetRefererResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetRefererResult.php
new file mode 100644
index 000000000..a8a649ebd
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetRefererResult.php
@@ -0,0 +1,41 @@
+rawResponse->body;
+ $config = new RefererConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+
+ /**
+ * 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
+ */
+ protected function isResponseOk()
+ {
+ $status = $this->rawResponse->status;
+ if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetStorageCapacityResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetStorageCapacityResult.php
new file mode 100644
index 000000000..2f4127b19
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetStorageCapacityResult.php
@@ -0,0 +1,34 @@
+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");
+ }
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetWebsiteResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetWebsiteResult.php
new file mode 100644
index 000000000..64d54facb
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetWebsiteResult.php
@@ -0,0 +1,40 @@
+rawResponse->body;
+ $config = new WebsiteConfig();
+ $config->parseFromXml($content);
+ return $config;
+ }
+
+ /**
+ * 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
+ */
+ protected function isResponseOk()
+ {
+ $status = $this->rawResponse->status;
+ if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/HeaderResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/HeaderResult.php
new file mode 100644
index 000000000..1ca4d1a28
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/HeaderResult.php
@@ -0,0 +1,23 @@
+rawResponse->header) ? array() : $this->rawResponse->header;
+ }
+
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateBucketWormResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateBucketWormResult.php
new file mode 100644
index 000000000..1cd7a0200
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateBucketWormResult.php
@@ -0,0 +1,27 @@
+rawResponse->header;
+ if (isset($header["x-oss-worm-id"])) {
+ return strval($header["x-oss-worm-id"]);
+ }
+ throw new OssException("cannot get worm-id");
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateMultipartUploadResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateMultipartUploadResult.php
new file mode 100644
index 000000000..53a15da86
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateMultipartUploadResult.php
@@ -0,0 +1,29 @@
+rawResponse->body;
+ $xml = simplexml_load_string($content);
+ if (isset($xml->UploadId)) {
+ return strval($xml->UploadId);
+ }
+ throw new OssException("cannot get UploadId");
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListBucketsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListBucketsResult.php
new file mode 100644
index 000000000..1dd037b70
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListBucketsResult.php
@@ -0,0 +1,32 @@
+rawResponse->body;
+ $xml = new \SimpleXMLElement($content);
+ if (isset($xml->Buckets) && isset($xml->Buckets->Bucket)) {
+ foreach ($xml->Buckets->Bucket as $bucket) {
+ $bucketInfo = new BucketInfo();
+ $bucketInfo->parseFromXmlNode($bucket);
+ $bucketList[] = $bucketInfo;
+ }
+ }
+ return new BucketListInfo($bucketList);
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListLiveChannelResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListLiveChannelResult.php
new file mode 100644
index 000000000..1a6e2a41f
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListLiveChannelResult.php
@@ -0,0 +1,16 @@
+rawResponse->body;
+ $channelList = new LiveChannelListInfo();
+ $channelList->parseFromXml($content);
+ return $channelList;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListMultipartUploadResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListMultipartUploadResult.php
new file mode 100644
index 000000000..3220c8616
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListMultipartUploadResult.php
@@ -0,0 +1,55 @@
+rawResponse->body;
+ $xml = simplexml_load_string($content);
+
+ $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
+ $bucket = isset($xml->Bucket) ? strval($xml->Bucket) : "";
+ $keyMarker = isset($xml->KeyMarker) ? strval($xml->KeyMarker) : "";
+ $keyMarker = OssUtil::decodeKey($keyMarker, $encodingType);
+ $uploadIdMarker = isset($xml->UploadIdMarker) ? strval($xml->UploadIdMarker) : "";
+ $nextKeyMarker = isset($xml->NextKeyMarker) ? strval($xml->NextKeyMarker) : "";
+ $nextKeyMarker = OssUtil::decodeKey($nextKeyMarker, $encodingType);
+ $nextUploadIdMarker = isset($xml->NextUploadIdMarker) ? strval($xml->NextUploadIdMarker) : "";
+ $delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
+ $delimiter = OssUtil::decodeKey($delimiter, $encodingType);
+ $prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
+ $prefix = OssUtil::decodeKey($prefix, $encodingType);
+ $maxUploads = isset($xml->MaxUploads) ? intval($xml->MaxUploads) : 0;
+ $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
+ $listUpload = array();
+
+ if (isset($xml->Upload)) {
+ foreach ($xml->Upload as $upload) {
+ $key = isset($upload->Key) ? strval($upload->Key) : "";
+ $key = OssUtil::decodeKey($key, $encodingType);
+ $uploadId = isset($upload->UploadId) ? strval($upload->UploadId) : "";
+ $initiated = isset($upload->Initiated) ? strval($upload->Initiated) : "";
+ $listUpload[] = new UploadInfo($key, $uploadId, $initiated);
+ }
+ }
+ return new ListMultipartUploadInfo($bucket, $keyMarker, $uploadIdMarker,
+ $nextKeyMarker, $nextUploadIdMarker,
+ $delimiter, $prefix, $maxUploads, $isTruncated, $listUpload);
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectVersionsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectVersionsResult.php
new file mode 100644
index 000000000..4503c03d0
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectVersionsResult.php
@@ -0,0 +1,98 @@
+rawResponse->body);
+ $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
+ $objectVersionList = $this->parseObjecVersionList($xml, $encodingType);
+ $deleteMarkerList = $this->parseDeleteMarkerList($xml, $encodingType);
+ $prefixList = $this->parsePrefixList($xml, $encodingType);
+ $bucketName = isset($xml->Name) ? strval($xml->Name) : "";
+ $prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
+ $prefix = OssUtil::decodeKey($prefix, $encodingType);
+ $keyMarker = isset($xml->KeyMarker) ? strval($xml->KeyMarker) : "";
+ $keyMarker = OssUtil::decodeKey($keyMarker, $encodingType);
+ $nextKeyMarker = isset($xml->NextKeyMarker) ? strval($xml->NextKeyMarker) : "";
+ $nextKeyMarker = OssUtil::decodeKey($nextKeyMarker, $encodingType);
+ $versionIdMarker = isset($xml->VersionIdMarker) ? strval($xml->VersionIdMarker) : "";
+ $nextVersionIdMarker = isset($xml->NextVersionIdMarker) ? strval($xml->NextVersionIdMarker) : "";
+ $maxKeys = isset($xml->MaxKeys) ? intval($xml->MaxKeys) : 0;
+ $delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
+ $delimiter = OssUtil::decodeKey($delimiter, $encodingType);
+ $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
+
+ return new ObjectVersionListInfo($bucketName, $prefix, $keyMarker, $nextKeyMarker,
+ $versionIdMarker, $nextVersionIdMarker, $maxKeys, $delimiter, $isTruncated,
+ $objectVersionList, $deleteMarkerList, $prefixList);
+ }
+
+ private function parseObjecVersionList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->Version)) {
+ foreach ($xml->Version as $content) {
+ $key = isset($content->Key) ? strval($content->Key) : "";
+ $key = OssUtil::decodeKey($key, $encodingType);
+ $versionId = isset($content->VersionId) ? strval($content->VersionId) : "";
+ $lastModified = isset($content->LastModified) ? strval($content->LastModified) : "";
+ $eTag = isset($content->ETag) ? strval($content->ETag) : "";
+ $type = isset($content->Type) ? strval($content->Type) : "";
+ $size = isset($content->Size) ? strval($content->Size) : "0";
+ $storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
+ $isLatest = isset($content->IsLatest) ? strval($content->IsLatest) : "";
+ $retList[] = new ObjectVersionInfo($key, $versionId, $lastModified, $eTag, $type, $size, $storageClass, $isLatest);
+ }
+ }
+ return $retList;
+ }
+
+ private function parseDeleteMarkerList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->DeleteMarker)) {
+ foreach ($xml->DeleteMarker as $content) {
+ $key = isset($content->Key) ? strval($content->Key) : "";
+ $key = OssUtil::decodeKey($key, $encodingType);
+ $versionId = isset($content->VersionId) ? strval($content->VersionId) : "";
+ $lastModified = isset($content->LastModified) ? strval($content->LastModified) : "";
+ $isLatest = isset($content->IsLatest) ? strval($content->IsLatest) : "";
+ $retList[] = new DeleteMarkerInfo($key, $versionId, $lastModified, $isLatest);
+ }
+ }
+ return $retList;
+ }
+
+ private function parsePrefixList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->CommonPrefixes)) {
+ foreach ($xml->CommonPrefixes as $commonPrefix) {
+ $prefix = isset($commonPrefix->Prefix) ? strval($commonPrefix->Prefix) : "";
+ $prefix = OssUtil::decodeKey($prefix, $encodingType);
+ $retList[] = new PrefixInfo($prefix);
+ }
+ }
+ return $retList;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php
new file mode 100644
index 000000000..124617457
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php
@@ -0,0 +1,80 @@
+rawResponse->body);
+ $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
+ $objectList = $this->parseObjectList($xml, $encodingType);
+ $prefixList = $this->parsePrefixList($xml, $encodingType);
+ $bucketName = isset($xml->Name) ? strval($xml->Name) : "";
+ $prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
+ $prefix = OssUtil::decodeKey($prefix, $encodingType);
+ $marker = isset($xml->Marker) ? strval($xml->Marker) : "";
+ $marker = OssUtil::decodeKey($marker, $encodingType);
+ $maxKeys = isset($xml->MaxKeys) ? intval($xml->MaxKeys) : 0;
+ $delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
+ $delimiter = OssUtil::decodeKey($delimiter, $encodingType);
+ $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
+ $nextMarker = isset($xml->NextMarker) ? strval($xml->NextMarker) : "";
+ $nextMarker = OssUtil::decodeKey($nextMarker, $encodingType);
+ return new ObjectListInfo($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, $objectList, $prefixList);
+ }
+
+ private function parseObjectList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->Contents)) {
+ foreach ($xml->Contents as $content) {
+ $key = isset($content->Key) ? strval($content->Key) : "";
+ $key = OssUtil::decodeKey($key, $encodingType);
+ $lastModified = isset($content->LastModified) ? strval($content->LastModified) : "";
+ $eTag = isset($content->ETag) ? strval($content->ETag) : "";
+ $type = isset($content->Type) ? strval($content->Type) : "";
+ $size = isset($content->Size) ? strval($content->Size) : "0";
+ $storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
+ if(isset($content->Owner)){
+ $owner = new Owner(strval($content->Owner->ID),strval($content->Owner->DisplayName));
+ }else{
+ $owner = null;
+ }
+ $restoreInfo= isset($content->RestoreInfo) ? strval($content->RestoreInfo) : null;
+ $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass,$owner,$restoreInfo);
+ }
+ }
+ return $retList;
+ }
+
+ private function parsePrefixList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->CommonPrefixes)) {
+ foreach ($xml->CommonPrefixes as $commonPrefix) {
+ $prefix = isset($commonPrefix->Prefix) ? strval($commonPrefix->Prefix) : "";
+ $prefix = OssUtil::decodeKey($prefix, $encodingType);
+ $retList[] = new PrefixInfo($prefix);
+ }
+ }
+ return $retList;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsV2Result.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsV2Result.php
new file mode 100644
index 000000000..8293767d8
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsV2Result.php
@@ -0,0 +1,81 @@
+rawResponse->body);
+ $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
+ $objectList = $this->parseObjectList($xml, $encodingType);
+ $prefixList = $this->parsePrefixList($xml, $encodingType);
+ $bucketName = isset($xml->Name) ? strval($xml->Name) : "";
+ $prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
+ $prefix = OssUtil::decodeKey($prefix, $encodingType);
+ $maxKeys = isset($xml->MaxKeys) ? intval($xml->MaxKeys) : 0;
+ $delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
+ $delimiter = OssUtil::decodeKey($delimiter, $encodingType);
+ $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
+ $continuationToken = isset($xml->ContinuationToken) ? strval($xml->ContinuationToken) : "";
+ $nextContinuationToken = isset($xml->NextContinuationToken) ? strval($xml->NextContinuationToken) : "";
+ $startAfter = isset($xml->StartAfter) ? strval($xml->StartAfter) : "";
+ $startAfter = OssUtil::decodeKey($startAfter, $encodingType);
+ $keyCount = isset($xml->KeyCount) ? intval($xml->KeyCount) : 0;
+ return new ObjectListInfoV2($bucketName, $prefix, $maxKeys, $delimiter, $isTruncated, $objectList, $prefixList, $continuationToken, $nextContinuationToken, $startAfter, $keyCount);
+ }
+
+ private function parseObjectList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->Contents)) {
+ foreach ($xml->Contents as $content) {
+ $key = isset($content->Key) ? strval($content->Key) : "";
+ $key = OssUtil::decodeKey($key, $encodingType);
+ $lastModified = isset($content->LastModified) ? strval($content->LastModified) : "";
+ $eTag = isset($content->ETag) ? strval($content->ETag) : "";
+ $type = isset($content->Type) ? strval($content->Type) : "";
+ $size = isset($content->Size) ? strval($content->Size) : "0";
+ $storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
+ if(isset($content->Owner)){
+ $owner = new Owner(strval($content->Owner->ID),strval($content->Owner->DisplayName));
+ }else{
+ $owner = null;
+ }
+ $restoreInfo= isset($content->RestoreInfo) ? strval($content->RestoreInfo) : null;
+ $retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass,$owner,$restoreInfo);
+ }
+ }
+ return $retList;
+ }
+
+ private function parsePrefixList($xml, $encodingType)
+ {
+ $retList = array();
+ if (isset($xml->CommonPrefixes)) {
+ foreach ($xml->CommonPrefixes as $commonPrefix) {
+ $prefix = isset($commonPrefix->Prefix) ? strval($commonPrefix->Prefix) : "";
+ $prefix = OssUtil::decodeKey($prefix, $encodingType);
+ $retList[] = new PrefixInfo($prefix);
+ }
+ }
+ return $retList;
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListPartsResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListPartsResult.php
new file mode 100644
index 000000000..6641b5bb1
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/ListPartsResult.php
@@ -0,0 +1,42 @@
+rawResponse->body;
+ $xml = simplexml_load_string($content);
+ $bucket = isset($xml->Bucket) ? strval($xml->Bucket) : "";
+ $key = isset($xml->Key) ? strval($xml->Key) : "";
+ $uploadId = isset($xml->UploadId) ? strval($xml->UploadId) : "";
+ $nextPartNumberMarker = isset($xml->NextPartNumberMarker) ? intval($xml->NextPartNumberMarker) : "";
+ $maxParts = isset($xml->MaxParts) ? intval($xml->MaxParts) : "";
+ $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
+ $partList = array();
+ if (isset($xml->Part)) {
+ foreach ($xml->Part as $part) {
+ $partNumber = isset($part->PartNumber) ? intval($part->PartNumber) : "";
+ $lastModified = isset($part->LastModified) ? strval($part->LastModified) : "";
+ $eTag = isset($part->ETag) ? strval($part->ETag) : "";
+ $size = isset($part->Size) ? strval($part->Size) : "";
+ $partList[] = new PartInfo($partNumber, $lastModified, $eTag, $size);
+ }
+ }
+ return new ListPartsInfo($bucket, $key, $uploadId, $nextPartNumberMarker, $maxParts, $isTruncated, $partList);
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutLiveChannelResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutLiveChannelResult.php
new file mode 100644
index 000000000..dcac86b78
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutLiveChannelResult.php
@@ -0,0 +1,16 @@
+rawResponse->body;
+ $channel = new LiveChannelInfo();
+ $channel->parseFromXml($content);
+ return $channel;
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutSetDeleteResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutSetDeleteResult.php
new file mode 100644
index 000000000..97af003b6
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/PutSetDeleteResult.php
@@ -0,0 +1,20 @@
+ $this->rawResponse->body);
+ return array_merge($this->rawResponse->header, $body);
+ }
+}
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php
new file mode 100644
index 000000000..597ac5a6b
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php
@@ -0,0 +1,213 @@
+rawResponse = $response;
+ $this->parseResponse();
+ }
+
+ /**
+ * Get requestId
+ *
+ * @return string
+ */
+ public function getRequestId()
+ {
+ if (isset($this->rawResponse) &&
+ isset($this->rawResponse->header) &&
+ isset($this->rawResponse->header['x-oss-request-id'])
+ ) {
+ return $this->rawResponse->header['x-oss-request-id'];
+ } else {
+ return '';
+ }
+ }
+
+ /**
+ * Get the returned data, different request returns the data format is different
+ *
+ * $return mixed
+ */
+ public function getData()
+ {
+ return $this->parsedData;
+ }
+
+ /**
+ * 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
+ */
+ public function isOK()
+ {
+ return $this->isOk;
+ }
+
+ /**
+ * @throws OssException
+ */
+ public function parseResponse()
+ {
+ $this->isOk = $this->isResponseOk();
+ if ($this->isOk) {
+ $this->parsedData = $this->parseDataFromResponse();
+ } else {
+ $httpStatus = strval($this->rawResponse->status);
+ $requestId = strval($this->getRequestId());
+ $code = $this->retrieveErrorCode($this->rawResponse->body);
+ $message = $this->retrieveErrorMessage($this->rawResponse->body);
+ $body = $this->rawResponse->body;
+
+ $details = array(
+ 'status' => $httpStatus,
+ 'request-id' => $requestId,
+ 'code' => $code,
+ 'message' => $message,
+ 'body' => $body
+ );
+ throw new OssException($details);
+ }
+ }
+
+ /**
+ * Try to get the error message from body
+ *
+ * @param $body
+ * @return string
+ */
+ private function retrieveErrorMessage($body)
+ {
+ if (empty($body) || false === strpos($body, 'Message)) {
+ return strval($xml->Message);
+ }
+ $flag = true;
+ } catch (\Exception $e) {
+ $flag = true;
+ }
+ if ($flag === true) {
+ $start = strpos($body, '');
+ if ($start === false) {
+ return '';
+ }
+ $start += 9;
+ $end = strpos($body, '', $start);
+ if ($end === false) {
+ return '';
+ }
+ return substr($body, $start, $end - $start);
+ }
+
+ return '';
+ }
+
+ /**
+ * Try to get the error Code from body
+ *
+ * @param $body
+ * @return string
+ */
+ private function retrieveErrorCode($body)
+ {
+ if (empty($body) || false === strpos($body, 'Code)) {
+ return strval($xml->Code);
+ }
+ $flag = true;
+ } catch (\Exception $e) {
+ $flag = true;
+ }
+ if ($flag === true) {
+ $start = strpos($body, '');
+ if ($start === false) {
+ return '';
+ }
+ $start += 6;
+ $end = strpos($body, '', $start);
+ if ($end === false) {
+ return '';
+ }
+ return substr($body, $start, $end - $start);
+ }
+
+ return '';
+ }
+
+ /**
+ * Judging from the return http status code, [200-299] that is OK
+ *
+ * @return bool
+ */
+ protected function isResponseOk()
+ {
+ $status = $this->rawResponse->status;
+ if ((int)(intval($status) / 100) == 2) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Return the original return data
+ *
+ * @return ResponseCore
+ */
+ public function getRawResponse()
+ {
+ return $this->rawResponse;
+ }
+
+ /**
+ * Indicate whether the request is successful
+ */
+ protected $isOk = false;
+ /**
+ * Data parsed by subclasses
+ */
+ protected $parsedData = null;
+ /**
+ * Store the original Response returned by the auth function
+ *
+ * @var ResponseCore
+ */
+ protected $rawResponse;
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/SymlinkResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/SymlinkResult.php
new file mode 100644
index 000000000..9c6d861a6
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/SymlinkResult.php
@@ -0,0 +1,24 @@
+rawResponse->header[OssClient::OSS_SYMLINK_TARGET] = rawurldecode($this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET]);
+ return $this->rawResponse->header;
+ }
+}
+
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/UploadPartResult.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/UploadPartResult.php
new file mode 100644
index 000000000..c6b66d454
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/UploadPartResult.php
@@ -0,0 +1,28 @@
+rawResponse->header;
+ if (isset($header["etag"])) {
+ return $header["etag"];
+ }
+ throw new OssException("cannot get ETag");
+
+ }
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Signer/SignerInterface.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Signer/SignerInterface.php
new file mode 100644
index 000000000..c592a4f8e
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Signer/SignerInterface.php
@@ -0,0 +1,12 @@
+request_headers['Date'])) {
+ $request->add_header('Date', gmdate('D, d M Y H:i:s \G\M\T'));
+ }
+ // Credentials information
+ if (!empty($credentials->getSecurityToken())) {
+ $request->add_header("x-oss-security-token", $credentials->getSecurityToken());
+ }
+ $headers = $request->request_headers;
+ $method = strtoupper($request->method);
+ $date = $headers['Date'];
+ $resourcePath = $this->getResourcePath($options);
+ $queryString = parse_url($request->request_url, PHP_URL_QUERY);
+ $query = array();
+ if ($queryString !== null) {
+ parse_str($queryString, $query);
+ }
+ $stringToSign = $this->calcStringToSign($method, $date, $headers, $resourcePath, $query);
+// printf("sign str:%s" . PHP_EOL, $stringToSign);
+ $options['string_to_sign'] = $stringToSign;
+ $signature = base64_encode(hash_hmac('sha1', $stringToSign, $credentials->getAccessKeySecret(), true));
+ $request->add_header('Authorization', 'OSS ' . $credentials->getAccessKeyId() . ':' . $signature);
+ }
+
+ public function presign(RequestCore $request, Credentials $credentials, array &$options)
+ {
+ $headers = $request->request_headers;
+ // Date
+ $expiration = $options['expiration'];
+ if (!isset($request->request_headers['Date'])) {
+ $request->add_header('Date', gmdate('D, d M Y H:i:s \G\M\T'));
+ }
+ $parsed_url = parse_url($request->request_url);
+ $queryString = isset($parsed_url['query']) ? $parsed_url['query'] : '';
+ $query = array();
+ if ($queryString !== null) {
+ parse_str($queryString, $query);
+ }
+ // Credentials information
+ if (!empty($credentials->getSecurityToken())) {
+ $query["security-token"] = $credentials->getSecurityToken();
+ }
+ $method = strtoupper($request->method);
+ $date = $expiration . "";
+ $resourcePath = $this->getResourcePath($options);
+ $stringToSign = $this->calcStringToSign($method, $date, $headers, $resourcePath, $query);
+ $options['string_to_sign'] = $stringToSign;
+ $signature = base64_encode(hash_hmac('sha1', $stringToSign, $credentials->getAccessKeySecret(), true));
+ $query['OSSAccessKeyId'] = $credentials->getAccessKeyId();
+ $query['Expires'] = $date;
+ $query['Signature'] = $signature;
+ $queryString = OssUtil::toQueryString($query);
+ $parsed_url['query'] = $queryString;
+ $request->request_url = OssUtil::unparseUrl($parsed_url);
+ }
+
+ private function getResourcePath(array $options)
+ {
+ $resourcePath = '/';
+ if (strlen($options['bucket']) > 0) {
+ $resourcePath .= $options['bucket'] . '/';
+ }
+ if (strlen($options['key']) > 0) {
+ $resourcePath .= $options['key'];
+ }
+ return $resourcePath;
+ }
+
+ private function calcStringToSign($method, $date, array $headers, $resourcePath, array $query)
+ {
+ /*
+ SignToString =
+ VERB + "\n"
+ + Content-MD5 + "\n"
+ + Content-Type + "\n"
+ + Date + "\n"
+ + CanonicalizedOSSHeaders
+ + CanonicalizedResource
+ Signature = base64(hmac-sha1(AccessKeySecret, SignToString))
+ */
+ $contentMd5 = '';
+ $contentType = '';
+ // CanonicalizedOSSHeaders
+ $signheaders = array();
+ foreach ($headers as $key => $value) {
+ $lowk = strtolower($key);
+ if (strncmp($lowk, "x-oss-", 6) == 0) {
+ $signheaders[$lowk] = $value;
+ } else if ($lowk === 'content-md5') {
+ $contentMd5 = $value;
+ } else if ($lowk === 'content-type') {
+ $contentType = $value;
+ }
+ }
+ ksort($signheaders);
+ $canonicalizedOSSHeaders = '';
+ foreach ($signheaders as $key => $value) {
+ $canonicalizedOSSHeaders .= $key . ':' . $value . "\n";
+ }
+ // CanonicalizedResource
+ $signquery = array();
+ foreach ($query as $key => $value) {
+ if (in_array($key, $this->signKeyList)) {
+ $signquery[$key] = $value;
+ }
+ }
+ ksort($signquery);
+ $sortedQueryList = array();
+ foreach ($signquery as $key => $value) {
+ if (strlen($value) > 0) {
+ $sortedQueryList[] = $key . '=' . $value;
+ } else {
+ $sortedQueryList[] = $key;
+ }
+ }
+ $queryStringSorted = implode('&', $sortedQueryList);
+ $canonicalizedResource = $resourcePath;
+ if (!empty($queryStringSorted)) {
+ $canonicalizedResource .= '?' . $queryStringSorted;
+ }
+ return $method . "\n" . $contentMd5 . "\n" . $contentType . "\n" . $date . "\n" . $canonicalizedOSSHeaders . $canonicalizedResource;
+ }
+
+ private $signKeyList = array(
+ "acl", "uploads", "location", "cors",
+ "logging", "website", "referer", "lifecycle",
+ "delete", "append", "tagging", "objectMeta",
+ "uploadId", "partNumber", "security-token", "x-oss-security-token",
+ "position", "img", "style", "styleName",
+ "replication", "replicationProgress",
+ "replicationLocation", "cname", "bucketInfo",
+ "comp", "qos", "live", "status", "vod",
+ "startTime", "endTime", "symlink",
+ "x-oss-process", "response-content-type", "x-oss-traffic-limit",
+ "response-content-language", "response-expires",
+ "response-cache-control", "response-content-disposition",
+ "response-content-encoding", "udf", "udfName", "udfImage",
+ "udfId", "udfImageDesc", "udfApplication",
+ "udfApplicationLog", "restore", "callback", "callback-var", "qosInfo",
+ "policy", "stat", "encryption", "versions", "versioning", "versionId", "requestPayment",
+ "x-oss-request-payer", "sequential",
+ "inventory", "inventoryId", "continuation-token", "asyncFetch",
+ "worm", "wormId", "wormExtend", "withHashContext",
+ "x-oss-enable-md5", "x-oss-enable-sha1", "x-oss-enable-sha256",
+ "x-oss-hash-ctx", "x-oss-md5-ctx", "transferAcceleration",
+ "regionList", "cloudboxes", "x-oss-ac-source-ip", "x-oss-ac-subnet-mask", "x-oss-ac-vpc-id", "x-oss-ac-forward-allow",
+ "metaQuery", "resourceGroup", "rtc", "x-oss-async-process", "responseHeader"
+ );
+}
\ No newline at end of file
diff --git a/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Signer/SignerV4.php b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Signer/SignerV4.php
new file mode 100644
index 000000000..039b04aab
--- /dev/null
+++ b/module/DataAliyunOssFe/SDK/vendor/aliyuncs/oss-sdk-php/src/OSS/Signer/SignerV4.php
@@ -0,0 +1,244 @@
+request_headers['Date'])) {
+ $request->add_header('Date', gmdate('D, d M Y H:i:s \G\M\T'));
+ }
+ $timestamp = strtotime($request->request_headers['Date']);
+ if ($timestamp === false) {
+ $timestamp = time();
+ }
+ $datetime = gmdate('Ymd\THis\Z', $timestamp);
+ $date = substr($datetime, 0, 8);
+ $request->add_header("x-oss-date", $datetime);
+ if (!isset($request->request_headers['x-oss-content-sha256'])) {
+ $request->add_header("x-oss-content-sha256", 'UNSIGNED-PAYLOAD');
+ }
+ // Credentials information
+ if (!empty($credentials->getSecurityToken())) {
+ $request->add_header("x-oss-security-token", $credentials->getSecurityToken());
+ }
+ $headers = $request->request_headers;
+ $method = strtoupper($request->method);
+ $region = $options['region'];
+ $product = $options['product'];
+ $scope = $this->buildScope($date, $region, $product);
+ $resourcePath = $this->getResourcePath($options);
+ $additionalHeaders = $this->getCommonAdditionalHeaders($request, $options);
+ $queryString = parse_url($request->request_url, PHP_URL_QUERY);
+ $query = array();
+ if ($queryString !== null) {
+ parse_str($queryString, $query);
+ }
+ $canonicalRequest = $this->calcCanonicalRequest($method, $resourcePath, $query, $headers, $additionalHeaders);
+ $stringToSign = $this->calcStringToSign($datetime, $scope, $canonicalRequest);
+// printf('canonical request:%s' . PHP_EOL, $canonicalRequest);
+// printf('sign str:%s' . PHP_EOL, $stringToSign);
+ $options['string_to_sign'] = $stringToSign;
+ $signature = $this->calcSignature($credentials->getAccessKeySecret(), $date, $region, $product, $stringToSign);
+ $authorization = 'OSS4-HMAC-SHA256 Credential=' . $credentials->getAccessKeyId() . '/' . $scope;
+ $additionalHeadersString = implode(';', $additionalHeaders);
+ if ($additionalHeadersString !== '') {
+ $authorization .= ',AdditionalHeaders=' . $additionalHeadersString;
+ }
+ $authorization .= ',Signature=' . $signature;
+ $request->add_header('Authorization', $authorization);
+ }
+
+ public function presign(RequestCore $request, Credentials $credentials, array &$options)
+ {
+ if (!isset($request->request_headers['Date'])) {
+ $request->add_header('Date', gmdate('D, d M Y H:i:s \G\M\T'));
+ }
+ $timestamp = strtotime($request->request_headers['Date']);
+ if ($timestamp === false) {
+ $timestamp = time();
+ }
+ $datetime = gmdate('Ymd\THis\Z', $timestamp);
+ $expiration = $options['expiration'];
+ $date = substr($datetime, 0, 8);
+ $expires = $expiration - $timestamp;
+ $headers = $request->request_headers;
+ $method = strtoupper($request->method);
+ $region = $options['region'];
+ $product = $options['product'];
+ $scope = $this->buildScope($date, $region, $product);
+ $resourcePath = $this->getResourcePath($options);
+ $additionalHeaders = $this->getCommonAdditionalHeaders($request, $options);
+ $queryString = parse_url($request->request_url, PHP_URL_QUERY);
+ $query = array();
+ if ($queryString !== null) {
+ parse_str($queryString, $query);
+ }
+ if (!empty($credentials->getSecurityToken())) {
+ $query["x-oss-security-token"] = $credentials->getSecurityToken();
+ }
+ $query["x-oss-signature-version"] = 'OSS4-HMAC-SHA256';
+ $query["x-oss-date"] = $datetime;
+ $query["x-oss-expires"] = $expires;
+ $query["x-oss-credential"] = $credentials->getAccessKeyId() . '/' . $scope;
+ if (count($additionalHeaders) > 0) {
+ $query["x-oss-additional-headers"] = implode(";", $additionalHeaders);
+ }
+ $canonicalRequest = $this->calcCanonicalRequest($method, $resourcePath, $query, $headers, $additionalHeaders);
+ $stringToSign = $this->calcStringToSign($datetime, $scope, $canonicalRequest);
+// printf('canonical request:%s' . PHP_EOL, $canonicalRequest);
+// printf('sign str:%s' . PHP_EOL, $stringToSign);
+ $options['string_to_sign'] = $stringToSign;
+ $signature = $this->calcSignature($credentials->getAccessKeySecret(), $date, $region, $product, $stringToSign);
+ $query["x-oss-signature"] = $signature;
+ $queryStr = OssUtil::toQueryString($query);
+ $explodeUrl = explode('?', $request->request_url);
+ $index = count($explodeUrl);
+ if ($index === 1) {
+ $request->request_url .= '?' . $queryStr;
+ } else {
+ $baseUrl = $explodeUrl[0];
+ $request->request_url = $baseUrl . '?' . $queryStr;
+ }
+ }
+
+ private function getResourcePath(array $options)
+ {
+ $resourcePath = '/';
+ if (strlen($options['bucket']) > 0) {
+ $resourcePath .= $options['bucket'] . '/';
+ }
+ if (strlen($options['key']) > 0) {
+ $resourcePath .= $options['key'];
+ }
+ return $resourcePath;
+ }
+
+ private function getCommonAdditionalHeaders(RequestCore $request, array $options)
+ {
+ if (isset($options[OssClient::OSS_ADDITIONAL_HEADERS])) {
+ $addHeaders = array();
+ foreach ($options[OssClient::OSS_ADDITIONAL_HEADERS] as $key) {
+ $lowk = strtolower($key);
+ if ($this->isDefaultSignedHeader($lowk)) {
+ continue;
+ }
+ $addHeaders[$lowk] = '';
+ }
+ $headers = array();
+ foreach ($request->request_headers as $key => $value) {
+ $lowk = strtolower($key);
+ if (isset($addHeaders[$lowk])) {
+ $headers[$lowk] = '';
+ }
+ }
+ ksort($headers);
+ return array_keys($headers);
+ }
+ return array();
+ }
+
+ private function isDefaultSignedHeader($low)
+ {
+ if (strncmp($low, "x-oss-", 6) == 0 ||
+ $low === "content-type" ||
+ $low === "content-md5") {
+ return true;
+ }
+ return false;
+ }
+
+ private function calcStringToSign($datetime, $scope, $canonicalRequest)
+ {
+ /*
+ StringToSign
+ "OSS4-HMAC-SHA256" + "\n" +
+ TimeStamp + "\n" +
+ Scope + "\n" +
+ Hex(SHA256Hash(Canonical Request))
+ */
+ $hashedRequest = hash('sha256', $canonicalRequest);
+ return "OSS4-HMAC-SHA256" . "\n" . $datetime . "\n" . $scope . "\n" . $hashedRequest;
+ }
+
+ private function calcCanonicalRequest($method, $resourcePath, array $query, array $headers, array $additionalHeaders)
+ {
+ /*
+ Canonical Request
+ HTTP Verb + "\n" +
+ Canonical URI + "\n" +
+ Canonical Query String + "\n" +
+ Canonical Headers + "\n" +
+ Additional Headers + "\n" +
+ Hashed PayLoad
+ */
+
+ //Canonical Uri
+ $canonicalUri = str_replace(array('%2F'), array('/'), rawurlencode($resourcePath));
+ //Canonical Query
+ $querySigned = array();
+ foreach ($query as $key => $value) {
+ $querySigned[rawurlencode($key)] = rawurlencode($value);
+ }
+ ksort($querySigned);
+ $sortedQueryList = array();
+ foreach ($querySigned as $key => $value) {
+ if (strlen($value) > 0) {
+ $sortedQueryList[] = $key . '=' . $value;
+ } else {
+ $sortedQueryList[] = $key;
+ }
+ }
+ $canonicalQuery = implode('&', $sortedQueryList);
+ //Canonical Headers
+ $headersSigned = array();
+ foreach ($headers as $key => $value) {
+ $lowk = strtolower($key);
+ if (SignerV4::isDefaultSignedHeader($lowk) ||
+ in_array($lowk, $additionalHeaders)) {
+ $headersSigned[$lowk] = trim($value);
+ }
+ }
+ ksort($headersSigned);
+ $canonicalizedHeaders = '';
+ foreach ($headersSigned as $key => $value) {
+ $canonicalizedHeaders .= $key . ':' . $value . "\n";
+ }
+ //Additional Headers
+ $canonicalAdditionalHeaders = implode(';', $additionalHeaders);
+ $hashPayload = "UNSIGNED-PAYLOAD";
+ if (isset($headersSigned['x-oss-content-sha256'])) {
+ $hashPayload = $headersSigned['x-oss-content-sha256'];
+ }
+
+ $stringToSign = $method . "\n"
+ . $canonicalUri . "\n"
+ . $canonicalQuery . "\n"
+ . $canonicalizedHeaders . "\n"
+ . $canonicalAdditionalHeaders . "\n"
+ . $hashPayload;
+ return $stringToSign;
+ }
+
+ private function buildScope($date, $region, $product)
+ {
+ return $date . "/" . $region . "/" . $product . "/aliyun_v4_request";
+ }
+
+ private function calcSignature($secret, $date, $region, $product, $stringToSign)
+ {
+ $h1Key = hash_hmac("sha256", $date, "aliyun_v4" . $secret, true);
+ $h2Key = hash_hmac("sha256", $region, $h1Key, true);
+ $h3Key = hash_hmac("sha256", $product, $h2Key, true);
+ $h4Key = hash_hmac("sha256", "aliyun_v4_request", $h3Key, true);
+ return bin2hex(hash_hmac("sha256", $stringToSign, $h4Key, true));
+ }
+}
diff --git a/module/DataAliyunOssFe/Util/DataAliyunOssFeUtil.php b/module/DataAliyunOssFe/Util/DataAliyunOssFeUtil.php
new file mode 100644
index 000000000..7ada86fce
--- /dev/null
+++ b/module/DataAliyunOssFe/Util/DataAliyunOssFeUtil.php
@@ -0,0 +1,77 @@
+signUrl(self::bucket(), $url, $timeout);
+ return Response::generateSuccessData([
+ 'url' => $url,
+ ]);
+ } catch (OssException $e) {
+ throw $e;
+ }
+ }
+}
diff --git a/module/DataAliyunOssFe/View/inc/script.blade.php b/module/DataAliyunOssFe/View/inc/script.blade.php
new file mode 100644
index 000000000..d8b96c6ec
--- /dev/null
+++ b/module/DataAliyunOssFe/View/inc/script.blade.php
@@ -0,0 +1,46 @@
+
+
diff --git a/module/DataAliyunOssFe/config.json b/module/DataAliyunOssFe/config.json
new file mode 100644
index 000000000..d8854883c
--- /dev/null
+++ b/module/DataAliyunOssFe/config.json
@@ -0,0 +1,25 @@
+{
+ "name": "DataAliyunOssFe",
+ "title": "阿里云OSS云存储(前端直传)",
+ "env": [
+ "laravel5",
+ "laravel9"
+ ],
+ "tags": [
+ "云存储",
+ "阿里云"
+ ],
+ "types": [
+ "Arch"
+ ],
+ "modstartVersion": ">=2.9.0",
+ "require": [
+ "Vendor"
+ ],
+ "version": "1.0.0",
+ "author": "官方",
+ "description": "阿里云OSS云存储上传插件,支持客户端直传、分片上传",
+ "providers": [
+ ],
+ "config": []
+}
diff --git a/module/Member/Docs/release.md b/module/Member/Docs/release.md
index 9d8f8e476..b544efae0 100644
--- a/module/Member/Docs/release.md
+++ b/module/Member/Docs/release.md
@@ -1,6 +1,7 @@
## 4.5.0
- 新增:VIP 优惠券功能集成,支持折扣券
+- 新增:可完全自定义上传功能定制的特性 UploadScript Hook
- 优化:VIP 开通页面交互形式优化
---
diff --git a/module/Member/View/pc/memberData/fileManager.blade.php b/module/Member/View/pc/memberData/fileManager.blade.php
index 074190fb7..aa314eb49 100644
--- a/module/Member/View/pc/memberData/fileManager.blade.php
+++ b/module/Member/View/pc/memberData/fileManager.blade.php
@@ -52,6 +52,7 @@
}
};
+ {!! \ModStart\Core\Hook\ModStartHook::fireInView('UploadScript',['source'=>'fileManager','server'=>\ModStart\Core\Input\Request::currentPageUrlWithOutQueries()]); !!}
@endsection
diff --git a/public/asset/common/editor.js b/public/asset/common/editor.js
index 9220886ff..525ed39a3 100644
--- a/public/asset/common/editor.js
+++ b/public/asset/common/editor.js
@@ -1 +1 @@
-!function(n){var i={};function o(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=i,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/asset//",o(o.s=335)}({12:function(e,t,o){"use strict";var n,i,r=(i={},function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}i[e]=t}return i[e]}),d=[];function c(e){for(var t=-1,n=0;n'').join("\n"))}}).show():alert("Missing Config : window.__selectorDialogServer"),!0;case"attachment":return window.__selectorDialogServer?window.__selectorDialog=new window.api.selectorDialog({server:window.__selectorDialogServer+"/file",callback:function(e){t.execCommand("insertFile",e.map(e=>({url:e.path,title:e.filename})))}}).show():alert("Missing Config : window.__selectorDialogServer"),!0}},imageConfig:{disableUpload:!0,disableOnline:!0,selectCallback:function(e,t){window.__selectorDialog=new window.api.selectorDialog({server:window.__selectorDialogServer+"/image",callback:function(e){e.length&&t({path:e[0].path,name:e[0].filename})}}).show()}},videoConfig:{disableUpload:!0,selectCallback:function(e,t){window.__selectorDialog=new window.api.selectorDialog({server:window.__selectorDialogServer+"/video",callback:function(e){e.length&&t({path:e[0].path,name:e[0].filename})}}).show()}},audioConfig:{disableUpload:!0,selectCallback:function(e,t){window.__selectorDialog=new window.api.selectorDialog({server:window.__selectorDialogServer+"/audio",callback:function(e){e.length&&t({path:e[0].path,name:e[0].filename})}}).show()}}};function a(){var e={formulaConfig:{imageUrlTemplate:"https://latex.codecogs.com/svg.image?{}"}};return window.__editorFormulaConfig&&window.__editorFormulaConfig.imageUrlTemplate&&(e.formulaConfig.imageUrlTemplate=window.__editorFormulaConfig.imageUrlTemplate),e}var e={basic:function(e,t,n){var i=o.extend({server:"",width:null,height:100,ready:function(){}},t),t=["fullscreen","source","autotypeset","selectall","undo","redo","removeformat","paragraph","fontsize","forecolor","backcolor","|","insertimage","uploadimage","insertvideo","insertaudio","attachment","bold","italic","underline","strikethrough","superscript","subscript","blockquote","insertorderedlist","insertunorderedlist","rowspacingtop","rowspacingbottom","lineheight","indent","justifyleft","justifycenter","justifyright","justifyjustify","|","link","unlink","insertcode","formula","attachment","imagenone","imageleft","imageright","imagecenter","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","|","contentimport"];window.__editorBasicToolBars&&(t=window.__editorBasicToolBars),window.__editorBasicToolBarsExtra&&(t=t.concat(window.__editorBasicToolBarsExtra));n=o.extend({toolbars:[t],serverUrl:i.server,wordCount:!1,elementPathEnabled:!1,initialFrameHeight:i.height,initialFrameWidth:i.width,enableAutoSave:!1,pasteplain:!1,autoHeightEnabled:!0,focus:!1},r,n,a()),n=UE.getEditor(e,n);return n.ready(function(){i.ready()}),n},simple:function(e,t,n){var i=o.extend({server:"",width:null,height:100,ready:function(){}},t),t=["fontsize","forecolor","insertimage","uploadimage","bold","italic","underline","strikethrough","insertcode","contentimport"];window.__editorSimpleToolBars&&(t=window.__editorSimpleToolBars),window.__editorSimpleToolBarsExtra&&(t=t.concat(window.__editorSimpleToolBarsExtra));n=o.extend({toolbars:[t],serverUrl:i.server,wordCount:!1,elementPathEnabled:!1,initialFrameHeight:i.height,initialFrameWidth:i.width,enableAutoSave:!1,pasteplain:!1,retainOnlyLabelPasted:!0,autoHeightEnabled:!0,focus:!1},r,n,a()),n=UE.getEditor(e,n);return n.ready(function(){i.ready()}),n},raw:UE};"api"in window||(window.api={}),window.api.editor=e,"MS"in window||(window.MS={}),window.MS.editor=e,window.MS.editorUploadConfig=r}.call(this,n(8))},336:function(e,t){function n(e,t){return e=e||self.document.URL||self.location.href,t=t||(n=document.getElementsByTagName("script"))[n.length-1].src,/^(\/|\\\\)/.test(n=t)?n=/^.+?\w(\/|\\\\)/.exec(e)[0]+t.replace(/^(\/|\\\\)/,""):/^[a-z]+:/i.test(t)||(n=(e=e.split("#")[0].split("?")[0].replace(/[^\\\/]+$/,""))+""+t),function(e){var t,n=/^[a-z]+:\/\//.exec(e)[0],i=[];for((e=(e=e.replace(n,"").split("?")[0].split("#")[0]).replace(/\\/g,"/").split(/\//))[e.length-1]="";e.length;)".."===(t=e.shift())?i.pop():"."!==t&&i.push(t);return n+i.join("/")}(n);var n}var i,o;i=window.UEDITOR_HOME_URL||(window.__msCDN?window.__msCDN+"asset/vendor/ueditor/":window.__msRoot?window.__msRoot+"asset/vendor/ueditor/":n()),o=window.UEDITOR_CORS_URL||(window.__msRoot?window.__msRoot+"asset/vendor/ueditor/":window.UEDITOR_HOME_URL||n()),window.UEDITOR_CONFIG={UEDITOR_HOME_URL:i,UEDITOR_CORS_URL:o,debug:!1,serverUrl:"/ueditor-plus/_demo_server/handle.php",serverHeaders:{},serverResponsePrepare:function(e){return console.log("serverResponsePrepare",e),e},toolbars:[["fullscreen","source","|","undo","redo","|","bold","italic","underline","fontborder","strikethrough","superscript","subscript","removeformat","formatmatch","autotypeset","blockquote","pasteplain","|","forecolor","backcolor","insertorderedlist","insertunorderedlist","selectall","cleardoc","|","rowspacingtop","rowspacingbottom","lineheight","|","customstyle","paragraph","fontfamily","fontsize","|","directionalityltr","directionalityrtl","indent","|","justifyleft","justifycenter","justifyright","justifyjustify","|","touppercase","tolowercase","|","link","unlink","anchor","|","imagenone","imageleft","imagecenter","imageright","|","simpleupload","insertimage","emotion","scrawl","insertvideo","insertaudio","attachment","insertframe","insertcode","pagebreak","template","background","formula","|","horizontal","date","time","spechars","wordimage","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","|","print","preview","searchreplace","|","contentimport","help"]],toolbarCallback:function(e,t){},imageConfig:{disableUpload:!1,disableOnline:!1,selectCallback:null},videoConfig:{disableUpload:!1,selectCallback:null},audioConfig:{disableUpload:!1,selectCallback:null},formulaConfig:{imageUrlTemplate:"https://r.latexeasy.com/image.svg?{}",editorMode:"live",editorLiveServer:"https://latexeasy.com"},autoSaveEnable:!0,autoSaveRestore:!1,autoSaveKey:null,initialContent:"",focus:!1,initialStyle:"",indentValue:"2em",readonly:!1,autoClearEmptyNode:!0,fullscreen:!1,allHtmlEnabled:!1,enableContextMenu:!0,shortcutMenu:["bold","italic","underline","strikethrough","fontborder","forecolor","backcolor","imagenone","imageleft","imagecenter","imageright","insertimage","formula"],elementPathEnabled:!0,wordCount:!0,maximumWords:1e4,maxUndoCount:20,maxInputCount:1,autoHeightEnabled:!0,catchRemoteImageEnable:!0,autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:{div:1},indent:!1,indentValue:"2em",bdc2sb:!1,tobdc:!1},allowDivTransToP:!0,rgb2Hex:!0,tipError:function(e,t){window&&window.MS&&window.MS.dialog?window.MS.dialog.tipError(e):alert(e)}},window.UE={getUEBasePath:n}},337:function(module,exports,__webpack_require__){!function(global,Buffer){!function(){UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor={plugins:{},commands:{},instants:{},I18N:{},_customizeUI:{},version:"3.9.0",constants:{STATEFUL:{DISABLED:-1,OFF:0,ON:1}}};var dom=UE.dom={},browser=UE.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,n={ie:/(msie\s|trident.*rv:)([\w.]+)/i.test(e),opera:!!t&&t.version,webkit:-1{this.isObject(n[e])&&e in t?i[e]=this.merge(t[e],n[e]):Object.assign(i,{[e]:n[e]})}),i},extend:function(e,t,n){if(t)for(var i in t)n&&e.hasOwnProperty(i)||(e[i]=t[i]);return e},extend2:function(e){for(var t=arguments,n=1;n'](?:(amp|lt|ldquo|rdquo|quot|gt|#39|nbsp|#\d+);)?/g,function(e,t){return t?e:{"<":"<","&":"&",'"':""","“":"“","”":"”",">":">","'":"'"}[e]}):""},html:function(e){return e?e.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g,function(e){return{"<":"<","&":"&",""":'"',"“":"“","”":"”",">":">","'":"'"," ":" "}[e]}):""},cssStyleToDomStyle:(test=document.createElement("div").style,cache={float:void 0!==test.cssFloat?"cssFloat":void 0!==test.styleFloat?"styleFloat":"float"},function(e){return cache[e]||(cache[e]=e.toLowerCase().replace(/-./g,function(e){return e.charAt(1).toUpperCase()}))}),loadFile:(c1=[],function(t,n,e){var i=d1(t,n);if(i)i.ready?e&&e():i.funs.push(e);else if(c1.push({doc:t,url:n.src||n.href,funs:[e]}),t.body){if(!n.id||!t.getElementById(n.id)){var o=t.createElement(n.tag);for(r in delete n.tag,n)o.setAttribute(r,n[r]);o.onload=o.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(0<(i=d1(t,n)).funs.length){i.ready=1;for(var e;e=i.funs.pop();)e()}o.onload=o.onreadystatechange=null}},o.onerror=function(){throw Error("The load "+(n.href||n.src)+" fails,check the url settings of file ueditor.config.js ")},t.getElementsByTagName("head")[0].appendChild(o)}}else{var r,a=[];for(r in n)"tag"!=r&&a.push(r+'="'+n[r]+'"');t.write("<"+n.tag+" "+a.join(" ")+" >"+n.tag+">")}}),isEmptyObject:function(e){if(null==e)return!0;if(this.isArray(e)||this.isString(e))return 0===e.length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},fixColor:function(e,t){if(/color/i.test(e)&&/rgba?/.test(t)){var n=t.split(",");if(3/.test(e.outerHTML):0==e.attributes.length},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},isTagNode:function(e,t){return 1==e.nodeType&&new RegExp("\\b"+e.tagName+"\\b","i").test(t)},filterNodeList:function(e,t,n){var i,o=[];return utils.isFunction(t)||(i=t,t=function(e){return-1!=utils.indexOf(utils.isArray(i)?i:i.split(" "),e.tagName.toLowerCase())}),utils.each(e,function(e){t(e)&&o.push(e)}),0==o.length?null:1!=o.length&&n?o:o[0]},isInNodeEndBoundary:function(e,t){var n=e.startContainer;if(3==n.nodeType&&e.startOffset!=n.nodeValue.length)return 0;if(1==n.nodeType&&e.startOffset!=n.childNodes.length)return 0;for(;n!==t;){if(n.nextSibling)return 0;n=n.parentNode}return 1},isBoundaryNode:function(e,t){for(;!domUtils.isBody(e);)if(e!==(e=e.parentNode)[t])return!1;return!0},fillHtml:browser.ie11below?" ":" ",loadScript:function(e,t){var n;(n=document.createElement("script")).src=e,n.onload=function(){t&&t({isNew:!0})},document.getElementsByTagName("head")[0].appendChild(n)}},fillCharReg=new RegExp(domUtils.fillChar,"g"),axios,imageCompression,M7,N7,Q7,_f,a5,b5,f5;function O7(e,t){var n;t.options.textarea&&((n=(n=!(n=t.textarea)?domUtils.getElementsByTagName(e,"textarea",function(e){return e.id==="ueditor_textarea_"+t.options.textarea})[0]:n)||domUtils.getElementsByTagName(e,"textarea",function(e){return e.name===t.options.textarea})[0])||e.appendChild(n=domUtils.createElement(document,"textarea",{name:t.options.textarea,id:"ueditor_textarea_"+t.options.textarea,style:"display:none"})),n&&!t.textarea&&(t.textarea=n),n.getAttribute("name")||n.setAttribute("name",t.options.textarea),n.value=t.hasContents()?t.options.allHtmlEnabled?t.getAllHtml():t.getContent(null,null,!0):"")}function P7(e){e.langIsReady=!0,e.fireEvent("langReady")}function nj(){var e=this;e.document.getElementById("initContent")&&(e.body.innerHTML="