Skip to content

format segment name, close #365 - #366

Merged
k0ka merged 6 commits into
php-opencloud:masterfrom
vpecinka:master
Sep 25, 2023
Merged

k0ka merged 6 commits into
php-opencloud:masterfrom
vpecinka:master

Conversation

@vpecinka

Copy link
Copy Markdown
Contributor

For Swift storage and large objects numbers has to be padded with zero for correct segment order.

@k0ka

k0ka commented Sep 25, 2023

Copy link
Copy Markdown
Member

Thank you for the PR.

Your current implementation has not obvious limit of 10000 segments. I guess we should either assert it and throw an exception or add another parameter $data['segmentCountFormat'] to createLargeObject with default value %05d.

I also want to add an integration test for this case.

@vpecinka

Copy link
Copy Markdown
Contributor Author

added the config option segmentIndexFormat with default value %05d and fixed the unit test.

@vpecinka

Copy link
Copy Markdown
Contributor Author

also added isValidSegmentIndexFormat() to check proper format (has to produce different values for given format and different values, plus result has to have same string length)

@k0ka
k0ka merged commit 42e66d8 into php-opencloud:master Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants