Commit Graph

30723 Commits

Author SHA1 Message Date
Fabien Potencier
aeb9bffa8f added a more specialized exception for a better error message 2017-04-11 13:45:43 -07:00
Nicolas Grekas
9fdd36f23d Merge branch '3.2'
* 3.2:
  Fix bad merge
2017-04-11 22:43:03 +02:00
Nicolas Grekas
e71807bc60 Fix bad merge 2017-04-11 22:42:49 +02:00
Nicolas Grekas
6491fd5854 Merge branch '3.2'
* 3.2:
  Allow terminal dimensions to be set to 0 (unbounded)
  [Cache] Remove exception false-positive from FilesystemAdapterTrait
  fix risky tests
  fix risky tests
  [Yaml] release memory after parsing
  [HttpFoundation] Fix and test status codes according to IANA's data
  Add `use_strict_mode` in validOptions for session
  [Console] Inherit phpdoc from OutputFormatterInterface
2017-04-11 20:40:10 +02:00
Fabien Potencier
5b4091ed7c bug #22372 [DI] Allow using parameters in "prototype" resource paths (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Allow using parameters in "prototype" resource paths

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

Commits
-------

d3fc86c709 [DI] Allow using parameters in "prototype" resource paths
2017-04-11 11:36:38 -07:00
Nicolas Grekas
a2bd375f60 Merge branch '2.8' into 3.2
* 2.8:
  fix risky tests
  [Yaml] release memory after parsing
  [HttpFoundation] Fix and test status codes according to IANA's data
  Add `use_strict_mode` in validOptions for session
  [Console] Inherit phpdoc from OutputFormatterInterface
2017-04-11 20:36:00 +02:00
Nicolas Grekas
0bc5eea71e Merge branch '2.7' into 2.8
* 2.7:
  [Yaml] release memory after parsing
  [HttpFoundation] Fix and test status codes according to IANA's data
  Add `use_strict_mode` in validOptions for session
  [Console] Inherit phpdoc from OutputFormatterInterface
2017-04-11 20:34:35 +02:00
Fabien Potencier
bca09e4933 bug #22374 [Cache] Remove exception false-positive from FilesystemAdapterTrait (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Cache] Remove exception false-positive from FilesystemAdapterTrait

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

As reported in the linked issue, there seem to be a race condition in FilesystemAdapterTrait (maybe related to realpath cache?).

Let's remove that exception: if the mkdir really fails, the error will be logged later on when a cache entry will be written (or succeed if the race is over.)

Commits
-------

a756db78d0 [Cache] Remove exception false-positive from FilesystemAdapterTrait
2017-04-11 11:23:14 -07:00
Nicolas Grekas
d3fc86c709 [DI] Allow using parameters in "prototype" resource paths 2017-04-11 20:16:57 +02:00
Fabien Potencier
8d34959fe9 minor #22380 fix risky tests (xabbuh)
This PR was merged into the 3.2 branch.

Discussion
----------

fix risky tests

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

Commits
-------

9125911668 fix risky tests
2017-04-11 09:38:31 -07:00
Fabien Potencier
54fa2ff975 minor #22379 fix risky tests (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

fix risky tests

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

Commits
-------

86b685f617 fix risky tests
2017-04-11 09:37:23 -07:00
Fabien Potencier
9950b90bb6 feature #22356 [DI] Rework config hierarchy: defaults > instanceof > service config (weaverryan, nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Rework config hierarchy: defaults > instanceof > service config

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

Replaces #22294.
The main change is that ChildDefinition does not have "instanceof" applied anymore. All the complexity of the pass came from the merging logic required to deal with them. But in fact, we'd better not have any such logic and just not apply "instanceof" to ChildDefinition (but have them inherit from their parents with the usual logic).

Commits
-------

6d6116b920 Adding an integration test for the hirarchy of defaults, instanceof, child, parent definitions
ab86457b12 [DI] Rework config hierarchy: defaults > instanceof > service config
cbaee55223 [DI] Track changes at the "Definition" level
2017-04-11 09:32:21 -07:00
Fabien Potencier
ed1e8fbb76 bug #22377 [Console] Allow terminal dimensions to be set to 0 (unbounded) (duncan3dc)
This PR was merged into the 3.2 branch.

Discussion
----------

[Console] Allow terminal dimensions to be set to 0 (unbounded)

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

A previous PR (#20328) changed the behavior of terminals with undefined widths from unbounded to 80 characters. And due to the way the existing code worked it become impossible to set a terminal to be unbounded again. This PR provides a way to restore the previous behavior:
```php
putenv('COLUMNS=0');
```

Commits
-------

4c1b001891 Allow terminal dimensions to be set to 0 (unbounded)
2017-04-11 08:47:22 -07:00
Craig Duncan
4c1b001891 Allow terminal dimensions to be set to 0 (unbounded) 2017-04-11 16:41:42 +01:00
Fabien Potencier
44008e8a98 minor #22378 CS fixes (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

CS fixes

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

Commits
-------

e9ce2687de CS fixes
2017-04-11 08:25:15 -07:00
Fabien Potencier
e904ab8cbe bug #22376 [FrameworkBundle] Use findDefinition() instead of getDefinition() on aliases (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Use findDefinition() instead of getDefinition() on aliases

| 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

The services for which `has()` is called might be aliases at this point so `getDefinition()` gives an exception, I ran into by executing this pass but not the removing ones (skipping ReplaceAliasByActualDefinitionPass) while working on https://github.com/symfony/symfony/issues/16388. Let's make it safe to use independently.

Commits
-------

41f3d1f166 Use findDefinition() instead of getDefinition() after calling has()
2017-04-11 08:18:29 -07:00
Robin Chalas
e9ce2687de CS fixes 2017-04-11 17:15:30 +02:00
Fabien Potencier
f478161ff5 minor #22367 [Yaml] release memory after parsing (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] release memory after parsing

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22351#discussion_r110647360
| License       | MIT
| Doc PR        |

Follow up of #22351 to release memory after parsing as suggested by @stof.

Commits
-------

c891413f6c [Yaml] release memory after parsing
2017-04-11 07:42:37 -07:00
Ryan Weaver
6d6116b920 Adding an integration test for the hirarchy of defaults, instanceof, child, parent definitions 2017-04-11 16:40:02 +02:00
Fabien Potencier
a6dbc39112 bug #22364 [Dotenv] Throwing an error when loading nothing (sanpii)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Dotenv] Throwing an error when loading nothing

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

This is a quick fix to prevent anoying when you follow a tutorial using another dotenv component. For example, this code uses [vlucas/phpdotenv](https://packagist.org/packages/vlucas/phpdotenv):

```php
$dotenv = new Dotenv\Dotenv(__DIR__.'/../');
$dotenv->load();
```

Silently failed with symfony/dotenv.

Commits
-------

911bc68991 [Dotenv] Throwing an error when loading nothing
2017-04-11 07:29:46 -07:00
Robin Chalas
41f3d1f166 Use findDefinition() instead of getDefinition() after calling has() 2017-04-11 16:03:41 +02:00
Sanpi
911bc68991 [Dotenv] Throwing an error when loading nothing 2017-04-11 15:47:47 +02:00
Nicolas Grekas
a756db78d0 [Cache] Remove exception false-positive from FilesystemAdapterTrait 2017-04-11 15:28:15 +02:00
Christian Flothmann
9125911668 fix risky tests 2017-04-11 11:53:09 +02:00
Nicolas Grekas
35afac00a0 bug #22368 [Bridge] [Twig] get and flush only flash sessions you need in getFlashes method (jordscream)
This PR was squashed before being merged into the 3.3-dev branch (closes #22368).

Discussion
----------

[Bridge] [Twig] get and flush only flash sessions you need in getFlashes method

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no ?!
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #22359
| License       | MIT
| Doc PR        | symfony/symfony-docs

@xabbuh comments about empty array to return

Commits
-------

33b044a [Bridge] [Twig] get and flush only flash sessions you need in getFlashes method
2017-04-11 11:36:34 +02:00
Jordan Samouh
33b044adb1 [Bridge] [Twig] get and flush only flash sessions you need in getFlashes method 2017-04-11 11:36:26 +02:00
Christian Flothmann
86b685f617 fix risky tests 2017-04-11 11:19:47 +02:00
Nicolas Grekas
4675c2261f minor #22370 [FrameworkBundle] Fix web_link.add_link_header_listener definition (dunglas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Fix web_link.add_link_header_listener definition

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

b7ac772 [FrameworkBundle] Fix web_link.add_link_header_listener definition
2017-04-11 11:19:44 +02:00
Kévin Dunglas
b7ac772994
[FrameworkBundle] Fix web_link.add_link_header_listener definition 2017-04-11 11:15:03 +02:00
Nicolas Grekas
383fa708de minor #22369 [WebLink] Fix tests (dunglas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[WebLink] Fix tests

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | I hope
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

e31341a [WebLink] Fix tests
2017-04-11 10:48:48 +02:00
Kévin Dunglas
e31341a855
[WebLink] Fix tests 2017-04-11 10:27:21 +02:00
Christian Flothmann
c891413f6c [Yaml] release memory after parsing 2017-04-11 09:50:01 +02:00
Fabien Potencier
8807eaf30b feature #22362 [DI] Populate class of ChildDefinition when its id matches an existing FQCN (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Populate class of ChildDefinition when its id matches an existing FQCN

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

See linked issue for expected DX.
Instead of doing a "continue", let's throw to force the resolution of any ambiguities.
There is a minor potential BC Break, if one uses an ambiguous FQCN as child-definition id in 3.2 or below.
To me, this should be rare, and easy to fix (compile time only).
The DX enhancement this PR provides looks worth it.

> Service definition "App\Foo\Child" has a parent but no class, and its name looks like a FQCN. Either the class is missing or you want to inherit it from the parent service. To resolve this ambiguity, please rename this service to a non-FQCN (e.g. using dots), or create the missing class.

Commits
-------

3200d3738a [DI] Populate class of ChildDefinition when its id matches an existing FQCN
2017-04-10 18:20:21 -07:00
Fabien Potencier
bbb0d5ed42 feature #22239 [Finder] Glob wildcard while using double-star without ending slash (sroze)
This PR was squashed before being merged into the 3.3-dev branch (closes #22239).

Discussion
----------

[Finder] Glob wildcard while using double-star without ending slash

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

This PR allows to use the `Glob::toRegex` method to dump a glob that will match "everything after" while using the double-star without leading slash. `/foo/**` will therefore match `/foo/a` or `/foo/a/b/c` or even `/foo/a/b/c/d.e`.

The use-case for this change is an application allowing its users to match a list of files/folders from such glob pattern.

Happy to add a line in the CHANGELOG and documentation if you feel that would make sense.

Commits
-------

170b0ace2c [Finder] Glob wildcard while using double-star without ending slash
2017-04-10 10:50:33 -07:00
Samuel ROZE
170b0ace2c [Finder] Glob wildcard while using double-star without ending slash 2017-04-10 10:50:31 -07:00
Fabien Potencier
f8e1098712 minor #22342 [Console] Inherit phpdoc from OutputFormatterInterface (ro0NL)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Inherit phpdoc from OutputFormatterInterface

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/22225#discussion_r109361374
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Commits
-------

ff3cb9cb27 [Console] Inherit phpdoc from OutputFormatterInterface
2017-04-10 10:33:28 -07:00
Fabien Potencier
f7debe8a30 bug #22343 [Dotenv] Throwing an exception when loading a directory (sanpii)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Dotenv] Throwing an exception when loading a directory

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

Commits
-------

8b83b58aa5 Throwing an exception when loading a directory
2017-04-10 10:15:08 -07:00
Fabien Potencier
eeb36eb65f bug #22344 [DX] [TwigBundle] Improve default expand states of exception template (curry684)
This PR was squashed before being merged into the 3.3-dev branch (closes #22344).

Discussion
----------

[DX] [TwigBundle] Improve default expand states of exception template

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #22334
| License       | MIT

As discussed in #22334 this PR changes the default exception template to more intelligently decide which call stack to initially expand:
- All exceptions are scanned for user code, ignoring the front controller and callbacks
- Only exceptions containing user code are expanded
- If no user code is found the first exception is expanded

Commits
-------

df25691250 [DX] [TwigBundle] Improve default expand states of exception template
2017-04-10 10:12:04 -07:00
Niels Keurentjes
df25691250 [DX] [TwigBundle] Improve default expand states of exception template 2017-04-10 10:12:01 -07:00
Fabien Potencier
dbfea949fe bug #22361 [HttpKernel et al.] Move DataCollector::cloneVar() to lateCollect() (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel et al.] Move DataCollector::cloneVar() to lateCollect()

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

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

f83f971c3f [HttpKernel et al.] Move DataCollector::cloneVar() to lateCollect()
2017-04-10 10:08:49 -07:00
Fabien Potencier
bf7d08d119 [WebLink] fixed composer keyword 2017-04-10 10:04:52 -07:00
Fabien Potencier
5a76834aea feature #22273 Add a new Link component (dunglas)
This PR was squashed before being merged into the 3.3-dev branch (closes #22273).

Discussion
----------

Add a new Link component

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  |no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | todo

This a proposal to extract HTTP preloading features introduced in #21478 in their own component.

There are some good reasons to do it:

* HTTP preloading is not (only) about assets: this standalone component could be very useful to replace resources embedding in APIs by HTTP/2 pushes like described in [this article](https://evertpot.com/rest-embedding-hal-http2/) by @evert. In such case, there is no reason to carry the whole asset component for an API.
* There is no dependency nor relation at all between the code of the asset compnent and the one I've added for Preloading features
* It makes the code cleaner (no more optional dependency in the `Asset` Twig extension)

This component would also better fit in HttpFoundation than in Asset. But there is no dependency between it and HttpFoundation and it can easily be used with PSR-7 too, so IMO it better belongs in a standalone component.

Btw, ~~~I plan to add support for prefetching to this component. Except a PR soon.~~~ Prefetching and prerendering support added in this PR.

ping @symfony/deciders

Commits
-------

053de25edf Add a new Link component
2017-04-10 09:55:53 -07:00
Kévin Dunglas
053de25edf Add a new Link component 2017-04-10 09:55:52 -07:00
Nicolas Grekas
3200d3738a [DI] Populate class of ChildDefinition when its id matches an existing FQCN 2017-04-10 18:46:19 +02:00
Nicolas Grekas
ab86457b12 [DI] Rework config hierarchy: defaults > instanceof > service config 2017-04-10 18:14:18 +02:00
Ryan Weaver
cbaee55223 [DI] Track changes at the "Definition" level 2017-04-10 18:14:17 +02:00
Nicolas Grekas
f83f971c3f [HttpKernel et al.] Move DataCollector::cloneVar() to lateCollect() 2017-04-10 18:00:26 +02:00
Fabien Potencier
aada1a14cc bug #22358 [DI] Fix named args overridding (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Fix named args overridding

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

(The exception check in ResolveDefinitionTemplatesPass is not done in ResolveNamedArgumentsPass.)

Commits
-------

0c030d92f9 [DI] Fix named args overridding
2017-04-10 08:25:06 -07:00
Fabien Potencier
6d8c53ee76 added a comment in a test 2017-04-10 08:21:06 -07:00
Fabien Potencier
63592a646c bug #22352 [HttpFoundation] Add use_strict_mode in validOptions for session (sstok)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] Add `use_strict_mode` in validOptions for session

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

PHP ini `session.use_strict_mode` was added in PHP 5.5.2 so I didn't target 2.8 as this still uses PHP 5.3. https://secure.php.net/manual/en/session.configuration.php#ini.session.use-strict-mode

Commits
-------

130ee327d4 Add `use_strict_mode` in validOptions for session
2017-04-10 08:18:38 -07:00