Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
867c155
Added docs and example to work with identity v2.0
haphan Feb 6, 2018
8cdf33e
Fixed refdoc build
haphan Feb 6, 2018
72b7496
Merge pull request #204 from php-opencloud/identity-v2
haphan Feb 6, 2018
3f5d9f4
Added semver
haphan Feb 6, 2018
ac5154d
Merge pull request #205 from php-opencloud/semver
haphan Feb 6, 2018
338c029
Update authentication.php
haphan Feb 6, 2018
55889bc
Merge pull request #207 from php-opencloud/patch-newline
haphan Feb 6, 2018
8c1fe4c
Fixed containerName was not set
haphan Feb 8, 2018
1033431
Merge pull request #208 from php-opencloud/fix-objstore-containername
haphan Feb 8, 2018
4adc505
Object Storage retrieval: containerName and name missing (#210)
haphan Feb 9, 2018
7f5087e
Update README.md (#212)
haphan Feb 10, 2018
0a0b2ec
Add 'subdir' as alias for 'name' in StorageObject (#214)
icewind1991 Feb 15, 2018
9210914
Handle Datetime serialization (#148)
tchiotludo Feb 16, 2018
c9f72c0
Enforce Symfony rule check (#223)
haphan Mar 13, 2018
5dcac99
Bumped up php-coveralls to remove dated guzzle (#226)
haphan Mar 13, 2018
2883c92
Readme (#227)
haphan Mar 13, 2018
7311b52
Fixed ObjectStorage PHPDoc of contentLength and lastModified
Apr 30, 2018
3374e2b
Merge pull request #238 from vitalybaev/fixed-object-storage-phpdoc-t…
haphan May 2, 2018
22eb492
Removed sami/sami. Changed travis email notification
haphan Aug 29, 2018
884e7ec
Keep php-cs-fixer happy
haphan Aug 29, 2018
5230354
Merge pull request #253 from php-opencloud/remove-sami
haphan Aug 29, 2018
1d5eb28
Update composer: php-coveralls/php-coveralls
haphan Aug 29, 2018
73502af
BlockStorage: setBootable, setImageMetadata, resetStatus
haphan Aug 29, 2018
0aad1d0
Compute: keypairType
haphan Aug 29, 2018
526745f
Networking: portSecurity, routerExternal for Network
haphan Aug 29, 2018
66ee164
Networking L3: Mapping external fixed IPs
haphan Aug 29, 2018
76c8387
ObjectStore: Fixed typehint
haphan Aug 29, 2018
64b9e41
Networking SecurityGroups Ext: add filterName
haphan Aug 29, 2018
e875038
Added tests
haphan Aug 29, 2018
c5cf03e
Code review
haphan Aug 29, 2018
eec8fb4
Merge pull request #254 from php-opencloud/updates
haphan Aug 30, 2018
0876029
Fix number of segments of a large object
mzur Sep 13, 2018
3eba351
Merge pull request #255 from biigle/fix-large-object-segments
haphan Sep 14, 2018
689cb05
Merge remote-tracking branch 'upstream/master' into merge-latest
laszlof Mar 12, 2019
2ca24e7
Merge remote-tracking branch 'nexcess/master' into merge-latest
laszlof Mar 12, 2019
7ba159a
fix
laszlof Mar 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/ObjectStore/v1/Models/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,11 @@ public function createLargeObject(array $data): StorageObject
$service->createContainer(['name' => $segmentContainer]);
}

$promises = [];
$count = 0;
$promises = [];
$count = 0;
$totalSegments = $stream->getSize() / $segmentSize;

while (!$stream->eof() && $count < round($stream->getSize() / $segmentSize)) {
while (!$stream->eof() && $count < $totalSegments) {
$promises[] = $this->model(StorageObject::class)->createAsync([
'name' => sprintf('%s/%d', $segmentPrefix, ++$count),
'stream' => new LimitStream($stream, $segmentSize, ($count - 1) * $segmentSize),
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/ObjectStore/v1/Models/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function test_other_exceptions_are_thrown()
public function test_it_chunks_according_to_provided_segment_size()
{
/** @var \GuzzleHttp\Psr7\Stream $stream */
$stream = \GuzzleHttp\Psr7\stream_for(implode('', range('A', 'Z')));
$stream = \GuzzleHttp\Psr7\stream_for(implode('', range('A', 'X')));

$data = [
'name' => 'object',
Expand All @@ -235,6 +235,7 @@ public function test_it_chunks_according_to_provided_segment_size()

$this->setupMock('PUT', 'segments', null, [], new Response(201));

// The stream has size 24 so we expect three segments.
$this->setupMock('PUT', 'segments/objectPrefix/1', $stream->read(10), [], new Response(201));
$this->setupMock('PUT', 'segments/objectPrefix/2', $stream->read(10), [], new Response(201));
$this->setupMock('PUT', 'segments/objectPrefix/3', $stream->read(10), [], new Response(201));
Expand Down