Skip to content

Rely on iconv and symfony/polyfill-* #16317

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

Merged
merged 1 commit into from
Oct 28, 2015
Merged

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #16240
License MIT
Doc PR -

Status: needs work
symfony/polyfill-* packages are not ready yet. Still, review welcomed.

@xabbuh
Copy link
Member

xabbuh commented Oct 22, 2015

The DoctrineBridge needs an update of the composer.json file.

@nicolas-grekas
Copy link
Member Author

@xabbuh not sure: iconv is an implicit requirement now (same as ext-json)

@@ -17,25 +17,25 @@
],
"require": {
"php": ">=5.3.9",
"paragonie/random_compat": "~1.0"
Copy link
Member

Choose a reason for hiding this comment

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

This must be kept (random_bytes() is used in the SecureRandom class).

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, I'm going to add random_compat to polyfill-php70 that's why it's removed from here

Copy link
Member

Choose a reason for hiding this comment

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

okay

@xabbuh
Copy link
Member

xabbuh commented Oct 22, 2015

@nicolas-grekas Is iconv even available on Windows by default?

@nicolas-grekas
Copy link
Member Author

@xabbuh yes, it's bundled on Windows without adding any dll, at least in the binaries provided on windows.php.net

@Tobion
Copy link
Contributor

Tobion commented Oct 22, 2015

Is the idea also to move the Intl component to Polyfill? Isn't the Intl component not basically a Polyfill or does it do more?

@@ -52,7 +52,7 @@ public static function parse($value, $exceptionOnInvalidType = false, $objectSup
return '';
}

if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this constant polyfilled?

Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we check for extension_loaded('mbstring') here ? Only the extension itself can overload functions anyway

Copy link
Member Author

Choose a reason for hiding this comment

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

the extension must be enabled for ini_get to return 2 so this is equivalent

Copy link
Member Author

Choose a reason for hiding this comment

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

@nicolas-grekas nicolas-grekas force-pushed the polyfill branch 2 times, most recently from 1c39e08 to e8c5ffc Compare October 23, 2015 08:21
@nicolas-grekas
Copy link
Member Author

@Tobion there where a few missing require for symfony/polyfill-intl-icu that I fixed. I looked at symfony/intl and it's both a shim and a utility component. I added @internal tags to the shim-related classes. Moving the code to polyfill-intl-icu could be useful as a cleanup but it's a bigger work and it won't provide much practical value so I'd like to postpone it for later if we want it.

@nicolas-grekas nicolas-grekas force-pushed the polyfill branch 4 times, most recently from 1baf102 to 11e866e Compare October 25, 2015 17:46
@nicolas-grekas
Copy link
Member Author

Tests are green! (appveyor failure is a transient test)
Status: needs review

@@ -330,6 +330,9 @@ public function escape($value, $context = 'html')
*/
public function setCharset($charset)
{
if ('UTF8' === $charset = strtoupper($charset)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need that? Shouldn't it be deprecated if it is for bc? Looks like a hack.

Copy link
Member Author

Choose a reason for hiding this comment

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

it's because iconv on windows doesn't accept utf8 as an encoding name: only utf-8 is supported

Copy link
Contributor

Choose a reason for hiding this comment

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

would be good to add this as comment

Copy link
Member Author

Choose a reason for hiding this comment

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

comment added

@Tobion
Copy link
Contributor

Tobion commented Oct 25, 2015

👍

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Oct 28, 2015

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 303f05b into symfony:2.8 Oct 28, 2015
fabpot added a commit that referenced this pull request Oct 28, 2015
This PR was merged into the 2.8 branch.

Discussion
----------

Rely on iconv and symfony/polyfill-*

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #16240
| License       | MIT
| Doc PR        | -

Status: needs work
symfony/polyfill-* packages are not ready yet. Still, review welcomed.

Commits
-------

303f05b Rely on iconv and symfony/polyfill-*
@nicolas-grekas nicolas-grekas deleted the polyfill branch October 28, 2015 02:40
@ghost
Copy link

ghost commented Oct 28, 2015

@fabpot #16363

@Tobion
Copy link
Contributor

Tobion commented Oct 29, 2015

I merged 2.8 in master and resolved all the conflicts.

@@ -16,7 +16,8 @@
}
],
"require": {
"php": ">=5.3.9"
"php": ">=5.3.9",
"symfony/polyfill-php54": "~1.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong: #16382

Tobion added a commit that referenced this pull request Oct 29, 2015
…5 (Tobion)

This PR was merged into the 2.8 branch.

Discussion
----------

[Serializer] polyfill for json_last_error_msg is in php 5.5

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16317
| License       | MIT
| Doc PR        | -

We need the polyfill for `json_last_error_msg` which is part of php 5.5, not 5.4.

Commits
-------

fb031f1 [Serializer] polyfill for json_last_error_msg is in php 5.5
Tobion added a commit that referenced this pull request Oct 30, 2015
This PR was merged into the 3.0-dev branch.

Discussion
----------

remove polyfills for unsupported php versions

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Remove obsolete polyfills in master as introduced in #16317

Commits
-------

78512cc remove polyfills for unsupported php versions
@fabpot fabpot mentioned this pull request Nov 16, 2015
nicolas-grekas added a commit that referenced this pull request Dec 29, 2015
…ency (xabbuh)

This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] add missing symfony/polyfill-php55 dependency

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16317
| License       | MIT
| Doc PR        |

The `json_last_error_msg()` function used in the `JsonResponse` class
requires PHP 5.5.

Commits
-------

3cc4e4d add missing symfony/polyfill-php55 dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants