Commit Graph

12789 Commits

Author SHA1 Message Date
Maks Slesarenko
3ae5b55882 added support for propel enum types in PropelTypeGuesser 2013-01-11 07:44:40 -05: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
9b92e8ecd3 merged branch stephpy/redis_profiler_sort (PR #6703)
This PR was merged into the 2.1 branch.

Commits
-------

9257b03 [Profiler] [Redis] Fix sort of profiler rows.

Discussion
----------

[Profiler] [Redis] Fix sort of redis storage profiler rows.

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

Redis profiler rows are not sorted as expected.

We have in redis:

```
- 2011-01-01 ...
- 2011-01-02 ...
- 2011-01-03 ...
```

If we limit to 2, we'll have:

```
- 2011-01-02 ...
- 2011-01-01 ...
```

Fixed this bug by reversing array.
2013-01-11 12:37:16 +01:00
Fabien Potencier
69aa428d47 merged branch stloyd/bugfix/nulllogger (PR #6704)
This PR was merged into the master branch.

Commits
-------

eb0d2ab [HttpKernel] Remove conflicting `use` from `NullLogger`

Discussion
----------

[HttpKernel] Remove conflicting `use` from `NullLogger`

Without this code dies with fatal:
> Cannot use Psr\Log\LoggerInterface as LoggerInterface because the name is already in use

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

by Seldaek at 2013-01-11T11:00:50Z

Oops :)
2013-01-11 12:17:32 +01:00
Stéphane PY
9257b0371c [Profiler] [Redis] Fix sort of profiler rows. 2013-01-11 11:35:43 +01:00
Joseph Bielawski
eb0d2abb1b [HttpKernel] Remove conflicting use from NullLogger 2013-01-11 11:33:37 +01:00
Bart van den Burg
6b669fbddf Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf
see #6668

Some more minor tweaks
2013-01-11 10:49:55 +01:00
Fabien Potencier
3d808b59de merged branch sineld/master (PR #6700)
This PR was merged into the master branch.

Commits
-------

2617cf6 Added Turkish translation for security component

Discussion
----------

Added Turkish translation for security component
2013-01-11 09:57:54 +01:00
Sinan Eldem
2617cf64c3 Added Turkish translation for security component 2013-01-11 10:47:35 +02:00
Fabien Potencier
6c3393a96a merged branch Seldaek/wording (PR #6698)
This PR was merged into the master branch.

Commits
-------

8d06c57 [HttpFoundation] Fix sentence and provide a hint at the solution for affected people

Discussion
----------

[HttpFoundation] Fix sentence and provide a hint at the solution for affected people
2013-01-11 09:27:47 +01:00
Jordi Boggiano
8d06c571ed [HttpFoundation] Fix sentence and provide a hint at the solution for affected people 2013-01-11 09:20:00 +01:00
Fabien Potencier
a31a6531c7 [HttpKernel] fixed usage of false as a valid strategy (for BC) 2013-01-11 09:12:57 +01:00
Adam Harvey
c7bfce9116 Fix version_compare() calls for PHP 5.5.
Until PHP 5.5 hits beta, the version number for Git builds is still 5.5.0-dev,
which is less than 5.5.0alpha1 according to version_compare(). This means that
the branches for 5.5 aren't being executed on 5.5 snapshots at present.
2013-01-11 16:02:30 +08:00
Fabien Potencier
9f25451134 merged branch stephpy/redis_profiler (PR #6680)
This PR was merged into the master branch.

Commits
-------

d027f45 [PROFILER][REDIS] Support database, auth on redis connection

Discussion
----------

[PROFILER][REDIS] Support database, auth on redis connection

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes

Allow database and password on dsn:

```yml
framework:
    profiler:
        dsn: redis://127.0.0.1:6379
        dsn: redis://127.0.0.1:6379/3
        dsn: redis://user:password@127.0.0.1:6379/3
```

Since redis uses only password for authentification, user will not be used ...

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

by shouze at 2013-01-10T16:58:02Z

👍 db selection is a must have
2013-01-11 08:49:43 +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
2aba3aa490 [HttpFoundation] added missing info in CHANGELOG 2013-01-11 08:05:42 +01:00
Fabien Potencier
a0c26e0335 merged branch Seldaek/jsonresp (PR #6635)
This PR was submitted for the 2.1 branch but it was merged into the master branch instead (closes #6635).

Commits
-------

26aafff [HttpFoundation] Remove special handling of empty arrays, fixes #5506

Discussion
----------

[HttpFoundation] Remove special handling of empty arrays, fixes #5506

Bug fix: yes
Feature addition: no
Backwards compatibility break: tiny/no
Symfony2 tests pass: yes
Fixes the following tickets: #5506
License of the code: MIT

See the linked issue for details, IMO it should be removed because it's not consistently applied and just a WTF for people.

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

by vicb at 2013-01-09T11:11:06Z

👍, could you please update the changelog with the BC break ?

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

by Seldaek at 2013-01-09T11:16:44Z

If we really consider this as a BC break and document it as such then I guess it should be 2.2 only and not 2.1. @fabpot?

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

by vicb at 2013-01-09T11:28:16Z

IMO there is no such things as "tiny BC" but BCs are yes/no.

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

by fabpot at 2013-01-09T15:09:18Z

Let's do it in master only and add a note in the CHANGELOG about the BC break.
2013-01-11 08:01:56 +01:00
Jordi Boggiano
2d07a17cbd Remove special handling of empty arrays, fixes #5506 2013-01-11 08:01:56 +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
b3abf45ae9 merged branch jankramer/property-path-setter-fix (PR #6696)
This PR was merged into the master branch.

Commits
-------

69535cf Fixed broken setter in Form/Util/PropertyPath

Discussion
----------

[Form] Fixed broken setter in Form/Util/PropertyPath

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

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

by bschussek at 2013-01-11T06:54:15Z

+1
2013-01-11 07:56:54 +01:00
Fabien Potencier
3095765bb1 merged branch jakzal/no-underscored-methods-in-tests-2.1 (PR #6695)
This PR was merged into the 2.1 branch.

Commits
-------

8024262 Removed underscores from test method names to be consistent with other components.

Discussion
----------

Removed underscores from test method names to be consistent with other components

This is just a cosmetic change. It is more common (in Symfony) to use fully camel-cased names for test methods. Only some of the test methods contain underscores. To avoid confusion it is better to be consistent.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
2013-01-11 07:55:32 +01:00
Jan Kramer
69535cfe42 Fixed broken setter in Form/Util/PropertyPath 2013-01-11 07:43:26 +01:00
Jakub Zalas
802426272f Removed underscores from test method names to be consistent with other components.
It is more common to use fully camel-cased names for test methods. Only some of the test methods are called with underscore notation. To avoid confusion it is better to be consistent.
2013-01-11 00:31:43 +00:00
Fabien Potencier
0acefc9a81 merged branch sstok/patch-3 (PR #6691)
This PR was merged into the master branch.

Commits
-------

08f9c76 Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf

Discussion
----------

Minor tone of voice correction in security.nl.xlf

For the Dutch people under us. http://www.kiezelcommunicatie.nl/kiezelblog/woorden-die-niet-meer-mogen-aflevering-1/

Yes I'm picky ;)
2013-01-10 23:25:39 +01:00
Fabien Potencier
8c4245f2a8 merged branch tiagobrito/master (PR #6693)
This PR was merged into the master branch.

Commits
-------

0d6be2e Added Portuguese (Portugal) translation to Security
87df0b7 Merge pull request #1 from symfony/master

Discussion
----------

Add Portuguese from Portugal Security translation

Translation file for portuguese from Portugal added in Security component translations
2013-01-10 23:25:26 +01:00
Tiago Brito
0d6be2e81a Added Portuguese (Portugal) translation to Security
Added Portuguese from Portugal translation for Security component
2013-01-10 22:01:22 +00:00
Tiago Brito
87df0b7ee2 Merge pull request #1 from symfony/master
update symfony repo
2013-01-10 13:37:17 -08:00
Sebastiaan Stok
08f9c7633e Update src/Symfony/Component/Security/Resources/translations/security.nl.xlf
For the Dutch people under us. http://www.kiezelcommunicatie.nl/kiezelblog/woorden-die-niet-meer-mogen-aflevering-1/

Yes I'm picky ;)
2013-01-10 19:55:35 +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
357d747311 merged branch theUniC/master (PR #6684)
This PR was merged into the master branch.

Commits
-------

1edf302 Fixed some translation typos

Discussion
----------

Fixed translation typos on the Security componente

Hi,

In my last PR I've introduced some translation typos on the Security component messages for the Spanish translation.

So sorry.

Christian.
2013-01-10 19:21:27 +01:00
Fabien Potencier
e4aa64b84e merged branch pborreli/patch-5 (PR #6687)
This PR was merged into the master branch.

Commits
-------

d4bbb6b [Security] Missing trailing dot.

Discussion
----------

[Security] Missing trailing dot.
2013-01-10 19:20:57 +01:00
Fabien Potencier
711fadcd18 merged branch pborreli/patch-4 (PR #6683)
This PR was merged into the master branch.

Commits
-------

53c5d9b [Security] Missing trailing dot.

Discussion
----------

[Security] Missing trailing dot.
2013-01-10 19:20:53 +01:00
Fabien Potencier
c084d3ff5e merged branch tkinast/patch-1 (PR #6688)
This PR was merged into the master branch.

Commits
-------

77545a2 Update src/Symfony/Component/Security/Resources/translations/security.es.xlf

Discussion
----------

Update src/Symfony/Component/Security/Resources/translations/security.es...

....xlf

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

by mweimerskirch at 2013-01-10T17:43:38Z

Duplicate of #6684?
2013-01-10 19:19:59 +01:00
Fabien Potencier
5864858539 merged branch mweimerskirch/patch-10 (PR #6685)
This PR was merged into the master branch.

Commits
-------

a1ef9d8 Fixed 2 typos in French translation

Discussion
----------

Fixed 2 typos in French translation
2013-01-10 19:18:42 +01:00
Fabien Potencier
8f497de806 merged branch tobiassjosten/patch-1 (PR #6690)
This PR was merged into the master branch.

Commits
-------

65bb3d2 Added Swedish translation

Discussion
----------

Added Swedish translation
2013-01-10 19:18:28 +01:00
Tobias Sjösten
65bb3d20ae Added Swedish translation 2013-01-10 10:04:48 -08:00
tkinast
77545a2ee5 Update src/Symfony/Component/Security/Resources/translations/security.es.xlf 2013-01-10 15:37:47 -02:00
Pascal Borreli
d4bbb6b737 [Security] Missing trailing dot. 2013-01-10 17:33:44 +00:00
Michel Weimerskirch
a1ef9d86f0 Fixed 2 typos in French translation 2013-01-10 18:19:20 +01:00
Fabien Potencier
1c0e3538ef merged branch mweimerskirch/patch-9 (PR #6682)
This PR was merged into the master branch.

Commits
-------

b92973c Fixed German translations for security component

Discussion
----------

Fixed German translations for security component

authentication != authorisation
plus a few other minor things
2013-01-10 18:16:15 +01:00
Pascal Borreli
53c5d9bf66 [Security] Missing trailing dot. 2013-01-10 17:14:38 +00:00
Christian
1edf3026d7 Fixed some translation typos 2013-01-10 18:12:39 +01:00
Fabien Potencier
5c653d4d02 merged branch mweimerskirch/security_lb (PR #6681)
This PR was merged into the master branch.

Commits
-------

9471a1c Added Luxembourgish translation for security component

Discussion
----------

Added Luxembourgish translation for security component
2013-01-10 18:11:37 +01:00
Michel Weimerskirch
b92973ca35 Fixed German translations for security component
authentication != authorisation
+ a few other minor things
2013-01-10 18:09:49 +01:00
Michel Weimerskirch
9471a1ce5a Added Luxembourgish translation for security component 2013-01-10 18:06:17 +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
8a7a120ed5 merged branch spolischook/master (PR #6679)
This PR was merged into the master branch.

Commits
-------

b74c00f [security][translation] added ukrainian message translations

Discussion
----------

Added ukrainian message translations
2013-01-10 17:47:27 +01:00
Stéphane PY
d027f45833 [PROFILER][REDIS] Support database, auth on redis connection 2013-01-10 17:46:24 +01:00
SPolischook
b74c00f9a8 [security][translation] added ukrainian message translations 2013-01-10 18:37:41 +02:00
Fabien Potencier
6022484329 merged branch kucharovic/patch-1 (PR #6678)
This PR was merged into the master branch.

Commits
-------

c6eb819 Created security.cs.xlf

Discussion
----------

[security][tranlation] Created Czech translation to Security
2013-01-10 17:35:13 +01:00