Commit Graph

17703 Commits

Author SHA1 Message Date
Fabien Potencier
d38a4b3414 Merge branch '2.5'
* 2.5:
  fixed previous merge
  Added missing `break` statement
  don't disable constructor calls to mockups of classes that extend internal PHP classes
  Small comment update according to PSR-2
  [Yaml] fix overwriting of keys after merged map
  [Yaml] fix priority of sequence merges according to spec
  [Console] Fixed notice in QuestionHelper
  [Console] Fixed notice in DialogHelper
  [Yaml] refactoring of merges for performance
  [Console] remove weird use statement
  [HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6
  [Filesystem] Fix test suite on OSX
  [FrameworkBundle] Redirect server output to /dev/null in case no verbosity is needed
  Add framework-bundle

Conflicts:
	src/Symfony/Component/Yaml/Parser.php
2014-06-20 19:41:51 +02:00
Fabien Potencier
76d3c9e185 Merge branch '2.4' into 2.5
* 2.4:
  fixed previous merge
  Added missing `break` statement
  don't disable constructor calls to mockups of classes that extend internal PHP classes
  Small comment update according to PSR-2
  [Console] Fixed notice in DialogHelper
  [HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6
  [Filesystem] Fix test suite on OSX
  Add framework-bundle

Conflicts:
	src/Symfony/Bundle/TwigBundle/composer.json
2014-06-20 19:38:20 +02:00
Fabien Potencier
f2bdc22b0d fixed previous merge 2014-06-20 19:37:57 +02:00
Fabien Potencier
b387477d51 Merge branch '2.3' into 2.4
* 2.3:
  Added missing `break` statement
  don't disable constructor calls to mockups of classes that extend internal PHP classes
  Small comment update according to PSR-2
  [Console] Fixed notice in DialogHelper
  [HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6
  [Filesystem] Fix test suite on OSX
  Add framework-bundle

Conflicts:
	src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
2014-06-20 19:36:47 +02:00
Fabien Potencier
eeeae94196 minor #11187 [Tests] don't disable constructor calls to mockups of classes that extend intern... (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Tests] don't disable constructor calls to mockups of classes that extend intern...

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

Fixes the tests for the 2.3 branch as reported by @stof in #11176.

Commits
-------

2c726b8 don't disable constructor calls to mockups of classes that extend internal PHP classes
2014-06-20 19:32:59 +02:00
Fabien Potencier
ff00dcce7d bug #11186 Added missing break statement (apfelbox)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11186).

Discussion
----------

Added missing `break` statement

Added a missing `break` statement in `AbstractFindAdapter` - a fall-through doesn't seem to be intended here.

Commits
-------

5af2802 Added missing `break` statement
2014-06-20 18:06:34 +02:00
Jannik Zschiesche
5af2802661 Added missing break statement
Added missing `break` statement in `AbstractFindAdapter` - a fall through doesn't seem to be intended here.
2014-06-20 18:06:33 +02:00
Christian Flothmann
2c726b8988 don't disable constructor calls to mockups of classes that extend internal PHP classes 2014-06-20 17:17:50 +02:00
Fabien Potencier
96bc061109 minor #11182 Small comment update according to PSR-2 (apfelbox)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11182).

Discussion
----------

Small comment update according to PSR-2

See [PSR-2](http://www.php-fig.org/psr/psr-2/) paragraph 5.2

> There MUST be a comment such as `// no break` when fall-through is intentional in a non-empty case body.

Related to #11181

Commits
-------

31b1dff Small comment update according to PSR-2
2014-06-20 16:22:59 +02:00
Jannik Zschiesche
31b1dff875 Small comment update according to PSR-2
See [PSR-2](http://www.php-fig.org/psr/psr-2/) paragraph 5.2

> There MUST be a comment such as `// no break` when fall-through is intentional in a non-empty case body.

Related to #11181
2014-06-20 16:22:59 +02:00
Fabien Potencier
a50aca04e4 bug #11168 [YAML] fix merge node (<<) (Tobion)
This PR was merged into the 2.5 branch.

Discussion
----------

[YAML] fix merge node (<<)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes but according to spec
| Deprecations? | no
| Tests pass?   | yes
| Needs merge to | 2.5
| Fixed tickets | #11142 and #11154
| License       | MIT
| Doc PR        | —

First commit small refactoring.
Second fixes #11154 (causing a BC break for a less common feature)
Third fixes #11142

Commits
-------

dee1562 [Yaml] fix overwriting of keys after merged map
8c621ab [Yaml] fix priority of sequence merges according to spec
02614e0 [Yaml] refactoring of merges for performance
2014-06-20 09:17:53 +02:00
Fabien Potencier
cd0309f847 minor #11162 [Console] remove weird use statement (cordoval)
This PR was merged into the 2.5 branch.

Discussion
----------

[Console] remove weird use statement

|Q            |A     |
|---          |---   |
|Bug Fix?     |yes   |
|New Feature? |no    |
|BC Breaks?   |no    |
|Deprecations?|no    |
|Tests Pass?  |yes     |
|Fixed Tickets| |
|License      |MIT   |
|Doc PR       |      |

Commits
-------

c117e8e [Console] remove weird use statement
2014-06-19 18:27:19 +02:00
Tobias Schultze
dee15623ae [Yaml] fix overwriting of keys after merged map
fixes symfony/symfony#11142
2014-06-19 16:02:29 +02:00
Tobias Schultze
8c621ab4b5 [Yaml] fix priority of sequence merges according to spec
fixes symfony/symfony#11154
2014-06-19 16:01:11 +02:00
Fabien Potencier
bebd18cbd1 bug #11170 [Console] Fixed notice in QuestionHelper (florianv)
This PR was merged into the 2.5 branch.

Discussion
----------

[Console] Fixed notice in QuestionHelper

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

When pressing escape in a question, a notice is shown because the sequence is only 2 characters long.

Commits
-------

9fe4b88 [Console] Fixed notice in QuestionHelper
2014-06-19 11:31:54 +02:00
Fabien Potencier
7d4f4f276a bug #11169 [Console] Fixed notice in DialogHelper (florianv)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] Fixed notice in DialogHelper

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

When pressing escape in a question, a notice is shown because the sequence is only 2 characters long.

Commits
-------

ff6c65e [Console] Fixed notice in DialogHelper
2014-06-19 11:31:20 +02:00
florianv
9fe4b88aaa [Console] Fixed notice in QuestionHelper 2014-06-19 01:05:50 +02:00
florianv
ff6c65ecf7 [Console] Fixed notice in DialogHelper 2014-06-19 01:02:32 +02:00
Tobias Schultze
02614e064f [Yaml] refactoring of merges for performance 2014-06-18 19:56:19 +02:00
Luis Cordova
c117e8eaa8 [Console] remove weird use statement 2014-06-18 07:37:22 -05:00
Romain Neutron
71c3a3599c bug #11156 Update WindowsPipes.php (jgonzalezlopez)
This PR was merged into the 2.6-dev branch.

Discussion
----------

Update WindowsPipes.php

This file has made that my assetic had an error, the property assignment have an extra "$" that it mustn't be present. Please correct it

Commits
-------

7bb98e2 Update WindowsPipes.php
2014-06-18 14:04:38 +02:00
jgonzalezlopez
7bb98e2146 Update WindowsPipes.php
This file has made that my assetic had an error, the property assignment have an extra "$" that it mustn't be present. Please correct it
2014-06-18 13:43:36 +02:00
Fabien Potencier
fbf92e58cb bug #11144 [HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6 (kicken)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6

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

Commits
-------

2a0e8e3 [HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6
2014-06-18 07:53:47 +02:00
Fabien Potencier
598d85cf01 minor #11122 [2.5][FrameworkBundle] Redirect server output to /dev/null in case no verbosity is needed (romainneutron)
This PR was merged into the 2.5 branch.

Discussion
----------

[2.5][FrameworkBundle] Redirect server output to /dev/null in case no verbosity is needed

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

This should reduce I/Os

Commits
-------

6d9fd62 [FrameworkBundle] Redirect server output to /dev/null in case no verbosity is needed
2014-06-17 22:02:09 +02:00
Fabien Potencier
5febbb27f5 minor #11140 [Validator] smaller CS fixes (Tobion)
This PR was merged into the 2.3-dev branch.

Discussion
----------

[Validator] smaller CS fixes

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

First commit fixes some CS of #11027
Second one removes `null` initialization from Validator as we don't do it.

Commits
-------

2025778 [Validator] no need to initialize properties with null
967576a [Validator] smaller fixes for binary format
2014-06-17 21:59:41 +02:00
Fabien Potencier
bd11e9216e minor #11136 [Filesystem] Fix test suite on OSX (romainneutron)
This PR was merged into the 2.3 branch.

Discussion
----------

[Filesystem] Fix test suite on OSX

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

Reviewing PR's, I realized the filesystem test suite fails on my setup (OSX, PHP 5.5.13 with posix ext). `posix_getgrgid` returns false, so some tests are failing.
This solves this issue.

Be aware that the patched method has been moved in FilesystemTestCase in recent branches

Commits
-------

e26f08e [Filesystem] Fix test suite on OSX
2014-06-17 21:57:48 +02:00
Keith Maika
2a0e8e39b8 [HttpFoundation] Fixed Request::getPort returns incorrect value under IPv6
Fixed issue with Request::getPort method returning an incorrect value when the HTTP_HOST header is a IPv6 address.
2014-06-17 10:14:17 -04:00
Tobias Schultze
2025778c8f [Validator] no need to initialize properties with null 2014-06-17 12:31:26 +02:00
Tobias Schultze
967576aaa9 [Validator] smaller fixes for binary format 2014-06-17 11:58:55 +02:00
Fabien Potencier
3b4afe78df feature #10934 [Process] Add support for streams as input (romainneutron)
This PR was squashed before being merged into the 2.6-dev branch (closes #10934).

Discussion
----------

[Process] Add support for streams as input

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

`Process::setStdin` now accepts a stream as input.
I've also split windows and unix pipes management.

Commits
-------

b57024e [Process] Add support for streams as input
2014-06-17 07:31:40 +02:00
Romain Neutron
b57024e68c [Process] Add support for streams as input 2014-06-17 07:31:38 +02:00
Fabien Potencier
6587b3989c feature #10939 [Translation] [Xliff] Support for <note> (Jérémy Derussé)
This PR was squashed before being merged into the 2.6-dev branch (closes #10939).

Discussion
----------

[Translation] [Xliff] Support for <note>

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

The purpose of this PR, is to avoid that the automated translation update (`app/console translation:update`) remove the `note` tags from XLIFF files.

Not sure if using the metadata bag is a good thing or if I should have add a "note" property in MessageCatalogue. What do you think ?

Commits
-------

d18e758 [Translation] [Xliff] Support for <note>
2014-06-17 07:29:58 +02:00
Jérémy Derussé
d18e7583fe [Translation] [Xliff] Support for <note> 2014-06-17 07:29:56 +02:00
Fabien Potencier
d217c7a852 feature #11027 [Validator] Support "maxSize" given in KiB (Jérémy Derussé)
This PR was squashed before being merged into the 2.6-dev branch (closes #11027).

Discussion
----------

[Validator] Support "maxSize" given in KiB

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

To display the constraint validation message with an expected suffix, this PR add a new option in  File constraint.

Commits
-------

48ed754 [Validator] Support "maxSize" given in KiB
2014-06-17 07:26:28 +02:00
Jérémy Derussé
48ed754fd3 [Validator] Support "maxSize" given in KiB 2014-06-17 07:26:23 +02:00
Romain Neutron
e26f08e9b5 [Filesystem] Fix test suite on OSX 2014-06-17 03:04:39 +02:00
Romain Neutron
6d9fd62730 [FrameworkBundle] Redirect server output to /dev/null in case no verbosity is needed 2014-06-17 01:42:56 +02:00
Nicolas Grekas
d55fe8475a feature #10921 [Debug] generic ErrorHandler (nicolas-grekas)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Debug] generic ErrorHandler

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | minor, see updated tests
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

The proposed goal of this PR is to build a class that can serve as a foundation for a standard error handler, shared with other projects and not only used by the FrameworkBundle.

This is a merge of my previous work on the subject (https://github.com/nicolas-grekas/Patchwork-Error-Logger/blob/master/class/Patchwork/PHP/InDepthErrorHandler.php) and recent improvements of error handling in Symfony's Debug\ErrorHandler.

ExceptionHandler has a new AbstractExceptionHandler base class that factors out the handling of fatal errors casted to exceptions.

ErrorHandler is introduced, which provides five bit fields that control how errors are handled:

- thrownErrors: errors thrown as ContextErrorException
- loggedErrors: logged errors, when not @-silenced
- scopedErrors: errors thrown or logged with their local context
- tracedErrors: errors logged with their trace, only once for repeated errors
- screamedErrors: never @-silenced errors

Each error level can be logged by a dedicated PSR-3 logger object.
Screaming only applies to logging.
Throwing takes precedence over logging.
Uncaught exceptions are logged as E_ERROR.
E_DEPRECATED and E_USER_DEPRECATED levels never throw.
E_RECOVERABLE_ERROR and E_USER_ERROR levels always throw.
Non catchable errors that can be detected at shutdown time are logged when the scream bit field allows so.
As errors have a performance cost, repeated errors are all logged, so that the developer
can see them and weight them as more important to fix than others of the same level.

- [x] build a more generic ErrorHandler
- [x] update service/listeners definitions to take advantage of the new interface of ErrorHandler
- [x] add phpdocs
- [x] add tests

Commits
-------

1701447 [Debug] update FrameworkBundle and HttpKernel for new ErrorHandler
839e9ac [Debug] generalized ErrorHandler
2014-06-16 15:59:08 +02:00
Nicolas Grekas
1701447c85 [Debug] update FrameworkBundle and HttpKernel for new ErrorHandler 2014-06-16 13:52:57 +02:00
Nicolas Grekas
839e9ac4c4 [Debug] generalized ErrorHandler 2014-06-16 13:52:56 +02:00
Fabien Potencier
185aafadd0 minor #11077 [TwigBundle] [Tests] Add framework-bundle (clemens-tolboom)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11077).

Discussion
----------

[TwigBundle] [Tests] Add framework-bundle

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

I'm unable to run the test from within TwigBundle

```bash
src/Symfony/Bundle/TwigBundle
composer install
phpunit
```
gives
```
PHP Fatal error:  Class 'Symfony\Bundle\FrameworkBundle\Templating\TemplateReference' not found
```

Adding the FrameworkBundle fixes this but is that what is needed?

I believe `require` and `require-dev` should use `dev-master`
- [x] require(-dev) is not up to par with symfony master.

Commits
-------

a12471d Add framework-bundle
2014-06-16 12:23:06 +02:00
Clemens Tolboom
a12471d171 Add framework-bundle 2014-06-16 12:23:01 +02:00
Fabien Potencier
4a93d7fe3a feature #11070 [HttpKernel] added value of DateTime object to ValueExporter (scuben)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[HttpKernel] added value of DateTime object to ValueExporter

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

This will output the actual value of a DateTime object in the form panel of the web debug toolbar.

- [x] gather feedback for my change (thank you stof, its my first contribution to oss)
- [x] finish the code

Commits
-------

a1762fb [HttpKernel] added value of DateTime object and objects implementing DateTimeInterface to ValueExporter
2014-06-16 11:31:11 +02:00
Fabien Potencier
074c38153b Merge branch '2.5'
* 2.5:
  PHP Fatal error when getContainer method of ContainerAwareCommand has be...
  [HttpFoundation] Fixed isSecure() check to be compliant with the docs
  Update MimeTypeExtensionGuesser.php
  fix test src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
  [Process] Do not redirect output to file handles when output is disabled
  [Validator] Fix array notation in the PropertyPath::append()
  Fixed undefined ImageValidator:: property when uploading an image during functional tests
  [HttpKernel] Fix event dispatcher dependency
  Fixed the Travis build on PHP 5.3.3
2014-06-16 11:30:19 +02:00
Fabien Potencier
349549cd17 Merge branch '2.4' into 2.5
* 2.4:
  PHP Fatal error when getContainer method of ContainerAwareCommand has be...
  [HttpFoundation] Fixed isSecure() check to be compliant with the docs
  Update MimeTypeExtensionGuesser.php
  fix test src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
  Fixed the Travis build on PHP 5.3.3
2014-06-16 11:30:12 +02:00
Fabien Potencier
75179c78a0 Merge branch '2.3' into 2.4
* 2.3:
  PHP Fatal error when getContainer method of ContainerAwareCommand has be...
  [HttpFoundation] Fixed isSecure() check to be compliant with the docs
  Update MimeTypeExtensionGuesser.php
  fix test src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
  Fixed the Travis build on PHP 5.3.3
2014-06-16 11:30:02 +02:00
Fabien Potencier
fd1bfd4e85 bug #11121 [2.5][Process] Do not redirect output to file handles when output is disabled, simply discard it (romainneutron)
This PR was merged into the 2.5 branch.

Discussion
----------

[2.5][Process] Do not redirect output to file handles when output is disabled, simply discard it

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

Commits
-------

b35250f [Process] Do not redirect output to file handles when output is disabled
2014-06-16 11:29:32 +02:00
Fabien Potencier
92d93cea80 bug #10966 PHP Fatal error when getContainer method of ContainerAwareCommand has be... (kevinvergauwen)
This PR was squashed before being merged into the 2.3 branch (closes #10966).

Discussion
----------

PHP Fatal error when getContainer method of ContainerAwareCommand has be...

PHP Fatal error when getContainer method of ContainerAwareCommand has been called within the configure method of a Command (application property is not been set yet at that time)

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

Commits
-------

8ea5c4c PHP Fatal error when getContainer method of ContainerAwareCommand has be...
2014-06-16 10:10:36 +02:00
Kevin Vergauwen
8ea5c4c0f6 PHP Fatal error when getContainer method of ContainerAwareCommand has be... 2014-06-16 10:10:33 +02:00
Fabien Potencier
1eed20a3f6 feature #11086 [HttpFoundation] Added ParameterBag::getBoolean (peterjmit)
This PR was merged into the 2.3-dev branch.

Discussion
----------

[HttpFoundation] Added ParameterBag::getBoolean

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

At the moment to pull a boolean value from a request the user has to use `ParameterBag::filter` or use `filter_var` directly

```php
// GET /products?hide_archived=true
$request->query->filter('hide_archived', false, false, FILTER_VALIDATE_BOOLEAN);
// or
filter_var($request->query->get('hide_archived'), FILTER_VALIDATE_BOOLEAN);
```

This is a pure convenience addition, adding a nice way of pulling a boolean value from a query string or request body (especially if http form/url encoded).

Example usage:
```php
// GET /products?hide_archived=true
$request->query->getBoolean('hide_archived'); // (boolean) true
$request->query->get('hide_archived'); // (string) "true"

// GET /products?hide_archived=1
$request->query->getBoolean('hide_archived'); // (boolean) true

// GET /products?hide_archived=false
$request->query->getBoolean('hide_archived'); // (boolean) false

// GET /products?hide_archived=banana
$request->query->getBoolean('hide_archived'); // (boolean) false
```

Commits
-------

36c58f8 [HttpFoundation] Added ParameterBag::getBoolean
2014-06-16 09:42:55 +02:00