Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Made use of "kB" vs. "KiB" consistent#10951

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 2 commits intosymfony:masterfromwebmozart:issue10661
May 22, 2014

Conversation

@webmozart
Copy link
Contributor

QA
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

Continuation of#10661.

This PR makes the usage of "kB" and "KiB" consistent across the project. The notations equal the internationally recognized ones:

Short formLong formValue in Bytes
Bbytes1
kBkilobytes1000
KiBkibibytes1024
MBmegabytes1000000
MiBmebibytes1048576
GBgigabytes1000000000
GiBgibibytes1073741824

The reason for differentiating between the two is that several users got confused with the current mix (see#10648,#10917,#10661).

FileValidator, UploadedFile and the ProgressBar helper were changed accordingly.

Follow-up feature request:#10962

@Tobion
Copy link
Contributor

-1 for the same reason as in#10661 (comment)

@webmozart
Copy link
ContributorAuthor

@Tobion I read and understand that reason. I also initially implemented theFile constraint to handle both SI and 2-based measures when working on this PR.

However, since the PHP manual explicitly states that it interprets "kilobytes" and "megabytes" as being 2-based, I think the best choice is to stick with that convention. I therefore removed the SI-handling code again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

why are you changing this test ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

"kB" → "KB"

I also changed the Unicode symbol to the explicit hex notation, since PHPStorm broke the symbol when I saved the file for some reason.

@Tobion
Copy link
Contributor

@webmozart But we don't need to continue the mistakes of PHP.

@snoob
Copy link
Contributor

I agree with@webmozart

@webmozart
Copy link
ContributorAuthor

@Tobion The alternative, which I had implemented, would be to explicitly differentiate between "kB"/"MB"/"GB"/... and "KiB"/"MiB"/"GiB"/... Since the console component displays memory in the 2-based measure (which is the convention), the console output would therefore also change from e.g.97 kB to97 KiB. This output is targeted at end users. The question is: Do end users know what "KiB" means?

I figured that the answer was probably no and removed the code again for that reason, staying in line with PHP's conventions (which were probably picked for the same reason). I don't think there's a benefit in being technically 100% correct here.

@Tobion
Copy link
Contributor

The memory output is for developers or other technicians. So they either know it or can look it up in 1 second. I'd prefer not to add to the confusion between binary and SI prefixes and once for all make it clear. Otherwise this debate will continue forever.
But if no other core member agrees I can live with it because I know that we mean binary measures (but all other other users will stay confused).

@Tobion
Copy link
Contributor

Btw the memory standards even refer to binary prefixes as alternative.http://en.wikipedia.org/wiki/JEDEC_memory_standards#Unit_prefixes_for_semiconductor_storage_capacity

@webmozart
Copy link
ContributorAuthor

Ok. I'd like to hear some more opinions though before changing this back.

@jderusse
Copy link
Member

May be a conflict with this PR#10917 ?

@webmozartwebmozart changed the titleUse "KB" everywhere instead of "kB"Made use of "kB" vs. "KiB" consistentMay 22, 2014
@webmozart
Copy link
ContributorAuthor

Alright, after reviewing#10648,#10917 and#10661, I changed the code and PR description again. We now explicitly differentiate between "kB" and "KiB" to avoid further confusions.

In a follow-up PR for the master branch (2.6), the specification of the "maxSize" option in theFile constraint in kibibytes etc. should be supported:#10962

@webmozart
Copy link
ContributorAuthor

@fabpot You may want to merge this into 2.3, there are no BC concerns involved except for the text output.

@Tobion
Copy link
Contributor

+1 now :)

@fabpotfabpot merged commite4c6da5 intosymfony:masterMay 22, 2014
fabpot added a commit that referenced this pull requestMay 22, 2014
This PR was merged into the 2.5-dev branch.Discussion----------Made use of "kB" vs. "KiB" consistent| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Continuation of#10661.This PR makes the usage of "kB" and "KiB" consistent across the project. The notations equal the internationally recognized ones:Short form | Long form | Value in Bytes--- | --- | ---B | bytes | 1kB | kilobytes | 1000KiB | kibibytes | 1024MB | megabytes | 1000000MiB | mebibytes | 1048576GB | gigabytes | 1000000000GiB | gibibytes | 1073741824The reason for differentiating between the two is that several users got confused with the current mix (see#10648,#10917,#10661).FileValidator, UploadedFile and the ProgressBar helper were changed accordingly.Follow-up feature request:#10962Commits-------e4c6da5 [Validator] Improved to-string conversion of the file size/size limitbbe1045 [Validator][Console][HttpFoundation] Use "KiB" everywhere (instead of "kB")
@webmozartwebmozart deleted the issue10661 branchAugust 4, 2014 14:40
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@webmozart@Tobion@snoob@jderusse@stof@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp