Commit Graph

13886 Commits

Author SHA1 Message Date
Jakub Zalas
2170dcb58e [FrameworkBundle] Added a missing test for TimedPhpEngine. 2013-04-17 22:32:28 +01:00
Fabien Potencier
5a158ea08b merged branch bschussek/issue5383 (PR #6528)
This PR was merged into the master branch.

Discussion
----------

[2.3] [Form] Support buttons in forms

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #5383
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#2489

The general idea of this PR is to be able to add buttons to forms like so:

```php
$builder->add('clickme', 'submit');
```

You can then check in the controller whether the button was clicked:

```php
if ($form->get('clickme')->isClicked()) {
   // do stuff
}
```

Button-specific validation groups are also supported:

```php
$builder->add('clickme', 'submit', array(
    'validation_groups' => 'OnlyClickMe',
));
```

The validation group will then override the one defined in the form if that button is clicked.

This PR also introduces the disabling of form validation by passing the value `false` in the option `validation_groups`:

```php
$builder->add('clickme', 'submit', array(
    'validation_groups' => false,
));
```

The same can be achieved (already before this PR) by passing an empty array:
```php
$builder->add('clickme', 'submit', array(
    'validation_groups' => array(),
));
```

See the linked documentation for more information.

Commits
-------

faf8d7a [Form] Added upgrade information about setting "validation_groups" => false
d504732 [Form] Added leading backslashes to @exceptionMessage doc blocks
c8afa88 [Form] Removed deprecated code scheduled for removal in 2.3
36ca056 [Form] Simplified Twig code
ce29c70 [Form] Fixed incorrect doc comment
0bc7129 [Form] Fixed invalid use of FormException
600007b [Form] The option "validation_groups" can now be set to false to disable validation. This is identical to setting it to an empty array.
277d6df [Form] Fixed concatenation operator CS (see 7c47e34928)
7b07925 [Form] Changed isset() to array_key_exists() to be consistent with ParameterBag
7b438a8 [Form] Made submit buttons able to convey validation groups
cc2118d [Form] Implemented support for buttons
2013-04-17 19:40:27 +02:00
Bernhard Schussek
a868048a82 [Validator] Moved constraints Optional and Required to the Constraints\ namespace 2013-04-17 18:02:12 +02:00
Albert Casademont
9e849eb78b [Form] Remove "value" attribute on empty_value option
Today we faced a very strange issue with the newest Blackberry 10 browser, it was not submitting our forms. Finally we found that in a ```select``` element, if you have a disabled option, it can't have a value or the HTML5 validator will crash and not submit the form. Of course, setting the ```novalidate``` option for the whole form also solved the issue.

Although I know this must be an issue with the WebKit version the BB10 has it can easily be solved in symfony with this change. In fact, it does make sense since we already have a disabled option with no value if the ```preferred_choices``` are not empty and a ```separator``` is set
2013-04-17 16:21:44 +02:00
Fabien Potencier
edd7649457 [DependencyInjection] fixed management of scoped services with an invalid behavior set to null (closes #7636) 2013-04-17 14:16:20 +02:00
Fabien Potencier
ee489124fe Merge branch '2.2'
* 2.2:
  [DependencyInjection] fixed wrong exception class
  fix overwriting of request's locale if attribute _locale is missing
2013-04-17 14:12:15 +02:00
Fabien Potencier
0b4716e3e8 Merge branch '2.1' into 2.2
* 2.1:
  [DependencyInjection] fixed wrong exception class

Conflicts:
	src/Symfony/Component/DependencyInjection/ContainerBuilder.php
2013-04-17 14:12:09 +02:00
Fabien Potencier
8be013d8fb merged branch fabpot/inactive-scope-fix (PR #7696)
This PR was merged into the 2.1 branch.

Discussion
----------

[DependencyInjection] fixed wrong exception class

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

Commits
-------

22bf965 [DependencyInjection] fixed wrong exception class
2013-04-17 14:11:36 +02:00
Fabien Potencier
22bf96561e [DependencyInjection] fixed wrong exception class 2013-04-17 14:10:55 +02:00
Fabien Potencier
7671edeb6b merged branch Olden/issue_7639 (PR #7694)
This PR was merged into the master branch.

Discussion
----------

[Stopwatch] Fix array definition from 5.4

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

I was break tests for 5.3 with my prev. PR #7691

Commits
-------

35a3c65 [Stopwatch] Fix array definition from 5.4
2013-04-17 09:33:58 +02:00
Alexander Kotynia
35a3c65db9 [Stopwatch] Fix array definition from 5.4 2013-04-17 10:17:10 +03:00
Fabien Potencier
78b060961a merged branch Tatsh/add-zend-opcache-detection (PR #7674)
This PR was merged into the master branch.

Discussion
----------

[HttpKernel] ConfigDataCollector: Add support for new Zend OPcache accelerator

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

Related: https://github.com/symfony/symfony/pull/7670

**From original pull request:**

More information: https://github.com/zend-dev/ZendOptimizerPlus

This extension is compatible with PHP 5.2-5.5. I'm using it with 5.5 and 5.4. The PHP developers plan to include this as opposed to APC in PHP 5.5 core. http://php.net/archive/2013.php#id2013-03-21-1

This does not really have to do with Zend Optimiser+. It has to do with the newly open sourced version, Zend OPcache.

I noticed a *similar* PR here https://github.com/symfony/symfony/pull/7087 but did not like that the unit test check for accelerators was completely removed. I also do not consider it necessary to add more code just for an extension check (I would consider that 'unnecessary re-factoring'). And finally, I have no idea what the final purpose of it is. Based on its title, it seemed like at first that it was for Zend Optimizer+ (the proprietary extension: http://files.zend.com/help/Zend-Server-6/zend-server.htm#zendoptimizerplus.html) but then it sort of changed to adding support for Zend OPcache (the recently open sourced version).

This does only Zend OPcache. Tested on PHP 5.5 and PHP 5.4, including unit tests.

Based on naming scheme, I decided to name the function `hasZendOpcache` (ignoring the abbreviation as with `hasApc`) as opposed to `hasZendOpCache` or other names. Not sure if this is the 'perfect name' (it gets called in all lower-case in the twig file anyway).

Commits
-------

8e9cb3b Add support for detection of Zend OPcache as an accelerator
2013-04-17 07:42:22 +02:00
Fabien Potencier
2cd4b8e9b0 Merge branch '2.1' into 2.2
* 2.1:
  fix overwriting of request's locale if attribute _locale is missing
2013-04-17 07:39:09 +02:00
Fabien Potencier
580b249310 merged branch uwej711/fix_locale_is_overridden_2_1 (PR #7686)
This PR was merged into the 2.1 branch.

Discussion
----------

[HttpKernel] fix overwriting of request's locale if attribute _locale is missing

In addition to https://github.com/symfony/symfony/pull/7516 same change for the 2.1 branch, see comments on https://github.com/lunetics/LocaleBundle/pull/59

Commits
-------

da156d3 fix overwriting of request's locale if attribute _locale is missing
2013-04-17 07:38:53 +02:00
Fabien Potencier
b42e4b0284 merged branch Olden/issue_7639 (PR #7691)
This PR was squashed before being merged into the master branch (closes #7691).

Discussion
----------

[Stopwatch] Fix checking started events

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

Stopwatch component return true from isStarted method, when StopwatchEvent was added but not started.

Commits
-------

b626542 [Stopwatch] Fix checking started events
2013-04-17 07:37:59 +02:00
Alexander Kotynia
b6265427c6 [Stopwatch] Fix checking started events 2013-04-17 07:37:59 +02:00
Fabien Potencier
6a2c71bad5 fixed previous merge 2013-04-17 07:37:48 +02:00
Fabien Potencier
1b2619078d Merge branch '2.2'
* 2.2:
  Fix default value handling for multi-value options
  [HttpKernel] truncate profiler token to 6 chars (see #7665)
  Disabled APC on Travis for PHP 5.5+ as it is not available
  [HttpFoundation] do not use server variable PATH_INFO because it is already decoded and thus symfony is fragile to double encoding of the path
  Fix download over SSL using IE < 8 and binary file response
  [Console] Fix merging of application definition, fixes #7068, replaces #7158
  [HttpKernel] fixed the Kernel when the ClassLoader component is not available (closes #7406)
  fixed output of bag values
  [Yaml] improved boolean naming ($notEOF -> !$EOF)
  [Yaml] fixed handling an empty value
  [Routing][XML Loader] Add a possibility to set a default value to null
  [Console] fixed handling of "0" input on ask
  The /e modifier for preg_replace() is deprecated in PHP 5.5; replace with preg_replace_callback()
  fixed handling of "0" input on ask
  [HttpFoundation] Fixed bug in key searching for NamespacedAttributeBag
  [Form] DateTimeToRfc3339Transformer use proper transformation exteption in reverse transformation
  Update PhpEngine.php
  [PropertyAccess] Add objectives to pluralMap
  [Security] Removed unused var
  [HttpFoundation] getClientIp is fixed.

Conflicts:
	src/Symfony/Component/Console/Tests/Command/CommandTest.php
	src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php
	src/Symfony/Component/HttpFoundation/Request.php
	src/Symfony/Component/HttpKernel/Kernel.php
2013-04-17 07:31:37 +02:00
Fabien Potencier
fd58a5f424 Merge branch '2.1' into 2.2
* 2.1:
  Fix default value handling for multi-value options
  [HttpKernel] truncate profiler token to 6 chars (see #7665)
  Disabled APC on Travis for PHP 5.5+ as it is not available
  [HttpFoundation] do not use server variable PATH_INFO because it is already decoded and thus symfony is fragile to double encoding of the path
  [Yaml] improved boolean naming ($notEOF -> !$EOF)
  [Yaml] fixed handling an empty value
  [Routing][XML Loader] Add a possibility to set a default value to null
  The /e modifier for preg_replace() is deprecated in PHP 5.5; replace with preg_replace_callback()
  [HttpFoundation] Fixed bug in key searching for NamespacedAttributeBag
  [Form] DateTimeToRfc3339Transformer use proper transformation exteption in reverse transformation
  Update PhpEngine.php
  [HttpFoundation] getClientIp is fixed.

Conflicts:
	.travis.yml
	src/Symfony/Component/Routing/Loader/XmlFileLoader.php
	src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd
	src/Symfony/Component/Routing/Tests/Fixtures/validpattern.xml
	src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php
2013-04-17 07:27:14 +02:00
Fabien Potencier
41fef9310a merged branch jmikola/2.2-fix/gh7689 (PR #7690)
This PR was submitted for the 2.2 branch but it was merged into the 2.1 branch instead (closes #7690).

Discussion
----------

[Console] Fix default value handling for multi-value options

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

The default value for array options will be an array, so it is not suitable to use as the default when processing one of many values for a multi-value option. Using null seems appropriate here, as it indicates the absence of a value and also converts nicely to an empty string (as opposed to an empty array).

Commits
-------

a9c28ff [Console] Fix default value handling for multi-value options
2013-04-17 07:12:51 +02:00
Jeremy Mikola
5abf887180 Fix default value handling for multi-value options
The default value for array options will be an array, so it is not suitable to use as the default when processing one of many values for a multi-value option. Using null seems appropriate here, as it indicates the absence of a value and also converts nicely to an empty string (as opposed to an empty array).

Fixes #7689
2013-04-17 07:12:51 +02:00
Uwe Jäger
da156d3f94 fix overwriting of request's locale if attribute _locale is missing 2013-04-16 21:35:51 +02:00
Fabien Potencier
d060c40503 merged branch stloyd/feature/form_date_dep (PR #7677)
This PR was merged into the master branch.

Discussion
----------

[Form] Remove deprecated code from Date & Time related fields

Commits
-------

f8b0994 [Form] Remove deprecated code from Date & Time related fields
2013-04-15 15:37:17 +02:00
Joseph Bielawski
f8b0994b5d [Form] Remove deprecated code from Date & Time related fields 2013-04-15 13:52:45 +02:00
Bernhard Schussek
faf8d7a89e [Form] Added upgrade information about setting "validation_groups" => false 2013-04-15 11:09:15 +02:00
Andrew Udvare
8e9cb3b0a7 Add support for detection of Zend OPcache as an accelerator 2013-04-14 21:00:45 -07:00
Fabien Potencier
324686cf25 merged branch 1ed/token-length (PR #7665)
This PR was merged into the 2.1 branch.

Discussion
----------

[WebProfilerBundle] made token shorter in WDT

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

The length of the profiler token was increased by [this](b9cdb9a26d
) commit. This PR makes the visible token shorter.

Before:
![before](https://f.cloud.github.com/assets/162986/376901/338b9684-a461-11e2-9806-fc77d5ce5039.png)
After:
![after](https://f.cloud.github.com/assets/162986/376902/338ee078-a461-11e2-88c8-78748739565c.png)

Commits
-------

1adbe3c [HttpKernel] truncate profiler token to 6 chars (see #7665)
2013-04-14 20:15:16 +02:00
Fabien Potencier
46efc9b4ac merged branch romainneutron/EnhanceSigchild (PR #5476)
This PR was squashed before being merged into the master branch (closes #5476).

Discussion
----------

[Process] Add signal and getPid methods

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

This PR replaces #5391 ; it adds :

 - sigchild compatibility mode. This means that if you activate it you have access to this exitcode of the process in case your php has been compiled with --enable-sigchild. This can happen when you deal with Oracle databases.

```php
$process->setEnhanceSigchildCompatibility(true);
```

 - `getPid` method to get the actual process identifier of the process

```php
$process->getPid();
```

 - `signal` method to send Posix signal to the process

```php
$process->signal(SIGHUP);
```

 - Add optionnal `$signal` as second argument to `stop`method. If provided, the signal is sent at timeout to the process. Example of use :

```php
$process->stop(5, SIGKILL);
```

Tests have been enhanced and now run both sigchild / non-sigchild mode.

By the way, tests are successful with a PHP compiled with the --enable-sigchild option ;)

Commits
-------

5ed2737 [Process] Add signal and getPid methods
2013-04-14 18:37:33 +02:00
Romain Neutron
5ed2737d54 [Process] Add signal and getPid methods 2013-04-14 18:37:33 +02:00
Gábor Egyed
1adbe3cad6 [HttpKernel] truncate profiler token to 6 chars (see #7665) 2013-04-13 20:20:36 +02:00
Fabien Potencier
ef0cebfaa6 merged branch stof/fix_travis_5_5 (PR #7663)
This PR was merged into the 2.1 branch.

Discussion
----------

Disabled APC on Travis for PHP 5.5+ as it is not available

As APC is not available, PHP triggers a warning when trying to load the extension, which lead to many test failures.

Commits
-------

6084176 Disabled APC on Travis for PHP 5.5+ as it is not available
2013-04-13 16:47:44 +02:00
Bernhard Schussek
d504732728 [Form] Added leading backslashes to @exceptionMessage doc blocks 2013-04-13 16:46:29 +02:00
Bernhard Schussek
c8afa886cd [Form] Removed deprecated code scheduled for removal in 2.3 2013-04-13 16:46:29 +02:00
Bernhard Schussek
36ca05656c [Form] Simplified Twig code 2013-04-13 16:46:29 +02:00
Bernhard Schussek
ce29c70190 [Form] Fixed incorrect doc comment 2013-04-13 16:46:29 +02:00
Bernhard Schussek
0bc7129eb1 [Form] Fixed invalid use of FormException 2013-04-13 16:46:29 +02:00
Bernhard Schussek
600007b71f [Form] The option "validation_groups" can now be set to false to disable validation. This is identical to setting it to an empty array. 2013-04-13 16:46:29 +02:00
Bernhard Schussek
277d6dfcf7 [Form] Fixed concatenation operator CS (see 7c47e34928) 2013-04-13 16:46:28 +02:00
Bernhard Schussek
7b07925fad [Form] Changed isset() to array_key_exists() to be consistent with ParameterBag 2013-04-13 16:46:28 +02:00
Bernhard Schussek
7b438a816b [Form] Made submit buttons able to convey validation groups 2013-04-13 16:46:28 +02:00
Bernhard Schussek
cc2118dd5c [Form] Implemented support for buttons 2013-04-13 16:46:28 +02:00
Christophe Coevoet
60841766db Disabled APC on Travis for PHP 5.5+ as it is not available 2013-04-13 16:35:03 +02:00
Fabien Potencier
9b6d30cf37 merged branch stof/fix_5_3 (PR #7662)
This PR was merged into the master branch.

Discussion
----------

Fixed the Console code on PHP 5.3

| Q             | A
| ------------- | ---
| Fixed tickets | none (catched by the Travis builds)
| License       | MIT

The PR #7657 introduced a requirement on PHP 5.4 by mistake.

Commits
-------

1356050 Fixed the Console code on PHP 5.3
2013-04-13 16:14:46 +02:00
Christophe Coevoet
1356050f21 Fixed the Console code on PHP 5.3
The PR #7657 introduced a requirement on PHP 5.4 by mistake.
2013-04-13 16:06:01 +02:00
Fabien Potencier
bedac11d57 merged branch Olden/issue_7639 (PR #7653)
This PR was squashed before being merged into the master branch (closes #7653).

Discussion
----------

[HttpKernel] Improve TraceableEventDispatcher to not call Stopwatch::stop() when not started

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

Commits
-------

e638e01 [HttpKernel] Improve TraceableEventDispatcher to not call Stopwatch::stop() when not started
2013-04-12 17:56:02 +02:00
Alexander Kotynia
e638e01ea7 [HttpKernel] Improve TraceableEventDispatcher to not call Stopwatch::stop() when not started 2013-04-12 17:56:02 +02:00
Fabien Potencier
e52fe4db1d merged branch gnutix/issue-7349-fix (PR #7612)
This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] Split getClientIp into two methods for better flexibility

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | Locally: NO (HttpFoundation tests passes, but all Symfony tests fails because of my local setup). Travis : YES
| Fixed tickets | #7349
| License       | MIT
| Doc PR        | none (yet?)

Split the ``Request::getClientIp`` method in two to allow better overriding flexibility. See #7349 for more information.

Commits
-------

2678dd5 [HttpFoundation] Move comments from one method to the other [ci skip].
7529664 [HttpFoundation] Removed the @api annotation on getClientIps method.
f0c4ab6 [HttpFoundation] Split the tests into two methods / data providers.
80030fb [HttpFoundation] Use @see annotation for better documentation generation.
3e703a2 [HttpFoundation] Fixing tests.
63cbbb5 [HttpFoundation] Add tests for the newly created Request::getClientIps() method.
58347fb [HttpFoundation] Split getClientIp into two methods for better flexibility.
2013-04-12 17:30:12 +02:00
Fabien Potencier
0c88f22c08 merged branch Seldaek/argv-tostring (PR #7657)
This PR was merged into the master branch.

Discussion
----------

[Console] Input::__toString escaping fixes

Follow up to #7648, also includes a fix for StringInput to parse newlines and other whitespace chars properly instead of normalizing them all to spaces. It was kinda needed to test it properly, so I bundled both in one.

Commits
-------

93b1369 [Console] Fix StringInput parsing to accept newlines and tabs
8642b67 [Console] Fix escaping of args
2013-04-12 17:26:58 +02:00
Jordi Boggiano
93b1369bb5 [Console] Fix StringInput parsing to accept newlines and tabs 2013-04-12 17:23:00 +02:00
Jordi Boggiano
8642b676b3 [Console] Fix escaping of args 2013-04-12 17:22:47 +02:00