Commit Graph

6483 Commits

Author SHA1 Message Date
alexandresalome
affe66c949 Merge remote-tracking branch 'origin/master' into new-profiler-storage 2011-08-29 13:44:52 +02:00
Fabien Potencier
a74605532e merged branch chEbba/xdebug_file_link_format (PR #1927)
Commits
-------

cc098a3 [HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler.php

Discussion
----------

[HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler

Format file and line as url, if xdebug.file_link_format is set. Inspired by #1893
2011-08-27 08:08:25 +02:00
Fabien Potencier
07a56edc5e updated CHANGELOG 2011-08-27 08:03:17 +02:00
Fabien Potencier
34c1868a91 merged branch stloyd/tests_fix (PR #1860)
Commits
-------

838237d [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull"

Discussion
----------

[2.1][Tests] Use proper phpunit assertion functions

Use proper phpunit assertion functions: `assertTrue()`, `assertFalse()`, `assertNull()`.
2011-08-27 08:01:17 +02:00
Fabien Potencier
f9be0f2623 merged branch brikou/finder_exclude_dirs (PR #1926)
Commits
-------

5be62f6 made exclude method accept array of dirs

Discussion
----------

[2.1] [Finder] made "exclude" method accept array of dirs (as "in" method)
2011-08-27 08:00:11 +02:00
Fabien Potencier
8d6c7d830e udpated CHANGELOG 2011-08-26 17:50:21 +02:00
Fabien Potencier
2ccee10c51 merged branch stealth35/mime_guesser (PR #1874)
Commits
-------

ea0db2d [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser

Discussion
----------

[2.1] [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser

`mime_content_type` exists just for the compat between the old PHP 5.2
`mime_magic` extension and `file_info` extension

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

by fabpot at 2011/08/19 05:31:25 -0700

I will merge it in 2.1 as some people might rely on it.

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

by stealth35 at 2011/08/19 05:46:02 -0700

ok in the meantime, we can invert the guesser checker :

```php
/**
 * Registers all natively provided mime type guessers
 */
private function __construct()
{
    if (FileBinaryMimeTypeGuesser::isSupported()) {
        $this->register(new FileBinaryMimeTypeGuesser());
    }

    if (FileinfoMimeTypeGuesser::isSupported()) {
        $this->register(new FileinfoMimeTypeGuesser());
    }

    if (ContentTypeMimeTypeGuesser::isSupported()) {
        $this->register(new ContentTypeMimeTypeGuesser());
    }
}
```

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

by stloyd at 2011/08/19 05:48:38 -0700

@stealth35 You should make new PR for change you mentioned above.

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

by stealth35 at 2011/08/19 05:53:12 -0700

@stloyd done PR #1989

EDIT : forget this
2011-08-26 17:49:56 +02:00
Fabien Potencier
fc793e668b added a CHANGELOG for 2.1 2011-08-26 17:45:40 +02:00
Fabien Potencier
a8609e1eab merged branch lsmith77/add_patch_support (PR #1916)
Commits
-------

007e395 do not set a default CONTENT_TYPE for PATCH
fa2c027 Added support for the PATCH method

Discussion
----------

[2.1] [HttpFoundation] Added support for the PATCH method

http://tools.ietf.org/html/rfc2068#section-19.6.1.1
http://tools.ietf.org/html/rfc5789

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

by Seldaek at 2011/08/07 03:23:20 -0700

According to the spec it seems that PATCH requests shouldn't be of application/x-www-form-urlencoded content-type so it shouldn't match the first if, and in the second it's probably wrong to default to application/x-www-form-urlencoded, no?

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

by lsmith77 at 2011/08/07 03:31:48 -0700

Hmm you are right. I assumed the diff would be encoded as ``application/x-www-form-urlencoded`` but there indeed is no indication of that in the spec. But given that the second case would still need some sort of handling for PATCH, just not sure what exactly ``$defaults['CONTENT_TYPE']`` should be set to.

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

by Seldaek at 2011/08/07 03:48:53 -0700

As I understand it, a PATCH request must specify a content-type or it's invalid, so we could just skip the second behavior if no content-type is present.

As your first link says:

    The list of differences is in a format defined by the media type of the entity (e.g.,
    "application/diff") and MUST include sufficient information to allow
    the server to recreate the changes necessary to convert the original
    version of the resource to the desired version.

Sounds like PATCH is highly application specific, and not so standardized, probably because it's not very useful for most purposes.

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

by lsmith77 at 2011/08/07 04:02:43 -0700

Yes, but to me this means that the patch is actually correct aside from the fact that its setting a default Content-Type, which I just corrected (not sure if this use of switch is ok with our coding style). Now if the Content-Type does end up being ``application/x-www-form-urlencoded`` then I would say its correct to decode it.
2011-08-26 17:44:39 +02:00
Fabien Potencier
707e8aaecb merged 2.0 branch 2011-08-26 10:01:25 +02:00
Fabien Potencier
98966c8779 updated VERSION and deps 2011-08-26 09:59:43 +02:00
Fabien Potencier
bb8a3f1ae5 updated vendors 2011-08-26 09:42:19 +02:00
Fabien Potencier
9f40ba6c2a bumped Symfony version to 2.0.2-DEV 2011-08-26 09:34:52 +02:00
Fabien Potencier
7cb402d806 updated VENDORS for 2.0.1 2011-08-26 08:46:48 +02:00
Fabien Potencier
7275c88777 updated CHANGELOG for 2.0.1 2011-08-26 08:46:45 +02:00
Fabien Potencier
f9ce68fad4 update VERSION for 2.0.1 2011-08-26 08:45:13 +02:00
Fabien Potencier
8f50592f31 [HttpFoundation] changed \LogicException to \InvalidArgumentException 2011-08-26 08:45:12 +02:00
Fabien Potencier
194d2a7219 update CONTRIBUTORS for 2.0.1 2011-08-26 08:45:12 +02:00
stloyd
838237dc32 [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
Fabien Potencier
1c7694ff30 [HttpFoundation] added a missing exception 2011-08-25 10:38:08 +02:00
Fabien Potencier
a79f22544e [HttpKernel] added a test for uploading a file via an array instead of an UploadedFile instance 2011-08-25 10:07:28 +02:00
Fabien Potencier
9112bed669 merged branch stloyd/patch-4 (PR #2018)
Commits
-------

542cfd6 [ServerBag] Skip unnecessary loop in `getHeaders()`

Discussion
----------

[ServerBag] Skip unnecessary loop in `getHeaders()`
2011-08-25 09:45:41 +02:00
Fabien Potencier
7f2c4ab557 merged branch jmikola/ContainerAwareEventDispatcher-key-conflict (PR #2022)
Commits
-------

84c1719 [FrameworkBundle] Avoid listener key conflicts in ContainerAwareEventDispatcher

Discussion
----------

[FrameworkBundle] Avoid listener key conflicts in ContainerAwareEventDispatcher

Since the key was previously concatenating service ID and method without a separator, it's possible that two different listeners could conflict (e.g. service/method pairs: foo/bar and fo/obar).
2011-08-25 09:45:33 +02:00
Jeremy Mikola
84c1719335 [FrameworkBundle] Avoid listener key conflicts in ContainerAwareEventDispatcher
Since the key was previously concatenating service ID and method without a separator, it's possible that two different listeners could conflict (e.g. service/method pairs: foo/bar and fo/obar).
2011-08-24 15:05:22 -04:00
Joseph Bielawski
542cfd62df [ServerBag] Skip unnecessary loop in getHeaders() 2011-08-24 21:56:02 +03:00
Fabien Potencier
536538fb83 [DoctrineBundle] removed an unused and confusing parameter (the connection class can be changed via the wrapper_class setting of a connection) 2011-08-24 18:08:06 +02:00
Fabien Potencier
0fc0f99b9d fixed CS 2011-08-24 17:06:56 +02:00
Fabien Potencier
8cdedd13c5 merged branch Seldaek/toolbar_debugging (PR #2019)
Commits
-------

89f477e [WebProfilerBundle] Throw exception if a collector template isn't found
6ca72cf [WebProfilerBundle] Allow .html.twig in collector template names

Discussion
----------

WDT debugging

While implementing collectors I did a mistake in the template name and it never told me, so I was left wondering why my stuff didn't show up. Not so nice IMO. Also the first commit is to allow template names to be specified fully. I don't see why this shouldn't be allowed, since it is the way you specify templates everywhere else.
2011-08-24 17:06:22 +02:00
Fabien Potencier
d7f078929c [FrameworkBundle] fixed duplicated RequestContext instances 2011-08-24 15:10:47 +02:00
Jordi Boggiano
89f477eb0a [WebProfilerBundle] Throw exception if a collector template isn't found 2011-08-24 13:53:49 +02:00
Jordi Boggiano
6ca72cf9ac [WebProfilerBundle] Allow .html.twig in collector template names 2011-08-24 10:37:03 +02:00
Fabien Potencier
755e0d4a37 tweaked CHANGELOG 2011-08-24 09:12:04 +02:00
Fabien Potencier
0805c9c6da added the 2.0.x CHANGELOG file 2011-08-24 09:10:15 +02:00
Fabien Potencier
9231f1d1dd merged branch jmikola/remove-subscriber-with-priorities (PR #2014)
Commits
-------

39fabab [EventDispatcher] Fix removeSubscriber() to work with priority syntax

Discussion
----------

[EventDispatcher] Fix removeSubscriber() to work with priority syntax

Previously only addSubscriber() was being tested with priority syntax. This adds a unit test for removeSubscriber() and fixes a bug that would have caused it to fail.
2011-08-23 22:51:37 +02:00
Jeremy Mikola
39fabab013 [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Fabien Potencier
0c6f47fcf3 Merge branch 'domcrawler-disabled-fields'
* domcrawler-disabled-fields:
  [DomCrawler] fixed disabled fields in forms (they are available in the DOM, but their values are not submitted -- whereas before, they were simply removed from the DOM)
  $node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too. https://github.com/Behat/Mink/pull/58#issuecomment-1712459
2011-08-23 16:00:30 +02:00
Fabien Potencier
1cf3cdd7e4 merged branch danielholmes/patch-1 (PR #2008)
Commits
-------

e294211 [DomCrawler] Removed unused document property in Form

Discussion
----------

[DomCrawler] Removed unused document property in Form
2011-08-23 15:37:40 +02:00
Daniel Holmes
e294211343 [DomCrawler] Removed unused document property in Form 2011-08-24 13:45:37 +10:00
Fabien Potencier
724d679b1f merged branch stloyd/patch-2 (PR #2010)
Commits
-------

06162e7 [WebProfiler] Use proper `Response` function to check is it an redirection

Discussion
----------

[WebProfiler] Use proper `Response` function

Use proper `Response::isRedirection()` function to check is it an redirection.
2011-08-23 15:36:54 +02:00
Joseph Bielawski
06162e7986 [WebProfiler] Use proper Response function to check is it an redirection 2011-08-24 00:44:06 +03:00
Fabien Potencier
3380f2a039 [DomCrawler] fixed disabled fields in forms (they are available in the DOM, but their values are not submitted -- whereas before, they were simply removed from the DOM) 2011-08-23 11:21:48 +02:00
Fabien Potencier
04a549bf6e merged branch cordoval/patch-1 (PR #1890)
Commits
-------

8a980bd $node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too. https://github.com/Behat/Mink/pull/58#issuecomment-1712459

Discussion
----------

$node->hasAttribute('disabled') sf2 should not create disagreement betwee

$node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too.
https://github.com/Behat/Mink/pull/58#issuecomment-1712459

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

by cordoval at 2011/08/09 20:34:56 -0700

@fabpot please let me know if this is going to be in sometime soon or not, just wondering why it is deviating ...

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

by fabpot at 2011/08/23 01:11:42 -0700

I have just checked in a browser and the Symfony2 implementation is actually the right one.

Try this in a browser:

    <form action='#' method="post">
        <input name="foo" disabled="disabled" value="foo" />
        <input name="bar" value="bar" />

        <input type="submit" />
    </form>

    <?php

    print_r($_POST);

    // output: Array ( [bar] => bar ) when the form is submitted

And here is the discussion about it in the HTML4 spec: http://www.w3.org/TR/html4/interact/forms.html#h-17.12:

"In this example, the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form."

And the same is tru for HTML5: http://www.w3.org/TR/html5/association-of-controls-and-forms.html#constructing-form-data-set

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

by cordoval at 2011/08/23 01:29:53 -0700

@fabpot I guess you got my scenario wrong. I am not trying to submit any form. I am just happen to have a disabled box that is checked and I want to read with the DOM Crawler that is checked. Not to submit or anything but for the purposes of testing.

Please consider also that this request comes from asserting values using behat mink, mink is fully dependent on sf2 driver for when it is used except it is told to use a different driver like a real browser like sahi. When testing in chrome and firefox, the verification with the DOM is made that the disabled box is checked properly. Symfony2 DOM Crawler however misses that spot for that use.

Even in the case where Symfony2 DOM Crawler component would have been thought not for this purpose of testing, or further for this particular scenario it would be good to make it more reusable for this kind of scenario.

Just saying....

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

by fabpot at 2011/08/23 02:00:34 -0700

Indeed, I didn't get your issue right. So, basically, all fields should be in the form, but the disabled field values should not be submitted (that makes sense).

I've prepared a fix in this patch: e8852586073bc23d4a41f4cd9cbe0d17a2f0c76d which is in the symfony/domcrawler-disabled-fields branch for now as I don't know if we can make this change in 2.0 or if we need to put it in 2.1.

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

by cordoval at 2011/08/23 02:15:01 -0700

oh no I was hoping to enter the authors, you already did the fix :'(
2011-08-23 11:21:17 +02:00
Fabien Potencier
277d75b7ce [Security] added a unit test for previous merge 2011-08-23 08:52:50 +02:00
Fabien Potencier
1bb53b8b7f merged branch Abhoryo/patch-1 (PR #1956)
Commits
-------

e9d2a67 CS
3a64b08 Search in others user providers when a user is not found in the first user provider and throws the right exception.

Discussion
----------

Chain user provider doesn't search in all user providers

I commit these changes because Chain user provider doesn't search in all user providers.

Example with the Acme/DemoBundle:

    // security.yml
    ...
        providers:
            chain_provider:
                providers: [in_memory, in_memory_extend]
            in_memory_extend:
                users:
                    admin2: { password: adminpass2, roles: [ 'ROLE_ADMIN' ] }
            in_memory:
                users:
                    user:  { password: userpass, roles: [ 'ROLE_USER' ] }
    ...
        firewalls:
    ...
            secured_area:
                pattern:    ^/demo/secured/
                provider: chain_provider OR in_memory_extend
    ...

We can see these logs :

    security.INFO: User "admin2" has been authenticated successfully [] []
    security.DEBUG: Write SecurityContext in the session [] []
    security.DEBUG: Read SecurityContext from the session [] []
    security.DEBUG: Reloading user from user provider. [] []
    security.WARNING: Username "admin2" could not be found. [] []

The new code search in others user providers when a user is not found in the first user provider and throws the right exception.

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

by lsmith77 at 2011/08/14 12:20:04 -0700

I wonder if it should be a provider option to continue on a failed user lookup. I can see cases where you really dont want to iterate over all providers and others where you do.

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

by Abhoryo at 2011/08/14 17:27:16 -0700

If someone need a provider like you describe, he can create one.
Here we talk about a chain user provider.

Doc : [using-multiple-user-providers](http://symfony.com/doc/current/book/security.html#using-multiple-user-providers)

We can read in the doc: "The chain_provider will, in turn, try to load the user from both the in_memory and user_db providers."
But its not the case right now.
2011-08-23 08:52:35 +02:00
Fabien Potencier
0b531932a0 merged branch stloyd/issue_1986 (PR #2000)
Commits
-------

c29fa9d [Form] Fix for treatment zero as empty data. Closes #1986

Discussion
----------

[Form] Fix for treatment zero as empty data. Closes #1986

For more info please read #1986.
2011-08-23 08:44:09 +02:00
Fabien Potencier
2b1bb2c357 [Form] added missing DelegatingValidator registration in the Form Extension class (used when using the Form component outside a Symfony2 project where the validation.xml is used instead) 2011-08-22 22:35:46 +02:00
Fabien Potencier
1fa6fa24cc merged branch weaverryan/form_choice_missing_variable (PR #2005)
Commits
-------

fdd2e7a [Form] Fixing a bug where setting empty_value to false caused a variable to not be found

Discussion
----------

[Form] Fixing a bug where setting empty_value to false caused a variable

Hey guys!

I think was an edge case that was overlooked. In this one case, the `$emptyValue` variable is never set. It causes warnings, but there should be no behavior change since the missing variable is being set to `null`.

Thanks!
2011-08-22 22:21:18 +02:00
Ryan Weaver
fdd2e7a30a [Form] Fixing a bug where setting empty_value to false caused a variable to not be found 2011-08-22 15:12:16 -05:00
Fabien Potencier
a8808be6bb merged branch hidenorigoto/master (PR #2003)
Commits
-------

bc7edfe [FrameworkBundle] changed resource filename of Japanese validator translation

Discussion
----------

[FrameworkBundle] change resource filename of Japanese validator translation

The country code of the translation resource file should be short notation because the long notation fallbacks to it.
2011-08-22 19:26:43 +02:00
hidenorigoto
bc7edfeb24 [FrameworkBundle] changed resource filename of Japanese validator translation 2011-08-23 01:14:50 +09:00