Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format segment name, close #365 #366

Merged
merged 6 commits into from
Sep 25, 2023
Merged

format segment name, close #365 #366

merged 6 commits into from
Sep 25, 2023

Conversation

vpecinka
Copy link
Contributor

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

@k0ka
Copy link
Member

k0ka commented Sep 25, 2023

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
Contributor Author

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

@vpecinka
Copy link
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
6 checks passed
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