Commit Graph

24880 Commits

Author SHA1 Message Date
Fabien Potencier
c435c2f6c6 bug #17430 [Serializer] Ensure that groups are strings (dunglas)
This PR was squashed before being merged into the 2.7 branch (closes #17430).

Discussion
----------

[Serializer] Ensure that groups are strings

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

Commits
-------

0a3b877 [Serializer] Ensure that groups are strings
2016-01-26 07:57:14 +01:00
Kévin Dunglas
0a3b87701c [Serializer] Ensure that groups are strings 2016-01-26 07:57:11 +01:00
Nicolas Grekas
1285a0d637 [Debug] Tell that the extension is for PHP 5 only 2016-01-26 00:34:19 +01:00
Tobias Schultze
714fcc60ec suggest apcu polyfill as apcu_* function are not yet available on hhvm 2016-01-25 23:42:51 +01:00
Nicolas Grekas
d21fab0d0b [Cache] Handle and log errors properly 2016-01-25 20:18:55 +01:00
Fabien Potencier
dd4acae867 bug #16795 [FrameworkBundle][Validator] Fix apc cache service & config (ogizanagi)
This PR was merged into the 3.0 branch.

Discussion
----------

[FrameworkBundle][Validator] Fix apc cache service & config

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

_Keep track of https://github.com/symfony/symfony/pull/16794#discussion_r46368928_

_NOTE_: This PR is on standby. If https://github.com/symfony/symfony/pull/16822 is merged, this one might probably be closed, as everything will be done during the merge.

Commits
-------

94a1728 [FrameworkBundle][Validator] Fix apc cache service & config
2016-01-25 19:30:14 +01:00
ogizanagi
94a17282b8 [FrameworkBundle][Validator] Fix apc cache service & config 2016-01-25 19:17:11 +01:00
Fabien Potencier
375b3b6c3c minor #17528 [Form] Remove unused private method (paradajozsef)
This PR was merged into the 3.0 branch.

Discussion
----------

[Form] Remove unused private method

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | FormValidatorTest::testMissingConstraintIndex() failed, but not relevant
| Fixed tickets | #1234
| License       | MIT
| Doc PR        | -

In 3.0 there is no reference to the private [indent method](https://github.com/symfony/symfony/blob/3.0/src/Symfony/Component/Form/Form.php#L1149).

There was only [one reference in 2.8](https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Form/Form.php#L843), but it has been removed.

Commits
-------

0fb1664 [Form] Remove unused private method
2016-01-25 19:05:54 +01:00
Paráda József
0fb1664eb4 [Form] Remove unused private method 2016-01-25 18:52:24 +01:00
Fabien Potencier
40035327b2 bug #15272 [FrameworkBundle] Fix template location for PHP templates (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] Fix template location for PHP templates

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

- [x] improve the test to cover logical path & filesystem path
- [x] Add a new test case and fix the path to the template

As the first commit only enchanced the test, and the second commit fixed the bug, it's best to review them seperately.

Commits
-------

132a4e4 [FrameworkBundle] Fix template location for PHP templates
cd42e2d [FrameworkBundle] Add path verification to the template parsing test cases
2016-01-25 18:08:12 +01:00
Fabien Potencier
1a8003e8fa fixed bad merge 2016-01-25 18:01:19 +01:00
Konstantin.Myakshin
8db691ab94 Static code analysis 2016-01-25 19:00:36 +02:00
Fabien Potencier
a0a97d7521 bug #11232 [Routing] Fixes fatal errors with object resources in AnnotationDirectoryLoader::supports (Tischoi)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11232).

Discussion
----------

[Routing] Fixes fatal errors with object resources in AnnotationDirectoryLoader::supports

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

Fixes fatal errors that occur in the supports method with objects that aren't string convertible / don't implement ArrayAccess. This is mostly a problem because some locators try to access a specific character in the resource name.
Since the resource is checked if it's a string either way, it's the most simple solution to just move that check a bit ahead.

Commits
-------

5e80585 Update AnnotationDirectoryLoader.php
2016-01-25 17:58:14 +01:00
Tischoi
5e805850cc Update AnnotationDirectoryLoader.php 2016-01-25 17:58:14 +01:00
Fabien Potencier
193d5c8dd5 added a test 2016-01-25 17:36:36 +01:00
Fabien Potencier
7921e476c3 Merge branch '2.3' into 2.7
* 2.3:
  Escape the delimiter in Glob::toRegex
2016-01-25 17:36:11 +01:00
Fabien Potencier
ff4b815fdf bug #17526 Escape the delimiter in Glob::toRegex (javiereguiluz)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #17526).

Discussion
----------

Escape the delimiter in Glob::toRegex

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

Commits
-------

2c45f46 Escape the delimiter in Glob::toRegex
2016-01-25 17:35:29 +01:00
Javier Eguiluz
2c45f461c2 Escape the delimiter in Glob::toRegex 2016-01-25 17:35:23 +01:00
Fabien Potencier
f521c11097 Merge branch '2.8' into 3.0
* 2.8:
  fixed undefined variable
  Fixed the phpDoc of UserInterface
  fixed APCu dep version
  make apc class loader testable against apcu without apc bc layer
  Added support for the `0.0.0.0/0` trusted proxy
  fixed CS
  [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument
  Limit the max height/width of icons in the profiler menu
  added missing constant
  Added 451 status code
  Remove unnecessary code
  Allow absolute URLs to be displayed in the debug toolbar
  [ClassLoader] Use symfony/polyfill-apcu
  update upgrade files with CSRF related option info
  [TranslationUpdateCommand] fixed undefined resultMessage var.
  [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2016-01-25 17:31:17 +01:00
Fabien Potencier
fe14e38a54 Merge branch '2.7' into 2.8
* 2.7:
  fixed undefined variable
  Fixed the phpDoc of UserInterface
  fixed APCu dep version
  make apc class loader testable against apcu without apc bc layer
  Added support for the `0.0.0.0/0` trusted proxy
  [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument
  added missing constant
  Added 451 status code
  Remove unnecessary code
  Allow absolute URLs to be displayed in the debug toolbar
  [ClassLoader] Use symfony/polyfill-apcu
  [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2016-01-25 17:29:20 +01:00
Fabien Potencier
ce0946dde0 Merge branch '2.3' into 2.7
* 2.3:
  fixed undefined variable
  Fixed the phpDoc of UserInterface
  fixed APCu dep version
  Added support for the `0.0.0.0/0` trusted proxy
  [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument
  [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2016-01-25 17:27:59 +01:00
Fabien Potencier
ca96e334b4 bug #17527 fixed undefined variable (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

fixed undefined variable

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

Commits
-------

4b21351 fixed undefined variable
2016-01-25 17:23:42 +01:00
Fabien Potencier
1d3fc10bca minor #17525 Fixed the phpDoc of UserInterface (javiereguiluz)
This PR was merged into the 2.3 branch.

Discussion
----------

Fixed the phpDoc of UserInterface

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

#13037 is the original issue ... which was tried to be fixed in #13146 ... which was closed without merging it.

Commits
-------

8e2a33e Fixed the phpDoc of UserInterface
2016-01-25 17:22:59 +01:00
Fabien Potencier
4b21351f36 fixed undefined variable 2016-01-25 17:19:48 +01:00
Javier Eguiluz
8e2a33ec2d Fixed the phpDoc of UserInterface 2016-01-25 16:23:13 +01:00
Fabien Potencier
48d91a83b6 feature #17522 [Cache] Use generator in ArrayAdapter (gcds)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Use generator in ArrayAdapter

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

Commits
-------

367e784 [Cache] Use generator in ArrayAdapter
2016-01-25 15:53:15 +01:00
Tobias Schultze
d9f02fb9b7 minor #17524 fixed APCu dep version (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

fixed APCu dep version

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

Commits
-------

3b7f4c7 fixed APCu dep version
2016-01-25 15:51:35 +01:00
Aurimas Niekis
367e784f25 [Cache] Use generator in ArrayAdapter 2016-01-25 15:49:11 +01:00
Fabien Potencier
3b7f4c7050 fixed APCu dep version 2016-01-25 15:47:02 +01:00
Fabien Potencier
acfa9abfdc feature #16164 [Serializer] Add a data: URI normalizer (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #16164).

Discussion
----------

[Serializer] Add a data: URI normalizer

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

A new normalizer to transform `\SplFileInfo`, `\SplFileObject` and `\Symfony\Component\HttpFoundation\File\File` to [`data:` URI](https://en.wikipedia.org/wiki/Data_URI_scheme) and the opposite.

It's convenient when dealing with the JavaScript `FileReader` API.

Usage:

```php
$normalizer = new DataUriNormalizer();
echo $normalizer->normalize(new File(__DIR__.'/test.gif'));
// data:image/gif;base64,R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=

echo $normalizer->normalize(new File(__DIR__.'/test.txt'));
// data:text/plain,K%C3%A9vin%20Dunglas%0A

var_dump($normalizer->denormalize('data:image/gif;base64,R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=', 'SplFileObject');
// a SplFileObject (also supports HttpFoundation file if the composant is installed)
```
cc @clementtalleu

Commits
-------

cc7b5af [Serializer] Add a data: URI normalizer
2016-01-25 15:33:51 +01:00
Kévin Dunglas
cc7b5af170 [Serializer] Add a data: URI normalizer 2016-01-25 15:33:44 +01:00
Fabien Potencier
81ab4ee008 minor #17521 make apc class loader testable against apcu without apc bc layer (Tobion)
This PR was merged into the 2.7 branch.

Discussion
----------

make apc class loader testable against apcu without apc bc layer

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

Commits
-------

24160b3 make apc class loader testable against apcu without apc bc layer
2016-01-25 14:21:14 +01:00
Fabien Potencier
8ccdd51543 minor #17519 remove obsolete apcu polyfill (Tobion)
This PR was merged into the 3.0 branch.

Discussion
----------

remove obsolete apcu polyfill

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

As @gapple pointed out in #17396

> APC is PHP <=5.4, so symfony/polyfill-apcu shouldn't be a dependency on 3.0 or master

Commits
-------

5bf64ea remove obsolete apcu polyfill
2016-01-25 14:20:33 +01:00
Fabien Potencier
e66d33f0cb minor #17403 [Form][Security] update upgrade files with CSRF related option info (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form][Security] update upgrade files with CSRF related option info

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

Commits
-------

1ecbb32 update upgrade files with CSRF related option info
2016-01-25 14:16:43 +01:00
Tobias Schultze
24160b3a2f make apc class loader testable against apcu without apc bc layer 2016-01-25 14:16:04 +01:00
Tobias Schultze
5bf64ea53d remove obsolete apcu polyfill 2016-01-25 14:06:23 +01:00
Fabien Potencier
cda6cbafa3 feature #15279 Added {{ value }} message placeholder to UniqueEntityValidator (jperovic)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #15279).

Discussion
----------

Added {{ value }} message placeholder to UniqueEntityValidator

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

Apologize if I missed something. This is my first contribution to a large scale project.

Commits
-------

9cf1ce9 Added {{ value }} message placeholder to UniqueEntityValidator
2016-01-25 13:43:57 +01:00
Jovan Perovic
9cf1ce918d Added {{ value }} message placeholder to UniqueEntityValidator 2016-01-25 13:43:51 +01:00
Fabien Potencier
81605dd7c9 bug #15706 [framework-bundle] Added support for the 0.0.0.0/0 trusted proxy (zerkms)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15706).

Discussion
----------

[framework-bundle] Added support for the `0.0.0.0/0` trusted proxy

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

It is relevant to my other PR: https://github.com/symfony/symfony/pull/14690

The original intention was to start accepting `0.0.0.0/0` as a trusted proxy (which is a valid CIDR notation).

The prupose is to allow all requests to be treated as trusted and to eliminate using dirty `['0.0.0.0/1', '128.0.0.0/1']` workaround.

Commits
-------

3188e1b Added support for the `0.0.0.0/0` trusted proxy
2016-01-25 13:36:48 +01:00
Ivan Kurnosov
3188e1b5d2 Added support for the 0.0.0.0/0 trusted proxy 2016-01-25 13:36:47 +01:00
Fabien Potencier
c650b8fa3e feature #16652 [console] Add truncate method to FormatterHelper (mheki)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #16652).

Discussion
----------

[console] Add truncate method to FormatterHelper

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

This PR adds a `truncate` method to `FormatterHelper`.
Message is truncated to the given length, then the suffix is appended to end of that string.
If the length is negative, number of letters to truncate is counted from the end of the message.
Suffix is always appended, unless truncate length is longer than message and suffix length.

Commits
-------

a16b1a0 [console] Add truncate method to FormatterHelper
2016-01-25 13:26:46 +01:00
Marek Pietrzak
a16b1a0228 [console] Add truncate method to FormatterHelper 2016-01-25 13:26:46 +01:00
Fabien Potencier
0d3bde8ae6 feature #17438 [Cache] Allow and use generators in AbstractAdapter (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Allow and use generators in AbstractAdapter

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

The most important enhancement is allowing doFetch to return a generator, which wasn't possible before.
The other changes add strictness.

Commits
-------

0ba851a [Cache] Allow and use generators in AbstractAdapter
2016-01-25 13:23:12 +01:00
Fabien Potencier
8059dc1bab bug #16274 [HttpKernel] Lookup the response even if the lock was released after two second wait (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Lookup the response even if the lock was released after two second wait

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

While looking into #15813 I noticed that we [wait for the lock to be released for five seconds, but then only do a lookup if the lock was released in two seconds](fa604d3c6f/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php (L540-L562)), no more.

I think it's worth to make both values the same (so either two or five seconds). I see no reason why we should wait for the lock for five seconds, but then only do a lookup if we waited for two. One way the wait either takes too long, the other way we loose the opportunity to actually return a response.

Commits
-------

9963170 [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2016-01-25 13:21:38 +01:00
Fabien Potencier
05dfbdbf40 minor #16635 [Security] add USERNAME_NONE_PROVIDED constant (SofHad)
This PR was submitted for the 2.8 branch but it was merged into the 3.1-dev branch instead (closes #16635).

Discussion
----------

[Security] add USERNAME_NONE_PROVIDED constant

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

I think that is better if we use a constant to define this string.

Commits
-------

3f60598 [Security] add USERNAME_NONE_PROVIDED constant
2016-01-25 13:06:56 +01:00
SofHad
3f605982e1 [Security] add USERNAME_NONE_PROVIDED constant 2016-01-25 13:06:55 +01:00
Fabien Potencier
209d08fe2d fixed CS 2016-01-25 12:59:24 +01:00
Fabien Potencier
c5ae309592 bug #16954 [TranslationUpdateCommand] fixed undefined resultMessage var. (aitboudad)
This PR was merged into the 2.8 branch.

Discussion
----------

[TranslationUpdateCommand] fixed undefined resultMessage var.

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

Commits
-------

1999e89 [TranslationUpdateCommand] fixed undefined resultMessage var.
2016-01-25 12:58:18 +01:00
Fabien Potencier
a52ae99735 bug #17355 [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument (xavismeh)
This PR was squashed before being merged into the 2.3 branch (closes #17355).

Discussion
----------

[DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument

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

No verification on doctrine-orm version has been provided since the `composer.json` requires `"doctrine/orm": "~2.4,>=2.4.5"` and performing a query with an object as array argument has been added in 2.2.0-BETA1 (see https://github.com/doctrine/doctrine2/blob/2.2.0-BETA1/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L1511)

Commits
-------

5c2d534 [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument
2016-01-25 12:44:21 +01:00
Xavier Coureau
5c2d534a1f [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument 2016-01-25 12:44:19 +01:00