Commit Graph

9594 Commits

Author SHA1 Message Date
Larry Garfield
a22f0cdc32 Enhance FlattenException to include more methods from Exception. That allows it to be used in place of Exception in more places. 2012-04-19 23:45:54 -05:00
Fabien Potencier
efc1a0d1b0 merged branch jalliot/patch-2 (PR #4015)
Commits
-------

7dc9361 Update autoload according to latest composer change

Discussion
----------

Update autoload according to latest composer change

[![Build Status](https://secure.travis-ci.org/jalliot/symfony.png?branch=patch-2)](http://travis-ci.org/jalliot/symfony)
2012-04-20 06:31:00 +02:00
Jordan Alliot
7dc93619d0 Update autoload according to latest composer change 2012-04-19 23:57:43 +03:00
Michał Pipa
94bee7a3d5 [Filesystem] symlink() creates target directories 2012-04-19 19:42:07 +02:00
Fabien Potencier
9b5be1df2a [Yaml] fixed tests when iconv and mbstring PHP extensions are not available 2012-04-19 19:28:53 +02:00
Włodzimierz Gajda
218813cb50 [Finder] contains(), notContains() 2012-04-19 18:19:17 +02:00
Włodzimierz Gajda
33e119a7dc Merge branch 'master' of https://github.com/symfony/symfony into finder_search_by_contents 2012-04-19 17:35:33 +02:00
Włodzimierz Gajda
082d86e3a0 [Finder] content(), notContent() methods 2012-04-19 17:34:50 +02:00
Fabien Potencier
03752564a0 merged branch vicb/umask (PR #4009)
Commits
-------

e0e451f Fix umasks in chmod() calls

Discussion
----------

Fix umasks in chmod() calls

As discussed with @Seldaek
ref: #4008
2012-04-19 16:17:16 +02:00
Victor Berchet
e0e451feb8 Fix umasks in chmod() calls 2012-04-19 15:47:04 +02:00
Fabien Potencier
4d8461f243 merged branch Seldaek/filesystemfixes (PR #4008)
Commits
-------

748bbe1 Make windows test run on windows only
e7f1295 [Filesystem] Fix Filesystem::chmod to apply umask properly
5c059aa Fix chmod() calls to apply umask
13c07d1 [Filesystem] Fix typo
c578d3a [Filesystem] Fix makePathRelative on windows with mixed paths, fix tests

Discussion
----------

[Filesystem][Others] Fix chmod method and all calls to chmod throughout the framework

Fixes the issue I mentioned in #4004 - basically php's chmod() does not apply the umask by default (unlike mkdir's mode arg which is masked by umask, from which I guess the confusion comes from).

So I expanded all cache writes and such to 0666 when they were 0644, and then mask it against umask, so that we respect the user settings a bit better.

Also fixed Filesystem::chmod which completely ignored the umask argument before.

Fixed a few tests on windows too.
2012-04-19 14:16:42 +02:00
Jordi Boggiano
748bbe17b8 Make windows test run on windows only 2012-04-19 13:51:15 +02:00
Jordi Boggiano
e7f129576e [Filesystem] Fix Filesystem::chmod to apply umask properly 2012-04-19 13:35:44 +02:00
Jordi Boggiano
5c059aa121 Fix chmod() calls to apply umask 2012-04-19 13:35:17 +02:00
Fabien Potencier
086b73506d merged branch pvanliefland/ticket_1692 (PR #3945)
Commits
-------

8bdff01 [DoctrineBridge][Form] added collection guess for array Doctrine type and array constraint type

Discussion
----------

[Form] [DoctrineBridge] Better field type guessing for array doctrine type and array validator type

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

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

by bschussek at 2012-04-18T08:45:17Z

Could you please add an entry to the CHANGELOG and squash your commits into one?

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

by pvanliefland at 2012-04-18T17:20:39Z

Done
2012-04-19 13:13:47 +02:00
Fabien Potencier
3c62ebf52e merged branch ruian/issue-3992 (PR #4006)
Commits
-------

45ada32 Add Support for boolean as to string into yaml extension

Discussion
----------

Add Support for boolean as to string into yaml extension

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: 3992
Todo:
- Maybe use only boolean checker instead of YamlDumper->dump
2012-04-19 13:01:39 +02:00
Julien 'ruian' Galenski
45ada3285f Add Support for boolean as to string into yaml extension 2012-04-19 12:45:34 +02:00
Jordi Boggiano
13c07d1469 [Filesystem] Fix typo 2012-04-19 12:37:59 +02:00
Jordi Boggiano
c578d3ac57 [Filesystem] Fix makePathRelative on windows with mixed paths, fix tests 2012-04-19 12:37:15 +02:00
Fabien Potencier
811751e147 merged branch rouffj/fix-3929 (PR #4004)
Commits
-------

5fa7ec2 Fix #3929

Discussion
----------

Fix #3929
2012-04-19 12:14:24 +02:00
Joseph Rouff
5fa7ec2acb Fix #3929 2012-04-19 12:10:32 +02:00
Fabien Potencier
684e5025ad merged branch Seldaek/asseturl (PR #4002)
Commits
-------

725423c Add test to prevent regressions
3b2f542 Fix asset generation with an empty asset

Discussion
----------

[Templating] Return base URL when an empty path is given to asset()

I think it's straightforward enough in the patch. Tests pass. It's quite useful to generate the base path to send to a JS frontend.
2012-04-19 12:03:59 +02:00
Fabien Potencier
460c181951 merged branch evillemez/master (PR #3557)
Commits
-------

b7b26af [DependencyInjection] Added, implemented and tested IntrospectableContainerInterface::initialized()

Discussion
----------

[DependencyInjection] IntrospectableContainerInterface::initialized()

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

Added, implemented and tested `IntrospectableContainerInterface::initialized()`, which allows checking for whether or not a service id has actually been loaded, without forcing it to load.  This could be implemented in several places to prevent loading a service when it's only needed if it has been previously loaded - for example the SwiftmailBundle's event listener for the `kernel.terminate` event, which currently forces Swiftmail to load on every request to check for messages to send, even if it was not previously loaded.

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

by fabpot at 2012-03-11T09:10:32Z

Do you have any other examples in mind where it would be useful?

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

by stof at 2012-03-11T12:39:22Z

@fabpot 2 exemples:

- the Swiftmailer listener to avoid loading the initialization code of Swiftmailer in each kernel.terminate event just to check that there is no pending message in the spool (if the spool has never been retrieved, it cannot have messages) (this is the use case we discussed on IRC last night)
- closing Doctrine connections and Monolog handlers in the shutdown method without creating them if they were not used

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

by stof at 2012-03-11T12:39:53Z

However, I don't like the name of the method

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

by lsmith77 at 2012-03-11T13:26:34Z

sounds very useful

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

by evillemez at 2012-03-11T17:00:39Z

@fabpot another example:

* Forcing a session to write early, if it was previously loaded - but not having to load the session to check, thus potentially forcing a database connection (if that's how the session is being handled) when it's not needed.

@stof Would more or less verbose be better?  Like, `isServiceLoaded()` or just `loaded()`.... or a better word than "loaded" ? :)

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

by stof at 2012-03-11T17:03:11Z

@evillemez My issue is the word ``loaded``. I don't think it is clear about what it means here

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

by lsmith77 at 2012-03-11T17:04:24Z

one thing we should also keep in mind here is the scope of the service.

BTW: there are also a couple of CS violations in your PR

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

by fabpot at 2012-03-11T17:07:43Z

@stof: I agree that we should think of a better name: `initialized()` or `exists()` (to differentiate from `has()`)?

@evillemez: After choosing the name, can you work on actually using the new method for some of the use cases mentioned in this PR?

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

by lsmith77 at 2012-03-11T17:20:12Z

what i meant with "scope" was if we are only talking about services instantiated in the current scope? but i guess there is no way to handle anything else anyway.

as for name .. i think ``instantiated()`` is more fitting than ``initialized()``.
``exists()`` could be confused with ``has()`` imho

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

by stof at 2012-03-11T17:26:06Z

The current implementation only works for container-scoped services. It does not make sense  for prototyped-scope services anyway (as the container does not keep them) but supporting scoped services will be tricky IMO

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

by mvrhov at 2012-03-11T17:34:21Z

hasBeen(Used|Called|Initialized),

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

by evillemez at 2012-03-11T17:54:43Z

The next day or two I'm only around for an hour or so here and there, I may be a little slow to respond.

@stof @lsmith77 I agree with either `instantiated()` or `initialized()`, I also think `exists()` might be easily confused with `has()`

@lsmith77 Besides the opening/closing brace placements, was there anything else?

@fabpot I would happily implement it in the Swiftmail bundle - as of now that's the only area where I know absolutely it would be useful.  The Session example I mentioned was an issue I ran into working on another app in another framework, and I'm not familiar yet with the internals of the Monolog/Doctrine Bundles.  But if people could point me in the right direction I'd be willing to check it out.

I'm still relatively new to some of the Symfony2 internals, so if there are obvious things I'm missing, please don't hesitate to point them out. :)

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

by evillemez at 2012-03-11T18:00:29Z

@lsmith77 Oh... I think there were some tab issues I didn't see in my editor, I'll fix those too.

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

by stof at 2012-03-11T18:13:03Z

The places where it should be used for Doctrine and Monolog are in separate repos anyway so it cannot be part of this PR

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

by evillemez at 2012-03-12T03:38:50Z

Any thoughts on `instantiated` vs `initialized`?  I'm leaning towards `initialized`.

How should I proceed, close this request and submit another with the changed name and fixed CS violations?

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

by fabpot at 2012-03-12T07:41:11Z

`initialized()` looks fine to me. Make your changes, squash your commits and then force the push to your branch (the PR will be updated automatically).

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

by evillemez at 2012-03-12T20:49:17Z

I was about to squash my commits to update this, but it just occurred to me that I hadn't considered the interface.  Does anyone feel this method `initialized()` should be defined in ContainerInterface as well?  It seems like it's generic enough that it would make sense.  But I'm not immediately aware if this would cause BC breaks.

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

by fabpot at 2012-03-13T11:34:33Z

We cannot break BC for `ContainerInterface` as this is marked with the `@api` tag.

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

by henrikbjorn at 2012-03-13T12:34:42Z

Is it a BC break if we add a method? i thought only changing the already written methods would be a BC break.

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

by ooflorent at 2012-03-13T12:39:44Z

@henrikbjorn It will raise a fatal error if the method isn't implemented in existing class.

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

by lsmith77 at 2012-03-13T13:06:26Z

we could however add a new interface that extends from the previous one.

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

by evillemez at 2012-03-13T15:40:39Z

Are the BC breaks we are worried about for compatibility just within the Symfony repo - or in general in case others have implemented the interface elsewhere?  As far as Symfony is concerned, the only class I can find that implements `ContainerInterface` is `Container`, so adding the method shouldn't be an issue.

If it's an issue of principle, in case others may have implemented the `ContainerInterface`, then... yeah, it's a break, and maybe should be left out.  I suppose this would mean that other places in code that type hint for `ContainerInterface` would have to change the type hint to `Container` if they want to implement the `initialized()` method.

Is this more or less acceptable than updating the interface?

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

by evillemez at 2012-03-14T19:17:27Z

Hadn't properly squashed commits, just fixed.

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

by evillemez at 2012-03-15T14:06:38Z

I'm done with this PR, unless there is a consensus that I should also implement `Container::initialized()` in `ContainerInterface`.

Anything else I need to do?

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

by Seldaek at 2012-03-15T15:41:44Z

@evillemez the common pattern for BC is to add a new interface, say IntrospectableContainerInterface or something, that extends ContainerInterface, then you can type-hint that without restricting use of competing implementations of the Container class.

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

by stof at 2012-04-03T22:30:51Z

@evillemez Please update this PR. It conflicts with master because of the move of tests. And the new interface suggested by @Seldaek is a good idea IMO

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

by evillemez at 2012-04-04T14:57:29Z

@Stof I may not be able to get to this until the end of the week, but I'll do it as soon as I can.

I'll rebase against the current master, and add/implement the interface.  Is `IntrospectableContainerInterface ` as suggested by @Seldaek ok with everyone?

Are there other features that we can think of that would be useful for this new interface?  I don't want to start a precedent of adding a new interface for every new method that comes up... I understand it makes sense for not breaking backwards compatibility for something previously marked as stable, but still, it's yet another file that will likely be included on every request.

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

by stof at 2012-04-04T15:35:15Z

@evillemez classes used on every requests can be added to some cached bootstrap files (which are loaded during the ``$kernel->loadClassCache()`` call in your front controller) to avoid including many files through the autoloader. And for even better performances in prod, the solution is to use APC with ``apc.stat = 0``, as advocated by @lsmith77

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

by evillemez at 2012-04-15T19:00:07Z

Ok, rebased against current master and implemented the interface.  I didn't mark it as `@api` because I think we may want to consider if there's any other functionality that could be implemented there before declaring it stable.

Sorry for the delay.  My wife and I are in the process of buying a house, and some unexpected things have come up.

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

by fabpot at 2012-04-18T10:59:01Z

Can you rebase before I merge? Thanks.
2012-04-19 11:56:35 +02:00
Jordi Boggiano
725423c4c4 Add test to prevent regressions 2012-04-19 11:54:19 +02:00
Fabien Potencier
d599442cc1 merged branch jfsimon/issue-3896 (PR #4001)
Commits
-------

cd783fb [HttpKernel] Fixed cache vary lookup (fixes #3896).

Discussion
----------

[HttpKernel] Fixed cache vary lookup (fixes #3896).

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3896
2012-04-19 11:49:29 +02:00
Jordi Boggiano
3b2f5428c3 Fix asset generation with an empty asset 2012-04-19 11:46:54 +02:00
jeanfrancois.simon
cd783fba06 [HttpKernel] Fixed cache vary lookup (fixes #3896). 2012-04-19 11:41:27 +02:00
Fabien Potencier
9ebc6a5b86 merged branch sstok/2.0 (PR #3997)
Commits
-------

89a1cdb Fixed grammar error. "tenminste" (instead of) -> "ten minste" (at minimum).

Discussion
----------

[Validator] validators.nl.xlf Fixed grammar error

There is a small grammar error in validators.nl.xlf

tenminste is wrong is this context.
http://www.onzetaal.nl/taaladvies/advies/tenminste

"tenminste" (instead of) -> "ten minste" (at minimum).

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

by Burgov at 2012-04-19T08:49:14Z

The name of the PR refers to the wrong file

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

by sstok at 2012-04-19T08:57:38Z

Oops :) your wright, I had to recover the form and made that mistake before and fixed in then.
The filename in the commit is correct however.
2012-04-19 11:37:58 +02:00
Fabien Potencier
aebaece460 merged branch bschussek/issue3990 (PR #3996)
Commits
-------

ccd6bbc [Form] Removed extra CSRF field on collection prototype

Discussion
----------

[Form] Removed extra CSRF field on collection prototype

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

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

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

by bschussek at 2012-04-19T08:43:32Z

Wait a minute please, I oversaw some tests that have to be adapted.

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

by bschussek at 2012-04-19T09:22:45Z

Fixed. ping @fabpot
2012-04-19 11:36:21 +02:00
Fabien Potencier
fd52f93c7e merged branch rouffj/fix-3971 (PR #3998)
Commits
-------

991076a Fix #3971

Discussion
----------

Fix #3971
2012-04-19 11:28:24 +02:00
Joseph Rouff
991076ad82 Fix #3971 2012-04-19 11:20:58 +02:00
Bernhard Schussek
ccd6bbc0a1 [Form] Removed extra CSRF field on collection prototype 2012-04-19 11:00:26 +02:00
Sebastiaan Stok
89a1cdb1bc Fixed grammar error. "tenminste" (instead of) -> "ten minste" (at minimum).
http://www.onzetaal.nl/taaladvies/advies/tenminste
2012-04-19 11:45:13 +03:00
Fabien Potencier
660fb46d56 merged branch hhamon/http_foundation_phpdoc (PR #3982)
Commits
-------

b19468e [HttpFoundation] changed return type from int to integer in ParameterBag::getInt() method.
9cd0b03 [HttpFoundation] fixed phpdoc in ParameterBag::getInt() method.

Discussion
----------

[HttpFoundation] phpdoc fix in ParameterBag class

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-19 09:03:49 +02:00
Fabien Potencier
0cd63852aa merged branch michal-pipa/composer-fix (PR #3986)
Commits
-------

a514072 Added Monolog to composer.json as dev dependency

Discussion
----------

Added Monolog to composer.json as dev dependency

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

Monolog was missing in dev composer dependences. It was present in `vendors.php`: 35e6c8ed0f/vendors.php

Without this code coverage report generation fails with error message: `Fatal error: Class 'Monolog\Handler\ChromePHPHandler' not found`.
2012-04-19 09:03:19 +02:00
Fabien Potencier
cc0e293bde merged branch msabramo/patch-1 (PR #3988)
Commits
-------

1863b28 Fix typo: Resonse -> Response

Discussion
----------

Fix typo: Resonse -> Response
2012-04-19 09:03:04 +02:00
Fabien Potencier
45679b4b53 merged branch willdurand/patch-1 (PR #3991)
Commits
-------

e5eed5c Fixed autoload.php.dist

Discussion
----------

Fixed autoload.php.dist
2012-04-19 09:02:51 +02:00
Hugo Hamon
b19468e15b [HttpFoundation] changed return type from int to integer in ParameterBag::getInt() method. 2012-04-19 01:11:41 +02:00
William Durand
e5eed5c31a Fixed autoload.php.dist 2012-04-19 01:46:46 +03:00
Marc Abramowitz
1863b28e97 Fix typo: Resonse -> Response 2012-04-18 13:38:08 -07:00
Michał Pipa
a514072b06 Added Monolog to composer.json as dev dependency 2012-04-18 21:22:15 +02:00
Evan Villemez
b7b26af9c5 [DependencyInjection] Added, implemented and tested IntrospectableContainerInterface::initialized() 2012-04-18 15:15:26 -04:00
pierre
8bdff01f17 [DoctrineBridge][Form] added collection guess for array Doctrine type and array constraint type
Fixes #1692
2012-04-18 19:15:40 +02:00
Fabien Potencier
83a0edd24b merged branch vicb/FormTypeValidatorExtension_fix (PR #3984)
Commits
-------

99ec873 [Form] Fix the FormTypeValidatorExtension (required by PR 3923)

Discussion
----------

[Form] Fix the FormTypeValidatorExtension (required by PR 3923)

Thanks to @jrfish for the fix (#3983)
2012-04-18 18:46:26 +02:00
Victor Berchet
99ec873134 [Form] Fix the FormTypeValidatorExtension (required by PR 3923) 2012-04-18 18:43:28 +02:00
Hugo Hamon
9cd0b03aea [HttpFoundation] fixed phpdoc in ParameterBag::getInt() method. 2012-04-18 17:30:08 +02:00
Fabien Potencier
b12f32612d merged branch hhamon/http_foundation_cs (PR #3980)
Commits
-------

64a0abe [HttpFoundation] fixed CS in ParameterBag class.

Discussion
----------

[HttpFoundation] fixed CS in ParameterBag class.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-18 17:21:05 +02:00
Fabien Potencier
065632b059 merged branch gajdaw/finder_comparator_not_equal (PR #3974)
Commits
-------

1b320c8 [Finder][Comparator] not equal operator

Discussion
----------

[Finder][Comparator] not equal operator

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-18 17:20:26 +02:00
Hugo Hamon
64a0abe577 [HttpFoundation] fixed CS in ParameterBag class. 2012-04-18 17:10:56 +02:00
Fabien Potencier
968dded8e7 merged branch drak/trace_static (PR #3977)
Commits
-------

3939c90 [FrameworkBundle] Fix TraceableEventDispatcher unable to trace static class callables

Discussion
----------

[FrameworkBundle] Fix TraceableEventDispatcher unable to trace static class callables

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-18 16:51:19 +02:00