Commit Graph

8066 Commits

Author SHA1 Message Date
Tobias Schultze
c331f4a306 HttpKernel test fix on windows 2012-04-13 00:48:19 +02:00
Tobias Schultze
cb47b03209 [Routing] small refactoring + language fixes 2012-04-12 21:23:30 +02:00
Drak
e199049581 [EventDispatcher] Fixed edge case not covered by tests that generated E_NOTICES 2012-04-12 16:21:33 +05:45
Fabien Potencier
5a320ca7bd merged 2.0 2012-04-12 12:30:32 +02:00
Fabien Potencier
5ab006aca2 merged branch Tobion/generator-dumper (PR #3894)
Commits
-------

382b083 [Routing] improved generated class by PhpGeneratorDumper
27a05f4 [Routing] small optimization of PhpGeneratorDumper

Discussion
----------

[Routing] improved PhpGeneratorDumper

Test pass: yes
BC break: no

The first commit only replaces arrays with strings and makes some cosmetic changes, so that it's more readable. This makes the `PhpGeneratorDumper` consistent in style with `PhpMatcherDumper` that I fixed recently and should slightly improve performance of the generation of the class.

The second commit changes the output of the `PhpGeneratorDumper->dump` and tries to optimize the resulting class that is used to generate URLs. It's best explained with an example.

Before my changes:

```php
class ProjectUrlGenerator extends Symfony\Component\Routing\Generator\UrlGenerator
{
    static private $declaredRouteNames = array(
       'Test' => true,
       'Test2' => true,
    );

    /**
     * Constructor.
     */
    public function __construct(RequestContext $context)
    {
        $this->context = $context;
    }

    public function generate($name, $parameters = array(), $absolute = false)
    {
        if (!isset(self::$declaredRouteNames[$name])) {
            throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
        }

        $escapedName = str_replace('.', '__', $name);

        list($variables, $defaults, $requirements, $tokens) = $this->{'get'.$escapedName.'RouteInfo'}();

        return $this->doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $absolute);
    }

    private function getTestRouteInfo()
    {
        return array(array (  0 => 'foo',), array (), array (), array (  0 =>   array (    0 => 'variable',    1 => '/',    2 => '[^/]+?',    3 => 'foo',  ),  1 =>   array (    0 => 'text',    1 => '/testing',  ),));
    }

    private function getTest2RouteInfo()
    {
        return array(array (), array (), array (), array (  0 =>   array (    0 => 'text',    1 => '/testing2',  ),));
    }
}
```

After my changes in second commit:

```php
class ProjectUrlGenerator extends Symfony\Component\Routing\Generator\UrlGenerator
{
    static private $declaredRoutes = array(
        'Test' => array (  0 =>   array (    0 => 'foo',  ),  1 =>   array (  ),  2 =>   array (  ),  3 =>   array (    0 =>     array (      0 => 'variable',      1 => '/',      2 => '[^/]+?',      3 => 'foo',    ),    1 =>     array (      0 => 'text',      1 => '/testing',    ),  ),),
        'Test2' => array (  0 =>   array (  ),  1 =>   array (  ),  2 =>   array (  ),  3 =>   array (    0 =>     array (      0 => 'text',      1 => '/testing2',    ),  ),),
    );

    /**
     * Constructor.
     */
    public function __construct(RequestContext $context)
    {
        $this->context = $context;
    }

    public function generate($name, $parameters = array(), $absolute = false)
    {
        if (!isset(self::$declaredRoutes[$name])) {
            throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
        }

        list($variables, $defaults, $requirements, $tokens) = self::$declaredRoutes[$name];

        return $this->doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $absolute);
    }
}
```

As you can see, there is no need to escape the route name and invoke a special method anymore. Instead the route properties are included in the static route array directly, that existed anyway. Is also easier to read as defined routes and their properties are in the same place.
2012-04-12 12:27:45 +02:00
Drak
57dd9147d9 [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities 2012-04-12 15:56:02 +05:45
Tobias Schultze
382b08361b [Routing] improved generated class by PhpGeneratorDumper 2012-04-12 07:35:08 +02:00
Fabien Potencier
bf1131cc50 merged branch Tobion/generator-cache (PR #3892)
Commits
-------

03d30fd [Routing] remove duplicated cache of compiled routes

Discussion
----------

[Routing] remove duplicated cache of compiled routes

The UrlGenerator caches compiled routes for generating URLs. But the Route class caches it's compiled route itself as long as it does not get modified. So compiled routes are cached twice which makes no sense in my opinion.

Test pass: yes
BC break: no
2012-04-12 06:57:29 +02:00
Fabien Potencier
3923ade0aa merged branch kimhemsoe/process_deadlock (PR #3888)
Commits
-------

89a5c1a [process] Added destructor to process to make sure handles are always closed in the right order.

Discussion
----------

[process] Added destructor to process to make sure handles are always cl...

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-12 06:56:15 +02:00
Tobias Schultze
27a05f4c24 [Routing] small optimization of PhpGeneratorDumper 2012-04-12 06:16:26 +02:00
Tobias Schultze
03d30fdadb [Routing] remove duplicated cache of compiled routes 2012-04-12 04:08:51 +02:00
Jordan Alliot
6483d88f69 [Security][ACL] Fixed ObjectIdentity::fromDomainObject and UserSecurityIdentity::from(Account|Token) when working with proxies
Backported ClassUtils class from Doctrine Common 2.2
Fixes #2611, #2056, #2048, #2035
2012-04-12 00:40:59 +02:00
Kim Hemsø Rasmussen
89a5c1a845 [process] Added destructor to process to make sure handles are always closed in the right order. 2012-04-11 23:08:57 +02:00
William DURAND
be2456b19e [Form] [Tests] Used assertCount() 2012-04-11 20:45:41 +02:00
Josip Kruslin
771ab45f08 Updated croatian validator translation and deleted validator xliff file 2012-04-11 20:41:00 +02:00
Fabien Potencier
570bb6ab67 merged branch willdurand/fix-form-type-doc (PR #3880)
Commits
-------

6f56dfc [Form] Fixed DateType default options
779d3bb [Form] Fixed documentation, and the DateType (default options)

Discussion
----------

[Form] Fixed documentation, and the DateType (default options)

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

by fabpot at 2012-04-11T16:48:04Z

That breaks the tests.

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

by willdurand at 2012-04-11T16:50:35Z

I got an error with the Form test suite before to write this patch..

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

by willdurand at 2012-04-11T16:53:30Z

Nevermind, I can see broken tests.. I'm on, sorry

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

by willdurand at 2012-04-11T16:57:52Z

@fabpot fixed.

```
OK, but incomplete or skipped tests!
Tests: 945, Assertions: 1439, Incomplete: 11.
```
2012-04-11 19:18:10 +02:00
William DURAND
4120f1392f [Form] Added all() method to the FormBuilder class
In order to perform some introspection on a FormBuilder instance,
we need to be able to get its children. Almost everything is accessible
in this class, but the children are not.

This PR adds a all() method to respect the current API (get(), remove(),
...).
2012-04-11 19:12:00 +02:00
William DURAND
6f56dfc0d6 [Form] Fixed DateType default options 2012-04-11 18:56:33 +02:00
Fabien Potencier
61bec64003 [HttpFoundation] added missing variable declaration 2012-04-11 18:56:05 +02:00
Tobias Schultze
f666836900 [Routing] simplified regex with named variables 2012-04-11 18:27:19 +02:00
William DURAND
779d3bbb8e [Form] Fixed documentation, and the DateType (default options) 2012-04-11 17:26:46 +02:00
Fabien Potencier
05842c54b8 merged branch bschussek/issue3354 (PR #3789)
Commits
-------

8329087 [Form] Moved calculation of ChoiceType options to closures
5adec19 [Form] Fixed typos
cb87ccb [Form] Failing test for empty_data option BC break
b733045 [Form] Fixed option support in Form component

Discussion
----------

[Form] Fixed option support in Form component

Bug fix: yes
Feature addition: no
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #3354, #3512, #3685, #3694
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3354)

This PR also introduces a new helper `DefaultOptions` for solving option graphs. It accepts default options to be defined on various layers of your class hierarchy. These options can then be merged with the options passed by the user. This is called *resolving*.

The important feature of this utility is that it lets you define *lazy options*. Lazy options are specified using closures that are evaluated when resolving and thus have access to the resolved values of other (potentially lazy) options. The class detects cyclic option dependencies and fails with an exception in this case.

For more information, check the inline documentation of the `DefaultOptions` class and the UPGRADE file.

@fabpot: Might this be worth a separate component? (in total the utility consists of five classes with two associated tests)

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

by beberlei at 2012-04-05T08:54:10Z

"The important feature of this utility is that it lets you define lazy options. Lazy options are specified using closures"

What about options that are closures? are those differentiated?

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

by bschussek at 2012-04-05T08:57:35Z

@beberlei Yes. Closures for lazy options receive a Symfony\Component\Form\Options instance as first argument. All other closures are interpreted as normal values.

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

by stof at 2012-04-05T11:09:49Z

I'm wondering if these classes should go in the Config component. My issue with it is that it would add a required dependency to the Config component and that the Config component mixes many different things in it already (the loader part, the resource part, the definition part...)

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

by sstok at 2012-04-06T13:36:36Z

Sharing the Options class would be great, and its more then one class so why not give it its own Component folder?
Filesystem is just one class, and that has its own folder.

Great job on the class bschussek 👏

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

by bschussek at 2012-04-10T12:32:34Z

@fabpot Any input?

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

by bschussek at 2012-04-10T13:54:13Z

@fabpot Apart from the decision about the final location of DefaultOptions et al., could you merge this soon? This would make my work a bit easier since this one is a blocker.

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

by fabpot at 2012-04-10T18:08:18Z

@bschussek: Can you rebase on master? I will merge afterwards. Thanks.
2012-04-11 17:03:28 +02:00
Bernhard Schussek
8329087a20 [Form] Moved calculation of ChoiceType options to closures 2012-04-11 16:50:57 +02:00
Bernhard Schussek
5adec19f56 [Form] Fixed typos 2012-04-11 16:37:42 +02:00
Jeremy Mikola
cb87ccb284 [Form] Failing test for empty_data option BC break
This demonstrates the issue described in symfony/symfony#3354. FieldType no longer has access to the child type's data_class option, which makes it unable to create the default closure for empty_data.
2012-04-11 16:37:42 +02:00
Bernhard Schussek
b7330456b6 [Form] Fixed option support in Form component 2012-04-11 16:37:42 +02:00
Fabien Potencier
cc833b13b6 merged branch hason/validator (PR #552)
Commits
-------

f9a486e [Validator] Added support for pluralization of the SizeLengthValidator
c0715f1 [FrameworkBundle], [TwigBundle] added support for form error message pluralization
7a6376e [Form] added support for error message pluralization
345981f [Validator] added support for plural messages

Discussion
----------

[Validator] Added support for plural error messages

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Todo: create translations for en and update others (FrameworkBundle)

[![Build Status](https://secure.travis-ci.org/hason/symfony.png?branch=validator)](http://travis-ci.org/hason/symfony)

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

by fabpot at 2011-05-14T20:41:01Z

@bschussek: What's your opinion?

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

by stof at 2011-09-04T13:14:29Z

@hason could you rebase your branch on top of master and update the PR ?

You also need to change the messages in the constraint that uses the pluralization to a pluralized format.

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

by stof at 2011-10-16T18:06:22Z

@hason ping

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

by stof at 2011-11-11T14:58:19Z

@hason ping again

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

by stof at 2011-12-12T20:39:10Z

@hason ping again. Can you update your PR ?

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

by hason at 2011-12-12T21:29:14Z

@stof I hope that I will update PR this week.

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

by bschussek at 2012-01-15T19:07:32Z

Looks good to me.

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

by canni at 2012-02-02T17:28:54Z

@hason can you update this PR and squash commits, it conflicts with current master

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

by hason at 2012-02-09T07:21:41Z

@stof, @canni Rebased.

What is the best solution for the translation of messages?

1. Change messages in the classes and all xliff files?
2. Keep messages in the classes and change all xliff files?

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

by stof at 2012-02-09T08:19:41Z

The constraints contain the en message so you will need to modify them to update the message

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

by hason at 2012-02-09T08:55:55Z

I prefer second option. The Validator component should be decoupled from the Translation component. The constraints contain the en message which is also the key for Translation component. We should create validators.en.xlf in the FrameworkBundle for en message. I think that this is better solution. What do you think?

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

by stof at 2012-04-04T02:22:02Z

@hason Please rebase your branch. It conflicts with master because of the move of the tests

@fabpot ping
2012-04-11 16:12:39 +02:00
Fabien Potencier
70d49c3c2c merged branch jakzal/FilesystemMirrorCleanup (PR #3844)
Commits
-------

efad5d5 [Filesystem] Prevented infiite loop on windows while calling mirror on symlink. Added test for mirroring symlinks.

Discussion
----------

[Filesystem] Prevented infinite loop on windows while mirrorring symlinks

First check for filetype in *mirror()* method is:

    if (is_link($file)) {
        $this->symlink($file, $target);

later we see:

    } elseif (is_file($file) || ($copyOnWindows && is_link($file))) {
        $this->copy($file, $target, isset($options['override']) ? $options['override'] : false);

The later check for links on windows (*$copyOnWindows && is_link($file)*) won't ever get called. Calling *symlink()* in *mirror()* on windows would lead to calling *mirror()* again.

Note that I didn't actually try running it on windows platform. I added a test for mirroring symlinks (non-windows test). I think it'd be good if someone added some windows specific tests to this class.

I also modified the target path:

    $target = $targetDir.'/'.str_replace($originDir.DIRECTORY_SEPARATOR, '', $file->getPathname());

It didn't use DIRECTORY_SEPARATOR and is equivalent to:

    $target = str_replace($originDir, $targetDir, $file->getPathname());

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: ~
Todo: ~
2012-04-11 16:06:53 +02:00
Fabien Potencier
0c57db1771 merged branch vicb/routing_improvements (PR #3876)
Commits
-------

9307f5b [Routing] Implement bug fixes and enhancements

Discussion
----------

[Routing] Implement bug fixes and enhancements (from @Tobion)

This is mainly #3754 with some minor formatting changes.

Original PR message from @Tobion:

Here a list of what is fixed. Tests pass.

1. The `RouteCollection` states

    > it overrides existing routes with the same name defined in the instance or its children and parents.

    But this is not true for `->addCollection()` but only for `->add()`. addCollection does not remove routes with the same name in its parents (only in its children). I don't think this is on purpose.
    So I fixed it by making sure there can only be one route per name in all connected collections. This way we can also simplify `->get()` and `->remove()` and improve performance since we can stop iterating recursively when we found the first and only route with a given name.
    See `testUniqueRouteWithGivenName` that fails in the old code but works now.

2. There was an bug with `$collection->addPrefix('0');` that didn't apply the starting slash. Fixed and test case added.

3. There is an issue with `->get()` that I also think is not intended. Currently it allows to access a sub-RouteCollection by specifing $name as array integer index. But according to the PHPdoc you should only be allowed to receive a Route instance and not a RouteCollection.
    See `testGet` that has a failing test case. I fixed this behavior.

4. Then I recognized that `->addCollection` depended on the order of applying them. So

        $collection1->addCollection($collection2, '/b');
        $collection2->addCollection($collection3, '/c');
        $rootCollection->addCollection($collection1, '/a');

    had a different pattern result from

        $collection2->addCollection($collection3, '/c');
        $collection1->addCollection($collection2, '/b');
        $rootCollection->addCollection($collection1, '/a');

    Fixed and test case added. See `testPatternDoesNotChangeWhenDefinitionOrderChanges`.

5. PHP could have ended in an infinite loop when one tried to add an existing RouteCollection to the tree. Fixed by throwing an exception when this situation is detected. See tests `testCannotSelfJoinCollection` and `testCannotAddExistingCollectionToTree`.

6. I made `setParent()` private because its not useful outside the class itself. And `remove()` also removes the route from its parents. Added public `getRoot()` method.

7. The `Route` class throwed a PHP warning when trying to set an empty requirement.

8. Fixed issue #3777. See discussion there for more info. I fixed it by removing the over-optimization that was introduced in 91f4097a09 but didn't work properly. One cannot reorder the route definitions, as is was done, because then the wrong route might me matched before the correct one. If one really wanted to do that, it would require to calculate the intersection of two regular expressions to determine if they can be grouped together (a tool that would also be useful to check whether a route is unreachable, see discussion in #3678) We can only safely optimize routes with a static prefix within a RouteCollection, not across multiple RouteCollections with different parents.  This is especially true when using variables and regular expressions requirements.
I could however apply an optimization that was missing yet: Collections with a single route were missing the static prefix optimization with `0 === strpos()`.

9. Fixed an issue where the `PhpMatcherDumper` would not apply the optimization if the root collection to be dumped has a prefix itself. For this I had to rewrite `compileRoutes`. It is also much easier to understand now. Addionally I added many comments and PHPdoc because complex recursive methods like this are still hard to grasp.
I added a test case for this (`url_matcher3.php`).

10. Fix that `Route::compile` needs to recompile a route once it is modified. Otherwise we have a wrong result. Test case added.
2012-04-11 15:53:10 +02:00
Tobias Schultze
9307f5b33b [Routing] Implement bug fixes and enhancements 2012-04-11 15:45:27 +02:00
Fabien Potencier
3469713d90 merged branch kmohrf/ticket_2827_validator_mail_A_RR_DNS_hostcheck (PR #3799)
Commits
-------

f617e02 [Validator] added less-strict email host verification

Discussion
----------

[Validator] added less-strict email host verification

uhhhhh, my first pull request :>. uhm... tell me if i did something wrong :)

#### Request info
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes... well,not really (i guess master branch is not passing - at least i didnt broke the email test)
Fixes the following tickets: #2827

#### Description
New checkHost attribute in email constraint will make the validator check for only one of MX, A or AAAA DNS resource records to verify it as a valid email address.
2012-04-11 14:41:31 +02:00
Fabien Potencier
3c3ec5c677 merged branch tvlooy/GetSetMethodNormalizer (PR #3582)
Commits
-------

039ff6f allow more control on GetSetMethodNormalizer by using callback functions and an ignoreAttributes list

Discussion
----------

allow more control on GetSetMethodNormalizer

Here is an other attempt. You would use this as follows:

    $serializer = new \Symfony\Component\Serializer\Serializer(
        array(new \Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer()),
        array('json' => new \Symfony\Component\Serializer\Encoder\JsonEncoder())
    );

    $callbacks = array('books' => function ($books) { return NULL; });

    return new Response(
        $serializer->serialize($paginator->getRows(), 'json', $callbacks),
        200,
        array('Content-Type' => 'application/json')
    );

Besides of returning NULL, you could also do things like:

    $callbacks = array(
        'books' => function ($books) {
            $ids = array();
            foreach ($books as $book) {
                $ids[] = $book->getId();
            }
            return $ids;
        },
        'author' => function ($author) {
            return $author->getId();
        },
        'creationDate' => function ($creationDate) {
            return $creationDate->format('d/m/Y');
        },
    );

The commit is not complete yet. But at this point I am interested in your opinions.

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

by lsmith77 at 2012-03-12T22:53:18Z

in general i agree that using a callback is a good solution to provide more power without complicating the API or implementation in this case.

please add a test case, this should also help illustrate how this can be used in practice.

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

by schmittjoh at 2012-03-13T04:54:33Z

Note that your change breaks the API defined by the interface, i.e. someone using this method needs to type-hint the serializer implementation, not the interface.

It also adds a parameter to the public API of the serializer which will only work with one specific normalizer. What if another normalizer needs additional information, should another parameter be added to the serialize method? What about deserialization?

Bottom line is, the serializer component was simply not designed for this kind of thing. I've tried to make it more flexible before creating the bundle, but some things simply cannot be fixed in a sane way.

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

by tvlooy at 2012-03-13T06:07:45Z

Would just adding a setCallbacks() to the GetSetMethodNormalizer be a better solution? That doesn't touch the API. I will try to write some tests this evening.

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

by schmittjoh at 2012-03-13T16:22:50Z

That would definitely be better.

You would then need to retrieve the normalizer instance before calling ``serialize`` on the serializer which also leaves a stale taste, but I have no other solution for now.

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

by tvlooy at 2012-03-13T21:32:26Z

So, this should be it then. Yet an other usage example:

    $normalizer = new \Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer();
    $normalizer->setCallbacks(
        array(
            'books' => function ($books) {
                $ids = array();
                foreach ($books as $book) {
                    $ids[] = $book->getId();
                }
                return $ids;
            },
        )
    );
    $serializer = new \Symfony\Component\Serializer\Serializer(
        array($normalizer),
        array('json' => new \Symfony\Component\Serializer\Encoder\JsonEncoder())
    );

    return new Response(
        $serializer->serialize($paginator->getRows(), 'json'),
        200,
        array('Content-Type' => 'application/json')
    );

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

by tvlooy at 2012-03-18T21:16:48Z

Anything else needed for this to get pulled in?

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

by tvlooy at 2012-03-19T18:33:58Z

Hm, I like to keep it that way because I like the fact that not passing a callable will result in a warning instead of silently skipping it. You don't get that behaviour by treating it as null.

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

by vicb at 2012-03-19T23:15:37Z

I was unclear: the code should throw an exception when an element is not callable, this is why `null` will not be supported any more (it is not a callback as the `setCallbacks` indicate).

They are several way to support the former behavior:

* the cb can return a defined interface,
* the cb can throw a defines exc,
* by adding a `setIgnoredAttributes` method

Please also squash your commits.

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

by tvlooy at 2012-03-20T21:02:06Z

Yes, I like the setIgnoredAttributes solution. I changed it and squashed the commits.

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

by tvlooy at 2012-03-26T20:07:36Z

some improvements and squashed the commits

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

by stof at 2012-04-03T22:36:15Z

@tvlooy Please rebase your branch. It conflicts with master because of the move of tests.

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

by tvlooy at 2012-04-04T07:43:47Z

@stof I will do it on saturday, if that is ok with you.

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

by fabpot at 2012-04-10T18:29:30Z

Is it mergeable now? ping @Seldaek, @schmittjoh.

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

by tvlooy at 2012-04-10T18:55:04Z

yes, it should be
2012-04-11 12:08:10 +02:00
Fabien Potencier
22d8a436fa merged branch kimhemsoe/xcache_classloader (PR #3809)
Commits
-------

c36651b Fixed spelling error
f123684 Removed leftover from c/p
b74a5d4 Updated to new cache loader pattern.
7e66908 Added XCache class loader

Discussion
----------

[ClassLoader] Added XCache class loader

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

There is no tests, as it seems there is no way to use xcache storage functions from CLI.

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

by stof at 2012-04-06T20:12:09Z

Please implement a XcacheClassLoader following the same pattern than the new ApcClassLoader instead

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

by cordoval at 2012-04-07T14:20:47Z

- should include tests
- should include documentation (will you also update the component documentation for this new class?)

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

by stof at 2012-04-07T14:25:00Z

@cordoval the PR explains why there is no tests: xcache canot be used in the CLI.

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

by cordoval at 2012-04-07T14:26:43Z

ok @stof sorry it said it seemed not to be possible, i thought it was possible but I am wrong.

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

by kimhemsoe at 2012-04-07T15:01:24Z

@cordoval My english is really horrible. I would not mind if someone else could do that task for me. We also need to add doc for the new ApcClassLoader.

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

by cordoval at 2012-04-07T15:03:57Z

I wish you can explain me more then about this class and how to use it in code so then I can write easily the documentation :D deal?

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

by kimhemsoe at 2012-04-07T15:21:25Z

Deal :P

The XcacheClassLoader and ApcClassLoader replaces the old ApcUniversalClassLoader.
They giving us support for using another loader then UniversalClassLoader, without duplicating the cache layer.
Aslong it have a public function findFile($class) method.

 $loader = new ClassLoader();

// register classes with namespaces
$loader->add('Symfony\Component', __DIR__.'/component');
$loader->add('Symfony', __DIR__.'/framework');

$cachedLoader = new XcacheClassLoader('my_prefix', $loader);

// activate the cached autoloader
$cachedLoader->register();

Think that is more or less the essence of this.

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

by cordoval at 2012-04-09T08:28:53Z

it is not add but registerNamespace right?

so the main idea is to get rid of the restriction to use Apc with Universal loader

what is the comparative advantage between APC and Xcache?

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

by kimhemsoe at 2012-04-09T08:55:23Z

Yes if the $loader (class finder) were to be a instance UniversalClassLoader.

Yes the main idea is to be able to reuse the cache layer with any class loader there obey to the one restriction.

Difference between apc and xcache and why to use what is coming down to taste and your setup. We use xcache as APC have some issues in fastcgi setups. when we upgrade to php54 at somepoint we get to chance to move to php-fpm wich solves these issues. Short story: Slightly out of scope for any documentation in here :-P
2012-04-11 11:50:49 +02:00
Fabien Potencier
191aaa3f0c merged branch bschussek/issue3635 (PR #3820)
Commits
-------

65aa387 [Form] Fixed index generation in EntityChoiceList if ID is not an integer

Discussion
----------

[Form] Fixed index generation in EntityChoiceList if ID is not an integer

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3635
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3635)
2012-04-11 11:36:22 +02:00
Fabien Potencier
e9539d8a6d merged branch hhamon/command_description_fixes (PR #3871)
Commits
-------

b4f0a04 [TwigBundle] fixed twig:lint command description.
809933f [FrameworkBundle] fixed translation:update command description.

Discussion
----------

Command description fixes

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-11 09:36:53 +02:00
Fabien Potencier
c7ba1b9605 merged 2.0 2012-04-11 09:33:57 +02:00
Fabien Potencier
9d5743b35c [Console] fixed typo 2012-04-11 09:12:51 +02:00
Hugo Hamon
b4f0a04574 [TwigBundle] fixed twig:lint command description. 2012-04-11 08:58:25 +02:00
Hugo Hamon
809933f55b [FrameworkBundle] fixed translation:update command description. 2012-04-11 08:57:57 +02:00
Fabien Potencier
88353575e4 merged branch vicb/routing_dumpers (PR #3858)
Commits
-------

77185e0 [Routing] Allow spaces in the script name for the apache dumper
6465a69 [Routing] Fixes to handle spaces in route pattern

Discussion
----------

[Routing] Handling of space characters in the dumpers

The compiler was using the 'x' modifier in order to ignore extra spaces and line feeds but the code was flawed:

- it was actually ignoring all the spaces, not only the extra ones added by the compiler,
- all the spaces were stripped in the php and apache matchers.

The proposed fix:

- do not use the 'x' modifier any more (and then do no add extra spaces / line feeds),
- do not strip the spaces in the matchers,
- escapes the spaces (both in regexs and script name) for the apache matcher.

It also include [a small optimization](https://github.com/vicb/symfony/pull/new#L9L89) when the only token of a route is an optional variable token - the idea is to make the regex easier to read.

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

by vicb at 2012-04-10T13:59:45Z

@Baachi fixed now. Thanks.

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

by Tobion at 2012-04-10T16:01:31Z

+1, I saw no reason for pretty printing the regex in the first place (just for debugging I guess).
@vicb since you want to make the regex easier to read, I propose the remove the `P` from the variable regex `?P<bar>`, which is not needed anymore in PHP 5.3 (and we only support PHP 5.3+ anyway).

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

by vicb at 2012-04-10T16:08:36Z

@Tobion could you make a PR to this branch for the named parameters ?

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

by Tobion at 2012-04-10T16:12:34Z

I can include it in #3754 because I'm about the add 2 more fixes to it anyway.
But when I proposed to apply these fixes to 2.0 Fabien rejected it. So not sure what branch you want me to apply this.

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

by vicb at 2012-04-10T16:25:38Z

May be the best is to put it on hold while I am reviewing your PRs. There are already enough changes, we'll make an other PR after all have been sorted out.

What's the difference between 3754 and 3810 ? (3810 + 3763 = 3754 ?)

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

by Tobion at 2012-04-10T16:39:32Z

Lol you forget to link the PR numbers. At first sight I thought it's some sort of mathematical riddle. Haha
#3810 is for 2.0 =  #3763 (already merged) + #3754 for master

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

by vicb at 2012-04-10T16:52:18Z

I didn't link on purpose... the question is if '=' means strictly or loosely equal (any diffs - beside master vs 2.0) ?

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

by Tobion at 2012-04-10T17:06:04Z

It just applies my changes to 2.0. Nothing more. So master still differs from 2.0 by the addional features that were already implemented (e.g. `RouteCollection->addCollection` with optional requirements and options). But since my changes are bug fixes (except the performance improvement in #3763 but that doesn't break anything and makes 2.0 easier to maintain) I thought they should go into 2.0 as well.

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

by vicb at 2012-04-10T17:14:27Z

@Tobion only bug fixes mean "only bug fixes". You should re-open a PR for 2.0 with "only bug fixes", you might want to wait for me to review 3754.

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

by Tobion at 2012-04-10T17:21:00Z

Without #3763 it's much harder to apply the bug fixes. And now that I found 2 more bugs which requiresome rewriting of the PhpMatcherDumper, I don't want to apply all the commits by hand again for 2.0...
2012-04-11 08:28:45 +02:00
Fabien Potencier
e21d4ffde4 [Console] fixed CS 2012-04-11 08:26:14 +02:00
Jean-François Simon
5b5b2c81c4 [Console] Fixed and added formatter tests. 2012-04-11 08:04:59 +02:00
Jean-François Simon
4ee8cfb81e [Console] Updated formatter to use style stack. 2012-04-11 07:58:51 +02:00
Jean-François Simon
bd1d28cb50 [Console] Added formatter style stack tests. 2012-04-11 07:58:28 +02:00
Jean-François Simon
b63bd0e7e0 [Console] Added formatter style stack. 2012-04-11 07:58:13 +02:00
Juti Noppornpitak
37843b33a9 Updated with PHP logo (only the text). 2012-04-10 23:15:03 -04:00
Juti Noppornpitak
d5e0cccacc Made the toolbar to show the version, memory usage, the state of security (both a abbreviation and an associate description) and number of DB requests and request time. 2012-04-10 22:12:49 -04:00
Fabien Potencier
02e1b81f65 merged 2.0 2012-04-10 20:26:56 +02:00
Fabien Potencier
57990cc53f merged branch johannes85/2.0 (PR #3791)
Commits
-------

0024ddc Fix for using route name as check_path.

Discussion
----------

Security Bundle route as check_path

In the current 2.0 branch you can't use a route as
firewalls:
admin_area:
login_path:
you will get a InvalidConfigurationException.

In the 2.1 version this is fixed. Since 2.1 isn't released i think this fix should be merged into the 2.0 branch too. Many people have this problem (https://github.com/schmittjoh/JMSI18nRoutingBundle/issues/7) for example which effectively blocks internationalisation in combination with the firewall.

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

by stof at 2012-04-10T13:35:13Z

@fabpot ping
2012-04-10 20:26:31 +02:00
Fabien Potencier
c7b226442b merged branch bschussek/issue3732 (PR #3819)
Commits
-------

c4e68a3 [Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class

Discussion
----------

[Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3732
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3732)

The addXxx()/removeXxx() methods should now be called correctly in ChoiceType and CollectionType.

PropertyPath now favors addXxx()/removeXxx() over setXxx() for collections. For example:

```
$propertyPath = new PropertyPath('article.tags');

// Tries to use addTag()/removeTag() and only uses setTags() (et al.)
// if not found
$propertyPath->setValue($article, $tags);
```

For other languages than English or very irregular plurals, a custom singular can be set by separating it with a pipe:

```
$propertyPath = new PropertyPath('article.genera|genus');
```

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

by bschussek at 2012-04-07T12:40:39Z

Again, the failing build is not my fault.
2012-04-10 20:22:54 +02:00
Fabien Potencier
517f8e0162 merged branch bschussek/issue3839 (PR #3859)
Commits
-------

61d792e [Form] Changed checkboxes in an expanded multiple-choice field to not include the choice index
bc9bc4a [Form] Fixed behavior of expanded multiple-choice field when submitted without ticks
2e07256 [Form] Simplified choice list API
2645120 [Form] Fixed handling of expanded choice lists, checkboxes and radio buttons with empty values ("")

Discussion
----------

[Form] Fixed handling of empty values in checkbox/radio/choice type

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3839, #3366
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3839)

This PR fixes the processing of checkboxes and radio buttons with empty "value" attributes as well as of expanded choice forms with empty values. Additionally, some unnecessary complexity has been removed of the new ChoiceList API.

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

by stof at 2012-04-10T13:56:12Z

You probably need to change some things in the CHANGELOG file too

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

by bschussek at 2012-04-10T14:39:24Z

No. This is an update of a previous post-2.0 PR, the CHANGELOG is still accurate.

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

by stof at 2012-04-10T14:46:47Z

well, doesn't it require changes to the description of previous changes related to the ChoiceList ? It does in the UPGRADE file so it is weird if the CHANGELOG does not require any change.

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

by bschussek at 2012-04-10T14:56:05Z

Feel free to check yourself :)
2012-04-10 20:02:12 +02:00
Fabien Potencier
48abdaff3c merged branch bschussek/issue3278 (PR #3860)
Commits
-------

004c873 [Form] Fixed display of DateTimeType and TimeType when displayed as "single_text" and "with_seconds" is false

Discussion
----------

[Form] Fixed display of [Date]TimeType when displayed as "single_text" and "with_seconds" is false

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3278
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3278)
2012-04-10 19:55:43 +02:00
Deni
362ac78463 [FrameworkBundle] Sync Russian translations 2012-04-10 21:33:35 +04:00
Bernhard Schussek
004c873c74 [Form] Fixed display of DateTimeType and TimeType when displayed as "single_text" and "with_seconds" is false 2012-04-10 18:15:31 +02:00
Bernhard Schussek
61d792eebd [Form] Changed checkboxes in an expanded multiple-choice field to not include the choice index 2012-04-10 17:47:40 +02:00
Bernhard Schussek
bc9bc4af5d [Form] Fixed behavior of expanded multiple-choice field when submitted without ticks 2012-04-10 17:42:05 +02:00
Victor Berchet
6465a6987a [Routing] Fixes to handle spaces in route pattern
- The route compiler does not add extra space or line-feed,
- The generated regex does not use the 'x' modified any more,
- The PHP and apache matchers do not need to strip any chars (vs space and line feed before),
- The space characters are escaped according to the apache format
2012-04-10 17:29:34 +02:00
Bernhard Schussek
2e07256921 [Form] Simplified choice list API 2012-04-10 15:37:24 +02:00
Bernhard Schussek
26451201e0 [Form] Fixed handling of expanded choice lists, checkboxes and radio buttons with empty values ("") 2012-04-10 15:35:46 +02:00
Brikou CARRE
6486e25a38 fixed used statements 2012-04-10 11:28:30 +02:00
Brikou CARRE
353085857b fixed typehints in docblocks (IDE completion works now) 2012-04-10 11:04:07 +02:00
Pierre Minnieur
a56bea6d88 removed param_converter from symfony-1.0.xsd 2012-04-10 12:00:57 +03:00
Fabien Potencier
8860424823 merged branch vicb/url_decoding (PR #3780)
Commits
-------

55014a6 [Routing] Request methods always return a raw path, fix the matcher to decode only once
d17ba0e Fixed base URL detection when request URI contains encoded chars

Discussion
----------

[RFC] Fix issues with url decoding

Related: #2324, #2963, #2962, #2579

### This PR fixes two issues:

* `+` in paths were turned to " " by `urldecode()`
* `urldecode()` was called a few times (and a different number of times according to which part of the path was handled, see #2962 for details).

### BC Breaks:

* `Request::getPathInfo()`, `Request::getBaseUrl()` and `Request::getBasePath` now return the raw (encoded) path (vs a decoded path before this PR). You should check any calls to these methods in your code and wrap them in `rawurldecode()` if needed.
* The `UrlMatcher` now decodes the URL only once (i.e. variable are no more decoded twice) and use `rawurldecode()` to support `+`.

### Notes:

* @arnaud-lb, the first commit is based on your #2963 so I put your name for the commit,

### Comment history from the original PR:

@vicb

**The state before this PR:**

* getRequestUri() returns an **encoded** value
* getPathInfo() returns a **decoded** value
* getBaseUrl() returns a **decoded** value
* getBasePath() returns a **decoded** value

The decoded value is wrong as `urldecode` is used in place of `rawurldecode` turning `+` into a space character (#2324).

The matcher starts by urldecoing the path (it is already decoded as explained right before) and then urldecodes each variable one more time.

We end up with a path being decoded twice and variables being decoded three times.

`Request::getUri()` calls both `getBaseUrl()` and `getPathInfo()` so that the return URI is **decoded**.

**The state after the PR:**

* getRequestUri() returns an **encoded** value
* getPathInfo() returns an **encoded** value
* getBaseUrl() returns an **encoded** value
* getBasePath() returns an **encoded** value

We are consistent and we have the raw values everywhere - there is no (easy) way to get the encoded value back once it has been decoded as it is done in the current code.

The matcher relies on an encoded value and decode the value only once (using `rawurldecode` to support `+`s).

So basically this PR:

* fix a bug - URL with `+` are now supported,
* makes paths consistent - encoded values everywhere, including `getUri()`
* makes variables consistent: they are decoded only once - the same as query string parameters.

There are some BC breaks:

* getPathInfo() returns an encoded value vs a decoded one before,
* getBaseUrl() returns an encoded value vs a decoded one before.
* getBasePath() returns an encoded value vs a decoded one before.

Any code relying on the output of one of the 2 previous methods should be checked and upgraded if needed. I am interested in the use cases where your code need to be updated.

@Seldaek

I checked a few projects and this is what I found (usage of getPathInfo & getBaseUrl):

- One use case of getPathInfo to check if the url started with `/something/` which is a prefix used for all "overlay" content which had to be treated differently somewhere => most likely unaffected
- One use case for checking path prefixes by regex in our [CorsBundle](https://github.com/nelmio/NelmioCorsBundle/blob/master/EventListener/CorsListener.php#L52-56) => potentially affected depending on the complexity of regexes I'd say

@vicb

Thanks @Seldaek for reporting the use cases. You second case would be solved by `rawurldecode`ing the path info which is a minimal change.

And in general I think we have to expand to doc to specify the url format that should be used.

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

by vicb at 2012-04-04T13:42:21Z

I'll squash the commits before this gets merged but for now it make the review easier.
2012-04-10 10:43:27 +02:00
Victor Berchet
55014a6841 [Routing] Request methods always return a raw path, fix the matcher to decode only once
sq
2012-04-10 10:40:58 +02:00
Arnaud Le Blanc
d17ba0e147 Fixed base URL detection when request URI contains encoded chars
Signed-off-by: Victor Berchet <victor@suumit.com>
2012-04-10 10:15:43 +02:00
Alessandro Desantis
78d6f3f0e0 [Filesystem] Written missing tests. 2012-04-10 10:15:30 +02:00
Alessandro Desantis
1998f3f5ec [Filesystem] Added silence operator to rename(). 2012-04-10 10:15:18 +02:00
Juti Noppornpitak
37ad8a61cd Removed the check for verbose and adjusted the style when the toolbar is on the top of the page. 2012-04-10 02:43:51 -04:00
Juti Noppornpitak
67b0532d24 Redesigned the WDT. 2012-04-10 00:44:32 -04:00
Alessandro Desantis
7ce5a526ec [Filesystem] Fixed docs for rename(). 2012-04-09 21:19:37 +02:00
Alessandro Desantis
3f2865b90f [Filesystem] rename() throws RuntimeException on error (fixes #3848). 2012-04-09 20:56:50 +02:00
Jakub Zalas
efad5d5452 [Filesystem] Prevented infiite loop on windows while calling mirror on symlink. Added test for mirroring symlinks. 2012-04-09 15:14:36 +01:00
Kim Hemsø Rasmussen
c36651bb6e Fixed spelling error 2012-04-09 10:21:42 +02:00
Eriksen Costa
31dde144ff [Locale] updated StubIntlDateFormatter::format() behavior for PHP >= 5.3.4 2012-04-08 19:21:28 -03:00
Dariusz Górecki
aa055dfd98 [Composer] Stwitch to composer vendors management
Bug fix: no
Feature addition: yes
Backwards compatibility break: ?
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

This speeds up Travis CI builds to `~2 min` also makes vendor management
a lot easier.
2012-04-08 21:11:03 +02:00
Jordi Boggiano
6dca141de8 [Process] Skip signal assertion on windows 2012-04-08 20:29:02 +02:00
Jordi Boggiano
4cd0fb4c69 [Process] Skip test that is still getting stuck on windows 2012-04-08 20:28:28 +02:00
Jordi Boggiano
e82a05d3e7 [Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation 2012-04-08 20:27:37 +02:00
Jordi Boggiano
f4227b5f82 [Process] Removing useless code (this is already done in updateStatus) 2012-04-08 20:26:27 +02:00
Jordi Boggiano
2d586d245d [Process] Fix a mistake triggering stream_select errors 2012-04-08 20:26:04 +02:00
Jordi Boggiano
f3408ccf2c [Finder] Avoid unnecessary use of the @ operator 2012-04-08 19:39:04 +02:00
Joseph Bielawski
292364ad70 [DomCrawler] Added some docbocks into DomCrawler classes. Closes #3832 2012-04-08 13:35:35 +02:00
Fabien Potencier
d6948581ac [TwigBundle] simplified code 2012-04-08 12:56:21 +02:00
Fabien Potencier
a11ec3e71c [TwigBundle] added correct file name in twig:lint exception reporting 2012-04-08 12:53:40 +02:00
Fabien Potencier
57c6aaa397 [TwigBundle] tweaked previous merge 2012-04-08 12:41:50 +02:00
Fabien Potencier
9c0fba93b2 merged branch marcw/feat-twig-lint (PR #3804)
Commits
-------

8726ade Adds more features to twig:lint command
1d7e9d9 Adds a linter command for templates

Discussion
----------

Adds a linter command for templates

Let's this PR be stoffed. ;)

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

by Tobion at 2012-04-06T15:48:18Z

Checking a single file is very limited. Checking a whole directory would be more useful, wouldn't it?

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

by willdurand at 2012-04-06T17:56:57Z

I think you should provide a way to validate all templates for a given bundle, something like:

    php app/console twig:lint @MySuperBundle

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

by henrikbjorn at 2012-04-06T18:03:45Z

Wouldnt it be better to throw some kind of exception if the lint is erroneous?

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

by marcw at 2012-04-07T11:22:34Z

@Tobion @willdurand  You can do that by combining unix tools.
@henrikbjorn Why ?

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

by marcw at 2012-04-07T11:27:11Z

Updated.

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

by dlsniper at 2012-04-07T13:15:53Z

@marcw it would be indeed nice to have support for a bundle/directory out of the box as some of the Symfony2 users might not be running unix or know the right commands to make this work.

I could help you with a PR in your repo if you want.

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

by henrikbjorn at 2012-04-07T18:55:34Z

@marcw as the console component will catch them and convert them into the right error code, also will display what went wrong instead of just dieing.

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

by marcw at 2012-04-08T09:15:37Z

Updated with all comments and requested features.
2012-04-08 12:39:25 +02:00
Bernhard Schussek
c4e68a3295 [Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class
Setting a property path like "article.tags" will now automatically try to
favor addTag() and removeTag() over setTags(), if found. If you want to
set up a property path with an irregular singular that is not detected,
you can use "|" to separate the plural from the singular form in the
path: "article.genera|genus".

Another consequence of this commit is that the MergeCollectionListener has
been simplified a lot. Forms returning an array or a collection will
always result in adders/removers being called now without having to add
this listener.
2012-04-08 12:32:17 +02:00
Bernhard Schussek
65aa387da0 [Form] Fixed index generation in EntityChoiceList if ID is not an integer 2012-04-08 12:32:10 +02:00
marc.weistroff
8726ade310 Adds more features to twig:lint command 2012-04-08 11:14:51 +02:00
Fabien Potencier
5122d68c24 merged branch ruimarinho/exception_css_tweaks (PR #3827)
Commits
-------

fad114b Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags

Discussion
----------

Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build status](https://secure.travis-ci.org/ruimarinho/symfony.png?branch=exception_css_tweaks)
Fixes the following tickets: -
Todo: -

Ever been in a situation when you're debugging code wrapped around `<pre>` tags and that code throws an exception? If you're familiar with this screenshot, you have :-) ![Image](http://i.imgur.com/dwxdD.png)

This PR is just a little tweak to the exceptions layout CSS in order to allow your to view the exception message. It also fixes a word break when messages are too long. ![Image 2](http://i.imgur.com/whxZv.png).

The build is currently failing due to an unmerged patch from the 2.0 branch.
2012-04-08 09:24:17 +02:00
Fabien Potencier
0e525fc5ce merged 2.0 2012-04-08 09:22:35 +02:00
Fabien Potencier
c6096e323e merged branch eriksencosta/test-fixes (PR #3830)
Commits
-------

fdee352 [TwigBridge] updated suggested packages
dad1750 [TwigBridge] updated TestCase as an abstract class
140ac20 [TwigBridge] fixed bootstrap

Discussion
----------

[TwigBridge] updated Composer suggested packages and test fixes

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

by eriksencosta at 2012-04-08T06:13:53Z

Rebased.
2012-04-08 09:18:17 +02:00
Eriksen Costa
fdee352619 [TwigBridge] updated suggested packages 2012-04-08 03:12:14 -03:00
Eriksen Costa
dad1750dfa [TwigBridge] updated TestCase as an abstract class 2012-04-07 18:49:17 -03:00
Eriksen Costa
140ac2014e [TwigBridge] fixed bootstrap 2012-04-07 18:47:00 -03:00
Jakub Zalas
22e2ad80c9 [Filesystem] Fixed relative path calculation for end path which is a subdirectory of the start path. 2012-04-07 21:52:26 +01:00
Jakub Zalas
bc93787a0d [Filesystem] Fixed relative path calculation for paths with various combinations of trailing directory separators. 2012-04-07 21:19:12 +01:00
Fabien Potencier
dee79e910d merged branch jakzal/SetCookieWithMultipleCookiesBugFix (PR #3823)
Commits
-------

7f92833 [BrowserKit] Fixed cs.
df3da28 [BrowserKit] Using assertNull instead of assertEquals.
87890d3 [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie.

Discussion
----------

[BrowserKit] Fixed CookieJar being unable to parse multiple cookies

Fix proposition for #3109

My fix splits value of *Set-Cookie* header by comma. Than it checks each extracted part if it starts with a cookie-name (token). If check is positive cookie is added to the list. Otherwise it's appended to the previous value. First element is always added to the list.

[rfc6265](http://tools.ietf.org/html/rfc6265) defines cookie-name with token:

    cookie-name = token
    token = <token, defined in [RFC2616], Section 2.2>

token is defined in [rfc2616](http://tools.ietf.org/html/rfc2616#section-2.2) as follows:

    token = 1*<any CHAR except CTLs or separators>
    CHAR = <any US-ASCII character (octets 0 - 127)>
    separators = "(" | ")" | "<" | ">" | "@"
                  | "," | ";" | ":" | "\" | <">
                  | "/" | "[" | "]" | "?" | "="
                  | "{" | "}" | SP | HT

That means cookie-name can be built out of following set of characters: *! # $ % & ' * + - . ^ _ ` | ~ 0-9 A-Z a-z*

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
2012-04-07 21:57:48 +02:00
Jakub Zalas
7f928332a9 [BrowserKit] Fixed cs. 2012-04-07 19:45:50 +01:00
Fabien Potencier
0a7f4668e0 [Process] added a note about user-defined error exist codes 2012-04-07 20:15:50 +02:00
Jakub Zalas
df3da289ad [BrowserKit] Using assertNull instead of assertEquals. 2012-04-07 18:45:48 +01:00
Jakub Zalas
87890d3a7c [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie. 2012-04-07 18:38:39 +01:00
Tom Van Looy
039ff6fc8e allow more control on GetSetMethodNormalizer by using callback functions and an ignoreAttributes list 2012-04-07 18:07:14 +02:00
Rui Marinho
fad114b76a Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags 2012-04-07 16:28:29 +01:00
Kim Hemsø Rasmussen
f1236844a8 Removed leftover from c/p 2012-04-07 17:15:32 +02:00
Bernhard Schussek
e0ce6b4c11 [Form] Fixed required value guessed by ValidatorTypeGuesser 2012-04-07 16:26:16 +02:00
marc.weistroff
1d7e9d9753 Adds a linter command for templates 2012-04-07 13:26:03 +02:00
Fabien Potencier
13aa515d65 merged branch jakzal/FilesystemTests (PR #3811)
Commits
-------

100e97e [Filesystem] Fixed warnings in makePathRelative().
f5f5c21 [Filesystem] Fixed typos in the docblocks.
d4243a2 [Filesystem] Fixed a bug in remove being unable to remove symlinks to unexisting file or directory.
11a676d [Filesystem] Added unit tests for mirror method.
8c94069 [Filesystem] Added unit tests for isAbsolutePath method.
2ee4b88 [Filesystem] Added unit tests for makePathRelative method.
21860cb [Filesystem] Added unit tests for symlink method.
a041feb [Filesystem] Added unit tests for rename method.
8071859 [Filesystem] Added unit tests for chmod method.
bba0080 [Filesystem] Added unit tests for remove method.
8e861b7 [Filesystem] Introduced workspace directory to limit complexity of tests.
a91e200 [Filesystem] Added unit tests for touch method.
7e297db [Filesystem] Added unit tests for mkdir method.
6ac5486 [Filesystem] Added unit tests for copy method.
1c833e7 [Filesystem] Added missing docblock comment.

Discussion
----------

[Filesystem] Fixed a bug in remove() being unable to unlink broken symlinks

While working on test coverage for Filesystem class I discovered a bug in remove() method.

Before removing a file a check is made if it exists:

    if (!file_exists($file)) {
        continue;
    }

Problem is [file_exists()](http://php.net/file_exists) returns false if link's target file doesn't exist. Therefore remove() will fail to delete a directory containing a broken link. Solution is to handle links a bit different:

    if (!file_exists($file) && !is_link($file)) {
        continue;
    }

Additionally, this PR improves test coverage of Filesystem component.

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

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

by cordoval at 2012-04-07T00:55:59Z

✌.|•͡˘‿•͡˘|.✌

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

by fabpot at 2012-04-07T06:12:34Z

Tests do not pass for me:

    PHPUnit 3.6.10 by Sebastian Bergmann.

    Configuration read from /Users/fabien/work/symfony/git/symfony/phpunit.xml.dist

    .........................EE.......

    Time: 0 seconds, Memory: 5.25Mb

    There were 2 errors:

    1) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #0 ('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component', '../')
    Uninitialized string offset: 29

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    2) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #1 ('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../')
    Uninitialized string offset: 16

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    FAILURES!
    Tests: 34, Assertions: 67, Errors: 2.

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

by jakzal at 2012-04-07T07:26:15Z

Sorry for this. For some reason my PHP error reporting level was to low to catch this...

Should be fixed now but I needed to modify the makePathRelative() (this bug existed before).
2012-04-07 10:18:55 +02:00
Fabien Potencier
e7dbc38941 merged branch eriksencosta/pt_BR-translations (PR #3817)
Commits
-------

bf51a58 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :)
dc94e27 [FrameworkBundle] synced pt_BR translations

Discussion
----------

synced and fixed pt_BR translations
2012-04-07 10:18:49 +02:00
Eriksen Costa
bf51a58f37 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :) 2012-04-07 04:30:12 -03:00
Eriksen Costa
dc94e27dbb [FrameworkBundle] synced pt_BR translations 2012-04-07 04:29:23 -03:00
Jakub Zalas
100e97ebe7 [Filesystem] Fixed warnings in makePathRelative(). 2012-04-07 08:23:20 +01:00
Fabien Potencier
72e854e943 fixed CS 2012-04-07 09:10:50 +02:00
Eriksen Costa
abd59c3dbd Merge branch 'master' into cs-fixes 2012-04-07 03:53:28 -03:00
Fabien Potencier
d967d39d27 merged branch chmielot/3446-empty-multiple-entity-choice (PR #3734)
Commits
-------

a430f3d [#3446] [Form] Fix getChoicesForValues of EntityChoiceList on empty values

Discussion
----------

[Form] Fix reverseTransform on multiple entity form type

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3446, #3727
Todo: -

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

by stof at 2012-04-03T23:05:55Z

@bschussek ping

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

by stof at 2012-04-03T23:06:45Z

This is an alternate implementation for #3727

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

by chmielot at 2012-04-04T13:47:27Z

OK, this is another possibility to fix this issue with working tests. What do you think about this?

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

by chmielot at 2012-04-04T13:51:27Z

OK, just done.

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

by stof at 2012-04-04T13:51:39Z

@beberlei @bschussek ping

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

by bschussek at 2012-04-06T18:50:37Z

@fabpot 👍
2012-04-07 08:22:05 +02:00
Fabien Potencier
526fb7bf05 merged branch bschussek/issue3738 (PR #3807)
Commits
-------

6584721 [Form] Improved labels generated by default from form names
6e0b03a [Form] Fixed label of prototype in CollectionType
fc342d1 Merge remote branch 'umpirsky/collection-name' into issue3738
f91660d Added test for prototype label.

Discussion
----------

[Form] Fixed default label generated for the CollectionType prototype

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3738, #3739
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3738)

(the fact that the build fails seems to origin from the broken master)
2012-04-07 08:15:43 +02:00
Fabien Potencier
1c10b0b455 merged branch eriksencosta/readme-fixes (PR #3814)
Commits
-------

f3efea3 [Propel1Bridge][TwigBridge] fixed export instructions in the README files

Discussion
----------

[Propel1Bridge][TwigBridge] fixed export instructions in the README files
2012-04-07 08:09:06 +02:00
Eriksen Costa
f5f0506b1b [TwigBundle] fixed CS 2012-04-07 01:24:57 -03:00
Eriksen Costa
f3efea3a6e [Propel1Bridge][TwigBridge] fixed export instructions in the README files 2012-04-06 23:24:52 -03:00
Jakub Zalas
f5f5c21228 [Filesystem] Fixed typos in the docblocks. 2012-04-07 00:05:37 +01:00
Jakub Zalas
d4243a28b6 [Filesystem] Fixed a bug in remove being unable to remove symlinks to unexisting file or directory. 2012-04-07 00:01:32 +01:00
Jakub Zalas
11a676d672 [Filesystem] Added unit tests for mirror method. 2012-04-06 23:56:57 +01:00
Jakub Zalas
8c940699c1 [Filesystem] Added unit tests for isAbsolutePath method. 2012-04-06 23:16:46 +01:00
Jakub Zalas
2ee4b8861c [Filesystem] Added unit tests for makePathRelative method. 2012-04-06 23:05:31 +01:00
Jakub Zalas
21860cbb5d [Filesystem] Added unit tests for symlink method. 2012-04-06 22:25:57 +01:00
Kim Hemsø Rasmussen
b74a5d4f14 Updated to new cache loader pattern. 2012-04-06 22:35:56 +02:00
Jakub Zalas
a041feb4b3 [Filesystem] Added unit tests for rename method. 2012-04-06 21:21:21 +01:00
Jakub Zalas
8071859915 [Filesystem] Added unit tests for chmod method. 2012-04-06 21:17:12 +01:00
Jakub Zalas
bba0080560 [Filesystem] Added unit tests for remove method. 2012-04-06 20:38:21 +01:00
Jakub Zalas
8e861b746a [Filesystem] Introduced workspace directory to limit complexity of tests. 2012-04-06 19:59:25 +01:00
Kim Hemsø Rasmussen
7e66908c02 Added XCache class loader 2012-04-06 20:32:52 +02:00
Jeremy Mikola
1c3e4ac694 [DependencyInjection] Fix Yaml file loader test
This broke when 2.0 was recently merged into master with b9daae2847, as the Yaml fixture change from 24a0d0a2dc was not included.
2012-04-06 14:29:48 -04:00
Jakub Zalas
a91e200db7 [Filesystem] Added unit tests for touch method. 2012-04-06 19:22:22 +01:00
Jakub Zalas
7e297dbead [Filesystem] Added unit tests for mkdir method. 2012-04-06 19:10:23 +01:00
Bernhard Schussek
658472193d [Form] Improved labels generated by default from form names 2012-04-06 19:50:06 +02:00
Bernhard Schussek
6e0b03a6e2 [Form] Fixed label of prototype in CollectionType 2012-04-06 19:45:42 +02:00
Bernhard Schussek
fc342d1a5b Merge remote branch 'umpirsky/collection-name' into issue3738 2012-04-06 19:34:40 +02:00
Jakub Zalas
6ac5486672 [Filesystem] Added unit tests for copy method. 2012-04-06 17:48:54 +01:00
Jakub Zalas
1c833e7d78 [Filesystem] Added missing docblock comment. 2012-04-06 17:48:01 +01:00
Jordi Boggiano
7ce22f0cef [Console] Add docblocks 2012-04-06 18:25:51 +02:00
Fabien Potencier
20a9961711 merged branch jjbohn/feature/property-path-hasser (PR #3549)
Commits
-------

b6ac1aa [FORM] Give PropertyPath ability to read hassers

Discussion
----------

[Form] Give PropertyPath ability to read hassers

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

Using a `hasser` instead of `isser` for Boolean values is pretty common. I've found myself using `issers` a handful of times just to make an interface play nice with the form component, but the code reads funny now. I don't think we should be accounting for every possible `getter` variation, but I think this one is common enough that it warrants a discussion.

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

by fabpot at 2012-03-11T08:25:31Z

I tend to agree with with. What do you think @bschussek?

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

by kriswallsmith at 2012-03-16T22:42:28Z

I'm not so sure. There are lots of reasons to write a *hasser* that accepts an argument (i.e. `User::hasRole($role)`). Doesn't seem as clean as *issers* and *getters*.

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

by vicb at 2012-03-16T22:49:14Z

> There are lots of reasons to write a hasser that accepts an argument

May be can check for 0 args as we are already using reflexion ?

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

by kriswallsmith at 2012-03-16T22:55:43Z

In that case we should check that there are either 0 arguments or only optional arguments and also consider adding the same logic to the other varieties.

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

by jjbohn at 2012-03-16T23:37:47Z

Passing arguments seems like a pretty big departure for PropertyPath. How would you annotate that? I'm not sure I see a common use case for needing arguments when mapping data to and from forms.

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

by stof at 2012-03-16T23:50:22Z

@jjbohn it is not about passing arguments but about using the hasser only if it does not have required arguments

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

by jjbohn at 2012-03-17T01:54:18Z

Ah. I see. I have a tendency to read @kriswallsmith comments wrong :D. I could see that but iirc, there's not any current check like this on the other accessors. Happy to add it though if there's a consensus.

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

by fabpot at 2012-03-17T11:24:34Z

What's the point is checking the hasser/getter/isser arguments. It's up to the developer to check if he can use them or not. Let's not complexify the code for this.

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

by kriswallsmith at 2012-03-17T15:37:39Z

My concern is that someone writes a hasser method on their model that is not intended for use with the form component but it's called anyway, leading to WTFs.

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

by stof at 2012-04-03T22:28:21Z

@fabpot what's your decision about this ?

@jjbohn you need to rebase your PR. It conflicts with master as tests have been moved

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

by bschussek at 2012-04-05T14:53:55Z

@kriswallsmith is right. The check for 1 === $method->getNumberOfRequiredParameters() can (and should) easily be added to all of the if-clauses here.

Apart from that, I'm okay with adding this.
2012-04-06 15:09:38 +02:00
Fabien Potencier
85535de74b moved a fixture file 2012-04-06 14:27:17 +02:00
Fabien Potencier
245a7b7eec merged branch ruimarinho/icu-48-fix (PR #3748)
Commits
-------

8689e9c [WIP] [Locale] Fixes NumberFormatter tests failing when using ICU 4.8 or 4.8.1

Discussion
----------

[WIP] [Locale] Fixes NumberFormatter tests failing when using ICU 4.8 or 4.8.1.1

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

The ICU CLDR 2.0 data has been updated on ICU 4.8 and the same data set is used on version 4.8.1.1. The problem is related to [this commit](http://bugs.icu-project.org/trac/changeset?reponame=&new=31307%40icu%2Ftrunk%2Fsource%2Fdata%2Fcurr%2Fen.txt&old=31074%40icu%2Ftrunk%2Fsource%2Fdata%2Fcurr%2Fen.txt) which has since been updated with new data and subsequently shipped with version 49.

The `DateFormatter` tests are still failing - see this [gist](https://gist.github.com/2004d40e5167286028ea). Suggestions are welcomed on how to handle this part.

Test results with PHP 5.4.0 with ICU 4.8.1.1 on OSX:

````
FAILURES!
Tests: 5917, Assertions: 12749, Failures: 26, Incomplete: 11, Skipped: 47.
```

with this WIP patch:

```
FAILURES!
Tests: 5917, Assertions: 12749, Failures: 13, Incomplete: 11, Skipped: 47.
```
2012-04-06 14:24:19 +02:00
Fabien Potencier
1387415ec3 merged branch hhamon/route_collection_better_exception_message (PR #3801)
Commits
-------

04ae7cc [Routing] fixed exception message.
f7647f9 [Routing] improved exception message when giving an invalid route name.

Discussion
----------

Route collection better exception message

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-06 14:22:10 +02:00
Fabien Potencier
b9daae2847 merged 2.0 2012-04-06 14:21:18 +02:00
Fabien Potencier
f2398f61a6 merged branch Seldaek/console_ex_20 (PR #3802)
Commits
-------

595cc11 [Console] Wrap exception messages to the terminal width to avoid ugly output
97f7b29 [Console] Avoid outputing \r's in exception messages

Discussion
----------

[Console] Exception rendering fixes

This fixes two things:

- `\r`'s in exception messages were output (in case of `\r\n` newlines), creating really weird results on windows.
- long exception messages were wrapping and then the "red" block was completely messed up, with half black/half red lines, now it's wrapped before output if the terminal width can be detected.

If you don't care about merging this for 2.0, you can also merge the `console_ex` branch which applies on master. Due to moving tests and renaming of some normalize stuff in the tests, the two test patches are kind of different.

RFC: I am really not sure where to put those getTerminalWidth/Height methods. I guess this is not the best place.
2012-04-06 14:15:48 +02:00
Fabien Potencier
37c9fe9a2b merged branch Seldaek/validator_yaml (PR #3794)
Commits
-------

8ceb569 Fix typo
8702ea5 [Validator] Allow empty keys in the validation config

Discussion
----------

[Validator] Allow empty keys in the validation config

This allows you to just list fields that don't have validation rules (yet), for future reference it's kinda helpful. Right now if they're not commented out a fatal is thrown because null isn't an array.

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

by bschussek at 2012-04-05T15:34:09Z

Could you add a test please?

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

by Seldaek at 2012-04-05T15:34:48Z

The dummy key I added in the test makes it fail without the fix.

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

by bschussek at 2012-04-05T15:46:54Z

Ah, that's perfect, I overlooked that. Thanks!
2012-04-06 14:14:01 +02:00
Jordi Boggiano
595cc11251 [Console] Wrap exception messages to the terminal width to avoid ugly output 2012-04-06 13:54:54 +02:00
Jordi Boggiano
97f7b29783 [Console] Avoid outputing \r's in exception messages 2012-04-06 13:51:32 +02:00
Drak
33881ddd30 [HttpFoundation] Add more tests for casing 2012-04-06 17:10:55 +05:45
Hugo Hamon
04ae7cc605 [Routing] fixed exception message. 2012-04-06 11:45:36 +02:00
Hugo Hamon
f7647f9325 [Routing] improved exception message when giving an invalid route name. 2012-04-06 10:49:41 +02:00
Drak
aec133996e [HttpFoundation] Coding standards. 2012-04-06 07:29:37 +00:00
Drak
3dc72cdf21 Add isMethod() to Request object 2012-04-06 12:35:12 +05:45
Konrad Mohrfeldt
f617e02a96 [Validator] added less-strict email host verification
New checkHost attribute in email constraint will
make the validator check for only one of MX, A or AAAA
DNS resource records to verify it as a valid
email address.
2012-04-06 02:33:41 +02:00
Jordi Boggiano
8ceb569b52 Fix typo 2012-04-05 19:10:13 +02:00
Jordi Boggiano
8702ea5f6d [Validator] Allow empty keys in the validation config 2012-04-05 17:21:24 +02:00
Markus Lanthaler
0ccb6fa48d [Yaml] fixed phpdoc (closes symfony/Yaml#3) 2012-04-05 15:34:56 +02:00
Johannes
0024ddce9c Fix for using route name as check_path. 2012-04-05 12:20:11 +03:00
Fabien Potencier
6bcd0a2d40 merged branch drak/caed (PR #3783)
Commits
-------

d04638a [EventDispatcher] More logical positions for classes.

Discussion
----------

[EventDispatcher] More logical positions for classes.

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

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

by stof at 2012-04-04T18:59:02Z

ah sorry, I looked at the patch too fast. Only the interface is moved
2012-04-05 08:11:42 +02:00
excelwebzone
bec2f0f70a Fix hebrew grammar 2012-04-04 19:12:09 -07:00
excelwebzone
1b48abbfa2 Hebrew translation update 2012-04-04 19:07:45 -07:00
Drak
d04638a9b5 [EventDispatcher] More logical positions for classes. 2012-04-04 22:03:00 +05:45
Christophe Coevoet
a2f65f7dfa [FrameworkBundle] Added the translation file for the en locale
This fixes the translation when the fallback is set to another language.
This new file can be used as reference by translators to find missing keys
in their translations as every contributor will be able to update it when
adding new keys.
2012-04-04 17:23:03 +02:00
John Bohn
b6ac1aa912 [FORM] Give PropertyPath ability to read hassers 2012-04-04 09:49:16 -05:00
Thomas Chmielowiec (chmielot)
a430f3d8a6 [#3446] [Form] Fix getChoicesForValues of EntityChoiceList on empty values 2012-04-04 15:46:22 +02:00
Rui Marinho
fc41d4f223 [Security] [HttpDigest] Fixes a configuration error caused by an invalid 'key' child node configuration 2012-04-04 14:28:24 +01:00
Fabien Potencier
e4ebffb01b Revert "merged branch ruimarinho/http_digest (PR #3778)"
This reverts commit eb6a26f572, reversing
changes made to a10fee16c1.
2012-04-04 13:13:39 +02:00
Fabien Potencier
eb6a26f572 merged branch ruimarinho/http_digest (PR #3778)
Commits
-------

fd1ea69 [Security] [HttpDigest] Fixes a configuration error caused by an invalid key child node configuration

Discussion
----------

[Security] [HttpDigest] Fixes a configuration error caused by an invalid "key" child node configuration

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
```
2012-04-04 12:56:30 +02:00
Rui Marinho
fd1ea69b78 [Security] [HttpDigest] Fixes a configuration error caused by an invalid key child node configuration 2012-04-04 11:36:25 +01:00
Fabien Potencier
71c9dc31f4 merged branch stof/routing_options_import (PR #3775)
Commits
-------

3c32569 [Routing] Added the possibility to define options for imported resources

Discussion
----------

[Routing] Added the possibility to define options for imported resources

Closes #2772
2012-04-04 08:59:44 +02:00
Fabien Potencier
479d808e6e Revert "merged branch jfsimon/master (PR #3613)"
This reverts commit 959158f9b9, reversing
changes made to b9de0be349.
2012-04-04 08:53:58 +02:00
Fabien Potencier
97fd965b70 merged branch stloyd/patch-3 (PR #3771)
Commits
-------

1456e1e Polish translations sync

Discussion
----------

[Validators] Polish translations sync
2012-04-04 08:00:11 +02:00
Fabien Potencier
21b45f2e19 merged branch pulzarraider/translation_update_sk (PR #3772)
Commits
-------

b5de295 Slovak translation update

Discussion
----------

[FrameworkBundle] Slovak translation update
2012-04-04 08:00:01 +02:00
Christophe Coevoet
3c325698ac [Routing] Added the possibility to define options for imported resources
Closes #2772
2012-04-04 03:36:42 +02:00
Andrej Hudec
b5de295e40 Slovak translation update 2012-04-03 23:48:25 +02:00
Joseph Bielawski
1456e1ea64 Polish translations sync 2012-04-04 00:40:52 +03:00
Fabien Potencier
e5121e91c8 merged branch maastermedia/translations (PR #3769)
Commits
-------

2519544 slovenian translations updated to latest list

Discussion
----------

Slovenian translations updated to latest list

Thank you!
2012-04-03 23:10:30 +02:00
Peter Kokot
251954476c slovenian translations updated to latest list 2012-04-03 22:16:08 +02:00
Fabien Potencier
959158f9b9 merged branch jfsimon/master (PR #3613)
Commits
-------

2a90871 [Console] Removed previously introduced BC break.
90a2a6e [Console] Undecorated formatter must update style stack too.
bd7e01a [Console] Fixed output formatter test broken by new implementation.
a1add4b [Console] Updated output formatter to use style stack.
4f298dd [Console] Added formatter style stack.
93ffe54 [Console] Added getters to output formatter style (and its interface).
48e6b49 [Console] Updated formatter test to match styles bug fix.
ad334b6 [Console] Fixed empty style appliance.
31d5fe5 [Console] Fixed output formatter docblock.

Discussion
----------

[Console] Fixes formatter nested style appliance.

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

When outputing styled text in the console, you sometimes face to a confusing behavior: style tags cannot be nested. If tou try something like `<fg=blue>Hello <fg=red>world</fg=red>!</fg=blue>`, the trailing `!` will not be styled.

This PR introduce a new FormatterOutputStyleStack to keep open/closed styles informations up-to-date. It slightly changes OutputFormatter implementation which no longer uses `OutputFormatterStyle::apply()` method, but the new `OutputFormatterStyle::getTerminalSequence()`.

**Question:** I don't une `OutputFormatterStyleInterface` but `OutputFormatterStyle` to type `OutputFormatterStyleStack` methods arguments (to avoid BC break on the interface). Do you think it's right?

**Notice:** I also needed to fix some tests broken by new implementation.

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

by stof at 2012-03-16T10:27:56Z

Adding new methods in an interface is a BC break for people implementing it

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

by jfsimon at 2012-03-16T10:33:21Z

@stof indeed... this is a problem, should I remove them? If I do so, I should use `OutputFormatterStyle` instead of the interface to type arguments in `OutputFormatterStyleStack` right?
2012-04-03 12:02:29 +02:00
Fabien Potencier
b9de0be349 merged branch drak/sessionmeta (PR #3718)
Commits
-------

8a0e6d2 [HttpFoundation] Update changelog.
4fc04fa [HttpFoundation] Renamed MetaBag to MetadataBag
2f03b31 [HttpFoundation] Added the ability to change the session cookie lifetime on migrate().
39141e8 [HttpFoundation] Add ability to force the lifetime (allows update of session cookie expiry-time)
ec3f88f [HttpFoundation] Add methods to interface
402254c [HttpFoundation] Changed meta-data responsibility to SessionStorageInterface
d9fd14f [HttpFoundation] Refactored for moved tests location.
29bd787 [HttpFoundation] Added some basic meta-data to Session

Discussion
----------

[2.1][HttpFoundation] Added some basic meta-data to Session

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
References the following tickets: #2171
Todo: -

Session data is stored as an encoded string against a single id.  If we want to store meta-data about the session, that data has to be stored as part of the session data to ensure the meta-data can persist using any session save handler.

This patch makes it much easier to determine the logic of session expiration.  In general a session expiry can be dealt with by the gc handlers, however, in some applications more specific expiry rules might be required.

Session expiry may also be more complex than a simple, session was idle for x seconds.  For example, in Zikula there are three security settings, Low, Medium and High.  The rules for session expiry are more complex as under the Medium setting, a session will expire after x minutes idle time, unless the rememberme option was ticked on login.  If so, the session will not idle.  This gives the user some control over their experience.  Under the high security setting, then there is no option, sessions will expire after the idle time is reached and login the UI has the rememberme checkbox removed.

The other advantage is that under this methodology, there can be a UI experience on expiry, like "Sorry, your session expired due to being idle for 10 minutes".

Keeping in the spirit of Symfony2 Components, I am seeking to make session handling flexible enough to accommodate these general requirements without specifically covering expiration rules. It would mean that it would be up to the implementing application to specifcally check and expire session after starting it.

Expiration might look something like this:

    $session->start();
    if (time() - $session->getMetadataBag()->getLastUpdate() > $maxIdleTime) {
        $session->invalidate();
        throw new SessionExpired();
    }

This commit also brings the ability to change the `cookie_lifetime` when migrating a session. This means one could move from a default of browser only session cookie to long-lived cookie when changing from a anonymous to a logged in user for example.

    $session->migrate($destroy, $lifetime);

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

by drak at 2012-03-30T18:18:43Z

@fabpot I have removed [WIP] status.

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

by drak at 2012-03-31T13:34:57Z

NB: This PR has been rebased and the tests relocated as per recent master changes.

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

by drak at 2012-04-03T02:16:43Z

@fabpot - ping
2012-04-03 11:40:07 +02:00
Fabien Potencier
262041382f merged branch Tobion/PhpMatcherDumper-Improvement (PR #3763)
Commits
-------

56c1e31 performance improvement in PhpMatcherDumper

Discussion
----------

performance improvement in PhpMatcherDumper

Tests pass: yes

The code generation uses a string internally instead of an array. The array wasn't used for random access anyway.
I also removed 4 unneeded iterations this way (when imploding, when merging and twice when applying the extra indention). A `preg_replace` could also be saved under certain circumstances by moving it.
And there was a small code errror in line 139.
2012-04-03 11:38:13 +02:00
Tobias Schultze
56c1e31e8a performance improvement in PhpMatcherDumper 2012-04-03 09:18:44 +02:00
Fabien Potencier
4923483805 merged branch stof/autoloader_refactoring (PR #3756)
Commits
-------

f1f1494 Added an exception when passing an invalid object to ApcClassLoader
f5cb167 [ClassLoader] Added a DebugClassLoader using composition
0e54a22 Updated the changelog
eae772e [ClassLoader] Added an ApcClassLoader
4d1333f Changed the test autoloading to use the new autoloader
09850bd [ClassLoader] Added a simplified PSR-0 ClassLoader

Discussion
----------

Autoloader refactoring

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/stof/symfony.png?branch=autoloader_refactoring)](http://travis-ci.org/stof/symfony)

As discussed in #3623, I added a new ClassLoader instead of modifying the UniversalClassLoader, to be able to use the method names without BC concerns. The new class works the same than the composer autoloader regarding the handling of fallbacks, to be able to reuse namespace maps generated by composer.

```php
<?php

// autoload.php
require_once __DIR__.'/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php';

$loader = new Symfony\Component\ClassLoader\ClassLoader();

$map = require __DIR__.'/vendor/.composer/autoload_namespaces.php';
$loader->addPrefixes($map);

$loader->register();
```

Differences with the composer class loader:

- Composer's ``add`` method is named ``addPrefix`` in the Symfony ClassLoader
- the methods related to the class map are removed as Symfony has a separate laoder for class maps
- the ``addPrefixes`` method is added, accepting a namespace map.

I also added a new ApcClassLoader which uses composition instead of inheriting from a class loader, which makes it far more easier to reuse (we could wrap a Composer autoloader with it for instance).

```php
<?php

$composerLoader = require __DIR__.'/vendor/.composer/autoload.php';

// no need to require the file manually as Composer already registered its autoloader
$cachedLoader = new Symfony\Component\ClassLoader\ApcClassLoader('autoload.my_app', $composerLoader);

$cachedLoader->register();
// unregister the Composer autoloader as we wrapped it in the ApcClassLoader
$composerLoader->unregister();
```

TODO:

- refactor the Debug class loader to use composition too to be able to support different class loaders

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

by fabpot at 2012-04-02T16:31:28Z

Can you update the CHANGELOG and the UPGRADE file accordingly?

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

by stof at 2012-04-02T16:47:43Z

I added a note in the CHANGELOG. There is nothing to add in the UPGRADE file as the change is fully BC (I did not change the UniversalClassLoader at all so it can still be used).

I'm working on the Debug loader right now so please wait a bit before merging

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

by stof at 2012-04-02T17:12:11Z

Here is a new DebugClassLoader using composition too. this way, it is able to support the UniversalClassLoader, the ApcUniversalClassLoader (without dropping the use of APC as done previously), the new ClassLoader, the new ApcClassLoader and even the composer autoloader.
I'm not sure about the use of ``method_exists`` as it could break if an autoloader implements a protected ``findFile`` method (crappy PHP 😢) but hardcoding the supported classes would be a pain and requiring an interface would make the autoloaders more difficult to use (as the interface would need to be required first) and would drop the support of the composer autoloader.
2012-04-02 20:28:07 +02:00
Christophe Coevoet
f1f1494bbf Added an exception when passing an invalid object to ApcClassLoader 2012-04-02 19:53:22 +02:00
Fabien Potencier
2808acd4ae merged branch stof/twig_engine_move (PR #3761)
Commits
-------

dbab7e1 [TwigBridge] Added a TwigEngine in the bridge

Discussion
----------

[TwigBridge] Added a TwigEngine in the bridge

This TwigEngine implements the interface available in the component.
the TwigBridge in TwigBundle now extends this class and provides only
the additional methods for the FrameworkBundle interface.

This will allow people to support the PhpEngine and Twig in their code more easily when using the component as they don't need to reimplement the class.
I originally thought about when I helped @dragoonis to integrate the Templating component in the PPI framework 2.0 as he talked about adding the support for Twig later too.
2012-04-02 19:06:44 +02:00
Christophe Coevoet
f5cb167554 [ClassLoader] Added a DebugClassLoader using composition 2012-04-02 19:03:58 +02:00
Fabien Potencier
93848be93b moved event dispatcher classes to the EventDispatcher component 2012-04-02 18:28:49 +02:00
Christophe Coevoet
dbab7e1ef6 [TwigBridge] Added a TwigEngine in the bridge
This TwigEngine implements the interface available in the component.
the TwigBridge in TwigBundle now extends this class and provides only
the additional methods for the FrameworkBundle interface.
2012-04-02 18:28:35 +02:00
Eriksen Costa
2cac50d8a9 fixed CS (missing or misplaced license blocks) 2012-04-02 00:52:14 -03:00
Christophe Coevoet
eae772e480 [ClassLoader] Added an ApcClassLoader
Unlike the ApcUniversalClassLoader, ApcClassLoader uses composition,
meaning it can be used to wrap any object providing a findFile($class)
method. Both the UniversalClassLoader and the new ClassLoader follow
this convention. It can also be used to wrap the Composer autoloader.
2012-04-01 23:56:45 +02:00
Christophe Coevoet
09850bdf01 [ClassLoader] Added a simplified PSR-0 ClassLoader
The new ClassLoader does not differentiate namespaced classes and
PEAR-like classes like the UniversalClassLoader does as the PEAR
format is a subset of PSR-0.
The new loader registers fallbacks by adding a location for an empty
prefix, as done in Composer. This allows using namespaces map generated
by Composer without any special processing on them.
2012-04-01 23:31:48 +02:00
Fabien Potencier
d6330e1bb3 merged branch havvg/hotfix/propel-modelchoice-readonly-models (PR #3731)
Commits
-------

64c7183 clean file docs in Propel1 fixtures
97ba218 accept read-only models in ModelChoiceList

Discussion
----------

accept read-only models in ModelChoiceList

Ping @willdurand

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

by willdurand at 2012-03-30T08:57:14Z

👍
2012-04-01 10:36:33 +02:00
Fabien Potencier
5821abb732 merged branch ruimarinho/sort_by_time (PR #3745)
Commits
-------

dcf82d7 [Finder] Added sortBy options based on accessed, changed and modified times

Discussion
----------

[Finder] Added sortBy options based on accessed, changed and modified times

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
2012-04-01 10:35:33 +02:00
Fabien Potencier
e92994ce3e merged branch lsmith77/HttpFoundation_test (PR #3744)
Commits
-------

925b65d updated reference to tests

Discussion
----------

updated reference to tests

this is basically the format used in all other components.

however i am not sure if it really makes sense to list ``phpunit -c src/Symfony/Component/HttpFoundation/``, since this relative path could be confusing for anyone using the standalone components. But even if using ``symfony/symfony`` the path is wrong relative to the location of the README.md.
2012-04-01 10:33:44 +02:00
Fabien Potencier
a10fee16c1 merged branch igorw/dic-yaml-without-args (PR #3747)
Commits
-------

24a0d0a [DependencyInjection] Support Yaml calls without arguments

Discussion
----------

[DependencyInjection] Support Yaml calls without arguments
2012-04-01 10:27:21 +02:00
Eriksen Costa
cf67870af7 fixed line break to LF 2012-03-31 18:11:43 -03:00
Eriksen Costa
013f998bb8 updated license blocks 2012-03-31 18:00:32 -03:00
Eriksen Costa
bec231f6ca fixed CS 2012-03-31 17:31:37 -03:00
Rui Marinho
8689e9cbf2 [WIP] [Locale] Fixes NumberFormatter tests failing when using ICU 4.8 or 4.8.1 2012-03-31 21:16:46 +01:00
Igor Wiedler
24a0d0a2dc [DependencyInjection] Support Yaml calls without arguments 2012-03-31 21:11:13 +02:00
Rui Marinho
dcf82d732b [Finder] Added sortBy options based on accessed, changed and modified times 2012-03-31 19:48:43 +01:00
Drak
4fc04fae18 [HttpFoundation] Renamed MetaBag to MetadataBag 2012-03-31 22:36:52 +05:45
lsmith77
925b65dbaf updated reference to tests 2012-03-31 15:56:35 +02:00
Drak
2f03b31258 [HttpFoundation] Added the ability to change the session cookie lifetime on migrate().
This is a very important option which allows the cookie lifetime to be changed on migrate.
For example when a user converts from an anonymous session to a logged in session one might
wish to change from a persistent cookie to browser session (e.g. a banking application).
2012-03-31 19:12:26 +05:45
Drak
39141e865b [HttpFoundation] Add ability to force the lifetime (allows update of session cookie expiry-time) 2012-03-31 19:12:22 +05:45
Drak
ec3f88f339 [HttpFoundation] Add methods to interface 2012-03-31 19:12:18 +05:45
Drak
402254ca7e [HttpFoundation] Changed meta-data responsibility to
SessionStorageInterface

Added cookie_lifetime to the meta-data.  This allows to know how old
a cookie is and when the cookie will expire.
2012-03-31 19:12:13 +05:45
Drak
d9fd14f261 [HttpFoundation] Refactored for moved tests location. 2012-03-31 19:12:08 +05:45
Drak
29bd787b7e [HttpFoundation] Added some basic meta-data to Session
This commit allows applications to know certain meta-data about the session
Session storage is designed to only store some data against a session ID
so this method is necessary to be compatible with any session handler, including
native handlers.
2012-03-31 19:12:04 +05:45
Fabien Potencier
0c7b2911bc [Routing] removed code that was not ready to be pushed 2012-03-30 20:36:59 +02:00
umpirsky
f91660db9c Added test for prototype label. 2012-03-30 15:35:41 +02:00
Fabien Potencier
5178e76d4e merged branch drak/sessionarray (PR #3735)
Commits
-------

8dd2c27 [HttpFoundation] Further micro-optimization.
54c5d5e [HttpFoundation] Micro-optimisation.

Discussion
----------

[HttpFoundation] Micro-optimisation.

Ref #3729

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

by robocoder at 2012-03-30T11:45:02Z

If you pre-flip your $validOptions arrays, you can use isset() instead of in_array() in the loop.

This changes the performance from O(m * n) to O(m).

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

by drak at 2012-03-30T11:53:24Z

@robocoder What is the expense of the array_flip though?

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

by robocoder at 2012-03-30T11:56:21Z

Why would you use array_flip if the array doesn't change?  Change $validOptions = array('x', 'y', ...) to $validOptions = array('x' => 0, 'y' => 0, ...), then change the in_array() to use isset().

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

by stof at 2012-03-30T11:57:08Z

@drak a loop. But it will be done only once before the other loop so it will be O(n + m) instead of O(m * n)

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

by drak at 2012-03-30T12:00:47Z

Ok :)
2012-03-30 14:05:19 +02:00
Drak
8dd2c273d3 [HttpFoundation] Further micro-optimization. 2012-03-30 17:41:58 +05:45
Victor Berchet
234ce4df9e [PhpUnit] Fix the path to the boostrap files in the components 2012-03-30 13:49:28 +02:00
Drak
54c5d5ed32 [HttpFoundation] Micro-optimisation. 2012-03-30 17:22:48 +05:45
Toni Uebernickel
64c7183bf5 clean file docs in Propel1 fixtures 2012-03-30 10:53:43 +02:00
Toni Uebernickel
97ba2189c9 accept read-only models in ModelChoiceList 2012-03-30 10:49:44 +02:00
Fabien Potencier
e18fcd852a merged branch kbond/extensible-httpcache (PR #3716)
Commits
-------

8f11f2dd shortened if/else syntax
2b8c2bc [FrameworkBundle] made http_cache dir extensible

Discussion
----------

[FrameworkBundle] make http_cache dir extensible

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

I have a use case where I don't want the httpcache cleared on `cache:clear`.  Currently, it is awkward to change this directory.

[![Build Status](https://secure.travis-ci.org/kbond/symfony.png?branch=extensible-httpcache)](http://travis-ci.org/kbond/symfony)
2012-03-30 08:10:12 +02:00
Oscar Cubo Medina
aac6ad8018 [Console] avoid warning parsing empty string argument 2012-03-29 21:02:51 +02:00
Fabien Potencier
a7a696fc5a merged branch liuggio/webtestcase_kernel_shutdown_before_client (PR #3704)
Commits
-------

3303155 added kernel shutdown before create client, fixed and stashed

Discussion
----------

[FrameworkBundle] WebTestCase createClient doesn't check if static:kernel was already allocated

with this little fix CreateClient shuts down the kernel before booting again.

If you add an echo after the "if" on the line number 38
and run the test you would see that sometime the kernel is not properly umounted.

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

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

by fabpot at 2012-03-29T09:19:07Z

Can you squash your commits before I merge? Thanks.

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

by liuggio at 2012-03-29T10:17:59Z

Done.
2012-03-29 15:32:24 +02:00
Fabien Potencier
036fc36919 merged branch lyrixx/patch-1 (PR #3721)
Commits
-------

c73748f [HttpFoundation] Added RFC reference to 308
468ad40 [HttpFoundation] Added support for 308 / Permanent Redirect

Discussion
----------

[HttpFoundation] Added support for 308 / Permanent Redirect

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes (i guess) [![Build Status](https://secure.travis-ci.org/lyrixx/symfony.png?branch=patch-1)](http://travis-ci.org/lyrixx/symfony)
Fixes the following tickets: -
Todo: -

I know this is still a draft, but it is already implemented in Firefox.

See :

- http://tools.ietf.org/html/draft-reschke-http-status-308-07
- https://developer.mozilla.org/en/HTTP/HTTP_response_codes#308

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

by stloyd at 2012-03-29T09:25:20Z

It will be in Firefox... 14!

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

by fabpot at 2012-03-29T09:33:01Z

Like the non RFC 2616 status code, you need to add the RFC number as a comment (or the reference to the draft).

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

by lsmith77 at 2012-03-29T11:58:14Z

can you open a PR for https://github.com/FriendsOfSymfony/FOSRest/blob/master/Util/Codes.php ?

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

by lyrixx at 2012-03-29T12:08:31Z

@lsmith77 : Done. See : https://github.com/FriendsOfSymfony/FOSRest/pull/7 :)
2012-03-29 14:54:38 +02:00
Martin Hasoň
44a7ca1733 [FrameworkBundle] added new czech validators translations for the File constraint. 2012-03-29 14:37:47 +02:00
Clemens Tolboom
e4f3fd9a72 Fixed example code. 2012-03-29 14:32:59 +02:00
Shein Alexey
0bde12c6c0 Added some skipifs to prevent fatal errors on missing extensions. 2012-03-29 15:19:53 +05:00
Grégoire Pineau
c73748fd22 [HttpFoundation] Added RFC reference to 308 2012-03-29 12:05:33 +02:00
Giulio De Donato
3303155023 added kernel shutdown before create client, fixed and stashed 2012-03-29 11:34:12 +02:00
Grégoire Pineau
468ad40405 [HttpFoundation] Added support for 308 / Permanent Redirect 2012-03-29 12:18:49 +03:00
Fabien Potencier
b1bb27e8da merged branch havvg/master (PR #3700)
Commits
-------

dd4d46a add limit to logger explosion

Discussion
----------

add limit to logger explosion

This limit is required to display complete query with e.g. "array" type in it.

ping @willdurand
2012-03-29 08:57:31 +02:00
Fabien Potencier
13a27ed73a merged branch robocoder/patch-1 (PR #3701)
Commits
-------

33382cd Add exception-controller attribute to xsd

Discussion
----------

Add exception-controller attribute to xsd
2012-03-29 08:56:32 +02:00
Fabien Potencier
7c59d8d490 merged branch ajessu/phpserver (PR #3717)
Commits
-------

d243097 Run built-in server on dev environment

Discussion
----------

Run built-in server on dev environment

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

Change the router of the built-in server command to run on dev environment.

The symfony standard edition doesn't have any `/` route by default (it's only available to dev), so by default, when ran, it gives a `404`, unless you explicitely add the `app_dev.php` front controller to the route.

Also, this server is meant to be run on dev only, so no need to run it with the prod front controller by default.
2012-03-29 08:48:13 +02:00
Fabien Potencier
d471a16657 merged branch drak/flashinterface (PR #3719)
Commits
-------

cde1c52 [HttpFoundation] Add missing method in flash interface.

Discussion
----------

[HttpFoundation] Add missing method in flash interface.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3711
Todo: -
2012-03-29 08:46:07 +02:00
Fabien Potencier
aed954cb63 fixed typo in the previous commit 2012-03-29 08:41:52 +02:00
Fabien Potencier
fea6b79acd moved component and bridge unit tests to the src/ directory
This is the first step to make each Symfony Component and Bridge self-contained.
2012-03-29 08:37:22 +02:00
Drak
cde1c52914 [HttpFoundation] Add missing method in flash interface. 2012-03-29 05:21:43 +05:45
Albert Jessurum
d24309789c Run built-in server on dev environment 2012-03-29 00:43:09 +02:00
Fabien Potencier
3e95126437 [DomCrawler] removed the hard dependency on CssSelector 2012-03-28 18:08:10 +02:00
Kevin Bond
8f11f2dd30 shortened if/else syntax 2012-03-28 11:52:41 -04:00
Kevin Bond
2b8c2bc9c3 [FrameworkBundle] made http_cache dir extensible 2012-03-28 11:41:21 -04:00
Jordan Alliot
15dd17e9bd Simplified CONTENT_ headers retrieval 2012-03-26 23:58:48 +02:00
Fabien Potencier
1bb6e0de4d merged branch drak/session_gc (PR #3659)
Commits
-------

cdba4cf [FrameworkBundle] Change XSD to allow string replacements on session args.
52f7955 [FrameworkBundle] Remove default from gc_* session configuration keys.
749593d [FrameworkBundle] Allow configuration of session garbage collection for session 'keep-alive'.

Discussion
----------

[2.1][FrameworkBundle] Allow configuration of session garbage collection

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2171
Todo: -

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

by drak at 2012-03-21T21:56:20Z

@fabpot - this PR is ready for merge.  It basically allows configuration of some session ini values that are necessary in controlling the session behaviour.

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

by dlsniper at 2012-03-21T22:57:18Z

@drak shouldn't all the options here: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php#L266 be available for configuration, or am I just reading the source wrong and they already are?

In this case should I make a separate PR to cover the rest or could you do it in this one?

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

by fabpot at 2012-03-23T14:56:22Z

@drak: the discussion is the ticket is very interesting and I think it should be part of a cookbook in the documentation. Can you take care of that before I merge this PR? Thanks.

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

by drak at 2012-03-25T15:32:59Z

@fabpot - yes - it's on the todo list.  Will update this PR when done.

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

by drak at 2012-03-26T19:45:13Z

@fabpot - this is ready for merging, the documentation is done (the PR is in but I'll tweak it, but no need to wait to merge this PR).  I will also add something extra to cookbook (I wrote docs for the component).
2012-03-26 22:08:10 +02:00
Anthon Pang
33382cd4f4 Add exception-controller attribute to xsd 2012-03-26 13:17:28 -03:00
Toni Uebernickel
dd4d46a4c7 add limit to logger explosion
This limit is required to display complete query with e.g. "array" type in it.
2012-03-26 17:07:55 +02:00
Fabien Potencier
cd56d09012 merged branch cedriclombardot/feat-propel-explain (PR #3616)
Commits
-------

9ef5e95 Add connection name in the propel data collector

Discussion
----------

Add connection name in the propel data collector

Bug fix: no
Feature addition: yes, This will allow to explain a propel query on a specific connection
Backwards compatibility break: no
Symfony2 tests pass: yes

- Require PR propelorm/Propel#315
- Related to PR propelorm/PropelBundle#129

cc @willdurand

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

by willdurand at 2012-03-16T18:17:26Z

@fabpot please, let me merge Propel related PRs before that one, thanks!

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

by willdurand at 2012-03-26T08:38:36Z

@fabpot good to go from my point of view
2012-03-26 10:39:42 +02:00
Fabien Potencier
74b7bb3605 merged branch gatsu/patch-1 (PR #3689)
Commits
-------

b718960 HttpFoundation\HeaderBag Little improvement.

Discussion
----------

[HttpFoundation\HeaderBag] Removed unnecessary anonymous function

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

by vicb at 2012-03-24T16:07:00Z

Related issue: #3294
2012-03-26 09:47:20 +02:00
Fabien Potencier
1aaf5c9423 merged branch marcw/patch-security-refresh-user (PR #3402)
Commits
-------

10947cb [DoctrineBridge][Security] Fixes bug that prevents repository's refreshUser from being called

Discussion
----------

[Security][DoctrineBridge] Fixes bug that prevents repository's refreshUser from being called

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

by marcw at 2012-02-21T08:46:09Z

Updated. What do you guys think about this patch ?

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

by henrikbjorn at 2012-02-21T08:57:47Z

Isnt this a bit dangerous, the custom repository implementing refreshUser should always be called first right? You wouldnt specify the $property property if your class has custom implementations would you?

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

by marcw at 2012-02-21T09:05:08Z

@henrikbjorn At this time, the refreshUser method is never called from the custom repository, even if you don't specify the "property" property. This patch fixes this.

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

by marcw at 2012-02-21T09:44:06Z

Updated & Squashed.

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

by stof at 2012-02-21T10:03:33Z

@marcw please move the retrieval of the id in the ``else`` block, like in my comment as it is useless to do this logic for the case where the userProviderInterface is implemented (and it will answer to @vicb by making it impossible to write it with elseif)

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

by marcw at 2012-02-21T10:19:06Z

I'm not sure about this, but Isn't the check of the id essential here to ensure that the entity is a persisted one ?

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

by stof at 2012-02-21T10:21:55Z

@marcw if the interface is used, it means that the user wants to do the work himself. So you should really let him do the way he wants. If he does not use the id to refresh the user, he could choose not to include it in the serialized data.
Retrieving the id is needed for the ``find()`` call because we pass the id as argument and so we fail when the serialized data don't contain it

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

by marcw at 2012-02-21T10:33:30Z

@stof Roger that. I'll do the fix.

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

by marcw at 2012-02-21T10:41:58Z

Updated & Squashed, again.

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

by stof at 2012-02-21T11:00:44Z

btw, to answer to your previous question, the exception when retrieving the id does not check if the object is persisted (you need to reach teh DB for this, which is what find() does) but that the id is part of the serialized data to give a better error reporting.

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

by fabpot at 2012-03-07T19:39:33Z

ready to be merged now?

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

by henrikbjorn at 2012-03-08T07:21:37Z

would say so.

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

by dlsniper at 2012-03-25T11:58:34Z

Hi, can this be merged now or not?
2012-03-26 09:36:13 +02:00
Jordi Boggiano
86a3512bd4 [FrameworkBundle] Add support for full URLs to redirect controller 2012-03-25 20:43:23 +02:00
Artyom Protaskin
b718960857 HttpFoundation\HeaderBag Little improvement. 2012-03-24 11:17:54 +04:00
Fabien Potencier
a00ae273a6 fixed previous commit 2012-03-24 00:31:38 +01:00
Fabien Potencier
c4dfe931f1 [HttpFoundation] made the host lowercase as per RFC 952/2181 2012-03-23 20:09:44 +01:00