Commit Graph

27020 Commits

Author SHA1 Message Date
Fabien Potencier
e408b50c5a feature #19504 [Yaml] deprecate missing space after mapping key colon (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Yaml] deprecate missing space after mapping key colon

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

Commits
-------

9a31eef deprecate missing space after mapping key colon
2016-08-02 12:17:38 +02:00
Fabien Potencier
a0b22f03cb feature #19430 [DomCrawler] Add support for XPath expression evaluation (jakzal)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[DomCrawler] Add support for XPath expression evaluation

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

Example usage:

```php
<?php

use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\VarDumper\VarDumper;

require_once __DIR__.'/vendor/autoload.php';

$html = '<html>
<body>
    <span id="article-100" class="article">Article 1</span>
    <span id="article-101" class="article">Article 2</span>
    <span id="article-102" class="article">Article 3</span>
</body>
</html>';

$crawler = new Crawler();
$crawler->addHtmlContent($html);

VarDumper::dump($crawler->filterXPath('//span[contains(@id, "article-")]')->evaluate('substring-after(@id, "-")'));
// array:3 [
//   0 => "100"
//   1 => "101"
//   2 => "102"
// ]

VarDumper::dump($crawler->evaluate('substring-after(//span[contains(@id, "article-")]/@id, "-")'));
// array:1 [
//   0 => "100"
// ]

VarDumper::dump($crawler->filterXPath('//span[@class="article"]')->evaluate('count(@id)'));
// array:3 [
//   0 => 1.0
//   1 => 1.0
//   2 => 1.0
// ]

VarDumper::dump($crawler->evaluate('count(//span[@class="article"])'));
// array:1 [
//   0 => 3.0
// ]

VarDumper::dump($crawler->evaluate('//span[1]'));
// Symfony\Component\DomCrawler\Crawler { }
```

Commits
-------

3148fad [DomCrawler] Add support for XPath expression evaluation
2016-08-02 12:15:39 +02:00
Christian Flothmann
9a31eeff56 deprecate missing space after mapping key colon 2016-08-02 09:47:02 +02:00
Fabien Potencier
983b560e15 feature #19205 [HttpKernel] Allow bundles to declare classes and annotated classes to compile using patterns (tgalopin)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[HttpKernel] Allow bundles to declare classes and annotated classes to compile using patterns

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

This PR introduces a simple system of patterns based on wildcards for classes to cache in the HttpKernel dependency injections extensions. This system started to be implemented in https://github.com/symfony/symfony/pull/18533 but I split it up here to use it also in the classes to compile.

Commits
-------

1be7424 [HttpKernel] Allow usage of patterns in classes and annotations to cache
2016-07-30 03:40:44 -04:00
Fabien Potencier
35b0ab9527 feature #18533 [FrameworkBundle] Wire PhpArrayAdapter with a new cache warmer for annotations (tgalopin)
This PR was squashed before being merged into the 3.2-dev branch (closes #18533).

Discussion
----------

[FrameworkBundle] Wire PhpArrayAdapter with a new cache warmer for annotations

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

Depends on https://github.com/symfony/symfony/pull/18825 and https://github.com/symfony/symfony/pull/18823

This PR implements the usage of the new OpCacheAdapter in the annotations caching system. The idea to use this adapter as much as possible in Symfony (validator, serializer, ...). These other implementations will be the object of different PRs.

Commits
-------

f950a2b [FrameworkBundle] Wire PhpArrayAdapter with a new cache warmer for annotations
2016-07-30 03:40:02 -04:00
Titouan Galopin
f950a2bcde [FrameworkBundle] Wire PhpArrayAdapter with a new cache warmer for annotations 2016-07-30 03:40:00 -04:00
Fabien Potencier
f76d050dd4 feature #17498 [Filesystem] Add a cross-platform readlink method (tgalopin)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Filesystem] Add a cross-platform readlink method

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

`readlink()` and `realpath()` have a completely different behavior under Windows and Unix:

- `realpath()` resolves recursively the children links of a link until a final target is found on Unix and resolves only the next link on Windows ;
- `readlink()` resolves recursively the children links of a link until a final target is found on Windows and resolves only the next link on Unix ;

I propose to solve this by implementing a helper method in the Filesystem component that would behave always the same way under all platforms.

Commits
-------

c36507e [Filesystem] Add a cross-platform readlink/realpath methods for nested links
2016-07-30 03:29:52 -04:00
Fabien Potencier
851a0a11d0 Merge branch '3.1'
* 3.1:
  Minor fixes
  [Cache] Fix abstract AdapterTestCase cache property
  [Console] Overcomplete argument exception message tweak.
  fixed bad auto merge
  Console table cleanup
  undefined offset fix (#19406)
  [EventDispatcher] Removed unused variable
2016-07-30 03:26:43 -04:00
Fabien Potencier
273eb480f8 Merge branch '3.0' into 3.1
* 3.0:
  Minor fixes
  [Console] Overcomplete argument exception message tweak.
  fixed bad auto merge
  Console table cleanup
  undefined offset fix (#19406)
  [EventDispatcher] Removed unused variable
2016-07-30 03:24:41 -04:00
Fabien Potencier
ca71e7489f Merge branch '2.8' into 3.0
* 2.8:
  Minor fixes
  [Console] Overcomplete argument exception message tweak.
  fixed bad auto merge
  Console table cleanup
  undefined offset fix (#19406)
  [EventDispatcher] Removed unused variable
2016-07-30 03:22:48 -04:00
Fabien Potencier
ec1808f0cb Merge branch '2.7' into 2.8
* 2.7:
  Minor fixes
  [Console] Overcomplete argument exception message tweak.
2016-07-30 03:20:35 -04:00
Fabien Potencier
2075d310b7 minor #19466 Minor fixes (zomberg)
This PR was squashed before being merged into the 2.7 branch (closes #19466).

Discussion
----------

Minor fixes

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

774c984 Minor fixes
2016-07-30 03:17:27 -04:00
Vyacheslav Pavlov
774c984863 Minor fixes 2016-07-30 03:17:26 -04:00
Titouan Galopin
c36507e64f [Filesystem] Add a cross-platform readlink/realpath methods for nested links 2016-07-29 17:37:06 +02:00
Nicolas Grekas
b1fb82d6db minor #19474 [Cache] Fix abstract AdapterTestCase cache property (tgalopin)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #19474).

Discussion
----------

[Cache] Fix abstract AdapterTestCase cache property

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | Sort of
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

The `AdapterTestCase` extends the `CachePoolTest` from the [cache/integration-tests package](https://packagist.org/packages/cache/integration-tests) in order to test cache pools but it tries to reuse a private variable from its parent class.

As there is no need to use a property in this case, I simply replace the variable by a local one.

Commits
-------

348b335 [Cache] Fix abstract AdapterTestCase cache property
2016-07-29 13:16:37 +02:00
Titouan Galopin
348b335197 [Cache] Fix abstract AdapterTestCase cache property 2016-07-29 13:16:37 +02:00
Fabien Potencier
ad85c79d3d minor #19275 [Console][FrameworkBundle] Revised console header formatting (ro0NL)
This PR was squashed before being merged into the 3.2-dev branch (closes #19275).

Discussion
----------

[Console][FrameworkBundle] Revised console header formatting

| Q             | A
| ------------- | ---
| Branch?       | "master"
| Bug fix?      | no
| New feature?  | yes (ui change)
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not yet
| Fixed tickets | #19095
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

Before/After
![image](https://cloud.githubusercontent.com/assets/1047696/16983804/e36c95e0-4e76-11e6-854d-dfa22c634b39.png)

Commits
-------

fcddb3a [Console][FrameworkBundle] Revised console header formatting
2016-07-29 05:54:40 -04:00
Roland Franssen
fcddb3a9c9 [Console][FrameworkBundle] Revised console header formatting 2016-07-29 05:54:38 -04:00
Fabien Potencier
bdfc2aa652 minor #19446 [Console] Overcomplete argument exception message tweak. (SpacePossum)
This PR was squashed before being merged into the 2.7 branch (closes #19446).

Discussion
----------

[Console] Overcomplete argument exception message tweak.

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

Updates the exception message when to many arguments are passed.
From;
```php
'Too many arguments.'
```
To:
```php
'No argument expected, got "foo".'
// or
'Too many arguments, expected arguments "foo".'
// or
'Too many arguments, expected arguments "foo, bar".'
// ... turtles all the way down
```

Commits
-------

7af59cd [Console] Overcomplete argument exception message tweak.
2016-07-28 13:56:28 -04:00
SpacePossum
7af59cdf86 [Console] Overcomplete argument exception message tweak. 2016-07-28 13:56:22 -04:00
Fabien Potencier
6404e8e033 fixed bad auto merge 2016-07-28 12:58:23 -04:00
Fabien Potencier
998fbd015e minor #19406 Console table cleanup (ReenExe)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #19406).

Discussion
----------

Console table cleanup

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

Commits
-------

217274b Console table cleanup
2016-07-28 12:57:43 -04:00
ReenExe
217274b3c1 Console table cleanup 2016-07-28 12:57:42 -04:00
Fabien Potencier
77b5fc4c4b Merge branch '2.7' into 2.8
* 2.7:
  undefined offset fix (#19406)
  [EventDispatcher] Removed unused variable
2016-07-28 12:56:28 -04:00
Fabien Potencier
382ad65372 bug #19470 undefined offset fix (#19406) (ReenExe)
This PR was squashed before being merged into the 2.7 branch (closes #19470).

Discussion
----------

undefined offset fix (#19406)

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

9813888 undefined offset fix (#19406)
2016-07-28 12:53:57 -04:00
ReenExe
9813888a4f undefined offset fix (#19406) 2016-07-28 12:53:55 -04:00
Nicolas Grekas
ec3a4ede27 minor #19464 [Cache] Use AdapterTestCase for new adapters (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Cache] Use AdapterTestCase for new adapters

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

Commits
-------

cbc1e54 [Cache] Use AdapterTestCase for new adapters
2016-07-28 14:16:00 +02:00
Nicolas Grekas
cbc1e54dd0 [Cache] Use AdapterTestCase for new adapters 2016-07-28 14:15:19 +02:00
Nicolas Grekas
b6bbe43b4b Merge branch '3.1'
* 3.1:
  [TwigBundle] Removed redundant return statement.
  enable property info
  [Cache] Fix default lifetime being ignored
  [DependencyInjection] Fixed deprecated default message template with XML
  Reference the actual location of the documentation
  [TwigBridge] Removed extra arguments in 2 places.
  [Cache] Fix incorrect timestamps generated by FilesystemAdapter
  [Process] Fix write access check for pipes on Windows
  [HttpKernel] Use flock() for HttpCache's lock files

Conflicts:
	src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php
2016-07-28 13:15:50 +02:00
Nicolas Grekas
75ebbf826c Merge branch '3.0' into 3.1
* 3.0:
  [TwigBundle] Removed redundant return statement.
  [DependencyInjection] Fixed deprecated default message template with XML
  [TwigBridge] Removed extra arguments in 2 places.
  [Process] Fix write access check for pipes on Windows
  [HttpKernel] Use flock() for HttpCache's lock files
2016-07-28 13:13:48 +02:00
Nicolas Grekas
1d5f391c89 Merge branch '2.8' into 3.0
* 2.8:
  [TwigBundle] Removed redundant return statement.
  [DependencyInjection] Fixed deprecated default message template with XML
  [TwigBridge] Removed extra arguments in 2 places.
  [Process] Fix write access check for pipes on Windows
  [HttpKernel] Use flock() for HttpCache's lock files
2016-07-28 13:13:34 +02:00
Nicolas Grekas
3a78921b38 Merge branch '2.7' into 2.8
* 2.7:
  [TwigBundle] Removed redundant return statement.
  [TwigBridge] Removed extra arguments in 2 places.
  [Process] Fix write access check for pipes on Windows
  [HttpKernel] Use flock() for HttpCache's lock files
2016-07-28 13:13:19 +02:00
Christophe Coevoet
42ea173247 minor #19459 [EventDispatcher] Removed unused variable (zomberg)
This PR was merged into the 2.7 branch.

Discussion
----------

[EventDispatcher] Removed unused variable

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

891e2ea [EventDispatcher] Removed unused variable
2016-07-28 13:09:20 +02:00
Titouan Galopin
1be7424316 [HttpKernel] Allow usage of patterns in classes and annotations to cache 2016-07-28 10:12:03 +02:00
Vyacheslav Pavlov
891e2ea17b [EventDispatcher] Removed unused variable 2016-07-28 10:50:15 +03:00
Nicolas Grekas
c7fa99e41f feature #19289 [VarDumper] Dumping exceptions is now more compact (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[VarDumper] Dumping exceptions is now more compact

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

Before:
![before](https://cloud.githubusercontent.com/assets/243674/16578686/2c7285b0-429c-11e6-9139-293e0c899d43.png)

Commits
-------

19e9cbe [VarDumper] Dumping exceptions is now more compact
2016-07-28 09:26:33 +02:00
Nicolas Grekas
a8a9923260 bug #19300 [HttpKernel] Use flock() for HttpCache's lock files (mpdude)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Use flock() for HttpCache's lock files

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #16777, #15813 and #16312 are also related
| License       | MIT
| Doc PR        |

When a PHP process crashes or terminates (maybe the OOM killer kicks in or other bad things ™️ happen) while the `HttpCache` holds a `.lck` file, that lock file may not get `unlink()`ed.

The result is that other requests trying to access this cache entry will see a few seconds delay while waiting for the lock; they will eventually continue but send 503 status codes along with the response. The sudden buildup of PHP processes caused by the additional delay may cause further problems (sudden load increase).

As `LockHandler` is using `flock()`-based locking, locks should be released by the OS when the PHP process terminates.

I wrote this as bugfix against 2.7 because every once in a while I encounter situations (not always reproducible) where `.lock` files are left over and keep the cache locked.

Commits
-------

2668edd [HttpKernel] Use flock() for HttpCache's lock files
2016-07-28 09:16:08 +02:00
Nicolas Grekas
19e9cbecbe [VarDumper] Dumping exceptions is now more compact 2016-07-28 09:09:25 +02:00
Nicolas Grekas
f9ba34f871 bug #19428 [Process] Fix write access check for pipes on Windows (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Process] Fix write access check for pipes on Windows

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

Commits
-------

66e694e [Process] Fix write access check for pipes on Windows
2016-07-28 08:53:02 +02:00
Nicolas Grekas
aaff0d1da3 bug #19442 [Cache] Fix default lifetime being ignored (nicolas-grekas)
This PR was merged into the 3.1 branch.

Discussion
----------

[Cache] Fix default lifetime being ignored

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

Courtesy of @ecanovas

Commits
-------

35ba478 [Cache] Fix default lifetime being ignored
2016-07-28 08:49:58 +02:00
Fabien Potencier
76dbd3c66c minor #19451 [TwigBundle] Removed redundant return statement. (zomberg)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Removed redundant return statement.

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

7f3145c [TwigBundle] Removed redundant return statement.
2016-07-27 23:07:26 -04:00
Vyacheslav Pavlov
7f3145c606 [TwigBundle] Removed redundant return statement. 2016-07-27 23:41:42 +03:00
Nicolas Grekas
26dfa2f879 bug #19435 [Cache] Fix incorrect timestamps generated by FilesystemAdapter (nicolas-grekas)
This PR was merged into the 3.1 branch.

Discussion
----------

[Cache] Fix incorrect timestamps generated by FilesystemAdapter

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

Commits
-------

bd2e795 [Cache] Fix incorrect timestamps generated by FilesystemAdapter
2016-07-27 16:06:17 +02:00
Nicolas Grekas
3a57de19cd bug #19434 [Serializer] enable property info in framework bundle (David Badura)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #19434).

Discussion
----------

[Serializer] enable property info in framework bundle

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

I've been wondering why the datetime normalizer won't work in combination with object normalizer in symfony 3.1 by default. I also found nothing in the documentation. Only http://symfony.com/blog/new-in-symfony-3-1-datetime-normalizer but here is not described how to use it with the object normalizer and how to configure the config.yml.

After debugging i found out that the object normalizer don't use the new property info component. With my change, you can enabled it with following config:

```yml
    serializer:
         enabled: true
    property_info: ~
```

Should i add analog to `enable_annotation` an `enable_property_info` option?

```yml
    serializer:
         enabled: true
         enable_property_info: true
    property_info: ~
```

Commits
-------

c02933d enable property info
2016-07-27 10:27:32 +02:00
David Badura
c02933dba3 enable property info 2016-07-27 10:27:32 +02:00
Nicolas Grekas
90e95a605f minor #19438 Reference the actual location of the documentation (greg0ire)
This PR was merged into the 3.1 branch.

Discussion
----------

Reference the actual location of the documentation

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

The old link was giving a 404

Commits
-------

98dc69e Reference the actual location of the documentation
2016-07-27 10:23:35 +02:00
Nicolas Grekas
35ba478680 [Cache] Fix default lifetime being ignored 2016-07-27 10:15:52 +02:00
Christophe Coevoet
db3f5544d9 bug #19439 [DependencyInjection] Fixed deprecated default message template with XML (jeremyFreeAgent)
This PR was merged into the 2.8 branch.

Discussion
----------

[DependencyInjection] Fixed deprecated default message template with XML

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

Commits
-------

165529b [DependencyInjection] Fixed deprecated default message template with XML
2016-07-27 09:15:16 +02:00
Jérémy Romey
165529bb55 [DependencyInjection] Fixed deprecated default message template with XML 2016-07-26 18:50:32 +02:00
Grégoire Paris
98dc69eb10
Reference the actual location of the documentation 2016-07-26 17:33:44 +02:00