Commit Graph

6622 Commits

Author SHA1 Message Date
Fabien Potencier
b6ef87f68e updated CHANGELOG for 2.0.4 2011-10-04 13:46:16 +02:00
Fabien Potencier
f172547d84 updated vendors for 2.0.4 2011-10-04 13:43:49 +02:00
Fabien Potencier
92d19063a8 [Translation] changed some unit tests for PHPUnit 3.6.0 compatibility 2011-10-04 08:43:04 +02:00
Fabien Potencier
cf4a91e923 [ClassLoader] fixed usage of trait_exists() 2011-10-03 18:02:59 +02:00
Fabien Potencier
8d6add638b [DoctrineBridge] fixed directory reference when the directory cannot be created 2011-10-03 08:58:15 +02:00
Fabien Potencier
ee375ae412 merged branch dpb587/patch-appkern (PR #2312)
Commits
-------

5419638 [HttpKernel] Show the actual directory needing to be created.

Discussion
----------

[HttpKernel] Show the actual directory needing to be created.

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

before: Unable to create the logs directory (/home/symfony/root/app)
after: Unable to create the logs directory (/home/symfony/root/app/logs)
2011-10-03 08:57:14 +02:00
Danny Berger
54196382b7 [HttpKernel] Show the actual directory needing to be created. 2011-10-03 02:08:17 -04:00
Fabien Potencier
6295e55329 [DoctrineBundle] made the previous fix only available in the development environment 2011-09-30 18:10:34 +02:00
Fabien Potencier
87416b4756 [DoctrineBundle] tweaked previous merge 2011-09-30 18:08:38 +02:00
Fabien Potencier
4790a5e43f merged branch Gregwar/proxy_file_issue (PR #1968)
Commits
-------

0e00e3f [DoctrineBundle] CS
0c4b793 [DoctrineBundle] Fixed performances issues on "On-demand" proxy file generation
e866a67 [DoctrineBundle] Tries to auto-generate the missing proxy files on the autoloader

Discussion
----------

[DoctrineBundle] Tries to auto-generate the missing proxy files on the autoloaded

See:
https://github.com/symfony/symfony/issues/1965
https://github.com/symfony/symfony/issues/1535

This fix is not really clean and there's maybe a factorizing work to do on it, but this work and avoid me spending my day deleting session cookies each time I clear cache.

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

by stloyd at 2011/08/23 10:37:28 -0700

You should follow Symfony2 CS (http://symfony.com/doc/current/contributing/code/standards.html).

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

by ruudk at 2011/09/26 02:50:13 -0700

+1

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

by fabpot at 2011/09/27 07:01:51 -0700

It looks like a bug fix, so this PR should be closed and a new one based on the 2.0 branch should be open. @beberlei: are you fine with this patch?

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

by beberlei at 2011/09/29 04:24:22 -0700

What is this for? I dont understand the bug and the solution here screams cache slam.

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

by beberlei at 2011/09/29 04:34:02 -0700

Ok i get the problem but the solution is still a monsterous hack. Can we find a real solution to the problem? There has to be one.

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

by Gregwar at 2011/09/29 04:34:25 -0700

@beberlei, when an user is authenticated for instance, there can be proxies serialized in session.

Si if you clear the cache in dev environment you'll get an error because the matching proxy classes won't exist and you'll be forced to clear your cookies and reauth, which can be annoying

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

by Gregwar at 2011/09/29 04:38:45 -0700

@beberlei, yes, I agree that we should do something more elegant, but the problem is that when PHP "meet" the proxy class we can't really know what was the "original" class it is supposed to extend

And as @schmittjoh said, this will only be executed very rarely

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

by beberlei at 2011/09/29 05:18:35 -0700

You agree you want something more suitable and still want this to be merged?

To ease the immediate pain wr could allow this however only in debug mode. A real solution here is maybe to move the proxy files out of the env folders. Rhey dont depend ont the env after all.

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

by stloyd at 2011/09/29 05:21:33 -0700

Proxy is not depending on env, but generation of proxy is... So this solution will be hard IMO, or even unacceptable...

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

by Gregwar at 2011/09/29 05:25:39 -0700

@beberlei what I meant is that I agree that's dirty but I don't think of anything better to solve this...

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

by fabpot at 2011/09/29 06:23:03 -0700

Even if the current patch is not the best solution, we should probably apply it to fix the problem and think about a better solution afterwards. Does it sound good for everybody?
2011-09-30 18:07:40 +02:00
Fabien Potencier
5c8a2fb48d [Routing] fixed route overriden mechanism when using embedded collections (closes #2139) 2011-09-30 12:01:46 +02:00
Fabien Potencier
245d57ac76 merged branch dpb587/patch-monoweb (PR #2296)
Commits
-------

e70c884 [Bridge/Monolog] Fix WebProcessor to accept a Request object.

Discussion
----------

[Bridge/Monolog] Fix WebProcessor to accept a Request object.

WebProcessor.php is type hinting a bad interface. Adds a simple test case.

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

Before:

    1) Symfony\Tests\Bridge\Monolog\Processor\WebProcessorTest::testUsesRequestServerData
    Argument 1 passed to Symfony\Bridge\Monolog\Processor\WebProcessor::__construct() must be an instance of Symfony\Bridge\Monolog\Processor\RequestInterface, instance of Symfony\Component\HttpFoundation\Request given, called in ./symfony/vendor/symfony/tests/Symfony/Tests/Bridge/Monolog/Processor/WebProcessorTest.php on line 31 and defined

    ./symfony/vendor/symfony/src/Symfony/Bridge/Monolog/Processor/WebProcessor.php:24
    ./symfony/vendor/symfony/tests/Symfony/Tests/Bridge/Monolog/Processor/WebProcessorTest.php:31

    FAILURES!
    Tests: 1, Assertions: 0, Errors: 1.

After:

    Starting test 'Symfony\Tests\Bridge\Monolog\Processor\WebProcessorTest::testUsesRequestServerData'.
    OK (1 test, 3 assertions)

Global:

    OK, but incomplete or skipped tests!
    Tests: 4337, Assertions: 10590, Incomplete: 36, Skipped: 23.
2011-09-30 08:30:29 +02:00
Danny Berger
e70c884f49 [Bridge/Monolog] Fix WebProcessor to accept a Request object. 2011-09-30 01:58:45 -04:00
Fabien Potencier
e6867bb2e0 [SwiftmailerBundle] added swiftmailer dependency in composer.json 2011-09-29 17:42:52 +02:00
Fabien Potencier
5c760b0d40 merged branch igorw/composer (PR #2275)
Commits
-------

731b28b [composer] add missing deps for FrameworkBundle
9c8f100 [composer] change ext/intl to the new ext-intl syntax
d535afe [composer] fix monolog-bridge composer.json, add more inter-component deps
9ade639 [composer] add composer.json

Discussion
----------

Composer

This PR adds a composer.json file for [composer](https://github.com/composer/composer) ([more info](packagist.org/about-composer)).

For discussion you can also go into #composer-dev on freenode and argue with naderman, seldaek and everzet.

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

by naderman at 2011/09/26 15:51:51 -0700

You haven't entered any keywords, they might come in handy when searching for packages on packagist.

But really this is just a +1 ;-)

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

by stof at 2011/09/26 16:12:21 -0700

See my comments on your previous (non-rebased) commit: f1c0242b5a

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

by igorw at 2011/09/27 00:04:36 -0700

Following dependencies do not have a composer.json yet: Twig, Doctrine (orm, dbal, common), swiftmailer.

Also missing from the standard edition: assetic, twig-extensions, jsm-metadata, SensioFrameworkExtraBundle, JMSSecurityExtraBundle, SensioDistributionBundle, SensioGeneratorBundle, AsseticBundle.

The point is, those can be added later on. Having the components composerized is already a leap forward. Also, doctrine depends on some symfony components, we've got to start somewhere.

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

by Seldaek at 2011/09/27 00:36:41 -0700

Also, just for information, the plan is to have `symfony/framework-bundle` be the "framework", with all dependencies to doctrine etc, though we should really only have strict requirements in there, and then in symfony-standard we ship a composer.json that requires the framework-bundle, doctrine-orm and things like that that are not essential to core. Otherwise people don't have a choice about what they use anymore.

Just a comment btw, the json is invalid, all / should be escaped. However json_decode is nice enough to parse those without complaining, browsers do too, even Crockford's json2.js does, so I'm not sure if we should privilege readability over strictness, since it seems nobody really cares about this escaping.

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

by igorw at 2011/09/27 00:41:39 -0700

So, I've implemented all of @stof's suggestions, except (for reasons stated above):

* doctrine to DoctrineBundle
* swiftmailer to SwiftmailerBundle
* twig to TwigBundle
* doctrine-common to Validator
* FrameworkBundle (what exactly does it depend on?)

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

by stof at 2011/09/27 00:52:31 -0700

@igorw at least HttpKernel, Routing, Templating, EventDispatcher, Doctrine Common (annotations cannot be disabled), Translator, Form (optional), Validator (optional), Console (optional). See the service definitions to see the others

@Seldaek FrameworkBundle does not depend on Doctrine, except for Common

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

by beberlei at 2011/09/27 03:15:34 -0700

What does the symfony/ or ext/ prefix control in composer?

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

by Seldaek at 2011/09/27 03:33:52 -0700

symfony/ is just the (mandatory) vendor namespace. Also ext/ has been renamed to ext- now, so it's not in any vendor, and should avoid potential issues.

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

by beberlei at 2011/09/27 05:07:03 -0700

@Seldaek Mandatory? So every package name is "vendor/package"? I like that because previously i thought package names are not namespaced, and thus clashes could occur between different communities easily.

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

by Seldaek at 2011/09/27 05:16:20 -0700

@beberlei: Mandatory. As of yesterday http://packagist.org/ will tell you you have an invalid package name if there's no slash in it. See 1306d1ca82 (diff-3)
2011-09-29 17:27:38 +02:00
Fabien Potencier
600b8ef5af [Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed 2011-09-29 16:15:57 +02:00
Fabien Potencier
d429594afb removed separator of choice widget when the separator is null 2011-09-29 10:14:34 +02:00
Fabien Potencier
17af13813a fixed usage of LIBXML_COMPACT as it is not always available 2011-09-28 21:54:54 +02:00
Christophe Coevoet
9e438128fa Fixed the phpdoc 2011-09-28 17:21:22 +03:00
Fabien Potencier
6eeca8e36d merged branch stealth35/fix_2142 (PR #2290)
Commits
-------

b12ce94 [HttpFoundation] fix #2142 PathInfo parsing/checking

Discussion
----------

[HttpFoundation] fix #2142 PathInfo parsing/checking

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 15:02:56 +02:00
stealth35
b12ce94c38 [HttpFoundation] fix #2142 PathInfo parsing/checking
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 13:18:44 +02:00
Fabien Potencier
b4028350d2 [HttpFoundation] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:50 +02:00
Fabien Potencier
128468193f [BrowserKit] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:26 +02:00
Fabien Potencier
1e7e6ba305 [HttpFoundation] removed the possibility for a cookie path to set it to null (as this is equivalent to /) 2011-09-28 10:34:14 +02:00
Fabien Potencier
ffdd6670a6 merged branch Seldaek/clearcookie (PR #1889)
Commits
-------

908a7a3 [HttpFoundation] Fix bug in clearCookie/removeCookie not clearing cookies set with a default '/' path, unless it was explicitly specified

Discussion
----------

[HttpFoundation] Fix bug in clearCookie/removeCookie not clearing cookies

[HttpFoundation] Fix bug in clearCookie/removeCookie not clearing cookies set with a default '/' path, unless it was explicitly specified

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

by Seldaek at 2011/08/02 10:31:44 -0700

The reason is that Cookie::__construct defaults to '/' btw, so if you don't specify it, and then call clearCookie without specifying again, the paths don't match.

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

by Koc at 2011/08/07 00:06:13 -0700

I think that correctrly use base path. Is it possible?

For example we have 2 apps
* site.com/app1/index.php
* site.com/app2/index.php
and app2 will remove cookies of app1

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

by Seldaek at 2011/08/07 02:58:10 -0700

IMO if people want that they should specify the path manually, by default cookies are always set for the entire host and I think it should stay like that.

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

by Koc at 2011/08/07 04:26:47 -0700

It is hard to specify path manually everywhere when set/remove cookies.

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

by Seldaek at 2011/09/27 07:01:43 -0700

@fabpot: ping? You said this was ok, but it was never merged.
2011-09-28 10:32:01 +02:00
Fabien Potencier
94940fe310 Merge remote-tracking branch 'pulzarraider/patch-5' into 2.0
* pulzarraider/patch-5:
  Fix for {@inheritdoc} phpDoc tag.
2011-09-28 10:03:46 +02:00
Andrej Hudec
5c060d15e9 Fix for {@inheritdoc} phpDoc tag. 2011-09-28 10:00:17 +03:00
Fabien Potencier
2db24c264f removed time limit for the vendors script (closes #2282) 2011-09-28 08:30:05 +02:00
Igor Wiedler
731b28bb92 [composer] add missing deps for FrameworkBundle 2011-09-27 20:03:59 +02:00
Fabien Potencier
c13b4e2b55 fixed fallback catalogue mechanism in Framework bundle 2011-09-27 17:18:11 +02:00
Igor Wiedler
9c8f100c11 [composer] change ext/intl to the new ext-intl syntax 2011-09-27 12:35:30 +02:00
Fabien Potencier
122a352003 merged branch drak/patch-2 (PR #2278)
Commits
-------

d375b6d Corrected docblock, quoted types were incorrect.

Discussion
----------

Patch 2

Update docblock to show correct property types.
2011-09-27 09:54:09 +02:00
Fabien Potencier
0b505ffee0 merged branch Exercise/assets-helper-scope-2 (PR #2223)
Commits
-------

6555e28 Remove unnecessary use statement
369f181 [FrameworkBundle] Add request scope to assets helper only if needed
d6b915a [FrameworkBundle] Assets templating helper does not need request scope

Discussion
----------

[FrameworkBundle] Assign request scope to assets helper only if needed

**Note**: This PR replaces #2218

I traced this request scope addition back to [an old commit](d9f5c99fab (commitcomment-597654)) from @kriswallsmith.

No other helpers have request scope and the assets helper's parameters don't appear to depend on the request in any way, so this appears to be unnecessary. As-is, request scope here prevents use of the assets helper from a console command that may need to internally render a template.

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

by fabpot at 2011/09/20 08:10:48 -0700

There is probably a reason why it was set to the request scope (just run the unit tests ;)).

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

by jmikola at 2011/09/20 08:22:46 -0700

Doh! Didn't even think to do that for such a small change.

I will investigate further. Do you have any idea how one can generate templates (which call the `asset()` function) during a console script?

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

by fabpot at 2011/09/20 08:33:22 -0700

Apparently, something depends on the Request somewhere. We need to find what needs the Request and determine if this is legitimate or not.

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

by henrikbjorn at 2011/09/20 09:25:05 -0700

https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Templating/Asset/PathPackage.php#L33

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

by jmikola at 2011/09/20 10:40:23 -0700

Thanks @henrikbjorn. So, it appears the default behavior of the asset helper is to use the request path as the base URL for assets. In my particular case, I didn't get this scope-widening exception at runtime because I use `assets_base_urls`, which results in the request-independent UrlPackage being injected instead of PathPackage.

This is tricky. I think there's definitely a use case for folks rendering templates outside of a request. Sending HTML emails via some console command is perhaps the most common example. Also, if those developers are not using a CDN, they likely won't think of using `assets_base_urls` at all. Unfortunately, that appears to be the only configuration option where the site's domain is specified (outside of, say, a session domain).

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

by lsmith77 at 2011/09/20 10:45:42 -0700

So do we need 2 services?

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

by jmikola at 2011/09/20 10:52:02 -0700

Well, we actually already have two services. I think that's why PathPackages and UrlPackages are distinct. The issue is that the asset helper has been assigned the request scope to accommodate to satisfy the most restrictive possibility.

I don't think two separate asset helpers would help the developer, even if it'd let us get passing tests.

Also, there is a very real use case here that I wasn't struggling with. You want to render templates with asset paths outside of a request (from a console command). In that case, you need a base URL, but where do you get that from?

Has anyone else encountered that requirement? I know we definitely did at OpenSky, and now at Exercise.com.

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

by jmikola at 2011/09/22 20:14:37 -0700

Had a chat with @kriswallsmith today. We brainstormed and came up with the idea of simply adding `strict="false"` to the request arguments of these templating services. That would disable the premature scope exception, but lead to different kind of error if the user attempted to call `asset()` when using a PathPackage (no `asset_base_urls` and no UrlPackage in play).

The PathPackage class in the templating component obviously has no request dependency -- just the FrameworkBundle version. I started modifying FrameworkBundle's PathPackage to make the Request usage optional (if it's not available, an empty base path is provided to the parent constructor, which actually works fine).

In the course of implementing that, I made the request argument `strict="false" on-invalid="null"` and encountered some strange behavior (possibly a bug) where the PathPackage service generated in FrameworkExtension via the DefinitionDecorator was not inheriting the strict/invalid properties. If I removed `on-invalid="null", strictness was inherited just fine. I'm going to continue looking into this, but at this point it seems like that may be a separate PR if it is, indeed, a bug.

Just going to paste my chat transcript with Kris here for some extra context:

```
<jmikola> if you have a moment later, could you chime in on https://github.com/symfony/symfony/pull/2223 ?
<jmikola> it's about using the asset() helper from a console command
<jmikola> i could have sworn we were sending emails like this in opensky, from console commands
<jmikola> doing the same thing for exercise, but the request scope on the asset helper is a cog in the gear
<kris>    you don't have base urls configured?
<jmikola> we do
<jmikola> but the service is request-scoped because it doesn't know until runtime if it will be using UrlPackage or PathPackage
<jmikola> and PathPackage depends on the request object
<kris>    yeah, it's tricky
<jmikola> so i think the scope was added to handle the most restrictive case
<jmikola> no way around that except to remove the scoping at runtime i suppose
<kris>    we can tweak the scope in a compilation pass
<kris>    but that could create some wtfs
<jmikola> why?
<jmikola> because some asset() calls might specify a package name?
<jmikola> without base_url's?
<kris>    what about setting strict to false?
<jmikola> i haven't played with package names but i think that's how it works
<jmikola> ah, what's the problem with that again? i know it disables the exception
<jmikola> but if strict is false, what's the benefit of having request scope at all?
<kris>    there are a lot of instances of strict="false" in the core
<jmikola> if strict is false, the scope becomes just documentation?
<jmikola> i'm drawing a blank on how that works - i just know strictness turns on the exceptions for widening violations
<kris>    right
<kris>    it means that helper would no longer be in the request scope, even though it uses a service from the request scope
<kris>    i think that would be fine
<jmikola> ah, strict=false goes on the service argument
<jmikola> does that mean we'd apply that to the definition of templating.asset.path_package ?
<kris>    yes
<jmikola> or just when PathPackage becomes an argument to the helper?
<jmikola> ok
<kris>    whatever uses the request
<jmikola> and this would still cause havoc if I didn't define base_urls and tried to call asset() :)
<jmikola> i suppose in the form of null passed when Request instance expected?
<jmikola> or worse, undefined service request
<kris>    right...
<jmikola> ok
<kris>    so maybe we need a way to manually define the base path
<jmikola> for PathPackage
<kris>    right, i think that's what's in the component
<jmikola> UrlPackage only comes into play if there's 1 or more assets_base_urls defined, right?
<kris>    right
<jmikola> i'm looking at it, and am curious what happens if it was constructed with no base urls :)
<jmikola> since there's no checks that the array is full
<jmikola> *non-empty
<jmikola> ah, if it's empty it uses '' as the base Url
<jmikola> Perhaps PathPackage in FrameworkBundle could make the request optional
<jmikola> the core PathPackage does support an empty baseUrl
<jmikola> $basePath rather
<jmikola> it uses "/" by default
<kris>    how about a configurator that calls setBasePath() if the container includes a request?
<jmikola> then the service would still need to be request scoped, no?
<jmikola> what it the same service was used on multiple requests
<jmikola> thinking of those trendy php app servers :)
<kris>    the service wouldn't use the request
<kris>    the configurator would
<kris>    but via dic injection
<jmikola> do configurators exist?
<jmikola> i don't think i've seen one, a class with that name is in the DistributionBundle though - probably different
<kris>    you can define a configurator on a service
<jmikola> example? is this done via tags?
<kris>    it's a callable that will be passed the service before it leaves the container for the first time
<jmikola> so the PathPackage base class in the Templating component has a private basePath, it'd need a setBasePath method added of course
<kris>    yeah, that's fine
<jmikola> ah <configurator
<jmikola> can't believe i've never seen this before
<kris>    it's an old feature
<kris>    and you can only set one for some reason
<jmikola> woah, it's only in test fixtures
<jmikola> nothing actually uses it
<jmikola> yet :)
<jmikola> configurators receive the container as their only argument?
<jmikola> oh, no arguments at all
<kris>    they receive the service
<kris>    but a configurator can be a service itself
<kris>    i would add a base path node to the config
<kris>    and disallow using both base path and base urls
<kris>    and only use the configurator if the base path isn't explicitly set
<jmikola> now, in this case i'd have the configurator for the PathPackage service be another service that depends on request
<kris>    no
<kris>    the configurator should depend on the container
<kris>    check if there is a request service and use it to set the base path if so
<jmikola> ok, and it's responsible for $pathPackage->setBaseUrl($request->getBasePath()) if the request exists
<jmikola> right
<kris>    setBasePath
<jmikola> correct, sorry
<jmikola> i think a base_path and base_url can co-exist
<jmikola> base_url will entail use of the UrlPackage
<jmikola> and base_path is simply the default value for PathPackages
<jmikola> in the absence of the request
<kris>    i don't follow
<jmikola> a base_url option in the config would simply be for the case where PathPackage is utilized outside of a request scope (i.e. console command)
<jmikola> sorry, base_path***
<jmikola> assets_base_url is for UrlPackages
<kris>    right
<jmikola> ok, so you're saying at the top level, or in the packages prototypes, we'd allow only one or the other
<jmikola> at present, there's only asset_base_url's, so that implies configurations creating only UrlPackages
<kris>    add a validation to the Configuration class so you have to choose one or the other
<kris>    i don't understand why you would need base_path from the cli
<jmikola> so in this case, absence of either will result in a PathPackage configured based on the current request
<kris>    don't you need absolute urls in your emails?
<kris>    i'm rethinking
<jmikola> yes, we're using UrlPackages of course
<jmikola> but the request scope ruined this for me
<kris>    don't bother with base_path in the config
<kris>    just do the configurator
<jmikola> there's still a possibility that someone would generate HTML for on-site use from a console command
<jmikola> perhaps pre-building twig templates or something
<jmikola> your idea made sense i think
<jmikola> even if it's an edge case
<jmikola> granted, most people are perfectly fine with "/" as a default base_path in the absence of a request
<kris>    that would be another pr
<jmikola> right
<jmikola> then for now, what about just making the request argument on-invalid null?
<jmikola> and changing PathPackage in the bundle
<jmikola> PathPackage in the component already handles an empty base path itself just fine
<kris>    yeah, that's better
<jmikola> on-invalid="null" and strict="false"
<kris>    nice
<jmikola> i'm satisifed with the simplicity of that
<jmikola> and will comment about your base_path option idea in my PR for a future task when i get around to it - as that sounded great as well
<jmikola> thanks for talking through this w/ me :)
<kris>    np
<jmikola> PackageFactory is the new roadblock, heh
<jmikola> getPackage() { return $this->container->get($request->isSecure() ? $sslId : $httpId); }
<jmikola> :D
<kris>    oh yeah
<jmikola> should i utilize the same logic? default to non-ssl?
<jmikola> i'm actually curious how gmail handles references to http:// assets embedded in its emails
<jmikola> i suppose it renders message bodies in iframes
<kris>    then it would be impossible to render https asset urls without a request
<jmikola> wouldn't it default to the http url?
<kris>    right
<kris>    but what if you only have https base urls configured?
<jmikola> if you break them into http and https blocks, it'd be a problem
<kris>    i think it always uses https if you only have https urls configured
<jmikola> otherwise, the shorthand notation sorts them for you
<jmikola> and all https urls are available to http
<jmikola> ah, you're correct
<jmikola> FrameworkExtension::createPackageDefinition
```

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

by jmikola at 2011/09/26 10:39:00 -0700

@fabpot: I believe I reached an agreeable solution, so please review when you get a chance.

I removed any `strict` and `on-invalid` trickery (ideas I was discussing with Kris) and decided to only apply request scoping to the assets helper if one or more of its injected packages (default or named) is request scoped.

This satisfies my requirements, as I had absolute base URL's defined for both HTTP and SSL protocols. It also leaves the current scope exceptions in place if, for instance, someone only defined an HTTP base URL and FrameworkBundle ended up creating a PathPackage for their SSL assets. I go into detail about this more in my second commit, and I think the added tests help explain this as well.

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

by jmikola at 2011/09/26 16:56:30 -0700

Something screwed up earlier and this PR's branch included all commits in `symfony/master`. I just cleaned things up.
2011-09-27 09:52:20 +02:00
Drak
d375b6d00e Corrected docblock, quoted types were incorrect. 2011-09-27 13:34:25 +05:45
Igor Wiedler
d535afeb98 [composer] fix monolog-bridge composer.json, add more inter-component deps 2011-09-27 09:33:21 +02:00
Jeremy Mikola
6555e28d57 Remove unnecessary use statement 2011-09-26 19:54:19 -04:00
Jeremy Mikola
369f181005 [FrameworkBundle] Add request scope to assets helper only if needed
Builds upon aead4a9836180cabae4d47fe27c634dcd79ac8f2, which prematurely removed request scoping from the assets templating helper in all cases. The helper need only be request-scoped if one or more request-scoped packages (e.g. PathPackages) are injected into it. This change makes it possible to utilize the assets helper outside of a request (e.g. during a console script).

To ensure that the assets helper is not assigned a request scope, all asset base URL's must be defined for all packages (default and any named) and both protocols: HTTP and SSL. The included test config fixtures concisely accomplish this by specifying a single HTTPS URL as the base URL for our default and named package, since FrameworkExtension's Configuration conveniently registers this URL for both protocols.
2011-09-26 19:54:12 -04:00
Jeremy Mikola
d6b915a174 [FrameworkBundle] Assets templating helper does not need request scope
No other helpers have request scope and the assets helper's parameters don't appear to depend on the request in any way, so this appears to be unnecessary. As-is, request scope here prevents use of the assets helper from a console command that may need to internally render a template.
2011-09-26 19:54:05 -04:00
Igor Wiedler
9ade639bb4 [composer] add composer.json 2011-09-27 00:55:43 +02:00
Laurent Bachelier
72e82eb595 Replace deprecated key_exists alias
From the PHP manual of array_key_exists:
    For backward compatibility, the following deprecated alias
    may be used: key_exists().
2011-09-27 00:06:04 +02:00
Marcin Chylek
ed02aa9974 Fix console: list 'namespace' command display all available commands 2011-09-27 00:05:57 +02:00
Dan Patrick
decfe9eb5c Corrected grammar in FilterControllerEvent comments 2011-09-27 00:05:39 +02:00
Fabien Potencier
0bd1f15923 merged branch Yrwein/class_loader_trait_exists (PR #2257)
Commits
-------

85ed5c6 [ClassLoader] Fixed state when trait_exists doesn't exists

Discussion
----------

[ClassLoader] Fixed state when trait_exists doesn't exists

Just for consistency of throwing exceptions in the ClassCollectionLoader. (An exception would be thrown in the next step by the ReflectionClass.)
2011-09-26 23:48:27 +02:00
Josef Cech
85ed5c67dc [ClassLoader] Fixed state when trait_exists doesn't exists 2011-09-25 19:25:50 +02:00
Fabien Potencier
369d4da4eb bumped Symfony version to 2.0.3-DEV 2011-09-25 11:51:38 +02:00
Fabien Potencier
6a25df0ebf updated VERSION for 2.0.3 2011-09-25 11:51:12 +02:00
Fabien Potencier
eb8de85ea5 updated CHANGELOG for 2.0.3 2011-09-25 11:50:40 +02:00
Fabien Potencier
49c585ebd2 Revert "merged branch stealth35/ini_bool (PR #2235)"
This reverts commit 363057b181, reversing
changes made to 545cd4cd63.
2011-09-25 11:33:22 +02:00
Fabien Potencier
fa13469bba Revert "[DependencyInjection] fixed array support for the ini loader"
This reverts commit e0ace8eaee.
2011-09-25 11:33:07 +02:00
Fabien Potencier
27fc06785b Revert "[DepedencyInjection] fixed unit tests"
This reverts commit b8e5a155e4.
2011-09-25 11:33:00 +02:00