lib/Beberlei/AzureBlobStorage/BlobClient.php
public function putPage($containerName = '', $blobName = '', $startByteOffset = 0, $endByteOffset = 0, $contents = '', $writeMethod = self::PAGE_WRITE_UPDATE, $leaseId = null, $additionalHeaders = array())
    {
        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 + 1) % 512 != 0) {
            throw new BlobException('End byte offset must be a modulus of 512 minus 1.');
        }

        $size = strlen($contents);
        if ($size >= self::MAX_BLOB_TRANSFER_SIZE) {
            throw new BlobException('Page blob size must not be larger than ' + self::MAX_BLOB_TRANSFER_SIZE . ' bytes.');
        }

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

        foreach ($additionalHeaders as $key => $value) {
            $headers[$key] = $value;
        }

        $headers['Range'] = 'bytes=' . $startByteOffset . '-' . $endByteOffset;

        $headers[Storage::PREFIX_STORAGE_HEADER . 'page-write'] = $writeMethod;

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

        $response = $this->performRequest($resourceName, array('comp' => 'page'), 'PUT', $headers, false, $contents, self::RESOURCE_BLOB, self::PERMISSION_WRITE);
        if ( ! $response->isSuccessful()) {
            throw new BlobException($this->getErrorMessage($response, 'Resource could not be accessed.'));
        }
    }
public function putPage($containerName = '', $blobName = '', $startByteOffset = 0, $endByteOffset = 0, $contents = '', $writeMethod = self::PAGE_WRITE_UPDATE, $leaseId = null, $additionalHeaders = array())
    {
        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 + 1) % 512 != 0) {
            throw new BlobException('End byte offset must be a modulus of 512 minus 1.');
        }

        $size = strlen($contents);
        if ($size >= self::MAX_BLOB_TRANSFER_SIZE) {
            throw new BlobException('Page blob size must not be larger than ' + self::MAX_BLOB_TRANSFER_SIZE . ' bytes.');
        }

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

        foreach ($additionalHeaders as $key => $value) {
            $headers[$key] = $value;
        }

        $headers['Range'] = 'bytes=' . $startByteOffset . '-' . $endByteOffset;

        $headers[Storage::PREFIX_STORAGE_HEADER . 'page-write'] = $writeMethod;

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

        $response = $this->performRequest($resourceName, array('comp' => 'page'), 'PUT', $headers, false, $contents, self::RESOURCE_BLOB, self::PERMISSION_WRITE);
        if ( ! $response->isSuccessful()) {
            throw new BlobException($this->getErrorMessage($response, 'Resource could not be accessed.'));
        }
    }
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 mixed  $contents           Page contents
@param string $writeMethod        Write method (Blob::PAGE_WRITE_*)
@param string $leaseId            Lease identifier
@param array  $additionalHeaders  Additional headers. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
@throws BlobException