Commit Graph

22937 Commits

Author SHA1 Message Date
Fabien Potencier
fdce6ac104 Merge branch '2.3' into 2.7
* 2.3:
  use PHP_OS instead of php_uname('s')
2015-10-02 15:59:42 +02:00
Fabien Potencier
112c66c944 minor #15991 Updated the stlyes of the YAML commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15991).

Discussion
----------

Updated the stlyes of the YAML commands

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

![yaml_1](https://cloud.githubusercontent.com/assets/73419/10158656/dfedd2ec-6693-11e5-8691-304b5dd19edc.png)

![yaml_2](https://cloud.githubusercontent.com/assets/73419/10158658/e22e1bfc-6693-11e5-9626-38f21ffb5a9a.png)

Commits
-------

c3ce7ca Updated the stlyes of the YAML commands
2015-10-02 15:03:18 +02:00
Javier Eguiluz
c3ce7ca141 Updated the stlyes of the YAML commands 2015-10-02 15:03:16 +02:00
Fabien Potencier
1e0adf4c21 feature #14721 [Security] Configuring a user checker per firewall (iltar)
This PR was squashed before being merged into the 2.8 branch (closes #14721).

Discussion
----------

[Security] Configuring a user checker per firewall

_Changed my base branch to avoid issues, closed old PR_

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed ticket | #11090 and helps #14673
| License       | MIT
| Doc PR        | symfony/symfony-docs/pull/5530

This pull request adds support for a configurable user checker per firewall. An example could be:

```yml
services:
    app.user_checker:
        class: App\Security\UserChecker
        arguments:
            - "@request_stack"

security:
    firewalls:
        secured_area:
            pattern: ^/
            anonymous: ~
            basic_auth: ~
            user_checker: app.user_checker

```
The above example will use the `UserChecker` defined as `app.user_checker`. If the `user_checker` option is left empty, `security.user_checker` will  be used. If the `user_checkers` option is not defined, it will fall back to the original behavior to not break backwards compatibility and will validate using the existing `UserChecker`: `security.user_checker`.

I left the default argument in the service definitions to be `security.user_checker` to include backwards compatibility for people who for some reason don't have the extension executed. You can obtain the checker for a specific firewall by appending the firewall name to it. For the firewall `secured_area`, this would be `security.user_checker.secured_area`.

Commits
-------

76bc662 [Security] Configuring a user checker per firewall
2015-10-02 14:49:38 +02:00
Iltar van der Berg
76bc662463 [Security] Configuring a user checker per firewall 2015-10-02 14:49:36 +02:00
Fabien Potencier
8879a5fa9a bug #16053 [Console] use PHP_OS instead of php_uname('s') (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] use PHP_OS instead of php_uname('s')

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

The php_uname() function may be disabled for security reasons.

Commits
-------

40e0dc8 use PHP_OS instead of php_uname('s')
2015-10-02 14:47:06 +02:00
Fabien Potencier
cddc6b9532 minor #16068 [PropertyInfo] Test behavior when an extractor returns null (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Test behavior when an extractor returns null

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

Add a test as suggested by @stof in https://github.com/symfony/symfony/pull/16064#issuecomment-144975004

Commits
-------

73ee226 [PropertyInfo] Test behavior when an extractor return null.
2015-10-02 14:45:01 +02:00
Fabien Potencier
f4a2752f9a Merge branch '2.7' into 2.8
* 2.7:
  [Yaml] Add regression test for comments indents
  Revert "bug #15860 [Yaml] Fix improper comments removal (ogizanagi)"
2015-10-02 14:38:01 +02:00
Fabien Potencier
34c8a7c51c Merge branch '2.3' into 2.7
* 2.3:
  [Yaml] Add regression test for comments indents
  Revert "bug #15860 [Yaml] Fix improper comments removal (ogizanagi)"
2015-10-02 14:36:41 +02:00
Fabien Potencier
351bccbffb minor #16074 [Yaml] Add regression test for comments indents (ogizanagi)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] Add regression test for comments indents

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

This is related to #16065, #15857 and #15860  (last one has been reverted due to this regression)

Commits
-------

7b9d519 [Yaml] Add regression test for comments indents
2015-10-02 14:33:33 +02:00
Fabien Potencier
a6d5c3305c minor #16073 Fix the DomCrawler tests (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix the DomCrawler tests

| Q             | A
| ------------- | ---
| 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 fixes the tests by applying changes from #16057 and #16058 in the right order in ``addNode``

Commits
-------

e6feed2 Fix the DomCrawler tests
2015-10-02 14:32:10 +02:00
maxime.steinhausser
7b9d519b0f [Yaml] Add regression test for comments indents 2015-10-02 14:20:54 +02:00
Christophe Coevoet
e6feed285a Fix the DomCrawler tests 2015-10-02 14:05:56 +02:00
Fabien Potencier
584cfc24a1 feature #16069 [WebProfilerBundle] Move AjaxCollector to HttpKernel for use with Silex (glaubinix, fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Move AjaxCollector to HttpKernel for use with Silex

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

This PR moves the AjaxDataCollector from the FrameworkBundle to the HttpKernel Component where most of the other DataCollectors are. This would allow applications which are not base on symfony/framework-bundle to use the collector. Like for instance applications based on silex or symfony components.

Commits
-------

3841f46 added missing a deprecated notice
c227806 Move AjaxCollector for use without framework bundle
2015-10-02 13:25:03 +02:00
Fabien Potencier
6413fb7743 feature #16063 [VarDumper] Add $this->getDump($var) when using VarDumperTestTrait (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Add $this->getDump($var) when using VarDumperTestTrait

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

So useful when writing/updating dump fixtures!

Commits
-------

aa1d578 [VarDumper] Add $this->getDump($var) when using VarDumperTestTrait
2015-10-02 12:42:43 +02:00
Fabien Potencier
9e60980f5a feature #16058 Prevent adding non-DOMElement elements in DomCrawler (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Prevent adding non-DOMElement elements in DomCrawler

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

Many methods of the DomCrawler component are relying on the DOMElement API, not only on the DOMNode API. All the typehints in the Form and Link APIs were already fixed in 2.5 because they are unusable with other kinds of nodes (fatal errors). However, the Crawler itself was not fixed. and this means that a bunch of its APIs can trigger fatal errors when passing other kinds of nodes.

Thus, there is a case where the code was allowing such nodes to be injected in the Crawler for some XPath queries. I fixed it to avoid it, adding the same kind of filtering than in other places.

Commits
-------

9f362a1 Prevent adding non-DOMElement elements in DomCrawler
2015-10-02 12:40:27 +02:00
Fabien Potencier
4af8a5545a feature #16057 Deprecate loading multiple documents in the same crawler (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

Deprecate loading multiple documents in the same crawler

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

Note that loading multiple documents in the same crawler already creates weird things when working with namespaces (the list of mapping of aliases to namespaces is shared between documents, which was flawed).

As said in the issue, this opens the door to optimizations in the future (sharing the DOMXpath instance for instance, including with subcrawler)

Commits
-------

0d1cb3b Deprecate loading multiple documents in the same crawler
2015-10-02 12:39:30 +02:00
Fabien Potencier
3841f4624d added missing a deprecated notice 2015-10-02 12:23:49 +02:00
Stephan Vock
c2278062b1 Move AjaxCollector for use without framework bundle 2015-10-02 12:20:34 +02:00
Kévin Dunglas
73ee226a1f [PropertyInfo] Test behavior when an extractor return null. 2015-10-02 12:16:37 +02:00
Fabien Potencier
510fdea599 Revert "bug #15860 [Yaml] Fix improper comments removal (ogizanagi)"
This reverts commit 150f52f3aa, reversing
changes made to 74af02a771.
2015-10-02 12:12:23 +02:00
Christophe Coevoet
0d1cb3bd1b Deprecate loading multiple documents in the same crawler 2015-10-02 10:46:05 +02:00
Nicolas Grekas
aa1d578c2c [VarDumper] Add $this->getDump($var) when using VarDumperTestTrait 2015-10-02 10:06:31 +02:00
Christophe Coevoet
9f362a12f6 Prevent adding non-DOMElement elements in DomCrawler
Many methods of the DomCrawler component are relying on the DOMElement
API, not only on the DOMNode API.
2015-10-02 10:01:39 +02:00
Nicolas Grekas
2ff0f97c60 Merge branch '2.7' into 2.8
* 2.7:
  [appveyor] Fix command line
  [Yaml] Fix improper comments removal inside strings
2015-10-02 08:55:39 +02:00
Nicolas Grekas
9b0fa548c1 Merge branch '2.3' into 2.7
* 2.3:
  [appveyor] Fix command line
  [Yaml] Fix improper comments removal inside strings
2015-10-02 08:55:14 +02:00
Nicolas Grekas
17edafd7e3 minor #16061 [appveyor] Fix command line (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[appveyor] Fix command line

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

Discovery the joy of cmd programming...

Commits
-------

bdcbde9 [appveyor] Fix command line
2015-10-02 08:53:52 +02:00
Nicolas Grekas
bdcbde91b9 [appveyor] Fix command line 2015-10-02 08:28:33 +02:00
Fabien Potencier
150f52f3aa bug #15860 [Yaml] Fix improper comments removal (ogizanagi)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] Fix improper comments removal

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

This tries to fix #15857 .

Honestly, I don't have any idea of the regressions it might introduce. Tests are passing, so if this code had any reason to exist, tests covering it are certainly missing :/

Any hint ?

Commits
-------

0e24fc5 [Yaml] Fix improper comments removal inside strings
2015-10-01 23:11:01 +02:00
Fabien Potencier
99745e12a7 feature #15742 Using a service as a router resource (weaverryan)
This PR was squashed before being merged into the 2.8 branch (closes #15742).

Discussion
----------

Using a service as a router resource

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

Hi guys!

This adds the ability to use a service as a routing resource. In other words, instead of loading `routing.yml`, you could load `my_route_loader`, and then a method would be called on your service to return a RouteCollection.

Specifically, I'm interested in this because it would allow a user to point their main router resource to the kernel itself, making it possible to load routes inside the kernel (making a single-file full-stack app more possible).

Thanks!

Commits
-------

79e210f Using a service as a router resource
2015-10-01 22:34:27 +02:00
Ryan Weaver
79e210f86c Using a service as a router resource 2015-10-01 22:34:24 +02:00
Fabien Potencier
54e3d71c03 feature #15778 Fluid interface for building routes in PHP (weaverryan)
This PR was squashed before being merged into the 2.8 branch (closes #15778).

Discussion
----------

Fluid interface for building routes in PHP

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

This - along with #15742 - attempts to making adding routes in PHP (via an actual class+method) not only possible, but also useful.

The two classes - `Route` and `RouteCollectionBuilder` are based off of Silex's `Controller` and `ControllerCollection`. The `RouteCollectionBuilder` is basically a `RouteCollection` that's able to import other resources. Here are the goals:

A) Import routes easily

```php
$routes->import('routing.yml');
```

B) Fluid addition of routes into the collection

```php
$routes->add('/admin', 'AppBundle:Admin:index', 'admin_index')
    ->setMethods(['GET']);
```

C) Ability to create routes with auto-generating names

D) Ability to add a "sub-collection" (kind of like an import, without pointing to another file). Included is the ability to set the controller class:

```php
$blogRoutes = $routes->createBuilder('/blog')
   ->setControllerClass('AppBundle\Controller\BlogController');
$blogRoutes->add('/', 'indexAction');
$blogRoutes->add('/{id}', 'editAction');
$routes->addBuilder($blogRoutes);
```

E) The collection options can be set before or after the routes. With `RouteCollection`, if you set something - e.g. a prefix or a default - and THEN add more routes, those options are not passed to those routes. This is by design, but not ideal for building routes (e.g. in the previous code example, the controllerClass would not be applied using the opposite logic, since it's set before adding the routes).

Thanks!

Commits
-------

15ba2e8 Fluid interface for building routes in PHP
2015-10-01 22:32:51 +02:00
Ryan Weaver
15ba2e87a4 Fluid interface for building routes in PHP 2015-10-01 22:32:48 +02:00
Fabien Potencier
238419fb5f minor #15983 Updated the styles of the container commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15983).

Discussion
----------

Updated the styles of the container commands

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

This PR uses comment() which hasn't been merged yet. WIP PR at #15964

This command defines a lot of options, so I don't know if I've updated all the possible outputs:

![container_params](https://cloud.githubusercontent.com/assets/73419/10148240/a4265ed4-6632-11e5-97c6-56d9d5fc496b.png)

![container_tags](https://cloud.githubusercontent.com/assets/73419/10148244/a68f392a-6632-11e5-925d-60eec7d659af.png)

![container_one_service](https://cloud.githubusercontent.com/assets/73419/10148224/8708c7b0-6632-11e5-9a4e-efd3c8206bc1.png)

![container_select_service](https://cloud.githubusercontent.com/assets/73419/10148225/88e88d9a-6632-11e5-969a-57a1f6efc17f.png)

![container_one_parameter](https://cloud.githubusercontent.com/assets/73419/10148227/8c92d342-6632-11e5-9d95-53bb71b6f67d.png)

![container_tagged_services](https://cloud.githubusercontent.com/assets/73419/10148229/9070a002-6632-11e5-8af9-e1d0579d539e.png)

Commits
-------

d209a4e Updated the styles of the container commands
2015-10-01 21:15:02 +02:00
Javier Eguiluz
d209a4ebac Updated the styles of the container commands 2015-10-01 21:14:59 +02:00
Fabien Potencier
02b99dbed4 minor #16052 [CssSelector] synchronize tests for static and non-static API (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[CssSelector] synchronize tests for static and non-static API

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

Synchronizing the classes ensures that no tests are lost when the legacy
API is removed in #16020 for Symfony 3.0, thus mitigating the risk of
future regressions.

Commits
-------

2b29a40 synchronize tests for static and non-static API
2015-10-01 21:11:23 +02:00
Tobias Schultze
311029b9a2 fix tests after twig commands style changes 2015-10-01 20:15:01 +02:00
Christian Flothmann
2b29a405be synchronize tests for static and non-static API
Synchronizing the classes ensures that no tests are lost when the legacy
API is removed in #16020 for Symfony 3.0, thus mitigating the risk of
future regressions.
2015-10-01 19:39:35 +02:00
Fabien Potencier
09ff9f851d bug #16051 [DomCrawler] fix deprecation triggers (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] fix deprecation triggers

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

On HHVM, the SplObjectStorage class performs calls to its method
internally. These method calls must not lead to triggered deprecation
notices.

Commits
-------

aca6bd9 [DomCrawler] fix deprecation triggers
2015-10-01 19:38:01 +02:00
Christian Flothmann
40e0dc8084 use PHP_OS instead of php_uname('s')
The php_uname() function may be disabled for security reasons.
2015-10-01 19:06:54 +02:00
Christian Flothmann
aca6bd9bd6 [DomCrawler] fix deprecation triggers
The SplObjectStorage class performs calls to its own methods. These
method calls must not lead to triggered deprecation notices.
2015-10-01 18:34:33 +02:00
Tobias Schultze
9f17026ba9 fix cs 2015-10-01 17:38:05 +02:00
Tobias Schultze
e7325b721e minor #15926 [2.8][Form] Deprecate alias tag option (WouterJ)
This PR was squashed before being merged into the 2.8 branch (closes #15926).

Discussion
----------

[2.8][Form] Deprecate alias tag option

FQCN should be used since 2.8 instead, so a deprecation error should be triggered when the `alias` setting is used.

Furthermore, the name of the option doesn't make much sense for form types (as it's the alias of the field it applies to), so I renamed it to `extended_type`. I'm open to any other suggestions.

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

Commits
-------

e3aa522 [2.8][Form] Deprecate alias tag option
2015-10-01 17:36:34 +02:00
WouterJ
e3aa5226e4 [2.8][Form] Deprecate alias tag option 2015-10-01 17:36:27 +02:00
Tobias Schultze
c434bbd5f3 Merge branch '2.7' into 2.8 2015-10-01 17:32:55 +02:00
Tobias Schultze
4b0e4c4ee0 Merge branch '2.3' into 2.7
Conflicts:
	src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php
2015-10-01 17:31:29 +02:00
Fabien Potencier
1309cfbe9d minor #15989 Updated the styles of the Twig commands (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes #15989).

Discussion
----------

Updated the styles of the Twig commands

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

![twig_1](https://cloud.githubusercontent.com/assets/73419/10158152/5d1668d2-6690-11e5-9399-8a9a89b4e919.png)

![twig_2](https://cloud.githubusercontent.com/assets/73419/10158156/60dbd470-6690-11e5-9a4e-1e702c961fa6.png)

![twig_3](https://cloud.githubusercontent.com/assets/73419/10158160/66030dba-6690-11e5-890f-09dd9579aa9a.png)

![twig_4](https://cloud.githubusercontent.com/assets/73419/10158172/71ed2ffc-6690-11e5-8c5c-8190c5e6c235.png)

Commits
-------

fdeccd5 Updated the styles of the Twig commands
2015-10-01 17:07:36 +02:00
Javier Eguiluz
fdeccd5849 Updated the styles of the Twig commands 2015-10-01 17:07:33 +02:00
Fabien Potencier
74af02a771 bug #16050 [TwigBundle] fix useless and failing test (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[TwigBundle] fix useless and failing test

| Q             | A
| ------------- | ---
| 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 test is failing in php 7, see https://travis-ci.org/symfony/symfony/jobs/83107755#L2015
But it also doesn't test anything. So it's useless in it's current form.

In 2.7 we have more tests that are actually useful. So the class is not untested.

Commits
-------

d94dd16 [TwigBundle] fix useless and failing test
2015-10-01 17:03:00 +02:00
Tobias Schultze
d94dd1679a [TwigBundle] fix useless and failing test 2015-10-01 16:53:49 +02:00