Commit Graph

8097 Commits

Author SHA1 Message Date
lsmith77
dfbed9f91d also test PHP 5.3.2, since this is the official lowest supported PHP version 2011-12-26 01:15:21 +01:00
Fabien Potencier
b6a7167907 merged branch drak/cs (PR #2953)
Commits
-------

79793e4 Coding standards and removing whitespace.

Discussion
----------

Coding standards and removing whitespace.

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

Please note `2.0` cs passes, this is specifically for the `master` branch.
2011-12-25 22:44:26 +01:00
Fabien Potencier
f8d0c8dd0c merged branch lsmith77/filesystem_forward_compat (PR #2956)
Commits
-------

6e98730 added forwards compatibility for the Filesystem component

Discussion
----------

added forwards compatibility for the Filesystem component

see #2949 and #2946

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

by willdurand at 2011/12/25 05:24:01 -0800

👍

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

by ManuelAC at 2011/12/25 06:38:44 -0800

👍

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

by NAYZO at 2011/12/25 07:45:55 -0800

👍

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

by avalanche123 at 2011/12/25 09:52:59 -0800

I think extracting interface and committing it to both branches is preferable.

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

by lsmith77 at 2011/12/25 12:17:59 -0800

what interface?

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

by avalanche123 at 2011/12/25 12:19:03 -0800

FilesystemInterface

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

by lsmith77 at 2011/12/25 12:22:31 -0800

an interface doesn't really relate to this PR .. aka its a separate topic. the purpose of this PR is to make it easier to write code targeting with 2.0 and 2.1 with minimal impact.

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

by willdurand at 2011/12/25 12:23:51 -0800

Seems overkill to add an interface here. I dont think there are different implementations.

Le 25 déc. 2011 à 21:19, Bulat Shakirzyanov<reply@reply.github.com> a écrit :

> FilesystemInterface
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2956#issuecomment-3271576

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

by avalanche123 at 2011/12/25 12:28:49 -0800

@lsmith77 point taken, makes sense
@willdurand there are plenty of alternatives to default filesystem (databases, s3, etc.)

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

by willdurand at 2011/12/25 12:52:58 -0800

Gaufrette (KnpLabs) is suitable for what you describe. I don't know if this component is designed to handle various adapters.
This is just a layer for files manipulations on disk.

Le 25 déc. 2011 à 21:28, Bulat Shakirzyanov<reply@reply.github.com> a écrit :

> @lsmith77 point taken, makes sense
> @willdurand there are plenty of alternatives to default filesystem (databases, s3, etc.)
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2956#issuecomment-3271596
2011-12-25 22:44:06 +01:00
Fabien Potencier
f8f31a2d59 Merge branch '2.0'
* 2.0:
  [Twig] made code compatible with Twig 1.5
2011-12-25 22:40:56 +01:00
Fabien Potencier
adea589a3d [Twig] made code compatible with Twig 1.5 2011-12-25 22:37:25 +01:00
Toni Uebernickel
41950a625f [WebProfilerBundle] add margin-bottom to caption 2011-12-25 14:49:49 +01:00
lsmith77
6e987307fc added forwards compatibility for the Filesystem component 2011-12-25 14:02:01 +01:00
Drak
79793e442a Coding standards and removing whitespace. 2011-12-24 15:50:47 +05:45
Fabien Potencier
b498138471 merged branch willdurand/filesystem-component (PR #2949)
Commits
-------

4afc6ac Updated CHANGELOG-2.1
3d3239c Added Filesystem Component mention in composer.json
5775a0a Added composer.json
b26ae4a Added README
fbe9507 Added LICENSE
818a332 [Component] Moved Filesystem class to its own component

Discussion
----------

Filesystem component

Related to #2946

William

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

by stof at 2011/12/22 10:58:25 -0800

you need to add the new component in the ``replace``  section of the main composer.json, and you also need to add it as a dependency for FrameworkBundle as it defines a service using it.

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

by stof at 2011/12/22 10:59:34 -0800

and you need to update the changelog file

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

by willdurand at 2011/12/22 11:06:04 -0800

@stof thanks. Is it ok ?

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

by stof at 2011/12/22 11:13:31 -0800

mentioning the move only once in the changelog would probably be enough (and it is especially not needed in the FrameworkBundle section IMO) but otherwise it's fine
2011-12-24 09:15:42 +01:00
Fabien Potencier
d149aa7b2b merged branch stloyd/profile_simplify (PR #2950)
Commits
-------

9daa2a6 [Profiler] Add function to get parent token directly

Discussion
----------

[Profiler] Add function to get parent token directly

```
Bug fix: no
Feature addition: kinda
Backwards compatibility break: no
Symfony2 tests pass: yes
2011-12-24 09:13:41 +01:00
Matthias Pigulla
cae7db0d19 Be more tolerant and also accept <esi:include ...></esi:include>, also if it is not 100% standards compliant. 2011-12-23 19:02:12 +01:00
Gustavo Piltcher
4a797df90b Oracle issues
minor modifications
2011-12-23 14:13:05 -02:00
Joseph Bielawski
9daa2a6cc8 [Profiler] Add function to get parent token directly 2011-12-23 09:45:13 +01:00
Fabien Potencier
d635be4e20 fixed merge 2011-12-23 09:21:58 +01:00
Fabien Potencier
5b2bc7d7f9 merged 2.0 2011-12-23 08:57:06 +01:00
Fabien Potencier
bebdd07f41 [TwigBridge] simplified code 2011-12-23 08:55:49 +01:00
Fabien Potencier
74cfd04504 [Security] made the logout path check configurable 2011-12-23 08:28:15 +01:00
William DURAND
4afc6acc9e Updated CHANGELOG-2.1 2011-12-22 20:04:58 +01:00
William DURAND
3d3239c29b Added Filesystem Component mention in composer.json
- In the global Symfony2 composer.json file as a replacement
- In the FrameworkBundle composer.json file as a requirement
2011-12-22 20:02:15 +01:00
William DURAND
5775a0a24a Added composer.json 2011-12-22 19:44:28 +01:00
William DURAND
b26ae4aac3 Added README 2011-12-22 19:43:09 +01:00
William DURAND
fbe950721b Added LICENSE 2011-12-22 19:42:52 +01:00
William DURAND
818a3321c0 [Component] Moved Filesystem class to its own component 2011-12-22 19:36:46 +01:00
Fabien Potencier
4404d6f0be merged branch stof/entity_provider_registry (PR #2928)
Commits
-------

373ab4c Fixed tests added from 2.0
9653be6 Moved the EntityFactory to the bridge
caa105f Removed useless use statement
24319bb [DoctrineBridge] Made it possible to change the manager used by the provider

Discussion
----------

[DoctrineBridge] Made it possible to change the manager used by the provider

This improves the support of several entity managers by allowing using a non-default one for the provider.

It is BC for the user as the default value for the name is ``null`` which means using the default one.

I'm preparing the PR for DoctrineBundle too

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

by stof at 2011/12/19 14:16:38 -0800

I'm wondering if the EntityFactory used to integrate the bundles with SecurityBundle should be moved to the bridge or not. Moving it (making the key and the abstract service id configurable) would allow reusing it in all Doctrine bundles instead of copy-pasting it (see the CouchDBBundle pull request linked above).
The bridge was initially meant to integrate third party libraries with the components and this class is about the SecurityBundle, not the component. But on the other hand, we already share the abstract DI extension between the bundles using the bridge.

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

by stof at 2011/12/19 14:17:48 -0800

@fabpot @beberlei thoughts ?

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

by stof at 2011/12/21 04:43:50 -0800

@fabpot @beberlei what do you thing about moving the EntityFactory to the bridge ?

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

by henrikbjorn at 2011/12/21 05:10:56 -0800

Missing mongodb bundle

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

by stof at 2011/12/21 05:52:06 -0800

@henrikbjorn I was planning to send the PR for mongodb too but the namespace change was not merged yet yesterday. And now, you want to wait for the answer to know if I need to copy-paste the factory to the mongodb bundle too or if I move it to the bridge

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

by beberlei at 2011/12/21 15:14:17 -0800

I think moving it to the Bridge makes sense if we can re-use across all the bundles then. Also it is really about integrating security with doctrine, so its a bridge topic.

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

by stof at 2011/12/22 08:39:52 -0800

I updated the PR to move the factory to the bridge. The DoctrineBundle and DoctrineCouchDBBundle PRs are updated too.

@fabpot the PR should be ready to be merged

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

by fabpot at 2011/12/22 08:53:02 -0800

Tests do not pass for me:

    ...E

    Time: 0 seconds, Memory: 14.75Mb

    There was 1 error:

    1) Symfony\Tests\Bridge\Doctrine\Security\User\EntityUserProviderTest::testSupportProxy
    Argument 1 passed to Symfony\Bridge\Doctrine\Security\User\EntityUserProvider::__construct() must implement interface Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\ORM\EntityManager given, called in tests/Symfony/Tests/Bridge/Doctrine/Security/User/EntityUserProviderTest.php on line 89 and defined

    src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php:35
    tests/Symfony/Tests/Bridge/Doctrine/Security/User/EntityUserProviderTest.php:89

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

by stof at 2011/12/22 08:56:33 -0800

@fabpot I fixed it before your comment (thanks travis ^^). It was the test added in my other PR to 2.0 and so not updated in the original commit. I forgot it when rebasing
2011-12-22 17:59:27 +01:00
Christophe Coevoet
373ab4c50f Fixed tests added from 2.0 2011-12-22 17:52:42 +01:00
Fabien Potencier
afa683a6e8 merged branch Burgov/doctrine_choice_with_proxy_object_fix (PR #2944)
Commits
-------

0a9ea26 fixed the display of the current value in a doctrine entity type, when the current value is for example an instance of Doctrine\Orm\Proxy\Proxy and is not yet initialized

Discussion
----------

fixed the display of the current value in a doctrine entity type

 when the current value is an instance of Doctrine\Orm\Proxy\Proxy

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

Arguably, this is a Doctrine issue rather than a Symfony one, but when the current value in the entity type is a proxy instance, no item is selected, because "$this->reflFields[$this->identifier[0]]->getValue($entity);" (in ClassMetadata) always returns null unless the entity is loaded

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

by Gregwar at 2011/12/22 07:07:34 -0800

+1 for this

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

by stof at 2011/12/22 08:30:44 -0800

@fabpot this is good for the merge now
2011-12-22 17:50:22 +01:00
Christophe Coevoet
9653be618a Moved the EntityFactory to the bridge 2011-12-22 16:54:29 +01:00
Bart van den Burg
0a9ea2614c fixed the display of the current value in a doctrine entity type, when the current value is for example an instance of Doctrine\Orm\Proxy\Proxy and is not yet initialized 2011-12-22 16:37:13 +01:00
Christophe Coevoet
caa105fef9 Removed useless use statement 2011-12-22 16:14:18 +01:00
Christophe Coevoet
24319bb0f4 [DoctrineBridge] Made it possible to change the manager used by the provider 2011-12-22 16:14:12 +01:00
Fabien Potencier
10c60ab5d5 merged branch Burgov/fix_entity_choice_list (PR #2942)
Commits
-------

c60f036 fixed typo
231e79c fixed entity choice list BC break

Discussion
----------

fixed EntityChoiceList BC break

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

This PR resolves a serious BC break introduced in commit b919d92b52
Prior to this commit, it was possible to use the entity shorthand notation in the EntityChoiceList constructor, but it broke because the EntityChoiceList now expects the second argument to be the actual class name

There is another issue at hand here, but I'm not sure how to fix it:

The EntityChoiceManager expects an Doctrine\Common\Persistence\ObjectManager instance, then the ClassMetadata is fetched from it and the method getIdentifierFieldNames is called on it. Yet, according to the docblock, getClassMetadata of the ObjectManager returns an instance of Doctrine\Common\Persistence\Mapping\ClassMetadata, which doesn't have a getIdentifierFieldNames() method.

So either the EntityChoiceList should expect an instance of EntityManager, or it should be rewritten to not use getIdentifierFieldNames() anymore.

Any ideas?

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

by fabpot at 2011/12/22 03:48:49 -0800

ping @beberlei

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

by beberlei at 2011/12/22 04:02:30 -0800

The fix is valid

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

by stof at 2011/12/22 04:54:53 -0800

@beberlei getIdentifierFieldNames should probably be added in the interface too. Currently, we only have isIdentifier in it.

This methods needs to be implemented in the MongoDB ODM though (simply returning ``array($this->getIdentifier())``
2011-12-22 14:10:23 +01:00
Bart van den Burg
c60f0363de fixed typo 2011-12-22 10:57:47 +01:00
Bart van den Burg
231e79ce0f fixed entity choice list BC break 2011-12-22 10:49:27 +01:00
Fabien Potencier
0fa9e4cb69 [HttpKernel] fixed some unit tests that can fail 2011-12-22 08:06:15 +01:00
Fabien Potencier
473741b9db added the possibility to change a StreamedResponse callback after its creation 2011-12-22 07:58:59 +01:00
Fabien Potencier
2dff183a07 merged branch kriswallsmith/http/apache-request (PR #2940)
Commits
-------

1b4aaa2 [HttpFoundation] fixed ApacheRequest

Discussion
----------

[HttpFoundation] fixed ApacheRequest

Pathinfo was incorrect when using mod_rewrite.
Added better test coverage.
2011-12-22 07:29:49 +01:00
Kris Wallsmith
1b4aaa2c8e [HttpFoundation] fixed ApacheRequest
Pathinfo was incorrect when using mod_rewrite.
Added better test coverage.
2011-12-21 13:57:56 -08:00
Fabien Potencier
8717d4425e moved a test in the constructor 2011-12-21 18:53:18 +01:00
Fabien Potencier
e44b8ba521 made some cosmetic changes 2011-12-21 18:34:44 +01:00
Fabien Potencier
2af5cb5602 merged branch marekkalnik/upload-flash (PR #2938)
Commits
-------

8235848 [HttpFoundation][File] Add flv file default extension

Discussion
----------

[HttpFoundation][File] Add flv file default extension

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes (doesn't affect tests)
Fixes the following tickets: -
Todo: -

This commit adds default extension for video/x-flv mime-type, which is a Flash Video file. Lack of this definition causes File::guessExtension() return null for this type of file, which breaks uploaded file in some user cases.
2011-12-21 17:08:06 +01:00
Fabien Potencier
74ef9b963e merged branch mdemirci/2.0 (PR #2937)
Commits
-------

5a6c989 FrameworkBundle: Adding test-attribute in xsd-schema to write functional-tests if using xml-configurations

Discussion
----------

[FrameworkBundle] Adding test-attribute in xsd-schema

 to write functional-tests if using xml-configurations
2011-12-21 17:07:45 +01:00
Marek Kalnik
8235848b5b [HttpFoundation][File] Add flv file default extension 2011-12-21 16:18:42 +01:00
Muharrem Demirci
5a6c989abc FrameworkBundle: Adding test-attribute in xsd-schema to write functional-tests if using xml-configurations 2011-12-21 15:50:59 +01:00
Fabien Potencier
0038d1bac4 [HttpFoundation] added support for streamed responses
To stream a Response, use the StreamedResponse class instead of the
standard Response class:

    $response = new StreamedResponse(function () {
        echo 'FOO';
    });

    $response = new StreamedResponse(function () {
        echo 'FOO';
    }, 200, array('Content-Type' => 'text/plain'));

As you can see, a StreamedResponse instance takes a PHP callback instead of
a string for the Response content. It's up to the developer to stream the
response content from the callback with standard PHP functions like echo.
You can also use flush() if needed.

From a controller, do something like this:

    $twig = $this->get('templating');

    return new StreamedResponse(function () use ($templating) {
        $templating->stream('BlogBundle:Annot:streamed.html.twig');
    }, 200, array('Content-Type' => 'text/html'));

If you are using the base controller, you can use the stream() method instead:

    return $this->stream('BlogBundle:Annot:streamed.html.twig');

You can stream an existing file by using the PHP built-in readfile() function:

    new StreamedResponse(function () use ($file) {
        readfile($file);
    }, 200, array('Content-Type' => 'image/png');

Read http://php.net/flush for more information about output buffering in PHP.

Note that you should do your best to move all expensive operations to
be "activated/evaluated/called" during template evaluation.

Templates
---------

If you are using Twig as a template engine, everything should work as
usual, even if are using template inheritance!

However, note that streaming is not supported for PHP templates. Support
is impossible by design (as the layout is rendered after the main content).

Exceptions
----------

Exceptions thrown during rendering will be rendered as usual except that
some content might have been rendered already.

Limitations
-----------

As the getContent() method always returns false for streamed Responses, some
event listeners won't work at all:

* Web debug toolbar is not available for such Responses (but the profiler works fine);
* ESI is not supported.

Also note that streamed responses cannot benefit from HTTP caching for obvious
reasons.
2011-12-21 14:34:26 +01:00
Fabien Potencier
cc8f3086df Merge branch '2.0'
* 2.0:
  [HttpKernel] fixed unit tests that can fail randomly
2011-12-21 14:29:13 +01:00
Fabien Potencier
7ea9c5b92a merged branch stloyd/missingClientTransformer (PR #2421)
Commits
-------

49d2685 [Form] Add default validation to TextType field (and related)

Discussion
----------

[Form] Add default transformer to TextType field (and related)

Bug fix: yes&no (?)
Feature addition: yes (?)
BC break: no
Symfony2 tests pass: yes
Fixes the following tickets: #1962.

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

by stloyd at 2011/12/19 03:43:37 -0800

@fabpot ping ;-)

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

by fabpot at 2011/12/19 10:58:20 -0800

Is it really needed? I have a feeling that it enforces unneeded constraints, but I can be wrong of course.

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

by hlecorche at 2011/12/20 02:31:03 -0800

It's needed because with TextType field, and without the ValueToStringTransformer, the user data (when sending the form) can be an array !!!

For example:
- if there is a TextType field
- and if there is a MaxLengthValidator
- and if the user data (when sending the form) is an array
So the exception "Expected argument of type string, array given in src\Symfony\Component\Validator\Constraints\MaxLengthValidator.php at line 40" is thrown
2011-12-21 12:55:51 +01:00
Fabien Potencier
3dd1072edc [HttpKernel] fixed unit tests that can fail randomly 2011-12-20 20:21:56 +01:00
Fabien Potencier
5803146a9e merged 2.0 2011-12-20 20:16:39 +01:00
Fabien Potencier
ebc9979a57 [Process] fixed unit tests on PHP 5.4 2011-12-20 20:16:11 +01:00
Fabien Potencier
89bd0d7874 merged branch Tobion/patch-3 (PR #2931)
Commits
-------

1eb5583 fixes #2906

Discussion
----------

Fix for #2906

closes #2906
2011-12-20 19:20:41 +01:00