Skip to content

Commit 52b926c

Browse files
jbouzekrisebastianfeldmann
authored andcommitted
fix build and cs
1 parent 2062357 commit 52b926c

File tree

5 files changed

+44
-24
lines changed

5 files changed

+44
-24
lines changed

build.xml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,22 @@
284284
</fileset>
285285
</copy>
286286

287-
<!-- GUZZLE (AWS / OPENSTACK) -->
287+
<!-- AZURE -->
288+
<copy file="${basedir}/vendor/microsoft/azure-storage-blob/LICENSE"
289+
tofile="${basedir}/build/phar/lib/microsoft/azure-storage-blob/LICENSE"/>
290+
<copy todir="${basedir}/build/phar/lib/microsoft/azure-storage-blob">
291+
<fileset dir="${basedir}/vendor/microsoft/azure-storage-blob/src">
292+
<include name="**/*.php"/>
293+
</fileset>
294+
</copy>
295+
<copy file="${basedir}/vendor/microsoft/azure-storage-common/LICENSE"
296+
tofile="${basedir}/build/phar/lib/microsoft/azure-storage-common/LICENSE"/>
297+
<copy todir="${basedir}/build/phar/lib/microsoft/azure-storage-common">
298+
<fileset dir="${basedir}/vendor/microsoft/azure-storage-common/src">
299+
<include name="**/*.php"/>
300+
</fileset>
301+
</copy>
302+
<!-- GUZZLE (AWS / OPENSTACK / AZURE) -->
288303
<copy file="${basedir}/vendor/guzzlehttp/guzzle/LICENSE"
289304
tofile="${basedir}/build/phar/lib/guzzlehttp/guzzle/LICENSE"/>
290305
<copy todir="${basedir}/build/phar/lib/guzzlehttp/guzzle">

build/phar-manifest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"softlayer/objectstorage",
3131
"vlucas/phpdotenv",
3232
"google/apiclient",
33-
"php-opencloud/openstack"
33+
"php-opencloud/openstack",
34+
"microsoft/azure-storage-blob"
3435
])) {
3536
continue;
3637
}

src/Backup/Sync/AzureBlob.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ class AzureBlob implements Simulator
7878
public function setup(array $config)
7979
{
8080
if (!class_exists('\\MicrosoftAzure\\Storage\\Blob\\BlobRestProxy')) {
81-
throw new Exception('Azure Bob Storage SDK not loaded: use composer to install "microsoft/azure-storage-blob"');
81+
throw new Exception('Azure Bob Storage SDK not loaded: use composer to install ' .
82+
'"microsoft/azure-storage-blob"');
8283
}
8384

8485
// check for mandatory options

tests/phpbu/Backup/Collector/AzureBlobTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public function testCollector()
5454
"Etag" => "0x8D702FF4A6EFED0",
5555
"Content-Length" => "100",
5656
"Content-Type" => "application/octet-stream",
57-
"Content-Encoding" => NULL,
58-
"Content-Language" => NULL,
57+
"Content-Encoding" => null,
58+
"Content-Language" => null,
5959
"Content-MD5" => "4zrnbmTxOxLksK3+1ulT8g==",
60-
"Cache-Control" => NULL,
61-
"Content-Disposition" => NULL,
60+
"Cache-Control" => null,
61+
"Content-Disposition" => null,
6262
"BlobType" => "BlockBlob",
6363
"AccessTier" =>"Hot",
6464
"AccessTierInferred" => "true",
@@ -75,11 +75,11 @@ public function testCollector()
7575
"Etag" => "0x8D702FF4A6EFED0",
7676
"Content-Length" => "100",
7777
"Content-Type" => "application/octet-stream",
78-
"Content-Encoding" => NULL,
79-
"Content-Language" => NULL,
78+
"Content-Encoding" => null,
79+
"Content-Language" => null,
8080
"Content-MD5" => "4zrnbmTxOxLksK3+1ulT8g==",
81-
"Cache-Control" => NULL,
82-
"Content-Disposition" => NULL,
81+
"Cache-Control" => null,
82+
"Content-Disposition" => null,
8383
"BlobType" => "BlockBlob",
8484
"AccessTier" =>"Hot",
8585
"AccessTierInferred" => "true",
@@ -96,11 +96,11 @@ public function testCollector()
9696
"Etag" => "0x8D702FF4A6EFED0",
9797
"Content-Length" => "100",
9898
"Content-Type" => "application/octet-stream",
99-
"Content-Encoding" => NULL,
100-
"Content-Language" => NULL,
99+
"Content-Encoding" => null,
100+
"Content-Language" => null,
101101
"Content-MD5" => "4zrnbmTxOxLksK3+1ulT8g==",
102-
"Cache-Control" => NULL,
103-
"Content-Disposition" => NULL,
102+
"Cache-Control" => null,
103+
"Content-Disposition" => null,
104104
"BlobType" => "BlockBlob",
105105
"AccessTier" =>"Hot",
106106
"AccessTierInferred" => "true",
@@ -111,7 +111,7 @@ public function testCollector()
111111
]
112112
]
113113
],
114-
"NextMarker" => NULL
114+
"NextMarker" => null
115115
]
116116
);
117117

@@ -165,7 +165,7 @@ public function testNoBlobResult()
165165
"Blobs" => [
166166
"Blob" => []
167167
],
168-
"NextMarker" => NULL
168+
"NextMarker" => null
169169
]
170170
);
171171

tests/phpbu/Backup/Sync/AzureBlobTest.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testSync()
8888
"ServiceEndpoint" => "https://accountname.blob.core.windows.net/"
8989
],
9090
"Containers" => [],
91-
"NextMarker" => NULL
91+
"NextMarker" => null
9292
]);
9393

9494
$clientMock = $this->createAzureBlobMock();
@@ -100,7 +100,8 @@ public function testSync()
100100
$azureBlob->method('getFileHandle')->willReturn('filehandle');
101101

102102
$azureBlob->setup([
103-
'connection_string' => 'DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=accountkey;EndpointSuffix=core.windows.net',
103+
'connection_string' => 'DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=accountkey;' .
104+
'EndpointSuffix=core.windows.net',
104105
'container_name' => 'dummy-container-name',
105106
'path' => 'backup'
106107
]);
@@ -123,7 +124,7 @@ public function testSyncWithRemoteCleanup()
123124
"ServiceEndpoint" => "https://accountname.blob.core.windows.net/"
124125
],
125126
"Containers" => [],
126-
"NextMarker" => NULL
127+
"NextMarker" => null
127128
]);
128129

129130
$azureBlobContents = ListBlobsResult::create(
@@ -137,7 +138,7 @@ public function testSyncWithRemoteCleanup()
137138
"Blobs" => [
138139
"Blob" => []
139140
],
140-
"NextMarker" => NULL
141+
"NextMarker" => null
141142
]
142143
);
143144

@@ -151,7 +152,8 @@ public function testSyncWithRemoteCleanup()
151152
$azureBlob->method('getFileHandle')->willReturn('filehandle');
152153

153154
$azureBlob->setup([
154-
'connection_string' => 'DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=accountkey;EndpointSuffix=core.windows.net',
155+
'connection_string' => 'DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=accountkey;' .
156+
'EndpointSuffix=core.windows.net',
155157
'container_name' => 'dummy-container-name',
156158
'path' => 'backup',
157159
'cleanup.type' => 'quantity',
@@ -176,7 +178,7 @@ public function testSyncFail()
176178
"ServiceEndpoint" => "https://accountname.blob.core.windows.net/"
177179
],
178180
"Containers" => [],
179-
"NextMarker" => NULL
181+
"NextMarker" => null
180182
]);
181183

182184
$clientMock = $this->createAzureBlobMock();
@@ -189,7 +191,8 @@ public function testSyncFail()
189191
$azureBlob->method('getFileHandle')->willReturn('filehandle');
190192

191193
$azureBlob->setup([
192-
'connection_string' => 'DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=accountkey;EndpointSuffix=core.windows.net',
194+
'connection_string' => 'DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=accountkey;' .
195+
'EndpointSuffix=core.windows.net',
193196
'container_name' => 'dummy-container-name',
194197
'path' => 'backup'
195198
]);

0 commit comments

Comments
 (0)