Commit Graph

4322 Commits

Author SHA1 Message Date
Pascal Borreli
6ef7f10628 Fixed typos 2013-04-21 11:14:35 +00:00
Fabien Potencier
46ac2f0e42 [TwigBundle] removed @ when defining an autoescaping service, and fixed XSD to use - instead of _ 2013-04-21 10:18:50 +02:00
Fabien Potencier
898a63c8f0 merged branch maxbeutel/pr/custom-template-escaping (PR #7479)
This PR was merged into the master branch.

Discussion
----------

[TwigBundle] Make twig extension handle custom template escaping guesser

I wanted to add a custom template escaping guesser for twig like in http://twig.sensiolabs.org/doc/recipes.html#using-the-template-name-to-set-the-default-escaping-strategy

This pull request allows you register a service id and a method as a custom guesser:

    twig:
        autoescape: my_service:guess

Documentation is missing for this PR and the unit tests are not that good. I´d work on it if this PR has any chance of getting merged?

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

Commits
-------

c2c1ed0 make twig extension handle custom template escaping guesser
2013-04-21 10:14:24 +02:00
Fabien Potencier
2b6d0cb955 merged branch lsmith77/redirect_controller (PR #7590)
This PR was merged into the master branch.

Discussion
----------

make it possible to ignore route attributes in the RedirectContoller

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

```
_welcome:
    pattern: /{path}
    defaults:
        _controller: FrameworkBundle:Redirect:redirect
        route: licenses_projects
        ignoreAttributes: true
    requirements:
        path: .*
```

or

```
_welcome:
    pattern: /{path}
    defaults:
        _controller: FrameworkBundle:Redirect:redirect
        route: licenses_projects
        ignoreAttributes: [path]
    requirements:
        path: .*
```

Ensures that ``path`` isnt added as a GET parameter in case the ``licenses_projects`` doesnt have a path in the pattern.

Commits
-------

190abc1 add unit tests for $ignoreAttributes
0c7b65f inject the Request via the action signature, rather than fetching it from the DIC
49062aa make it possible to ignore route attributes in the RedirectContoller
2013-04-20 22:39:42 +02:00
Lukas Kahwe Smith
190abc1842 add unit tests for $ignoreAttributes 2013-04-20 22:35:33 +02:00
Lukas Kahwe Smith
0c7b65faf6 inject the Request via the action signature, rather than fetching it from the DIC 2013-04-20 22:34:45 +02:00
Lukas Kahwe Smith
49062aacac make it possible to ignore route attributes in the RedirectContoller 2013-04-20 22:32:51 +02:00
Dmitrii Chekaliuk
811434f988 Allow setting trusted_proxies using CIDR notation 2013-04-20 17:49:56 +02:00
Fabien Potencier
51a3561ed4 [SecurityBundle] added a missing entry in the CHANGELOG 2013-04-20 15:51:07 +02:00
Fabien Potencier
1777d984b9 merged branch danfinnie/multiple_ip_matching (PR #7251)
This PR was squashed before being merged into the master branch (closes #7251).

Discussion
----------

[SecurityBundle] [HttpFoundation] Allow for multiple IP address in security access_control rules

Fixes #7249.

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

Commits
-------

650352d [SecurityBundle] [HttpFoundation] Allow for multiple IP address in security access_control rules
2013-04-20 15:48:17 +02:00
Dan Finnie
650352d1ca [SecurityBundle] [HttpFoundation] Allow for multiple IP address in security access_control rules 2013-04-20 15:48:16 +02:00
Fabien Potencier
719c278f32 merged branch egeloen/f-container-params-debug (PR #6550)
This PR was merged into the master branch.

Discussion
----------

[FrameworkBundle] Allow to debug container parameters

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Fixes the following tickets: ~
Todo: -
License of the code: MIT
Documentation PR: ~

Hey!

This PR adds a new command which allows to debug container parameters. IMO, being able to list all available parameters is very useful. We can now know which parameters we can inject into our services.

Regards

Commits
-------

ceb401d Add parameters debug to the container:debug command
64388c1 [FrameworkBundle] Allow to debug container parameters
2013-04-20 15:10:52 +02:00
Bernhard Schussek
01b71a47ea [Form] Removed trigger_error() for deprecations as of 3.0 2013-04-18 11:02:51 +02:00
Bernhard Schussek
81f8c67566 [Form] Implemented form processors 2013-04-18 11:02:51 +02:00
Fabien Potencier
e51c560ad4 merged branch acasademont/patch-1 (PR #7678)
This PR was merged into the master branch.

Discussion
----------

[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 won't 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

Commits
-------

9e849eb [Form] Remove "value" attribute on empty_value option
2013-04-18 10:34:46 +02:00
Fabien Potencier
5a3428dc78 Revert "merged branch drak/start_on_demand (PR #7576)"
This reverts commit 7aa06818bc, reversing
changes made to 7bf8933662.
2013-04-18 07:30:58 +02:00
Fabien Potencier
7aa06818bc merged branch drak/start_on_demand (PR #7576)
This PR was merged into the master branch.

Discussion
----------

[2.3][Session] Give greater control over how and when session starts

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

Refs #6036

Gives control over how start on demand works: allowing to turn it on or off and to allow bag access when session is off.

Commits
-------

f431cb0 Fix tests
1f521d8 Coding standards
2583c26 [HttpFoundation][FrameworkBundle] Keep save auto_start behaviour as in 2.2 and make component values consistent with FrameworkBundle's configuration options.
ceaf69b [FrameworkBundle] Use more sophisticated validation and configuration.
af0a140 [FrameworkBundle] Add configuration to allow control over session start on demand.
8fc2397 [HttpFoundation] Give control over how session start on demand.
2013-04-18 07:26:17 +02:00
Fabien Potencier
7bf8933662 merged branch drak/session_detect (PR #7571)
This PR was squashed before being merged into the master branch (closes #7571).

Discussion
----------

[2.3] Handle PHP sessions started outside of Symfony

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

This PR brings a way to allow Symfony2 to manage a session started outside of Symfony in such a way that quite explicit. It also introduces more robust detection of previously started sessions under PHP 5.3 and supports real session status detection under PHP 5.4

Commits
-------

df99902 [2.3] Handle PHP sessions started outside of Symfony
2013-04-18 07:19:50 +02:00
Drak
df99902a01 [2.3] Handle PHP sessions started outside of Symfony 2013-04-18 07:19:50 +02:00
Jakub Zalas
043a91514f [FrameworkBundle] Fixed Stopwatch namespace. 2013-04-17 22:32:53 +01:00
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
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
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
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
Andrew Udvare
8e9cb3b0a7 Add support for detection of Zend OPcache as an accelerator 2013-04-14 21:00:45 -07:00
Bernhard Schussek
c8afa886cd [Form] Removed deprecated code scheduled for removal in 2.3 2013-04-13 16:46:29 +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
Pavel Volokitin
f1632266e4 fixed output of bag values
Call json_encode with flags: JSON_UNESCAPED_SLASHES and
JSON_UNESCAPED_UNICODE
2013-04-12 14:36:58 +02:00
Drak
f431cb02b4 Fix tests 2013-04-11 13:22:46 +01:00
Fabien Potencier
3cb87a3f95 merged branch dantleech/enforce_sprintf_for_exceptions (PR #7620)
This PR was squashed before being merged into the master branch (closes #7620).

Discussion
----------

Enforce sprintf for exceptions

| Q             | A
| ------------- | ---
| Bug fix?      |no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | [yes|no]
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/2483

Changed format of exceptions which concatenate strings as follows

````
throw new \Exception('The '.$something.' needs the '.$foobar.' parameter');
````

to

````
throw new \Exception(sprintf('The %s needs the %s parameter', $something, $foobar));
````

This follows discussion on mailing list: https://groups.google.com/forum/?fromgroups#!topic/symfony-devs/tecj3UOAueM

Unit test results are pending...

Commits
-------

e655120 Enforce sprintf for exceptions
2013-04-11 08:50:46 +02:00
dantleech
e655120f05 Enforce sprintf for exceptions 2013-04-11 08:50:46 +02:00
Andrew Udvare
b22d2ff925 The /e modifier for preg_replace() is deprecated in PHP 5.5; replace with preg_replace_callback() 2013-04-11 08:41:26 +02:00
Fabien Potencier
17e065facb merged branch canni/prod_server (PR #7507)
This PR was squashed before being merged into the master branch (closes #7507).

Discussion
----------

[FrameworkBundle] Enable possibility to run PHP bultin server in production env

See the referenced ticket for discussion;

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

Commits
-------

12fce13 [FrameworkBundle] Enable possibility to run PHP bultin server in production env
2013-04-09 16:38:45 +02:00
Dariusz Górecki
12fce13dbb [FrameworkBundle] Enable possibility to run PHP bultin server in production env 2013-04-09 16:38:45 +02:00
Fabien Potencier
83e078a035 Merge branch '2.2'
* 2.2:
  Fix finding ACLs from ObjectIdentity's with different types
  [HttpKernel] tweaked previous merge
  #7531: [HttpKernel][Config] FileLocator adds NULL as global resource path
  Fix autocompletion of command names when namespaces conflict
  Fix timeout in Process::stop method
  fixed CS
  Round stream_select fifth argument up.
  Fix Process timeout
  [HttpKernel] Remove args from 5.3 stack traces to avoid filling log files, fixes #7259
  bumped Symfony version to 2.2.2-DEV
  updated VERSION for 2.2.1
  updated CHANGELOG for 2.2.1
  Fixed phpdoc blocks to show that $uri can be passed as a string or ControllerReference (rather than just as a string)
  [HttpFoundation] Fixed copy pasted comment from FlashBag in AttributeBag
  [FrameworkBundle] fixed the discovery of the PHPUnit configuration file when using aggregate options like in -vc app/ (closes #7562)
  [WebProfilerBundle] removed next pointer class in a template
  fix overwriting of request's locale if attribute _locale is missing

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php
	src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php
	src/Symfony/Component/HttpKernel/Kernel.php
2013-04-07 22:25:23 +02:00
Lukas Kahwe Smith
d36f4aed80 dump the list of available bundles (and extension alaises) if no name is provided 2013-04-07 18:28:21 +02:00
Drak
2583c2614f [HttpFoundation][FrameworkBundle] Keep save auto_start behaviour as in 2.2 and make component values consistent with FrameworkBundle's configuration options. 2013-04-06 18:13:24 +01:00
Drak
ceaf69b32e [FrameworkBundle] Use more sophisticated validation and configuration. 2013-04-06 17:24:31 +01:00
Fabien Potencier
9a7c56788e Merge branch '2.1' into 2.2
* 2.1:
  [HttpFoundation] Fixed copy pasted comment from FlashBag in AttributeBag
  [FrameworkBundle] fixed the discovery of the PHPUnit configuration file when using aggregate options like in -vc app/ (closes #7562)
  [WebProfilerBundle] removed next pointer class in a template
2013-04-06 12:15:43 +02:00
Drak
af0a14009f [FrameworkBundle] Add configuration to allow control over session start on demand.
1. Gives user control over session start on demand mode.
2. Re-introduce flag to allow session listener to manually start session.
2013-04-06 10:34:54 +01:00
Fabien Potencier
375ded4227 [FrameworkBundle] fixed the discovery of the PHPUnit configuration file when using aggregate options like in -vc app/ (closes #7562) 2013-04-05 08:39:48 +02:00
Max Beutel
c2c1ed0728 make twig extension handle custom template escaping guesser 2013-04-03 10:05:05 +02:00
Dariusz Górecki
553e294f77 [Fix CS] Unneeded whitespace around negation operator 2013-04-02 10:46:23 +01:00
Dariusz Górecki
7c47e34928 [CS Fix] Consistent coding-style of concatenation operator usage 2013-04-02 10:39:57 +01:00
Bilal Amarni
b0ba9fd712 [WebProfilerBundle] removed next pointer class in a template 2013-04-02 11:25:27 +03:00
Fabien Potencier
aa5b22f279 merged branch jfsimon/issue-7439 (PR #7476)
This PR was merged into the master branch.

Discussion
----------

[HttpKernel] adds possibility to add attributes to hx:include tag

This PR follows #7439 and adds escaping to attributes.
This introduces 2 options to the `HIncludeFragmentRenderer::render()` method:
* `id`: an optional `id` attribute for the `hx:include` tag
* `attrs`: an optional array of attributes for the `hx:include` tag

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

Commits
-------

670a502 [HttpKernel] added escaping for hx:include tag attributes
342d089 Allow to set id + custom attributes to hinclude tag
2013-04-01 10:10:25 +02:00
Fabien Potencier
e1c741db9c Merge branch '2.2'
* 2.2: (22 commits)
  fixed doc references (closes #7515)
  fixed doc references (closes #7515)
  On OS X, sys_get_tmp_dir() returns /var/private/..., which really is below /private/var.
  Doctrine cannot handle bare random non-utf8 strings
  small changes
  [SecurityBundle] Fixed configuration exemple
  idAsIndex should be true with a smallint or bigint id field.
  [PropertyAccess] Remove trailing periods from doc blocks
  Fix param docs for PropertyAccessor read method
  Fixed long multibyte parameter logging in DbalLogger:startQuery
  Keep the file extension in the temporary copy and test that it exists (closes #7482)
  bumped Symfony version to 2.1.10-DEV
  [Validator][translation][japanese]replaced period to japanese one [Validator][translation][japanese]fixed japanese translation to more practical one [Validator][translation][japanese]fixed message ordering to be consistent with other languages [Validator][translation][japanese]added new validation messages in japanese translation
  updated VERSION for 2.1.9
  update CONTRIBUTORS for 2.1.9
  updated CHANGELOG for 2.1.9
  [Security] fixed wrong interface
  Remove already defined arguments
  Add missing use
  [FrameworkBundle] Reuse definition variable in FormPass
  ...

Conflicts:
	src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
	src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/config.html.twig
2013-04-01 10:07:30 +02:00