From dca6a05ad2306b67511b8bf2d2ea0355a04e44de Mon Sep 17 00:00:00 2001 From: Yaqi Yang Date: Fri, 18 Mar 2016 09:40:35 -0700 Subject: [PATCH 1/3] Fix for https://github.com/Azure/azure-sdk-for-php/pull/757 --- WindowsAzure/Blob/BlobRestProxy.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WindowsAzure/Blob/BlobRestProxy.php b/WindowsAzure/Blob/BlobRestProxy.php index b9c6d94d2..30c3c3cd3 100644 --- a/WindowsAzure/Blob/BlobRestProxy.php +++ b/WindowsAzure/Blob/BlobRestProxy.php @@ -1354,6 +1354,11 @@ public function createBlockBlob($container, $blob, $content, $options = null) array_push($blockIds, $block); $this->createBlobBlock($container, $blob, $block->getBlockId(), $body); } + $block = new Block(); + $block->setBlockId(base64_encode(str_pad($counter++, 6, '0',STR_PAD_LEFT))); + $block->setType('Uncommitted'); + array_push($blockIds, $block); + $this->createBlobBlock($container, $blob, $block->getBlockId(), $body); } $response = $this->commitBlobBlocks($container, $blob, $blockIds, $options); } From 26d9380fc88c64745c298e38c718dd917fa5c1ce Mon Sep 17 00:00:00 2001 From: Yaqi Yang Date: Fri, 18 Mar 2016 09:49:50 -0700 Subject: [PATCH 2/3] Fixed error in the last merge --- WindowsAzure/Blob/BlobRestProxy.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/WindowsAzure/Blob/BlobRestProxy.php b/WindowsAzure/Blob/BlobRestProxy.php index 30c3c3cd3..2607b6dae 100644 --- a/WindowsAzure/Blob/BlobRestProxy.php +++ b/WindowsAzure/Blob/BlobRestProxy.php @@ -1349,16 +1349,11 @@ public function createBlockBlob($container, $blob, $content, $options = null) } if (!empty($body)) { $block = new Block(); - $block->setBlockId(base64_encode(str_pad($counter++, '0', 6))); + $block->setBlockId(base64_encode(str_pad($counter++, 6, '0',STR_PAD_LEFT))); $block->setType('Uncommitted'); array_push($blockIds, $block); $this->createBlobBlock($container, $blob, $block->getBlockId(), $body); - } - $block = new Block(); - $block->setBlockId(base64_encode(str_pad($counter++, 6, '0',STR_PAD_LEFT))); - $block->setType('Uncommitted'); - array_push($blockIds, $block); - $this->createBlobBlock($container, $blob, $block->getBlockId(), $body); + } } $response = $this->commitBlobBlocks($container, $blob, $blockIds, $options); } From bf68c89d3a05cf8fe25e167c896417d68336d378 Mon Sep 17 00:00:00 2001 From: Yaqi Yang Date: Fri, 18 Mar 2016 09:52:07 -0700 Subject: [PATCH 3/3] Removed some stray spaces --- WindowsAzure/Blob/BlobRestProxy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WindowsAzure/Blob/BlobRestProxy.php b/WindowsAzure/Blob/BlobRestProxy.php index 2607b6dae..90b81c4b8 100644 --- a/WindowsAzure/Blob/BlobRestProxy.php +++ b/WindowsAzure/Blob/BlobRestProxy.php @@ -1353,7 +1353,7 @@ public function createBlockBlob($container, $blob, $content, $options = null) $block->setType('Uncommitted'); array_push($blockIds, $block); $this->createBlobBlock($container, $blob, $block->getBlockId(), $body); - } + } } $response = $this->commitBlobBlocks($container, $blob, $blockIds, $options); }