lib/Beberlei/AzureBlobStorage/BlobClient.php
public function getPageRegions($containerName = '', $blobName = '', $startByteOffset = 0, $endByteOffset = 0, $leaseId = null)
    {
        Assertion::notEmpty($containerName, 'Container name is not specified');
        self::assertValidContainerName($containerName);
        Assertion::notEmpty($blobName, 'Blob name is not specified.');
        self::assertValidRootContainerBlobName($containerName, $blobName);

        if ($startByteOffset % 512 != 0) {
            throw new BlobException('Start byte offset must be a modulus of 512.');
        }
        if ($endByteOffset > 0 && ($endByteOffset + 1) % 512 != 0) {
            throw new BlobException('End byte offset must be a modulus of 512 minus 1.');
        }

        $headers = array();
        if (!is_null($leaseId)) {
            $headers['x-ms-lease-id'] = $leaseId;
        }

        if ($endByteOffset > 0) {
            $headers['Range'] = 'bytes=' . $startByteOffset . '-' . $endByteOffset;
        }

        $resourceName = self::createResourceName($containerName , $blobName);

        $response = $this->performRequest($resourceName, array('comp' => 'pagelist'), 'GET', $headers, false, null, self::RESOURCE_BLOB, self::PERMISSION_WRITE);
        if ( ! $response->isSuccessful()) {
            throw new BlobException($this->getErrorMessage($response, 'Resource could not be accessed.'));
        }

        $result = $this->parseResponse($response);
        $xmlRanges = null;
        if (count($result->PageRange) > 1) {
            $xmlRanges = $result->PageRange;
        } else {
            $xmlRanges = array($result->PageRange);
        }

        $ranges = array();
        for ($i = 0; $i < count($xmlRanges); $i++) {
            $ranges[] = new PageRegionInstance(
            (int)$xmlRanges[$i]->Start,
            (int)$xmlRanges[$i]->End
            );
        }

        return $ranges;
    }
public function getPageRegions($containerName = '', $blobName = '', $startByteOffset = 0, $endByteOffset = 0, $leaseId = null)
    {
        Assertion::notEmpty($containerName, 'Container name is not specified');
        self::assertValidContainerName($containerName);
        Assertion::notEmpty($blobName, 'Blob name is not specified.');
        self::assertValidRootContainerBlobName($containerName, $blobName);

        if ($startByteOffset % 512 != 0) {
            throw new BlobException('Start byte offset must be a modulus of 512.');
        }
        if ($endByteOffset > 0 && ($endByteOffset + 1) % 512 != 0) {
            throw new BlobException('End byte offset must be a modulus of 512 minus 1.');
        }

        $headers = array();
        if (!is_null($leaseId)) {
            $headers['x-ms-lease-id'] = $leaseId;
        }

        if ($endByteOffset > 0) {
            $headers['Range'] = 'bytes=' . $startByteOffset . '-' . $endByteOffset;
        }

        $resourceName = self::createResourceName($containerName , $blobName);

        $response = $this->performRequest($resourceName, array('comp' => 'pagelist'), 'GET', $headers, false, null, self::RESOURCE_BLOB, self::PERMISSION_WRITE);
        if ( ! $response->isSuccessful()) {
            throw new BlobException($this->getErrorMessage($response, 'Resource could not be accessed.'));
        }

        $result = $this->parseResponse($response);
        $xmlRanges = null;
        if (count($result->PageRange) > 1) {
            $xmlRanges = $result->PageRange;
        } else {
            $xmlRanges = array($result->PageRange);
        }

        $ranges = array();
        for ($i = 0; $i < count($xmlRanges); $i++) {
            $ranges[] = new PageRegionInstance(
            (int)$xmlRanges[$i]->Start,
            (int)$xmlRanges[$i]->End
            );
        }

        return $ranges;
    }
Put page in page blob

@param string $containerName      Container name
@param string $blobName           Blob name
@param int    $startByteOffset    Start byte offset
@param int    $endByteOffset      End byte offset
@param string $leaseId            Lease identifier
@return array Array of page ranges
@throws BlobException