Commit Graph

23860 Commits

Author SHA1 Message Date
Kévin Dunglas
7bab21700d [Asset] Add support for preloading with links and HTTP/2 push 2017-02-19 14:56:07 -08:00
Fabien Potencier
554b1a748f Merge branch '3.2'
* 3.2:
  [Form] fixed tests
2017-02-06 13:27:36 +01:00
Fabien Potencier
6516a20e11 Merge branch '2.8' into 3.2
* 2.8:
  [Form] fixed tests
2017-02-06 13:27:26 +01:00
Fabien Potencier
9650b50436 [Form] fixed tests 2017-02-06 13:27:13 +01:00
Fabien Potencier
6ccdcdc330 Merge branch '3.2'
* 3.2:
  Remove 3.1 from PR template
  fixed test name
  [Cache] Fix class exists checks in PhpArrayAdapter
  Casting TableCell value to string.
  [FrameworkBundle] fixed custom domain for translations in php templates
  [Form] Fixed DateType format option
  [Config] Fix checking cache for non existing meta file
2017-02-06 13:04:42 +01:00
Fabien Potencier
cfc6bafed2 Merge branch '2.8' into 3.2
* 2.8:
  Remove 3.1 from PR template
  fixed test name
  Casting TableCell value to string.
  [FrameworkBundle] fixed custom domain for translations in php templates
  [Form] Fixed DateType format option
  [Config] Fix checking cache for non existing meta file
2017-02-06 13:04:21 +01:00
Fabien Potencier
47a8b4dc58 Merge branch '2.7' into 2.8
* 2.7:
  Remove 3.1 from PR template
  fixed test name
  Casting TableCell value to string.
  [FrameworkBundle] fixed custom domain for translations in php templates
  [Form] Fixed DateType format option
2017-02-06 13:04:06 +01:00
Nicolas Grekas
6ac1223eca bug #20844 [Config] Fix checking cache for non existing meta file (hason)
This PR was merged into the 2.8 branch.

Discussion
----------

[Config] Fix checking cache for non existing meta file

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

Commits
-------

17f02e0 [Config] Fix checking cache for non existing meta file
2017-02-05 11:11:19 +01:00
Fabien Potencier
ad8f18963e fixed test name 2017-02-04 08:36:32 -08:00
Fabien Potencier
1d1f1666e7 bug #21063 [Form] Fixed DateType format option for single text widget (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed DateType format option for single text widget

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

It's currently not possible to use a custom format with `DateType` when not using one of the three values day, month or year (i.e in my case "MM/yyyy").

The formatter handles it, it looks like this option check is wrong, this PR fixes it.

Commits
-------

9e0d531d36 [Form] Fixed DateType format option
2017-02-04 08:34:51 -08:00
Nicolas Grekas
686af613aa [Config] Fix conditional class existence checks 2017-02-04 09:30:42 +01:00
Nicolas Grekas
44e5989850 [Cache] Fix class exists checks in PhpArrayAdapter 2017-02-04 09:30:23 +01:00
Fabien Potencier
f0d13f4708 bug #21430 Casting TableCell value to string. (jaydiablo)
This PR was squashed before being merged into the 2.7 branch (closes #21430).

Discussion
----------

Casting TableCell value to string.

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

PHP throws a catchable fatal error when the value from this method is
used in strstr in the Table class. This fixes the error by casting to a string before returning the value.

Commits
-------

1e5707fed3 Casting TableCell value to string.
2017-02-03 13:25:39 -08:00
Jay Klehr
1e5707fed3 Casting TableCell value to string. 2017-02-03 13:25:34 -08:00
Robin Chalas
d1001d4bac [SecurityBundle] Add AutowiringTypesTest 2017-02-03 16:32:53 +01:00
Robin Lehrmann
78c0ec5c13 [FrameworkBundle] fixed custom domain for translations in php templates 2017-02-03 15:56:44 +01:00
Fabien Potencier
7c5dcfcdb8 minor #21521 [SecurityBundle] Remove FirewallMap from classes to compile (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] Remove FirewallMap from classes to compile

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes
| Fixed tickets | #21520
| License       | MIT

Commits
-------

d1091091ef [SecurityBundle] Remove FirewallMap from classes to compile
2017-02-03 06:48:44 -08:00
Fabien Potencier
da2710e400 feature #21517 [FrameworkBundle] Add missing autowiring aliases for common interfaces (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Add missing autowiring aliases for common interfaces

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

Commits
-------

c3a2141a45 [FrameworkBundle] Add more autowiring aliases
2017-02-03 06:46:45 -08:00
Nicolas Grekas
23ba91272f Merge branch '3.2'
* 3.2:
  [FrameworkBundle][Console] JsonDescriptor: Respect original output
  [Process] Non ASCII characters disappearing during the escapeshellarg
2017-02-03 13:20:42 +01:00
Robin Chalas
d1091091ef [SecurityBundle] Remove FirewallMap from classes to compile 2017-02-03 13:17:59 +01:00
Nicolas Grekas
d5a95323da Merge branch '2.8' into 3.2
* 2.8:
  [FrameworkBundle][Console] JsonDescriptor: Respect original output
  [Process] Non ASCII characters disappearing during the escapeshellarg
2017-02-03 13:11:38 +01:00
Nicolas Grekas
151fe329d0 Merge branch '2.7' into 2.8
* 2.7:
  [Process] Non ASCII characters disappearing during the escapeshellarg
2017-02-03 13:08:06 +01:00
Robin Chalas
c3a2141a45 [FrameworkBundle] Add more autowiring aliases 2017-02-03 10:29:29 +01:00
Fabien Potencier
a46e691ae1 minor #21499 [FrameworkBundle][Console] Fix descriptors to support IteratorArgument, ClosureProxy and arrays (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Console] Fix descriptors to support IteratorArgument, ClosureProxy and arrays

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

Fixes both array and iterator/closure-proxy arguments support in descriptors when using `--show-arguments`

Commits
-------

a94924c540 [FrameworkBundle][Console] Fix descriptors to support IteratorArgument, ClosureProxy and arrays
2017-02-02 15:06:10 -08:00
Maxime Steinhausser
a94924c540 [FrameworkBundle][Console] Fix descriptors to support IteratorArgument, ClosureProxy and arrays 2017-02-02 21:16:35 +01:00
Fabien Potencier
2e13d4efa6 feature #21516 [HttpKernel][FrameworkBundle] Lazy load argument value resolvers (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel][FrameworkBundle] Lazy load argument value resolvers

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

The ArgumentResolver resolves an arg using the first ArgumentValueResolver which `supports()` it (which can be complex, see e.g. [sensiolabs/SensioFrameworkExtraBundle#436](https://github.com/sensiolabs/SensioFrameworkExtraBundle/pull/436/files#diff-865d48d9369c4431bce36ba642834570R10)).

Commits
-------

02b4aaa25f [HttpKernel] Lazy load argument value resolvers
2017-02-02 11:44:56 -08:00
Kévin Dunglas
c48c36be8f [DI] Add support for getter autowiring 2017-02-02 20:37:38 +01:00
Robin Chalas
02b4aaa25f
[HttpKernel] Lazy load argument value resolvers 2017-02-02 20:36:37 +01:00
Fabien Potencier
03b7cf72dc feature #21419 [DI][Config] Add & use ReflectionClassResource (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI][Config] Add & use ReflectionClassResource

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

With new changes comming to 3.3, we need a more generic reflection tracking logic than the one already managed by the autowiring subsystem.

This PR adds a new ReflectionClassResource in the Config component, and a new ContainerBuilder::getReflectionClass() method in the DI one (for fetching+tracking reflection-related info).

ReflectionClassResource tracks changes to any public or protected properties/method.

PR updated and ready, best viewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/21419/files?w=1).

changelog:

* added `ReflectionClassResource` class
* added second `$exists` constructor argument to `ClassExistenceResource` - with a special mode that prevents fatal errors from happening when some parent class is broken (logic generalized from AutowiringPass)
* made `ClassExistenceResource` also work with interfaces and traits
* added `ContainerBuilder::getReflectionClass()` for retrieving and tracking reflection class info
* deprecated `ContainerBuilder::getClassResource()`, use `ContainerBuilder::getReflectionClass()` or `ContainerBuilder::addObjectResource()` instead

Commits
-------

37e44939ef [DI][Config] Add & use ReflectionClassResource
2017-02-02 10:28:05 -08:00
Maxime Steinhausser
bf71776e20 [FrameworkBundle][Console] JsonDescriptor: Respect original output 2017-02-02 18:43:33 +01:00
Fabien Potencier
87273d9f44 minor #21407 [WebServerBundle] Improved exception message (wouterj)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[WebServerBundle] Improved exception message

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

This is a quite minor one, but imo "guessing" is something that's optional. If I don't pass value X, a script will guess value X. However, in this case, the front controller file cannot be specified. It has to be one of the "guessed" file names. That's why I renamed "guessing" to "finding".

While doing this, I also added the possible file names in the exception message to ease fixing problems.

Commits
-------

df46188381 Improved exception message
2017-02-02 07:29:17 -08:00
Nicolas Grekas
caba97a62b feature #21455 [DI] Allow to count on lazy collection arguments (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Allow to count on lazy collection arguments

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/21450#issuecomment-275931764
| License       | MIT
| Doc PR        | todo (with https://github.com/symfony/symfony-docs/issues/7336)

When using the new iterator feature of the DI component to lazy load collection, we always know the number of arguments in the collection (only the invalidBehavior set to `IGNORE_ON_INVALID_REFERENCE` may change this number). So we are able to generate and use a `RewindableGenerator` implementing `\Countable` by computing this value ahead.

So, in a service accepting `array|iterable`, like in the `GuardAuthenticationListener` (see #21450):

```php
class GuardAuthenticationListener implements ListenerInterface
{
    private $guardAuthenticators;

    /**
       * @param iterable|GuardAuthenticatorInterface[]  $guardAuthenticators   The authenticators, with keys that match what's passed to GuardAuthenticationProvider
       * @param LoggerInterface                         $logger                A LoggerInterface instance
    */
    public function __construct($guardAuthenticators, LoggerInterface $logger = null)
    {
          // ...
    }

    public function handle(GetResponseEvent $event)
    {
        if (null !== $this->logger) {
            $context = array()
            if (is_array($this->guardAuthenticators) || $this->guardAuthenticators instanceof \Countable) {
                $context['authenticators'] = count($this->guardAuthenticators);
            }
            $this->logger->debug('Checking for guard authentication credentials.', $context);
        }
        // ...
    }
}
```

we still keep the ability to call count without loosing the lazy load benefits.

Commits
-------

f23e460 [DI] Allow to count on lazy collection arguments
2017-02-02 15:11:42 +01:00
GuillaumeVerdon
3779f3fbb9 [Process] Non ASCII characters disappearing during the escapeshellarg 2017-02-02 14:55:53 +01:00
Nicolas Grekas
55a34b7b51 Merge branch '3.2'
* 3.2:
  Add HEADER_FORWARDED to setTrustedHeaderName docs
  Fix phpDoc typo
  [FrameworkBundle][Console] JsonDescriptor: Respect original output
  Remove dead code
  Enable dump() in autoload-dev
  add missing functional Serializer test case
2017-02-02 14:49:58 +01:00
Nicolas Grekas
4fd91481c2 Merge branch '2.8' into 3.2
* 2.8:
  Add HEADER_FORWARDED to setTrustedHeaderName docs
  Fix phpDoc typo
  [FrameworkBundle][Console] JsonDescriptor: Respect original output
  Enable dump() in autoload-dev
2017-02-02 14:47:35 +01:00
Nicolas Grekas
0a6d3c6d00 Merge branch '2.7' into 2.8
* 2.7:
  Add HEADER_FORWARDED to setTrustedHeaderName docs
  Fix phpDoc typo
  [FrameworkBundle][Console] JsonDescriptor: Respect original output
  Enable dump() in autoload-dev
2017-02-02 14:38:20 +01:00
Nicolas Grekas
3ee1aa0160 minor #21501 [FrameworkBundle][Console] JsonDescriptor: Respect original output (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle][Console] JsonDescriptor: Respect original output

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

I'm suggesting this one, because I recently pushed some changes to the descriptors, and of course, I'm not editing expected output fixtures by hand, but by dumping the real output to fixture files. But it's tiring to get false positive diffs when reviewing it. Descriptor tests already are painful enough 😅

This PR respects the way elements are actually output. If it's ok to you, I'll submit some other PRs to upper branches, because there are more issues regarding this (items order for instance).

If it causes too much troubles getting this in sync with upper branches, let's close this and never talk about it anymore 😄

Commits
-------

08dd70b [FrameworkBundle][Console] JsonDescriptor: Respect original output
2017-02-02 14:32:11 +01:00
Pascal Hofmann
b46276e9b2 Add HEADER_FORWARDED to setTrustedHeaderName docs 2017-02-02 14:27:35 +01:00
Nicolas Grekas
0b57d17081 bug #21508 [DI] : Fix bad generation of proxy class when use overriden getter on class with constructor (jean-pasqualini)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] : Fix bad generation of proxy class when use overriden getter on class with constructor

[DI] : Fix bad generation of proxy class when use overriden getter on class with constructor

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

- [X] Add test fail
- [X] Fix bug
- [X] Run test pass

Commits
-------

2440b0f [DI] : Fix bad generation of proxy class when use overriden getter on class with constructor
2017-02-02 14:22:22 +01:00
Nicolas Grekas
37e44939ef [DI][Config] Add & use ReflectionClassResource 2017-02-02 14:15:15 +01:00
Wouter J
df46188381 Improved exception message 2017-02-02 12:37:59 +01:00
Jean Pasqualini
2440b0f05d [DI] : Fix bad generation of proxy class when use overriden getter on class with constructor
- [X] Add test fail
- [X] Fix bug
- [X] Run test pass
2017-02-02 11:50:54 +01:00
Robin Chalas
6b556b8b9b [DI] Add ContainerBuilder::fileExists()
Update TwigExtension
2017-02-02 11:26:40 +01:00
Pavel Batanov
8e6cfa0cef Fix phpDoc typo 2017-02-02 08:03:53 +03:00
Fabien Potencier
46daa359ea feature #21470 [Process] Deprecate not inheriting env vars + compat related settings (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Process] Deprecate not inheriting env vars + compat related settings

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

Turning compat on/off is not a feature in itself.

About env vars: if one has unwanted env vars, one will still be able to remove them explicitly for the command. From my experience, not having eg PATH or HTTP_PROXY, etc. is more problematic. I'd prefer people to care about setting/unsetting the environment vars **they know about**, rather than allowing them to start with no ENV and discover later that they missed setting some var.

Commits
-------

df14451a73 [Process] Deprecate not inheriting env vars + compat related settings
2017-02-01 13:16:10 -08:00
Fabien Potencier
1b2801591e feature #21494 [DI] Deprecate autowiring-types in favor of aliases (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Deprecate autowiring-types in favor of aliases

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #21351, #19970, ~~#18040~~, ~~#17783~~
| License       | MIT
| Doc PR        | symfony/symfony-docs#7445

https://github.com/symfony/symfony/pull/21494/files?w=1
This PR deprecates autowiring-types and replaces them by plain aliases.
ping @dunglas @weaverryan

Eg instead of
```xml
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false">
    <autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type>
</service>
```

just do:
```xml
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" />
<service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" />
```

Commits
-------

b11d391cb7 [DI] Deprecate autowiring-types in favor of aliases
2017-02-01 12:54:06 -08:00
Fabien Potencier
29db096b0b minor #21492 [DI] Deduplicate resources while adding them (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Deduplicate resources while adding them

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

Since the string cast of resources is already used to deduplicate them, let's do it earlier. This can only decrease memory usage.

Commits
-------

04853fc5c3 [DI] Deduplicate resource while adding them
2017-02-01 11:11:51 -08:00
Maxime Steinhausser
08dd70b507 [FrameworkBundle][Console] JsonDescriptor: Respect original output 2017-02-01 19:43:31 +01:00
Nicolas Grekas
b11d391cb7 [DI] Deprecate autowiring-types in favor of aliases 2017-02-01 19:42:39 +01:00
Yonel Ceruto
0cd8bf82bc Remove dead code 2017-02-01 07:55:07 -08:00