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

[Validator] Added support for validation of giga values#32485

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 1 commit intosymfony:3.4fromkernig:3.4
Jul 19, 2019

Conversation

@kernig
Copy link
Contributor

As described in issue#32479

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?just tested on my presta and it works. if further tests are necessary, it would be great if someone could help!
Fixed tickets#32479
LicenseMIT
Doc PR

The validation(function normalizeBinaryFormat) in symfony/src/Symfony/Component/Validator/Constraints/File.php doesn't work with gigabyte values in php.ini.
In the PHP documentation it says "PHP allows shortcuts for byte values, including K (kilo), M (mega) and G (giga). " so in my opinion these values should work.
Thanks to@kijamve for the fix.

Copy link
Member

@derrabusderrabus left a comment

Choose a reason for hiding this comment

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

Can you please add a test?

'ki' =>1 <<10,
'm' =>1000000,
'mi' =>1 <<20,
'g' =>1000000000,
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd rather use constant expression as it is easier to see that the value is correct

Suggested change
'g' =>1000000000,
'g' =>1000 *1000 *1000,

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Great idea. Could you add the change for 'm' as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

as this is a bugfix it's advisable to leave it for the next commit

if you want to change it (i certainly like code consistency) this is the line:

'm' =>1000 *1000,

@kernig
Copy link
ContributorAuthor

@derrabus ok, i'll try to setup a testing environment for it but it will take a few days, probably.

@nicolas-grekasnicolas-grekas changed the titleAdded support for validation of giga values[Validator] Added support for validation of giga valuesJul 18, 2019
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

as is is consistent

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Tests fail, please have a look at them :)

@kernig
Copy link
ContributorAuthor

@nicolas-grekas
fixed the problem, can you help with travis-ci check on PHP 7.2?

@fabpot
Copy link
Member

Thank you@kernig.

@fabpotfabpot merged commit969f2c4 intosymfony:3.4Jul 19, 2019
fabpot added a commit that referenced this pull requestJul 19, 2019
…ernig)This PR was squashed before being merged into the 3.4 branch (closes#32485).Discussion----------[Validator] Added support for validation of giga valuesAs described in issue#32479| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | just tested on my presta and it works. if further tests are necessary, it would be great if someone could help!| Fixed tickets |#32479| License       | MIT| Doc PR        |The validation(function normalizeBinaryFormat) in symfony/src/Symfony/Component/Validator/Constraints/File.php doesn't work with gigabyte values in php.ini.In the PHP documentation it says "PHP allows shortcuts for byte values, including K (kilo), M (mega) and G (giga). " so in my opinion these values should work.Thanks to@kijamve for the fix.Commits-------969f2c4 [Validator] Added support for validation of giga values
This was referencedJul 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus requested changes

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@kaznovackaznovackaznovac left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@kernig@fabpot@kaznovac@nicolas-grekas@derrabus@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp