installed plugin W3 Total Cache version 2.3.2

This commit is contained in:
2023-06-05 11:23:16 +00:00
committed by Gitium
parent d9b3c97e40
commit 51ea2ff21c
2730 changed files with 334913 additions and 0 deletions

View File

@ -0,0 +1,246 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\WindowsAzureUtilities;
/**
* Represents a set of access conditions to be used for operations against the
* storage services.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class AccessCondition
{
/**
* Represents the header type.
*
* @var string
*/
private $_header = Resources::EMPTY_STRING;
/**
* Represents the header value.
*
* @var string
*/
private $_value;
/**
* Constructor
*
* @param string $headerType header name
* @param string $value header value
*/
protected function __construct($headerType, $value)
{
$this->setHeader($headerType);
$this->setValue($value);
}
/**
* Specifies that no access condition is set.
*
* @return \MicrosoftAzure\Storage\Blob\Models\AccessCondition
*/
public static function none()
{
return new AccessCondition(Resources::EMPTY_STRING, null);
}
/**
* Returns an access condition such that an operation will be performed only if
* the resource's ETag value matches the specified ETag value.
* <p>
* Setting this access condition modifies the request to include the HTTP
* <i>If-Match</i> conditional header. If this access condition is set, the
* operation is performed only if the ETag of the resource matches the specified
* ETag.
* <p>
* For more information, see
* <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642&clcid=0x409'>
* Specifying Conditional Headers for Blob Service Operations</a>.
*
* @param string $etag a string that represents the ETag value to check.
*
* @return \MicrosoftAzure\Storage\Blob\Models\AccessCondition
*/
public static function ifMatch($etag)
{
return new AccessCondition(Resources::IF_MATCH, $etag);
}
/**
* Returns an access condition such that an operation will be performed only if
* the resource has been modified since the specified time.
* <p>
* Setting this access condition modifies the request to include the HTTP
* <i>If-Modified-Since</i> conditional header. If this access condition is set,
* the operation is performed only if the resource has been modified since the
* specified time.
* <p>
* For more information, see
* <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642&clcid=0x409'>
* Specifying Conditional Headers for Blob Service Operations</a>.
*
* @param \DateTime $lastModified date that represents the last-modified
* time to check for the resource.
*
* @return \MicrosoftAzure\Storage\Blob\Models\AccessCondition
*/
public static function ifModifiedSince($lastModified)
{
Validate::isDate($lastModified);
return new AccessCondition(
Resources::IF_MODIFIED_SINCE,
$lastModified
);
}
/**
* Returns an access condition such that an operation will be performed only if
* the resource's ETag value does not match the specified ETag value.
* <p>
* Setting this access condition modifies the request to include the HTTP
* <i>If-None-Match</i> conditional header. If this access condition is set, the
* operation is performed only if the ETag of the resource does not match the
* specified ETag.
* <p>
* For more information,
* see <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642&clcid=0x409'>
* Specifying Conditional Headers for Blob Service Operations</a>.
*
* @param string $etag string that represents the ETag value to check.
*
* @return \MicrosoftAzure\Storage\Blob\Models\AccessCondition
*/
public static function ifNoneMatch($etag)
{
return new AccessCondition(Resources::IF_NONE_MATCH, $etag);
}
/**
* Returns an access condition such that an operation will be performed only if
* the resource has not been modified since the specified time.
* <p>
* Setting this access condition modifies the request to include the HTTP
* <i>If-Unmodified-Since</i> conditional header. If this access condition is
* set, the operation is performed only if the resource has not been modified
* since the specified time.
* <p>
* For more information, see
* <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642&clcid=0x409'>
* Specifying Conditional Headers for Blob Service Operations</a>.
*
* @param \DateTime $lastModified date that represents the last-modified
* time to check for the resource.
*
* @return \MicrosoftAzure\Storage\Blob\Models\AccessCondition
*/
public static function ifNotModifiedSince($lastModified)
{
Validate::isDate($lastModified);
return new AccessCondition(
Resources::IF_UNMODIFIED_SINCE,
$lastModified
);
}
/**
* Sets header type
*
* @param string $headerType can be one of Resources
*
* @return none.
*/
public function setHeader($headerType)
{
$valid = AccessCondition::isValid($headerType);
Validate::isTrue($valid, Resources::INVALID_HT_MSG);
$this->_header = $headerType;
}
/**
* Gets header type
*
* @return string.
*/
public function getHeader()
{
return $this->_header;
}
/**
* Sets the header value
*
* @param string $value the value to use
*
* @return none
*/
public function setValue($value)
{
$this->_value = $value;
}
/**
* Gets the header value
*
* @return string
*/
public function getValue()
{
return $this->_value;
}
/**
* Check if the $headerType belongs to valid header types
*
* @param string $headerType candidate header type
*
* @return boolean
*/
public static function isValid($headerType)
{
if ($headerType == Resources::EMPTY_STRING
|| $headerType == Resources::IF_UNMODIFIED_SINCE
|| $headerType == Resources::IF_MATCH
|| $headerType == Resources::IF_MODIFIED_SINCE
|| $headerType == Resources::IF_NONE_MATCH
) {
return true;
} else {
return false;
}
}
}

View File

@ -0,0 +1,141 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Holds container access policy elements
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class AccessPolicy
{
/**
* @var string
*/
private $_start;
/**
* @var \DateTime
*/
private $_expiry;
/**
* @var \DateTime
*/
private $_permission;
/**
* Gets start.
*
* @return \DateTime.
*/
public function getStart()
{
return $this->_start;
}
/**
* Sets start.
*
* @param \DateTime $start value.
*
* @return none.
*/
public function setStart($start)
{
Validate::isDate($start);
$this->_start = $start;
}
/**
* Gets expiry.
*
* @return \DateTime.
*/
public function getExpiry()
{
return $this->_expiry;
}
/**
* Sets expiry.
*
* @param \DateTime $expiry value.
*
* @return none.
*/
public function setExpiry($expiry)
{
Validate::isDate($expiry);
$this->_expiry = $expiry;
}
/**
* Gets permission.
*
* @return string.
*/
public function getPermission()
{
return $this->_permission;
}
/**
* Sets permission.
*
* @param string $permission value.
*
* @return none.
*/
public function setPermission($permission)
{
$this->_permission = $permission;
}
/**
* Converts this current object to XML representation.
*
* @return array.
*/
public function toArray()
{
$array = array();
$array['Start'] = Utilities::convertToEdmDateTime($this->_start);
$array['Expiry'] = Utilities::convertToEdmDateTime($this->_expiry);
$array['Permission'] = $this->_permission;
return $array;
}
}

View File

@ -0,0 +1,66 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Optional parameters for acquireLease wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class AcquireLeaseOptions extends BlobServiceOptions
{
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
}

View File

@ -0,0 +1,88 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* The result of calling acquireLease API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class AcquireLeaseResult
{
/**
* @var string
*/
private $_leaseId;
/**
* Creates AcquireLeaseResult from response headers
*
* @param array $headers response headers
*
* @return AcquireLeaseResult
*/
public static function create($headers)
{
$result = new AcquireLeaseResult();
$result->setLeaseId(
Utilities::tryGetValue($headers, Resources::X_MS_LEASE_ID)
);
return $result;
}
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
}

View File

@ -0,0 +1,174 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Represents windows azure blob object
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class Blob
{
/**
* @var string
*/
private $_name;
/**
* @var string
*/
private $_url;
/**
* @var string
*/
private $_snapshot;
/**
* @var array
*/
private $_metadata;
/**
* @var BlobProperties
*/
private $_properties;
/**
* Gets blob name.
*
* @return string.
*/
public function getName()
{
return $this->_name;
}
/**
* Sets blob name.
*
* @param string $name value.
*
* @return none.
*/
public function setName($name)
{
$this->_name = $name;
}
/**
* Gets blob snapshot.
*
* @return string.
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets blob snapshot.
*
* @param string $snapshot value.
*
* @return none.
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
/**
* Gets blob url.
*
* @return string.
*/
public function getUrl()
{
return $this->_url;
}
/**
* Sets blob url.
*
* @param string $url value.
*
* @return none.
*/
public function setUrl($url)
{
$this->_url = $url;
}
/**
* Gets blob metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets blob metadata.
*
* @param array $metadata value.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets blob properties.
*
* @return BlobProperties.
*/
public function getProperties()
{
return $this->_properties;
}
/**
* Sets blob properties.
*
* @param BlobProperties $properties value.
*
* @return none.
*/
public function setProperties($properties)
{
$this->_properties = $properties;
}
}

View File

@ -0,0 +1,63 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Holds available blob block types
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class BlobBlockType
{
const COMMITTED_TYPE = 'Committed';
const UNCOMMITTED_TYPE = 'Uncommitted';
const LATEST_TYPE = 'Latest';
/**
* Validates the provided type.
*
* @param string $type The entry type.
*
* @return boolean
*/
public static function isValid($type)
{
switch ($type) {
case self::COMMITTED_TYPE:
case self::LATEST_TYPE:
case self::UNCOMMITTED_TYPE:
return true;
default:
return false;
}
}
}

View File

@ -0,0 +1,68 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Represents BlobPrefix object
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class BlobPrefix
{
/**
* @var string
*/
private $_name;
/**
* Gets blob name.
*
* @return string.
*/
public function getName()
{
return $this->_name;
}
/**
* Sets blob name.
*
* @param string $name value.
*
* @return none.
*/
public function setName($name)
{
$this->_name = $name;
}
}

View File

@ -0,0 +1,431 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* Represents blob properties
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class BlobProperties
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* @var string
*/
private $_contentType;
/**
* @var integer
*/
private $_contentLength;
/**
* @var string
*/
private $_contentEncoding;
/**
* @var string
*/
private $_contentLanguage;
/**
* @var string
*/
private $_contentMD5;
/**
* @var string
*/
private $_contentRange;
/**
* @var string
*/
private $_cacheControl;
/**
* @var string
*/
private $_blobType;
/**
* @var string
*/
private $_leaseStatus;
/**
* @var integer
*/
private $_sequenceNumber;
/**
* Creates BlobProperties object from $parsed response in array representation
*
* @param array $parsed parsed response in array format.
*
* @return BlobProperties
*/
public static function create($parsed)
{
$result = new BlobProperties();
$clean = array_change_key_case($parsed);
$date = Utilities::tryGetValue($clean, Resources::LAST_MODIFIED);
$result->setBlobType(Utilities::tryGetValue($clean, 'blobtype'));
$result->setContentLength(intval($clean[Resources::CONTENT_LENGTH]));
$result->setETag(Utilities::tryGetValue($clean, Resources::ETAG));
if (!is_null($date)) {
$date = Utilities::rfc1123ToDateTime($date);
$result->setLastModified($date);
}
$result->setLeaseStatus(Utilities::tryGetValue($clean, 'leasestatus'));
$result->setLeaseStatus(
Utilities::tryGetValue(
$clean, Resources::X_MS_LEASE_STATUS, $result->getLeaseStatus()
)
);
$result->setSequenceNumber(
intval(
Utilities::tryGetValue($clean, Resources::X_MS_BLOB_SEQUENCE_NUMBER)
)
);
$result->setContentRange(
Utilities::tryGetValue($clean, Resources::CONTENT_RANGE)
);
$result->setCacheControl(
Utilities::tryGetValue($clean, Resources::CACHE_CONTROL)
);
$result->setBlobType(
Utilities::tryGetValue(
$clean, Resources::X_MS_BLOB_TYPE, $result->getBlobType()
)
);
$result->setContentEncoding(
Utilities::tryGetValue($clean, Resources::CONTENT_ENCODING)
);
$result->setContentLanguage(
Utilities::tryGetValue($clean, Resources::CONTENT_LANGUAGE)
);
$result->setContentMD5(
Utilities::tryGetValue($clean, Resources::CONTENT_MD5)
);
$result->setContentType(
Utilities::tryGetValue($clean, Resources::CONTENT_TYPE)
);
return $result;
}
/**
* Gets blob lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
Validate::isDate($lastModified);
$this->_lastModified = $lastModified;
}
/**
* Gets blob etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets blob etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
$this->_etag = $etag;
}
/**
* Gets blob contentType.
*
* @return string.
*/
public function getContentType()
{
return $this->_contentType;
}
/**
* Sets blob contentType.
*
* @param string $contentType value.
*
* @return none.
*/
public function setContentType($contentType)
{
$this->_contentType = $contentType;
}
/**
* Gets blob contentRange.
*
* @return string.
*/
public function getContentRange()
{
return $this->_contentRange;
}
/**
* Sets blob contentRange.
*
* @param string $contentRange value.
*
* @return none.
*/
public function setContentRange($contentRange)
{
$this->_contentRange = $contentRange;
}
/**
* Gets blob contentLength.
*
* @return integer.
*/
public function getContentLength()
{
return $this->_contentLength;
}
/**
* Sets blob contentLength.
*
* @param integer $contentLength value.
*
* @return none.
*/
public function setContentLength($contentLength)
{
Validate::isInteger($contentLength, 'contentLength');
$this->_contentLength = $contentLength;
}
/**
* Gets blob contentEncoding.
*
* @return string.
*/
public function getContentEncoding()
{
return $this->_contentEncoding;
}
/**
* Sets blob contentEncoding.
*
* @param string $contentEncoding value.
*
* @return none.
*/
public function setContentEncoding($contentEncoding)
{
$this->_contentEncoding = $contentEncoding;
}
/**
* Gets blob contentLanguage.
*
* @return string.
*/
public function getContentLanguage()
{
return $this->_contentLanguage;
}
/**
* Sets blob contentLanguage.
*
* @param string $contentLanguage value.
*
* @return none.
*/
public function setContentLanguage($contentLanguage)
{
$this->_contentLanguage = $contentLanguage;
}
/**
* Gets blob contentMD5.
*
* @return string.
*/
public function getContentMD5()
{
return $this->_contentMD5;
}
/**
* Sets blob contentMD5.
*
* @param string $contentMD5 value.
*
* @return none.
*/
public function setContentMD5($contentMD5)
{
$this->_contentMD5 = $contentMD5;
}
/**
* Gets blob cacheControl.
*
* @return string.
*/
public function getCacheControl()
{
return $this->_cacheControl;
}
/**
* Sets blob cacheControl.
*
* @param string $cacheControl value.
*
* @return none.
*/
public function setCacheControl($cacheControl)
{
$this->_cacheControl = $cacheControl;
}
/**
* Gets blob blobType.
*
* @return string.
*/
public function getBlobType()
{
return $this->_blobType;
}
/**
* Sets blob blobType.
*
* @param string $blobType value.
*
* @return none.
*/
public function setBlobType($blobType)
{
$this->_blobType = $blobType;
}
/**
* Gets blob leaseStatus.
*
* @return string.
*/
public function getLeaseStatus()
{
return $this->_leaseStatus;
}
/**
* Sets blob leaseStatus.
*
* @param string $leaseStatus value.
*
* @return none.
*/
public function setLeaseStatus($leaseStatus)
{
$this->_leaseStatus = $leaseStatus;
}
/**
* Gets blob sequenceNumber.
*
* @return int.
*/
public function getSequenceNumber()
{
return $this->_sequenceNumber;
}
/**
* Sets blob sequenceNumber.
*
* @param int $sequenceNumber value.
*
* @return none.
*/
public function setSequenceNumber($sequenceNumber)
{
Validate::isInteger($sequenceNumber, 'sequenceNumber');
$this->_sequenceNumber = $sequenceNumber;
}
}

View File

@ -0,0 +1,65 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Blob service options.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class BlobServiceOptions
{
private $_timeout;
/**
* Gets timeout.
*
* @return string.
*/
public function getTimeout()
{
return $this->_timeout;
}
/**
* Sets timeout.
*
* @param string $timeout value.
*
* @return none.
*/
public function setTimeout($timeout)
{
$this->_timeout = $timeout;
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Encapsulates blob types
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class BlobType
{
const BLOCK_BLOB = 'BlockBlob';
const PAGE_BLOB = 'PageBlob';
}

View File

@ -0,0 +1,99 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Holds information about blob block.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class Block
{
/**
* @var string
*/
private $_blockId;
/**
* @var string
*/
private $_type;
public function __construct($blockId = '', $type = '')
{
$this->_blockId = $blockId;
$this->_type = $type;
}
/**
* Sets the blockId.
*
* @param string $blockId The id of the block.
*
* @return none
*/
public function setBlockId($blockId)
{
$this->_blockId = $blockId;
}
/**
* Gets the blockId.
*
* @return string
*/
public function getBlockId()
{
return $this->_blockId;
}
/**
* Sets the type.
*
* @param string $type The type of the block.
*
* @return none
*/
public function setType($type)
{
$this->_type = $type;
}
/**
* Gets the type.
*
* @return string
*/
public function getType()
{
return $this->_type;
}
}

View File

@ -0,0 +1,175 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer;
use MicrosoftAzure\Storage\Blob\Models\Block;
/**
* Holds block list used for commitBlobBlocks
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class BlockList
{
/**
* @var array
*/
private $_entries;
public static $xmlRootName = 'BlockList';
/**
* Creates block list from array of blocks.
*
* @param array $array The blocks array.
*
* @return BlockList
*/
public static function create($array)
{
$blockList = new BlockList();
foreach ($array as $value) {
$blockList->addEntry($value->getBlockId(), $value->getType());
}
return $blockList;
}
/**
* Adds new entry to the block list entries.
*
* @param string $blockId The block id.
* @param string $type The entry type, you can use BlobBlockType.
*
* @return none
*/
public function addEntry($blockId, $type)
{
Validate::isString($blockId, 'blockId');
Validate::isTrue(
BlobBlockType::isValid($type),
sprintf(Resources::INVALID_BTE_MSG, get_class(new BlobBlockType()))
);
$block = new Block();
$block->setBlockId($blockId);
$block->setType($type);
$this->_entries[] = $block;
}
/**
* Addds committed block entry.
*
* @param string $blockId The block id.
*
* @return none
*/
public function addCommittedEntry($blockId)
{
$this->addEntry($blockId, BlobBlockType::COMMITTED_TYPE);
}
/**
* Addds uncommitted block entry.
*
* @param string $blockId The block id.
*
* @return none
*/
public function addUncommittedEntry($blockId)
{
$this->addEntry($blockId, BlobBlockType::UNCOMMITTED_TYPE);
}
/**
* Addds latest block entry.
*
* @param string $blockId The block id.
*
* @return none
*/
public function addLatestEntry($blockId)
{
$this->addEntry($blockId, BlobBlockType::LATEST_TYPE);
}
/**
* Gets blob block entry.
*
* @param string $blockId The id of the block.
*
* @return Block
*/
public function getEntry($blockId)
{
foreach ($this->_entries as $value) {
if ($blockId == $value->getBlockId()) {
return $value;
}
}
return null;
}
/**
* Gets all blob block entries.
*
* @return string
*/
public function getEntries()
{
return $this->_entries;
}
/**
* Converts the BlockList object to XML representation
*
* @param XmlSerializer $xmlSerializer The XML serializer.
*
* @return string
*/
public function toXml($xmlSerializer)
{
$properties = array(XmlSerializer::ROOT_NAME => self::$xmlRootName);
$array = array();
foreach ($this->_entries as $value) {
$array[] = array(
$value->getType() => $value->getBlockId()
);
}
return $xmlSerializer->serialize($array, $properties);
}
}

View File

@ -0,0 +1,86 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* The result of calling breakLease API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class BreakLeaseResult
{
/**
* @var string
*/
private $_leaseTime;
/**
* Creates BreakLeaseResult from response headers
*
* @param array $headers response headers
*
* @return BreakLeaseResult
*/
public static function create($headers)
{
$result = new BreakLeaseResult();
$result->setLeaseTime(
Utilities::tryGetValue($headers, Resources::X_MS_LEASE_TIME)
);
return $result;
}
/**
* Gets lease time.
*
* @return string
*/
public function getLeaseTime()
{
return $this->_leaseTime;
}
/**
* Sets lease time.
*
* @param string $leaseTime the blob lease time.
*
* @return none
*/
public function setLeaseTime($leaseTime)
{
$this->_leaseTime = $leaseTime;
}
}

View File

@ -0,0 +1,258 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for commitBlobBlocks
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CommitBlobBlocksOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_blobContentType;
/**
* @var string
*/
private $_blobContentEncoding;
/**
* @var string
*/
private $_blobContentLanguage;
/**
* @var string
*/
private $_blobContentMD5;
/**
* @var string
*/
private $_blobCacheControl;
/**
* @var array
*/
private $_metadata;
/**
* @var string
*/
private $_leaseId;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets blob ContentType.
*
* @return string.
*/
public function getBlobContentType()
{
return $this->_blobContentType;
}
/**
* Sets blob ContentType.
*
* @param string $blobContentType value.
*
* @return none.
*/
public function setBlobContentType($blobContentType)
{
$this->_blobContentType = $blobContentType;
}
/**
* Gets blob ContentEncoding.
*
* @return string.
*/
public function getBlobContentEncoding()
{
return $this->_blobContentEncoding;
}
/**
* Sets blob ContentEncoding.
*
* @param string $blobContentEncoding value.
*
* @return none.
*/
public function setBlobContentEncoding($blobContentEncoding)
{
$this->_blobContentEncoding = $blobContentEncoding;
}
/**
* Gets blob ContentLanguage.
*
* @return string.
*/
public function getBlobContentLanguage()
{
return $this->_blobContentLanguage;
}
/**
* Sets blob ContentLanguage.
*
* @param string $blobContentLanguage value.
*
* @return none.
*/
public function setBlobContentLanguage($blobContentLanguage)
{
$this->_blobContentLanguage = $blobContentLanguage;
}
/**
* Gets blob ContentMD5.
*
* @return string.
*/
public function getBlobContentMD5()
{
return $this->_blobContentMD5;
}
/**
* Sets blob ContentMD5.
*
* @param string $blobContentMD5 value.
*
* @return none.
*/
public function setBlobContentMD5($blobContentMD5)
{
$this->_blobContentMD5 = $blobContentMD5;
}
/**
* Gets blob cache control.
*
* @return string.
*/
public function getBlobCacheControl()
{
return $this->_blobCacheControl;
}
/**
* Sets blob cacheControl.
*
* @param string $blobCacheControl value to use.
*
* @return none.
*/
public function setBlobCacheControl($blobCacheControl)
{
$this->_blobCacheControl = $blobCacheControl;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets blob metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets blob metadata.
*
* @param array $metadata value.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
}

View File

@ -0,0 +1,150 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* WindowsAzure container object.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class Container
{
/**
* @var string
*/
private $_name;
/**
* @var string
*/
private $_url;
/**
* @var array
*/
private $_metadata;
/**
* @var ContainerProperties
*/
private $_properties;
/**
* Gets container name.
*
* @return string.
*/
public function getName()
{
return $this->_name;
}
/**
* Sets container name.
*
* @param string $name value.
*
* @return none.
*/
public function setName($name)
{
$this->_name = $name;
}
/**
* Gets container url.
*
* @return string.
*/
public function getUrl()
{
return $this->_url;
}
/**
* Sets container url.
*
* @param string $url value.
*
* @return none.
*/
public function setUrl($url)
{
$this->_url = $url;
}
/**
* Gets container metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets container metadata.
*
* @param array $metadata value.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets container properties
*
* @return ContainerProperties
*/
public function getProperties()
{
return $this->_properties;
}
/**
* Sets container properties
*
* @param ContainerProperties $properties container properties
*
* @return none.
*/
public function setProperties($properties)
{
$this->_properties = $properties;
}
}

View File

@ -0,0 +1,218 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Blob\Models\AccessPolicy;
use MicrosoftAzure\Storage\Blob\Models\SignedIdentifier;
use MicrosoftAzure\Storage\Blob\Models\PublicAccessType;
use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer;
/**
* Holds conatiner ACL members.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ContainerAcl
{
/**
* All available types can be found in PublicAccessType
*
* @var string
*/
private $_publicAccess;
/**
* @var array
*/
private $_signedIdentifiers = array();
/*
* The root name of XML elemenet representation.
*
* @var string
*/
public static $xmlRootName = 'SignedIdentifiers';
/**
* Parses the given array into signed identifiers.
*
* @param string $publicAccess The container public access.
* @param array $parsed The parsed response into array representation.
*
* @return none
*/
public static function create($publicAccess, $parsed)
{
$result = new ContainerAcl();
$result->_publicAccess = $publicAccess;
$result->_signedIdentifiers = array();
if (!empty($parsed) && is_array($parsed['SignedIdentifier'])) {
$entries = $parsed['SignedIdentifier'];
$temp = Utilities::getArray($entries);
foreach ($temp as $value) {
$startString = urldecode($value['AccessPolicy']['Start']);
$expiryString = urldecode($value['AccessPolicy']['Expiry']);
$start = Utilities::convertToDateTime($startString);
$expiry = Utilities::convertToDateTime($expiryString);
$permission = $value['AccessPolicy']['Permission'];
$id = $value['Id'];
$result->addSignedIdentifier($id, $start, $expiry, $permission);
}
}
return $result;
}
/**
* Gets container signed modifiers.
*
* @return array.
*/
public function getSignedIdentifiers()
{
return $this->_signedIdentifiers;
}
/**
* Sets container signed modifiers.
*
* @param array $signedIdentifiers value.
*
* @return none.
*/
public function setSignedIdentifiers($signedIdentifiers)
{
$this->_signedIdentifiers = $signedIdentifiers;
}
/**
* Gets container publicAccess.
*
* @return string.
*/
public function getPublicAccess()
{
return $this->_publicAccess;
}
/**
* Sets container publicAccess.
*
* @param string $publicAccess value.
*
* @return none.
*/
public function setPublicAccess($publicAccess)
{
Validate::isTrue(
PublicAccessType::isValid($publicAccess),
Resources::INVALID_BLOB_PAT_MSG
);
$this->_publicAccess = $publicAccess;
}
/**
* Adds new signed modifier
*
* @param string $id a unique id for this modifier
* @param \DateTime $start The time at which the Shared Access Signature
* becomes valid. If omitted, start time for this call is assumed to be
* the time when the Blob service receives the request.
* @param \DateTime $expiry The time at which the Shared Access Signature
* becomes invalid. This field may be omitted if it has been specified as
* part of a container-level access policy.
* @param string $permission The permissions associated with the Shared
* Access Signature. The user is restricted to operations allowed by the
* permissions. Valid permissions values are read (r), write (w), delete (d) and
* list (l).
*
* @return none.
*
* @see http://msdn.microsoft.com/en-us/library/windowsazure/hh508996.aspx
*/
public function addSignedIdentifier($id, $start, $expiry, $permission)
{
Validate::isString($id, 'id');
Validate::isDate($start);
Validate::isDate($expiry);
Validate::isString($permission, 'permission');
$accessPolicy = new AccessPolicy();
$accessPolicy->setStart($start);
$accessPolicy->setExpiry($expiry);
$accessPolicy->setPermission($permission);
$signedIdentifier = new SignedIdentifier();
$signedIdentifier->setId($id);
$signedIdentifier->setAccessPolicy($accessPolicy);
$this->_signedIdentifiers[] = $signedIdentifier;
}
/**
* Converts this object to array representation for XML serialization
*
* @return array.
*/
public function toArray()
{
$array = array();
foreach ($this->_signedIdentifiers as $value) {
$array[] = $value->toArray();
}
return $array;
}
/**
* Converts this current object to XML representation.
*
* @param XmlSerializer $xmlSerializer The XML serializer.
*
* @return string.
*/
public function toXml($xmlSerializer)
{
$properties = array(
XmlSerializer::DEFAULT_TAG => 'SignedIdentifier',
XmlSerializer::ROOT_NAME => self::$xmlRootName
);
return $xmlSerializer->serialize($this->toArray(), $properties);
}
}

View File

@ -0,0 +1,95 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Holds container properties fields
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ContainerProperties
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* Gets container lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets container lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
$this->_lastModified = $lastModified;
}
/**
* Gets container etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets container etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
$this->_etag = $etag;
}
}

View File

@ -0,0 +1,205 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* optional parameters for CopyBlobOptions wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CopyBlobOptions extends BlobServiceOptions
{
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* @var AccessCondition
*/
private $_sourceAccessCondition;
/**
* @var array
*/
private $_metadata;
/**
* @var string
*/
private $_sourceSnapshot;
/**
* @var string
*/
private $_leaseId;
/**
* @var sourceLeaseId
*/
private $_sourceLeaseId;
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets source access condition
*
* @return SourceAccessCondition
*/
public function getSourceAccessCondition()
{
return $this->_sourceAccessCondition;
}
/**
* Sets source access condition
*
* @param SourceAccessCondition $sourceAccessCondition value to use.
*
* @return none.
*/
public function setSourceAccessCondition($sourceAccessCondition)
{
$this->_sourceAccessCondition = $sourceAccessCondition;
}
/**
* Gets metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets metadata.
*
* @param array $metadata value.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets source snapshot.
*
* @return string
*/
public function getSourceSnapshot()
{
return $this->_sourceSnapshot;
}
/**
* Sets source snapshot.
*
* @param string $sourceSnapshot value.
*
* @return none
*/
public function setSourceSnapshot($sourceSnapshot)
{
$this->_sourceSnapshot = $sourceSnapshot;
}
/**
* Gets lease ID.
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease ID.
*
* @param string $leaseId value.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets source lease ID.
*
* @return string
*/
public function getSourceLeaseId()
{
return $this->_sourceLeaseId;
}
/**
* Sets source lease ID.
*
* @param string $sourceLeaseId value.
*
* @return none
*/
public function setSourceLeaseId($sourceLeaseId)
{
$this->_sourceLeaseId = $sourceLeaseId;
}
}

View File

@ -0,0 +1,123 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* The result of calling copyBlob API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CopyBlobResult
{
/**
* @var string
*/
private $_etag;
/**
* @var \DateTime
*/
private $_lastModified;
/**
* Creates CopyBlobResult object from the response of the copy blob request.
*
* @param array $headers The HTTP response headers in array representation.
*
* @return CopyBlobResult
*/
public static function create($headers)
{
$result = new CopyBlobResult();
$result->setETag(
Utilities::tryGetValueInsensitive(
Resources::ETAG,
$headers
)
);
if (Utilities::arrayKeyExistsInsensitive(Resources::LAST_MODIFIED, $headers)) {
$lastModified = Utilities::tryGetValueInsensitive(
Resources::LAST_MODIFIED,
$headers
);
$result->setLastModified(Utilities::rfc1123ToDateTime($lastModified));
}
return $result;
}
/**
* Gets ETag.
*
* @return string
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets ETag.
*
* @param string $etag value.
*
* @return none
*/
public function setETag($etag)
{
$this->_etag = $etag;
}
/**
* Gets blob lastModified.
*
* @return \DateTime
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none
*/
public function setLastModified($lastModified)
{
$this->_lastModified = $lastModified;
}
}

View File

@ -0,0 +1,139 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Blob\Models\CreateBlobOptions;
/**
* Optional parameters for createBlobBlock wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CreateBlobBlockOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_contentMD5;
/**
* @var string
*/
private $_leaseId;
/**
* @var int
*/
private $_numberOfConcurrency;
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets blob contentMD5.
*
* @return string.
*/
public function getContentMD5()
{
return $this->_contentMD5;
}
/**
* Sets blob contentMD5.
*
* @param string $contentMD5 value.
*
* @return none.
*/
public function setContentMD5($contentMD5)
{
$this->_contentMD5 = $contentMD5;
}
/**
* Gets number of concurrency for sending a blob.
*
* @return int
*/
public function getNumberOfConcurrency()
{
return $this->_numberOfConcurrency;
}
/**
* Sets number of concurrency for sending a blob.
*
* @param int $numberOfConcurrency the number of concurrent requests.
*/
public function setNumberOfConcurrency($numberOfConcurrency)
{
$this->_numberOfConcurrency = $numberOfConcurrency;
}
/**
* Construct a CreateBlobBlockOptions object from a createBlobOptions.
*
* @param CreateBlobOptions $createBlobOptions
*
* @return CreateBlobBlockOptions
*/
public static function create($createBlobOptions)
{
$result = new CreateBlobBlockOptions();
$result->setTimeout($createBlobOptions->getTimeout());
$result->setContentMD5($createBlobOptions->getContentMD5());
$result->setLeaseId($createBlobOptions->getLeaseId());
$result->setNumberOfConcurrency(
$createBlobOptions->getNumberOfConcurrency()
);
return $result;
}
}

View File

@ -0,0 +1,520 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Blob\Models\CreateBlobBlockOptions;
/**
* optional parameters for createXXXBlob wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CreateBlobOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_contentType;
/**
* @var string
*/
private $_contentEncoding;
/**
* @var string
*/
private $_contentLanguage;
/**
* @var string
*/
private $_contentMD5;
/**
* @var string
*/
private $_cacheControl;
/**
* @var string
*/
private $_blobContentType;
/**
* @var string
*/
private $_blobContentEncoding;
/**
* @var string
*/
private $_blobContentLanguage;
/**
* @var integer
*/
private $_blobContentLength;
/**
* @var string
*/
private $_blobContentMD5;
/**
* @var string
*/
private $_blobCacheControl;
/**
* @var array
*/
private $_metadata;
/**
* @var string
*/
private $_leaseId;
/**
* @var integer
*/
private $_sequenceNumber;
/**
* @var string
*/
private $_sequenceNumberAction;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* @var int
*/
private $_numberOfConcurrency;
/**
* Gets blob ContentType.
*
* @return string.
*/
public function getBlobContentType()
{
return $this->_blobContentType;
}
/**
* Sets blob ContentType.
*
* @param string $blobContentType value.
*
* @return none.
*/
public function setBlobContentType($blobContentType)
{
$this->_blobContentType = $blobContentType;
}
/**
* Gets blob ContentEncoding.
*
* @return string.
*/
public function getBlobContentEncoding()
{
return $this->_blobContentEncoding;
}
/**
* Sets blob ContentEncoding.
*
* @param string $blobContentEncoding value.
*
* @return none.
*/
public function setBlobContentEncoding($blobContentEncoding)
{
$this->_blobContentEncoding = $blobContentEncoding;
}
/**
* Gets blob ContentLanguage.
*
* @return string.
*/
public function getBlobContentLanguage()
{
return $this->_blobContentLanguage;
}
/**
* Sets blob ContentLanguage.
*
* @param string $blobContentLanguage value.
*
* @return none.
*/
public function setBlobContentLanguage($blobContentLanguage)
{
$this->_blobContentLanguage = $blobContentLanguage;
}
/**
* Gets blob ContentLength.
*
* @return integer.
*/
public function getBlobContentLength()
{
return $this->_blobContentLength;
}
/**
* Sets blob ContentLength.
*
* @param integer $blobContentLength value.
*
* @return none.
*/
public function setBlobContentLength($blobContentLength)
{
Validate::isInteger($blobContentLength, 'blobContentLength');
$this->_blobContentLength = $blobContentLength;
}
/**
* Gets blob ContentMD5.
*
* @return string.
*/
public function getBlobContentMD5()
{
return $this->_blobContentMD5;
}
/**
* Sets blob ContentMD5.
*
* @param string $blobContentMD5 value.
*
* @return none.
*/
public function setBlobContentMD5($blobContentMD5)
{
$this->_blobContentMD5 = $blobContentMD5;
}
/**
* Gets blob cache control.
*
* @return string.
*/
public function getBlobCacheControl()
{
return $this->_blobCacheControl;
}
/**
* Sets blob cacheControl.
*
* @param string $blobCacheControl value to use.
*
* @return none.
*/
public function setBlobCacheControl($blobCacheControl)
{
$this->_blobCacheControl = $blobCacheControl;
}
/**
* Gets blob contentType.
*
* @return string.
*/
public function getContentType()
{
return $this->_contentType;
}
/**
* Sets blob contentType.
*
* @param string $contentType value.
*
* @return none.
*/
public function setContentType($contentType)
{
$this->_contentType = $contentType;
}
/**
* Gets contentEncoding.
*
* @return string.
*/
public function getContentEncoding()
{
return $this->_contentEncoding;
}
/**
* Sets contentEncoding.
*
* @param string $contentEncoding value.
*
* @return none.
*/
public function setContentEncoding($contentEncoding)
{
$this->_contentEncoding = $contentEncoding;
}
/**
* Gets contentLanguage.
*
* @return string.
*/
public function getContentLanguage()
{
return $this->_contentLanguage;
}
/**
* Sets contentLanguage.
*
* @param string $contentLanguage value.
*
* @return none.
*/
public function setContentLanguage($contentLanguage)
{
$this->_contentLanguage = $contentLanguage;
}
/**
* Gets contentMD5.
*
* @return string.
*/
public function getContentMD5()
{
return $this->_contentMD5;
}
/**
* Sets contentMD5.
*
* @param string $contentMD5 value.
*
* @return none.
*/
public function setContentMD5($contentMD5)
{
$this->_contentMD5 = $contentMD5;
}
/**
* Gets cacheControl.
*
* @return string.
*/
public function getCacheControl()
{
return $this->_cacheControl;
}
/**
* Sets cacheControl.
*
* @param string $cacheControl value to use.
*
* @return none.
*/
public function setCacheControl($cacheControl)
{
$this->_cacheControl = $cacheControl;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets blob metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets blob metadata.
*
* @param array $metadata value.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets blob sequenceNumber.
*
* @return int.
*/
public function getSequenceNumber()
{
return $this->_sequenceNumber;
}
/**
* Sets blob sequenceNumber.
*
* @param int $sequenceNumber value.
*
* @return none.
*/
public function setSequenceNumber($sequenceNumber)
{
Validate::isInteger($sequenceNumber, 'sequenceNumber');
$this->_sequenceNumber = $sequenceNumber;
}
/**
* Gets blob sequenceNumberAction.
*
* @return string.
*/
public function getSequenceNumberAction()
{
return $this->_sequenceNumberAction;
}
/**
* Sets blob sequenceNumberAction.
*
* @param string $sequenceNumberAction value.
*
* @return none.
*/
public function setSequenceNumberAction($sequenceNumberAction)
{
$this->_sequenceNumberAction = $sequenceNumberAction;
}
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets number of concurrency for sending a blob.
*
* @return int
*/
public function getNumberOfConcurrency()
{
return $this->_numberOfConcurrency;
}
/**
* Sets number of concurrency for sending a blob.
*
* @param int $numberOfConcurrency the number of concurrent requests.
*/
public function setNumberOfConcurrency($numberOfConcurrency)
{
$this->_numberOfConcurrency = $numberOfConcurrency;
}
/**
* Construct a CreateBlobOptions object from a createBlockBlobOptions.
*
* @param CreateBlobBlockOptions $createBlobBlockOptions
*
* @return CreateBlobOptions
*/
public static function create($createBlobBlockOptions)
{
$result = new CreateBlobOptions();
$result->setTimeout($createBlobBlockOptions->getTimeout());
$result->setContentMD5($createBlobBlockOptions->getContentMD5());
$result->setLeaseId($createBlobBlockOptions->getLeaseId());
$result->setNumberOfConcurrency(
$createBlobBlockOptions->getNumberOfConcurrency()
);
return $result;
}
}

View File

@ -0,0 +1,122 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Optional parameters for create and clear blob pages
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CreateBlobPagesOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_contentMD5;
/**
* @var string
*/
private $_leaseId;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets blob contentMD5.
*
* @return string.
*/
public function getContentMD5()
{
return $this->_contentMD5;
}
/**
* Sets blob contentMD5.
*
* @param string $contentMD5 value.
*
* @return none.
*/
public function setContentMD5($contentMD5)
{
$this->_contentMD5 = $contentMD5;
}
}

View File

@ -0,0 +1,184 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* Holds result of calling create or clear blob pages
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CreateBlobPagesResult
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* @var integer
*/
private $_sequenceNumber;
/**
* @var string
*/
private $_contentMD5;
/**
* Creates CreateBlobPagesResult object from $parsed response in array
* representation
*
* @param array $headers HTTP response headers
*
* @return CreateBlobPagesResult
*/
public static function create($headers)
{
$result = new CreateBlobPagesResult();
$clean = array_change_key_case($headers);
$date = $clean[Resources::LAST_MODIFIED];
$date = Utilities::rfc1123ToDateTime($date);
$result->setETag($clean[Resources::ETAG]);
$result->setLastModified($date);
$result->setContentMD5(
Utilities::tryGetValue($clean, Resources::CONTENT_MD5)
);
$result->setSequenceNumber(
intval(
Utilities::tryGetValue($clean, Resources::X_MS_BLOB_SEQUENCE_NUMBER)
)
);
return $result;
}
/**
* Gets blob lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
Validate::isDate($lastModified);
$this->_lastModified = $lastModified;
}
/**
* Gets blob etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets blob etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
Validate::isString($etag, 'etag');
$this->_etag = $etag;
}
/**
* Gets blob contentMD5.
*
* @return string.
*/
public function getContentMD5()
{
return $this->_contentMD5;
}
/**
* Sets blob contentMD5.
*
* @param string $contentMD5 value.
*
* @return none.
*/
public function setContentMD5($contentMD5)
{
$this->_contentMD5 = $contentMD5;
}
/**
* Gets blob sequenceNumber.
*
* @return int.
*/
public function getSequenceNumber()
{
return $this->_sequenceNumber;
}
/**
* Sets blob sequenceNumber.
*
* @param int $sequenceNumber value.
*
* @return none.
*/
public function setSequenceNumber($sequenceNumber)
{
Validate::isInteger($sequenceNumber, 'sequenceNumber');
$this->_sequenceNumber = $sequenceNumber;
}
}

View File

@ -0,0 +1,123 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* The optional parameters for createBlobSnapshot wrapper.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CreateBlobSnapshotOptions extends BlobServiceOptions
{
/**
* @var array
*/
private $_metadata;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* @var string
*/
private $_leaseId;
/**
* Gets metadata.
*
* @return array
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets metadata.
*
* @param array $metadata The metadata array.
*
* @return none
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets access condition.
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition.
*
* @param AccessCondition $accessCondition The access condition object.
*
* @return none
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets lease Id.
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id.
*
* @param string $leaseId The lease Id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
}

View File

@ -0,0 +1,154 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* The result of creating Blob snapshot.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CreateBlobSnapshotResult
{
/**
* A DateTime value which uniquely identifies the snapshot.
* @var string
*/
private $_snapshot;
/**
* The ETag for the destination blob.
* @var string
*/
private $_etag;
/**
* The date/time that the copy operation to the destination blob completed.
* @var \DateTime
*/
private $_lastModified;
/**
* Creates CreateBlobSnapshotResult object from the response of the
* create Blob snapshot request.
*
* @param array $headers The HTTP response headers in array representation.
*
* @return CreateBlobSnapshotResult
*/
public static function create($headers)
{
$result = new CreateBlobSnapshotResult();
$headerWithLowerCaseKey = array_change_key_case($headers);
$result->setETag($headerWithLowerCaseKey[Resources::ETAG]);
$result->setLastModified(
Utilities::rfc1123ToDateTime(
$headerWithLowerCaseKey[Resources::LAST_MODIFIED]
)
);
$result->setSnapshot($headerWithLowerCaseKey[Resources::X_MS_SNAPSHOT]);
return $result;
}
/**
* Gets snapshot.
*
* @return string
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets snapshot.
*
* @param string $snapshot value.
*
* @return none
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
/**
* Gets ETag.
*
* @return string
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets ETag.
*
* @param string $etag value.
*
* @return none
*/
public function setETag($etag)
{
$this->_etag = $etag;
}
/**
* Gets blob lastModified.
*
* @return \DateTime
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none
*/
public function setLastModified($lastModified)
{
$this->_lastModified = $lastModified;
}
}

View File

@ -0,0 +1,123 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Blob\Models\BlobServiceOptions;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for createContainer API
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class CreateContainerOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_publicAccess;
/**
* @var array
*/
private $_metadata;
/**
* Gets container public access.
*
* @return string.
*/
public function getPublicAccess()
{
return $this->_publicAccess;
}
/**
* Specifies whether data in the container may be accessed publicly and the level
* of access. Possible values include:
* 1) container: Specifies full public read access for container and blob data.
* Clients can enumerate blobs within the container via anonymous request, but
* cannot enumerate containers within the storage account.
* 2) blob: Specifies public read access for blobs. Blob data within this
* container can be read via anonymous request, but container data is not
* available. Clients cannot enumerate blobs within the container via
* anonymous request.
* If this value is not specified in the request, container data is private to
* the account owner.
*
* @param string $publicAccess access modifier for the container
*
* @return none.
*/
public function setPublicAccess($publicAccess)
{
Validate::isString($publicAccess, 'publicAccess');
$this->_publicAccess = $publicAccess;
}
/**
* Gets user defined metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets user defined metadata. This metadata should be added without the header
* prefix (x-ms-meta-*).
*
* @param array $metadata user defined metadata object in array form.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Adds new metadata element. This element should be added without the header
* prefix (x-ms-meta-*).
*
* @param string $key metadata key element.
* @param string $value metadata value element.
*
* @return none.
*/
public function addMetadata($key, $value)
{
$this->_metadata[$key] = $value;
}
}

View File

@ -0,0 +1,151 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for deleteBlob wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class DeleteBlobOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_leaseId;
/**
* @var string
*/
private $_snapshot;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* @var boolean
*/
private $_deleteSnaphotsOnly;
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets blob snapshot.
*
* @return string.
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets blob snapshot.
*
* @param string $snapshot value.
*
* @return none.
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
/**
* Gets blob deleteSnaphotsOnly.
*
* @return boolean.
*/
public function getDeleteSnaphotsOnly()
{
return $this->_deleteSnaphotsOnly;
}
/**
* Sets blob deleteSnaphotsOnly.
*
* @param string $deleteSnaphotsOnly value.
*
* @return boolean.
*/
public function setDeleteSnaphotsOnly($deleteSnaphotsOnly)
{
Validate::isBoolean($deleteSnaphotsOnly);
$this->_deleteSnaphotsOnly = $deleteSnaphotsOnly;
}
}

View File

@ -0,0 +1,66 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* The optional for deleteContainer API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class DeleteContainerOptions extends BlobServiceOptions
{
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
}

View File

@ -0,0 +1,122 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Optional parameters for getBlobMetadata wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetBlobMetadataOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_leaseId;
/**
* @var string
*/
private $_snapshot;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets blob snapshot.
*
* @return string.
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets blob snapshot.
*
* @param string $snapshot value.
*
* @return none.
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
}

View File

@ -0,0 +1,147 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* Holds results of calling getBlobMetadata wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetBlobMetadataResult
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* @var array
*/
private $_metadata;
/**
* Creates GetBlobMetadataResult from response headers.
*
* @param array $headers The HTTP response headers.
* @param array $metadata The blob metadata array.
*
* @return GetBlobMetadataResult
*/
public static function create($headers, $metadata)
{
$result = new GetBlobMetadataResult();
$date = $headers[Resources::LAST_MODIFIED];
$result->setLastModified(Utilities::rfc1123ToDateTime($date));
$result->setETag($headers[Resources::ETAG]);
$result->setMetadata(is_null($metadata) ? array() : $metadata);
return $result;
}
/**
* Gets blob lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
Validate::isDate($lastModified);
$this->_lastModified = $lastModified;
}
/**
* Gets blob etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets blob etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
Validate::isString($etag, 'etag');
$this->_etag = $etag;
}
/**
* Gets blob metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets blob metadata.
*
* @param array $metadata value.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
}

View File

@ -0,0 +1,208 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for getBlob wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetBlobOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_leaseId;
/**
* @var string
*/
private $_snapshot;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* @var boolean
*/
private $_computeRangeMD5;
/**
* @var integer
*/
private $_rangeStart;
/**
* @var integer
*/
private $_rangeEnd;
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets blob snapshot.
*
* @return string.
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets blob snapshot.
*
* @param string $snapshot value.
*
* @return none.
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
/**
* Gets rangeStart
*
* @return integer
*/
public function getRangeStart()
{
return $this->_rangeStart;
}
/**
* Sets rangeStart
*
* @param integer $rangeStart the blob lease id.
*
* @return none
*/
public function setRangeStart($rangeStart)
{
Validate::isInteger($rangeStart, 'rangeStart');
$this->_rangeStart = $rangeStart;
}
/**
* Gets rangeEnd
*
* @return integer
*/
public function getRangeEnd()
{
return $this->_rangeEnd;
}
/**
* Sets rangeEnd
*
* @param integer $rangeEnd range end value in bytes
*
* @return none
*/
public function setRangeEnd($rangeEnd)
{
Validate::isInteger($rangeEnd, 'rangeEnd');
$this->_rangeEnd = $rangeEnd;
}
/**
* Gets computeRangeMD5
*
* @return boolean
*/
public function getComputeRangeMD5()
{
return $this->_computeRangeMD5;
}
/**
* Sets computeRangeMD5
*
* @param boolean $computeRangeMD5 value
*
* @return none
*/
public function setComputeRangeMD5($computeRangeMD5)
{
Validate::isBoolean($computeRangeMD5);
$this->_computeRangeMD5 = $computeRangeMD5;
}
}

View File

@ -0,0 +1,122 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Optional parameters for getBlobProperties wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetBlobPropertiesOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_leaseId;
/**
* @var string
*/
private $_snapshot;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets blob snapshot.
*
* @return string.
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets blob snapshot.
*
* @param string $snapshot value.
*
* @return none.
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
}

View File

@ -0,0 +1,95 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Holds result of calling getBlobProperties
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetBlobPropertiesResult
{
/**
* @var BlobProperties
*/
private $_properties;
/**
* @var array
*/
private $_metadata;
/**
* Gets blob metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets blob metadata.
*
* @param array $metadata value.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets blob properties.
*
* @return BlobProperties.
*/
public function getProperties()
{
return $this->_properties;
}
/**
* Sets blob properties.
*
* @param BlobProperties $properties value.
*
* @return none.
*/
public function setProperties($properties)
{
$this->_properties = $properties;
}
}

View File

@ -0,0 +1,142 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Blob\Models\BlobProperties;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* Holds result of GetBlob API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetBlobResult
{
/**
* @var BlobProperties
*/
private $_properties;
/**
* @var array
*/
private $_metadata;
/**
* @var StreamInterface
*/
private $_contentStream;
/**
* Creates GetBlobResult from getBlob call.
*
* @param array $headers The HTTP response headers.
* @param StreamInterface $body The response body.
* @param array $metadata The blob metadata.
*
* @return GetBlobResult
*/
public static function create($headers, $body, $metadata)
{
$result = new GetBlobResult();
$result->setContentStream($body->detach());
$result->setProperties(BlobProperties::create($headers));
$result->setMetadata(is_null($metadata) ? array() : $metadata);
return $result;
}
/**
* Gets blob metadata.
*
* @return array
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets blob metadata.
*
* @param array $metadata value.
*
* @return none
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
/**
* Gets blob properties.
*
* @return BlobProperties
*/
public function getProperties()
{
return $this->_properties;
}
/**
* Sets blob properties.
*
* @param BlobProperties $properties value.
*
* @return none
*/
public function setProperties($properties)
{
$this->_properties = $properties;
}
/**
* Gets blob contentStream.
*
* @return StreamInterface
*/
public function getContentStream()
{
return $this->_contentStream;
}
/**
* Sets blob contentStream.
*
* @param StreamInterface $contentStream The stream handle.
*
* @return none
*/
public function setContentStream($contentStream)
{
$this->_contentStream = $contentStream;
}
}

View File

@ -0,0 +1,145 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Blob\Models\ContainerAcl;
/**
* Holds container ACL
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetContainerAclResult
{
/**
* @var ContainerAcl
*/
private $_containerACL;
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* Parses the given array into signed identifiers
*
* @param string $publicAccess container public access
* @param string $etag container etag
* @param \DateTime $lastModified last modification date
* @param array $parsed parsed response into array
* representation
*
* @return none.
*/
public static function create($publicAccess, $etag, $lastModified, $parsed)
{
$result = new GetContainerAclResult();
$result->setETag($etag);
$result->setLastModified($lastModified);
$acl = ContainerAcl::create($publicAccess, $parsed);
$result->setContainerAcl($acl);
return $result;
}
/**
* Gets container ACL
*
* @return ContainerAcl
*/
public function getContainerAcl()
{
return $this->_containerACL;
}
/**
* Sets container ACL
*
* @param ContainerAcl $containerACL value.
*
* @return none.
*/
public function setContainerAcl($containerACL)
{
$this->_containerACL = $containerACL;
}
/**
* Gets container lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets container lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
$this->_lastModified = $lastModified;
}
/**
* Gets container etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets container etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
$this->_etag = $etag;
}
}

View File

@ -0,0 +1,126 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Holds result of getContainerProperties and getContainerMetadata
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class GetContainerPropertiesResult
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* @var array
*/
private $_metadata;
/**
* Any operation that modifies the container or its properties or metadata
* updates the last modified time. Operations on blobs do not affect the last
* modified time of the container.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets container lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
$this->_lastModified = $lastModified;
}
/**
* The entity tag for the container. If the request version is 2011-08-18 or
* newer, the ETag value will be in quotes.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets container etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
$this->_etag = $etag;
}
/**
* Gets user defined metadata.
*
* @return array.
*/
public function getMetadata()
{
return $this->_metadata;
}
/**
* Sets user defined metadata. This metadata should be added without the header
* prefix (x-ms-meta-*).
*
* @param array $metadata user defined metadata object in array form.
*
* @return none.
*/
public function setMetadata($metadata)
{
$this->_metadata = $metadata;
}
}

View File

@ -0,0 +1,46 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Modes for leasing a blob
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class LeaseMode
{
const ACQUIRE_ACTION = 'acquire';
const RENEW_ACTION = 'renew';
const RELEASE_ACTION = 'release';
const BREAK_ACTION = 'break';
}

View File

@ -0,0 +1,187 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for listBlobBlock wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListBlobBlocksOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_leaseId;
/**
* @var string
*/
private $_snapshot;
/**
* @var boolean
*/
private $_includeUncommittedBlobs;
/**
* @var boolean
*/
private $_includeCommittedBlobs;
/**
* Holds result of list type. You can access it by this order:
* $_listType[$this->_includeUncommittedBlobs][$this->_includeCommittedBlobs]
*
* @var array
*/
private static $_listType;
/**
* Constructs the static variable $listType.
*/
public function __construct()
{
self::$_listType[true][true] = 'all';
self::$_listType[true][false] = 'uncommitted';
self::$_listType[false][true] = 'committed';
self::$_listType[false][false] = 'all';
$this->_includeUncommittedBlobs = false;
$this->_includeCommittedBlobs = false;
}
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets blob snapshot.
*
* @return string.
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets blob snapshot.
*
* @param string $snapshot value.
*
* @return none.
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
/**
* Sets the include uncommittedBlobs flag.
*
* @param bool $includeUncommittedBlobs value.
*
* @return none.
*/
public function setIncludeUncommittedBlobs($includeUncommittedBlobs)
{
Validate::isBoolean($includeUncommittedBlobs);
$this->_includeUncommittedBlobs = $includeUncommittedBlobs;
}
/**
* Indicates if uncommittedBlobs is included or not.
*
* @return boolean.
*/
public function getIncludeUncommittedBlobs()
{
return $this->_includeUncommittedBlobs;
}
/**
* Sets the include committedBlobs flag.
*
* @param bool $includeCommittedBlobs value.
*
* @return none.
*/
public function setIncludeCommittedBlobs($includeCommittedBlobs)
{
Validate::isBoolean($includeCommittedBlobs);
$this->_includeCommittedBlobs = $includeCommittedBlobs;
}
/**
* Indicates if committedBlobs is included or not.
*
* @return boolean.
*/
public function getIncludeCommittedBlobs()
{
return $this->_includeCommittedBlobs;
}
/**
* Gets block list type.
*
* @return string
*/
public function getBlockListType()
{
$includeUncommitted = $this->_includeUncommittedBlobs;
$includeCommitted = $this->_includeCommittedBlobs;
return self::$_listType[$includeUncommitted][$includeCommitted];
}
}

View File

@ -0,0 +1,274 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* Holds result of listBlobBlocks
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListBlobBlocksResult
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* @var string
*/
private $_contentType;
/**
* @var integer
*/
private $_contentLength;
/**
* @var array
*/
private $_committedBlocks;
/**
* @var array
*/
private $_uncommittedBlocks;
/**
* Gets block entries from parsed response
*
* @param array $parsed HTTP response
* @param string $type Block type
*
* @return array
*/
private static function _getEntries($parsed, $type)
{
$entries = array();
if (is_array($parsed)) {
$rawEntries = array();
if ( array_key_exists($type, $parsed)
&& is_array($parsed[$type])
&& !empty($parsed[$type])
) {
$rawEntries = Utilities::getArray($parsed[$type]['Block']);
}
foreach ($rawEntries as $value) {
$entries[$value['Name']] = $value['Size'];
}
}
return $entries;
}
/**
* Creates ListBlobBlocksResult from given response headers and parsed body
*
* @param array $headers HTTP response headers
* @param array $parsed HTTP response body in array representation
*
* @return ListBlobBlocksResult
*/
public static function create($headers, $parsed)
{
$result = new ListBlobBlocksResult();
$clean = array_change_key_case($headers);
$result->setETag(Utilities::tryGetValue($clean, Resources::ETAG));
$date = Utilities::tryGetValue($clean, Resources::LAST_MODIFIED);
if (!is_null($date)) {
$date = Utilities::rfc1123ToDateTime($date);
$result->setLastModified($date);
}
$result->setContentLength(
intval(
Utilities::tryGetValue($clean, Resources::X_MS_BLOB_CONTENT_LENGTH)
)
);
$result->setContentType(
Utilities::tryGetValue($clean, Resources::CONTENT_TYPE)
);
$result->_uncommittedBlocks = self::_getEntries(
$parsed, 'UncommittedBlocks'
);
$result->_committedBlocks = self::_getEntries($parsed, 'CommittedBlocks');
return $result;
}
/**
* Gets blob lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
Validate::isDate($lastModified);
$this->_lastModified = $lastModified;
}
/**
* Gets blob etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets blob etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
$this->_etag = $etag;
}
/**
* Gets blob contentType.
*
* @return string.
*/
public function getContentType()
{
return $this->_contentType;
}
/**
* Sets blob contentType.
*
* @param string $contentType value.
*
* @return none.
*/
public function setContentType($contentType)
{
$this->_contentType = $contentType;
}
/**
* Gets blob contentLength.
*
* @return integer.
*/
public function getContentLength()
{
return $this->_contentLength;
}
/**
* Sets blob contentLength.
*
* @param integer $contentLength value.
*
* @return none.
*/
public function setContentLength($contentLength)
{
Validate::isInteger($contentLength, 'contentLength');
$this->_contentLength = $contentLength;
}
/**
* Gets uncommitted blocks
*
* @return array
*/
public function getUncommittedBlocks()
{
return $this->_uncommittedBlocks;
}
/**
* Sets uncommitted blocks
*
* @param array $uncommittedBlocks The uncommitted blocks entries
*
* @return none.
*/
public function setUncommittedBlocks($uncommittedBlocks)
{
$this->_uncommittedBlocks = $uncommittedBlocks;
}
/**
* Gets committed blocks
*
* @return array
*/
public function getCommittedBlocks()
{
return $this->_committedBlocks;
}
/**
* Sets committed blocks
*
* @param array $committedBlocks The committed blocks entries
*
* @return none.
*/
public function setCommittedBlocks($committedBlocks)
{
$this->_committedBlocks = $committedBlocks;
}
}

View File

@ -0,0 +1,237 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for listBlobs API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListBlobsOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_prefix;
/**
* @var string
*/
private $_marker;
/**
* @var string
*/
private $_delimiter;
/**
* @var integer
*/
private $_maxResults;
/**
* @var boolean
*/
private $_includeMetadata;
/**
* @var boolean
*/
private $_includeSnapshots;
/**
* @var boolean
*/
private $_includeUncommittedBlobs;
/**
* Gets prefix.
*
* @return string.
*/
public function getPrefix()
{
return $this->_prefix;
}
/**
* Sets prefix.
*
* @param string $prefix value.
*
* @return none.
*/
public function setPrefix($prefix)
{
Validate::isString($prefix, 'prefix');
$this->_prefix = $prefix;
}
/**
* Gets delimiter.
*
* @return string.
*/
public function getDelimiter()
{
return $this->_delimiter;
}
/**
* Sets prefix.
*
* @param string $delimiter value.
*
* @return none.
*/
public function setDelimiter($delimiter)
{
Validate::isString($delimiter, 'delimiter');
$this->_delimiter = $delimiter;
}
/**
* Gets marker.
*
* @return string.
*/
public function getMarker()
{
return $this->_marker;
}
/**
* Sets marker.
*
* @param string $marker value.
*
* @return none.
*/
public function setMarker($marker)
{
Validate::isString($marker, 'marker');
$this->_marker = $marker;
}
/**
* Gets max results.
*
* @return integer.
*/
public function getMaxResults()
{
return $this->_maxResults;
}
/**
* Sets max results.
*
* @param integer $maxResults value.
*
* @return none.
*/
public function setMaxResults($maxResults)
{
Validate::isInteger($maxResults, 'maxResults');
$this->_maxResults = $maxResults;
}
/**
* Indicates if metadata is included or not.
*
* @return boolean.
*/
public function getIncludeMetadata()
{
return $this->_includeMetadata;
}
/**
* Sets the include metadata flag.
*
* @param bool $includeMetadata value.
*
* @return none.
*/
public function setIncludeMetadata($includeMetadata)
{
Validate::isBoolean($includeMetadata);
$this->_includeMetadata = $includeMetadata;
}
/**
* Indicates if snapshots is included or not.
*
* @return boolean.
*/
public function getIncludeSnapshots()
{
return $this->_includeSnapshots;
}
/**
* Sets the include snapshots flag.
*
* @param bool $includeSnapshots value.
*
* @return none.
*/
public function setIncludeSnapshots($includeSnapshots)
{
Validate::isBoolean($includeSnapshots);
$this->_includeSnapshots = $includeSnapshots;
}
/**
* Indicates if uncommittedBlobs is included or not.
*
* @return boolean.
*/
public function getIncludeUncommittedBlobs()
{
return $this->_includeUncommittedBlobs;
}
/**
* Sets the include uncommittedBlobs flag.
*
* @param bool $includeUncommittedBlobs value.
*
* @return none.
*/
public function setIncludeUncommittedBlobs($includeUncommittedBlobs)
{
Validate::isBoolean($includeUncommittedBlobs);
$this->_includeUncommittedBlobs = $includeUncommittedBlobs;
}
}

View File

@ -0,0 +1,345 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Blob\Models\Blob;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
use MicrosoftAzure\Storage\Common\Internal\InvalidArgumentTypeException;
/**
* Hold result of calliing listBlobs wrapper.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListBlobsResult
{
/**
* @var array
*/
private $_blobPrefixes;
/**
* @var Blob[]
*/
private $_blobs;
/**
* @var string
*/
private $_delimiter;
/**
* @var string
*/
private $_prefix;
/**
* @var string
*/
private $_marker;
/**
* @var string
*/
private $_nextMarker;
/**
* @var integer
*/
private $_maxResults;
/**
* @var string
*/
private $_containerName;
/**
* Creates ListBlobsResult object from parsed XML response.
*
* @param array $parsed XML response parsed into array.
*
* @return ListBlobsResult
*/
public static function create($parsed)
{
$result = new ListBlobsResult();
$serviceEndpoint = Utilities::tryGetKeysChainValue(
$parsed,
Resources::XTAG_ATTRIBUTES,
Resources::XTAG_SERVICE_ENDPOINT
);
$containerName = Utilities::tryGetKeysChainValue(
$parsed,
Resources::XTAG_ATTRIBUTES,
Resources::XTAG_CONTAINER_NAME
);
$result->_containerName = $containerName;
$result->_prefix = Utilities::tryGetValue(
$parsed, Resources::QP_PREFIX
);
$result->_marker = Utilities::tryGetValue(
$parsed, Resources::QP_MARKER
);
$result->_nextMarker = Utilities::tryGetValue(
$parsed, Resources::QP_NEXT_MARKER
);
$result->_maxResults = intval(
Utilities::tryGetValue($parsed, Resources::QP_MAX_RESULTS, 0)
);
$result->_delimiter = Utilities::tryGetValue(
$parsed, Resources::QP_DELIMITER
);
$result->_blobs = array();
$result->_blobPrefixes = array();
$rawBlobs = array();
$rawBlobPrefixes = array();
if ( is_array($parsed['Blobs'])
&& array_key_exists('Blob', $parsed['Blobs'])
) {
$rawBlobs = Utilities::getArray($parsed['Blobs']['Blob']);
}
foreach ($rawBlobs as $value) {
$blob = new Blob();
$blob->setName($value['Name']);
$blob->setUrl($serviceEndpoint . $containerName . '/' . $value['Name']);
$blob->setSnapshot(Utilities::tryGetValue($value, 'Snapshot'));
$blob->setProperties(
BlobProperties::create(
Utilities::tryGetValue($value, 'Properties')
)
);
$blob->setMetadata(
Utilities::tryGetValue($value, Resources::QP_METADATA, array())
);
$result->_blobs[] = $blob;
}
if ( is_array($parsed['Blobs'])
&& array_key_exists('BlobPrefix', $parsed['Blobs'])
) {
$rawBlobPrefixes = Utilities::getArray($parsed['Blobs']['BlobPrefix']);
}
foreach ($rawBlobPrefixes as $value) {
$blobPrefix = new BlobPrefix();
$blobPrefix->setName($value['Name']);
$result->_blobPrefixes[] = $blobPrefix;
}
return $result;
}
/**
* Gets blobs.
*
* @return Blob[]
*/
public function getBlobs()
{
return $this->_blobs;
}
/**
* Sets blobs.
*
* @param Blob[] $blobs list of blobs
*
* @return none
*/
public function setBlobs($blobs)
{
$this->_blobs = array();
foreach ($blobs as $blob) {
$this->_blobs[] = clone $blob;
}
}
/**
* Gets blobPrefixes.
*
* @return array
*/
public function getBlobPrefixes()
{
return $this->_blobPrefixes;
}
/**
* Sets blobPrefixes.
*
* @param array $blobPrefixes list of blobPrefixes
*
* @return none
*/
public function setBlobPrefixes($blobPrefixes)
{
$this->_blobPrefixes = array();
foreach ($blobPrefixes as $blob) {
$this->_blobPrefixes[] = clone $blob;
}
}
/**
* Gets prefix.
*
* @return string
*/
public function getPrefix()
{
return $this->_prefix;
}
/**
* Sets prefix.
*
* @param string $prefix value.
*
* @return none
*/
public function setPrefix($prefix)
{
$this->_prefix = $prefix;
}
/**
* Gets prefix.
*
* @return string
*/
public function getDelimiter()
{
return $this->_delimiter;
}
/**
* Sets prefix.
*
* @param string $delimiter value.
*
* @return none
*/
public function setDelimiter($delimiter)
{
$this->_delimiter = $delimiter;
}
/**
* Gets marker.
*
* @return string
*/
public function getMarker()
{
return $this->_marker;
}
/**
* Sets marker.
*
* @param string $marker value.
*
* @return none
*/
public function setMarker($marker)
{
$this->_marker = $marker;
}
/**
* Gets max results.
*
* @return integer
*/
public function getMaxResults()
{
return $this->_maxResults;
}
/**
* Sets max results.
*
* @param integer $maxResults value.
*
* @return none
*/
public function setMaxResults($maxResults)
{
$this->_maxResults = $maxResults;
}
/**
* Gets next marker.
*
* @return string
*/
public function getNextMarker()
{
return $this->_nextMarker;
}
/**
* Sets next marker.
*
* @param string $nextMarker value.
*
* @return none
*/
public function setNextMarker($nextMarker)
{
$this->_nextMarker = $nextMarker;
}
/**
* Gets container name.
*
* @return string
*/
public function getContainerName()
{
return $this->_containerName;
}
/**
* Sets container name.
*
* @param string $containerName value.
*
* @return none
*/
public function setContainerName($containerName)
{
$this->_containerName = $containerName;
}
}

View File

@ -0,0 +1,171 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Blob\Models\BlobServiceOptions;
use \MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Options for listBlobs API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListContainersOptions extends BlobServiceOptions
{
/**
* Filters the results to return only containers whose name begins with the
* specified prefix.
*
* @var string
*/
private $_prefix;
/**
* Identifies the portion of the list to be returned with the next list operation
* The operation returns a marker value within the
* response body if the list returned was not complete. The marker value may
* then be used in a subsequent call to request the next set of list items.
* The marker value is opaque to the client.
*
* @var string
*/
private $_marker;
/**
* Specifies the maximum number of containers to return. If the request does not
* specify maxresults, or specifies a value greater than 5,000, the server will
* return up to 5,000 items. If the parameter is set to a value less than or
* equal to zero, the server will return status code 400 (Bad Request).
*
* @var string
*/
private $_maxResults;
/**
* Include this parameter to specify that the container's metadata be returned
* as part of the response body.
*
* @var bool
*/
private $_includeMetadata;
/**
* Gets prefix.
*
* @return string.
*/
public function getPrefix()
{
return $this->_prefix;
}
/**
* Sets prefix.
*
* @param string $prefix value.
*
* @return none.
*/
public function setPrefix($prefix)
{
Validate::isString($prefix, 'prefix');
$this->_prefix = $prefix;
}
/**
* Gets marker.
*
* @return string.
*/
public function getMarker()
{
return $this->_marker;
}
/**
* Sets marker.
*
* @param string $marker value.
*
* @return none.
*/
public function setMarker($marker)
{
Validate::isString($marker, 'marker');
$this->_marker = $marker;
}
/**
* Gets max results.
*
* @return string.
*/
public function getMaxResults()
{
return $this->_maxResults;
}
/**
* Sets max results.
*
* @param string $maxResults value.
*
* @return none.
*/
public function setMaxResults($maxResults)
{
Validate::isString($maxResults, 'maxResults');
$this->_maxResults = $maxResults;
}
/**
* Indicates if metadata is included or not.
*
* @return string.
*/
public function getIncludeMetadata()
{
return $this->_includeMetadata;
}
/**
* Sets the include metadata flag.
*
* @param bool $includeMetadata value.
*
* @return none.
*/
public function setIncludeMetadata($includeMetadata)
{
Validate::isBoolean($includeMetadata);
$this->_includeMetadata = $includeMetadata;
}
}

View File

@ -0,0 +1,266 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
use MicrosoftAzure\Storage\Blob\Models\Container;
use MicrosoftAzure\Storage\Tests\Unit\Common\Internal\UtilitiesTest;
/**
* Container to hold list container response object.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListContainersResult
{
/**
* @var array
*/
private $_containers;
/**
* @var string
*/
private $_prefix;
/**
* @var string
*/
private $_marker;
/**
* @var string
*/
private $_nextMarker;
/**
* @var integer
*/
private $_maxResults;
/**
* @var string
*/
private $_accountName;
/**
* Creates ListBlobResult object from parsed XML response.
*
* @param array $parsedResponse XML response parsed into array.
*
* @return ListBlobResult
*/
public static function create($parsedResponse)
{
$result = new ListContainersResult();
$serviceEndpoint = Utilities::tryGetKeysChainValue(
$parsedResponse,
Resources::XTAG_ATTRIBUTES,
Resources::XTAG_SERVICE_ENDPOINT
);
$result->_accountName = Utilities::tryParseAccountNameFromUrl(
$serviceEndpoint
);
$result->_prefix = Utilities::tryGetValue(
$parsedResponse, Resources::QP_PREFIX
);
$result->_marker = Utilities::tryGetValue(
$parsedResponse, Resources::QP_MARKER
);
$result->_nextMarker = Utilities::tryGetValue(
$parsedResponse, Resources::QP_NEXT_MARKER
);
$result->_maxResults = Utilities::tryGetValue(
$parsedResponse, Resources::QP_MAX_RESULTS
);
$result->_containers = array();
$rawContainer = array();
if ( !empty($parsedResponse['Containers']) ) {
$containersArray = $parsedResponse['Containers']['Container'];
$rawContainer = Utilities::getArray($containersArray);
}
foreach ($rawContainer as $value) {
$container = new Container();
$container->setName($value['Name']);
$container->setUrl($serviceEndpoint . $value['Name']);
$container->setMetadata(
Utilities::tryGetValue($value, Resources::QP_METADATA, array())
);
$properties = new ContainerProperties();
$date = $value['Properties']['Last-Modified'];
$date = Utilities::rfc1123ToDateTime($date);
$properties->setLastModified($date);
$properties->setETag($value['Properties']['Etag']);
$container->setProperties($properties);
$result->_containers[] = $container;
}
return $result;
}
/**
* Sets containers.
*
* @param array $containers list of containers.
*
* @return none
*/
public function setContainers($containers)
{
$this->_containers = array();
foreach ($containers as $container) {
$this->_containers[] = clone $container;
}
}
/**
* Gets containers.
*
* @return Container[]
*/
public function getContainers()
{
return $this->_containers;
}
/**
* Gets prefix.
*
* @return string
*/
public function getPrefix()
{
return $this->_prefix;
}
/**
* Sets prefix.
*
* @param string $prefix value.
*
* @return none
*/
public function setPrefix($prefix)
{
$this->_prefix = $prefix;
}
/**
* Gets marker.
*
* @return string
*/
public function getMarker()
{
return $this->_marker;
}
/**
* Sets marker.
*
* @param string $marker value.
*
* @return none
*/
public function setMarker($marker)
{
$this->_marker = $marker;
}
/**
* Gets max results.
*
* @return string
*/
public function getMaxResults()
{
return $this->_maxResults;
}
/**
* Sets max results.
*
* @param string $maxResults value.
*
* @return none
*/
public function setMaxResults($maxResults)
{
$this->_maxResults = $maxResults;
}
/**
* Gets next marker.
*
* @return string
*/
public function getNextMarker()
{
return $this->_nextMarker;
}
/**
* Sets next marker.
*
* @param string $nextMarker value.
*
* @return none
*/
public function setNextMarker($nextMarker)
{
$this->_nextMarker = $nextMarker;
}
/**
* Gets account name.
*
* @return string
*/
public function getAccountName()
{
return $this->_accountName;
}
/**
* Sets account name.
*
* @param string $accountName value.
*
* @return none
*/
public function setAccountName($accountName)
{
$this->_accountName = $accountName;
}
}

View File

@ -0,0 +1,179 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for listPageBlobRanges wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListPageBlobRangesOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_leaseId;
/**
* @var string
*/
private $_snapshot;
/**
* @var integer
*/
private $_rangeStart;
/**
* @var integer
*/
private $_rangeEnd;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets blob snapshot.
*
* @return string.
*/
public function getSnapshot()
{
return $this->_snapshot;
}
/**
* Sets blob snapshot.
*
* @param string $snapshot value.
*
* @return none.
*/
public function setSnapshot($snapshot)
{
$this->_snapshot = $snapshot;
}
/**
* Gets rangeStart
*
* @return integer
*/
public function getRangeStart()
{
return $this->_rangeStart;
}
/**
* Sets rangeStart
*
* @param integer $rangeStart the blob lease id.
*
* @return none
*/
public function setRangeStart($rangeStart)
{
Validate::isInteger($rangeStart, 'rangeStart');
$this->_rangeStart = $rangeStart;
}
/**
* Gets rangeEnd
*
* @return integer
*/
public function getRangeEnd()
{
return $this->_rangeEnd;
}
/**
* Sets rangeEnd
*
* @param integer $rangeEnd range end value in bytes
*
* @return none
*/
public function setRangeEnd($rangeEnd)
{
Validate::isInteger($rangeEnd, 'rangeEnd');
$this->_rangeEnd = $rangeEnd;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
}

View File

@ -0,0 +1,196 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Blob\Models\PageRange;
/**
* Holds result of calling listPageBlobRanges wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class ListPageBlobRangesResult
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* @var integer
*/
private $_contentLength;
/**
* @var array
*/
private $_pageRanges;
/**
* Creates BlobProperties object from $parsed response in array representation
*
* @param array $headers HTTP response headers
* @param array $parsed parsed response in array format.
*
* @return ListPageBlobRangesResult
*/
public static function create($headers, $parsed)
{
$result = new ListPageBlobRangesResult();
$headers = array_change_key_case($headers);
$date = $headers[Resources::LAST_MODIFIED];
$date = Utilities::rfc1123ToDateTime($date);
$blobLength = intval($headers[Resources::X_MS_BLOB_CONTENT_LENGTH]);
$rawPageRanges = array();
if (!empty($parsed['PageRange'])) {
$parsed = array_change_key_case($parsed);
$rawPageRanges = Utilities::getArray($parsed['pagerange']);
}
$result->_pageRanges = array();
foreach ($rawPageRanges as $value) {
$result->_pageRanges[] = new PageRange(
intval($value['Start']), intval($value['End'])
);
}
$result->setContentLength($blobLength);
$result->setETag($headers[Resources::ETAG]);
$result->setLastModified($date);
return $result;
}
/**
* Gets blob lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
Validate::isDate($lastModified);
$this->_lastModified = $lastModified;
}
/**
* Gets blob etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets blob etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
Validate::isString($etag, 'etag');
$this->_etag = $etag;
}
/**
* Gets blob contentLength.
*
* @return integer.
*/
public function getContentLength()
{
return $this->_contentLength;
}
/**
* Sets blob contentLength.
*
* @param integer $contentLength value.
*
* @return none.
*/
public function setContentLength($contentLength)
{
Validate::isInteger($contentLength, 'contentLength');
$this->_contentLength = $contentLength;
}
/**
* Gets page ranges
*
* @return array
*/
public function getPageRanges()
{
return $this->_pageRanges;
}
/**
* Sets page ranges
*
* @param array $pageRanges page ranges to set
*
* @return none
*/
public function setPageRanges($pageRanges)
{
$this->_pageRanges = array();
foreach ($pageRanges as $pageRange) {
$this->_pageRanges[] = clone $pageRange;
}
}
}

View File

@ -0,0 +1,129 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Holds info about page range used in HTTP requests
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class PageRange
{
/**
* @var integer
*/
private $_start;
/**
* @var integer
*/
private $_end;
/**
* Constructor
*
* @param integer $start the page start value
* @param integer $end the page end value
*
* @return PageRange
*/
public function __construct($start = null, $end = null)
{
$this->_start = $start;
$this->_end = $end;
}
/**
* Sets page start range
*
* @param integer $start the page range start
*
* @return none.
*/
public function setStart($start)
{
$this->_start = $start;
}
/**
* Gets page start range
*
* @return integer
*/
public function getStart()
{
return $this->_start;
}
/**
* Sets page end range
*
* @param integer $end the page range end
*
* @return none.
*/
public function setEnd($end)
{
$this->_end = $end;
}
/**
* Gets page end range
*
* @return integer
*/
public function getEnd()
{
return $this->_end;
}
/**
* Gets page range length
*
* @return integer
*/
public function getLength()
{
return $this->_end - $this->_start + 1;
}
/**
* Sets page range length
*
* @param integer $value new page range
*
* @return none
*/
public function setLength($value)
{
$this->_end = $this->_start + $value - 1;
}
}

View File

@ -0,0 +1,44 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* Holds available blob page write options
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class PageWriteOption
{
const CLEAR_OPTION = 'clear';
const UPDATE_OPTION = 'update';
}

View File

@ -0,0 +1,66 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
/**
* Holds public acces types for a container.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class PublicAccessType
{
const NONE = Resources::EMPTY_STRING;
const BLOBS_ONLY = 'blob';
const CONTAINER_AND_BLOBS = 'container';
/**
* Validates the public access.
*
* @param string $type The public access type.
*
* @return boolean
*/
public static function isValid($type)
{
switch ($type) {
case self::NONE:
case self::BLOBS_ONLY:
case self::CONTAINER_AND_BLOBS:
return true;
default:
return false;
}
}
}

View File

@ -0,0 +1,95 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
/**
* The optional parameters for setBlobMetadata API.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class SetBlobMetadataOptions extends BlobServiceOptions
{
/**
* @var string
*/
private $_leaseId;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
}

View File

@ -0,0 +1,118 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* Holds results of calling getBlobMetadata wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class SetBlobMetadataResult
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* Creates SetBlobMetadataResult from response headers.
*
* @param array $headers response headers
*
* @return SetBlobMetadataResult
*/
public static function create($headers)
{
$result = new SetBlobMetadataResult();
$date = $headers[Resources::LAST_MODIFIED];
$result->setLastModified(Utilities::rfc1123ToDateTime($date));
$result->setETag($headers[Resources::ETAG]);
return $result;
}
/**
* Gets blob lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
Validate::isDate($lastModified);
$this->_lastModified = $lastModified;
}
/**
* Gets blob etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets blob etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
Validate::isString($etag, 'etag');
$this->_etag = $etag;
}
}

View File

@ -0,0 +1,292 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Validate;
/**
* Optional parameters for setBlobProperties wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class SetBlobPropertiesOptions extends BlobServiceOptions
{
/**
* @var BlobProperties
*/
private $_blobProperties;
/**
* @var string
*/
private $_leaseId;
/**
* @var string
*/
private $_sequenceNumberAction;
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Creates a new SetBlobPropertiesOptions with a specified BlobProperties
* instance.
*
* @param BlobProperties $blobProperties The blob properties instance.
*/
public function __construct($blobProperties = null)
{
$this->_blobProperties = is_null($blobProperties)
? new BlobProperties() : clone $blobProperties;
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
/**
* Gets blob sequenceNumber.
*
* @return integer.
*/
public function getSequenceNumber()
{
return $this->_blobProperties->getSequenceNumber();
}
/**
* Sets blob sequenceNumber.
*
* @param integer $sequenceNumber value.
*
* @return none.
*/
public function setSequenceNumber($sequenceNumber)
{
$this->_blobProperties->setSequenceNumber($sequenceNumber);
}
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getSequenceNumberAction()
{
return $this->_sequenceNumberAction;
}
/**
* Sets lease Id for the blob
*
* @param string $sequenceNumberAction action.
*
* @return none
*/
public function setSequenceNumberAction($sequenceNumberAction)
{
$this->_sequenceNumberAction = $sequenceNumberAction;
}
/**
* Gets lease Id for the blob
*
* @return string
*/
public function getLeaseId()
{
return $this->_leaseId;
}
/**
* Sets lease Id for the blob
*
* @param string $leaseId the blob lease id.
*
* @return none
*/
public function setLeaseId($leaseId)
{
$this->_leaseId = $leaseId;
}
/**
* Gets blob blobContentLength.
*
* @return integer.
*/
public function getBlobContentLength()
{
return $this->_blobProperties->getContentLength();
}
/**
* Sets blob blobContentLength.
*
* @param integer $blobContentLength value.
*
* @return none.
*/
public function setBlobContentLength($blobContentLength)
{
$this->_blobProperties->setContentLength($blobContentLength);
}
/**
* Gets blob ContentType.
*
* @return string.
*/
public function getBlobContentType()
{
return $this->_blobProperties->getContentType();
}
/**
* Sets blob ContentType.
*
* @param string $blobContentType value.
*
* @return none.
*/
public function setBlobContentType($blobContentType)
{
$this->_blobProperties->setContentType($blobContentType);
}
/**
* Gets blob ContentEncoding.
*
* @return string.
*/
public function getBlobContentEncoding()
{
return $this->_blobProperties->getContentEncoding();
}
/**
* Sets blob ContentEncoding.
*
* @param string $blobContentEncoding value.
*
* @return none.
*/
public function setBlobContentEncoding($blobContentEncoding)
{
$this->_blobProperties->setContentEncoding($blobContentEncoding);
}
/**
* Gets blob ContentLanguage.
*
* @return string.
*/
public function getBlobContentLanguage()
{
return $this->_blobProperties->getContentLanguage();
}
/**
* Sets blob ContentLanguage.
*
* @param string $blobContentLanguage value.
*
* @return none.
*/
public function setBlobContentLanguage($blobContentLanguage)
{
$this->_blobProperties->setContentLanguage($blobContentLanguage);
}
/**
* Gets blob ContentMD5.
*
* @return string.
*/
public function getBlobContentMD5()
{
return $this->_blobProperties->getContentMD5();
}
/**
* Sets blob ContentMD5.
*
* @param string $blobContentMD5 value.
*
* @return none.
*/
public function setBlobContentMD5($blobContentMD5)
{
$this->_blobProperties->setContentMD5($blobContentMD5);
}
/**
* Gets blob cache control.
*
* @return string.
*/
public function getBlobCacheControl()
{
return $this->_blobProperties->getCacheControl();
}
/**
* Sets blob cacheControl.
*
* @param string $blobCacheControl value to use.
*
* @return none.
*/
public function setBlobCacheControl($blobCacheControl)
{
$this->_blobProperties->setCacheControl($blobCacheControl);
}
}

View File

@ -0,0 +1,149 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Common\Internal\Resources;
use MicrosoftAzure\Storage\Common\Internal\Validate;
use MicrosoftAzure\Storage\Common\Internal\Utilities;
/**
* Holds result of calling setBlobProperties wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class SetBlobPropertiesResult
{
/**
* @var \DateTime
*/
private $_lastModified;
/**
* @var string
*/
private $_etag;
/**
* @var integer
*/
private $_sequenceNumber;
/**
* Creates SetBlobPropertiesResult from response headers.
*
* @param array $headers response headers
*
* @return SetBlobPropertiesResult
*/
public static function create($headers)
{
$result = new SetBlobPropertiesResult();
$date = $headers[Resources::LAST_MODIFIED];
$result->setLastModified(Utilities::rfc1123ToDateTime($date));
$result->setETag($headers[Resources::ETAG]);
if (array_key_exists(Resources::X_MS_BLOB_SEQUENCE_NUMBER, $headers)) {
$sNumber = $headers[Resources::X_MS_BLOB_SEQUENCE_NUMBER];
$result->setSequenceNumber(intval($sNumber));
}
return $result;
}
/**
* Gets blob lastModified.
*
* @return \DateTime.
*/
public function getLastModified()
{
return $this->_lastModified;
}
/**
* Sets blob lastModified.
*
* @param \DateTime $lastModified value.
*
* @return none.
*/
public function setLastModified($lastModified)
{
Validate::isDate($lastModified);
$this->_lastModified = $lastModified;
}
/**
* Gets blob etag.
*
* @return string.
*/
public function getETag()
{
return $this->_etag;
}
/**
* Sets blob etag.
*
* @param string $etag value.
*
* @return none.
*/
public function setETag($etag)
{
Validate::isString($etag, 'etag');
$this->_etag = $etag;
}
/**
* Gets blob sequenceNumber.
*
* @return int.
*/
public function getSequenceNumber()
{
return $this->_sequenceNumber;
}
/**
* Sets blob sequenceNumber.
*
* @param int $sequenceNumber value.
*
* @return none.
*/
public function setSequenceNumber($sequenceNumber)
{
Validate::isInteger($sequenceNumber, 'sequenceNumber');
$this->_sequenceNumber = $sequenceNumber;
}
}

View File

@ -0,0 +1,78 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Blob\Models\AccessCondition;
use MicrosoftAzure\Storage\Blob\Models\BlobServiceOptions;
/**
* Optional parameters for setContainerMetadata wrapper
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class SetContainerMetadataOptions extends BlobServiceOptions
{
/**
* @var AccessCondition
*/
private $_accessCondition;
/**
* Constructs the access condition object with none option.
*/
public function __construct()
{
$this->_accessCondition = AccessCondition::none();
}
/**
* Gets access condition
*
* @return AccessCondition
*/
public function getAccessCondition()
{
return $this->_accessCondition;
}
/**
* Sets access condition
*
* @param AccessCondition $accessCondition value to use.
*
* @return none.
*/
public function setAccessCondition($accessCondition)
{
$this->_accessCondition = $accessCondition;
}
}

View File

@ -0,0 +1,103 @@
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* PHP version 5
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @link https://github.com/azure/azure-storage-php
*/
namespace MicrosoftAzure\Storage\Blob\Models;
use MicrosoftAzure\Storage\Blob\Models\AccessPolicy;
/**
* Holds container signed identifiers.
*
* @category Microsoft
* @package MicrosoftAzure\Storage\Blob\Models
* @author Azure Storage PHP SDK <dmsh@microsoft.com>
* @copyright 2016 Microsoft Corporation
* @license https://github.com/azure/azure-storage-php/LICENSE
* @version Release: 0.11.0
* @link https://github.com/azure/azure-storage-php
*/
class SignedIdentifier
{
private $_id;
private $_accessPolicy;
/**
* Gets id.
*
* @return string.
*/
public function getId()
{
return $this->_id;
}
/**
* Sets id.
*
* @param string $id value.
*
* @return none.
*/
public function setId($id)
{
$this->_id = $id;
}
/**
* Gets accessPolicy.
*
* @return string.
*/
public function getAccessPolicy()
{
return $this->_accessPolicy;
}
/**
* Sets accessPolicy.
*
* @param string $accessPolicy value.
*
* @return none.
*/
public function setAccessPolicy($accessPolicy)
{
$this->_accessPolicy = $accessPolicy;
}
/**
* Converts this current object to XML representation.
*
* @return array.
*/
public function toArray()
{
$array = array();
$array['SignedIdentifier']['Id'] = $this->_id;
$array['SignedIdentifier']['AccessPolicy'] = $this->_accessPolicy->toArray();
return $array;
}
}