Commit Graph

22368 Commits

Author SHA1 Message Date
Ryan Weaver
6edb9e1b06 Tweaking docblock on interface thanks to @iltar 2015-09-20 19:24:21 -04:00
Ryan Weaver
d6937218be Adding periods at the end of exceptions, and changing one class name to LogicException thanks to @iltar 2015-09-20 19:24:21 -04:00
Ryan Weaver
eb158cbdb3 Updating interface method per suggestion - makes sense to me, Request is redundant 2015-09-20 19:24:21 -04:00
Ryan Weaver
c73c32e674 Thanks fabbot! 2015-09-20 19:24:21 -04:00
Ryan Weaver
6c180c78da Adding an edge case - this should not happen anyways 2015-09-20 19:24:21 -04:00
Ryan Weaver
180e2c7878 Properly handles "post auth" tokens that have become not authenticated
Here is the flow:

A) You login using guard and are given a PostAuthGuardToken
B) Your user changes between requests - AbstractToken::setUser() and hasUserChanged() - which
    results in the Token becoming "not authenticated"
C) Something calls out to the security system, which then passes the no-longer-authed
    token back into the AuthenticationProviderManager
D) Because the PostauthGuardToken implements GuardTokenInterface, the provider responds
    to it. But, seeing that this is a no-longer-authed PostAuthGuardToken, it returns
    an AnonymousToken, which triggers logout
2015-09-20 19:24:21 -04:00
Ryan Weaver
873ed284d2 Renaming the tokens to be clear they are "post" and "pre" auth - also adding an interface
The reason is that the GuardAuthenticationProvider *must* respond to *all* tokens
created by the system - both "pre auth" and "post auth" tokens. The reason is that
if a "post auth" token becomes not authenticated (e.g. because the user changes between
requests), then it may be passed to the provider system. If no providers respond (which
was the case before this commit), then AuthenticationProviderManager throws an exception.

The next commit will properly handle these "post auth" + "no-longer-authenticated" tokens,
which should cause a log out.
2015-09-20 19:24:20 -04:00
Ryan Weaver
a0bceb43c9 adding Guard tests 2015-09-20 19:24:20 -04:00
Ryan Weaver
05af97c7f7 Initial commit (but after some polished work) of the new Guard authentication system 2015-09-20 19:24:20 -04:00
Ryan Weaver
330aa7f729 Improving phpdoc on AuthenticationEntryPointInterface so people that implement this understand it 2015-09-20 19:24:20 -04:00
Tobias Schultze
0ad587aec3 minor #15847 [DomCrawler] Optimize the regex used to find namespace prefixes (stof)
This PR was merged into the 2.7 branch.

Discussion
----------

[DomCrawler] Optimize the regex used to find namespace prefixes

| 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

I ran Blackfire on the [Mink BrowserKitDriver](https://github.com/minkphp/MinkBrowserKitDriver) testsuite (which is a realistic usage of the Mink API btw, as the driver testsuite is basically a functional test of a fixtures website, where failures are considered to be caused by the driver misbehaving).
I discovered that 17% of the time was spent in ``preg_match_all`` to look for prefixes in the XPath namespace prefixes (Mink does not use any namespace prefix in its Xpath queries).

This optimizes the regex to use a possessive quantifier. This avoids useless backtracking when matching (due to the way the regex is written, backtracking cannot allow finding more matches here). See https://blackfire.io/profiles/compare/21aaebf3-e38f-456a-8fc9-cf7d9e2a35eb/graph for the improvement.
The optimization is applied in the 2.7 branch, because this regex does not exist in 2.3: the registration of namespaces was added in 2.4

Commits
-------

02818e4 [DomCrawler] Optimize the regex used to find namespace prefixes
2015-09-21 00:21:34 +02:00
Nicolas Grekas
549f43b03a [Console] Add clock mock to fix transient test on HHVM 2015-09-20 23:33:09 +02:00
Christophe Coevoet
02818e4c92 [DomCrawler] Optimize the regex used to find namespace prefixes 2015-09-20 23:13:58 +02:00
Nicolas Grekas
aa50596345 [VarDumper] Add EnumStub for dumping virtual collections with casters 2015-09-20 23:07:38 +02:00
Nicolas Grekas
b1e0bd76c4 Merge branch '2.7' into 2.8
* 2.7:
  [Console] Fix whitespaces in fixture
2015-09-19 22:42:44 +02:00
Nicolas Grekas
f64cf23811 Merge branch '2.3' into 2.7
* 2.3:
  [Console] Fix whitespaces in fixture

Conflicts:
	src/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt
	src/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt
2015-09-19 22:42:33 +02:00
Nicolas Grekas
da29357d49 [Console] Fix whitespaces in fixture 2015-09-19 22:40:41 +02:00
Nicolas Grekas
f5d6034311 Merge branch '2.7' into 2.8
* 2.7:
  Remove whitespaces between <input> and <label>
  [travis] Remove PHP 7 from allowed failures
  [Finder] Optimize the hot-path
  Update Process.php
2015-09-19 21:59:50 +02:00
Nicolas Grekas
1ba6cfee48 Merge branch '2.3' into 2.7
* 2.3:
  [travis] Remove PHP 7 from allowed failures
  [Finder] Optimize the hot-path
  Update Process.php

Conflicts:
	composer.json
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php
2015-09-19 21:59:23 +02:00
Tobias Schultze
bcb2ff600d minor #15832 [Translation][File dumper] allow new child classes to implement only formatCatalogue (aitboudad)
This PR was merged into the 2.8 branch.

Discussion
----------

[Translation][File dumper] allow new child classes to implement only formatCatalogue

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

Commits
-------

5fd9f2f [Translation][File dumper] allow new child classes to implement only formatCatalogue.
2015-09-18 22:35:55 +02:00
Fabien Potencier
72f3fe1470 minor #15836 [Form] fixed something: Remove whitespaces between <input> and <label> (ThomasLandauer)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #15836).

Discussion
----------

[Form] fixed something: Remove whitespaces between <input> and <label>

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

Reason: With the whitespaces, there would be a "gap" between `<input>` and `<label>` which is clickable, but doesn't activate the `<input>`.

It's easy to *add* some margin with CSS, whereas it's impossible to *remove* whitespaces with CSS.

Commits
-------

1b97c17 Remove whitespaces between <input> and <label>
2015-09-18 20:31:45 +02:00
Thomas Landauer
1b97c17c30 Remove whitespaces between <input> and <label>
Reason: With the whitespaces, there would be a "gap" between <input> and <label> which is clickable, but doesn't activate the <input>.

It's easy to *add* some margin with CSS, whereas it's impossible to *remove* whitespaces with CSS.
2015-09-18 20:31:45 +02:00
Fabien Potencier
2e5e601343 minor #15833 [Translation] Clean whitespaces and EOL in xliff-core-2.0.xsd (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[Translation] Clean whitespaces and EOL in xliff-core-2.0.xsd

| 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/15833/files?w=1

Commits
-------

630f3b3 [Translation] Clean whitespaces and EOL in xliff-core-2.0.xsd
2015-09-18 20:26:34 +02:00
Abdellatif Ait boudad
5fd9f2f33f [Translation][File dumper] allow new child classes to implement only formatCatalogue. 2015-09-18 14:52:26 +00:00
Tobias Schultze
c4bb79a794 minor #15817 [Process] Stopped Autoruns when shelling on windows (rquadling)
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Stopped Autoruns when shelling on windows

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

Stop autoruns when shelling on Windows.

Original PR was on https://github.com/symfony/Process/pull/9#issuecomment-140721398.

Commits
-------

bca6771 Update Process.php
2015-09-18 15:09:04 +02:00
Tobias Schultze
b783e40422 minor #15831 [travis] Remove PHP 7 from allowed failures (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[travis] Remove PHP 7 from allowed failures

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

Looking at the latests PRs, PHP 7 does not segfault anymore with our test suite.

Commits
-------

ba8366e [travis] Remove PHP 7 from allowed failures
2015-09-18 15:05:57 +02:00
Nicolas Grekas
ba8366e208 [travis] Remove PHP 7 from allowed failures 2015-09-18 14:36:19 +02:00
Nicolas Grekas
630f3b30a3 [Translation] Clean whitespaces and EOL in xliff-core-2.0.xsd 2015-09-18 13:01:00 +02:00
Fabien Potencier
4e7644c597 bug #15826 [Finder] Optimize the hot-path (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[Finder] Optimize the hot-path

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

A significant part of the perf gain in #15802 was related to filters not being applied recursively...
#15824 fixing this, performance dropped again.

This PR optimizes the hot path by replacing a regexp test by a simple `isset` when possible.
Blackfire diff after #15824 is the following:
https://blackfire.io/profiles/compare/9e489018-998d-4acb-92a0-46011828e83b/graph

`preg_match` is not called anymore, and  `Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current()` is also cut by two.

When this `isset` optimization is disabled and replaced by a concatenation of all the regexps patterns in a single bigger one, the gain is still significant but lower:
https://blackfire.io/profiles/compare/db86b80e-b63e-4fc9-9ff3-9ed32baeb948/graph

This makes me think that an other and last round of optimization is possible by merging all regexps in one in MultiplePcreFilterIterator filters. If someone wants to work on this, please do it :)

Commits
-------

f156de6 [Finder] Optimize the hot-path
2015-09-18 12:01:26 +02:00
Nicolas Grekas
f156de6b71 [Finder] Optimize the hot-path 2015-09-18 11:35:50 +02:00
Nicolas Grekas
c08cf4b7f6 [Finder] Deprecate adapters and related classes 2015-09-18 11:02:33 +02:00
Nicolas Grekas
4d275b42da Merge branch '2.7' into 2.8
* 2.7:
  [Finder] Fix recursive filter iterator
  Improve the structure of the Finder testsuite
  [VarDumper] Fix HtmlDumper constructor calling CliDumper's
  [Finder] Handle filtering of recursive iterators and use it to skip looping over excluded directories
  Exclude files based on path before applying the sorting
  fixed composer.json
  [Console] fix phpdoc of DialogHelper
  Allowed extensions to inline compiler passes
2015-09-18 09:20:16 +02:00
Nicolas Grekas
666f523984 Merge branch '2.3' into 2.7
* 2.3:
  [Finder] Fix recursive filter iterator
  Improve the structure of the Finder testsuite

Conflicts:
	src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php
	src/Symfony/Component/Finder/Tests/FinderTest.php
	src/Symfony/Component/Finder/Tests/Iterator/DateRangeFilterIteratorTest.php
2015-09-18 09:19:55 +02:00
Alexander Schwenn
b5599a5897 [Form] Fix php warning on invalid FormFactory::createBuilder() argument 2015-09-17 23:09:48 +02:00
Abdellatif Ait boudad
327c647be5 feature #15699 [Translator][FileDumper] deprecated format method in favor of formatCatalogue. (aitboudad)
This PR was merged into the 2.8 branch.

Discussion
----------

[Translator][FileDumper] deprecated format method in favor of formatCatalogue.

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

We introduced `formatCatalogue` to allow using options passed to the dump method.

Commits
-------

366879b [Translator][FileDumper] deprecated format method in favor of formatCatalogue.
2015-09-17 17:05:31 +00:00
Nicolas Grekas
89d75af805 bug #15804 [VarDumper] Fix HtmlDumper constructor calling CliDumper's (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix HtmlDumper constructor calling CliDumper's

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/var-dumper/pull/2#issuecomment-140338205
| License       | MIT
| Doc PR        | -

Commits
-------

4c7bb9c [VarDumper] Fix HtmlDumper constructor calling CliDumper's
2015-09-17 14:16:46 +02:00
Nicolas Grekas
4a9676b5a2 minor #15824 [Finder] Fix recursive filter iterator (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[Finder] Fix recursive filter iterator

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

#15802 was broken because the filters where not propagated to children iterators. This fixes the issue and adds a test case for this situation. The RecursiveIterator implementation is moved from FilterIterator to ExcludeDirectoryFilterIterator. Doing so on other filters is possible but would be a new feature that is not required for fixing the performance issue we had previously.

Commits
-------

cf3019b [Finder] Fix recursive filter iterator
2015-09-17 14:15:24 +02:00
Nicolas Grekas
cf3019bc5a [Finder] Fix recursive filter iterator 2015-09-17 10:48:13 +02:00
Martin Hasoň
184d4f2df0 [WebProfilerBundle] Added collapsed sidebar on small screens 2015-09-17 10:17:00 +02:00
Tobias Schultze
a7b7f5479e [EventDispatcher] skip one lazy loading call 2015-09-17 03:42:05 +02:00
Tobias Schultze
ec59953f4c [EventDispatcher] fix memory leak in a getListeners 2015-09-17 03:14:14 +02:00
Abdellatif Ait boudad
366879ba83 [Translator][FileDumper] deprecated format method in favor of formatCatalogue. 2015-09-16 14:54:16 +00:00
Abdellatif Ait boudad
7b358a144a feature #15717 [Translator][Loader] added XLIFF 2.0 support. (xphere, aitboudad)
This PR was merged into the 2.8 branch.

Discussion
----------

[Translator][Loader] added XLIFF 2.0 support.

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

Commits
-------

0c24d55 [Translation][Dumper] added XLIFF 2.0 support.
7af4fc7 [XLIFF 2.0] added support for target attributes.
ace6042 apply some fixes.
ce540ae update changelog.
ff5d6a3 [Translation][Loader] added XLIFF 2.0 support.
2015-09-16 14:51:54 +00:00
Richard Quadling
bca67712d0 Update Process.php
Stop autoruns when shelling on Windows.

Original PR was on https://github.com/symfony/Process/pull/9#issuecomment-140721398.
2015-09-16 14:19:29 +01:00
Abdellatif Ait boudad
ac7591f505 [WebProfilerBundle] added btn-link. 2015-09-16 12:52:37 +00:00
Fabien Potencier
f3b6ffc85a minor #15812 [WebProfilerBundle] bug #15811 use of twig deprecated sameas test (ctrl-f5)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] bug #15811 use of twig deprecated sameas test

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

Commits
-------

534c5db bug #15811 use of twig deprecated sameas test
2015-09-16 13:14:26 +02:00
Nicky De Maeyer
534c5db3a3 bug #15811 use of twig deprecated sameas test 2015-09-16 11:31:47 +02:00
Fabien Potencier
4f9a411389 minor #15808 Improve the structure of the Finder testsuite (stof)
This PR was merged into the 2.3 branch.

Discussion
----------

Improve the structure of the Finder testsuite

| 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

Testing against different adapters is now handled by multiple subclasses of a common test case rather than using data providers. This allows tests to be marked as skipped for unsupported adapters instead of making them disappear from the testsuite.
This will also make it much easier to mark tests for the find-based adapters as legacy ones when deprecating them.
This correspond to changes done by @nicolas-grekas in https://github.com/symfony/symfony/pull/15805, backported to 2.3 and with the data providers removed (his PR was keeping data providers for the adapter but making it return a single adapter all the time, hence the much bigger diff in my PR).
All tests in AbstractFinderTest are just moved from the FinderTest (they are all the tests running against multiple adapters). FinderTest itself runs the PhpAdapter (as this is the logic we want to keep in the finder in 3.0). I also tried to have a PhpFinderTest and keeping FinderTest only with the extra tests, but this would make things harder to merge branches between 2.8 and 3.0 in the future (once we remove other adapter tests) as we could simply keep the AbstractFinderTest in 3.0 for now to ease merging PRs adding new tests for bug fixes.

Commits
-------

20f2d03 Improve the structure of the Finder testsuite
2015-09-16 11:14:30 +02:00
Christophe Coevoet
20f2d03d2e Improve the structure of the Finder testsuite
Testing against different adapters is now handled by multiple subclasses
of a common test case rather than using data providers. This allows
tests to be marked as skipped for unsupported adapters instead of making
them disappear from the testsuite.
2015-09-16 09:54:32 +02:00
Tobias Schultze
0a5807bf47 minor #15809 Remove minimum width for web profiler content view (jbafford)
This PR was merged into the 2.8 branch.

Discussion
----------

Remove minimum width for web profiler content view

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

This removes the min-width on the Web Profiler's content view, to allow for narrower browser windows to render all content without a horizontal scroll bar. I've checked all of the profiler pages, and none of them seem adversely affected by this. (In some cases, certain content winds up being taller because there's less horizontal space, but that's entirely expected and reasonable).

Commits
-------

62dc014 Remove minimum width for web profiler content view
2015-09-16 01:59:41 +02:00