Commit Graph

18336 Commits

Author SHA1 Message Date
Fabien Potencier
ea6ce1c8af fixed typo 2014-09-23 16:20:22 +02:00
Fabien Potencier
aa594450d2 feature #11716 [OptionsResolver] Added a light-weight, low-level API for basic option resolving (webmozart)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[OptionsResolver] Added a light-weight, low-level API for basic option resolving

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11705
| License       | MIT
| Doc PR        | symfony/symfony-docs#4159

See [the updated documentation](https://github.com/webmozart/symfony-docs/blob/issue11705/components/options_resolver.rst) for details on the usage of the simple API.

The most important motivation for this change is DX and speed. The basic features of the component should be easily usable in a wide variety of use cases without impacting performance.

For DX reasons, I added the static methods to the `Options` class, which makes the code concise and easy to read and understand:

```php
use Symfony\Component\OptionsResolver\Options;

$options = Options::validateRequired($options, 'format');

$options = Options::validateTypes($options, array(
    'format' => array('string', 'int'),
    'calendar' => 'int',
));

$options = Options::validateValues($options, array(
    'calendar' => array(
        \IntlDateFormatter::GREGORIAN,
        \IntlDateFormatter::TRADITIONAL,
    ),
));

$options = Options::resolve($options, array(
    'format' => null,
    'calendar' => \IntlDateFormatter::GREGORIAN,
));
```

If you need to distribute the option configuration, this PR also extracts the configuration part of the `OptionsResolver` class into a new class `OptionsConfig`, which can be passed around. When the configuration is complete, pass the config object to `Options::resolve()` as second argument:

```php
$config = new OptionsConfig();

$config->setDefaults(array(
    'format' => \IntlDateFormatter::MEDIUM,
    'calendar' => \IntlDateFormatter::GREGORIAN,
));

$options = Options::resolve($options, $config);
```

Consequently - since `OptionsResolver` extends `OptionsConfig` - the two following statements now become identical:

```php
$options = $resolver->resolve($options);
$options = Options::resolve($options, $resolver);
```

Commits
-------

9066025 [OptionsResolver] Added a light-weight, low-level API for basic option resolving
2014-09-23 12:46:07 +02:00
Fabien Potencier
cc63edbfa8 minor #11994 [Form] Changed "allow_html5" to "html5" (webmozart)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Form] Changed "allow_html5" to "html5"

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

This is a follow-up to #8291, which I missed before it was merged. IMO "allow_html5" is a confusing name. We don't "allow" HTML5, but we use it - or we don't. I think "html5" conveys that meaning well and is shorter at the same time.

Commits
-------

ad171be [Form] Changed "allow_html5" to "html5"
2014-09-23 12:31:32 +02:00
Bernhard Schussek
ad171be6e9 [Form] Changed "allow_html5" to "html5" 2014-09-23 12:15:17 +02:00
Fabien Potencier
0050b8d458 feature #10698 [Security] Added a REMOTE_USER based listener to security firewalls (Maxime Douailin)
This PR was squashed before being merged into the 2.6-dev branch (closes #10698).

Discussion
----------

[Security] Added a REMOTE_USER based listener to security firewalls

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | /
| License       | MIT
| Doc PR        | symfony/symfony-docs#3912
TODO
- [x] submit changes to the documentation

I've seen myself implementing a few times a REMOTE_USER based authentication listener, as a large part of security modules for Apache (Kerberos, CAS, and more) are providing the username via an environment variable.

So I thought this could benefit the whole community if directly included in the framework. It is very similar to the X509AuthenticationListener, and basing the RemoteUserAuthenticationListener on the AbstractPreAuthenticatedListener is relevant and very convenient.

Using the X509AuthenticationListener could be possible, but it is confusing to use it directly when your authentication is not certificate based.

Please let me know if I need to update anything.

Regards

Commits
-------

a2872f2 [Security] Added a REMOTE_USER based listener to security firewalls
2014-09-23 11:54:13 +02:00
Maxime Douailin
a2872f21b9 [Security] Added a REMOTE_USER based listener to security firewalls 2014-09-23 11:54:11 +02:00
Fabien Potencier
1fb8f8817a feature #11183 [Security] add an AbstractVoter implementation (Inoryy)
This PR was squashed before being merged into the 2.6-dev branch (closes #11183).

Discussion
----------

[Security] add an AbstractVoter implementation

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/4257

The idea is to reduce boilerplate required to create custom Voter, doing most of the work for the developer and guiding him on the path by providing simple requirements via abstract methods that will be called by the AbstractVoter.

P.S. This is meant to be a [DX Initiative](https://github.com/symfony/symfony/issues?labels=DX&state=open) improvement.

Commits
-------

d3bafc6 [Security] add an AbstractVoter implementation
2014-09-23 11:51:23 +02:00
Roman Marintšenko
d3bafc6b48 [Security] add an AbstractVoter implementation 2014-09-23 11:51:18 +02:00
Fabien Potencier
56a7a60f52 minor #11992 [Console][Command][LogicException] The command name cannot be empty. #11991 (skafandri)
This PR was submitted for the 2.5 branch but it was merged into the 2.6-dev branch instead (closes #11992).

Discussion
----------

[Console][Command][LogicException] The command name cannot be empty. #11991

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

Commits
-------

7d6fbd9 [Console][Command][LogicException] The command name cannot be empty. #11991
2014-09-23 11:01:06 +02:00
skafandri
7d6fbd99a2 [Console][Command][LogicException] The command name cannot be empty. #11991 2014-09-23 11:01:06 +02:00
Fabien Potencier
d059b1edae fixed CS 2014-09-23 08:31:13 +02:00
Fabien Potencier
0da03cf98b feature #8291 [Form] Add allow_html5 option to date and time FormType to disable HTML5 input type (csanquer)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Form] Add allow_html5 option to date and time FormType to disable HTML5 input type

[Form] added allow_html5 option to date and time FormType to disable HTML5 input type when widget is set to single_text

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

With this little patch we can have a single text widget without HTML5 date input type which is required when using some javascript date or time picker .

Commits
-------

392d6c7 add allow_html5 option to date and time FormType to disable HTML5 date input when widget is set to single_text
2014-09-23 08:30:39 +02:00
Fabien Potencier
8ac12257f3 fixed CS 2014-09-23 08:15:49 +02:00
Fabien Potencier
8e8488092f feature #11815 Added some methods to improve the handling of auto_mapping feature (goetas)
This PR was squashed before being merged into the 2.6-dev branch (closes #11815).

Discussion
----------

Added some methods to improve the handling of auto_mapping feature

| Q             | A
| ------------- | ---
| Bug fix?      |no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?  | yes
| Fixed tickets | https://github.com/doctrine/DoctrineBundle/issues/60
| License       | MIT

This PR is a part that is required by:
* https://github.com/doctrine/DoctrineMongoDBBundle/pull/267
* https://github.com/doctrine/DoctrineBundle/pull/321

The proposed PRs are an alternative to https://github.com/symfony/symfony/pull/11650 and https://github.com/doctrine/DoctrineBundle/pull/322

Commits
-------

2e30a43 Added some methods to improve the handling of auto_mapping feature
2014-09-23 08:15:19 +02:00
Asmir Mustafic
2e30a431d0 Added some methods to improve the handling of auto_mapping feature 2014-09-23 08:15:16 +02:00
Fabien Potencier
ef399b1071 fixed some unit tests 2014-09-23 07:29:08 +02:00
Fabien Potencier
7096c8d769 Merge branch '2.5'
* 2.5:
  typo fixed in AbstractProcessTest (getoutput() => getOutput())
  Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
  [Translation] [Config] Clear libxml errors after parsing XML file
  check for the Validator if forms are enabled
  Clear json_last_error
  Fix JsonSerializable namespace
  Catch exceptions to restore the error handler
  [HttpFoundation] Silent only JSON errors
2014-09-23 07:25:18 +02:00
Fabien Potencier
1c254a4f09 Merge branch '2.4' into 2.5
* 2.4:
  typo fixed in AbstractProcessTest (getoutput() => getOutput())
  Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
  [Translation] [Config] Clear libxml errors after parsing XML file
2014-09-23 07:25:11 +02:00
Fabien Potencier
924d06adf6 Merge branch '2.3' into 2.4
* 2.3:
  typo fixed in AbstractProcessTest (getoutput() => getOutput())
  Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
  [Translation] [Config] Clear libxml errors after parsing XML file

Conflicts:
	src/Symfony/Component/Config/Util/XmlUtils.php
2014-09-23 07:24:59 +02:00
Fabien Potencier
e47e4fa56d bug #11989 [Finder][Urgent] Remove asterisk and question mark from folder name in test to prevent windows file system issues. (Adam)
This PR was merged into the 2.3 branch.

Discussion
----------

[Finder][Urgent] Remove asterisk and question mark from folder name in test to prevent windows file system issues.

Bugfix: Yes
Fixed tickets: #11984 , #11985
Related tickets: #11970

Commit #11970 prevented Symphony from being checked out via windows due to invalid characters in a folder name within the tests.

The issue was reported in #11984  and was attempted to be fixed in #11985 but wasn't due to still including the question mark.

Please accept this ASAP as it entirely breaks any composer that relies on it.

Commits
-------

5fbb278 Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
2014-09-23 07:24:00 +02:00
Fabien Potencier
3a67de274b minor #11986 typo fixed in AbstractProcessTest (getoutput() => getOutput()) (YevKov)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11986).

Discussion
----------

typo fixed in AbstractProcessTest (getoutput() => getOutput())

Commits
-------

36998bb typo fixed in AbstractProcessTest (getoutput() => getOutput())
2014-09-23 07:16:08 +02:00
Yevgen Kovalienia
36998bb629 typo fixed in AbstractProcessTest (getoutput() => getOutput()) 2014-09-23 07:16:08 +02:00
Fabien Potencier
3a3fb05cdf bug #11908 [Translation] [Config] Clear libxml errors after parsing xliff file (pulzarraider)
This PR was merged into the 2.3 branch.

Discussion
----------

[Translation] [Config] Clear libxml errors after parsing xliff file

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

If libxml_use_internal_errors is set to `true` before parsing xliff file, the libxml errors are not cleared correctly. An error `Validation failed: no DTD found !` occurs in libxml errors after parsing and it's available outside the xliff parser (can break other functionality that use `libxml_get_errors` function).

Commits
-------

fab61ef [Translation] [Config] Clear libxml errors after parsing XML file
2014-09-23 07:15:05 +02:00
Adam
5fbb278b7a Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
A previous commit introduced a folder with a question mark and an asterisk which are invalid NTFS folder name characters and prevented checkout on those systems.
2014-09-23 03:52:24 +00:00
Andrej Hudec
fab61effaf [Translation] [Config] Clear libxml errors after parsing XML file 2014-09-22 20:11:23 +02:00
Fabien Potencier
33b30a839f bug #11839 [FrameworkBundle] check if the Validator component is present when forms are enabled (xabbuh)
This PR was merged into the 2.5 branch.

Discussion
----------

[FrameworkBundle] check if the Validator component is present when forms are enabled

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

The `Symfony\Component\Validator\Validation` class is used in the
`FrameworkExtension` class. Therefore, it is required to have the
Validator component installed in production as well but not only when
being in a development environment.

Commits
-------

ed41da1 check for the Validator if forms are enabled
2014-09-22 18:56:03 +02:00
Christian Flothmann
ed41da1c9c check for the Validator if forms are enabled
When the Form component is enabled, the container extension class
automatically enables the Validator component which therefore has to
be enabled. The container extension now throws an exception when forms
are enabled, but the Validator component is not present.
2014-09-22 18:53:46 +02:00
Fabien Potencier
9752a7600a feature #11078 [WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig (clemens-tolboom)
This PR was squashed before being merged into the 2.6-dev branch (closes #11078).

Discussion
----------

[WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig

| Q             | A
| ------------- | ---
| Bug fix?      | I guess this is a bug
| New feature?  | The exception structure changes for the default
| BC breaks?    | The exception structure changes for the default
| Deprecations? | [yes|no]
| Tests pass?   | [yes|no]
| Fixed tickets |
| License       | MIT
| Doc PR        |

The result for `error.json.twig` and `exception.json.twig` differ making the client forced to check for it's result.

We think the structure should be the same to make the ie a javascript client try to respond similar for --env=dev|prod

Commits
-------

4a59f98 [WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig
2014-09-22 18:01:06 +02:00
Clemens Tolboom
4a59f989a9 [WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig 2014-09-22 18:01:04 +02:00
Fabien Potencier
6a435cd28e bug #11418 [JsonResponse] Silent only JSON errors (GromNaN)
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #11418).

Discussion
----------

[JsonResponse] Silent only JSON errors

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

Commits
-------

6d6a3af Clear json_last_error
ef91f71 Fix JsonSerializable namespace
d952f90 Catch exceptions to restore the error handler
ddf95c7 [HttpFoundation] Silent only JSON errors
2014-09-22 17:58:59 +02:00
Jérôme Tamarelle
6d6a3af4ff Clear json_last_error 2014-09-22 17:58:58 +02:00
Jerome TAMARELLE
ef91f710e3 Fix JsonSerializable namespace 2014-09-22 17:58:58 +02:00
Jerome TAMARELLE
d952f9049e Catch exceptions to restore the error handler 2014-09-22 17:58:58 +02:00
Jerome TAMARELLE
ddf95c7adc [HttpFoundation] Silent only JSON errors 2014-09-22 17:58:58 +02:00
Fabien Potencier
e5e6f4d86d feature #11857 [Filesystem] Check number of bytes copied. (skigun)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Filesystem] Check number of bytes copied.

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

This only test local files (because of `filesize`), wonder if we should include the remote files using `get_headers` in order to get the Content-length for example. However, it will perform an additional request...

Here's a little benchmark for 500 copy from a remote origin file :
- Standard without check -> Time: 47.34 seconds, Memory: 3.75Mb
- Check with `get_headers` ->Time: 1.32 minutes, Memory: 3.75Mb

Commits
-------

81eca38 [Filesystem] Check number of bytes copied.
2014-09-22 17:54:44 +02:00
Fabien Potencier
a1f8d99a7e fixed CS 2014-09-22 17:52:38 +02:00
Fabien Potencier
2a9a342591 feature #11858 [DependencyInjection] Added exception to avoid fatal during compile in a frozen dumped container (ClementGautier)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[DependencyInjection] Added exception to avoid fatal during compile in a frozen dumped container

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

Commits
-------

2356eaa [DependencyInjection] Added exception to avoid fatal during compile in a frozen dumped container
2014-09-22 17:51:56 +02:00
Fabien Potencier
2104813ca2 Merge branch '2.5'
* 2.5:
  [2.3] Add missing development dependencies
  Fix @return docs on HttpCache::restoreResponseBody()
  [Finder] Escape location for regex searches
  Make sure HttpCache is a trusted proxy

Conflicts:
	src/Symfony/Component/Form/composer.json
2014-09-22 17:29:07 +02:00
Fabien Potencier
4fa670bfae Merge branch '2.4' into 2.5
* 2.4:
  [2.3] Add missing development dependencies
  Fix @return docs on HttpCache::restoreResponseBody()
  [Finder] Escape location for regex searches
  Make sure HttpCache is a trusted proxy
2014-09-22 17:28:36 +02:00
Fabien Potencier
8efff1b464 Merge branch '2.3' into 2.4
* 2.3:
  [2.3] Add missing development dependencies
  Fix @return docs on HttpCache::restoreResponseBody()
  [Finder] Escape location for regex searches
  Make sure HttpCache is a trusted proxy

Conflicts:
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Component/Form/composer.json
2014-09-22 17:28:09 +02:00
Fabien Potencier
4ac8adde5d minor #11340 [2.3] Add missing development dependencies (romainneutron)
This PR was squashed before being merged into the 2.3 branch (closes #11340).

Discussion
----------

[2.3] Add missing development dependencies

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

I've also added a run of the test suite in every component scope.

Commits
-------

3b02af9 [2.3] Add missing development dependencies
2014-09-22 17:12:11 +02:00
Romain Neutron
3b02af9f79 [2.3] Add missing development dependencies 2014-09-22 17:11:59 +02:00
Fabien Potencier
995da74f35 feature #11312 Make assets:install smarter with symlinks (Roy Van Ginneken)
This PR was squashed before being merged into the 2.6-dev branch (closes #11312).

Discussion
----------

Make assets:install smarter with symlinks

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

Commits
-------

6537333 Make assets:install smarter with symlinks
2014-09-22 15:51:42 +02:00
Roy Van Ginneken
6537333647 Make assets:install smarter with symlinks 2014-09-22 15:51:40 +02:00
Fabien Potencier
0811b29b63 feature #11852 [Console] add overwrite flag to ProgressBar helper to allow non-decorated output (kbond)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Console] add overwrite flag to ProgressBar helper to allow non-decorated output

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes, but not critical
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11542, #10011
| License       | MIT
| Doc PR        | symfony/symfony-docs#4206

By default, the `ProgressBar` helper overwrites the output to give the nice progress bar look.  To prevent the output from blowing up in non-decorated environments, the output was hidden in these environments (see #9846).

This PR enables using the `ProgressBar` in non-decorated environments by adding an `overwrite` flag.  When `false`, instead of overwriting the bar, it is rendered on a new line.  To prevent flooding the output, you can adjust the `redrawFrequency`.

By default, when using the `ProgressBar` in a non-decorated environment, the `overwrite` flag is set to false.  If a `max` is set, the `redrawFrequency` is set to a sensible default (10% of the max).  If a `max` isn't set, the bar is output for every advance so to prevent flooding, a sensible `redrawFrequency` should be manually set.

The only BC break is that output will now display where it didn't before.

Commits
-------

cdee6f6 add overwrite flag to allow non-decorated output
2014-09-22 15:46:08 +02:00
Fabien Potencier
902efb8a84 bug #11937 [HttpKernel] Make sure HttpCache is a trusted proxy (thewilkybarkid)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Make sure HttpCache is a trusted proxy

| Q             | A
| ------------- | ---
| Bug fix?      | yes (of sorts)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9292
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/4239

Fixes #9292 by adding `127.0.0.1` as a trusted proxy when using `HttpCache` (assuming it hasn't been already).

Commits
-------

ca65362 Make sure HttpCache is a trusted proxy
2014-09-22 15:44:41 +02:00
Fabien Potencier
74cc625df1 minor #11980 [FrameworkBundle] Added link on server:* commands (lyrixx)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] Added link on server:* commands

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

Commits
-------

ce62ccf [FrameworkBundle] Added link on server:* commands
2014-09-22 15:30:00 +02:00
Grégoire Pineau
ce62ccfcdd [FrameworkBundle] Added link on server:* commands 2014-09-22 15:27:18 +02:00
Fabien Potencier
13139d759c minor #11981 Fix @return docs on HttpCache::restoreResponseBody() (znerol)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11981).

Discussion
----------

Fix @return docs on HttpCache::restoreResponseBody()

Commits
-------

37dc57b Fix @return docs on HttpCache::restoreResponseBody()
2014-09-22 15:25:53 +02:00
znerol
37dc57bda2 Fix @return docs on HttpCache::restoreResponseBody() 2014-09-22 15:25:52 +02:00