Commit Graph

13551 Commits

Author SHA1 Message Date
Fabien Potencier
aac8f8fe3d merged branch bamarni/form-default-csrf-provider-session-status (PR #7449)
This PR was merged into the 2.1 branch.

Discussion
----------

[Form] made DefaultCsrfProvider using session_status() when available

| Q             | A
| ------------- | ---
| Bug fix?      | [on PHP 5.4]
| Tests pass?   | [yes]
| License       | MIT

Commits
-------

5afea04 [Form] made DefaultCsrfProvider using session_status() when available
2013-03-22 16:37:06 +01:00
Jean-François Simon
714ace8250 [finder] Introduced AccessDeniedException
This exception is thrown when trying to open a non-readable directory.

Squashed commits:
[Finder] Fixed small errors
[Finder] small changes about AccessDeniedException
[Finder] removed unnecessary comment
[Finder] added access denied exception test
[Finder] Updated AccessDeniedException base class
[Finder] fixed access denied exception test
[Finder] native adapters now throw AccessDeniedException on stderr
2013-03-22 06:21:57 +01:00
Bilal Amarni
5afea04d4a [Form] made DefaultCsrfProvider using session_status() when available 2013-03-21 16:59:06 +01:00
Fabien Potencier
9568768fd9 merged branch fabpot/kernel-flexibility (PR #7437)
This PR was merged into the master branch.

Commits
-------

7c3179a [HttpKernel] moved the Container compilation for more flexibility
757194c [HttpKernel] made the Kernel class more flexible (closes #7396)

Discussion
----------

[HttpKernel] made the Kernel class more flexible (closes #7396)

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

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

by jrobeson at 2013-03-20T14:04:53Z

I still (personally) think that the compile() method is still too close to the building of the container. Is there a reasonable way to move the compile() method away from the rest of the logic used to build the container?

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

by elnur at 2013-03-20T14:34:23Z

I like this one. Can't wait to see this merged.

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

by stof at 2013-03-20T14:50:22Z

@jrobeson compiling the container is part of building it (it is the step running the compiler passes)

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

by jrobeson at 2013-03-20T15:32:26Z

i read the code stof .. that is what it does :) . I just thought it'd be easier to modify the container from the kernel of the compile() call was placed after the  buildContainer() call at https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Kernel.php#L556

This is something i had to work around when migrating to symfony. It's not a big deal to me anymore, so no worries.

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

by stof at 2013-03-20T15:36:12Z

@jrobeson the container is not fully build until you compile it. Half of the work is done by the compile() call.

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

by fabpot at 2013-03-20T15:38:24Z

I've moved the compile method as it makes things even more flexible.

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

by jrobeson at 2013-03-20T15:41:45Z

@stof : i know .. which is even better reason to move it outside that big method.

@fabpot: thanks!
2013-03-20 18:03:16 +01:00
Fabien Potencier
48856b1ce2 merged branch eddiejaoude/master (PR #7144)
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #7144).

Commits
-------

448983c [YAML] Added unit tests to Dumper

Discussion
----------

[YAML] Added unit tests to Dumper

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

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

by stof at 2013-02-21T11:28:55Z

I don't like the fact that you are adding a getter for the only purpose of reaching 100% coverage (which could be achieved differently by checking that the dumper can indeed use 8 spaces when dumping)

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

by eddiejaoude at 2013-02-21T11:33:03Z

Ok, fair point, I will amend.

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

by eddiejaoude at 2013-02-21T11:35:14Z

I also thought of using reflection for the private property, as checking 8 space dump is less of a unit test as using multiple methods, thoughts?

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

by eddiejaoude at 2013-02-21T13:42:30Z

Another way to look at it, is if the property has a 'setter' why should it not have a 'getter' too? i.e. If the developer can 'set' it, why cant they 'get' it too. Just another thought, once the best way to move forward is confirmed, I will update my other tests accordingly & submit them.

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

by Baachi at 2013-02-21T13:49:25Z

Another solution would be, to extend the `Dumper` class and move the `getIndentation` to this class. This class should be located into the `tests/` folder.

@stof What do you think?

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

by stof at 2013-02-21T14:21:54Z

@Baachi IMO, the unit test should ensure that we can actually change the indentation of the dumped code (which is what we want to do). We don't bother about being able to get the indentation (we don't even have a method for it currently), we want it to be applied. The Dumper is not a configuration object. It is an object doing some work.

So testing that a new getter returns the value will not ensure that changing the indentation is working.

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

by Baachi at 2013-02-21T15:07:23Z

@stof Ah yes, I understand you. So my solution is wrong, @eddiejaoude should call `setIndentation` and check the dumped yaml` if the string has the right indentation.

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

by eddiejaoude at 2013-02-22T07:35:08Z

Ok, thanks for the clarification guys. I will get on the case shortly!
2013-03-20 17:54:46 +01:00
Eddie Jaoude
992a4401e9 Added unit tests to Dumper 2013-03-20 17:54:45 +01:00
Fabien Potencier
bb83b3ea43 [HttpKernel] added a safeguard for when a fragment is rendered outside the context of a master request 2013-03-20 17:13:45 +01:00
Fabien Potencier
5d7b8356ab [FrameworkBundle] added some functional tests 2013-03-20 17:13:44 +01:00
Fabien Potencier
ff9d6883bb fixed Request management for FragmentHandler 2013-03-20 17:13:44 +01:00
Fabien Potencier
1b98ad34ff fixed Request management for LocaleListener 2013-03-20 17:13:40 +01:00
Fabien Potencier
a7b2b7e92b fixed Request management for RequestListener 2013-03-20 16:58:09 +01:00
Fabien Potencier
0892135f45 [HttpKernel] ensured that the Request is null when outside of the Request scope 2013-03-20 16:58:09 +01:00
Fabien Potencier
2ffcfb98c8 [FrameworkBundle] made the Request service synchronized
This change allows any service to depend on the Request (via a method
call) and always have the right Request instance without the need for
the service to be in the request scope (you still need to set the
Request reference as non-strict).
2013-03-20 16:58:08 +01:00
Fabien Potencier
ec1e7ca6ac [DependencyInjection] added a way to automatically update scoped services
A service can now be marked as synchronized; when set, all method calls
involving this service will be called each time this service is set.
When in a scope, methods are also called to restore the previous version of the
service.
2013-03-20 16:58:08 +01:00
Fabien Potencier
7c3179a364 [HttpKernel] moved the Container compilation for more flexibility 2013-03-20 16:37:56 +01:00
Fabien Potencier
19955c5a3c merged branch jfsimon/issue-7378 (PR #7438)
This PR was merged into the 2.1 branch.

Commits
-------

c928ddc [HttpFoudantion] fixed Request::getPreferredLanguage()
839c78a Revert "merged branch jfsimon/issue-6928 (PR #7378)"

Discussion
----------

[HttpFoundation] fixed Request::getPreferredLanguage()

Previous PR #7378 was wrong and adding BC break. Resolution for short languages codes is now done in `Request::getPreferredLanguage()` method.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7378
2013-03-20 15:33:09 +01:00
Fabien Potencier
469330da92 merged branch Tobion/typhint-routing-profiler (PR #7377)
This PR was submitted for the 2.2 branch but it was merged into the master branch instead (closes #7377).

Commits
-------

a58a443 [WebProfiler] add missing typehint to RouterController

Discussion
----------

[WebProfiler] add missing typehint to RouterController

It must be a RouteCollection because TraceableUrlMatcher expects it anyway.

| Q             | A
| ------------- | ---
| Bug fix?      | [no]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| License       | MIT
2013-03-20 15:28:26 +01:00
Tobias Schultze
395c50909a add missing typehint to RouterController 2013-03-20 15:28:26 +01:00
Abdellatif AitBoudad
f2da7f1abc Update .travis.yml (closes #7355)
Add extension apc.so to Travis-CI testing
2013-03-20 15:23:56 +01:00
Jean-François Simon
c928ddc77d [HttpFoudantion] fixed Request::getPreferredLanguage() 2013-03-20 15:10:59 +01:00
Fabien Potencier
d699a929e0 Merge branch '2.2'
* 2.2: (70 commits)
  change wrapped exception message to be more usefull
  updated VERSION for 2.0.23
  update CONTRIBUTORS for 2.0.23
  updated CHANGELOG for 2.0.23
  [Form] fixed failing test
  [DomCrawler] added support for query string with slash
  Fixed invalid file path for hiddeninput.exe on Windows.
  fix xsd definition for strict-requirements
  [WebProfilerBundle] Fixed the toolbar styles to apply them in IE8
  [ClassLoader] fixed heredocs handling
  fixed handling of heredocs
  Add a public modifier to an interface method
  removing xdebug extension
  [HttpRequest] fixes Request::getLanguages() bug
  [HttpCache] added a test (cached content should be kept after purging)
  [DoctrineBridge] Fixed non-utf-8 recognition
  [Security] fixed HttpUtils class tests
  replaced new occurences of 'Request::create()' with '::create()'
  changed sub-requests creation to '::create()'
  fixed merge issue
  ...

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
	src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig
	src/Symfony/Component/DomCrawler/Link.php
	src/Symfony/Component/Translation/Translator.php
2013-03-20 15:03:03 +01:00
Fabien Potencier
e24ce2f22f Merge branch '2.1' into 2.2
* 2.1:
  updated VERSION for 2.0.23
  update CONTRIBUTORS for 2.0.23
  updated CHANGELOG for 2.0.23
  [Form] fixed failing test
  [DomCrawler] added support for query string with slash
2013-03-20 14:55:39 +01:00
Fabien Potencier
757194c775 [HttpKernel] made the Kernel class more flexible (closes #7396) 2013-03-20 14:55:07 +01:00
Fabien Potencier
4047bf229f merged branch jfsimon/preg-bytes-conversion (PR #7413)
This PR was merged into the master branch.

Commits
-------

3674c22 changed bytes conversion method

Discussion
----------

Changed bytes conversion method

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

**The old way:**

```php
switch (strtolower(substr($memory, -1))) {
    case 'g':
        $memory *= 1024;
    case 'm':
        $memory *= 1024;
    case 'k':
        $memory *= 1024;
}
```

**The new way:**

```php
if (preg_match('#^(\d+)([bkmgt])#i', $memory, $match)) {
    $shift = array('b' => 0, 'k' => 10, 'm' => 20, 'g' => 30, 't' => 40);
    $memory = ($match[1] * (1 << $shift[strtolower($match[2])]));
}
```

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

by bendavies at 2013-03-18T16:27:52Z

pretty unreadable, no?

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

by benja-M-1 at 2013-03-18T16:29:25Z

I agree, I would not like to have to debug it.

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

by pborreli at 2013-03-18T16:31:43Z

just for my culture, what does : `1 << $var` ?

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

by bendavies at 2013-03-18T16:33:23Z

@pborreli it's a left shift http://php.net/manual/en/language.operators.bitwise.php

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

by jfsimon at 2013-03-18T16:47:15Z

@bendavies @benja-M-1 it's concise and easily recognised (if you understood it the first time).
FYI I didn't find it myself... pretty clever isn't it?

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

by benja-M-1 at 2013-03-18T16:50:53Z

Clearly too much clever for me :)

And what about moving this code in its own class to avoid the copy/paste?

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

by jfsimon at 2013-03-18T16:52:51Z

@benja-M-1 It would add a dependency to the components using it :(

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

by bendavies at 2013-03-18T16:55:26Z

@jfsimon clever indeed, but not necessarily better!

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

by jfsimon at 2013-03-18T16:57:18Z

@bendavies that's true.

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

by Tobion at 2013-03-18T17:00:56Z

There are other places where it could be used too (e.g. FileValidator).

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

by bendavies at 2013-03-18T17:06:01Z

on the other side of the argument, i *hate* the sneaky fall through on the switch statement.
very confusing the first time you see it!

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

by bendavies at 2013-03-18T17:19:42Z

this method has already made it into symfony here: https://github.com/symfony/symfony/pull/7395

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

by jfsimon at 2013-03-19T08:16:19Z

@Tobion I have some questions about the `FileValidator`:
* Why is th `k` in lower case and the `M` in upper case?
* Why is the size divided by 1000 and not 1024?

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

by Tobion at 2013-03-19T08:30:23Z

I was wondering the same. I guess this config (which is also displayed to users) uses the official metric prefixes (k = kilo, M = mega). So it's not about the computer terms where 1 KB = 1024 byte.

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

by vicb at 2013-03-19T16:03:21Z

kB =1000, kiB=1024.
Imo regexps should be case insensitive and account for the "i".
I am not in favor of the changes in this pr (the current way is also documented on php.net fwiw)
2013-03-20 14:37:17 +01:00
Fabien Potencier
8ff21064b2 merged branch Tobion/strict-req-xsd (PR #7424)
This PR was merged into the 2.2 branch.

Commits
-------

7ef90d2 fix xsd definition for strict-requirements

Discussion
----------

fix xsd definition for strict-requirements

see https://groups.google.com/forum/?fromgroups=#!topic/symfony-devs/bvHPI5C4dlY
2013-03-20 14:25:32 +01:00
Fabien Potencier
6da248efa2 merged branch gimler/pimp_exception (PR #7433)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #7433).

Commits
-------

9f84528 change wrapped exception message to be more usefull

Discussion
----------

change wrapped exception message to be more usefull

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

When you try to parse a yml file with the XMLLoader you get the following Exception

```
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
[ERROR 4] Start tag expected, '<' not found (in n/a - line 1, column 1)

[InvalidArgumentException]
[ERROR 4] Start tag expected, '<' not found (in n/a - line 1, column 1)
```

after the patch
```
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to parse file "/home/.../src/Application/FOS/UserBundle/DependencyInjection/../Resources/config/services.yml".

[InvalidArgumentException]
[ERROR 4] Start tag expected, '<' not found (in n/a - line 1, column 1)
```
2013-03-20 14:23:26 +01:00
Gordon Franke
d015a0f660 change wrapped exception message to be more usefull 2013-03-20 14:23:26 +01:00
Jean-François Simon
839c78a4b0 Revert "merged branch jfsimon/issue-6928 (PR #7378)"
This reverts commit 70ec4f6c61, reversing
changes made to 3a03f3e346.
2013-03-20 14:19:35 +01:00
Fabien Potencier
0631f9edcd Merge branch '2.0' into 2.1
* 2.0:
  updated VERSION for 2.0.23
  update CONTRIBUTORS for 2.0.23
  updated CHANGELOG for 2.0.23

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
2013-03-20 13:47:59 +01:00
Fabien Potencier
47cf973b92 merged branch nikrou/relative-path-with-slash (PR #7434)
This PR was merged into the 2.1 branch.

Commits
-------

e6b7515 [DomCrawler] added support for query string with slash

Discussion
----------

[DomCrawler] added support for query string with slash

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

Link\getUri() failed to return correct uri when current query string contains slash
Test pass on branch 2.1 but fails on master
2013-03-20 13:44:25 +01:00
Fabien Potencier
9948536833 updated VERSION for 2.0.23 2013-03-20 12:32:41 +01:00
Fabien Potencier
96618b5dad update CONTRIBUTORS for 2.0.23 2013-03-20 12:32:15 +01:00
Fabien Potencier
ad86c4811a updated CHANGELOG for 2.0.23 2013-03-20 12:15:45 +01:00
Fabien Potencier
e1cd990a77 [Form] fixed failing test 2013-03-20 12:02:29 +01:00
Nicolas Roudaire
e6b75153e3 [DomCrawler] added support for query string with slash
Link\getUri() failed to return correct uri when current query string contains slash
2013-03-20 09:46:19 +01:00
Fabien Potencier
6c531c132b merged branch kherge/2.2 (PR #7428)
This PR was merged into the 2.2 branch.

Commits
-------

633c051 Fixed invalid file path for hiddeninput.exe on Windows.

Discussion
----------

[2.2] [Console] Fix "The system cannot find the path specified." on Windows for askHiddenResponse().

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none available
| License       | MIT
| Doc PR        | n/a
2013-03-19 23:06:41 +01:00
Kevin Herrera
633c051409 Fixed invalid file path for hiddeninput.exe on Windows. 2013-03-19 13:48:08 -07:00
Fabien Potencier
b3ca7988cc Merge branch '2.1' into 2.2
* 2.1:
  Add a public modifier to an interface method
  [HttpRequest] fixes Request::getLanguages() bug
  [HttpCache] added a test (cached content should be kept after purging)
  [DoctrineBridge] Fixed non-utf-8 recognition
  [Security] fixed HttpUtils class tests
2013-03-19 21:41:20 +01:00
Fabien Potencier
e055b806bf merged branch stof/toolbar_ie (PR #7423)
This PR was merged into the 2.2 branch.

Commits
-------

39445c5 [WebProfilerBundle] Fixed the toolbar styles to apply them in IE8

Discussion
----------

[WebProfilerBundle] Fixed the toolbar styles to apply them in IE8

| Q             | A
| ------------- | ---
| Fixed tickets | #7422
| License       | MIT

Currently, the toolbar breaks the design of the whole page in IE8 and lower as it does not have styles applied. Even though it is a debugging tool and devs are often using modern browsers, it is painful to be forced to disable it when testing the site in IE (I won't bother about supporting the profiler JS in IE8 though as this is a different page which can be displayed in a modern browser even when testing in IE).
The reason of the issue is that [IE8 removes style tags at the beginning when setting the innerHTML](http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread/33fd33f7-e857-4f6f-978e-fd486eba7174/). As the fix is as easy as moving the tag after the div, I don't see a reason to reject this change.

I sent the bugfix to 2.2 because these templates have been refactored a lot between 2.1 and 2.2 so the fix would have been different. However, it is also possible to fix it in 2.1 if you want.
2013-03-19 15:30:59 +01:00
Tobias Schultze
7ef90d2f32 fix xsd definition for strict-requirements 2013-03-19 15:23:22 +01:00
Christophe Coevoet
39445c5897 [WebProfilerBundle] Fixed the toolbar styles to apply them in IE8
Fixes #7422
2013-03-19 15:14:34 +01:00
Fabien Potencier
d7fa84162b merged branch fabpot/fix-heredocs (PR #7417)
This PR was merged into the 2.2 branch.

Commits
-------

601da45 [ClassLoader] fixed heredocs handling

Discussion
----------

[ClassLoader] fixed heredocs handling

The end of an hereodc must have a newline to avoid PHP syntax errors.
2013-03-19 09:33:24 +01:00
Fabien Potencier
601da456ba [ClassLoader] fixed heredocs handling
The end of an hereodc must have a newline to avoid PHP syntax errors.
2013-03-19 09:32:26 +01:00
Fabien Potencier
949baf415b merged branch fabpot/fix-heredocs (PR #7416)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #7416).

Commits
-------

6d29979 [ClassLoader] fixed handling of heredocs

Discussion
----------

[ClassLoader] fixed handling of heredocs

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a
2013-03-19 09:20:23 +01:00
Fabien Potencier
67b5e1cc64 fixed handling of heredocs 2013-03-19 09:20:23 +01:00
Fabien Potencier
46341e171a merged branch bamarni/issue-6830 (PR #7408)
This PR was merged into the 2.1 branch.

Commits
-------

54609b9 [HttpCache] added a test (cached content should be kept after purging)

Discussion
----------

[HttpCache] added a test (cached content should be kept after purging)

closes #6830
2013-03-18 19:53:03 +01:00
Fabien Potencier
84ff273986 merged branch jfsimon/issue-7037 (PR #7395)
This PR was merged into the master branch.

Commits
-------

a011842 [HttpKernel] fixed memory collector
def2ccb Add PHP memory_limit to WDT

Discussion
----------

[HttpKernel] fixed memory collector

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

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

by vicb at 2013-03-15T20:21:55Z

OT, that's great to see many contributions for you @jfsimon, thanks !

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

by jfsimon at 2013-03-18T09:35:54Z

Thanks @vicb, this is so lovely :)
2013-03-18 18:10:19 +01:00
Jean-François Simon
3674c22b31 changed bytes conversion method 2013-03-18 17:08:21 +01:00
Jean-François Simon
a011842982 [HttpKernel] fixed memory collector 2013-03-18 16:18:56 +01:00
Fabien Potencier
7b7639280c merged branch elnur/interface-public-modifier (PR #7397)
This PR was submitted for the 2.0 branch but it was merged into the 2.1 branch instead (closes #7397).

Commits
-------

8ee05e5 Add a public modifier to an interface method

Discussion
----------

[2.0][Security] Add a public modifier to an interface method

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
2013-03-18 15:34:12 +01:00