Commit Graph

6324 Commits

Author SHA1 Message Date
Nicolas Grekas
73c96939cd [FrameworkBundle] Alter container class instead of kernel name in cache:clear command 2016-10-04 16:32:03 +02:00
Fabien Potencier
996c1ee3cb added checks for public services on compiler passes that use service id and not references 2016-10-01 08:38:16 -07:00
Fabien Potencier
470dc3e36f [TwigBundle] added missing dependencies for tests 2016-10-01 07:16:30 -07:00
Tugdual Saunier
fcd6ec2a5e
[TwigBundle] Fix CacheWarmingTest are order dependent 2016-09-30 14:26:39 +01:00
Fabien Potencier
24e9cf2155 fixed Twig support for 1.26 and 2.0 2016-09-28 18:04:26 -07:00
Roland Franssen
b074a7156a Fixed expectedException annotations 2016-09-23 11:13:36 -07:00
Fabien Potencier
26e2846c8a bug #19904 [Form] Fixed collapsed ChoiceType options attributes (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed collapsed ChoiceType options attributes

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

Commits
-------

7806e2a Fixed collapsed ChoiceType options attributes
2016-09-13 17:22:22 -07:00
Fabien Potencier
946b96b70d bug #19922 [Yaml][TwigBridge] Use JSON_UNESCAPED_SLASHES for lint commands output (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml][TwigBridge] Use JSON_UNESCAPED_SLASHES for lint commands output

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

Slashes are escaped when sing the `lint:twig` and `lint:yaml` commands with the `format` option set to `json`, giving such results:

```json
[
    {
        "file": "yaml\/wrong\/1.yml",
        "valid": false,
        "message": "Unable to parse at line 1 (near \";:cc`\")."
    }
]
```

That's not convenient as file paths may be reused (e.g. copy-pasted).
Results stay fine as error messages are already escaped:

```json
[
    {
        "file": "yaml/wrong/1.yml",
        "valid": false,
        "message": "Unable to parse at line 1 (near \";:cc`\")."
    }
]
```

Commits
-------

0427594 Use JSON_UNESCAPED_SLASHES for lint commands output
2016-09-13 16:35:36 -07:00
Robin Chalas
04275945ef
Use JSON_UNESCAPED_SLASHES for lint commands output 2016-09-12 23:15:58 +02:00
HeahDude
7806e2a05d Fixed collapsed ChoiceType options attributes 2016-09-11 01:56:49 +02:00
Pedro Resende
1393e3e913 [FrameworkBundle] Fix Incorrect line break in exception message (500 debug page) 2016-09-06 15:45:52 -07:00
Nicolas Grekas
8693611b12 bug #19842 [FrameworkBundle] Check for class existence before is_subclass_of (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Check for class existence before is_subclass_of

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

Same as #19342

Commits
-------

8a9e0f5 [FrameworkBundle] Check for class existence before is_subclass_of
2016-09-06 11:20:32 +02:00
Robin Chalas
8a9e0f526d [FrameworkBundle] Check for class existence before is_subclass_of 2016-09-06 10:59:36 +02:00
Yonel Ceruto
325da3c0d8 Code enhancement and cleanup 2016-09-06 09:26:07 +02:00
Fabien Potencier
6de4359e4b minor #19736 [FrameworkBundle][Security] Remove useless mocks (Ener-Getick)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle][Security] Remove useless mocks

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

Removes mocks causing issues in https://github.com/symfony/symfony/pull/19734.

Commits
-------

fcd3345 [FrameworkBundle][Security] Remove useless mocks
2016-08-25 10:52:51 -07:00
Ener-Getick
fcd3345e34
[FrameworkBundle][Security] Remove useless mocks 2016-08-25 14:52:03 +02:00
Yonel Ceruto
b66ea5e16e added friendly exception when constraint validator does not exist or it is not enabled 2016-08-24 03:54:03 -07:00
Fabien Potencier
d30c3184df minor #19713 [FrameworkBundle] Remove duplicated code in RouterDebugCommand (JhonnyL)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Remove duplicated code in RouterDebugCommand

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

Commits
-------

20a69aa [FrameworkBundle] Remove duplicated code in RouterDebugCommand
2016-08-23 10:14:32 -07:00
JhonnyL
fd27801cf1 [FrameworkBundle] Remove TranslatorBagInterface check 2016-08-23 10:02:31 -07:00
JhonnyL
20a69aa1cf [FrameworkBundle] Remove duplicated code in RouterDebugCommand 2016-08-23 14:39:28 +02:00
Grégoire Pineau
d80589c2d4 [Debug] Swap dumper services at bootstrap
This commit fix a bug when using debug function too soon.
For example, if you call dump function during kernel::boot() the
dump output will be sent to stderr, even in a web context.

With this patch, the data collector is used by default, so the
dump output is send to the WDT. In a CLI context, if dump is used
too soon, the datacollector will buffer it, and release it at the
end of the script. So in this case everything will be visible by the
end used.
2016-08-17 13:57:44 +02:00
Fabien Potencier
1a059e54cf bug #19373 [Form] Skip CSRF validation on form when POST max size is exceeded (jameshalsall)
This PR was squashed before being merged into the 2.7 branch (closes #19373).

Discussion
----------

[Form] Skip CSRF validation on form when POST max size is exceeded

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

In #19140 the CSRF validation listener was not aware that the POST max size had exceeded, and was adding a form error message that wasn't relevant to the actual error.

This introduces the `ServerParams` utility class into the `CsrfValidationListener` and checks that the POST max size has not been exceeded. If it has then it won't bother trying to validate the CSRF token.

My main concern with this change is that it opens up an attack vector around tokens, but I've encapsulated the request size validation in a single method in `ServerParams` now so that the request handlers are using the same logic.

Commits
-------

289531f [Form] Skip CSRF validation on form when POST max size is exceeded
2016-08-15 15:45:28 -07:00
James Halsall
289531f0d0 [Form] Skip CSRF validation on form when POST max size is exceeded 2016-08-15 15:45:25 -07:00
Vyacheslav Pavlov
774c984863 Minor fixes 2016-07-30 03:17:26 -04:00
Vyacheslav Pavlov
7f3145c606 [TwigBundle] Removed redundant return statement. 2016-07-27 23:41:42 +03:00
Nicolas Grekas
b27b0a93bb minor #19405 Fixed bugs in names of classes and methods. (zomberg)
This PR was squashed before being merged into the 2.7 branch (closes #19405).

Discussion
----------

Fixed bugs in names of classes and methods.

| 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 related to case sensitive.

I changed only calls of names of called methods but not definition of methods because BC.

Commits
-------

c41aa03 Fixed bugs in names of classes and methods.
2016-07-26 06:40:56 +02:00
Vyacheslav Pavlov
c41aa03c48 Fixed bugs in names of classes and methods. 2016-07-26 06:40:54 +02:00
Nicolas Grekas
16af6a4d83 minor #19411 [FrameworkBundle] Fixed parameters number mismatch declaration (zomberg)
This PR was squashed before being merged into the 2.7 branch (closes #19411).

Discussion
----------

[FrameworkBundle] Fixed parameters number mismatch declaration

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

9c4efd0 [FrameworkBundle] Fixed parameters number mismatch declaration
2016-07-26 06:37:23 +02:00
Vyacheslav Pavlov
9c4efd0d91 [FrameworkBundle] Fixed parameters number mismatch declaration 2016-07-26 06:37:20 +02:00
Vyacheslav Pavlov
191aef975c [WebProfilerBundle] Fixed JSDoc parameter definition 2016-07-23 18:20:27 +03:00
Magnus Nordlander
db841018dc [HttpKernel] Add listener that checks when request has both Forwarded and X-Forwarded-For 2016-06-30 08:49:13 +02:00
Nicolas Grekas
9d3ae85301 [HttpKernel] Inline ValidateRequestListener logic into HttpKernel 2016-06-29 12:24:37 +02:00
Jules Pietri
f809f3e340 fixed HttpKernel dependencies after #18688 2016-06-29 10:18:30 +02:00
Fabien Potencier
2d3723007d bug #18688 [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For (magnusnordlander)
This PR was squashed before being merged into the 2.7 branch (closes #18688).

Discussion
----------

[HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For

| 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        | symfony/symfony-docs#6526

Emit a warning when a request has both a trusted Forwarded header and a trusted X-Forwarded-For header, as this is most likely a misconfiguration which causes security issues.

Commits
-------

ee8842f [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For
2016-06-29 09:01:56 +02:00
Magnus Nordlander
ee8842fedb [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For 2016-06-29 09:01:55 +02:00
Fabien Potencier
554303e339 removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
Fabien Potencier
e8901b1669 bug #19061 [FORM] fix post_max_size_message translation (alt. 2) (David Badura)
This PR was merged into the 2.7 branch.

Discussion
----------

[FORM] fix post_max_size_message translation (alt. 2)

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

Commits
-------

9d8a5e5 fix post_max_size_message translation
2016-06-22 13:59:59 +02:00
David Badura
9d8a5e5a04 fix post_max_size_message translation 2016-06-21 22:32:24 +02:00
Fabien Potencier
7cc3ca59d0 fixed CS 2016-06-20 18:47:20 +02:00
Cédric Bertolini
b35658b1ff Fix feature detection for IE
operator `!` has higher precedence (4) than operator `in` (8). Parentheses are mandatory here.
2016-06-13 13:03:01 +02:00
Jules Pietri
445dcc8ae2 [Form] Fixed collapsed choice attributes 2016-06-13 01:34:04 +02:00
Fabien Potencier
a81b6cec5d bug #18971 Do not inject web debug toolbar on attachments (peterrehm)
This PR was squashed before being merged into the 2.7 branch (closes #18971).

Discussion
----------

Do not inject web debug toolbar on attachments

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

Commits
-------

4a7d836 Do not inject web debug toolbar on attachments
2016-06-08 13:15:48 +02:00
Peter Rehm
4a7d83666e Do not inject web debug toolbar on attachments 2016-06-08 13:15:43 +02:00
Nicolas Grekas
065dee8525 [HttpKernel] Fix context dependent test 2016-06-06 14:20:11 +02:00
Nicolas Grekas
bf3a2c0abd @throws annotations should go after @return 2016-06-06 13:03:51 +02:00
Fabien Potencier
011d2dcd26 Merge branch '2.3' into 2.7
* 2.3:
  updated VERSION for 2.3.42
  update CONTRIBUTORS for 2.3.42
  updated CHANGELOG for 2.3.42
  Revert "bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh)"
  Partial revert of previous PR
  [DependencyInjection] Skip deep reference check for 'service_container'
  Catch \Throwable
  [Serializer] Add missing @throws annotations
  Fix for #18843
  force enabling the external XML entity loaders
  Removed UTC specification with timestamp
2016-06-06 10:55:42 +02:00
Nicolas Grekas
b3cd2679b8 Partial revert of previous PR 2016-05-30 10:16:24 +02:00
Filip Procházka
893cf00a52 Catch \Throwable 2016-05-30 10:14:41 +02:00
Linnaea Von Lavia
91a2f5dea1 Fix js comment in profiler 2016-05-26 10:56:28 +08:00
Peter Rehm
94e4706609 Fixed server status command when port has been omitted 2016-05-20 17:00:42 +02:00
Fabien Potencier
2731787e8b bug #18799 Use levenshtein level for better Bundle matching (j0k3r)
This PR was merged into the 2.7 branch.

Discussion
----------

Use levenshtein level for better Bundle matching

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

_I've targetted 2.7 branch since this was introduced in the 2.6 version but the 2.6 isn't maintain anymore._

**TL;DR:** I found unused code in bad bundle exception when Symfony try to find the best bundle to fix the typo. Should we remove that code (and got a potential lower matching bundle name) or keep it and make it work?

-----

I've noticed that a part of the code wasn't used when determining which bundle typo was written on _bad bundle exception_, from https://github.com/symfony/symfony/pull/11210.

```php
$alternative = null;
$shortest = null;
foreach ($bundleNames as $bundleName) {
    // if there's a partial match, return it immediately
    if (false !== strpos($bundleName, $nonExistentBundleName)) {
        return $bundleName;
    }

    $lev = levenshtein($nonExistentBundleName, $bundleName);
    if ($lev <= strlen($nonExistentBundleName) / 3 && ($alternative === null || $lev < $shortest)) {
        $alternative = $bundleName;
    }
}
```

In this snippet, the `$shortest` wasn't update in the `foreach`. Reading the code, I guess it was supposed to add an even better accuracy when multiple bundle matche the typo'd bundle name.

Which mean when an alternative is found, we have to assign the level `$lev` from that match to `$shortest`.

```php
if ($lev <= strlen($nonExistentBundleName) / 3 && ($alternative === null || $lev < $shortest)) {
    $alternative = $bundleName;
    $shortest = $lev;
}
```

Let say you have these bundles: `FoooooBundle` and `FooBundle` and you request the bundle `FoodBundle`.

- Without `$shortest` updated, you'll got a suggestion with `FoooooBundle` (first matching bundle found)
- With `$shortest` upadted, you'll got a suggestion with `FooBundle` (because it has a better level than `FoooooBundle`)

This isn't a _bug fix_ since this is only supposed to help developper but not the final user.

**Question is**: should we keep that level comparison or just remove it?

Commits
-------

ac7f74e Use levenshtein level for better Bundle matching
2016-05-17 20:42:59 +02:00
Jeremy Benoist
ac7f74ecca Use levenshtein level for better Bundle matching 2016-05-17 15:13:00 +02:00
Romain Neutron
f8dd87d7cc [WebProfilerBundle] Fix CORS ajax security issues 2016-05-16 18:19:08 +02:00
Fabien Potencier
9a0e29991d fixed bad merge 2016-05-09 14:39:01 -05:00
Fabien Potencier
b9b68f7af8 Merge branch '2.3' into 2.7
* 2.3:
  [2.3][Component/Security] Fixed phpdoc in AnonymousToken constructor for user param
  call get() after the container was compiled
  Fixed readme of OptionsResolver
2016-05-09 13:11:52 -05:00
Christian Flothmann
2d46bd4812 prevent calling get() for service_container service 2016-05-09 17:08:24 +02:00
Christian Flothmann
954126b04f call get() after the container was compiled 2016-05-09 17:05:30 +02:00
Fabien Potencier
cf38962dfe minor #18551 [FrameworkBundle] Remove misleading comment (JhonnyL)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Remove misleading comment

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

This is not true for service_container anymore.

Commits
-------

9f2f858 [FrameworkBundle] Remove misleading comment
2016-04-28 13:02:03 +02:00
Fabien Potencier
4aca7038b8 minor #18606 [FrameworkBundle] Remove duplicated code in ContainerDebugCommand (JhonnyL)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Remove duplicated code in ContainerDebugCommand

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

Commits
-------

5885cbc [FrameworkBundle] Remove duplicated code in ContainerDebugCommand
2016-04-26 14:22:32 +02:00
Fabien Potencier
70b12a8583 bug #18562 [2.7][WebProfilerBunde] Give an absolute url in case the request occured from another domain (romainneutron)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][WebProfilerBunde] Give an absolute url in case the request occured from another domain

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

This is related to #18413:

Using two symfony application ProjectA and MicroServiceB, if ProjectA issues XHR to MicroServiceB and both have the WebProfilerBundle enabled, then Ajax requests will be monitored in ProjectA. But - at the moment - it will try to look for profiles under ProjectA domain whereas data are stored on MicroServiceB domain.

This PR fixes this issue

Commits
-------

1a5d4ad [WebProfilerBunde] Give an absolute url in case the request occured from another domain
2016-04-21 18:18:51 +02:00
JhonnyL
5885cbc1a2 [FrameworkBundle] Remove duplicated code in ContainerDebugCommand 2016-04-21 09:55:15 +02:00
Romain Neutron
1a5d4adadd [WebProfilerBunde] Give an absolute url in case the request occured from another domain 2016-04-16 12:12:40 +02:00
jhonnyL
9f2f858f55 [FrameworkBundle] Remove misleading comment 2016-04-14 20:06:25 +00:00
Nicolas Grekas
01fb26b4d2 Merge branch '2.3' into 2.7
* 2.3:
  Detect CLI color support for Windows 10 build 10586
  [EventDispatcher] Try first if the event is Stopped
  [FrameworkBundle] fixes grammar in container:debug command manual.

Conflicts:
	src/Symfony/Component/EventDispatcher/EventDispatcher.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
2016-04-04 19:08:16 +02:00
Hugo Hamon
c3c092de0f [FrameworkBundle] fixes grammar in container:debug command manual. 2016-04-04 10:38:46 +02:00
Kévin Dunglas
5c87d766d5 [FrameworkBundle] Return the invokable service if its name is the class name 2016-03-31 22:45:44 +02:00
Christian Flothmann
aa4dd4fcf0 fix high deps tests 2016-03-29 22:47:33 +02:00
Cameron Porter
0d31c3e9cb [WebProfilerBundle] Add missing use statement.
Request is needed in RouterController::getTraces to be able to create a request.
2016-03-28 23:46:00 -05:00
Iltar van der Berg
9fea1ee4f4 Removed unused variables 2016-03-24 12:33:34 +01:00
Christian Flothmann
81886530c7 move test methods to test case class 2016-03-23 19:17:25 +01:00
Nicolas Grekas
86c0a17721 Merge branch '2.3' into 2.7
* 2.3:
  [Validator] use correct term for a property in docblock (not "option")
  [PropertyAccess] Remove most ref mismatches to improve perf
  [Validator] EmailValidator cannot extract hostname if email contains multiple @ symbols
  [NumberFormatter] Fix invalid numeric literal on PHP 7
  Use XML_ELEMENT_NODE in nodeType check
  [PropertyAccess] Reduce overhead of UnexpectedTypeException tracking
  [PropertyAccess] Throw an UnexpectedTypeException when the type do not match
  [FrameworkBundle] Add tests for the Controller class

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php
	src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php
	src/Symfony/Component/PropertyAccess/PropertyAccessor.php
	src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php
	src/Symfony/Component/PropertyAccess/PropertyPath.php
	src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
	src/Symfony/Component/Validator/Constraints/EmailValidator.php
2016-03-22 09:55:46 +01:00
Kévin Dunglas
514a06083a [FrameworkBundle] Add tests for the Controller class 2016-03-16 19:49:12 +01:00
Kévin Dunglas
ca56be1c8a [FrameworkBundle] Add tests for the Controller class 2016-03-16 19:32:37 +01:00
Nicolas Grekas
c7686a3624 Merge branch '2.3' into 2.7
* 2.3:
  Improved the PHPdoc of FileSystem::copy()
  [Validator] Test DNS Email constraints using checkdnsrr() mock
  [travis] Run real php subprocesses on hhvm for Process component tests
  bug #18161 [Translation] Add support for fuzzy tags in PoFileLoader
  [Form] Fix NumberToLocalizedStringTransformer::reverseTransform with big integers
  [Form] Fix INT64 cast to float in IntegerType.
  [SecurityBundle][PHPDoc] Added method doumentation for SecurityFactoryInterface
  FrameworkBundle: Client: getContainer(): fixed phpdoc
  [Validator] Updating inaccurate docblock comment

Conflicts:
	.travis.yml
	src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php
2016-03-16 17:00:15 +01:00
Amine Matmati
cfb3ea1a5f [SecurityBundle][PHPDoc] Added method doumentation for SecurityFactoryInterface 2016-03-15 14:44:54 +01:00
Dawid Nowak
7462fa59b1 FrameworkBundle: Client: getContainer(): fixed phpdoc
The kernel might be shut down and then the method will return null instead of a ContainerInterface object
2016-03-15 11:30:50 +01:00
Patrick McDougle
181f256949 Use debug member variable 2016-03-12 10:48:57 -08:00
Nicolas Grekas
81c50d628e Merge branch '2.3' into 2.7
* 2.3:
  [HttpFoundation] Fix transient test
  [HttpFoundation] Add a dependency on the mbstring polyfill
  add readme files where missing
  Don't use reflections when possible
  [Form] Update form tests after the ICU data update
  [Intl] Update tests and the number formatter to match behaviour of the intl extension
  [Intl] Update the ICU data to version 55
  [Intl] Fix the update-data.php script in preparation for ICU 5.5
  Use constant instead of function call.
  fixed test name
  automatically generate safe fallback filename

Conflicts:
	src/Symfony/Component/Debug/Debug.php
	src/Symfony/Component/HttpFoundation/composer.json
	src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php
2016-03-07 14:45:47 +01:00
Christian Flothmann
a1997b92c6 add readme files where missing 2016-03-07 11:36:15 +01:00
Fabien Potencier
a29e818a3f minor #18025 [2.7] Don't use reflection when possible (Ener-Getick)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] Don't use reflection when possible

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

See https://github.com/symfony/symfony/pull/18021

Commits
-------

35be501 Don't use reflections when possible
2016-03-06 11:26:36 +01:00
Ener-Getick
35be5017e7 Don't use reflections when possible 2016-03-05 18:34:36 +01:00
Fabien Potencier
d66f0ebe35 Merge branch '2.3' into 2.7
* 2.3:
  Updated all the README files
  [TwigBundle] Fix failing test on appveyor
  [FrameworkBundle] Fix a regression in handling absolute and namespaced template paths
  Allow to normalize \Traversable
  Remove _path from query parameters when fragment is a subrequest and request attributes are already set Added tests for _path removal in FragmentListener
  Simplified everything
  Added a test
  Fixed the problem in an easier way
  Fixed a syntax issue
  Improved the error message when a template is not found
  [CodingStandards] Conformed to coding standards
  [TwigBundle] fixed Include file locations in "Template could not be found" exception
2016-03-04 08:52:28 +01:00
Nicolas Grekas
d5bbc3c6cb [TwigBundle] Fix failing test on appveyor 2016-03-03 18:24:01 +01:00
Fabien Potencier
37569be45f bug #17434 Improved the error message when a template is not found (rvanginneken, javiereguiluz)
This PR was merged into the 2.3 branch.

Discussion
----------

Improved the error message when a template is not found

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

### Before

![template_error_before](https://cloud.githubusercontent.com/assets/73419/12414237/7db29212-be94-11e5-85b4-c6444aa853f8.png)

### After

![template_error_after](https://cloud.githubusercontent.com/assets/73419/12414242/80ed1eca-be94-11e5-992e-a0596a1e95ca.png)

This seems to work in the browser ... but I can't make tests pass. Could anybody please help me? Thanks!

Commits
-------

0134d76 Simplified everything
19bfa2e Added a test
88b913b Fixed the problem in an easier way
35f082f Fixed a syntax issue
968476b Improved the error message when a template is not found
e9d951a [CodingStandards] Conformed to coding standards
d3fe07b [TwigBundle] fixed Include file locations in "Template could not be found" exception
2016-03-03 15:31:15 +01:00
Fabien Potencier
9d58ad92fe bug #17744 Improve error reporting in router panel of web profiler (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #17744).

Discussion
----------

Improve error reporting in router panel of web profiler

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

### Problem

If you define a route condition like this:

```yaml
app:
    resource: '@AppBundle/Controller/'
    type:     annotation
    condition: "request.server.get('HTTP_HOST') matches '/.*\.dev/'"
```

When browsing the Routing panel in the web profiler, you see an exception:

![problem](https://cloud.githubusercontent.com/assets/73419/12930027/553eeb08-cf76-11e5-90b1-ab0de6175d4e.png)

#### Why?

Because the route condition uses the `request` object, but the special `TraceableUrlMatcher` class doesn't get access to the real `request` object but to the special object obtained via:

```php
$request = $profile->getCollector('request');
```

These are the contents of this pseudo-request:

![cause](https://cloud.githubusercontent.com/assets/73419/12930052/804ea248-cf76-11e5-9c38-2e43e1654065.png)

`request.server.get(...)` condition fails because `request.server` is `null`. The full exception message shows this:

![exception](https://cloud.githubusercontent.com/assets/73419/12930079/9c7d6058-cf76-11e5-8eeb-45f5059c824c.png)

### Solution

I propose to catch all exceptions in `TraceableUrlMatcher` and display an error message with some details of the exception:

![error_message](https://cloud.githubusercontent.com/assets/73419/12930106/b29e31d2-cf76-11e5-868c-98d8b0cc4e5b.png)

Commits
-------

1001554 Improve error reporting in router panel of web profiler
2016-03-03 14:12:45 +01:00
Javier Eguiluz
10015546b0 Improve error reporting in router panel of web profiler 2016-03-03 14:12:44 +01:00
Fabien Potencier
eee9bfbef6 bug #17894 [FrameworkBundle] Fix a regression in handling absolute template paths (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] Fix a regression in handling absolute template paths

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

Regression introduced by #15272.

Commits
-------

d8c493f [FrameworkBundle] Fix a regression in handling absolute and namespaced template paths
2016-03-03 13:59:03 +01:00
Jakub Zalas
d8c493f076 [FrameworkBundle] Fix a regression in handling absolute and namespaced template paths 2016-03-03 08:16:18 +00:00
Fabien Potencier
9851928f9b fixed tests 2016-03-02 13:43:59 +01:00
Fabien Potencier
11a8524742 minor #17632 [FrameworkBundle] Test that ObjectNormalizer is registered (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Test that ObjectNormalizer is registered

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

129b140 [FrameworkBundle] Test that ObjectNormalizer is registered
2016-03-02 13:42:07 +01:00
Fabien Potencier
c6b68924a0 Merge branch '2.3' into 2.7
* 2.3:
  fix debug toolbar rendering by removing inadvertently added links
  simplified code
  Allow variadic controller parameters to be resolved.
2016-03-01 18:34:38 +01:00
Christian Raue
a0ddfc4246 fix debug toolbar rendering by removing inadvertently added links 2016-03-01 17:26:04 +01:00
Javier Eguiluz
0134d76785 Simplified everything 2016-03-01 15:47:09 +01:00
Fabien Potencier
51a71ab74a Merge branch '2.3' into 2.7
* 2.3:
  #17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features
  Fix bug when using an private aliased factory service
  ChoiceFormField of type "select" could be "disabled"
  Update contributing docs
  [Console] Fix escaping of trailing backslashes
  Fix constraint validator alias being required
  [ci] clone with depth=1 to kill push-forced PRs
  Add check on If-Range header
2016-02-28 17:19:47 +01:00
Tristan Roussel
5136c308f2 Fix constraint validator alias being required 2016-02-23 21:06:57 +01:00
Fabien Potencier
24cdae71a1 minor #17883 Update twig.html.twig (tvlooy)
This PR was merged into the 2.7 branch.

Discussion
----------

Update twig.html.twig

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

Replace base64 template icon with svg version. If you set the Content-Security-Policy you would need to provide "img-src 'self' data:;" just for that icon (or get an error in the console). This should be fixed in the new version of the toolbar but it would be nice to have a fix for 2.7 LTS too.

Commits
-------

d29f04c Update twig.html.twig
2016-02-22 16:01:50 +01:00
Tom Van Looy
d29f04c149 Update twig.html.twig
Replace base64 template icon with svg version. If you set the Content-Security-Policy you would need to provide "img-src 'self' data:;" just for that icon (or get an error in the console). This should be fixed in the new version of the toolbar but it would be nice to have a fix for 2.7 LTS too.
2016-02-22 14:30:57 +01:00
Jules Pietri
ce6e5ac5aa [2.7] [FrameworkBundle] minor fix tests added by #17569 2016-02-19 17:41:56 +01:00
Fabien Potencier
653428af76 Merge branch '2.3' into 2.7
* 2.3:
  fixed CS
  fixed CS
  documented the $url parameter better
  register commands from kernel when accessing list
  Update FileSystem
2016-02-18 17:03:55 +01:00
Fabien Potencier
a02967c9ee fixed CS 2016-02-18 16:45:01 +01:00
Fabien Potencier
e932baec28 bug #17569 [FrameworkBundle] read commands from bundles when accessing list (havvg)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] read commands from bundles when accessing list

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

This allows access to the list of commands registered by the kernel (bundle and later service ids) programmatically when you do not `run` the application.

Commits
-------

0fe3088 register commands from kernel when accessing list
2016-02-18 16:42:34 +01:00
Fabien Potencier
d3c55cb3f1 bug #17787 [Form] Fix choice placeholder edge cases (Tobion)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fix choice placeholder edge cases

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

Fixing several problems with choice placeholder that enhances #9030 for more edge cases:

- A choice with an empty value manually added in the choices array should only be considered a placeholder when it is the first element in the final choice select.
This is part of the HTML spec and how browsers also behave. If you select a choice with an empty value that is not the first option, it will still pass the "required" check
and thus submit the empty value. So it's not a placeholder.
If in the example below you move the empty option to the first place, the browsers will error on submit that you
must select a value. So only then it is a placeholder to show as initial value.

```html
<select id="form_timezone" name="form[timezone]" required="required">
    <option value="Africa/Abidjan">Abidjan</option>
    <option value="">Empty</option>
</select>
```

Also the validator https://validator.w3.org/nu/ will mark the above code as error:
> The first child option element of a select element with a required attribute, and without a multiple attribute, and without a size attribute whose value is greater than 1, must have either an empty value attribute, or must have no text content. Consider either adding a placeholder option label, or adding a size attribute with a value equal to the number of option elements.

This is fixed by replacing`0 !== count($choiceList->getChoicesForValues(array('')))` with `$view->vars['placeholder_in_choices'] = $choiceListView->hasPlaceholder()`.
Which means, the required attribute is removed automatically because the select form element is required implicitly anyway due to the nature of the choice UI.

- As the above quote mentions, the `size` attribute also has impact. Namely for a select with size > 1 it can be possible to have a required attribute even without placeholder.
This is because when the size > 1, there is no default choice selected (similar to select with "multiple").

- A placeholder for required radio buttons or a select with size > 1 does not make sense as it would just be fake data that can be submitted (similar to the ignored placeholder for multi-select and checkboxes).

Commits
-------

0efbc30 [Form] fix edge cases with choice placeholder
2016-02-18 13:07:46 +01:00
Fabien Potencier
1af6e98851 Merge branch '2.3' into 2.7
* 2.3:
  fix YAML syntax in functional tests config
2016-02-16 08:15:42 +01:00
Christian Flothmann
2da40382ab [FrameworkBundle] fix YAML syntax 2016-02-15 19:07:52 +01:00
Christian Flothmann
d9af4bc606 fix YAML syntax in functional tests config 2016-02-15 19:05:26 +01:00
Tobias Schultze
0efbc30304 [Form] fix edge cases with choice placeholder 2016-02-13 13:18:37 +01:00
Fabien Potencier
4598b74906 Merge branch '2.3' into 2.7
* 2.3:
  remove unnecessary retrieval and setting of data
  avoid (string) catchable fatal error for __PHP_Incomplete_Class instances
  sendContent return as parent.
  [FrameworkBundle] Fix a typo
2016-02-12 07:23:50 +01:00
Jakub Zalas
89133e6a71 [FrameworkBundle] Fix a typo 2016-02-10 10:18:08 +00:00
Nicolas Grekas
fc939580ab Merge branch '2.3' into 2.7
* 2.3:
  [travis] Add some comments
  changed operator from and to &&

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php
2016-02-04 13:09:54 +01:00
Fabien Potencier
c71840193c changed operator from and to && 2016-02-02 15:23:07 +01:00
Christian Flothmann
1a96c40f35 [#17634] move DebugBundle license file 2016-02-01 20:40:12 +01:00
Christian Flothmann
10c17f8589 Merge branch '2.3' into 2.7
* 2.3:
  Move licenses according to new best practices
2016-02-01 20:38:55 +01:00
Kévin Dunglas
aab5decc5b Move licenses according to new best practices 2016-01-31 22:16:42 +01:00
Kévin Dunglas
8780e26c9d [FrameworkBundle] Remove unused code in test 2016-01-31 22:09:31 +01:00
Kévin Dunglas
129b140a5f [FrameworkBundle] Test that ObjectNormalizer is registered 2016-01-31 22:03:33 +01:00
Fabien Potencier
9d8232bf25 Merge branch '2.3' into 2.7
* 2.3:
  fix container cache key generation
  [Translation] Add resources from fallback locale
  [DependencyInjection] enforce tags to have a name
  [YAML] Refine the return value of Yaml::parse()
2016-01-31 08:56:20 +01:00
Christian Flothmann
29750e51ad fix container cache key generation
If the actual class name were not taken into, we would not be able to
detect inconsistencies between the different configuration formats (PHP,
YAML, and XML) as the container built based on the first evaluated
configuration format would be cached and reused by tests for the other
formats too.
2016-01-30 22:24:39 +01:00
Fabien Potencier
8c0b48f6ca bug #17605 [FrameworkBundle] remove default null value for asset version (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] remove default null value for asset version

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

Setting `null` as the version of a package means that it uses the empty
version strategy. However, omitting the `version` option entirely was
meant to fall back to the default version strategy. This is not possible
when the default version value is `null` as there is no way to remove
it.

Commits
-------

25f735f remove default null value for asset version
2016-01-30 16:54:06 +01:00
Paráda József
c8e1384b84 [2.7] Fix tests 2016-01-30 16:53:18 +01:00
Christian Flothmann
25f735f78a remove default null value for asset version
Setting `null` as the version of a package means that it uses the empty
version strategy. However, omitting the `version` option entirely was
meant to fall back to the default version strategy. This is not possible
when the default version value is `null` as there is no way to remove
it.
2016-01-30 09:02:28 +01:00
Javier Eguiluz
19bfa2ed8c Added a test 2016-01-27 18:13:21 +01:00
Javier Eguiluz
88b913b0c4 Fixed the problem in an easier way 2016-01-27 17:49:58 +01:00
Toni Uebernickel
0fe3088dea register commands from kernel when accessing list 2016-01-27 13:20:43 +01:00
Christian Flothmann
3a027badb7 Merge branch '2.3' into 2.7
* 2.3:
  fixed CS
  [BrowserKit] Corrected HTTP_HOST logic #15398
  resolve aliases in factory services
  Remove invalid CSS white-space value
  Fix FileSystem tests on Windows
2016-01-27 12:27:15 +01:00
Fabien Potencier
72fa3bdda9 minor #17552 Remove invalid CSS white-space value (Triiistan)
This PR was merged into the 2.3 branch.

Discussion
----------

Remove invalid CSS white-space value

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

Commits
-------

03d3182 Remove invalid CSS white-space value
2016-01-27 11:20:13 +01:00
Fabien Potencier
1876b4f1c8 Merge branch '2.3' into 2.7
* 2.3:
  Static code analysis
  Update AnnotationDirectoryLoader.php
  [FrameworkBundle] Fix template location for PHP templates
  [FrameworkBundle] Add path verification to the template parsing test cases
2016-01-27 06:09:39 +01:00
Fabien Potencier
89e86197c1 minor #17480 Static code analysis (Koc)
This PR was merged into the 2.3 branch.

Discussion
----------

Static code analysis

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

Things that done:
* fix case in method calls
* removed unused imports
* use shorter concat where it possible
* optimize some css
* removed duplicated array keys
* removed redurant return statements
* removed one-time variables
* do not pass arguments that not used in functions

Commits
-------

8db691a Static code analysis
2016-01-27 05:57:57 +01:00
Tristan Roussel
03d3182129 Remove invalid CSS white-space value 2016-01-27 01:14:25 +01:00
Javier Eguiluz
37655be008 Increase the inlining YAML level for config:debug 2016-01-26 16:21:36 +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
Konstantin.Myakshin
8db691ab94 Static code analysis 2016-01-25 19:00:36 +02: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
4b21351f36 fixed undefined variable 2016-01-25 17:19: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
36c72623e6 bug #17454 Allow absolute URLs to be displayed in the debug toolbar (javiereguiluz)
This PR was merged into the 2.7 branch.

Discussion
----------

Allow absolute URLs to be displayed in the debug toolbar

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

If you agree with the original issue, this should do the trick. If you don't agree, please explain the reasons and close #12221. Thanks!

Commits
-------

11b63ff Allow absolute URLs to be displayed in the debug toolbar
2016-01-25 12:02:24 +01:00
Stepan Anchugov
884368e709 Throw for missing container extensions
This covers cases when a bundle does not have an extension, which
lead to FatalErrorException with ```Call to a member function getAlias() on null```
2016-01-25 10:38:10 +01:00
Fabien Potencier
c738085cb3 minor #16941 [FrameworkBundle] Compute the kernel root hash only one time (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Compute the kernel root hash only one time

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

23431e9 [FrameworkBundle] Compute the kernel root hash only one time
2016-01-25 09:11:55 +01:00
Evgeniy Sokolov
65adb7282c add defaultNull to version 2016-01-25 01:05:43 +01:00
Fabien Potencier
93d5bf7424 Merge branch '2.3' into 2.7
* 2.3:
  [SecurityBundle] Optimize dependency injection tests
  [HttpFoundation] Do not overwrite the Authorization header if it is already set
  tag for dumped PHP objects must be a local one
2016-01-24 12:05:56 +01:00
Evgeniy Sokolov
646fc9caaa Ability to set empty version strategy in packages 2016-01-23 23:57:07 +01:00
Christian Flothmann
a5c881182f sort bundles in config:dump-reference command
This backports #17495 to the `2.3` branch.
2016-01-23 17:38:15 +01:00
Fabien Potencier
870b40cf59 minor #17495 [2.7] [FrameworkBundle] [DX] Sort bundles in config commands (kix)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] [FrameworkBundle] [DX] Sort bundles in config commands

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

Reopened against `2.7` instead of #17490

This makes the behaviour of config commands a bit more user-friendly. Scanning through an ordered list should be a lot easier for the user, especially if she knows what's the exact bundle they're looking for. The sort is applied to the bundle name, as the extension alias might not always be present.

Before:
![before](https://cloud.githubusercontent.com/assets/345754/12498061/8e0ff30a-c0c1-11e5-9c96-561065eedc79.png)
After:
![after](https://cloud.githubusercontent.com/assets/345754/12498064/93019bde-c0c1-11e5-8bbc-c85a74b3f5e8.png)

Commits
-------

80d51e0 Sort bundles in config commands
2016-01-23 11:38:31 +01:00
Christian Flothmann
766a648ded CLI: use request context to generate absolute URLs 2016-01-23 11:02:39 +01:00
Paráda József
bf56d2fc17 [SecurityBundle] Optimize dependency injection tests 2016-01-23 10:46:30 +01:00
Stepan Anchugov
80d51e0d18 Sort bundles in config commands 2016-01-22 18:33:13 +05:00
Stepan Anchugov
b85059a672 Remove default match from AbstractConfigCommand::findExtension
Previously, findExtension would return the first extension that might
not even match the $name parameter.
2016-01-21 07:10:38 +01:00
Javier Eguiluz
11b63ff686 Allow absolute URLs to be displayed in the debug toolbar 2016-01-20 10:38:59 +01:00
Fabien Potencier
6ec5537aed Merge branch '2.3' into 2.7
* 2.3:
  [Process] Remove a misleading comment
  Improve the phpdoc of SplFileInfo methods
  [Process] Use stream based storage to avoid memory issues
  Fixed the documentation of VoterInterface::supportsAttribute
  Remove useless duplicated tests
  [FrameworkBundle] Optimize framework extension tests
  Use is_subclass_of instead of Reflection when possible
2016-01-20 07:45:12 +01:00
Javier Eguiluz
35f082f6ef Fixed a syntax issue 2016-01-19 10:10:19 +01:00
Javier Eguiluz
968476b707 Improved the error message when a template is not found 2016-01-19 10:05:18 +01:00
Roy Van Ginneken
e9d951a882 [CodingStandards] Conformed to coding standards 2016-01-19 10:05:12 +01:00
Roy Van Ginneken
d3fe07b160 [TwigBundle] fixed Include file locations in "Template could not be found" exception 2016-01-19 10:04:39 +01:00
Nicolas Grekas
90d493ea97 [FrameworkBundle] Don't log twice with the error handler 2016-01-19 00:13:42 +01:00
Paráda József
f6a078b96c [FrameworkBundle] Optimize framework extension tests 2016-01-17 17:17:03 +01:00
Fabien Potencier
ab43f389e2 minor #17401 [2.7] Use is_subclass_of instead of reflection (Ener-Getick)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] Use is_subclass_of instead of reflection

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

Follows https://github.com/symfony/symfony/pull/17400

>
For performance reason, I replaced a reflection instantiation by ``is_subclass_of``.

Commits
-------

5af5d06 Use is_subclass_of instead of reflection
2016-01-16 19:10:37 +01:00
Tobias Schultze
aedeebb4f1 fix merge 2.3 into 2.7 for SecureRandom dependency 2016-01-16 18:29:47 +01:00
Ener-Getick
5af5d06f2e Use is_subclass_of instead of reflection 2016-01-16 14:49:28 +01:00
Fabien Potencier
8d7b19fbbe Merge branch '2.3' into 2.7
* 2.3:
  Fixed correct class name in thrown exception
  Add gc_mem_caches() call for PHP7 after itoken_get_all() as new memory manager will not release small buckets to OS automatically
  Removed a duplicated test in CardSchemeValidatorTest
  Fix perf and mem issue when using token_get_all
  [SecurityBundle] fix SecureRandom service constructor args
  Normalize params only when used.
2016-01-16 05:55:21 +01:00
Fabien Potencier
7d72f93e90 bug #17373 [SecurityBundle] fix SecureRandom service constructor args (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[SecurityBundle] fix SecureRandom service constructor args

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

Commits
-------

50d55f6 [SecurityBundle] fix SecureRandom service constructor args
2016-01-16 05:53:05 +01:00
Peter Ward
e555aade12 Add gc_mem_caches() call for PHP7 after itoken_get_all() as new memory manager will not release small buckets to OS automatically 2016-01-15 10:01:44 +01:00
Nicolas Grekas
d1f72d8ef4 Fix perf and mem issue when using token_get_all 2016-01-14 14:27:10 +01:00
Tobias Schultze
50d55f6855 [SecurityBundle] fix SecureRandom service constructor args 2016-01-14 14:17:14 +01:00
Fabien Potencier
5c29e717a2 Merge branch '2.3' into 2.7
* 2.3:
  [Console] Display console application name even when no version set
  Remove empty statements.
2016-01-14 09:26:43 +01:00
Possum
4491c970b3 Remove empty statements. 2016-01-13 18:07:01 +01:00
Fabien Potencier
da655a9368 Merge branch '2.3' into 2.7
* 2.3:
  Typo fix
  [2.3] Static Code Analysis for Components
  Added support \IteratorAggregate for UniqueEntityValidator
  Fix #17306 Paths with % in it are note allowed (like urlencoded)
  Added sort order SORT_STRING for params in UriSigner
  Remove normalizer cache in Serializer class
2016-01-12 18:44:11 +01:00
Pavel Batanov
de7b4d73c6 Fix #17306 Paths with % in it are note allowed (like urlencoded) 2016-01-09 15:55:11 +03:00
Diego Saint Esteben
e38fa135ab Use proper class to fetch $versionStrategy property 2016-01-07 19:01:12 +01:00
Titouan Galopin
a7b7766983 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit 2016-01-06 11:27:30 +01:00
Nicolas Grekas
6cd79e92f6 Merge branch '2.3' into 2.7
* 2.3:
  [Process] Fix potential race condition
  typo
  [FrameworkBundle] Set the kernel.name properly after a cache warmup
  Removed spaces before semicolon
2016-01-06 10:57:37 +01:00
Titouan Galopin
758fc1dfb2 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit 2016-01-06 10:52:17 +01:00
Jakub Zalas
1438b9a067 [FrameworkBundle] Set the kernel.name properly after a cache warmup 2016-01-04 18:15:54 +01:00
Fabien Potencier
5a9c1b5a0f minor #17243 Removed spaces before semicolon (dereckson)
This PR was merged into the 2.3 branch.

Discussion
----------

Removed spaces before semicolon

'lorem ; ipsum' → 'lorem; ipsum'

| Q             | A
| ------------- | ---
| Fixed tickets | #17242
| License       | MIT

Commits
-------

169d551 Removed spaces before semicolon
2016-01-04 17:52:03 +01:00
Fabien Potencier
6dbef8ccb8 updated copyright year 2016-01-03 16:33:06 +01:00
Fabien Potencier
d6f503660f Merge branch '2.3' into 2.7
* 2.3:
  Update copyright year
  [2.3] Static Code Analysis for Components
2016-01-03 16:32:00 +01:00
Diego Saint Esteben
ce067e6460 Update copyright year 2016-01-01 23:53:47 -03:00
Sébastien Santoro
169d5513a6 Removed spaces before semicolon
'lorem ; ipsum' → 'lorem; ipsum'
2016-01-01 15:10:52 +00:00
Tobias Schultze
140ed985be feature #16747 [Form] Improved performance of ChoiceType and its subtypes (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Improved performance of ChoiceType and its subtypes

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

I found out today that, although CachingFactoryDecorator is part of Symfony 2.7, it is not configured to be used in the DI configuration. This simple in-memory cache improved the page load by 50% for one considerably large form with many (~600) choice/entity fields that I was working on today.

Also, caching of query builders with parameters was broken, since the parameters are represented by objects. PHP's object hashes were used to calculate the cache keys, hence the cache always missed. I converted parameters to arrays for calculating the cache keys to fix this problem.

Commits
-------

a0ef101 [Form] Improved performance of ChoiceType and its subtypes
2015-12-30 16:04:43 +01:00
Bernhard Schussek
a0ef1018d6 [Form] Improved performance of ChoiceType and its subtypes 2015-12-30 11:11:52 +01:00
Nicolas Grekas
a63dd194ed Merge branch '2.3' into 2.7
* 2.3:
  [travis] timeout the sigchild tests at 60s
  CS: Single line comments should use double slashes (//) and not hash (#).
  Do not use HttpKernel Extension when not needed
  bumped Symfony version to 2.3.37
  updated VERSION for 2.3.36
  update CONTRIBUTORS for 2.3.36
  updated CHANGELOG for 2.3.36
  use nowdoc instead of heredoc

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php
	src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php
	src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php
	src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php
	src/Symfony/Bundle/TwigBundle/Command/LintCommand.php
	src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php
	src/Symfony/Component/Debug/ExceptionHandler.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Routing/Generator/Dumper/PhpGeneratorDumper.php
2015-12-28 14:11:03 +01:00
Nicolas Grekas
a89fe42811 minor #17086 CS: use nowdoc instead of heredoc (gharlan)
This PR was merged into the 2.3 branch.

Discussion
----------

CS: use nowdoc instead of heredoc

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

if this is accepted, we could add the fixer to symfony level of php-cs-fixer: https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1580

Commits
-------

3dca549 use nowdoc instead of heredoc
2015-12-28 14:03:05 +01:00
Tobias Schultze
cc64c54cfa Do not use HttpKernel Extension when not needed for 2.7 2015-12-26 18:53:53 +01:00
Tobias Schultze
4978e196ca Do not use HttpKernel Extension when not needed 2015-12-26 18:41:33 +01:00
Fabien Potencier
97cf53f9bd Merge branch '2.3' into 2.7
* 2.3:
  [2.7] Fixed flatten exception recursion with errors
  Embedded identifier support
  Change the ExtensionInterface load method definition to bo identical to the documentation.
  add and correct armenian translations
  [Config] Fix array sort on normalization in edge case
  [Yaml] fix indented line handling in folded blocks
  improve BrowserKit test coverage p1
2015-12-26 14:37:43 +01:00
Mathieu MARCHOIS
85c271b7a2 Change the ExtensionInterface load method definition to bo identical to the documentation. 2015-12-26 13:00:54 +01:00
Nicolas Grekas
b7f998f744 Merge branch '2.3' into 2.7
* 2.3:
  [SecurityBundle] Removing test insulations for a huge perf win
  [Filesystem] fix tests on 2.3
  [Filesystem] Recursivly widen non-executable directories
2015-12-22 11:07:22 +01:00
Fabien Potencier
bbc53dd83f minor #16999 [SecurityBundle] Removing test insulations for a huge perf win (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[SecurityBundle] Removing test insulations for a huge perf win

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

Commits
-------

b8fa471 [SecurityBundle] Removing test insulations for a huge perf win
2015-12-21 19:31:12 +01:00
Nicolas Grekas
b8fa471f8a [SecurityBundle] Removing test insulations for a huge perf win 2015-12-21 17:08:45 +01:00
Gregor Harlan
3dca549b95 use nowdoc instead of heredoc 2015-12-21 17:05:00 +01:00
Nicolas Grekas
85814de44c Merge branch '2.3' into 2.7
* 2.3:
  prefer phpunit 5.x on hhvm
  [FrameworkBundle][HttpKernel] the finder is required to discover bundle commands
  [travis] Auto-conf deps=high matrix line
  Fix the logout path when not using the router
  [HttpFoundation] Added the ability of mapping stream wrapper protocols when using X-Sendfile
  [HttpFoundation] Add a test case for using BinaryFileResponse with stream wrappers

Conflicts:
	.travis.yml
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php
2015-12-18 16:35:58 +01:00
Nicolas Grekas
c2b7ccb36c bug #17048 Fix the logout path when not using the router (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix the logout path when not using the router

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

This needs to use the base url, not the base path, so that it goes through the front controller when not using url rewriting.

Commits
-------

1a2567e Fix the logout path when not using the router
2015-12-18 10:38:22 +01:00
Christian Flothmann
17fcef5aff [FrameworkBundle][HttpKernel] the finder is required to discover bundle commands 2015-12-18 10:21:31 +01:00
Christophe Coevoet
1a2567e19e Fix the logout path when not using the router
This needs to use the base url, not the base path, so that it goes
through the front controller when not using url rewriting.
2015-12-17 13:54:40 +01:00
Tobias Schultze
88d586b447 Merge branch '2.3' into 2.7 2015-12-15 02:31:17 +01:00
Nicolas Grekas
f253d624a0 Merge branch '2.3' into 2.7
* 2.3:
  [Process] Enhance compatiblity with --enable-sigchild
  [Process] Always call proc_close
  [Validator] Updated Luxembourgish translations for 2.8
  [FrameworkBundle] prevent cache:clear creating too long paths

Conflicts:
	src/Symfony/Component/Process/Tests/ProcessTest.php
	src/Symfony/Component/Process/Tests/SigchildDisabledProcessTest.php
	src/Symfony/Component/Process/Tests/SigchildEnabledProcessTest.php
	src/Symfony/Component/Process/Tests/SimpleProcessTest.php
	src/Symfony/Component/Validator/Resources/translations/validators.lb.xlf
2015-12-10 17:58:22 +01:00
Nicolas Grekas
99535506e8 Clean useless deprecation silencing 2015-12-10 15:12:08 +01:00
Kévin Dunglas
23431e99d6 [FrameworkBundle] Compute the kernel root hash only one time 2015-12-10 11:46:31 +01:00
Tobias Schultze
4cde2d1e33 bug #16829 [FrameworkBundle] prevent cache:clear creating too long paths (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] prevent cache:clear creating too long paths

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

Commits
-------

6e279c5 [FrameworkBundle] prevent cache:clear creating too long paths
2015-12-10 01:42:36 +01:00
Fabien Potencier
420da14156 bug #16757 [FrameworkBundle] [Translation] Fixed translations not written when no translations directory in update command (jeremyFreeAgent)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] [Translation] Fixed translations not written when no translations directory in update command

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

Currently when you run the TranslationUpdateCommand and want to write the translation in the domain file without a `translations` directory the output is `[OK] Success` but the file is not created.

This PR fix the creation of the directory.

Commits
-------

8c45107 [FrameworkBundle] [Translation] Fixed translations not written when no translations directory in update command
2015-12-08 19:14:24 +01:00
Fabien Potencier
b8fbe69bb8 bug #16871 [FrameworkBundle] Disable built-in server commands when Process component is missing (gnugat, xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Disable built-in server commands when Process component is missing

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

This also backports the improvement for the `suggest` section from #16650 to the `2.7` branch and improves it by also mentioning the other built-in server commands.

Commits
-------

972c4ca disable server commands without Process component
dd82b64 list all server command names in suggestion
d18fb9b Suggested Process dependency
2015-12-07 22:55:06 +01:00
Fabien Potencier
52915ede0f Merge branch '2.3' into 2.7
* 2.3:
  disable server:run cmd without Process component
  Suggested Process dependency
2015-12-07 22:53:02 +01:00