You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
34
vendor/oss-sdk/src/OSS/Result/GetStorageCapacityResult.php
vendored
Executable file
34
vendor/oss-sdk/src/OSS/Result/GetStorageCapacityResult.php
vendored
Executable file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace OSS\Result;
|
||||
|
||||
use OSS\Core\OssException;
|
||||
|
||||
/**
|
||||
* Class AclResult GetBucketAcl interface returns the result class, encapsulated
|
||||
* The returned xml data is parsed
|
||||
*
|
||||
* @package OSS\Result
|
||||
*/
|
||||
class GetStorageCapacityResult extends Result
|
||||
{
|
||||
/**
|
||||
* Parse data from response
|
||||
*
|
||||
* @return string
|
||||
* @throws OssException
|
||||
*/
|
||||
protected function parseDataFromResponse()
|
||||
{
|
||||
$content = $this->rawResponse->body;
|
||||
if (empty($content)) {
|
||||
throw new OssException("body is null");
|
||||
}
|
||||
$xml = simplexml_load_string($content);
|
||||
if (isset($xml->StorageCapacity)) {
|
||||
return intval($xml->StorageCapacity);
|
||||
} else {
|
||||
throw new OssException("xml format exception");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user