PHPIndex

This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).

BucketInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/BucketInfo.php'
View Content
<?php

namespace OSS\Model;


/**
 * Bucket information class. This is the type of element in BucketListInfo's
 *
 * Class BucketInfo
 * @package OSS\Model
 */
class BucketInfo
{
     /**
     * BucketInfo constructor.
     *
     * @param string $location
     * @param string $name
     * @param string $createDate
     */
    public function __construct($location = '', $name = '', $createDate = '')
    {
        $this->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;
}
BucketListInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/BucketListInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class BucketListInfo
 *
 * It's the type of return value of ListBuckets.
 *
 * @package OSS\Model
 */
class BucketListInfo
{
    /**
     * BucketListInfo constructor.
     * @param array $bucketList
     */
    public function __construct(array $bucketList)
    {
        $this->bucketList = $bucketList;
    }

    /**
     * Get the BucketInfo list
     *
     * @return BucketInfo[]
     */
    public function getBucketList()
    {
        return $this->bucketList;
    }

    /**
     * BucketInfo list
     *
     * @var array
     */
    private $bucketList = array();
}
BucketStat.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/BucketStat.php'
View Content
<?php

namespace OSS\Model;


/**
 * Bucket stat class.
 *
 * Class BucketStat
 * @package OSS\Model
 */
class BucketStat
{
    /**
     * Get storage
     *
     * @return int
     */
    public function getStorage()
    {
        return $this->storage;
    }

    /**
     * Get object count
     *
     * @return int
     */
    public function getObjectCount()
    {
        return $this->objectCount;
    }

    /**
     * Get multipart upload count.
     *
     * @return int
     */
    public function getMultipartUploadCount()
    {
        return $this->multipartUploadCount;
    }

    /**
     * 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);
        }
    }
    
    /**
     * current storage
     *
     * @var int
     */
    private $storage;
    /**
     * object count
     *
     * @var int
     */
    private $objectCount;

    /**
     * multipart upload count
     *
     * @var int
     */
    private $multipartUploadCount;

}
CnameConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/CnameConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class CnameConfig
 * @package OSS\Model
 *
 * TODO: fix link
 * @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
 */
class CnameConfig implements XmlConfig
{
    public function __construct()
    {
        $this->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 version="1.0" encoding="utf-8"?>
<BucketCnameConfiguration>
</BucketCnameConfiguration>
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();
}
CorsConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/CorsConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class CorsConfig
 * @package OSS\Model
 *
 * @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
 */
class CorsConfig implements XmlConfig
{
    /**
     * CorsConfig constructor.
     */
    public function __construct()
    {
        $this->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;
    }

    /**
     * Parse CorsConfig from the xml.
     *
     * @param string $strXml
     * @throws OssException
     * @return null
     */
    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        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);
        }
        return;
    }

    /**
     * Serialize the object into xml string.
     *
     * @return string
     */
    public function serializeToXml()
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><CORSConfiguration></CORSConfiguration>');
        foreach ($this->rules as $rule) {
            $xmlRule = $xml->addChild('CORSRule');
            $rule->appendToXml($xmlRule);
        }
        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();
}
CorsRule.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/CorsRule.php'
View Content
<?php

namespace OSS\Model;

use OSS\Core\OssException;


/**
 * Class CorsRule
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
 */
class CorsRule
{
    /**
     * Add an allowedOrigin rule
     *
     * @param string $allowedOrigin
     */
    public function addAllowedOrigin($allowedOrigin)
    {
        if (!empty($allowedOrigin)) {
            $this->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;
}
DeleteMarkerInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/DeleteMarkerInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 *
 * Class DeleteMarkerInfo
 *
 * @package OSS\Model
 */
class DeleteMarkerInfo
{
    /**
     * DeleteMarkerInfo constructor.
     *
     * @param string $key
     * @param string $versionId
     * @param string $lastModified
     * @param string $isLatest
     */
    public function __construct($key, $versionId, $lastModified, $isLatest)
    {
        $this->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 = "";
}
DeleteObjectInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/DeleteObjectInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class DeleteObjectInfo
 * @package OSS\Model
 */
class DeleteObjectInfo
{
    /**
     * DeleteObjectInfo constructor.
     *
     * @param string $key
     * @param string $versionId
     */
    public function __construct($key, $versionId = '')
    {
        $this->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 = "";
}
DeletedObjectInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/DeletedObjectInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class DeletedObjectInfo
 * @package OSS\Model
 */
class DeletedObjectInfo
{
    /**
     * DeletedObjectInfo constructor.
     *
     * @param string $key
     * @param string $versionId
     * @param string $deleteMarker
     * @param string $deleteMarkerVersionId
     */
    public function __construct($key, $versionId, $deleteMarker, $deleteMarkerVersionId)
    {
        $this->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 = "";
}
ExtendWormConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ExtendWormConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class ExtendWormConfig
 * @package OSS\Model
 *
 */
class ExtendWormConfig implements XmlConfig
{
    /**
     * ExtendWormConfig constructor.
     * @param null $day
     */
    public function __construct($day = null)
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><ExtendWormConfiguration></ExtendWormConfiguration>');
        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;
}
GetLiveChannelHistory.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/GetLiveChannelHistory.php'
View Content
<?php

namespace OSS\Model;

use OSS\Core\OssException;

/**
 * Class GetLiveChannelHistory
 * @package OSS\Model
 */
class GetLiveChannelHistory implements XmlConfig
{
     public function getLiveRecordList()
    {
        return $this->liveRecordList;
    }

    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);

        if (isset($xml->LiveRecord)) {
            foreach ($xml->LiveRecord as $record) {
            $liveRecord = new LiveChannelHistory();
            $liveRecord->parseFromXmlNode($record);
            $this->liveRecordList[] = $liveRecord;
           }
        }
    }

    public function serializeToXml()
    {
        throw new OssException("Not implemented.");
    }
    
    private $liveRecordList = array();
}
GetLiveChannelInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/GetLiveChannelInfo.php'
View Content
<?php

namespace OSS\Model;
/**
 * Class GetLiveChannelInfo
 * @package OSS\Model
 */
class GetLiveChannelInfo implements XmlConfig
{
    public function getDescription()
    {
        return $this->description;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function getType()
    {
        return $this->type;
    }
  
    public function getFragDuration()
    {
        return $this->fragDuration;
    }
   
    public function getFragCount()
    {
        return $this->fragCount;
    }
   
    public function getPlayListName()
    {
        return $this->playlistName;
    }

    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);

        $this->description = strval($xml->Description);
        $this->status = strval($xml->Status);

        if (isset($xml->Target)) {
            foreach ($xml->Target as $target) {
            $this->type = strval($target->Type);
            $this->fragDuration = strval($target->FragDuration);
            $this->fragCount = strval($target->FragCount);
            $this->playlistName = strval($target->PlaylistName);
           }
        }
    }

    public function serializeToXml()
    {
        throw new OssException("Not implemented.");
    }
    
    private $description;
    private $status;
    private $type;
    private $fragDuration;
    private $fragCount;
    private $playlistName;
}
GetLiveChannelStatus.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/GetLiveChannelStatus.php'
View Content
<?php

namespace OSS\Model;
/**
 * Class GetLiveChannelStatus
 * @package OSS\Model
 */
class GetLiveChannelStatus implements XmlConfig
{
    public function getStatus()
    {
        return $this->status;
    }

    public function getConnectedTime()
    {
        return $this->connectedTime;
    }

    public function getRemoteAddr()
    {
        return $this->remoteAddr;
    }

    public function getVideoWidth()
    {
        return $this->videoWidth;
    }
    public function getVideoHeight()
    {
        return $this->videoHeight;
    }
    public function getVideoFrameRate()
    {
        return $this->videoFrameRate;
    }
    public function getVideoBandwidth()
    {
        return $this->videoBandwidth;
    }
    public function getVideoCodec()
    {
        return $this->videoCodec;
    }

    public function getAudioBandwidth()
    {
        return $this->audioBandwidth;
    }
    public function getAudioSampleRate()
    {
        return $this->audioSampleRate;
    }
    public function getAudioCodec()
    {
        return $this->audioCodec;
    }


    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        $this->status = strval($xml->Status);
        $this->connectedTime = strval($xml->ConnectedTime);
        $this->remoteAddr = strval($xml->RemoteAddr);

        if (isset($xml->Video)) {
            foreach ($xml->Video as $video) {
            $this->videoWidth = intval($video->Width);
            $this->videoHeight = intval($video->Height);
            $this->videoFrameRate = intval($video->FrameRate);
            $this->videoBandwidth = intval($video->Bandwidth);
            $this->videoCodec = strval($video->Codec);
           }
        }
        
        if (isset($xml->Video)) {
            foreach ($xml->Audio as $audio) {
            $this->audioBandwidth = intval($audio->Bandwidth);
            $this->audioSampleRate = intval($audio->SampleRate);
            $this->audioCodec = strval($audio->Codec);
           }
        }

    }

    public function serializeToXml()
    {
        throw new OssException("Not implemented.");
    }
    
    private $status;
    private $connectedTime;
    private $remoteAddr;

    private $videoWidth;
    private $videoHeight;
    private $videoFrameRate;
    private $videoBandwidth;
    private $videoCodec;

    private $audioBandwidth;
    private $audioSampleRate;
    private $audioCodec;
    

}
InitiateWormConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/InitiateWormConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class InitiateWormConfig
 * @package OSS\Model
 *
 */
class InitiateWormConfig implements XmlConfig
{
    /**
     * InitiateWormConfig constructor.
     * @param null $day
     */
    public function __construct($day = null)
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><InitiateWormConfiguration></InitiateWormConfiguration>');
        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;
}
LifecycleAction.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LifecycleAction.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class LifecycleAction
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
 */
class LifecycleAction
{
    /**
     * LifecycleAction constructor.
     * @param string $action
     * @param string $timeSpec
     * @param string $timeValue
     */
    public function __construct($action, $timeSpec, $timeValue)
    {
        $this->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;

}
LifecycleConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LifecycleConfig.php'
View Content
<?php

namespace OSS\Model;

use OSS\Core\OssException;


/**
 * Class BucketLifecycleConfig
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
 */
class LifecycleConfig implements XmlConfig
{
    /**
     * Parse the xml into this object.
     *
     * @param string $strXml
     * @throws OssException
     * @return null
     */
    public function parseFromXml($strXml)
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><LifecycleConfiguration></LifecycleConfiguration>');
        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;
}


LifecycleRule.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LifecycleRule.php'
View Content
<?php

namespace OSS\Model;


/**
 * Class LifecycleRule
 * @package OSS\Model
 *
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
 */
class LifecycleRule
{
    /**
     * Get Id
     *
     * @return string
     */
    public function getId()
    {
        return $this->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';
}
ListMultipartUploadInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ListMultipartUploadInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class ListMultipartUploadInfo
 * @package OSS\Model
 *
 * @link http://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/ListMultipartUploads.html
 */
class ListMultipartUploadInfo
{
    /**
     * ListMultipartUploadInfo constructor.
     *
     * @param string $bucket
     * @param string $keyMarker
     * @param string $uploadIdMarker
     * @param string $nextKeyMarker
     * @param string $nextUploadIdMarker
     * @param string $delimiter
     * @param string $prefix
     * @param int $maxUploads
     * @param string $isTruncated
     * @param array $uploads
     */
    public function __construct($bucket, $keyMarker, $uploadIdMarker, $nextKeyMarker, $nextUploadIdMarker, $delimiter, $prefix, $maxUploads, $isTruncated, array $uploads)
    {
        $this->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();
}
ListPartsInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ListPartsInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class ListPartsInfo
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/ListParts.html
 */
class ListPartsInfo
{

    /**
     * ListPartsInfo constructor.
     * @param string $bucket
     * @param string $key
     * @param string $uploadId
     * @param int $nextPartNumberMarker
     * @param int $maxParts
     * @param string $isTruncated
     * @param array $listPart
     */
    public function __construct($bucket, $key, $uploadId, $nextPartNumberMarker, $maxParts, $isTruncated, array $listPart)
    {
        $this->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();
}
LiveChannelConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LiveChannelConfig.php'
View Content
<?php

namespace OSS\Model;


/**
 * Class LiveChannelConfig
 * @package OSS\Model
 */
class LiveChannelConfig implements XmlConfig
{
    public function __construct($option = array())
    {
        if (isset($option['description'])) {
            $this->description = $option['description'];
        }
        if (isset($option['status'])) {
            $this->status = $option['status'];
        }
        if (isset($option['type'])) {
            $this->type = $option['type'];
        }
        if (isset($option['fragDuration'])) {
            $this->fragDuration = $option['fragDuration'];
        }
        if (isset($option['fragCount'])) {
            $this->fragCount = $option['fragCount'];
        }
        if (isset($option['playListName'])) {
            $this->playListName = $option['playListName'];
        }
    }

    public function getDescription()
    {
        return $this->description;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function getType()
    {
        return $this->type;
    }

    public function getFragDuration()
    {
        return $this->fragDuration;
    }

    public function getFragCount()
    {
        return $this->fragCount;
    }

    public function getPlayListName()
    {
        return $this->playListName;
    }

    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        $this->description = strval($xml->Description);
        $this->status = strval($xml->Status);
        $target = $xml->Target;
        $this->type = strval($target->Type);
        $this->fragDuration = intval($target->FragDuration);
        $this->fragCount = intval($target->FragCount);
        $this->playListName = strval($target->PlayListName);
    }

    public function serializeToXml()
    {
        $strXml = <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<LiveChannelConfiguration>
</LiveChannelConfiguration>
EOF;
        $xml = new \SimpleXMLElement($strXml);
        if (isset($this->description)) {
            $xml->addChild('Description', $this->description);
        }

        if (isset($this->status)) {
            $xml->addChild('Status', $this->status);
        }

        $node = $xml->addChild('Target');
        $node->addChild('Type', $this->type);

        if (isset($this->fragDuration)) {
            $node->addChild('FragDuration', $this->fragDuration);
        }

        if (isset($this->fragCount)) {
            $node->addChild('FragCount', $this->fragCount);
        }

        if (isset($this->playListName)) {
            $node->addChild('PlayListName', $this->playListName);
        }

        return $xml->asXML();
    }

    public function __toString()
    {
        return $this->serializeToXml();
    }
    
    private $description;
    private $status = "enabled";
    private $type;
    private $fragDuration = 5;
    private $fragCount = 3;
    private $playListName = "playlist.m3u8";
}
LiveChannelHistory.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LiveChannelHistory.php'
View Content
<?php

namespace OSS\Model;
/**
 * Class LiveChannelHistory
 * @package OSS\Model
 *
 */
class LiveChannelHistory implements XmlConfig
{
    public function __construct()
    {
    }

    public function getStartTime()
    {
        return $this->startTime;
    }

    public function getEndTime()
    {
        return $this->endTime;
    }

    public function getRemoteAddr()
    {
        return $this->remoteAddr;
    }

    public function parseFromXmlNode($xml)
    {
        if (isset($xml->StartTime)) {
            $this->startTime = strval($xml->StartTime);
        }

        if (isset($xml->EndTime)) {
            $this->endTime = strval($xml->EndTime);
        }

        if (isset($xml->RemoteAddr)) {
            $this->remoteAddr = strval($xml->RemoteAddr);
        }
    }

    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        $this->parseFromXmlNode($xml);
    }

    public function serializeToXml()
    {
        throw new OssException("Not implemented.");
    }
    
    private $startTime;
    private $endTime;
    private $remoteAddr;
}
LiveChannelInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LiveChannelInfo.php'
View Content
<?php

namespace OSS\Model;
/**
 * Class LiveChannelInfo
 * @package OSS\Model
 *
 */
class LiveChannelInfo implements XmlConfig
{
    public function __construct($name = null, $description = null)
    {
        $this->name = $name;
        $this->description = $description;
        $this->publishUrls = array();
        $this->playUrls = array();
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function getPublishUrls()
    {
        return $this->publishUrls;
    }

    public function getPlayUrls()
    {
        return $this->playUrls;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function getLastModified()
    {
        return $this->lastModified;
    }

    public function getDescription()
    {
        return $this->description;
    }

    public function setDescription($description)
    {
        $this->description = $description;
    }

    public function parseFromXmlNode($xml)
    {
        if (isset($xml->Name)) {
            $this->name = strval($xml->Name);
        }

        if (isset($xml->Description)) {
            $this->description = strval($xml->Description);
        }

        if (isset($xml->Status)) {
            $this->status = strval($xml->Status);
        }

        if (isset($xml->LastModified)) {
            $this->lastModified = strval($xml->LastModified);
        }

        if (isset($xml->PublishUrls)) {
            foreach ($xml->PublishUrls as $url) {
                $this->publishUrls[] = strval($url->Url);
            }
        }

        if (isset($xml->PlayUrls)) {
            foreach ($xml->PlayUrls as $url) {
                $this->playUrls[] = strval($url->Url);
            }
        }
    }

    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        $this->parseFromXmlNode($xml);
    }

    public function serializeToXml()
    {
        throw new OssException("Not implemented.");
    }
    
    private $name;
    private $description;
    private $publishUrls;
    private $playUrls;
    private $status;
    private $lastModified;
}
LiveChannelListInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LiveChannelListInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class LiveChannelListInfo
 *
 * The data returned by ListBucketLiveChannels
 *
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
 */
class LiveChannelListInfo implements XmlConfig
{
    /**
     * @return string
     */
    public function getBucketName()
    {
        return $this->bucket;
    }

    public function setBucketName($name)
    {
        $this->bucket = $name;
    }

    /**
     * @return string
     */
    public function getPrefix()
    {
        return $this->prefix;
    }

    /**
     * @return string
     */
    public function getMarker()
    {
        return $this->marker;
    }

    /**
     * @return int
     */
    public function getMaxKeys()
    {
        return $this->maxKeys;
    }

    /**
     * @return mixed
     */
    public function getIsTruncated()
    {
        return $this->isTruncated;
    }

    /**
     * @return LiveChannelInfo[]
     */
    public function getChannelList()
    {
        return $this->channelList;
    }

    /**
     * @return string
     */
    public function getNextMarker()
    {
        return $this->nextMarker;
    }

    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);

        $this->prefix = strval($xml->Prefix);
        $this->marker = strval($xml->Marker);
        $this->maxKeys = intval($xml->MaxKeys);
        $this->isTruncated = (strval($xml->IsTruncated) == 'true');
        $this->nextMarker = strval($xml->NextMarker);

        if (isset($xml->LiveChannel)) {
            foreach ($xml->LiveChannel as $chan) {
                $channel = new LiveChannelInfo();
                $channel->parseFromXmlNode($chan);
                $this->channelList[] = $channel;
            }
        }
    }

    public function serializeToXml()
    {
        throw new OssException("Not implemented.");
    }
    
    private $bucket = '';
    private $prefix = '';
    private $marker = '';
    private $nextMarker = '';
    private $maxKeys = 100;
    private $isTruncated = 'false';
    private $channelList = array();
}
LoggingConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/LoggingConfig.php'
View Content
<?php

namespace OSS\Model;


/**
 * Class LoggingConfig
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLogging.html
 */
class LoggingConfig implements XmlConfig
{
    /**
     * LoggingConfig constructor.
     * @param null $targetBucket
     * @param null $targetPrefix
     */
    public function __construct($targetBucket = null, $targetPrefix = null)
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus></BucketLoggingStatus>');
        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 = "";

}
ObjectInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ObjectInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 *
 * Class ObjectInfo
 *
 * The element type of ObjectListInfo, which is the return value type of listObjects
 *
 * The return value of listObjects includes two arrays
 * One is the returned ObjectListInfo, which is similar to a file list in a file system.
 * The other is the returned prefix list, which is similar to a folder list in a file system.
 *
 * @package OSS\Model
 */
class ObjectInfo
{
    /**
     * ObjectInfo constructor.
     *
     * @param string $key
     * @param string $lastModified
     * @param string $eTag
     * @param string $type
     * @param int $size
     * @param string $storageClass
     */
    public function __construct($key, $lastModified, $eTag, $type, $size, $storageClass)
    {
        $this->key = $key;
        $this->lastModified = $lastModified;
        $this->eTag = $eTag;
        $this->type = $type;
        $this->size = $size;
        $this->storageClass = $storageClass;
    }

    /**
     * @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;
    }

    /**
     * @return int
     */
    public function getSize()
    {
        return $this->size;
    }

    /**
     * @return string
     */
    public function getStorageClass()
    {
        return $this->storageClass;
    }

    private $key = "";
    private $lastModified = "";
    private $eTag = "";
    private $type = "";
    private $size = 0;
    private $storageClass = "";
}
ObjectListInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ObjectListInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class ObjectListInfo
 *
 * The class of return value of ListObjects
 *
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
 */
class ObjectListInfo
{
    /**
     * ObjectListInfo constructor.
     *
     * @param string $bucketName
     * @param string $prefix
     * @param string $marker
     * @param string $nextMarker
     * @param string $maxKeys
     * @param string $delimiter
     * @param null $isTruncated
     * @param array $objectList
     * @param array $prefixList
     */
    public function __construct($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, array $objectList, array $prefixList)
    {
        $this->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();
}
ObjectVersionInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ObjectVersionInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 *
 * Class ObjectVersionInfo
 *
 * The element type of ObjectVersionListInfo, which is the return value type of listObjectVersions
 *
 * The return value of listObjectVersions includes three arrays
 * One is the returned ObjectVersionListInfo, which is similar to a file list in a file system.
 * The other is the returned prefix list, which is similar to a folder list in a file system.
 *
 * @package OSS\Model
 */
class ObjectVersionInfo
{
    /**
     * ObjectVersionInfo constructor.
     *
     * @param string $key
     * @param string $lastModified
     * @param string $eTag
     * @param string $type
     * @param int $size
     * @param string $storageClass
     * @param string $isLatest
     */
    public function __construct($key, $versionId, $lastModified, $eTag, $type, $size, $storageClass, $isLatest)
    {
        $this->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;
    }

    /**
     * @return int
     */
    public function getSize()
    {
        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 = "";
}
ObjectVersionListInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ObjectVersionListInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class ObjectVersionListInfo
 *
 * The class of return value of ListObjectVersions
 *
 * @package OSS\Model
 */
class ObjectVersionListInfo
{
    /**
     * ObjectVersionListInfo constructor.
     *
     * @param string $bucketName
     * @param string $prefix
     * @param string $keyMarker
     * @param string $nextKeyMarker
     * @param string $versionIdMarker
     * @param string $nextVersionIdMarker
     * @param string $maxKeys
     * @param string $delimiter
     * @param null $isTruncated
     * @param array $objectversionList
     * @param array $deleteMarkerList
     * @param array $prefixList
     */
    public function __construct($bucketName, $prefix, $keyMarker, $nextKeyMarker, $versionIdMarker, $nextVersionIdMarker
        , $maxKeys, $delimiter, $isTruncated
        , array $objectversionList, array $deleteMarkerList, array $prefixList)
    {
        $this->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();
}
PartInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/PartInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class PartInfo
 * @package OSS\Model
 */
class PartInfo
{
    /**
     * PartInfo constructor.
     *
     * @param int $partNumber
     * @param string $lastModified
     * @param string $eTag
     * @param int $size
     */
    public function __construct($partNumber, $lastModified, $eTag, $size)
    {
        $this->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;
    }

    /**
     * @return int
     */
    public function getSize()
    {
        return $this->size;
    }

    private $partNumber = 0;
    private $lastModified = "";
    private $eTag = "";
    private $size = 0;
}
PrefixInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/PrefixInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class PrefixInfo
 *
 * ListObjects return Prefix list of classes
 * The returned data contains two arrays
 * One is to get the list of objects【Can be understood as the corresponding file system file list】
 * One is to get Prefix list【Can be understood as the corresponding file system directory list】
 *
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
 */
class PrefixInfo
{
    /**
     * PrefixInfo constructor.
     * @param string $prefix
     */
    public function __construct($prefix)
    {
        $this->prefix = $prefix;
    }

    /**
     * @return string
     */
    public function getPrefix()
    {
        return $this->prefix;
    }

    private $prefix;
}
RefererConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/RefererConfig.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class RefererConfig
 *
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketReferer.html
 */
class RefererConfig implements XmlConfig
{
    /**
     * @param string $strXml
     * @return null
     */
    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        if (!isset($xml->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('<?xml version="1.0" encoding="utf-8"?><RefererConfiguration></RefererConfiguration>');
        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();
}
RequestPaymentConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/RequestPaymentConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class RequestPaymentConfig
 * @package OSS\Model
 *
 * @link https://help.aliyun.com/document_detail/117914.htm
 */
class RequestPaymentConfig implements XmlConfig
{
    /**
     * RequestPaymentConfig constructor.
     * @param null $payer
     */
    public function __construct($payer = null)
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><RequestPaymentConfiguration></RequestPaymentConfiguration>');
        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 = "";
}
RestoreConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/RestoreConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class RestoreConfig
 * @package OSS\Model
 *
 */
class RestoreConfig implements XmlConfig
{
    /**
     * RestoreConfig constructor.
     * @param int $day
     * @param null $tier
     */
    public function __construct($day, $tier = null)
    {
        $this->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 version="1.0" encoding="utf-8"?><RestoreRequest></RestoreRequest>');
        $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';
}
ServerSideEncryptionConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/ServerSideEncryptionConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class ServerSideEncryptionConfig
 * @package OSS\Model
 *
 * @link https://help.aliyun.com/document_detail/117914.htm
 */
class ServerSideEncryptionConfig implements XmlConfig
{
    /**
     * ServerSideEncryptionConfig constructor.
     * @param null $sseAlgorithm
     * @param null $kmsMasterKeyID
     */
    public function __construct($sseAlgorithm = null, $kmsMasterKeyID = null)
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><ServerSideEncryptionRule></ServerSideEncryptionRule>');
        $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 = "";
}
StorageCapacityConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/StorageCapacityConfig.php'
View Content
<?php

namespace OSS\Model;

use OSS\Core\OssException;

/**
 * Class StorageCapacityConfig
 *
 * @package OSS\Model
 * @link http://docs.alibaba-inc.com/pages/viewpage.action?pageId=271614763
 */
class StorageCapacityConfig implements XmlConfig
{
    /**
     * StorageCapacityConfig constructor.
     *
     * @param int $storageCapacity            
     */
    public function __construct($storageCapacity)
    {
        $this->storageCapacity = $storageCapacity;
    }

    /**
     * Not implemented
     */
    public function parseFromXml($strXml)
    {
        throw new OssException("Not implemented.");
    }

    /**
     * Serialize StorageCapacityConfig into xml
     *
     * @return string
     */
    public function serializeToXml()
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketUserQos></BucketUserQos>');
        $xml->addChild('StorageCapacity', strval($this->storageCapacity));
        return $xml->asXML();
    }

    /**
     * To string
     *
     * @return string
     */
    function __toString()
    {
        return $this->serializeToXml();
    }

    /**
     * Set storage capacity
     *
     * @param int $storageCapacity            
     */
    public function setStorageCapacity($storageCapacity)
    {
        $this->storageCapacity = $storageCapacity;
    }

    /**
     * Get storage capacity
     * 
     * @return int
     */
    public function getStorageCapacity()
    {
        return $this->storageCapacity;
    }

    private $storageCapacity = 0;
}
Tag.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/Tag.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class Tag
 * @package OSS\Model
 */
class Tag
{
    /**
     * Tag constructor.
     *
     * @param string $key
     * @param string $value
     */
    public function __construct($key, $value)
    {
        $this->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 = "";
}
TaggingConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/TaggingConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class TaggingConfig
 * @package OSS\Model
 *
 */
class TaggingConfig implements XmlConfig
{
    /**
     * TaggingConfig constructor.
     */
    public function __construct()
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><Tagging></Tagging>');
        $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();
}
UploadInfo.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/UploadInfo.php'
View Content
<?php

namespace OSS\Model;

/**
 * Class UploadInfo
 *
 * The return value of ListMultipartUpload
 *
 * @package OSS\Model
 */
class UploadInfo
{
    /**
     * UploadInfo constructor.
     *
     * @param string $key
     * @param string $uploadId
     * @param string $initiated
     */
    public function __construct($key, $uploadId, $initiated)
    {
        $this->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 = "";
}
VersioningConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/VersioningConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class VersioningConfig
 * @package OSS\Model
 *
 */
class VersioningConfig implements XmlConfig
{
    /**
     * VersioningConfig constructor.
     * @param null $status
     */
    public function __construct($status = null)
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><VersioningConfiguration></VersioningConfiguration>');
        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 = "";
}
WebsiteConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/WebsiteConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;


/**
 * Class WebsiteConfig
 * @package OSS\Model
 * @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketWebsite.html
 */
class WebsiteConfig implements XmlConfig
{
    /**
     * WebsiteConfig constructor.
     * @param  string $indexDocument
     * @param  string $errorDocument
     */
    public function __construct($indexDocument = "", $errorDocument = "")
    {
        $this->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('<?xml version="1.0" encoding="utf-8"?><WebsiteConfiguration></WebsiteConfiguration>');
        $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 = "";
}
WormConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/WormConfig.php'
View Content
<?php

namespace OSS\Model;


use OSS\Core\OssException;

/**
 * Class WormConfig
 * @package OSS\Model
 *
 */
class WormConfig implements XmlConfig
{
    /**
     * Parse WormConfig from the xml.
     *
     * @param string $strXml
     * @throws OssException
     * @return null
     */
    public function parseFromXml($strXml)
    {
        $xml = simplexml_load_string($strXml);
        if (isset($xml->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;
}
XmlConfig.php
wget 'https://sme10.lists2.roe3.org/kodbox/app/sdks/IO/oss/OSS/Model/XmlConfig.php'
View Content
<?php

namespace OSS\Model;

/**
 * Interface XmlConfig
 * @package OSS\Model
 */
interface XmlConfig
{

    /**
     * Interface method: Parse the object from the xml.
     *
     * @param string $strXml
     * @return null
     */
    public function parseFromXml($strXml);

    /**
     * Interface method: Serialize the object into xml.
     *
     * @return string
     */
    public function serializeToXml();

}