Commit Graph

26125 Commits

Author SHA1 Message Date
Nicolas Grekas
d1038c3421 bug #18596 [DI] Fix internal caching in AutowirePass (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[DI] Fix internal caching in AutowirePass

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

ping @dunglas

Commits
-------

ed2e236 [DI] Fix internal caching in AutowirePass
2016-04-20 13:30:10 +02:00
Nicolas Grekas
7fd5a02fa1 feature #18597 [Cache] Add CacheItem::validateKey utility method (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Add CacheItem::validateKey utility method

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

Ping @dunglas

Commits
-------

af09cde [Cache] Add CacheItem::validateKey utility method
2016-04-20 11:44:29 +02:00
Nicolas Grekas
af09cdef49 [Cache] Add CacheItem::validateKey utility method 2016-04-20 11:19:01 +02:00
Nicolas Grekas
ed2e2360bc [DI] Fix internal caching in AutowirePass 2016-04-20 08:44:03 +02:00
Fabien Potencier
2f0b8f8f3f bug #18581 [Console] [TableHelper] make it work with SymfonyStyle. (aitboudad)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] [TableHelper] make it work with SymfonyStyle.

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

Commits
-------

43cc93c [Console] [TableHelper] make it work with SymfonyStyle.
2016-04-20 08:32:07 +02:00
Fabien Potencier
8e67eab202 fixed CS 2016-04-20 08:30:26 +02:00
Fabien Potencier
1253700e01 bug #18589 [Serializer] fix parent class of AbstractNormalizer (xabbuh)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Serializer] fix parent class of AbstractNormalizer

| 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/17545#discussion_r58012336
| License       | MIT
| Doc PR        |

We must maintain the parent class to not break BC.

Commits
-------

45b9ed9 fix parent class of AbstractNormalizer
2016-04-20 08:29:49 +02:00
Shawn Iwinski
e249bc3cae [Security] Normalize "symfony/security-acl" dependency versions across all composer.json files 2016-04-19 14:38:18 -04:00
Nicolas Grekas
812bf5c45d [VarDumper] Fix dumping type hints for non-existing parent classes 2016-04-19 19:25:26 +02:00
Kévin Dunglas
114fca3126 feature #17660 [Serializer] Integrate the PropertyInfo Component (recursive denormalization and hardening) (mihai-stancu, dunglas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

	[Serializer] Integrate the PropertyInfo Component (recursive denormalization and hardening)

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16143, #17193, #14844
| License       | MIT
| Doc PR        | todo

Integrates the PropertyInfo Component in order to:

* denormalize a graph of objects recursively (see tests)
* harden the hydratation logic

The hardening part is interesting. Considering the following example:

```php
class Foo
{
    public function setDate(\DateTimeInterface $date)
    {
    }
}

// initialize $normalizer
$normalizer->denormalize(['date' => 1234], Foo::class);
```

Previously, a PHP error was thrown because the type passed to the setter (an int) doesn't match the one checked with the typehint. With the PropertyInfo integration, an `UnexpectedValueExcption` is throw instead.
It's especially interesting for web APIs dealing with JSON documents. For instance in API Platform, previously a 500 error was thrown, but thanks to this fix a 400 HTTP code with a descriptive error message will be returned. (/cc @csarrazi @mRoca @blazarecki, it's an alternative to https://github.com/dunglas/php-to-json-schema for protecting an API).

/cc @mihai-stancu

Commits
-------

5194482 [Serializer] Integrate the PropertyInfo Component
6b464b0 Recursive denormalize using PropertyInfo
2016-04-19 17:18:49 +02:00
Kévin Dunglas
5194482ed5 [Serializer] Integrate the PropertyInfo Component
Recursive denormalization handling and hardening.
2016-04-19 17:00:22 +02:00
Nicolas Grekas
51d075a51b feature #18561 [FrameworkBundle] Fallback to default cache system in production for serializer (tgalopin)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Fallback to default cache system in production for serializer

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

In the same idea as https://github.com/symfony/symfony/pull/18544, this PR proposes a default fallback to filesystem cache for the serializer if the APC cache is not enabled in production. In other words, if the following part of `config_prod.yml` file is not uncommented, the filesystem will be used:

``` yaml
#framework:
#    serializer:
#        cache: serializer.mapping.cache.doctrine.apc
```

Commits
-------

4f0b8be [FrameworkBundle] Fallback to default cache system in production for serializer
2016-04-19 16:23:32 +02:00
Nicolas Grekas
44e3664ac9 minor #18585 [PropertyInfo] Remove useless return statement (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Remove useless return statement

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| 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
-------

9093bd5 [PropertyInfo] Remove useless return statement
2016-04-19 16:06:07 +02:00
Nicolas Grekas
852592d030 minor #18588 [Serializer] Add deprecation notices (theofidry)
This PR was squashed before being merged into the 3.1-dev branch (closes #18588).

Discussion
----------

[Serializer] Add deprecation notices

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

As discussed in #18583, add deprecation notices to `master` instead.

Commits
-------

d3063ed [Serializer] Add deprecation notices
2016-04-19 16:04:41 +02:00
Théo FIDRY
d3063ed288 [Serializer] Add deprecation notices 2016-04-19 16:04:22 +02:00
Nicolas Grekas
2729c88e7e minor #18590 [FrameworkBundle] update argument value resolver pass tests (xabbuh)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] update argument value resolver pass tests

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

Make sure to have at least one assertion per test.

Commits
-------

b8afa30 update argument value resolver pass tests
2016-04-19 16:02:12 +02:00
Nicolas Grekas
d74a4dbdaa feature #18567 [FrameworkBundle][Serializer] Fix APC cache service name (tgalopin)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle][Serializer] Fix APC cache service name

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

In the commit 008055659c, we introduced in the standard edition the usage of `serializer.mapping.cache.doctrine.apc` instead of `serializer.mapping.cache.apc` in `config_prod.yml` comments.

Earlier, we introduced the validator equivalent modification (`validator.mapping.cache.doctrine.apc` instead of `validator.mapping.cache.apc`) but while we adapted the validator configuration in the FrameworkBundle in https://github.com/symfony/symfony/pull/16822, we did not adapt the FrameworkBundle configuration for the serializer.

I tested the current master of symfony-standard and it's indeed failing:

```
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "serializer" has a dependency on a non-existent service "serializer.mapping.cache.doctrine.apc".
```

This PR renames the serializer APCu cache service name to fix this issue. However, I'm not sure when the validator cache service modification was merged and released so I'm not sure how this PR should handle this. Is this a bug? Or is this a new feature and we should trigger a depreciation but keep the service `serializer.mapping.cache.apc` usable?

Commits
-------

88ef89c [FrameworkBundle][Serializer] Fix APC cache service name and deprecate old name
2016-04-19 16:00:57 +02:00
Christophe Coevoet
40b4cb2c4a minor #18591 [Config] Fix XmlUtilsTest namespace (JhonnyL)
This PR was merged into the 2.3 branch.

Discussion
----------

[Config] Fix XmlUtilsTest namespace

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

Commits
-------

58425eb [Config] Fix XmlUtilsTest namespace
2016-04-19 15:42:43 +02:00
jhonnyL
58425eb44c [Config] Fix XmlUtilsTest namespace 2016-04-19 13:29:13 +00:00
Abdellatif Ait boudad
43cc93c7e8 [Console] [TableHelper] make it work with SymfonyStyle. 2016-04-19 12:28:43 +01:00
Christian Flothmann
45b9ed95fe fix parent class of AbstractNormalizer
We must maintain the parent class to not break BC.
2016-04-19 13:00:54 +02:00
Christian Flothmann
b8afa30831 update argument value resolver pass tests
Make sure to have at least one assertion per test.
2016-04-19 12:57:28 +02:00
Fabien Potencier
c848f88c72 minor #18584 [Serializer] Remove dead code (theofidry)
This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] Remove dead code

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

The deleted lines are the exact equivalent of L249-251. It looks like this is due from a bad merged when the (de)normalization cache has been removed.

Commits
-------

31c530a Remove dead code
2016-04-19 10:49:24 +02:00
Titouan Galopin
88ef89c8dc [FrameworkBundle][Serializer] Fix APC cache service name and deprecate old name 2016-04-19 08:52:34 +02:00
Kévin Dunglas
9093bd5d83 [PropertyInfo] Remove useless return statement 2016-04-18 22:49:43 +02:00
Mihai Stancu
6b464b01aa Recursive denormalize using PropertyInfo
- Refactored PR 14844 "Denormalize with typehinting"
- Now using PropertyInfo to extract type information
- Updated tests
- Updated composer.json
2016-04-18 21:22:06 +02:00
Théo FIDRY
31c530ae4a
Remove dead code 2016-04-18 20:15:00 +01:00
Kévin Dunglas
3a165e551d feature #17959 [Serializer] Harden the ObjectNormalizer (dunglas)
This PR was squashed before being merged into the 3.1-dev branch (closes #17959).

Discussion
----------

[Serializer] Harden the ObjectNormalizer

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

Transform `\TypeError`s to catchable serializer exceptions.

Follows #17738 and completes #17660.

Commits
-------

26a07fb [Serializer] Harden the ObjectNormalizer
2016-04-18 19:37:57 +02:00
Kévin Dunglas
26a07fb2ab [Serializer] Harden the ObjectNormalizer 2016-04-18 19:37:45 +02:00
Nicolas Grekas
2824db3da8 feature #18547 DX: better error message if factory class is empty (dbu)
This PR was merged into the 3.1-dev branch.

Discussion
----------

DX: better error message if factory class is empty

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

i was trying to debug this service configuration:

```xml
        <service id="repository.user" class="Doctrine\ORM\EntityRepository">
            <argument>%user_entity_class%</argument>
            <factory id="doctrine.orm.default_entity_manager" method="getRepository"/>
        </service>
```

Turns out i should have used `<factory service=...` instead of `<factory id=...` but the error message does not even tell which service is wrong. The same happens when only specifying the `method=` attribute. The current exception message tells:

    Cannot dump definition because of invalid class name ('')

With this change, the message at least tells the context, hopefully helping the developer debug the issue:

    Empty class for factory of service repository.user and no factory service specified

Commits
-------

0999326 better error message if factory class is empty
2016-04-18 14:53:30 +02:00
Nicolas Grekas
8aec0bba0d minor #18576 [Cache] Fix test tearDown (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Fix test tearDown

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

Commits
-------

9ca22e9 [Cache] Fix test tearDown
2016-04-18 14:52:26 +02:00
Nicolas Grekas
9ca22e9805 [Cache] Fix test tearDown 2016-04-18 13:57:20 +02:00
David Buchmann
09993265c2 better error message if factory class is empty 2016-04-18 11:26:57 +02:00
Iltar van der Berg
e54c1a648c Fixed a redundant check in DefaultValueResolver 2016-04-18 09:44:09 +02:00
Nicolas Grekas
39df9e4f8b CS fixes 2016-04-17 18:02:30 +02:00
Nicolas Grekas
95afc677b6 bug #18571 [Cache] Minor tweaks (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Minor tweaks

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/php-cache/integration-tests/pull/51
| License       | MIT
| Doc PR        | -

Commits
-------

9dcbe34 [Cache] Minor tweaks
2016-04-17 16:50:41 +02:00
Nicolas Grekas
9dcbe3403c [Cache] Minor tweaks 2016-04-17 13:51:09 +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
Titouan Galopin
4f0b8beea6 [FrameworkBundle] Fallback to default cache system in production for serializer 2016-04-15 22:43:35 +02:00
jhonnyL
313d8b1684 [FrameworkBundle] Better output for user in ContainerDebugCommand 2016-04-15 11:28:00 +00:00
Fabien Potencier
47cb0c3ec1 feature #18020 fix #17993 - Deprecated callable strings (hamza)
This PR was merged into the 3.1-dev branch.

Discussion
----------

fix #17993 - Deprecated callable strings

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

Is this ok ?

- [x] Rebase when  #18057 is merged

Commits
-------

191b495 fix #17993 - Deprecated callable strings
2016-04-15 12:08:13 +02:00
Fabien Potencier
2528ec48cc bug #18280 [Routing] add query param if value is different from default (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[Routing] add query param if value is different from default

| Q             | A
| ------------- | ---
| Branch?       | 2.3
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | most likely not
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #10940, #18111, #18035
| License       | MIT
| Doc PR        | -

Commits
-------

1ef2edf [Routing] add query param if value is different from default
2016-04-15 11:53:50 +02:00
Fabien Potencier
cea9d862cc minor #18498 [FrameworkBundle] Use SymfonyStyle in AbstractConfigCommand (JhonnyL)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Use SymfonyStyle in AbstractConfigCommand

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

Before:
![screen shot 2016-04-10 at 18 12 56](https://cloud.githubusercontent.com/assets/1104667/14411548/ab040a32-ff4b-11e5-878d-7e6acb257750.png)
After:
![screen shot 2016-04-10 at 18 11 57](https://cloud.githubusercontent.com/assets/1104667/14411553/be16e022-ff4b-11e5-838e-5fa2ad46133b.png)

Commits
-------

30b44a8 [FrameworkBundle] Use SymfonyStyle in AbstractConfigCommand
2016-04-15 11:33:33 +02:00
Fabien Potencier
529d0fe230 feature #18487 [Cache] Add DoctrineProvider, for using PSR-6 pools in Doctrine Cache (nicolas-grekas)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Add DoctrineProvider, for using PSR-6 pools in Doctrine Cache

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

This would allow cache pool configuration as usual (see #17290) before injecting the resulting doctrine cache provider anywhere such an interface is required.

Commits
-------

5d256dd [Cache] Add DoctrineProvider, for using PSR-6 pools in Doctrine Cache
2016-04-15 11:27:30 +02:00
Fabien Potencier
e4177a716e feature #18544 [FrameworkBundle] Fallback to default cache system in production for validation (tgalopin)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle] Fallback to default cache system in production for validation

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

This PR proposes a default fallback to filesystem cache for some services if the APC cache is not enabled in production. In other words, if the following part of `config_prod.yml` file is not uncommented, the filesystem will be used:

``` yaml
#framework:
#    validation:
#        cache: validator.mapping.cache.doctrine.apc
#    serializer:
#        cache: serializer.mapping.cache.doctrine.apc
#
# ... other services
```

Commits
-------

1a65595 [FrameworkBundle] Fallback to default cache system in production for validation
2016-04-15 11:26:35 +02:00
Fabien Potencier
5356dbb7ee bug #18540 Replace iconv_*() uses by mb_*(), add mbstring polyfill when required (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

Replace iconv_*() uses by mb_*(), add mbstring polyfill when required

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

Looks like `iconv_*()` functions can be really slow (see #18539).

Commits
-------

27f5f81 Replace iconv_*() uses by mb_*(), add mbstring polyfill when required
2016-04-15 11:20:55 +02:00
Fabien Potencier
8d6670bf80 minor #18529 [HttpKernel] Renamed the argument resolver tag (iltar)
This PR was merged into the 3.1-dev branch.

Discussion
----------

[HttpKernel] Renamed the argument resolver tag

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

Changed as discussed several times: https://github.com/symfony/symfony/pull/18510#issuecomment-208778875, https://github.com/symfony/symfony-docs/pull/6422#issuecomment-208453616.

Commits
-------

cd10057 Renamed argument resolver tag, added test
2016-04-15 11:05:59 +02:00
Iltar van der Berg
cd100575d4 Renamed argument resolver tag, added test 2016-04-15 09:47:59 +02:00
hamza
191b4954c0 fix #17993 - Deprecated callable strings
ext
2016-04-15 07:55:48 +02:00
jhonnyL
9f2f858f55 [FrameworkBundle] Remove misleading comment 2016-04-14 20:06:25 +00:00