Commit Graph

4191 Commits

Author SHA1 Message Date
Fabien Potencier
bb5c8f4777 [FrameworkBundle] fixed typo 2013-02-01 17:07:52 +01:00
Fabien Potencier
c72e471c65 renamed some classes and Twig functions to more descriptive names (refs #6871)
HttpContentRenderer has been renamed to FragmentHandler.
The RendererStrategy subnamespace has been renamed to Fragment.
The strategy classes now have Fragment in their names.
ProxyRouterListener has been renamed to FragmentListener
The router_proxy configuration entry has been renamed to fragments.
2013-02-01 15:17:20 +01:00
Joseph Bielawski
53c70548a0 Update composer.json files: - to allow versions ~2.2 (>=2.2,<3.0) of Doctrine DBAL, ORM & Common - fixed Propel1 versions difference between main and bridge files - fixed Twig versions difference between main and bridge files - to allow versions ~1.11 (>=1.11,<2.0) of Twig - fixed Locale ext-intl version to accept all, not non-existing version 2013-02-01 10:33:53 +01:00
Fabien Potencier
c1037b1603 merged branch vicb/fmwk/config (PR #6852)
This PR was squashed before being merged into the master branch (closes #6852).

Commits
-------

fde7585 [DIC] Better handling of enableable configurations

Discussion
----------

[DIC] Better handling of enableable configurations

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no, this feature has not been released yet
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

My definition of bug fix might be discussable. The thing which I think is not discussable is that this PR fixes the semantic - and I think it is important for a "semantic configuration": before this PR, some nodes had `->canBeDisabled` for nodes that were actually disabled by default. Those nodes now have `->canBeEnabled` which sounds right.

**Edit: Jan 28, 2013** - history:

See [the related comments](https://github.com/symfony/symfony/pull/6829#discussion_r2727742).

I think Symfony **must** get the configuration right as we can expect of lot of devs to use this as a template when writting their own configuration.

@schmittjoh could you please give me your feedback on [this change](https://github.com/symfony/symfony/pull/6852/files#L4R224) considering [the rationale](https://github.com/symfony/symfony/pull/6852/files#L3R7).

---------------------------------------------------------------------------

by stof at 2013-01-23T16:10:33Z

@vicb your links are broken as they are pointing to the PR creation page

---------------------------------------------------------------------------

by stof at 2013-01-23T16:10:55Z

and to create a TODO list, it has to be a list first

---------------------------------------------------------------------------

by vicb at 2013-01-23T16:31:10Z

@stof thanks for reporting the broken links, they are fixed /cc @schmittjoh

---------------------------------------------------------------------------

by vicb at 2013-01-23T16:31:50Z

@Tobion please submit a PR to my repo, I don't have much time to work on this. Thanks !

---------------------------------------------------------------------------

by vicb at 2013-01-25T15:14:47Z

@fabpot @schmittjoh I'd like your feedback on the latest commit, rationale is in the method phpDoc. It better matches what we do now and seem the most sensible thing to do.

edit: with this you can no more disable the node explicitly, I have to find a better solution

---------------------------------------------------------------------------

by schmittjoh at 2013-01-25T15:20:13Z

Looks good.

On Fri, Jan 25, 2013 at 4:15 PM, Victor Berchet <notifications@github.com>wrote:

> @fabpot <https://github.com/fabpot> @schmittjoh<https://github.com/schmittjoh>I'd like your feedback on the latest commit, rationale is in the method
> phpDoc. It better matches what we do now and seem the most sensible thing
> to do.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/symfony/symfony/pull/6852#issuecomment-12704585>.
>
>

---------------------------------------------------------------------------

by vicb at 2013-01-28T14:37:57Z

@fabpot I know I keep insisting on this one and I am sorry for that but I think this should be considered as a bug fix (see the PR header for details) and should be merged in 2.2. I think the Symfony core should be exemplary as it is used by many developers as a template when creating their own bundle. *This PR is no more a WIP and can be merged right now*.

In addition to fixing the enableable nodes, this PR contain new UTs and some fixes to the code / tests.

---------------------------------------------------------------------------

by fabpot at 2013-01-28T16:43:42Z

@vicb As explained in a comment, this is not a BC break as this feature does not exist in 2.1. So, I can make the change to the CHANGELOG if you want after merging, or I can let you make the change.

---------------------------------------------------------------------------

by vicb at 2013-01-28T16:46:33Z

I am going to change it right now !

---------------------------------------------------------------------------

by vicb at 2013-01-28T16:46:56Z

(and thanks for having checked this)

---------------------------------------------------------------------------

by vicb at 2013-01-28T16:54:37Z

@fabpot I have updated the changelog and the PR header.

I am not sure if the commits should be squashed or not. On one side the multiple commits can help understand the changes but on the other side that's a lot of small commits which could pollute history. I let you choose what to do.
2013-01-28 18:21:49 +01:00
Victor
fde7585967 [DIC] Better handling of enableable configurations 2013-01-28 18:21:49 +01:00
Victor
189a05e8c7 css fix 2013-01-25 15:47:14 +01:00
Fabien Potencier
3196dbdf52 Merge branch '2.1'
* 2.1:
  [DependencyInjection] fixed the creation of synthetic services in ContainerBuilder
  [Security] PHPDoc in SecurityEvents
  Fix typos in README
  Added an error message in the DebugClassLoader when using / instead of \.
  KNOWN_ISSUES with php 5.3.16
  [FrameworkBundle] fixed Client::doRequest that must call its parent method (closes #6737)
  [Yaml] fixed ignored text when parsing an inlined mapping or sequence (closes #6786)
  [Yaml] fixed #6773
  [Yaml] fixed #6770
  bumped Symfony version to 2.1.8-DEV
  bumped Symfony version to 2.0.23-DEV

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Client.php
	src/Symfony/Component/HttpKernel/Kernel.php
2013-01-23 21:21:00 +01:00
Fabien Potencier
7c957e3411 merged branch MaksSlesarenko/fix-for-choice-widget (PR #6734)
This PR was squashed before being merged into the master branch (closes #6734).

Commits
-------

4d51ec0 Fix for hardcode (#6384) in choice widget

Discussion
----------

Fix for hardcode (#6384) in choice widget

empty_value should not be disabled if field is not required!

#6384

---------------------------------------------------------------------------

by sstok at 2013-01-15T15:51:08Z

You need to revert the file mode changes (100644 → 100755)

---------------------------------------------------------------------------

by MaksSlesarenko at 2013-01-18T16:44:42Z

fixed tests

---------------------------------------------------------------------------

by MaksSlesarenko at 2013-01-21T15:36:59Z

ping @fabpot

---------------------------------------------------------------------------

by fabpot at 2013-01-21T15:58:26Z

ping @bschussek

---------------------------------------------------------------------------

by MaksSlesarenko at 2013-01-23T11:15:37Z

ping @fabpot @bschussek

---------------------------------------------------------------------------

by Tobion at 2013-01-23T12:08:19Z

I think it's good to squash and merge.

---------------------------------------------------------------------------

by fabpot at 2013-01-23T12:16:37Z

Can you rebase and squash before I merge? Thanks.

---------------------------------------------------------------------------

by MaksSlesarenko at 2013-01-23T19:51:36Z

@fabpot done
2013-01-23 20:54:36 +01:00
Maks Slesarenko
4d51ec05d8 Fix for hardcode (#6384) in choice widget 2013-01-23 20:54:35 +01:00
Fabien Potencier
65b4112ddb fixed a circular reference (closes #6730) 2013-01-23 14:48:08 +01:00
Fabien Potencier
4bdfb92a35 updated CHANGELOGS 2013-01-23 14:21:06 +01:00
Fabien Potencier
23f51450bd renamed proxy to router_proxy 2013-01-23 13:57:53 +01:00
Fabien Potencier
3193a90815 made the proxy path configurable 2013-01-23 13:57:53 +01:00
Fabien Potencier
ad82893691 removed the need for a proxy route for rendering strategies 2013-01-23 13:57:52 +01:00
Kris Wallsmith
731cd49781 made twig extension service private 2013-01-22 10:56:22 -08:00
Fabien Potencier
cdf1d72e2f [FrameworkBundle] fixed requirement of the _controller palceholder for the proxy route (closes #6783)
A controller name can be a service and service names can contain dots.
2013-01-22 10:57:00 +01:00
Fabien Potencier
bdc7e91865 Merge branch '2.0' into 2.1
* 2.0:
  [DependencyInjection] fixed the creation of synthetic services in ContainerBuilder
  [Security] PHPDoc in SecurityEvents
  [FrameworkBundle] fixed Client::doRequest that must call its parent method (closes #6737)
  [Yaml] fixed ignored text when parsing an inlined mapping or sequence (closes #6786)
  [Yaml] fixed #6773
  [Yaml] fixed #6770
  bumped Symfony version to 2.0.23-DEV

Conflicts:
	src/Symfony/Component/DependencyInjection/ContainerBuilder.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Yaml/Inline.php
	src/Symfony/Component/Yaml/Tests/InlineTest.php
2013-01-22 08:14:57 +01:00
Fabien Potencier
94f6116f42 renamed hostname to host in the routing system (closes #6775)
As explained in #6775, this has been done for the following reasons:

1. It's also Request::getHost()
2. The term hostname has been obsoleted in
http://tools.ietf.org/html/rfc3986#appendix-D.2 and uses the host only
3. hostname in the RFC was defined as the registered domain name, but we
probably also want to match IP-Adresses with the pattern which is the
host = IP-literal / IPv4address / reg-name for.
2013-01-21 17:57:32 +01:00
Fabien Potencier
1ab48db367 tweaked the deprecated error handler to actually display the deprecation message
I've also removed uninterested information (like the trigger_error stack
frame).
2013-01-20 16:29:41 +01:00
Fabien Potencier
c9cfcc1dc3 merged branch davedevelopment/new-twig-notation (PR #6805)
This PR was merged into the master branch.

Commits
-------

d5e73e5 [SecurityBundle] changed includes to use the new Twig notation

Discussion
----------

[SecurityBundle] changed includes to use the new Twig notation

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no - couple of unrelated failures
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A
2013-01-19 08:44:11 +01:00
Dave Marshall
d5e73e5e2b [SecurityBundle] changed includes to use the new Twig notation 2013-01-18 21:52:28 +00:00
Christophe Coevoet
44fe249bae Fixed some tests on Windows 2013-01-18 21:36:32 +01:00
Fabien Potencier
94cb13df42 [FrameworkBundle] fixed circular reference for service templating (closes #6730, closes #6762) 2013-01-18 15:46:50 +01:00
Fabien Potencier
ce38069a94 [FrameworkBundle] fixed Client::doRequest that must call its parent method (closes #6737) 2013-01-18 11:08:30 +01:00
Fabien Potencier
1f762c7723 Merge branch '2.1'
* 2.1:
  [Yaml] fixed default value
  Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.
  added a way to enable/disable object support when parsing/dumping
  added a way to enable/disable PHP support when parsing a YAML input via Yaml::parse()
  fixed CS
  [Process] Fix docblocks, remove `return` from `PhpProcess#start()` as parent returns nothing, cleaned up `ExecutableFinder`
  fixes a bug when output/error output contains a % character
  [Console] fixed input bug when the value of an option is empty (closes #6649, closes #6689)
  [Profiler] [Redis] Fix sort of profiler rows.
  Fix version_compare() calls for PHP 5.5.
  Removed underscores from test method names to be consistent with other components.
  [Process] In edge cases `getcwd()` can return `false`, then `proc_open()` should get `null` to use default value (the working dir of the current PHP process)
  Fix version_compare() calls for PHP 5.5.
  Handle the deprecation of IntlDateFormatter::setTimeZoneId() in PHP 5.5.
  removed the .gitattributes files (closes #6605, reverts #5674)
  [HttpKernel] Clarify misleading comment in ExceptionListener

Conflicts:
	src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig
	src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php
	src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php
	src/Symfony/Component/Form/Tests/Util/PropertyPathTest.php
	src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
	src/Symfony/Component/Process/Process.php
2013-01-17 16:25:59 +01:00
Fabien Potencier
4cc19990ac merged branch lmcd/wdt-padding-fix (PR #6769)
This PR was merged into the master branch.

Commits
-------

4b54156 Fix lack of padding in some WDT boxes (e.g. You are not authenticated.)

Discussion
----------

[WebProfilerBundle] Fix lack of padding in some WDT boxes (e.g. You are not authenticated.)

Fixes bug introduced by https://github.com/symfony/symfony/pull/6615

Before:
![wdt-padding-before](https://f.cloud.github.com/assets/363540/73453/c6779f30-6044-11e2-9df5-682c822ac13c.png)

After:
![wdt-padding-after](https://f.cloud.github.com/assets/363540/73455/cbeaa44e-6044-11e2-9d9b-9184b1351554.png)
2013-01-17 07:27:13 +01:00
Lee McDermott
4b541568ee Fix lack of padding in some WDT boxes (e.g. You are not authenticated.) 2013-01-17 01:20:55 +00:00
Lee McDermott
2d53698134 Make last toolbar info box right-aligned 2013-01-17 01:00:06 +00:00
Fabien Potencier
463b464c10 replaced usage of Route::getPattern() by Route::getPath() 2013-01-16 23:04:10 +01:00
Florin Patan
41d3953e76 Fix regression in WDT path/pattern naming 2013-01-16 17:51:26 +02:00
Fabien Potencier
efabb1e9ae merged branch lmcd/wdt-shadow-fix (PR #6615)
This PR was squashed before being merged into the master branch (closes #6615).

Commits
-------

490c746 [WDT] Toolbar cleanups

Discussion
----------

[WDT] Toolbar cleanups

Ok this is ridiculously minor, but it's one of those little things that winds me up on a daily basis so I fixed it.

When you mouseover a section on the WDT, the box-shadow is blurry on the right edge.

Edit: this PR now covers a few other minor tweaks - see below.

---------------------------------------------------------------------------

by lmcd at 2013-01-09T07:41:42Z

Just pushed a couple more changes that cleanup WDT popup boxes a little bit. Again the changes are subtle, but better imo.

Before:
![box1-before](https://f.cloud.github.com/assets/363540/52807/efc2cf7e-5a2f-11e2-9c42-1f5a33d667a9.png)

After:
![box1-after](https://f.cloud.github.com/assets/363540/52808/f4929c8c-5a2f-11e2-9195-7583979d8ce9.png)

Before:
![box2-before](https://f.cloud.github.com/assets/363540/52809/f8b1752c-5a2f-11e2-8166-a602e9e80d3a.png)

After:
![box2-after](https://f.cloud.github.com/assets/363540/52812/11791ede-5a30-11e2-92d4-b35c0d7ecc6b.png)

Note: requires cross-browser testing
2013-01-16 10:29:16 +01:00
Lee McDermott
490c746be9 [WDT] Toolbar cleanups 2013-01-16 10:29:15 +01:00
Fabien Potencier
2dfe9660a2 fixed CS 2013-01-16 10:27:54 +01:00
Fabien Potencier
89f9b24575 merged branch fabpot/routing-options (PR #6738)
This PR was merged into the master branch.

Commits
-------

9fc7def added the UPGRADE file for Symfony 3.0
e84cad2 [Routing] updated CHANGELOG
65eca8a [Routing] added new schemes and methods options to the annotation loader
5082994 [Routing] renamed pattern to path
b357caf [Routing] renamed hostname pattern to just hostname
e803f46 made schemes and methods available in XmlFileLoader
d374e70 made schemes and methods available in YamlFileLoader
2834e7e added scheme and method setter in RouteCollection
10183de make scheme and method requirements first-class citizen in Route

Discussion
----------

Routing options

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

In #5989, it has unanimously been decided to renamed `hostname_pattern` to `hostname` and `pattern` to `path`. That makes a lot of sense and I would like to do the renaming now as `hostname_pattern` is new in Symfony 2.2, so I'd like to avoid breaking BC just after the release. As we are modifying the route options, I've also included changes introduced by @Tobion in #6049 which were discussed in #5990.

As everything is BC, I think it's wise to include that in 2.2. What do you think?

---------------------------------------------------------------------------

by Tobion at 2013-01-14T18:25:53Z

I agree it should be done in 2.2. Thanks for working on it.

---------------------------------------------------------------------------

by vicb at 2013-01-14T23:11:12Z

@fabpot "Everything is BC" until it breaks BC in 3.0, that's why I'd like to see [deprecations in PR summary](https://github.com/symfony/symfony-docs/pull/2116) what do you think ?

---------------------------------------------------------------------------

by vicb at 2013-01-14T23:16:40Z

it would also be great to update the CHANGELOG with deprecations (it could also help people answering your question)

---------------------------------------------------------------------------

by fabpot at 2013-01-15T07:07:03Z

@vicb: I've just updated the CHANGELOG and created the UPGRADE file for 3.0.

---------------------------------------------------------------------------

by vicb at 2013-01-15T07:15:32Z

@fabpot thanks.
2013-01-15 17:25:04 +01:00
Fabien Potencier
b357cafd00 [Routing] renamed hostname pattern to just hostname 2013-01-14 17:14:02 +01:00
Pascal Borreli
b1c68815f5 Fixed PHPDoc 2013-01-11 17:38:19 +00:00
Alexander Miehe
f127781f2e Update src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Add use HttpKernelInterface for refactored forward method
2013-01-11 13:33:14 +01:00
Fabien Potencier
b58e8ce9aa merged branch fabpot/kernel-refactor (PR #6459)
This PR was merged into the master branch.

Commits
-------

76fefe3 updated CHANGELOG and UPGRADE files
f7da1f0 added some unit tests (and fixed some bugs)
f17f586 moved the container aware HTTP kernel to the HttpKernel component
2eea768 moved the deprecation logic calls outside the new HttpContentRenderer class
bd102c5 made the content renderer work even when ESI is disabled or when no templating engine is available (the latter being mostly useful when testing)
a8ea4e4 [FrameworkBundle] deprecated HttpKernel::forward() (it is only used once now and not part of any interface anyway)
1240690 [HttpKernel] made the strategy a regular parameter in HttpContentRenderer::render()
adc067e [FrameworkBundle] made some services private
1f1392d [HttpKernel] simplified and enhanced code managing the hinclude strategy
403bb06 [HttpKernel] added missing phpdoc and tweaked existing ones
892f00f [HttpKernel] added a URL signer mechanism for hincludes
a0c49c3 [TwigBridge] added a render_* function to ease usage of custom rendering strategies
9aaceb1 moved the logic from HttpKernel in FrameworkBundle to the HttpKernel component

Discussion
----------

[WIP] Kernel refactor

Currently, the handling of sub-requests (including ESI and hinclude) is mostly done in FrameworkBundle. It makes these important features harder to implement for people using only HttpKernel (like Drupal and Silex for instance).

This PR moves the code to HttpKernel instead. The code has also been refactored to allow easier integration of other rendering strategies (refs #6108).

The internal route has been re-introduced but it can only be used for trusted IPs (so for the internal rendering which is managed by Symfony itself, or by a trusted reverse proxy like Varnish for ESI handling). For the hinclude strategy, when using a controller, the URL is automatically signed (see #6463).

The usage of a listener instead of a controller to handle internal sub-requests speeds up things quite a lot as it saves one sub-request handling. In Symfony 2.0 and 2.1, the handling of a sub-request actually creates two sub-requests.

Rendering a sub-request from a controller can be done with the following code:

```jinja
{# default strategy #}
{{ render(path("partial")) }}
{{ render(controller("SomeBundle:Controller:partial")) }}

{# ESI strategy #}
{{ render(path("partial"), { strategy: 'esi' }) }}
{{ render(controller("SomeBundle:Controller:partial"), { strategy: 'esi' }) }}

{# hinclude strategy #}
{{ render(path("default1"), { strategy: 'hinclude' }) }}
```

The second commit allows to simplify the calls a little bit thanks to some nice syntactic sugar:

```jinja
{# default strategy #}
{{ render(path("partial")) }}
{{ render(controller("SomeBundle:Controller:partial")) }}

{# ESI strategy #}
{{ render_esi(path("partial")) }}
{{ render_esi(controller("SomeBundle:Controller:partial")) }}

{# hinclude strategy #}
{{ render_hinclude(path("default1")) }}
```

---------------------------------------------------------------------------

by fabpot at 2013-01-03T17:58:49Z

I've just pushed a new version of the code that actually works in my browser (but I've not yet written any unit tests). I've updated the PR description accordingly.

All comments welcome!

---------------------------------------------------------------------------

by Koc at 2013-01-03T20:11:43Z

what about `render(controller="SomeBundle:Controller:partial", strategy="esi")`?

---------------------------------------------------------------------------

by stof at 2013-01-04T09:01:01Z

shouldn't we have interfaces for the UriSigner and the HttpContentRenderer ?

---------------------------------------------------------------------------

by lsmith77 at 2013-01-04T19:28:09Z

btw .. as mentioned in #6213 i think it would make sense to refactor the HttpCache to use a cache layer to allow more flexibility in where to cache the data (including clustering) and better invalidation. as such if you are refactoring HttpKernel .. it might also make sense to explore splitting off HttpCache.

---------------------------------------------------------------------------

by fabpot at 2013-01-04T19:30:07Z

@lsmith77 This is a totally different topic. This PR is just about moving things from FrameworkBundle to HttpKernel to make them more reusable outside of the full-stack framework.

---------------------------------------------------------------------------

by fabpot at 2013-01-05T09:39:52Z

I think this PR is almost ready now. I still need to update the docs and add some unit tests. Any other comments on the whole approach? The class names? The `controller` function thingy? The URI signer mechanism? The proxy protection for the internal controller? The proxy to handle internal routes?

---------------------------------------------------------------------------

by sstok at 2013-01-05T10:08:25Z

Looks good to me 👍

---------------------------------------------------------------------------

by sdboyer at 2013-01-07T18:17:08Z

@Crell asked me to weigh in, since i'm one of the Drupal folks who's likely to work most with this.

i think i've grokked about 60% of the big picture here, and i'm generally happy with what i see. the assumption that the HInclude strategy makes about working with templates probably isn't one that we'll be able to use (and so, would need to write our own), but that's not a big deal since the whole goal here is to make strategies pluggable.

so, yeah. +1.

---------------------------------------------------------------------------

by winzou at 2013-01-09T20:21:44Z

Just for my information: will this PR be merged for 2.2 version? Thanks.

---------------------------------------------------------------------------

by stof at 2013-01-09T20:41:04Z

@winzou according to the blog post announcing the beta 1 release, yes. It is explicitly listed as being one of the reason to make it a beta instead of the first RC.

---------------------------------------------------------------------------

by winzou at 2013-01-09T20:49:36Z

OK thanks, I've totally skipped this blog post.

---------------------------------------------------------------------------

by fabpot at 2013-01-10T15:26:15Z

I've just added a bunch of unit tests and fix some bugs I found while writing the tests.
2013-01-11 08:24:18 +01:00
Fabien Potencier
b868bf6249 merged branch lmcd/php-sapi (PR #6636)
This PR was merged into the master branch.

Commits
-------

16b3426 Show PHP SAPI in WDT

Discussion
----------

[WDT] Show PHP SAPI in WDT

PHP running under Apache as a module:
![sapi-apache](https://f.cloud.github.com/assets/363540/53093/7709dc8a-5a48-11e2-8c09-031e0645e3ea.png)

PHP running with the in-built CLI web server (via `server:run`)
![sapi-cli](https://f.cloud.github.com/assets/363540/53094/96df9a0e-5a48-11e2-96e9-7bc2f452083d.png)
2013-01-11 08:00:38 +01:00
Fabien Potencier
39686077f8 merged branch bschussek/property-path (PR #6595)
This PR was merged into the master branch.

Commits
-------

6b1652e [PropertyAccess] Property path, small refactoring, read/writeProperty to read/write Property/Index.
1bae7b2 [PropertyAccess] Extracted PropertyAccess component out of Form

Discussion
----------

[PropertyAccess] Extracted PropertyAccess component out of Form

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

TODO: adapt DoctrineBundle/PropelBundle to pass the "property_accessor" service to EntityType/ModelType

Usage:

```php
$accessor = PropertyAccess::getPropertyAccessor();

// equivalent to $object->getFoo()->setBar('value')
$accessor->setValue($object, 'foo.bar', 'value');

// equivalent to $object->getFoo()->getBar()
$accessor->getValue($object, 'foo.bar');

// equivalent to $object->getFoo()['bar']
$accessor->getValue($object, 'foo[bar]');

// equivalent to $array['foo']->setBar('value')
$accessor->setValue($array, '[foo].bar', 'value');

// equivalent to $array['foo']['bar']
$accessor->getValue($array, '[foo][bar]');
```

Later on, once we have generation and caching of class-specific accessors, configuration will be something like this (consistent with the Form and Validator component):

```php
$accessor = PropertyAccess::getPropertyAccessorBuilder()
    ->setCacheDirectory(__DIR__ . '/cache')
    ->setCacheLifeTime(86400)
    ->enableMagicGetSet()
    ->enableMagicCall()
    ->getPropertyAccessor();
```

or

```php
$accessor = PropertyAccess::getPropertyAccessorBuilder()
    ->setCache($cache)
    ->getPropertyAccessor();
```

etc.

---------------------------------------------------------------------------

by Burgov at 2013-01-07T08:48:15Z

+1. I use this feature outside of the Form context a lot

---------------------------------------------------------------------------

by stof at 2013-01-07T08:49:34Z

The classes in the Form component should be kept for BC (and deprecated) for people using the feature

---------------------------------------------------------------------------

by michelsalib at 2013-01-07T10:02:19Z

YES YES YES 👍. Sorry for my enthusiasm, but I already copy pasted the PropertyPath class to some of my libraries to avoid linking to the whole Form component. I thus will be glad to officially use this component into my libraries via composer.

---------------------------------------------------------------------------

by norzechowicz at 2013-01-07T10:17:39Z

Same as @michelsalib to avoid linking full Form component I was using copied parts of code. Can't wait to use this component in my lib. 👍

---------------------------------------------------------------------------

by bschussek at 2013-01-07T10:43:41Z

I split away `getValue()` and `setValue()` from `PropertyPath` into a new class `ReflectionGraph`. The component is also named ReflectionGraph now.

---------------------------------------------------------------------------

by michelsalib at 2013-01-07T10:47:10Z

I am not found of the name. What do you intend to do in the component more than what PropertyPath does ?

---------------------------------------------------------------------------

by bschussek at 2013-01-07T10:58:59Z

@michelsalib A `PropertyPath` is simply a string like `foo.bar[baz]`. `getValue()` and `setValue()` interpret this path. There may be different interpretations for the same path, so these methods were split into a new class.

I chose the name `ReflectionGraph` because the functionality is very similar to `ReflectionProperty`.

```php
$reflProperty = new ReflectionProperty('Vendor/Class', 'property');
$reflProperty->setValue($object, 'foo');

$reflGraph = new ReflectionGraph();
$reflGraph->setValue($object, 'property.path', 'foo');
```

---------------------------------------------------------------------------

by michelsalib at 2013-01-07T11:00:42Z

What about naming it `Reflection`, maybe sometime we will want to add more reflection tools for classes, interfaces... ?

---------------------------------------------------------------------------

by bschussek at 2013-01-07T11:02:32Z

@michelsalib I doubt that we will do that. PHP's implementation is sufficient.

---------------------------------------------------------------------------

by vicb at 2013-01-07T11:03:57Z

> Backwards compatibility break: no

Really ?

---------------------------------------------------------------------------

by michelsalib at 2013-01-07T11:05:07Z

Well, that is just a suggestion. If I am the only one to oppose, I won't complain.

---------------------------------------------------------------------------

by bschussek at 2013-01-07T11:09:08Z

> Really ?

@vicb Would you please refrain from such meanginless comments in the future? I'm getting a bit tired of them. If you think that BC is broken somewhere, tell me where so that I can fix it.

---------------------------------------------------------------------------

by stof at 2013-01-07T11:09:43Z

@vicb There is no BC break as he kept deprecated classes for BC

---------------------------------------------------------------------------

by norzechowicz at 2013-01-07T11:13:12Z

@bschussek what do you think about some kind of factory for Reflection? This will prevent creating new Reflection objects each time you want to access properties values.

---------------------------------------------------------------------------

by vicb at 2013-01-07T11:18:47Z

@bschussek my point is that my comment is no more meaningless than closing #6453 because it will break BC.We could also keep BC by extending the classes in the new ns but in both cases BC will ultimately be broken (when the legacy classes are removed)

---------------------------------------------------------------------------

by vicb at 2013-01-07T12:23:45Z

@bschussek @stof I think that modifying the constructor signatures of `EntityChoiceList`, `FormType` are BC breaks (this is not an exhaustive list)

---------------------------------------------------------------------------

by bschussek at 2013-01-07T12:35:13Z

@vicb You are right. I added corresponding entries to the CHANGELOG and adapted the above description.

---------------------------------------------------------------------------

by vicb at 2013-01-08T13:39:13Z

@bschussek looking at this PR, I was wondering if an alternate syntax would make sense:

```php
<?php
$reflGraph = new ReflectionGraph($object);

// equivalent to $object->getFoo()->setBar('value')
$reflGraph['foo.bar'] = 'value';

// equivalent to $object->getFoo()->getBar()
$reflGraph['foo.bar'];
```

_Sorry for the off topic_

---------------------------------------------------------------------------

by vicb at 2013-01-08T13:49:46Z

The advantage of using such a `ReflectionGraph` factory is that it might be easier to return specialized reflection graphs, ie optimized instances (that would be cached).

---------------------------------------------------------------------------

by Toflar at 2013-01-08T14:49:54Z

I was also puzzled by the fact that there will be many `ReflectionGraph` instances although they don't have to. I'm with @vicb and I'd also vote for using the constructor to set the subject you're working on. Otherwise you'll repeat yourself over and over again by passing the subject - say `$object` - to `getValue()` or `setValue()`. If however you don't like the constructor thing then why do we have to have an instance of `ReflectionGraph` rather than just go for static methods and use `ReflectionGraph::getValue()` and `ReflectionGraph::setValue()`?

In my opinion there are a few methods that could be static anyway (especially some private ones) :)

But probably I misunderstood something as I'm just about to discover the SF components and don't have any experience working with them (so basically I just read the PR because of @bschussek's tweet :D)

Couldn't come up with any intuitive name for the component though :(
Generally when we talk about "getting" and "setting" values we call those things "mutators"...so `GraphMutator` might be more intuitive than the word `Reflection` :)

---------------------------------------------------------------------------

by Taluu at 2013-01-08T14:57:42Z

I like the last proposition made by @vicb (implementing `ArrayAccess` on `ReflectionGraph` - or whatever name will be chosen (`PathMutator` for example :D), and also specify which object should be worked on in the constructor rather than in each method).

Would this also be used in the `Validator` component ?

---------------------------------------------------------------------------

by stof at 2013-01-08T15:16:12Z

@Toflar A static ``ReflectionGraph::getValue()`` means you have a coupling to the implementation (as with any static call). The current implementation allows you to replace it with your own implementation as long as you implement the interface as it follows the DI pattern (as done in other places in Symfony).

@vicb The issue with ``$reflGraph = new ReflectionGraph($object);`` is that you cannot inject the ReflectionGraph anymore, as you need a new one each time. This would mean adding a ``ReflectionGraphFactory`` to be injected (and which could then be replaced by a factory using code generation). Using the constructor directly would not allow using a replacement based on code generation later. So the resulting code would more likely be

```php

$reflGraph = new ReflectionGraph();

$mutator = $reflGraph->getMutator($object);

// equivalent to $object->getFoo()->setBar('value')
$mutator['foo.bar'] = 'value';

// equivalent to $object->getFoo()->getBar()
$mutator['foo.bar'];
```

Btw, writing this, I find the naming Mutator suggested by @Taluu good when it concerns the setter, but quite weird when getting the value.

---------------------------------------------------------------------------

by Taluu at 2013-01-08T15:21:00Z

I was not the one to suggest though, it was @everzet. But then something like `PathAccessor`, as it is both a mutator and a getter ? I also like @stof suggestion, still in the idea of avoiding to have to put the object as an argument and also allowing to use an `ArrayAccess` interface..

---------------------------------------------------------------------------

by vicb at 2013-01-08T15:21:54Z

@stof your remark makes sense.

What about `Accessor`, the benefit being that it might well be the name of a coming PHP feature: https://wiki.php.net/rfc/propertygetsetsyntax-v1.2

---------------------------------------------------------------------------

by everzet at 2013-01-08T15:27:02Z

```php
$manager = new PropertyManager(new PropertyPath());
$num = $manager->getValue($object, 'foo.num');
$manager->setValue($object, 'foo.num', $num + 1);

$objectManager = new ObjectPropertyManager($object[, $manager]);
$num = $objectManager->getValue('foo.num');
$objectManager->setValue('foo.num', $num + 1);

$objectManager['foo.num'] += 1;
```

---------------------------------------------------------------------------

by bschussek at 2013-01-08T15:28:01Z

It might be me, but I don't like `ArrayAccess` to be misused for features like that. If I access a key in an array access structure, I expect it to be something like a collection, an associative array or a key value store. This class is neither.

Putting that aside, an accessor for a specific object might make sense, but I'm not sure about that yet.

```php
$reflObject->setValue('foo.bar', 'value');
$reflObject->getValue('foo.bar');
```

---------------------------------------------------------------------------

by stof at 2013-01-08T15:28:52Z

@vicb I would vote for PathAccessor then, as we are not doing simple accessor but accessors through a path in an object graph.
In my snippet above, we would then have a ReflectionGraph instance and a PathAccessor instance (``$mutator``).

Btw, I would also keep the methods ``setValue`` and ``getValue``. I find it more clear.

---------------------------------------------------------------------------

by bschussek at 2013-01-08T15:32:07Z

@stof But then we're rather left with the question of ReflectionGraph **vs.** PathAccessor. I don't think that the tiny interface difference (one global, one object-based) justifies the big naming difference.

---------------------------------------------------------------------------

by vicb at 2013-01-08T15:33:24Z

> This class is neither.

It might be `$pa['foo.bar[baz]'] = $pa['foo.bar']['baz'];` I don't know if it would help though.

---------------------------------------------------------------------------

by stof at 2013-01-08T15:35:51Z

@bschussek In my suggestion, ``ReflectionGraph`` is a factory for the PathAccessor objects. It is not accessing anymore itself (which would probably continue to cause issues to implement it with code generation). But the naming could indeed be changed to something else.
2013-01-10 19:35:24 +01:00
Fabien Potencier
f0a66db79a merged branch Seldaek/psr3 (PR #6628)
This PR was merged into the master branch.

Commits
-------

67d7423 Remove use of deprecated HttpKernel LoggerInterface
dca4528 [HttpKernel] Extend psr/log's NullLogger class
1e5a890 [Monolog] Mark old non-PSR3 methods as deprecated
91a86f8 [HttpKernel][Monolog] Add PSR-3 support to the LoggerInterface

Discussion
----------

[HttpKernel][MonologBridge] PSR-3 support

This enables PSR-3 support and monolog 1.3+. The first commit is the main part. The rest deals with deprecation of short-hand methods (warn/err/crit/emerg) that are fully expanded in PSR-3 (warning/error/critical/emergency).

The downside of deprecating them is that for bundles it's a bit harder to support older and newer versions. If that is too much of a hassle you can drop that for now and cherry pick the first commit.

The upside is that it forces people to move towards PSR-3 compatible stuff, which means eventually we could completely drop the LoggerInterface from the framework. In any case I think the documentation should only mention the `Psr\Log\LoggerInterface` and people should start hinting against that. The change should be done in core as well I suppose.

Anyway I wanted to throw this out there as it is to get feedback.

---------------------------------------------------------------------------

by stof at 2013-01-09T09:15:15Z

@Seldaek I also think you should change the typehint to use the PSR LoggerInterface in all classes using the logger

---------------------------------------------------------------------------

by Seldaek at 2013-01-09T09:54:55Z

OK updated according to all the feedback. I tested it in an app and it still seems to work so there shouldn't be any major issues.

---------------------------------------------------------------------------

by Seldaek at 2013-01-09T09:59:55Z

@fabpot if you merge please merge also the bundle PR, otherwise it won't be possible to update without conflict.

---------------------------------------------------------------------------

by frosas at 2013-01-10T14:59:20Z

I'm trying to understand why a `composer update` of a Symfony 2.1.* resulted in a fatal error. Shouldn't a stable version don't break like this?

As @olaurendeau points, why Symfony depends 1.* instead of 1.2.*? Or why Monolog 1.3 breaks its public interface (EDIT: I'm not sure about it)? Or why isn't this PR being merged (into branch 2.1) at the same time Monolog 1.3 is released?

Please, understand I'm not looking for who to blame, it's just I want to know if this situation is unexpected or if otherwise a `composer update` on a stable branch is not as innocent as it seems.

---------------------------------------------------------------------------

by stof at 2013-01-10T15:06:51Z

@frosas it cannot be merged into 2.1 as it is a BC break. The 2.1 branch has been updated to forbid Monolog 1.3 already

---------------------------------------------------------------------------

by Seldaek at 2013-01-10T15:11:58Z

@frosas you can blame me for releasing as 1.3.0 and not 2.0, but technically for monolog this isn't really a BC break, I just added an interface. The problem is due to the way it's used in symfony, it ended up as a fatal error. In any case the situation is now sorted out I think.

---------------------------------------------------------------------------

by frosas at 2013-01-10T15:26:43Z

@stof now I see this `>=1.0,<1.3-dev` change in the 2.1 branch. Now, shouldn't a new (2.1.7) version be released for all of us not in the dev minimum-stability?

@Seldaek then do you see feasible to rely only in X.Y.* versions to avoid this kind of errors?

---------------------------------------------------------------------------

by Seldaek at 2013-01-10T15:45:22Z

@frosas relying on X.Y.* is painful because you always need to wait until someone updates the constraint to get the new version. Of course using ~1.3 like in this PR means if I fuck up and break BC people will update to it, but that's a less likely occurrence than the alternative I think, so I would rather not use X.Y.*

---------------------------------------------------------------------------

by frosas at 2013-01-10T15:50:50Z

@Seldaek you are right about this, but I was thinking more in changing it only for the stable versions. EDIT: I mean, how often do you need a new feature in a branch you only apply fixes to?

---------------------------------------------------------------------------

by stof at 2013-01-10T15:57:32Z

@frosas Monolog and Symfony have separate release cycles. Foorcing Symfony users to use an old version of Monolog until they update to a new version of Symfony whereas the newer Monolog is compatible is a bad idea. Thus, as Monolog keeps BC, it does not maintain bugfix releases for all older versions (just like Twig does too). So it would also forbid you to get the fixes done in newer Monolog versions.

The incompatibility between Symfony 2.1 LoggerInterface and PSR-3 (whereas they expect exactly the same behavior and signature for methods with the same name) is unfortunate and is the reason why we get some issues here.

---------------------------------------------------------------------------

by frosas at 2013-01-10T16:21:06Z

@stof I appreciate you prefer to allow newer versions at the price of having to be constantly monitoring its changes to avoid breaks.

Another similar but safer strategy would be to stick to X.Y.* versions and upgrade to X.Y+1.* once the new version integration is tested, but I understand this is discutible in projects as close to Symfony as Monolog.

Returning to the issue, what do you say to release this 2.1.7 version? Or is it only me who is having issues here?

---------------------------------------------------------------------------

by stof at 2013-01-10T16:26:20Z

@frosas a minor release should not break BC when following smeantic versionning (Symfony warned about the fact it is not strictly followed for the first releases of 2.x). But as far as monolog is concerned, 1.3 is BC with 1.2.

---------------------------------------------------------------------------

by Seldaek at 2013-01-10T16:49:55Z

@frosas sorry I didn't get you still had the problem. I tagged a 2.1.7 of monologbundle which hopefully fixes your issue.
2013-01-10 17:57:14 +01:00
Fabien Potencier
76fefe3537 updated CHANGELOG and UPGRADE files 2013-01-10 17:09:48 +01:00
Fabien Potencier
f7da1f0eb8 added some unit tests (and fixed some bugs) 2013-01-10 16:26:59 +01:00
Fabien Potencier
3e99f4e976 merged branch asm89/issue-837 (PR #4935)
This PR was merged into the master branch.

Commits
-------

73db84f [Security] Move translations file to 'security' domain
324703a [Security] Switch to English messages as message keys
aa74769 [Security] Fix CS + unreachable code
2d7a7ba [Security] Fix `AuthenticationException` serialization
50d5724 [Security] Introduced `UsernameNotFoundException#get/setUsername`
39da27a [Security] Removed `get/setExtraInformation`, added `get/set(Token|User)`
837ae15 [Security] Add note about changed constructor to changelog
d6c57cf [FrameworkBundle] Register security exception translations
d7129b9 [Security] Fix exception constructors called in `UserChecker`
0038fbb [Security] Add initial translations for AccountStatusException childs
50e2cfc [Security] Add custom `getMessageKey` AccountStatusException childs
1147977 [Security] Fix InsufficientAuthenticationException constructor calls
79430b8 [Security] Fix AuthenticationServiceException constructor calls
42cced4 [Security] Fix AuthenticationException constructor calls
963a1d7 [Security] Add initial translations for the exceptions
ed6eed4 [Security] Add `getMessageKey` and `getMessageData` to auth exceptions
694c47c [Security] Change signature of `AuthenticationException` to match `\Exception`

Discussion
----------

[2.2][Security] AuthenticationException enhancements

Bug fix: semi
Feature addition: yes
Backwards compatibility break: yes
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=issue-837)](http://travis-ci.org/asm89/symfony)
Fixes the following tickets: #837
License of the code: MIT

This PR adds the functionality discussed in #837 and changes the constructor of the `AuthenticationException` to match that of `\Exception`. This PR will allow developers to show a translated (save) authentication exception message to the user. :)

*Todo:*
- Add some functional test to check that the exceptions can indeed be translated?
- Get feedback on the current English messages

---------------------------------------------------------------------------

by asm89 at 2012-07-15T14:04:11Z

ping @schmittjoh

---------------------------------------------------------------------------

by schmittjoh at 2012-07-15T14:57:32Z

Looks good to me.

While you are at the exceptions, I think we can also get rid of the "extra information" thing and replace it by explicit getters/setters. Mostly that will mean adding set/getToken, set/getUser, set/getUsername. Bundles might add custom exceptions which have other data. This will make it a bit more useful and predictable.

---------------------------------------------------------------------------

by asm89 at 2012-07-15T15:40:45Z

@schmittjoh I removed the `get/setExtraInformation` and added the more explicit getters/setters as you suggested.

---------------------------------------------------------------------------

by asm89 at 2012-07-15T19:33:15Z

@fabpot Did you reschedule this for 2.2? Why? It was originally a 2.1 ticket. I think it is an important one because at the moment there is no reliable way to show users the cause of an `AuthenticationException` without the threat of exposing sensitive information. This issue has been around for a while, see the original issue this PR refers to, or for example [this TODO comment in FOSUB](https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Controller/SecurityController.php#L37).

The PR itself is ready to merge now. My only question that remains is about whether the actual translations should be functional tested?

---------------------------------------------------------------------------

by fabpot at 2012-07-15T19:43:19Z

We need to stop at some point. If not, we never release anything. beta3 was scheduled for today and I don't plan any other one before the first RC and I won't have time to review this PR next week. So, if you, @schmittjoh, @vicb, @stof, and a few other core devs "validate" this PR, I might consider merging it before 2.1.

---------------------------------------------------------------------------

by asm89 at 2012-07-15T19:46:09Z

@fabpot I totally agree with your point of view. I just have been trying to pickup some security issues that were still open. :)

---------------------------------------------------------------------------

by stof at 2012-07-15T19:50:29Z

This looks good to me

---------------------------------------------------------------------------

by asm89 at 2012-08-12T09:06:24Z

Since the beta period is over I assume the window was missed to get this security related PR in 2.1. If I have feedback from @fabpot I'll still try to make it mergeable asap though.

---------------------------------------------------------------------------

by fabpot at 2012-08-13T10:10:32Z

@asm89 This would indeed be considered for merging in 2.2.

---------------------------------------------------------------------------

by Antek88 at 2012-10-03T10:30:46Z

+1

---------------------------------------------------------------------------

by stof at 2012-10-04T21:27:15Z

@asm89 could you rebase this PR ? It conflicts with master

---------------------------------------------------------------------------

by fabpot at 2012-10-05T17:16:44Z

What's the status of this PR? @asm89 Have you taken all the feedback into account?

---------------------------------------------------------------------------

by stof at 2012-10-13T17:48:48Z

@asm89 ping

---------------------------------------------------------------------------

by fabpot at 2012-10-29T09:48:40Z

@asm89 If you don't have time, I can finish the work on this PR, but can you just tell me what's left?

---------------------------------------------------------------------------

by asm89 at 2012-10-29T10:02:22Z

I can pick this up, but I have two outstanding questions:
- One about adding `::create()`? https://github.com/symfony/symfony/pull/4935#discussion_r1358297
- And what is the final verdict on the messages? https://github.com/symfony/symfony/pull/4935#discussion_r1165701 The initial idea was that the exception itself have an exception message which is plain english and informative for the developer. If you want to display the 'safe' user messages you have the optional dependency on the translator. There is a comparison made with the Validator component, but in my opinion that's a different case because the violations always contain the message directed at the user and have no plain english message for the developer. Apart from that the Validator component contains it's own code for replacing `{{ }}` variables in messages (duplication? not as flexible as the translator). Concluding I'd opt for: optional dependency on translator component if you want to show 'safe' user messages + message keys.

@schmittjoh Any things to add?

---------------------------------------------------------------------------

by schmittjoh at 2012-10-29T10:14:09Z

Message keys sound good to me. I wouldn't add the ``create`` method for now.

On Mon, Oct 29, 2012 at 11:02 AM, Alexander <notifications@github.com>wrote:

> I can pick this up, but I have two outstanding questions:
>
>    - One about adding ::create()? symfony/symfony#4935<https://github.com/symfony/symfony/issues/4935#discussion_r1358297>
>    - And what is the final verdict on the messages? symfony/symfony#4935<https://github.com/symfony/symfony/issues/4935#discussion_r1165701>The initial idea was that the exception itself have an exception message
>    which is plain english and informative for the developer. If you want to
>    display the 'safe' user messages you have the optional dependency on the
>    translator. There is a comparison made with the Validator component, but in
>    my opinion that's a different case because the violations always contain
>    the message directed at the user and have no plain english message for the
>    developer. Apart from that the Validator component contains it's own code
>    for replacing {{ }} variables in messages (duplication? not as
>    flexible as the translator). Concluding I'd opt for: optional dependency on
>    translator component if you want to show 'safe' user messages + message
>    keys.
>
> @schmittjoh <https://github.com/schmittjoh> Any things to add?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/symfony/symfony/pull/4935#issuecomment-9861016>.
>
>

---------------------------------------------------------------------------

by fabpot at 2012-10-29T10:27:37Z

As I said in the discussion about the translations, I'm -1 for the message keys to be consistent with how we manage translations everywhere else in the framework.

---------------------------------------------------------------------------

by stof at 2012-10-29T10:30:50Z

@fabpot When we changed the English translation for the validation errors in 2.1, we had to tag the commit as a BC rbeak as it was changing the source for all other translations. And if you look at the state of the files now, you will see that we are *not* using the English as source anymore in some places as some validation errors have a pluralized translation but the source has not been changed.
So I think using a key is more future-proof.

---------------------------------------------------------------------------

by asm89 at 2012-10-30T19:44:49Z

Any final decision on this? On one hand I have @stof and @schmittjoh +1 on message keys, on the other @fabpot -1. I guess it's your call @fabpot.

Edit: also @vicb seemed to be +1 on message keys earlier on.

---------------------------------------------------------------------------

by drak at 2012-11-01T20:19:00Z

I am also -1, I agree with @fabpot

---------------------------------------------------------------------------

by asm89 at 2012-11-12T09:38:51Z

@fabpot Can you please give a definite answer on this? I personally think @stof and @vicb have good points to do message keys, but with all these different people +1 and -1'ing the PR I'm lost on what it should actually do.

---------------------------------------------------------------------------

by asm89 at 2012-11-14T09:59:06Z

ping @fabpot

---------------------------------------------------------------------------

by asm89 at 2012-11-26T10:01:27Z

ping @fabpot We talked about this in Berlin. Any final thoughts on the PR? :) One idea was to do message keys + opt depend on the translator component if you want to use them, or use your own implementation.

---------------------------------------------------------------------------

by fabpot at 2012-11-26T14:01:37Z

The conclusion is: keep using plain English.

On Mon, Nov 26, 2012 at 11:01 AM, Alexander <notifications@github.com>wrote:

> ping @fabpot <https://github.com/fabpot> We talked about this in Berlin.
> Any final thoughts on the PR? :) One idea was to do message keys + opt
> depend on the translator component if you want to use them, or use your own
> implementation.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/symfony/symfony/pull/4935#issuecomment-10709997>.
>
>

---------------------------------------------------------------------------

by Inori at 2012-11-26T15:00:22Z

is this final? if not, then +1 for message keys

---------------------------------------------------------------------------

by vicb at 2012-11-27T22:33:47Z

@fabpot I can't understand why we keep discussing this for months as this implementation use *both* keys and plain Englis, ie using  keys  is optional ( if it was not it would not be an issue according to #6129)

---------------------------------------------------------------------------

by asm89 at 2013-01-02T21:43:46Z

@fabpot @vicb I'll rebase this PR, fix the comments and refactor the message keys to use plain English + {{ }} syntax for the placeholders.

---------------------------------------------------------------------------

by asm89 at 2013-01-07T15:00:58Z

@fabpot If I fix this tonight, will it make the beta?

---------------------------------------------------------------------------

by fabpot at 2013-01-07T15:53:00Z

yes, definitely.

---------------------------------------------------------------------------

by asm89 at 2013-01-07T20:13:38Z

@fabpot I switched the implementation to English messages instead of message keys and fixed the final comments + rebased. Anything you want me to do after this?

Still happy with `getMessageKey()`?
2013-01-10 14:38:06 +01:00
Bernhard Schussek
1bae7b242c [PropertyAccess] Extracted PropertyAccess component out of Form 2013-01-10 09:49:37 +01:00
Fabien Potencier
f17f5867a8 moved the container aware HTTP kernel to the HttpKernel component 2013-01-10 09:21:32 +01:00
Fabien Potencier
2eea7682e7 moved the deprecation logic calls outside the new HttpContentRenderer class 2013-01-10 09:21:32 +01:00
Fabien Potencier
bd102c5eba made the content renderer work even when ESI is disabled or when no templating engine is available (the latter being mostly useful when testing) 2013-01-10 09:21:31 +01:00
Fabien Potencier
a8ea4e4b10 [FrameworkBundle] deprecated HttpKernel::forward() (it is only used once now and not part of any interface anyway) 2013-01-10 09:21:31 +01:00
Fabien Potencier
1240690cac [HttpKernel] made the strategy a regular parameter in HttpContentRenderer::render() 2013-01-10 09:21:31 +01:00
Fabien Potencier
adc067e938 [FrameworkBundle] made some services private 2013-01-10 09:21:31 +01:00
Fabien Potencier
892f00ffee [HttpKernel] added a URL signer mechanism for hincludes 2013-01-10 09:21:31 +01:00
Fabien Potencier
9aaceb19ee moved the logic from HttpKernel in FrameworkBundle to the HttpKernel component 2013-01-10 09:21:30 +01:00
Lee McDermott
16b342607c Show PHP SAPI in WDT 2013-01-09 10:34:35 +00:00
Jordi Boggiano
67d7423456 Remove use of deprecated HttpKernel LoggerInterface 2013-01-09 10:52:29 +01:00
Fabien Potencier
3a4869dd14 merged branch Tobion/relative-path (PR #3958)
This PR was merged into the master branch.

Commits
-------

6703fb5 added changelog entries
1997e2e fix phpdoc of UrlGeneratorInterface that missed some exceptions and improve language of exception message
f0415ed [Routing] made reference type fully BC and improved phpdoc considerably
7db07d9 [Routing] added tests for generating relative paths and network paths
75f59eb [Routing] add support for path-relative and scheme-relative URL generation

Discussion
----------

[2.2] [Routing] add support for path-relative URL generation

Tests pass: yes
Feature addition: yes
BC break: <del>tiny (see below)</del> NO
deprecations: NO

At the moment the Routing component only supports absolute and domain-relative URLs, e.g.
`http://example.org/user-slug/article-slug/comments` and
`/user-slug/article-slug/comments`.

But there are two link types missing: schema-relative URLs and path-relative URLs.
schema-relative: e.g. `//example.org/user-slug/article-slug/comments`
path-relative: e.g. `comments`.

Both of them would now be possible with this PR. I think it closes a huge gap in the Routing component.
Use cases are pretty common. Schema-relative URLs are for example used when you want to include assets (scripts, images etc) in a secured website with HTTPS. Path-relative URLs are the only option when you want to generate static files (e.g. documentation) that can be downloaded as an HTML archive. Such use-cases are currently not possible with symfony.

The calculation of the relative path based on the request path and target path is hightly unit tested. So it is really equivalent. I found several implemenations on the internet but none of them worked in all cases. Mine is pretty short and works.

I also added an optional parameter to the twig `path` function, so this feature can also be used in twig templates.

Ref: This implements path-relative URLs as suggested in #3908.

<del>[BC BREAK] The signature of UrlGeneratorInterface::generate changed to support scheme-relative and path-relative URLs. The core UrlGenerator is BC and does not break anything, but users who implemented their own UrlGenerator need to be aware of this change. See UrlGenerator::convertReferenceType.</del>

---------------------------------------------------------------------------

by jalliot at 2012-04-16T09:56:56Z

@Tobion For completeness, you should add the option to the `url` and `asset` twig functions/template helpers.

---------------------------------------------------------------------------

by stof at 2012-04-16T10:46:06Z

@jalliot adding the option to ``url`` does not make any sense. The difference between ``path`` and ``url`` is that ``path`` generates a path and ``url`` generates an absolute url (thus including the scheme and the hostname)

---------------------------------------------------------------------------

by Tobion at 2012-04-16T12:27:49Z

@stof I guess jalliot meant we could then generate scheme-relative URLs with `url`. Otherwise this would have no equivalent in twig.

---------------------------------------------------------------------------

by jalliot at 2012-04-16T12:34:08Z

@stof Yep I meant what @Tobion said :)

---------------------------------------------------------------------------

by Tobion at 2012-04-18T11:57:04Z

The $relative parameter I added besides the existing $absolute parameter of the `->generate` method was not clear enough. So I merged those into a different parameter `referenceType`. I adjusted all parts of symfony to use the new signature. And also made the default `UrlGenerator` implementation BC with the old style. So almost nobody will recognize a change. The only BC break would be for somebody who implemented his own `UrlGenerator` and did not call the parent default generator.
Using `referenceType` instead of a simple Boolean is much more flexible. It will for example allow a custom generator to support a new reference type like http://en.wikipedia.org/wiki/CURIE

---------------------------------------------------------------------------

by Tobion at 2012-04-18T13:34:58Z

ping @schmittjoh considering your https://github.com/schmittjoh/JMSI18nRoutingBundle/blob/master/Router/I18nRouter.php would need a tiny change

---------------------------------------------------------------------------

by schmittjoh at 2012-04-18T13:37:39Z

Can you elaborate the necessary change?

---------------------------------------------------------------------------

by Tobion at 2012-04-18T13:51:10Z

This PR changes the signature of `generate` to be able to generate path-relative and scheme-relative URLs. So it needs to be
`public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)` and your implementation would need to change `if ($absolute && $this->hostMap) {` to `if (self::ABSOLUTE_URL === $referenceType && $this->hostMap) {`
I can do a PR if this gets merged.

---------------------------------------------------------------------------

by schmittjoh at 2012-04-18T13:52:14Z

If I understand correctly, the old parameter still works, no?

edit: Ah, ok I see what you mean now.

---------------------------------------------------------------------------

by Tobion at 2012-04-18T13:56:33Z

Yeah the old parameter still works but $absolute would also evaluate to true (a string) in your case for non-absolute URLs, i.e. paths.

---------------------------------------------------------------------------

by Tobion at 2012-04-19T21:09:46Z

ping @fabpot

---------------------------------------------------------------------------

by fabpot at 2012-04-20T04:30:18Z

Let's discuss that feature for 2.2.

---------------------------------------------------------------------------

by Tobion at 2012-04-20T10:40:59Z

What are your objections against it? It's already implemented, it works and it adds support for things that are part of a web standard. The BC break is tiny at the moment (almost nobody is affected) because the core UrlGenerator works as before. But if we waited for 2.2 it will be much harder to make the transition because 2.1 is LTS. So I think is makes sense to add it now. Furthermore it makes it much more future-proof as custom generators can more easiliy add support for other link types like CURIE. At the moment a Boolean for absolute URLs is simply too limited and also somehow inconsistent because $absolute = false stands for an absolute path. You see the awkwardness in this naming.

Btw, I added a note in the changelog. And I will add documentation of this feature in symfony-docs once this is merged.

---------------------------------------------------------------------------

by fabpot at 2012-04-20T12:14:32Z

nobody has ever said that 2.1 would be LTS. Actually, I think we are going to wait for 2.3 for LTS.

---------------------------------------------------------------------------

by Tobion at 2012-04-20T12:27:18Z

Well what I meant is, the longer we wait with this, the harder to apply it.
In 04ac1fdba2 you modified `generate` signature for better extensibility that is not even made use of. I think changing `$abolute` param goes in the same direction and has direct use.

I'd like to know your reason to wait for 2.2. Not enough time to review it, or afraid of breaking something, or marketing for 2.2?

---------------------------------------------------------------------------

by stof at 2012-04-20T16:28:27Z

@Tobion the issue is that merging new features forces to postpone the release so that it is tested by enough devs first to be sure there is no blocking bug in it. Big changes cannot be merged when we are hunting the remaining bugs to be able to release.

---------------------------------------------------------------------------

by schmittjoh at 2012-04-20T16:42:11Z

Considering the changes that have been made to the Form component, and are still being made, I think this is in comparison to that a fairly minor change.

Maybe a clearer guideline on the release process, or the direction would help, and avoid confusion, or wrong expectations on contributors' part.

---------------------------------------------------------------------------

by Tobion at 2012-10-05T13:52:11Z

@fabpot this is ready. So if you agree with it, I would create a documentation PR.

---------------------------------------------------------------------------

by stof at 2012-10-13T16:09:47Z

@fabpot what do you think about this PR ?

---------------------------------------------------------------------------

by Crell at 2012-11-01T16:05:01Z

This feels like it's overloading the generate() method to do double duty: One, make a URl based on a route.  Two, make a  URI based on a URI snippet.  Those are two separate operations.  Why not just add a second method that does the second operation and avoid the conditionals?  (We're likely to do that in Drupal for our own generator as well.)

---------------------------------------------------------------------------

by Tobion at 2012-11-01T16:38:39Z

@crell: No, you must have misunderstood something. The generate method still only generates a URI based on a route. The returned URI reference can now also be a relative path and a network path. Thats all.

---------------------------------------------------------------------------

by Tobion at 2012-12-13T18:30:28Z

@fabpot this is ready. It is fully BC! I also improved phpdoc considerably.

---------------------------------------------------------------------------

by Tobion at 2012-12-14T20:51:38Z

@fabpot Do you want me to write documentation for it? I would also be interested to write about the new features of the routing component in general. I wanted to do that anyway and it would probably be a good fit for your "new in symfony" articles.

---------------------------------------------------------------------------

by fabpot at 2012-12-14T20:58:16Z

Im' going to review this PR in the next coming days. And to answer your second question, more documentation or better documentation is always a good thing, so go for it.

---------------------------------------------------------------------------

by Tobion at 2013-01-02T21:50:20Z

@fabpot ping. I added changelog entries.
2013-01-09 10:27:51 +01:00
Fabien Potencier
b33d5bc352 removed the .gitattributes files (closes #6605, reverts #5674) 2013-01-09 09:51:07 +01:00
Fabien Potencier
f07c61d25c merged branch bschussek/issue5844 (PR #6137)
This PR was merged into the master branch.

Commits
-------

586a16e [Validator] Changed DefaultTranslator::getLocale() to always return 'en'
58bfd60 [Validator] Improved the inline documentation of DefaultTranslator
cd662cc [Validator] Added ExceptionInterface, BadMethodCallException and InvalidArgumentException
e00e5ec [Validator] Fixed failing test
cc0df0a [Validator] Changed validator to support pluralized messages by default
56d61eb [Form][Validator] Added BC breaks in unstable code to the CHANGELOG
1e34e91 [Form] Added upgrade instructions to the UPGRADE file
b94a256 [DoctrineBridge] Adapted DoctrineBridge to translator integration in the validator
c96a051 [FrameworkBundle] Adapted FrameworkBundle to translator integration in the validator
92a3b27 [TwigBridge] Adapted TwigBridge to translator integration in the validator
e7eb5b0 [Form] Adapted Form component to translator integration in the validator
46f751c [Validator] Extracted message interpolation logic of ConstraintViolation and used the Translation component for that

Discussion
----------

[Validator] Integrated the Translator in the Validator component

Bug fix: no
Feature addition: no
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #5844, #6117
Todo: -
License of the code: MIT
Documentation PR: -

This PR allows to replace the default message substitution strategy in the validator (`strtr()`) by passing an implementation of `Symfony\Component\Translation\TranslatorInterface`. The motivation for this are both #5844 and the need to replace the translation strategy in Drupal's integration of the Validator.

In the stand-alone usage of the validator, both the translator and the default translation domain can now be passed to `ValidatorBuilderInterface`:

```php
$validator = Validation::createValidatorBuilder()
    ->setTranslator(new MyTranslator())
    ->setTranslationDomain('validators')
    ->getValidator();
```

References:

* #5844
* #6117
* #6129
* [Add a validation framework to Drupal 8](http://drupal.org/node/1845546)
* [Add the symfony validator component to core despite Symfony potentially releasing BC-breaking updates after 2.3.](http://drupal.org/node/1849564)

---------------------------------------------------------------------------

by Tobion at 2012-11-28T08:53:25Z

no BC break? Looking at ValidatorBuilderInterface there is definitely one.

---------------------------------------------------------------------------

by bschussek at 2012-11-28T08:55:01Z

ValidatorBuilderInterface is not part of the stable API. You are not supposed to implement this interface.

---------------------------------------------------------------------------

by Tobion at 2012-11-28T09:01:07Z

We're not only documenting bc breaks for stable API, otherwise we could remove 90% of the upgrade file since few methods are tagged with API.
An interface that nobody should implement?

---------------------------------------------------------------------------

by bschussek at 2012-11-28T09:30:02Z

The question is what to consider a BC break. Something will always break for someone. Should we consequently mark everything as BC break? I don't think so.

For example, since 2.1, you are supposed to use `Validation::createValidator*()` for creating a validator. Because of that, I won't consider changing the constructor signature of `Validator` a BC break anymore from 2.1 on.

The same for the unstable interfaces. These are currently meant to be used only, that is, type hint against them and call their methods. But we don't guarantee that we won't add methods to them.

---------------------------------------------------------------------------

by Tobion at 2012-11-28T09:38:19Z

I agree that almost any change could be considered a BC break. So we probably need to better define what a BC break is and what not. Otherwise Symfony will stop evolving after 2.3 because from then on Fabien wanted to prevent BC breaks which is almost impossible in a strict definition of bc break.

---------------------------------------------------------------------------

by fabpot at 2012-11-28T11:37:22Z

BC breaks should always be documented, and we guarantee BC only for things tagged with @api. I'm going to update the docs to make things clearer.

---------------------------------------------------------------------------

by bschussek at 2012-11-28T13:09:57Z

@fabpot I documented these changes now in the CHANGELOG: af99ebb1206ac92889b7193ba1ecc12bf2617e85

Are we sure we want to document *all* BC breaks from now on, even in non-@api code? This could rather scare people looking at our changelogs (lots of BC BREAKS there).

---------------------------------------------------------------------------

by fago at 2012-11-28T17:29:58Z

Unfortunately, it turns out the symfony translator interface does not mach the Drupal translation system as well as we initally thought, see http://drupal.org/node/1852106. Given that, this would integrating the validator component into Drupal even harder, because it introduces the dependency on the (unwanted) translation component. :(

---------------------------------------------------------------------------

by stof at 2012-11-28T18:19:36Z

If this does not help Drupal anyway, maybe #5844 is a better way to manage translations for people using the validator outside forms ?
and the Drupal guys would simply follow a similar approach, but based on their own translator instead of the symfony one.

---------------------------------------------------------------------------

by fago at 2012-11-28T18:50:12Z

Yeah. The only problem I see with the approach of #5844 is that *after* validation only the translated messages are available. We'd need to have access to the untranslated messages also.

---------------------------------------------------------------------------

by fago at 2012-11-29T09:49:47Z

As our translation system handles translating pluralized messages differently, the current ExecutionContextInterface::addViolation() method poses a problem also. We need to pass on - both the single and plural - message, as the message gets chosen during translation, see http://api.drupal.org/api/drupal/core!includes!common.inc/function/format_plural/8
So maybe, we could allow adding an already created ConstraintViolation object also? Then, we could implement a "PluralConstraintViolation" class that takes both message templates.

---------------------------------------------------------------------------

by bschussek at 2012-12-03T15:52:36Z

I updated this PR to support pluralized messages by default in the validator. This should solve the problem of the Drupal guys, because their implementation of `TranslatorInterface::transChoice($id, $number, ...)` can now simply split the $id by pipes (`|`) and pass the parts to their own `format_plural($count, $singular, $plural, ...)` function.

For us, it breaks BC because translation catalog sources had to be adapted.

---------------------------------------------------------------------------

by fabpot at 2012-12-03T16:25:52Z

Most of the XLF files are broken (the end is missing now).

IIUC, we now have a hard dependency on the Translation component, which is something we wanted to avoid.

---------------------------------------------------------------------------

by fabpot at 2012-12-03T16:27:56Z

Oops, clicked on the "comment" button too fast.

So, the dependency is hard (you need to install the dep) but light as we only rely on the translation interface from the component (when using the default translator). It looks acceptable to me, especially because we now use Composer to manage dependencies.

---------------------------------------------------------------------------

by bschussek at 2012-12-03T16:54:10Z

@fabpot Thanks for the hint. Going to fix this.

---------------------------------------------------------------------------

by bschussek at 2012-12-04T11:34:43Z

@fabpot Fixed.

---------------------------------------------------------------------------

by bschussek at 2012-12-07T12:40:24Z

Is there anything missing for this PR to be merged?
2013-01-09 09:22:50 +01:00
Fabien Potencier
aba96c7cae Merge branch '2.1'
* 2.1:
  [Console] Fix style escaping parsing
  [Console] Make style formatter matching less greedy to avoid having to escape when not needed
  [Bundle] [FrameworkBundle] fixed indentation in esi.xml services file.
  [Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class.
  [Form] Fixed EntityChoiceList when loading objects with negative integer IDs
  [TwigBundle] There is no CSS visibility of display, should be visible instead
  [Form] corrected source node for a Danish translation
  [DependencyInjection] fixed a bug where the strict flag on references were lost (closes #6607)
  [HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
  [CssSelector] added css selector with empty string
  [HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
  [DependencyInjection] refactored code to avoid logic duplication
  [Form] Deleted references in FormBuilder::getFormConfig() to improve performance
  [HttpFoundation] Update docblock for non-working method

Conflicts:
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig
2013-01-08 19:17:41 +01:00
Fabien Potencier
8321127cda Merge branch '2.0' into 2.1
* 2.0:
  [Bundle] [FrameworkBundle] fixed indentation in esi.xml services file.
  [TwigBundle] There is no CSS visibility of display, should be visible instead
  [DependencyInjection] fixed a bug where the strict flag on references were lost (closes #6607)
  [HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
  [CssSelector] added css selector with empty string
  [HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
  [DependencyInjection] refactored code to avoid logic duplication

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Resources/config/esi.xml
	src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
	src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php
2013-01-08 19:16:44 +01:00
Hugo Hamon
113271c2df [Bundle] [FrameworkBundle] fixed indentation in esi.xml services file. 2013-01-08 16:05:00 +01:00
Bernhard Schussek
c96a0511f2 [FrameworkBundle] Adapted FrameworkBundle to translator integration in the validator 2013-01-08 14:43:29 +01:00
Igor Wiedler
8da2b412b4 [TwigBundle] There is no CSS visibility of display, should be visible instead 2013-01-08 02:14:26 +01:00
Alexander
73db84fd5e [Security] Move translations file to 'security' domain 2013-01-07 21:11:25 +01:00
Alexander
d6c57cff6f [FrameworkBundle] Register security exception translations 2013-01-07 20:58:58 +01:00
Fabien Potencier
b378964dbd Revert "merged branch stloyd/feature/kernel_secret_change (PR #6598)"
This reverts commit dbca0403b8, reversing
changes made to 1e6258846a.
2013-01-07 17:26:10 +01:00
Joseph Bielawski
f5290b95a9 [FrameworkBundle] Force users to set "kernel.secret" to something different than default "ThisTokenIsNotSoSecretChangeIt" 2013-01-07 10:48:25 +01:00
Bernhard Schussek
184c8e586f Fixed @expectedException definitions to reference absolute exception paths 2013-01-05 18:52:40 +01:00
Fabien Potencier
31ff3db517 Merge branch '2.1'
* 2.1: (24 commits)
  updated license year
  Update src/Symfony/Component/HttpFoundation/Response.php
  [Form] Fixed inheritance of "error_bubbling" in RepeatedType
  [Form] Fixed DateType when used with the intl extension disabled.
  [HttpFoundation] fix return types and handling of zero in Response
  [HttpFoundation] better fix for non-parseable Expires header date
  Fixed missing plural message in portuguese validator
  Fix Expires when the header is -1
  [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
  [Console] fixed unitialized properties (closes #5935)
  [Process] Prevented test from failing when pcntl extension is not enabled.
  Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
  [Form] Fixed failing tests for DateTimeToStringTransformer.
  [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
  [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
  [Form] Fixed test regression introduced in #6440
  [Tests] Fix namespaces
  Fixed php doc of GenericEvent::__construct
  HttpUtils must handle RequestMatcher too
  use preferred_choices in favor of preferred_query
  ...

Conflicts:
	src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
2013-01-04 18:02:19 +01:00
Fabien Potencier
8349816dc5 Merge branch '2.0' into 2.1
* 2.0:
  updated license year
  Update src/Symfony/Component/HttpFoundation/Response.php
  [Console] fixed unitialized properties (closes #5935)
  [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
  bumped Symfony version to 2.0.21-DEV
  updated VERSION for 2.0.21
  updated CHANGELOG for 2.0.21

Conflicts:
	src/Symfony/Bundle/SwiftmailerBundle/LICENSE
	src/Symfony/Component/Filesystem/LICENSE
	src/Symfony/Component/HttpFoundation/Response.php
	src/Symfony/Component/HttpKernel/Kernel.php
2013-01-04 18:00:54 +01:00
Fabien Potencier
df5c171490 updated license year 2013-01-04 17:59:43 +01:00
Fabien Potencier
18856428b6 updated license year 2013-01-04 17:58:00 +01:00
Hugo Hamon
a88607c7ff [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener. 2012-12-29 15:12:58 +01:00
Fabien Potencier
31a7825fe8 [FrameworkBundle] changed data collector templates to use the new namespaced template names 2012-12-23 12:31:08 +01:00
Fabien Potencier
382e98484b merged branch fabpot/optional-kernel (PR #6465)
This PR was merged into the master branch.

Commits
-------

5e359d3 made the kernel optional in all data collectors

Discussion
----------

made the kernel optional in all data collectors
2012-12-23 12:26:00 +01:00
Fabien Potencier
e20b7d9d3c merged branch egeloen/date-time-type (PR #3846)
This PR was merged into the master branch.

Commits
-------

bf9e238 [Form] Add options with_minutes to DateTimeType & TimeType

Discussion
----------

[Form] Add option with_minutes to the DateTimeType & TimeType

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Fixes the following tickets: -
Todo: -

Hey,

One of my project requires the datetime usage only with hours. I have submit a patch allowing to disable minutes like seconds are disabled.

---------------------------------------------------------------------------

by stloyd at 2012-04-09T16:26:11Z

You should also extend tests for those `Types`

---------------------------------------------------------------------------

by egeloen at 2012-04-09T16:31:51Z

Oups, I have looked at tests but I didn't find it at my first reading. I will do it :)

---------------------------------------------------------------------------

by stloyd at 2012-04-09T16:34:42Z

@egeloen Here you can find tests for Form Types: https://github.com/symfony/symfony/tree/master/src/Symfony/Component/Form/Tests/Extension/Core/Type

---------------------------------------------------------------------------

by egeloen at 2012-04-09T16:42:42Z

@stloyd I have added tests. Can you give me some feedbacks ?

---------------------------------------------------------------------------

by stloyd at 2012-04-09T16:46:33Z

@egeloen I'm not sure if we should allow user to set `with_minutes=false` and `with_seconds=true`. But in overall seems quite ok.

---------------------------------------------------------------------------

by egeloen at 2012-04-09T16:51:37Z

Yes, you're right. But I'm unsure how can I do this following the good way.

---------------------------------------------------------------------------

by inanimatt at 2012-05-03T15:46:02Z

Just make it throw an InvalidConfigurationException.php exception, no? :)

---------------------------------------------------------------------------

by egeloen at 2012-06-09T18:27:41Z

I have updated the PR in order to throw an ``InvalidConfigurationException`` if we enable seconds & disable minutes.

---------------------------------------------------------------------------

by egeloen at 2012-07-09T19:08:11Z

@bschussek I have removed the useless code.

I think I have found an issue about my PR. I have added 3 tests in order to show it. It seems if we disable minutes, the text widget is broken.

---------------------------------------------------------------------------

by stof at 2012-10-13T16:00:43Z

@egeloen can you rebase your PR as it conflicts with master ?

---------------------------------------------------------------------------

by egeloen at 2012-10-13T17:15:22Z

@stof rebase

Like explain previously, my PR is still failling if we disable minutes & use the text widget.

---------------------------------------------------------------------------

by egeloen at 2012-10-13T18:09:03Z

I have fixed the last issue. IMO, the PR can now be merge.

---------------------------------------------------------------------------

by stof at 2012-10-13T18:20:00Z

@bschussek @fabpot ping

---------------------------------------------------------------------------

by egeloen at 2012-10-16T18:13:00Z

@bschussek Do yo think this PR can be merge?

---------------------------------------------------------------------------

by egeloen at 2012-10-30T19:14:00Z

@fabpot is there something missing before merging?

---------------------------------------------------------------------------

by fabpot at 2012-10-31T08:22:55Z

I'm waiting for @bschussek approval.

---------------------------------------------------------------------------

by geoffrey-brier at 2012-11-13T10:49:52Z

I really need the `with_minute => false` enhancement on a project as I don't want to write CSS/JS hacks, could @bschussek approve/disapprove it so that I can make a decision?

---------------------------------------------------------------------------

by henrikbjorn at 2012-11-13T10:52:12Z

@geoffrey-brier you could do you own FieldType that extends the current one and add the option your self.

---------------------------------------------------------------------------

by egeloen at 2012-11-13T13:20:44Z

@bschussek Yes... :) I have updated the PR according to your feedback.

I needed to update the `DateTimeToStringTransformer` because it tries to create a `DateTime` only from the value (with no format). In my case, the `'03'` value is not enougt to create it. So, if the date time creation fails, it then try to create the datetime from the format. I don't know if it is the best approach but it works well.

By the way, why does it first try to create a `DateTime` without format, **then only** try to use the format ?

---------------------------------------------------------------------------

by bschussek at 2012-11-13T14:20:13Z

@egeloen Good question, I think the transformer is a bit flawed there. I'm working on that. The rest of the PR looks good. Thank you!

---------------------------------------------------------------------------

by bschussek at 2012-12-13T18:14:58Z

I fixed the transformer in #6333. Once that is merged into 2.1, and once 2.1 is merged into master after that, you can rebase this PR on master. Then we can merge it.

---------------------------------------------------------------------------

by egeloen at 2012-12-22T14:54:38Z

I have rebased & squashed commits. The PR is ready to merge. ping @fabpot
2012-12-22 22:01:49 +01:00
Fabien Potencier
552185a98a [WebProfilerBundle] fixed wrong class name 2012-12-22 21:58:25 +01:00
Eric GELOEN
bf9e238f75 [Form] Add options with_minutes to DateTimeType & TimeType 2012-12-22 15:51:06 +01:00
Fabien Potencier
5e359d3e9d made the kernel optional in all data collectors 2012-12-22 14:27:11 +01:00
Fabien Potencier
a5e1c4a657 [TwigBundle] added a compatibility layer for the render tag so that the same code can work in both 2.1 and 2.2
If you want your code to work on both version, use the following syntax:

{% render url('foo') with {}, {'bar': 1} %}

where the empty array is not used in 2.2.
2012-12-21 08:47:46 +01:00
Fabien Potencier
84ec18783e Merge branch '2.1'
* 2.1:
  fixed typo
  [FrameworkBundle] fixed ESI calls
  [FrameworkBundle] fixed ESI calls
  bumped Symfony version to 2.1.6-DEV
  updated VERSION for 2.1.5
  updated CHANGELOG for 2.1.5
  bumped Symfony version to 2.0.21-DEV
  [FrameworkBundle] fixed trusted_proxies configuration for some edge cases
  [FrameworkBundle] fixed XSD for the trusted-proxies setting
  updated VERSION for 2.0.20
  update CONTRIBUTORS for 2.0.20
  updated CHANGELOG for 2.0.20

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
	src/Symfony/Component/HttpKernel/Kernel.php
2012-12-20 23:18:21 +01:00
Fabien Potencier
bc09ac9eb0 fixed typo 2012-12-20 23:15:41 +01:00
Fabien Potencier
b8e5689363 [FrameworkBundle] fixed ESI calls 2012-12-20 23:13:30 +01:00
Fabien Potencier
ce536cdd5a [FrameworkBundle] fixed ESI calls 2012-12-20 23:10:14 +01:00
Fabien Potencier
3341c8ec43 [FrameworkBundle] restricted to only URIs the first argument of the actions helper 2012-12-20 22:49:33 +01:00
Fabien Potencier
1493f747a2 Merge branch '2.0' into 2.1
* 2.0:
  bumped Symfony version to 2.0.21-DEV
  [FrameworkBundle] fixed trusted_proxies configuration for some edge cases
  [FrameworkBundle] fixed XSD for the trusted-proxies setting
  updated VERSION for 2.0.20
  update CONTRIBUTORS for 2.0.20
  updated CHANGELOG for 2.0.20

Conflicts:
	CONTRIBUTORS.md
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml
	src/Symfony/Component/HttpKernel/Kernel.php
2012-12-20 15:24:08 +01:00
Fabien Potencier
1f281db261 [TwigBundle] fixed PHP notice 2012-12-20 12:01:24 +01:00
Joseph Bielawski
5aed0d5505 [FrameworkBundle] Remove test for class removed in commit 64d43c8 2012-12-20 10:34:05 +01:00
Fabien Potencier
4517aebe6f [FrameworkBundle] fixed trusted_proxies configuration for some edge cases 2012-12-20 10:21:38 +01:00
Fabien Potencier
0085798dff [FrameworkBundle] fixed XSD for the trusted-proxies setting 2012-12-20 09:52:00 +01:00
Fabien Potencier
64d43c806b restricted to only URIs the first argument of the render tag 2012-12-20 08:31:14 +01:00
Fabien Potencier
2c9083a6e0 Merge branch '2.1'
* 2.1:
  [FrameworkBundle] added support for URIs as an argument to HttpKernel::render()
  [FrameworkBundle] restricted the type of controllers that can be executed by InternalController
  [Process] Allow non-blocking start with PhpProcess
  Making it easier to grab the PR template.
  [Locale] fixed a test
  Fixed failing test
  fix double-decoding in the routing system

Conflicts:
	src/Symfony/Component/Process/PhpProcess.php
2012-12-20 08:22:35 +01:00
Fabien Potencier
4bee2e9d3a Merge branch '2.0' into 2.1
* 2.0:
  [FrameworkBundle] added support for URIs as an argument to HttpKernel::render()
  [FrameworkBundle] restricted the type of controllers that can be executed by InternalController
  Making it easier to grab the PR template.
  fix double-decoding in the routing system

Conflicts:
	README.md
	src/Symfony/Bundle/FrameworkBundle/EventListener/RouterListener.php
	src/Symfony/Component/Security/Http/HttpUtils.php
2012-12-20 08:21:29 +01:00
Fabien Potencier
532cc9a0e6 [FrameworkBundle] added support for URIs as an argument to HttpKernel::render() 2012-12-20 08:14:51 +01:00
Fabien Potencier
1f8c501b99 [FrameworkBundle] restricted the type of controllers that can be executed by InternalController 2012-12-20 08:14:45 +01:00
Fabien Potencier
d90e55cbb3 merged branch Tobion/fix-double-encoding (PR #6363)
This PR was merged into the 2.0 branch.

Commits
-------

8b2c17f fix double-decoding in the routing system

Discussion
----------

fix double-decoding in the routing system

@fabpot @vicb This should fix it. You know what ;) Don't want to leak more information.
And the good thing, it's no hack nor does it break BC.
2012-12-20 08:11:40 +01:00
Fabien Potencier
eedafadb58 merged branch lmcd/wdt-token (PR #6431)
This PR was merged into the master branch.

Commits
-------

4663450 Use abbr_class
15c52f5 Show class name of security token in WDT

Discussion
----------

Show class name for security token in WDT

I found this to be really useful when creating custom authentication providers

Example:

![token](https://f.cloud.github.com/assets/363540/23829/2f28c1ac-4a70-11e2-91d4-e3ac27201b4f.png)
2012-12-20 08:05:25 +01:00
Lee McDermott
4663450a03 Use abbr_class 2012-12-20 06:35:43 +00:00
Lee McDermott
15c52f507e Show class name of security token in WDT 2012-12-20 06:23:44 +00:00
Sema
8654cd80fd Fixed missing quote in FormHelper->widget() PHPDoc 2012-12-19 15:09:11 +04:00