API Documentation

Service/WindowsAzure/Storage/Blob.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://todo name_todo
package
Zend_Service_WindowsAzure
subpackage
Storage
version
$Id$
Classes
Zend_Service_WindowsAzure_Storage_Blob

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Service_WindowsAzure_Storage_Blob

Extends from
Zend_Service_WindowsAzure_Storage
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service_WindowsAzure
subpackage
Storage
Constants
ACL_PRIVATE
ACL_PUBLIC
ACL_PUBLIC_BLOB
ACL_PUBLIC_CONTAINER
LEASE_ACQUIRE
LEASE_RENEW
LEASE_RELEASE
LEASE_BREAK
MAX_BLOB_SIZE
MAX_BLOB_TRANSFER_SIZE
BLOBTYPE_BLOCK
BLOBTYPE_PAGE
PAGE_WRITE_UPDATE
PAGE_WRITE_CLEAR
Properties
$_wrapperClients
$_sharedAccessSignatureCredentials
Methods
__construct
blobExists
containerExists
createContainer
getContainerAcl
setContainerAcl
getContainer
getContainerMetadata
setContainerMetadata
deleteContainer
listContainers
putBlob
putBlobData
putLargeBlob
putBlock
putBlockList
getBlockList
createPageBlob
putPage
getPageRegions
copyBlob
getBlob
getBlobData
getBlobInstance
getBlobMetadata
setBlobMetadata
setBlobProperties
getBlobProperties
deleteBlob
snapshotBlob
leaseBlob
listBlobs
generateSharedAccessUrl
registerAsClient
unregisterAsClient
getWrapperClient
registerStreamWrapper
unregisterStreamWrapper
createResourceName
isValidContainerName
_getErrorMessage
_generateBlockId

Description

Constants

ACL_PRIVATE

 ACL_PRIVATE = 'null'

ACL - Private access

Details

value
null

ACL_PUBLIC

 ACL_PUBLIC = 'container'

ACL - Public access (read all blobs)

Details

value
container
deprecated
Use ACL_PUBLIC_CONTAINER or ACL_PUBLIC_BLOB instead.

ACL_PUBLIC_BLOB

 ACL_PUBLIC_BLOB = 'blob'

ACL - Blob Public access (read all blobs)

Details

value
blob

ACL_PUBLIC_CONTAINER

 ACL_PUBLIC_CONTAINER = 'container'

ACL - Container Public access (enumerate and read all blobs)

Details

value
container

LEASE_ACQUIRE

 LEASE_ACQUIRE = 'acquire'

Blob lease constants

Details

value
acquire

LEASE_RENEW

 LEASE_RENEW = 'renew'

Details

value
renew

LEASE_RELEASE

 LEASE_RELEASE = 'release'

Details

value
release

LEASE_BREAK

 LEASE_BREAK = 'break'

Details

value
break

MAX_BLOB_SIZE

 MAX_BLOB_SIZE = '67108864'

Maximal blob size (in bytes)

Details

value
67108864

MAX_BLOB_TRANSFER_SIZE

 MAX_BLOB_TRANSFER_SIZE = '4194304'

Maximal blob transfer size (in bytes)

Details

value
4194304

BLOBTYPE_BLOCK

 BLOBTYPE_BLOCK = 'BlockBlob'

Blob types

Details

value
BlockBlob

BLOBTYPE_PAGE

 BLOBTYPE_PAGE = 'PageBlob'

Details

value
PageBlob

PAGE_WRITE_UPDATE

 PAGE_WRITE_UPDATE = 'update'

Put page write options

Details

value
update

PAGE_WRITE_CLEAR

 PAGE_WRITE_CLEAR = 'clear'

Details

value
clear

Properties

$_sharedAccessSignatureCredentials

Zend_Service_WindowsAzure_Credentials_SharedAccessSignature $_sharedAccessSignatureCredentials = 'null'

SharedAccessSignature credentials

Details

$_sharedAccessSignatureCredentials
Zend_Service_WindowsAzure_Credentials_SharedAccessSignature
visibility
private
default
null
final
false
static
false

$_wrapperClients

array $_wrapperClients = 'array'

Stream wrapper clients

Details

$_wrapperClients
array
visibility
protected
default
array
final
false
static
true

Methods

__construct

__construct( string $host = Zend_Service_WindowsAzure_Storage, string $accountName = Zend_Service_WindowsAzure_Credentials_CredentialsAbstract, string $accountKey = Zend_Service_WindowsAzure_Credentials_CredentialsAbstract, boolean $usePathStyleUri = false, Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null ) :

Creates a new Zend_Service_WindowsAzure_Storage_Blob instance

Arguments
$host
string
Storage host name
$accountName
string
Account name for Windows Azure
$accountKey
string
Account key for Windows Azure
$usePathStyleUri
boolean
Use path-style URI's
$retryPolicy
Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract
Retry policy to use when making requests
Details
visibility
public
final
false
static
false

_generateBlockId

_generateBlockId( int $part = 0 ) : string

Generate block id

Arguments
$part
int
Block number
Output
string
Windows Azure Blob Storage block number
Details
visibility
protected
final
false
static
false

_getErrorMessage

_getErrorMessage( Zend_Http_Response $response, string $alternativeError = Unknown error. ) : string

Get error message from Zend_Http_Response

Arguments
$response
Zend_Http_Response
Repsonse
$alternativeError
string
Alternative error message
Output
string
Details
visibility
protected
final
false
static
false

blobExists

blobExists( string $containerName, string $blobName, string $snapshotId = null ) : boolean

Check if a blob exists

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$snapshotId
string
Snapshot identifier
Output
boolean
Details
visibility
public
final
false
static
false

containerExists

containerExists( string $containerName ) : boolean

Check if a container exists

Arguments
$containerName
string
Container name
Output
boolean
Details
visibility
public
final
false
static
false

copyBlob

copyBlob( string $sourceContainerName, string $sourceBlobName, string $destinationContainerName, string $destinationBlobName, array $metadata = array, string $sourceSnapshotId = null, string $destinationLeaseId = null, array $additionalHeaders = array ) : object

Copy blob

Arguments
$sourceContainerName
string
Source container name
$sourceBlobName
string
Source blob name
$destinationContainerName
string
Destination container name
$destinationBlobName
string
Destination blob name
$metadata
array
Key/value pairs of meta data
$sourceSnapshotId
string
Source snapshot identifier
$destinationLeaseId
string
Destination lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd894037.aspx for more information.
Output
object
Partial blob properties
Details
visibility
public
final
false
static
false
throws

createContainer

createContainer( string $containerName, array $metadata = array ) : object

Create container

Arguments
$containerName
string
Container name
$metadata
array
Key/value pairs of meta data
Output
object
Container properties
Details
visibility
public
final
false
static
false
throws

createPageBlob

createPageBlob( string $containerName, string $blobName, int $size = 0, array $metadata = array, string $leaseId = null, array $additionalHeaders = array ) : object

Create page blob

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$size
int
Size of the page blob in bytes
$metadata
array
Key/value pairs of meta data
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Output
object
Partial blob properties
Details
visibility
public
final
false
static
false
throws

createResourceName

createResourceName( string $containerName, string $blobName ) : string

Create resource name

Arguments
$containerName
string
Container name
$blobName
string
Blob name
Output
string
Details
visibility
public
final
false
static
true

deleteBlob

deleteBlob( string $containerName, string $blobName, string $snapshotId = null, string $leaseId = null, array $additionalHeaders = array ) :

Delete blob

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$snapshotId
string
Snapshot identifier
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

deleteContainer

deleteContainer( string $containerName, array $additionalHeaders = array ) :

Delete container

Arguments
$containerName
string
Container name
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

generateSharedAccessUrl

generateSharedAccessUrl( string $containerName, string $blobName, string $resource = b, string $permissions = r, string $start, string $expiry, string $identifier ) : string

Generate shared access URL

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$resource
string
Signed resource - container (c) - blob (b)
$permissions
string
Signed permissions - read (r), write (w), delete (d) and list (l)
$start
string
The time at which the Shared Access Signature becomes valid.
$expiry
string
The time at which the Shared Access Signature becomes invalid.
$identifier
string
Signed identifier
Output
string
Details
visibility
public
final
false
static
false

getBlob

getBlob( string $containerName, string $blobName, string $localFileName, string $snapshotId = null, string $leaseId = null, array $additionalHeaders = array ) :

Get blob

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$localFileName
string
Local file name to store downloaded blob
$snapshotId
string
Snapshot identifier
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

getBlobData

getBlobData( string $containerName, string $blobName, string $snapshotId = null, string $leaseId = null, array $additionalHeaders = array ) : mixed

Get blob data

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$snapshotId
string
Snapshot identifier
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Output
mixed
Blob contents
Details
visibility
public
final
false
static
false
throws

getBlobInstance

getBlobInstance( string $containerName, string $blobName, string $snapshotId = null, string $leaseId = null, array $additionalHeaders = array ) : Zend_Service_WindowsAzure_Storage_BlobInstance

Get blob instance

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$snapshotId
string
Snapshot identifier
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

getBlobMetadata

getBlobMetadata( string $containerName, string $blobName, string $snapshotId = null, string $leaseId = null ) : array

Get blob metadata

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$snapshotId
string
Snapshot identifier
$leaseId
string
Lease identifier
Output
array
Key/value pairs of meta data
Details
visibility
public
final
false
static
false
throws

getBlobProperties

getBlobProperties( string $containerName, string $blobName, string $snapshotId = null, string $leaseId = null ) : Zend_Service_WindowsAzure_Storage_BlobInstance

Get blob properties

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$snapshotId
string
Snapshot identifier
$leaseId
string
Lease identifier
Details
visibility
public
final
false
static
false
throws

getBlockList

getBlockList( string $containerName, string $blobName, string $snapshotId = null, string $leaseId = null, integer $type = 0 ) : array

Get block list

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$snapshotId
string
Snapshot identifier
$leaseId
string
Lease identifier
$type
integer
Type of block list to retrieve. 0 = all, 1 = committed, 2 = uncommitted
Output
array
Details
visibility
public
final
false
static
false
throws

getContainer

getContainer( string $containerName ) : Zend_Service_WindowsAzure_Storage_BlobContainer

Get container

Arguments
$containerName
string
Container name
Details
visibility
public
final
false
static
false
throws

getContainerAcl

getContainerAcl( string $containerName, bool $signedIdentifiers = false ) : string

Get container ACL

Arguments
$containerName
string
Container name
$signedIdentifiers
bool
Display only private/blob/container or display signed identifiers?
Output
string
Acl, to be compared with Zend_Service_WindowsAzure_Storage_Blob::ACL_*
Details
visibility
public
final
false
static
false
throws

getContainerMetadata

getContainerMetadata( string $containerName ) : array

Get container metadata

Arguments
$containerName
string
Container name
Output
array
Key/value pairs of meta data
Details
visibility
public
final
false
static
false
throws

getPageRegions

getPageRegions( string $containerName, string $blobName, int $startByteOffset = 0, int $endByteOffset = 0, string $leaseId = null ) : array

Put page in page blob

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$startByteOffset
int
Start byte offset
$endByteOffset
int
End byte offset
$leaseId
string
Lease identifier
Output
array
Array of page ranges
Details
visibility
public
final
false
static
false
throws

getWrapperClient

getWrapperClient( string $name ) : Zend_Service_WindowsAzure_Storage_Blob

Get wrapper client for stream type

Arguments
$name
string
Protocol name
Details
visibility
public
final
false
static
true

isValidContainerName

isValidContainerName( string $containerName ) : boolean

Is valid container name?

Arguments
$containerName
string
Container name
Output
boolean
Details
visibility
public
final
false
static
true

leaseBlob

leaseBlob( string $containerName, string $blobName, string $leaseAction = self, string $leaseId = null ) : Zend_Service_WindowsAzure_Storage_LeaseInstance

Lease blob - See (http://msdn.microsoft.com/en-us/library/ee691972.aspx)

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$leaseAction
string
Lease action (Zend_Service_WindowsAzure_Storage_Blob::LEASE_*)
$leaseId
string
Lease identifier, required to renew the lease or to release the lease.
Details
visibility
public
final
false
static
false
throws

listBlobs

listBlobs( string $containerName, string $prefix, string $delimiter, int $maxResults = null, string $marker = null, string $include = null, int $currentResultCount = 0 ) : array

List blobs

Arguments
$containerName
string
Container name
$prefix
string
Optional. Filters the results to return only blobs whose name begins with the specified prefix.
$delimiter
string
Optional. Delimiter, i.e. '/', for specifying folder hierarchy
$maxResults
int
Optional. Specifies the maximum number of blobs to return per call to Azure storage. This does NOT affect list size returned by this function. (maximum: 5000)
$marker
string
Optional string value that identifies the portion of the list to be returned with the next list operation.
$include
string
Optional. Specifies that the response should include one or more of the following subsets: '', 'metadata', 'snapshots', 'uncommittedblobs'). Multiple values can be added separated with a comma (,)
$currentResultCount
int
Current result count (internal use)
Output
array
Details
visibility
public
final
false
static
false
throws

listContainers

listContainers( string $prefix = null, int $maxResults = null, string $marker = null, string $include = null, int $currentResultCount = 0 ) : array

List containers

Arguments
$prefix
string
Optional. Filters the results to return only containers whose name begins with the specified prefix.
$maxResults
int
Optional. Specifies the maximum number of containers to return per call to Azure storage. This does NOT affect list size returned by this function. (maximum: 5000)
$marker
string
Optional string value that identifies the portion of the list to be returned with the next list operation.
$include
string
Optional. Include this parameter to specify that the container's metadata be returned as part of the response body. (allowed values: '', 'metadata')
$currentResultCount
int
Current result count (internal use)
Output
array
Details
visibility
public
final
false
static
false
throws

putBlob

putBlob( string $containerName, string $blobName, string $localFileName, array $metadata = array, string $leaseId = null, array $additionalHeaders = array ) : object

Put blob

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$localFileName
string
Local file name to be uploaded
$metadata
array
Key/value pairs of meta data
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Output
object
Partial blob properties
Details
visibility
public
final
false
static
false
throws

putBlobData

putBlobData( string $containerName, string $blobName, mixed $data, array $metadata = array, string $leaseId = null, array $additionalHeaders = array ) : object

Put blob data

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$data
mixed
Data to store
$metadata
array
Key/value pairs of meta data
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Output
object
Partial blob properties
Details
visibility
public
final
false
static
false
throws

putBlock

putBlock( string $containerName, string $blobName, string $identifier, array $contents, string $leaseId = null ) :

Put large blob block

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$identifier
string
Block ID
$contents
array
Contents of the block
$leaseId
string
Lease identifier
Details
visibility
public
final
false
static
false
throws

putBlockList

putBlockList( string $containerName, string $blobName, array $blockList = array, array $metadata = array, string $leaseId = null, array $additionalHeaders = array ) :

Put block list

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$blockList
array
Array of block identifiers
$metadata
array
Key/value pairs of meta data
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

putLargeBlob

putLargeBlob( string $containerName, string $blobName, string $localFileName, array $metadata = array, string $leaseId = null ) : object

Put large blob (> 64 MB)

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$localFileName
string
Local file name to be uploaded
$metadata
array
Key/value pairs of meta data
$leaseId
string
Lease identifier
Output
object
Partial blob properties
Details
visibility
public
final
false
static
false
throws

putPage

putPage( string $containerName, string $blobName, int $startByteOffset = 0, int $endByteOffset = 0, mixed $contents, string $writeMethod = self, string $leaseId = null, array $additionalHeaders = array ) :

Put page in page blob

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$startByteOffset
int
Start byte offset
$endByteOffset
int
End byte offset
$contents
mixed
Page contents
$writeMethod
string
Write method (Zend_Service_WindowsAzure_Storage_Blob::PAGE_WRITE_*)
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

registerAsClient

registerAsClient( string $name ) : Zend_Service_WindowsAzure_Storage_Blob

Register this object as stream wrapper client

Arguments
$name
string
Protocol name
Details
visibility
public
final
false
static
false

registerStreamWrapper

registerStreamWrapper( string $name = azure ) :

Register this object as stream wrapper

Arguments
$name
string
Protocol name
Details
visibility
public
final
false
static
false

setBlobMetadata

setBlobMetadata( string $containerName, string $blobName, array $metadata = array, string $leaseId = null, array $additionalHeaders = array ) :

Set blob metadata

Calling the Set Blob Metadata operation overwrites all existing metadata that is associated with the blob. It's not possible to modify an individual name/value pair.

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$metadata
array
Key/value pairs of meta data
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

setBlobProperties

setBlobProperties( string $containerName, string $blobName, string $leaseId = null, array $additionalHeaders = array ) :

Set blob properties

All available properties are listed at http://msdn.microsoft.com/en-us/library/ee691966.aspx and should be provided in the $additionalHeaders parameter.

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$leaseId
string
Lease identifier
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

setContainerAcl

setContainerAcl( string $containerName, bool $acl = self, array $signedIdentifiers = array ) :

Set container ACL

Arguments
$containerName
string
Container name
$acl
bool
Zend_Service_WindowsAzure_Storage_Blob::ACL_*
$signedIdentifiers
array
Signed identifiers
Details
visibility
public
final
false
static
false
throws

setContainerMetadata

setContainerMetadata( string $containerName, array $metadata = array, array $additionalHeaders = array ) :

Set container metadata

Calling the Set Container Metadata operation overwrites all existing metadata that is associated with the container. It's not possible to modify an individual name/value pair.

Arguments
$containerName
string
Container name
$metadata
array
Key/value pairs of meta data
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Details
visibility
public
final
false
static
false
throws

snapshotBlob

snapshotBlob( string $containerName, string $blobName, array $metadata = array, array $additionalHeaders = array ) : string

Snapshot blob

Arguments
$containerName
string
Container name
$blobName
string
Blob name
$metadata
array
Key/value pairs of meta data
$additionalHeaders
array
Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Output
string
Date/Time value representing the snapshot identifier.
Details
visibility
public
final
false
static
false
throws

unregisterAsClient

unregisterAsClient( string $name ) : Zend_Service_WindowsAzure_Storage_Blob

Unregister this object as stream wrapper client

Arguments
$name
string
Protocol name
Details
visibility
public
final
false
static
false

unregisterStreamWrapper

unregisterStreamWrapper( string $name = azure ) : Zend_Service_WindowsAzure_Storage_Blob

Unregister this object as stream wrapper

Arguments
$name
string
Protocol name
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.