Commit Graph

29050 Commits

Author SHA1 Message Date
Benjamin Cremer
7743989675 Move AddConsoleCommandPass from FrameworkBundle to Console. 2017-01-11 13:05:48 +01:00
Fabien Potencier
cbecfc3d74 minor #21233 [Form] Removed unused ResolvedTypeFactory in FormFactory constructor (HeahDude)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form] Removed unused ResolvedTypeFactory in FormFactory constructor

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

____
This PR just removes some legacy code from 2.x.

Commits
-------

3607eb3dd0 [Form] Removed unused ResolvedTypeFactory in FormFactory constructor
2017-01-10 13:52:26 -08:00
Fabien Potencier
8b354785b5 bug #21232 [FrameworkBundle] removed a deprecation notice when using autowiring (on kernel.class_cache.cache_warmer) (fabpot)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] removed a deprecation notice when using autowiring (on kernel.class_cache.cache_warmer)

| 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

When using autowiring, Symfony uses reflection to list all available classes. So, each class is loaded, and for the `ClassCacheCacheWarmer`, it means that a deprecation notice is triggered. So, I've moved it to when an instance is created instead.

Commits
-------

eb6ff9c7e3 [FrameworkBundle] removed a deprecation notice when using autowiring (on kernel.class_cache.cache_warmer)
2017-01-10 13:49:58 -08:00
HeahDude
3607eb3dd0 [Form] Removed unused ResolvedTypeFactory in FormFactory constructor 2017-01-10 21:49:17 +01:00
Fabien Potencier
eb6ff9c7e3 [FrameworkBundle] removed a deprecation notice when using autowiring (on kernel.class_cache.cache_warmer) 2017-01-10 12:32:13 -08:00
Fabien Potencier
bdd0f9d94d feature #21231 [FrameworkBundle] allow to reference files directly from kernel.root_dir (fabpot)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] allow to reference files directly from kernel.root_dir

| 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

While working on a bundleless app, I want to be able to reference a directory for routing annotations like this:

```yaml
app:
    resource: "../src/Controller/"
    type: annotation
```

but that does not work because Symfony expects a bundle resource (`@AppBundle...`) or a directory referenced from the main app `Resources` directory. But as I don't have such a directory, even using `../../src/Controller` does not work.

So, I propose to add the %kernel.root_dir% to the list of allowed directories.

By the way, we don't have the same issue with the routing annotation **file** loader as it does not use the locator for whatever reason. Should we fix it?

Commits
-------

80b61e9127 [FrameworkBundle] allowed to reference files directly from kernel.root_dir
2017-01-10 12:30:05 -08:00
Fabien Potencier
80b61e9127 [FrameworkBundle] allowed to reference files directly from kernel.root_dir 2017-01-10 11:14:57 -08:00
Fabien Potencier
4d916c63dd feature #20611 [DI] FileLoaders: Allow to explicit type to load (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] FileLoaders: Allow to explicit type to load

| 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/issues/20308
| License       | MIT
| Doc PR        | Not yet

(fabbot will scream out regarding the PR fixtures)

Commits
-------

6b660c2114 [DI] FileLoaders: Allow to explicit type to load
2017-01-10 07:50:45 -08:00
Fabien Potencier
629de96792 feature #20689 [Config][FrameworkBundle] Allow to dump extension config reference sub-path (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Config][FrameworkBundle] Allow to dump extension config reference sub-path

| 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

Same as https://github.com/symfony/symfony/pull/18940 but for the `config:dump-reference` command:

<img width="975" alt="screenshot 2016-11-29 a 19 09 04" src="https://cloud.githubusercontent.com/assets/2211145/20722577/6c9f9b98-b667-11e6-9683-9a304ff80895.PNG">

Only available for yaml, because it's the most common format when developing an end-application, and dumping a sub xml document causes some issues and raises more questions with the current `XmlReferenceDumper` implementation (namespaces, root name, ...).

Commits
-------

869bb1530b [Config][FrameworkBundle] Allow to dump extension config reference sub path
2017-01-10 07:47:15 -08:00
Nicolas Grekas
16d33e1fff Merge branch '3.2'
* 3.2:
  [DI] Add missing legacy group on testLegacy
  Minor tweaks
  Fix merge
  [DI] Dont share service when no id provided
  Fix Container and PhpDumper test inaccuracies
  [DI] Fix missing new line after private alias
  [ClassLoader] Throw an exception if the cache is not writeable
  Fixing regression in TwigEngine exception handling.
2017-01-10 15:32:56 +01:00
Nicolas Grekas
1fcb66d129 Merge branch '3.1' into 3.2
* 3.1:
  [DI] Add missing legacy group on testLegacy
2017-01-10 15:27:50 +01:00
Nicolas Grekas
027d58869f Merge branch '2.8' into 3.1
* 2.8:
  [DI] Add missing legacy group on testLegacy
2017-01-10 15:27:30 +01:00
Nicolas Grekas
a351c24e6c Merge branch '2.7' into 2.8
* 2.7:
  [DI] Add missing legacy group on testLegacy
2017-01-10 15:27:01 +01:00
Nicolas Grekas
c5847696ea [DI] Add missing legacy group on testLegacy 2017-01-10 15:26:05 +01:00
Nicolas Grekas
80ed2c5173 Minor tweaks 2017-01-10 15:21:25 +01:00
Nicolas Grekas
783abab7ae Merge branch '3.1' into 3.2
* 3.1:
  Fix merge
  [DI] Dont share service when no id provided
  Fix Container and PhpDumper test inaccuracies
  [DI] Fix missing new line after private alias
  [ClassLoader] Throw an exception if the cache is not writeable
  Fixing regression in TwigEngine exception handling.
2017-01-10 15:14:38 +01:00
Nicolas Grekas
15ff7f9195 Merge branch '2.8' into 3.1
* 2.8:
  Fix merge
  [DI] Dont share service when no id provided
  Fix Container and PhpDumper test inaccuracies
  [DI] Fix missing new line after private alias
  [ClassLoader] Throw an exception if the cache is not writeable
  Fixing regression in TwigEngine exception handling.
2017-01-10 15:09:41 +01:00
Nicolas Grekas
87db587fa6 Fix merge 2017-01-10 15:07:18 +01:00
Nicolas Grekas
144eb54fcd Merge branch '2.7' into 2.8
* 2.7:
  [DI] Dont share service when no id provided
  Fix Container and PhpDumper test inaccuracies
  [DI] Fix missing new line after private alias
  [ClassLoader] Throw an exception if the cache is not writeable
  Fixing regression in TwigEngine exception handling.
2017-01-10 15:03:07 +01:00
Nicolas Grekas
f03073c103 bug #21179 [TwigBundle] Fixing regression in TwigEngine exception handling (Bertalan Attila)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Fixing regression in TwigEngine exception handling

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

Fixing regression after #20831 in TwigEngine exception handling.

Commits
-------

390cb33 Fixing regression in TwigEngine exception handling.
2017-01-10 14:51:20 +01:00
Nicolas Grekas
d18c2cadfc minor #21226 Fix Container and PhpDumper test inaccuracies (nikita2206)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix Container and PhpDumper test inaccuracies

| 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        |

Stumbled upon and fixed some minor inaccuracies in tests for DI container, they might have lead to undetected changes of `Container`'s behavior

Commits
-------

24b93cc Fix Container and PhpDumper test inaccuracies
2017-01-10 14:43:59 +01:00
Nicolas Grekas
e355739b83 minor #21225 [DI] Dont share service when no id provided (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[DI] Dont share service when no id provided

| 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        | -

Commits
-------

814f633 [DI] Dont share service when no id provided
2017-01-10 14:43:16 +01:00
Nicolas Grekas
814f63390d [DI] Dont share service when no id provided 2017-01-10 14:32:11 +01:00
Maxime Steinhausser
6b660c2114 [DI] FileLoaders: Allow to explicit type to load 2017-01-10 12:54:54 +01:00
Nikita Nefedov
24b93cc75c Fix Container and PhpDumper test inaccuracies 2017-01-10 14:19:58 +03:00
Maxime STEINHAUSSER
869bb1530b [Config][FrameworkBundle] Allow to dump extension config reference sub path 2017-01-09 22:03:44 +01:00
Fabien Potencier
9e6d6ba3a9 bug #21219 [DI] Fixes aliases visibility with and without defaults (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Fixes aliases visibility with and without defaults

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

Commits
-------

f1cc090465 [DI] Fixes aliases visibility with and without defaults
2017-01-09 12:26:05 -08:00
Fabien Potencier
44f6a8c6b1 bug #21220 [DI] Fix missing new line after private alias (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[DI] Fix missing new line after private alias

| 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/21219#discussion_r95220565
| License       | MIT
| Doc PR        | N/A

Without this change, the output is:

```yml
# [...]
alias_for_foo: '@foo'
another_alias_for_foo:
    alias: foo
    public: false    another_third_alias_for_foo: '@foo' # <--- missing new line after `public: false`
```

(this is tested by the `CrossCheckTest` but there is no fixture file to update (automatically dumped and removed by the test case))

Commits
-------

101a165d0d [DI] Fix missing new line after private alias
2017-01-09 12:23:12 -08:00
Maxime Steinhausser
f1cc090465 [DI] Fixes aliases visibility with and without defaults 2017-01-09 20:25:31 +01:00
Maxime Steinhausser
101a165d0d [DI] Fix missing new line after private alias 2017-01-09 19:49:53 +01:00
Fabien Potencier
e9f2512c04 bug #21211 Classloader tmpname (lyrixx)
This PR was merged into the 2.7 branch.

Discussion
----------

Classloader tmpname

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

In dev env:

from:

> Notice: tempnam(): file created in the system's temporary directory

to:

> Failed to write cache file "/var/www/html/var/cache/dev/classes.php".

Commits
-------

3c887da4f3 [ClassLoader] Throw an exception if the cache is not writeable
2017-01-09 06:56:46 -08:00
Grégoire Pineau
3c887da4f3 [ClassLoader] Throw an exception if the cache is not writeable 2017-01-09 15:44:50 +01:00
Fabien Potencier
e66e6afcc1 feature #21188 [HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse

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

Replaces #19740. Native "getSize" is reported to return false on error, so using false as return type doesn't break the signature.

Commits
-------

8011209a18 [HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse
2017-01-09 06:38:12 -08:00
Fabien Potencier
bb1e076899 minor #21191 [Yaml] Remove unused argument (GuilhemN)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Yaml] Remove unused argument

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

This PR removes an unused argument of `Inline::parseScalar()`. I based it on master as that's not really a bug fix but the lowest applicable branch is 3.0 (the method was not internal in 2.x).

Commits
-------

1a14a1f274 [Yaml] Remove an unused argument
2017-01-09 06:37:34 -08:00
Nicolas Grekas
8011209a18 [HttpFoundation] Add File\Stream for size-unknown BinaryFileResponse 2017-01-09 15:30:01 +01:00
Fabien Potencier
5f4ba3199c feature #21214 [DI] Allow ~ instead of {} for services in Yaml (wouterj)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Allow ~ instead of {} for services in Yaml

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

Now we can omit the class name, Yaml config can look like this:
```yaml
services:
    AppBundle\Something: {}
```

While this works, the consistent way in Symfony for such cases is to use `~`. This PR allows to use `~` as well, ending up with:
```yaml
services:
    AppBundle\Something: ~
```

Commits
-------

28a1b5ac47 Allow setting services as null
2017-01-09 06:01:23 -08:00
WouterJ
28a1b5ac47 Allow setting services as null 2017-01-09 13:12:14 +01:00
Bertalan Attila
390cb335fa Fixing regression in TwigEngine exception handling. 2017-01-09 10:33:51 +01:00
Fabien Potencier
e6bd47e457 minor #21209 [SecurityBundle] removed usage of the templating component (fabpot)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] removed usage of the templating component

| 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
-------

17240eb7e8 [SecurityBundle] removed usage of the templating component
2017-01-08 15:07:02 -08:00
Fabien Potencier
17240eb7e8 [SecurityBundle] removed usage of the templating component 2017-01-08 13:33:13 -08:00
Fabien Potencier
a97cdd63a2 Merge branch '3.2'
* 3.2:
  fixed bad merge
2017-01-08 13:20:52 -08:00
Fabien Potencier
dd0ee1f6dd fixed bad merge 2017-01-08 13:20:47 -08:00
Fabien Potencier
9b99fffb9d Merge branch '3.2'
* 3.2:
  [TwigBundle] fixed usage when Templating is not installed
  [Validator] Check cascasdedGroups for being countable
  [Cache] Add changelog for 3.2
  [Cache] Add changelog
  [Filesystem] Check that the directory is writable after created it in dumpFile()
  [HttpFoundation] Improved set cookie header tests
  [Serializer] int is valid when float is expected when deserializing JSON
  [Console] increased code coverage of Output classes
  Added missing headers in fixture files
  [Profiler][VarDumper] Fix minor color issue & duplicated selector
2017-01-08 13:15:04 -08:00
Fabien Potencier
831d0a0553 Merge branch '3.1' into 3.2
* 3.1:
  [TwigBundle] fixed usage when Templating is not installed
  [Validator] Check cascasdedGroups for being countable
  [Cache] Add changelog
  [Filesystem] Check that the directory is writable after created it in dumpFile()
  [HttpFoundation] Improved set cookie header tests
  [Serializer] int is valid when float is expected when deserializing JSON
  [Console] increased code coverage of Output classes
  Added missing headers in fixture files
  [Profiler][VarDumper] Fix minor color issue & duplicated selector
2017-01-08 12:47:33 -08:00
Fabien Potencier
789111c52a Merge branch '2.8' into 3.1
* 2.8:
  [TwigBundle] fixed usage when Templating is not installed
  [Validator] Check cascasdedGroups for being countable
  [Filesystem] Check that the directory is writable after created it in dumpFile()
  [HttpFoundation] Improved set cookie header tests
  [Console] increased code coverage of Output classes
  [Profiler][VarDumper] Fix minor color issue & duplicated selector
2017-01-08 12:43:43 -08:00
Fabien Potencier
4546377125 Merge branch '2.7' into 2.8
* 2.7:
  [TwigBundle] fixed usage when Templating is not installed
  [Validator] Check cascasdedGroups for being countable
  [Filesystem] Check that the directory is writable after created it in dumpFile()
  [HttpFoundation] Improved set cookie header tests
  [Console] increased code coverage of Output classes
2017-01-08 12:43:03 -08:00
Fabien Potencier
6bd7840169 bug #21205 [TwigBundle] fixed usage when Templating is not installed (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] fixed usage when Templating is not installed

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | bug introduced in #20799
| License       | MIT
| Doc PR        | n/a

In #20799, the decoupling of the Templating definition means that the `twig.loader.filesystem` is not always defined, but used in Extension. So, this PR does the opposite as what was done before. Use `twig.loader.native_filesystem` by default and copy paths to `twig.loader.filesystem` when templating is used.

/cc @xabbuh

Commits
-------

6aa98d163d [TwigBundle] fixed usage when Templating is not installed
2017-01-08 12:42:44 -08:00
Fabien Potencier
6aa98d163d [TwigBundle] fixed usage when Templating is not installed 2017-01-08 12:32:10 -08:00
Fabien Potencier
efe2a93bba feature #20612 [Filesystem] Add appendToFile() (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Filesystem] Add appendToFile()

| 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        | todo

So we could append content to a file:

```php
(new Filesystem)->appendToFile($file, 'bar');
```

instead of doing it in two steps:

```php
if (false === $content = @file_get_contents($file)) {
    throw new \Exception();
}

(new Filesystem)->dumpFile($file, $content.'bar');
```

Doing it opt-in using `dumpFile(..., $append = false)` would have been enough but not possible for BC.

Commits
-------

1f7b753670 [Filesystem] Add appendToFile()
2017-01-08 12:18:13 -08:00
Robin Chalas
1f7b753670
[Filesystem] Add appendToFile() 2017-01-08 21:06:51 +01:00