While Definition::getArgument() could be used to fetch replaced values, it relied upon bad comparison logic (e.g. "index_1" > 1). Additionally, storing original arguments and replacements in the same array makes Definition::getArguments()'s bounds check unreliable. A single argument and its replacement would count twice, allowing getArgument(2) to pass the bounds check and result in an array index error.
With this new method, fetching of replacement arguments is more straightforward and bounds checking functions as it should.
Commits
-------
d3f137b cosmetic tweak
2877883 anything in front of ;q= is part of the mime type, anything after may be ignored
Discussion
----------
[HttpFoundation] fix splitHttpAcceptHeader() parsing of parameters
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
anything in front of ;q= is part of the mime type, anything after may be ignored
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
---------------------------------------------------------------------------
by lsmith77 at 2011/10/09 04:00:12 -0700
i must admit .. i am not 100% that my implemention is correct either .. but i am sure the current one isn't.
---------------------------------------------------------------------------
by lsmith77 at 2011/10/09 07:57:33 -0700
@fabpot: I am also not sure if getFormat() should optionally not support matching parameters, aka anything before ``;q=..``
Commits
-------
0907111 session data needs to be encoded because it can contain non binary safe characters e.g null. Fixes#2067
Discussion
----------
session data needs to be encoded because it can contain non binary safe characters e.g null., part 2
Bug fix: yes
Feature addition: no
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #2067
I'm marking this as a compatibility break because session table should be cleared and even if not cleared all currently logged in users will be logged out.
This is the fix for a same issue in DBAL session storage made against master.
---------------------------------------------------------------------------
by schmittjoh at 2011/10/12 02:44:19 -0700
If I understand this correctly, only the PgSqlPlatform is affected by this. What do you think about adding an ``ìnstanceof PgSqlPlatform`` check?
---------------------------------------------------------------------------
by mvrhov at 2011/10/12 03:47:52 -0700
It's the same for sqlite, it just happens that mysql escapes \0, so we can say it's driver dependent.
The Drupal guys had the same issue http://drupal.org/node/690746 , they changed to column type to bytea for pgsql and for mysql to blob, also in Drupal report you can find that storing this into a session hash_file('md5', 'CHANGELOG.txt', TRUE) will trigger the similar problem in mysql.
The other thing to consider is what I mentioned in original bugreport, e.g igbinary as default serializer for session data.
Commits
-------
edfa29b session data needs to be encoded because it can contain non binary safe characters e.g null. Fixes#2067
Discussion
----------
session data needs to be encoded because it can contain non binary safe characters e.g null.
Bug fix: yes
Feature addition: no
Backwards compatibility break: yes
Symfony2 tests pass: yes
Fixes the following tickets: #2067
I'm marking this as a compatibility break because session table should be cleared and even if not cleared all currently logged in users will be logged out.
---------------------------------------------------------------------------
by mvrhov at 2011/10/11 12:52:25 -0700
P.S. I know there was a talk about doctrine based session storage but I cannot find this in core. It probably has the same problem.
---------------------------------------------------------------------------
by eventhorizonpl at 2011/10/11 14:34:08 -0700
Thanks for tracking down and fixing this issue!
Best regards,
Michal
---------------------------------------------------------------------------
by stof at 2011/10/11 16:24:18 -0700
@mvrhov The Doctrine based storage is only available in master, not in 2.0
Commits
-------
c46fe16 Adding "sf-toolbar" class to toolbar wrapper to make it possible to check for its existance prior to js instantiation (in order to change page layout when profiler toolbar is enabled)
Discussion
----------
[WebProfilerBundle] Adding "sf-toolbar" class to toolbar wrapper to make it possible to check
Adding "sf-toolbar" class to toolbar wrapper to make it possible to check for its existance prior to js instantiation (in order to change page layout when profiler toolbar is enabled)
Commits
-------
808088a added the ability to use dot and single quotes in the keys and values
Discussion
----------
[2.0][Bugfix][DependencyInjection] added the ability to use dot and single quotes in the keys and values
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
We can not set a specific combination of dots and single quotes in the values and keys of the arguments. I.E.
```xml
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/serviceshttp://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="key_escaper" class="MyNamespace\MyClass">
<call method="setCollection">
<argument type="collection">
<argument key="only dot">.</argument>
<argument key="concatenation as value">.''.</argument>
<argument key="concatenation from the start line">''.</argument>
<argument key=".">is the same problem for the keys?</argument>
</argument>
</call>
</service>
</services>
</container>
```
As a result we have such a dump:
```php
<?php
class appDevDev_formapro1DebugProjectContainer extends Container
{
protected function getKeyEscaperService()
{
$this->services['key_escaper'] = $instance = new \MyNamespace\MyClass();
$instance->setCollection(array('only dot' => , 'concatenation as value' => '.\'\, 'concatenation from the start line' => '\'\, => 'is the same problem for the keys?'));
return $instance;
}
}
```
Commits
-------
27d0809 [MonologBridge] Adjust for Monolog 1.0.2
Discussion
----------
[MonologBridge] Adjust for Monolog 1.0.2
This is BC, it just turns off headers in browsers that don't have Firebug, I have had problems in IE with more than 150 log entries just crashing the page.
Commits
-------
6b872cf Check if cache_warmer service is available before doing the actual cache warmup
Discussion
----------
fix cache warump exception when service is not available
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A
fixes [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
You have requested a non-existent service "cache_warmer". in console when FrameworkBundle is removed from kernel.
Commits
-------
6b872cf Check if cache_warmer service is available before doing the actual cache warmup
40fb76d [Framework] removed wrong listener
Discussion
----------
fix cache warump exception when service is not available
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A
fixes [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
You have requested a non-existent service "cache_warmer". in console when FrameworkBundle is removed from kernel.
Commits
-------
96235a6 cs fix
46a69f1 define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes#2422. combining routers will only really work when #2450 is merged too.
Discussion
----------
define a WarmableInterface and only warm the cache if it implements warmable
define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes#2422. combining routers will only really work when #2450 is merged too.
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes*
Fixes the following tickets: #2422
(*) tests:
success for
phpunit src/Symfony/Bundle/FrameworkBundle/Tests/
and
phpunit tests/Symfony/Tests/Component/Routing/
but when running all tests, i have to put gc_disable() into autoload to avoid segmentation fault and then get (after 3000 successful tests):
PHP Fatal error: Call to undefined method Symfony\Tests\Component\HttpKernel\Debug\StopwatchTest::assertCount() in /home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony/tests/Symfony/Tests/Component/HttpKernel/Debug/StopwatchTest.php on line 84
---------------------------------------------------------------------------
by stof at 2011/10/22 08:46:31 -0700
@dbu assertCount is new in PHP 3.6. It seems like the test of the new 2.1 feature has been written using 3.6-RC.
---------------------------------------------------------------------------
by dbu at 2011/10/22 09:40:07 -0700
@stof: ah, thanks for the hint. i hope you mean php 3.4 and not 3.6? but i assume symfony 2.1 should be able to run on 3.3, right?
anyways, the tests run through if i disable the StopWatch, so i guess we can consider the tests succeeding.
---------------------------------------------------------------------------
by stof at 2011/10/22 09:41:28 -0700
this is a method of PHPUnit TestCase class. I was talking about the PHPUnit version
Commits
-------
6b02ffb fix a typo in the routing dependency injection configuration. the request_context service is named router, not routing
Discussion
----------
fix a typo in the routing dependency injection configuration
fix a typo in the routing dependency injection configuration. the request_context service is named router.request_context , not routing.request_context
Bug fix: yes
Feature addition: no
Backwards compatibility break: ? - should not unless somebody relied on the bug
Symfony2 tests pass: yes
Fixes the following tickets: no ticket
i ran
phpunit src/Symfony/Bundle/FrameworkBundle/Tests/
and
phpunit tests/Symfony/Tests/Component/Routing/
If a request listener returns a response before calling the profiler
listener, the request will not be added in the stack leading to an error
during the handling of the kernel.response event. The profiler listener
should ideally be run first.
That allows projects that only use HttpFoundation and not HttpKernel to be able to
enforce the HTTP specification "rules".
$request = Request::createFromGlobals();
$response = new Response();
// do whatever you want with the Respons
// enforce HTTP spec
$response->prepare($request);
$response->send();
Within Symfony2, the prepare method is automatically called by the ResponseListener.
Commits
-------
ae342c7 unified toolbar.css
a7e4e70 unified profiler.css
09fe09e unified and corrected exception_layout.css
3a1674b unified and corrected exception.css
Discussion
----------
Unified and corrected CSS markup
Unified (spaces, braces, quotes, indention) and corrected (missing semicolon) the CSS markup.
Did not change any semantic, only markup!
@fabpot: New pull based on symfony:2.0 and changed formatting style as agreed in #2405
Commits
-------
1768544 Changed debug output to say Service Id rather than name for the service ids
Discussion
----------
Changed debug output to say Service Id rather than name for the service i
Changed debug output to say Service Id rather than name for the service ids
Commits
-------
9546ee6 Removed the IndexedReader
ea2cf73 Refactored the validator initializer
c6063ec [DoctrineBundle] Updated the code to use the new registry
a1784c2 [DoctrineBridge] Updated the code to use the new registry
Discussion
----------
Doctrine registry
This updates the Doctrine bridge and DoctrineBundle to use the new ManagerRegistry interface and its methods instead of using the old methods which are marked as deprecated.
Commits
-------
18cca22 cleaned up the use statements in the Registry class and RegistryInterface
Discussion
----------
cleaned up the use statements in the Registry class and RegistryInterface
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
just cosmetics ..
Commits
-------
63d2ce2 [FrameworkBundle] Fixed the ckeck for the router class
Discussion
----------
[FrameworkBundle] Fixed the ckeck for the router class
The getRouteCollection method is now part of the RouterInterface so the
command should accept any implementation of the interface instead of just
the implementations extending the core one.
The ORM now supports using a standard reader and does the needed logic
internally.
The IndexedReader is also available in Common for people needing it.
The getRouteCollection method is now part of the RouterInterface so the
command should accept any implementation of the interface instead of just
the implementations extending the core one.
Commits
-------
41ab1f7 updated RegistryInterface for https://github.com/doctrine/common/pull/68
Discussion
----------
[Doctrine] updated RegistryInterface
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
We tweaked the ManagerRegistry interface in https://github.com/doctrine/common/pull/68
So this PR just fixes the RegistryInterface as the PR was merged
Commits
-------
dc5772d use ORM master
4364463 use doctrine-common master
55b572d fixed getting the alias for a namespace
2b89e15 use getObjectNamespace() in getEntityNamespace()
0217a0e updated base class name
e8f3c21 updated vendors to point to lsmith77's fork of doctrine-common until its merged
6e87d01 fix tests
13c2f33 added a default implementation of the ManagerRegistry integrating the container
Discussion
----------
[Doctrine] added a default implementation of the ManagerRegistry
Bug fix: no
Feature addition: yes
Backwards compatibility break: yes (minor change in the interface see below)
Symfony2 tests pass: yes
Fixes the following tickets: -
added a default implementation of the ManagerRegistry integrating the container
attempted to maintain BC as good as possible, but RegistryInterface::getRepository() had to be dropped from RegistryInterface. Its still part of the ManagerRegistry, so its only a BC break for people using RegistryInterface to create their own implementation as I ran into https://bugs.php.net/bug.php?id=43200
all implementation (ORM/ODM) will need to match the changes to the ClassMetadataFactory interface
ORM, PHPCR, CouchDB have been upgraded already.
The Bundles also need to be updated. ORM is covered with this PR, I have a PR ready for PHPCR:
https://github.com/symfony-cmf/symfony-cmf/pull/108
also note that before merging the change to vendors.php needs to be fixed to point to the right repo again
For MongoDB it currently does not yet have a registry and I can take care of CouchDB once this is all merged.
---------------------------------------------------------------------------
by lsmith77 at 2011/09/23 00:40:07 -0700
still a few failing tests and details still need to be discussed ..
---------------------------------------------------------------------------
by lsmith77 at 2011/09/23 00:53:23 -0700
ok .. tests are passing now
---------------------------------------------------------------------------
by lsmith77 at 2011/10/11 10:27:52 -0700
ok Doctrine/ORM updates are done .. PR updated .. ready to be merged.
Commits
-------
1b57727 removed unused use statements
fd67c78 updated implementation to re-use the existing build() method
59e2e97 improves extensibility between bundles
Discussion
----------
[RFC] Improving extensibility between bundles
This is a quick draft for improving extensibility between different bundles.
The idea behind this is that an extension can provide configurable settings that other bundles can change.
---------------------------------------------------------------------------
by Seldaek at 2011/10/07 13:28:13 -0700
I am not yet sure what I would use it for, but I like the idea.
---------------------------------------------------------------------------
by lsmith77 at 2011/10/07 13:45:19 -0700
can you show a bit more how to use this?
---------------------------------------------------------------------------
by lsmith77 at 2011/10/07 13:47:38 -0700
oh it appears this is an example?
f4e76640a0 (diff-9)
---------------------------------------------------------------------------
by schmittjoh at 2011/10/07 13:57:00 -0700
yes
On Fri, Oct 7, 2011 at 10:47 PM, Lukas Kahwe Smith <
reply@reply.github.com>wrote:
> oh it appears this is an example?
>
>
> f4e76640a0 (diff-9)
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2349#issuecomment-2328078
>
---------------------------------------------------------------------------
by schmittjoh at 2011/10/11 01:11:39 -0700
@fabpot, do you have an opinion on this, 👍👎?
Commits
-------
73312ab [Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".
Discussion
----------
[Validator] The Type constraint now accepts the "Boolean" type instead of
[Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
---------------------------------------------------------------------------
by stloyd at 2011/10/11 03:43:24 -0700
As this is bugfix only, this should be made againts __2.0__ branch.
---------------------------------------------------------------------------
by hhamon at 2011/10/11 05:03:52 -0700
@stloyd I don't really know if it's a bug fix or an improvement. We could not use "Boolean" but we could use "boolean" or "bool" only. So that's why I just improved this constraint validator.
* 2.0:
[BrowserKit] fixed cookie updates from Response (the URI here is not the base URI, so it should not be used to determine the default values missing in the cookie, closes#2309)
Commits
-------
ba6bd4b [HttpKernel] Fix the FileProfileStorage, according to the tests
1654473 [HttpKernel] Create a test to outline the problem with file storage
Discussion
----------
[HttpKernel] Fix the file storage
The file storage was not correctly fetching children back.
* First the test showing the problem
* Second the fix to the test
Solution is to add a file for each stored profile file, containing the list of children tokens.
Commits
-------
249164d fixed typos
f4b7805 Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub
4cc1ed0 Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub
6a23e5f fixed typos
5b9d92a Fixed some errors
Discussion
----------
Translation of Framework Bundle in Armenian
fixed some typos
Without this, the exception is eventually thrown in EntityChoiceList::getIdentifierValues() with a very a message that doesn't really suit the real error: "Entities passed to the choice field must be managed"
Commits
-------
f49bbb7 updated
319fd9c Updated the file
0dc8c3f Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub
25d7596 Added 42-48 messages to Armenian translation
Discussion
----------
Armenian Translation (new)
updated armenian translation file for Framework Bundle
Commits
-------
05663ec First
Discussion
----------
Armenian Translation
I added armenian translation to Framework Bundle Validators
---------------------------------------------------------------------------
by stof at 2011/10/08 13:48:31 -0700
Can you do a PR based on the 2.0 branch instead ?
---------------------------------------------------------------------------
by tigranazatyan at 2011/10/08 13:51:03 -0700
I do not have skills using github, please do it yourself:)
The locale management does not require sessions anymore.
In the Symfony2 spirit, the locale should be part of your URLs. If this is the case
(via the special _locale request attribute), Symfony will store it in the request
(getLocale()).
This feature is now also configurable/replaceable at will as everything is now managed
by the new LocaleListener event listener.
How to upgrade:
The default locale configuration has been moved from session to the main configuration:
Before:
framework:
session:
default_locale: en
After:
framework:
default_locale: en
Whenever you want to get the current locale, call getLocale() on the request (was on the
session before).
Commits
-------
3f8e8c9 fixes a session max lifetime handling
3abb7f3 fixed some conflicts with garbage collection
a1888b2 added a dbal session storage
Discussion
----------
Dbal session storage
Adds a session storage based on Doctrine DBAL.
---------------------------------------------------------------------------
by lsmith77 at 2011/09/14 13:39:28 -0700
guess it would be nice to then provide a service inside the DoctrineBundle that reuses a global DoctrineDBAL connection, guess the connection to use would then need to be configured via the doctrine app config.
---------------------------------------------------------------------------
by schmittjoh at 2011/09/14 13:42:34 -0700
I haven't found a sane way to provide automatic configuration that's why I left this to the user to implement. It's also relatively easy:
```yml
services:
dbal_session_storage:
class: Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionStorage
arguments: [@database_connection]
framework:
session: { storage_id: dbal_session_storage }
---------------------------------------------------------------------------
by stof at 2011/09/14 13:57:48 -0700
@lsmith77 There is an issue about reusing another DBAL connection: if the transaction is aborted by the ORM, the session could be aborted too as you cannot have 2 independent transactions AFAIK
---------------------------------------------------------------------------
by lsmith77 at 2011/09/14 13:59:57 -0700
not sure how this is relevant. i mean why does the transaction need to be left open? just begin, write, commit ..
---------------------------------------------------------------------------
by stof at 2011/09/14 14:02:39 -0700
and what if the transaction of the ORM is still opened (let's say you use SimpleThingsTransactionalBundle) ?
---------------------------------------------------------------------------
by lsmith77 at 2011/09/14 14:06:12 -0700
well thats a bit of an edge case imho. also i wonder if SimpleThingsTransactionalBundle shouldn't make sure that its transaction is closed before the session is written.
---------------------------------------------------------------------------
by schmittjoh at 2011/09/14 14:06:56 -0700
It closes them.
On Wed, Sep 14, 2011 at 11:06 PM, Lukas Kahwe Smith <
reply@reply.github.com>wrote:
> well thats a bit of an edge case imho. also i wonder if
> SimpleThingsTransactionalBundle shouldn't make sure that its transaction is
> closed before the session is written.
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2182#issuecomment-2098100
>
---------------------------------------------------------------------------
by stof at 2011/09/14 14:15:02 -0700
@schmittjoh Does it close them **before** writing the session ?
---------------------------------------------------------------------------
by schmittjoh at 2011/09/14 14:44:15 -0700
I think either commit, or rollback is called, but @beberlei can probably answer that better.
Anyway, it is not really related to this PR because it is up to the user which connection is used.
---------------------------------------------------------------------------
by stof at 2011/09/14 14:58:48 -0700
I know that one of them is called. But if they are called after the session is persisted to the DB, a rollback is an issue as it will rollback the session persistence as well.
The PR is indeed fine. What need to be changed is the doc about how to use it, to advocate using a separate connection instead of the default one (which is used in your example)
---------------------------------------------------------------------------
by schmittjoh at 2011/09/15 02:57:34 -0700
There is no doc yet, but lets see what @fabpot thinks of all of this first.
---------------------------------------------------------------------------
by fabpot at 2011/09/15 04:57:57 -0700
Any benefits over using the PDO session storage?
---------------------------------------------------------------------------
by lsmith77 at 2011/09/15 05:00:50 -0700
cleaner code, potentially better support for niche RDBMS, centralized logging and finally afaik DoctrineDBAL has emulation for nested transactions.
---------------------------------------------------------------------------
by schmittjoh at 2011/09/15 05:11:00 -0700
The benefits (for me) are:
- logging queries
- better interoperability with existing build processes (migrations)
- better database interoperability
- re-using existing connection (I don't have the problem that Stof mentioned above)
---------------------------------------------------------------------------
by beberlei at 2011/09/15 06:18:22 -0700
The nested transactions is the problem here as @stof already said. If you reuse the default connection and use nested transactions that fail then this will make your session not save. That is why the docs should recommend you create a second connection for a dbal based session storage, even if it is using the same database. The PDO session storage would be a second connection besides DBAL aswell.
I like the migrations/schema hook though to create the table automatically through schema commands.
---------------------------------------------------------------------------
by fabpot at 2011/09/15 10:45:31 -0700
ok, looks good to me. Can you add some documentation about its usage (like the possible keys for options)? Is it possible to add some tests too?
---------------------------------------------------------------------------
by jdreesen at 2011/09/22 06:34:11 -0700
why did you close this?
---------------------------------------------------------------------------
by schmittjoh at 2011/09/30 06:26:12 -0700
I can't put more time into this PR, however I'm using it for some time already, and there shouldn't be any major issues as it is basically copy/paste from the PDO session.
Commits
-------
8bd0e42 [Form] Use proper parent (text) for EmailType and TextareaType
Discussion
----------
[2.0][Form] Use proper parent (text) for EmailType and TextareaType
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Commits
-------
95049ef [Form] Added type check to `ScalarToChoiceTransformer`
Discussion
----------
[2.0][Form] Added type check to ScalarToChoiceTransformer
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Commits
-------
5473d3b [Translation] Allow use of UTF-8 encoded catalogues into non-UTF-8 applications
deb6dea [Translation] Add failing tests to verify that UTF-8 lang files can't be used with another charset
Discussion
----------
Allow use of UTF-8 catalogues in non-UTF-8 applications
This is #2313 but targetting the master branch.
Bug fix: yes
Feature addition: ?:)
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
The problem I'm having is that, while porting an existing app, we are using UTF-8 everywhere to have a migration path ready, but the current application and DB is still in ISO-8859-1, which means translations containing accented chars are broken.
Also, we didn't hit the issue yet since we don't use forms much, but I imagine we would have similar issues with core translations for the validator which are all UTF-8 encoded.
Note that I explicitly suppressed this conversion in case your application is setup as UTF-8, to make sure most people are not affected by any slow down this introduces.
Commits
-------
8404b35 Updated indonesian translations for trans-unit 47 and 48
Discussion
----------
Updated indonesian translations for trans-unit 47 and 48
Commits
-------
ee0fe7a Added guessers for Size and SizeLength constraints
Discussion
----------
Added guessers for Size and SizeLength constraints
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
---------------------------------------------------------------------------
by jalliot at 2011/09/30 13:40:37 -0700
BTW, I've noticed that some constraints currently don't have guessers in 2.0:
* ``False`` (which could be guessed as a checkbox)
* ``True`` (which could be guessed as a required checkbox)
* ``Choice`` (which could be guessed as a choice type with medium confidence and with the choice list being guessed as the list provided for the constraint)
Are there any reasons why this is not implemented in 2.0 or should I try to make a PR for it?
There is also the ``Collection`` case but I guess it would be too difficult for this one...
Commits
-------
f9b2be9 Added french translation for SizeLength and UserPassword constraints
Discussion
----------
Added french translation for SizeLength and UserPassword constraints
---------------------------------------------------------------------------
by fabpot at 2011/09/30 13:45:46 -0700
47 is already taken for "This value should be the user current password". Should be 48.
---------------------------------------------------------------------------
by jalliot at 2011/09/30 13:59:01 -0700
@fabpot Fixed and added translation for 47 as well.
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/1965https://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?
Commits
-------
3223c5a Removed now useless test
21cf0ac Backported new behaviour from PR #2148 and removed check for interface at run-time
8b240d4 Implementation of kernel.event_subscriber tag for services.
Discussion
----------
Added missing kernel.event_subscriber tag (closes#2012)
This PR adds a ``kernel.event_subscriber`` tag which allows to register services as event subscribers in the same way ``kernel.event_listener`` allows to register them as event listeners.
The service is still lazy loaded and the DIC does not need to be recompiled for every modification in the service's code.
There is one important thing to remember:
If the service is created by a factory, the class parameter **MUST** reflect the real class of the service, although it is not needed at the moment for the DIC. For that issue, we could either forbid services created by factories or add a note to the documentation.
This PR closes#2012.
---------------------------------------------------------------------------
by jalliot at 2011/08/24 06:42:18 -0700
I'm not sure the test is good enough so feel free to add some more.
---------------------------------------------------------------------------
by jalliot at 2011/08/25 03:46:20 -0700
I re-implemented the check for EventSubscriberInterface in ContainerAwareEventDispatcher because I think the overhead is minimum and it allows to use this method even without the tag (at run-time).
I also added some tests for RegisterKernelListenersPass.
---------------------------------------------------------------------------
by stof at 2011/09/04 02:42:00 -0700
@jalliot Your branch conflicts with the current master. could you rebase it ?
---------------------------------------------------------------------------
by jalliot at 2011/09/04 02:57:03 -0700
Rebased
---------------------------------------------------------------------------
by jalliot at 2011/09/13 02:19:46 -0700
@fabpot What do you think about this PR? At the moment, the subscribers are not really usable in Symfony2 because of the lack of this tag.
---------------------------------------------------------------------------
by fabpot at 2011/09/13 04:17:46 -0700
I don't like subscribers. There are other PRs on adding more support for them, but the reality is that they are complex for no added benefit. I'm wondering if it wouldn't be better to just remove them altogether.
---------------------------------------------------------------------------
by jalliot at 2011/09/13 04:38:20 -0700
@fabpot Well I prefer listeners too but I think that if Symfony2 does support subscribers (which it does at the moment), it should do it properly and completely, thus allowing to register subscriber services like here or to register several methods for one same event like in #2148.
But I guess that if you merged those 2 PRs (well actually this one would have to be modified first if #2148 is merged but I'll do it then), many use cases would be covered and people should stop asking for more support :) (except maybe for removing the static modifier but this would be wrong IMO and prevent entirely this PR).
---------------------------------------------------------------------------
by fabpot at 2011/09/28 11:47:10 -0700
@jalliot: #2148 has been merged. Can you update this PR accordingly? thanks.
---------------------------------------------------------------------------
by jalliot at 2011/09/28 12:00:44 -0700
Sure thing. Will do it as well as removing the check for the interface tonight or tomorrow :)
---------------------------------------------------------------------------
by jalliot at 2011/09/29 08:53:17 -0700
@fabpot Check for interface removed and #2148 merged. Also rebased on latest master.
---------------------------------------------------------------------------
by fabpot at 2011/09/29 09:09:11 -0700
Tests do not pass.
---------------------------------------------------------------------------
by jalliot at 2011/09/29 09:18:48 -0700
@fabpot Fixed
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)
* 2.0:
[Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed
removed separator of choice widget when the separator is null
Commits
-------
060d75d [Console] fixed CS and simplified code
a5ff635 [Console] added support for interactive shell without readline extension
Discussion
----------
[2.1] [Console] added support for interactive shell without readline extension
---------------------------------------------------------------------------
by lmcd at 2011/06/30 15:12:56 -0700
Very useful! Pre-installed PHP on OS X ships without readline.
---------------------------------------------------------------------------
by stof at 2011/06/30 15:24:47 -0700
@lmcd You can already use the console, just not the shell.
---------------------------------------------------------------------------
by lmcd at 2011/06/30 15:27:00 -0700
@stof Yep I know, but it would be nice to use the shell :)
---------------------------------------------------------------------------
by hason at 2011/07/01 01:54:34 -0700
@stof Interactive generators will not work on Windows and Mac OS X without these simple changes. I think this is bad news.
---------------------------------------------------------------------------
by Seldaek at 2011/07/01 01:58:59 -0700
Yup, it's definitely a good addition.
---------------------------------------------------------------------------
by Seldaek at 2011/07/01 01:59:26 -0700
@fabpot: I'm not sure why this is tagged 2.1, but IMO this should go in now.
---------------------------------------------------------------------------
by stof at 2011/07/01 01:59:44 -0700
@hason This is not true. The shell is only used when running the console with the ``-s`` option. A command can be interactive without using the shell (I'm on Windows)
---------------------------------------------------------------------------
by lmcd at 2011/07/01 02:08:17 -0700
@stof Yea true, the interactive generators are fine without readline, however I don't think this dependancy should prevent people using the shell on Win/Mac.
---------------------------------------------------------------------------
by hason at 2011/07/01 02:28:10 -0700
@stof This is good news :) I was hasty.
---------------------------------------------------------------------------
by lmcd at 2011/07/04 02:03:36 -0700
I'm feeling inclined to remove readline entirely for 2.1 and roll our own solution to support things like this in the shell: http://lmcd.me/v/sf-autocomplete-2.mov
---------------------------------------------------------------------------
by stof at 2011/09/04 04:55:37 -0700
what is the status of this PR ?
Commits
-------
5146a1f [EventDispatcher] Added possibility for subscribers to subscribe several times for same event
Discussion
----------
[EventDispatcher] Added possibility for subscribers to subscribe several times for same event
[EventDispatcher] Added possibility for subscribers to subscribe several times for same event
closes#2146
And it is of course fully BC :)
---------------------------------------------------------------------------
by jalliot at 2011/09/09 17:34:07 -0700
If merged, #2021 will have to reflect the change too
Commits
-------
dd20f01 Fixed assets:install to use a relative path instead of an absolute
Discussion
----------
[2.1] Fixed "assets:install" to create relative instead of absolute symlinks
This is a fairly simple fix so that the symlinks are relative to the resources rather than an absolute path that breaks from machine-to-machine or upon deployment.
We were trying to figure out why styles were messed up for other contributors, but then found that the paths were hard-coded for my machine :)
---------------------------------------------------------------------------
by ericclemmons at 2011/06/04 09:44:11 -0700
Any other thoughts/updates on this?
---------------------------------------------------------------------------
by fabpot at 2011/06/04 22:31:39 -0700
We have such a feature in symfony1 and IIRC it does not work very well. One problem is when you use symlink for some bundles. Then, you should not use a relative symlink as there is a common path between the two.
---------------------------------------------------------------------------
by ericclemmons at 2011/06/05 09:55:00 -0700
Sorry, I didn't think that we would be an issue since the Bundle "Best Practices" states to not include other bundles as dependencies.
If absolute links are a must, then the next alternative is for collaborators to add "/web/bundles" to .gitignore and each person run "assets:install" upon installation/update.
I was personally hoping there were a way to have this versioned for easier deployment.
On Jun 5, 2011, at 12:31 AM, fabpot<reply@reply.github.com> wrote:
> We have such a feature in symfony1 and IIRC it does not work very well. One problem is when you use symlink for some bundles. Then, you should not use a relative symlink as there is a common path between the two.
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1173#issuecomment-1303600
---------------------------------------------------------------------------
by henrikbjorn at 2011/06/27 04:56:58 -0700
``` php
<?php
// ...
->addOption('relative', null, InputOption::VALUE_NONE, 'The --symlink option will generate relative paths')
// ...
```
and just default to absolute paths ?
---------------------------------------------------------------------------
by ericclemmons at 2011/06/27 08:37:50 -0700
I'm very supportive of that compromise. Up to @fabpot if I should add this back in, since relative paths were apparently problematic with symfony1.
---------------------------------------------------------------------------
by sbusch at 2011/07/15 08:46:01 -0700
+1
I'm developing on Mac and the files are mounted on a Linux box which serves the project. The paths are not the same on those two systems. If I accidentally install assets on my Mac the absolute paths won't work on the Linux webserver.
Other scenario: one teammate could add those symlinks by accident to the git repository, which breaks all other installations.
Relative symlinks could help a lot in these cases.
---------------------------------------------------------------------------
by ericclemmons at 2011/07/15 08:47:53 -0700
@sbusch Your issues are the same as mine, which prompted this ticket :)
Until this gets @fabpot's blessing, it's best to simply add `web/bundles` to your `.gitignore` file and tell your users to always run `assets:install --symlink` each time they pull down code & something breaks ;)
---------------------------------------------------------------------------
by sbusch at 2011/07/15 08:58:33 -0700
The handling (calculation) of relative symlinks IMO fits better to the `symlink()` method of `\Symfony\Component\HttpKernel\Util\Filesystem`. Possible method signature:
symfony/src/Symfony/Component/HttpKernel/Util/Filesystem.php:
```php
<?php
// ...
/**
* Creates a symbolic link or copy a directory.
*
* @param string $originDir The origin directory path
* @param string $targetDir The symbolic link name
* @param Boolean $copyOnWindows Whether to copy files if on Windows
* @param Boolean $makeRelative Whether to try to create a relative link
*/
public function symlink($originDir, $targetDir, $copyOnWindows = false, $makeRelative = false)
{
```
And what about changing the `--symlink` option to optionally have a value, instead of adding a new depending option? E.g. `--symlink[=absolute|relative]`, with "absolute" as default:
symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php:
```php
<?php
// ...
class AssetsInstallCommand extends ContainerAwareCommand
{
/**
* @see Command
*/
protected function configure()
{
$this
->setDefinition(array(
new InputArgument('target', InputArgument::REQUIRED, 'The target directory (usually "web")'),
))
->addOption('symlink', null, InputOption::VALUE_OPTIONAL, 'Symlinks the assets instead of copying it. Allowed values: "absolute" (default) and "relative".', 'absolute')
->setHelp(<<<EOT
The <info>assets:install</info> command installs bundle assets into a given
directory (e.g. the web directory).
<info>./app/console assets:install web [--symlink]</info>
A "bundles" directory will be created inside the target directory, and the
"Resources/public" directory of each bundle will be copied into it.
To create a symlink to each bundle instead of copying its assets, use the
<info>--symlink</info> option. Use <info>--symlink=relative</info> for relative symlinks.
EOT
)
->setName('assets:install')
;
}
/**
* @see Command
*
* @throws \InvalidArgumentException When the target directory does not exist
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if (!is_dir($input->getArgument('target'))) {
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
}
if ($input->hasOption('symlink'))
{
if (!function_exists('symlink')) {
throw new \InvalidArgumentException('The symlink() function is not available on your system. You need to install the assets without the --symlink option.');
}
if (!in_array($input->getOption('symlink'), array('absolute', 'relative'))) {
throw new \InvalidArgumentException(sprintf('Invalid value "%s" for option "symlink"', $input->getOption('symlink')));
}
}
$filesystem = $this->getContainer()->get('filesystem');
// Create the bundles directory otherwise symlink will fail.
$filesystem->mkdir($input->getArgument('target').'/bundles/', 0777);
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
$originDir = $bundle->getPath().'/Resources/public';
if (is_dir($originDir)) {
$targetDir = $input->getArgument('target').'/bundles/'.preg_replace('/bundle$/', '', strtolower($bundle->getName()));
$output->writeln(sprintf('Installing assets for <comment>%s</comment> into <comment>%s</comment>', $bundle->getNamespace(), $targetDir));
$filesystem->remove($targetDir);
if ($input->hasOption('symlink')) {
$filesystem->symlink($originDir, $targetDir, false, $input->getOption('symlink') == 'relative');
} else {
$filesystem->mkdir($targetDir, 0777);
$filesystem->mirror($originDir, $targetDir);
}
}
}
}
```
---------------------------------------------------------------------------
by sbusch at 2011/07/15 09:04:46 -0700
@ericclemmons: yes, that's our current workaround. I started with manually converting absolute links to relative ones, but that quickly got very annoying ;-)
After that I tried to implement the generation of relative links by myself (where the proposals of my previous comment come from) until I found your PR.
---------------------------------------------------------------------------
by henrikbjorn at 2011/07/18 00:20:38 -0700
@sbush if it defaults to something how would you turn it off ?
---------------------------------------------------------------------------
by stof at 2011/07/18 00:26:16 -0700
@henrikbjorn a default value for the option is used when using ``--symlink`` without the value. If you don't use the option at all, it is disabled.
---------------------------------------------------------------------------
by stof at 2011/07/18 11:58:29 -0700
In fact no. The default value seems to be also used when the option is not set at all. @fabpot is this intended ?
---------------------------------------------------------------------------
by Seldaek at 2011/07/19 05:18:29 -0700
Symlinks on windows, although technically possible, don't quite work with PHP on most setups. Also git doesn't seem to support them either on windows (not sure why not). For those reasons, and although I'm sure this doesn't apply to every project, I would recommend you just have everyone run `assets:install [--symlink]` on their local machine, and make that command run on the server as part of your deployment process.
---------------------------------------------------------------------------
by ericclemmons at 2011/07/19 06:15:34 -0700
Nobody is even entertaining --relative?
On Jul 19, 2011, at 7:18 AM, Seldaek<reply@reply.github.com> wrote:
> Symlinks on windows, although technically possible, don't quite work with PHP on most setups. Also git doesn't seem to support them either on windows (not sure why not). For those reasons, and although I'm sure this doesn't apply to every project, I would recommend you just have everyone run `assets:install [--symlink]` on their local machine, and make that command run on the server as part of your deployment process.
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1173#issuecomment-1606463
---------------------------------------------------------------------------
by Gregwar at 2011/08/10 08:56:27 -0700
I agree with the idea of proposing a --relative option, I'm currently working on a Samba mounted filesystem and I'm forced to create manually symlinks to get things working since the paths are not the same
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.
Commits
-------
f7bf7b5 fixed condition
181332b added a Controller:getUser() shortcut to recover the current user
Discussion
----------
[2.1] added a Controller:getUser() shortcut to recover the current user
Commits
-------
c4a0f79 Updates according to suggestions.
6aec789 Added tests.
54454ba Added generic filtering to ParameterBag.
Discussion
----------
Added generic filtering to ParameterBag.
Adds filtering convenience using PHP's filter_var() e.g.
$request->get->filter($key, '', false, FITLER_SANITIZE_STRING);
See http://php.net/manual/en/filter.filters.php for capabilities.
---------------------------------------------------------------------------
by GromNaN at 2011/09/25 15:41:50 -0700
What is the use case ?
---------------------------------------------------------------------------
by drak at 2011/09/25 15:52:19 -0700
Input variable validation/sanitization. ParameterBag has a few built in like `getAlnum()` for example. This method offer's PHP's full filtering and sanitization suite.
---------------------------------------------------------------------------
by fabpot at 2011/09/27 00:56:41 -0700
Can you add some unit tests for this new feature?
---------------------------------------------------------------------------
by drak at 2011/09/27 00:58:56 -0700
Sure thing.
---------------------------------------------------------------------------
by drak at 2011/09/27 01:07:03 -0700
Before I make the commit, is the method name ok for you or would you prefer it is called `getFiltered()`?
---------------------------------------------------------------------------
by fabpot at 2011/09/27 01:13:46 -0700
`filter` sounds good to me.
---------------------------------------------------------------------------
by drak at 2011/09/27 02:37:01 -0700
I've added some tests.
---------------------------------------------------------------------------
by stloyd at 2011/09/27 02:42:42 -0700
@drak IMO you must check that user don't use unknown filter and/or flags for filter.
---------------------------------------------------------------------------
by drak at 2011/09/27 02:48:38 -0700
@stloyd - I'm not sure that's practical at all, this is a wrapper for a built-in PHP function and I don't understand why we would need validate arguments for a PHP function - it's the coder's job to use the API correctly - none of the inputs to this function are coming from a web request. It would also mean that the API would need to keep track of any upstream changes to constants in the PHP engine (which are just integers after all). It's really just not practical.
---------------------------------------------------------------------------
by stealth35 at 2011/09/27 05:16:50 -0700
@drak it's could be cool to use `filter_id` ✌️
if (is_string) {
$filter = filter_id($filter);
}
---------------------------------------------------------------------------
by drak at 2011/09/27 07:05:42 -0700
@stealth35 regarding this
if (is_string) {
$filter = filter_id($filter);
}
I believe strongly in the use of IDEs when coding and autocomplete nicely provides when you type `FILTER_`. Additionally, `filter_id()` only works on filters, but not for the flags, so I'm not entirely sure how useful it would be overall compared to using a good IDE (which you need when working with complex frameworks anyhow, imo :)
---------------------------------------------------------------------------
by drak at 2011/09/27 07:30:10 -0700
Ok check it now.
Commits
-------
d675c28 [FrameworkBundle] Use Router instead of RouterInterface
ae7ae8d [FrameworkBundle] Moved router_listener from web to router.xml since it depends on the router
35a9023 [FrameworkBundle] Added isEnabled to Router commands, fixes#1467536d979 [Console] Added Command::isEnabled method that defines whether to add the command or not
Discussion
----------
[2.1] [Console] Added Command::isEnabled method
This addresses #1467.
The idea is to allow commands to evaluate whether they can run or not, since they are automatically registered.
- It's useful for the two router:* commands since they're optional (router can be disabled), but part of the FrameworkBundle that is not really optional.
- It could be useful for third party code as well.
- It's BC.
- aa95bb0d395810b29a3e654673e130736d9d1080 should address the issue in #1467, while the other commits just make sure the command is not registered at all if the router isn't standard.
One issue remains though:
- A few other services like twig helpers get the `ròuter` injected, this means that if there is really **no** router service defined, there is still an error. I'm not sure how to fix those beyond adding `on-invalid="null"` but I'm not sure if that's desirable. I guess we could argue that the router is a big candidate for replacement/suppression, and as such it should be truly optional, but if we do it I don't know where it'll lead. I don't want to end up in a situation where half the dependencies are optional to support every possible combination. @fabpot wdyt?
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/28 16:19:46 -0700
I'd rather see us not register a command instead of register and then disable it. Can we do the same thing you've done here in the bundle's registerCommands() method?
---------------------------------------------------------------------------
by Seldaek at 2011/06/28 16:51:36 -0700
Note that it's never really registered. During the registration it's checked and skipped if not enabled.
However, doing it as you suggest means overriding/copy-pasting all the code from the core Bundle class, which I don't like so much. It also means adding code specific to those two commands in a somewhat unrelated place, which I also don't like.
I'm not saying the current solution is perfect, but from the alternatives I considered, it's the best I have found.
---------------------------------------------------------------------------
by stof at 2011/09/04 04:58:04 -0700
@Seldaek your branch conflicts with master. could you rebase it ?
@fabpot what do you think about this PR ?
---------------------------------------------------------------------------
by Seldaek at 2011/09/04 08:39:05 -0700
Rebased
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.
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.
Adds filtering convenience using PHP's filter_var() e.g.
`$request->get->filter($key, '', false, FITLER_SANITIZE_STRING);`
See http://php.net/manual/en/filter.filters.php for capabilities.
* 2.0:
bumped Symfony version to 2.0.3-DEV
updated VERSION for 2.0.2
update CONTRIBUTORS for 2.0.2
updated CHANGELOG for 2.0.2
updated vendors for 2.0.2
merged branch helmer/target_path (PR #2228)
Commits
-------
022a9a7 [Security] Make saving target_path extendible
Discussion
----------
[Security] Make saving target_path extendible
The problem lies in how Security component handles ``target_path`` - the latest request URI is always stored. This can lead to problems in following scenarios:
a) The response type of the request is not HTML (think JSON, XML ..)
b) The URI matches a route that does not listen to HTTP GET
I opened a [PR](https://github.com/symfony/symfony/pull/604) months ago, to partly solve scenario A, which did not make it. Now I am proposing a different solution - user can extend ``ExceptionListener`` and override the logic behind setting the ``target_path`` to match his precise needs.
In my simplified scenario, I would be using:
```
protected function setTargetPath(Request $request)
{
if ($request->isXmlHttpRequest() || 'GET' !== $request->getMethod()) {
return;
}
$request->getSession()->set('_security.target_path', $request->getUri());
}
```
@Seldaek, @schmittjoh, @lsmith77, thoughts?
---------------------------------------------------------------------------
by Seldaek at 2011/09/21 02:37:02 -0700
Seems like a better solution for flexibility's sake. Would be quite awesome if you could add a cookbook entry to symfony/symfony-docs about this, otherwise I'm afraid we'll have to explain it over and over again :)
---------------------------------------------------------------------------
by helmer at 2011/09/21 03:38:57 -0700
[Cookbook](b22c5e666e) entry done. Perhaps though I rushed ahead ..
---------------------------------------------------------------------------
by Seldaek at 2011/09/21 03:52:01 -0700
Thanks. You can already do a pull request against symfony-docs, just reference this pull request in it so it's not merged before this is merged.
Commits
-------
67c33a8 Rebased with master, and fixed wrong behavior with proper tests coverage
f8a6a4b Be sure that both fields have same value for required option in RepeatedType
0679220 Additional test coverage for changes in RepeatedType
b23d47d moved options test form from class->method scope
5fe5556 fixed accidental permission change
a969434 [Form] fixed CS, merged options, added tests
8819db3 [Form] Allow setting different options to repeating fields
Discussion
----------
[2.1] [Form] Allow setting different options at RepeatedType fields
This an test covered version of #1348 (rebased with master).
---------------------------------------------------------------------------
by stloyd at 2011/06/27 04:18:19 -0700
@fabpot What do you think about this ? I'm just not sure that we should allow setting `required` per field, IMO better would be forcing this option from default `$options['options']` and ignore that field in `$options['first_options']` and/or `$options['second_options']`.
---------------------------------------------------------------------------
by stloyd at 2011/07/02 00:00:04 -0700
@fabpot ping.
---------------------------------------------------------------------------
by fabpot at 2011/07/06 05:45:56 -0700
Let's discuss this new feature for 2.1.
---------------------------------------------------------------------------
by stloyd at 2011/08/24 01:12:59 -0700
Rebased with master.
---------------------------------------------------------------------------
by stof at 2011/09/04 05:02:42 -0700
@fabpot What do you think about this feature ? It is now time to discuss it :)
---------------------------------------------------------------------------
by fabpot at 2011/09/22 00:18:29 -0700
Tests do not pass.
---------------------------------------------------------------------------
by stloyd at 2011/09/24 01:54:42 -0700
@fabpot Should be ok now.
Commits
-------
afc0971 make it easier to customize the cache lookup in the TemplateLocator
Discussion
----------
make it easier to customize the cache lookup in the TemplateLocator
---------------------------------------------------------------------------
by fabpot at 2011/09/22 01:21:56 -0700
Do you any use case for that?
---------------------------------------------------------------------------
by lsmith77 at 2011/09/22 01:27:06 -0700
Yes in the ThemeBundle we override the default cache to include the key + theme:
https://github.com/liip/liipthemebundle/pull/9/files#L7R53
---------------------------------------------------------------------------
by lsmith77 at 2011/09/22 01:29:18 -0700
though i just thought about it .. if we do not put this into 2.0, it might not be worth the trouble.
---------------------------------------------------------------------------
by pjedrzejewski at 2011/09/22 02:19:42 -0700
+1 for this.
attempted to maintain BC as good as possible, but RegistryInterface::getRepository() had to be dropped from RegistryInterface. Its still part of the ManagerRegistry, so its only a BC break for people using RegistryInterface to create their own implementation
Commits
-------
f4784f7 [DomCrawler] Submit on a <form> node
Discussion
----------
DomCrawler - ability to submit a form that doesn't have any buttons
The proposed modification allows to submit above a <form> tag.
Using the DomCrawler component (among others), I have to interact with a remote site that has a form without a submit button (submitted automatically by javascript). This prompted the quick fix I'm sending. Please tell me if there is anything I should do differently and I'll modify it.
Thanks :)
---------------------------------------------------------------------------
by fabpot at 2011/09/12 00:46:07 -0700
Looks good to me. Can you add some unit tests for this new behavior? Thanks.
---------------------------------------------------------------------------
by jc- at 2011/09/12 02:27:25 -0700
Honored to meet you. I'm trying to run the test suite but 24 tests fail even without my commit. I'll try to get it sorted out and submit tests for this ASAP.
Commits
-------
6d8c4a8 change nested collection indentation from 2 to 4
Discussion
----------
Changed Yaml Dumper nested collection indentation
This PR changes the dumpers nested collection indentation from 2 to 4 which seems to be the standard.
Commits
-------
022a9a7 [Security] Make saving target_path extendible
Discussion
----------
[Security] Make saving target_path extendible
The problem lies in how Security component handles ``target_path`` - the latest request URI is always stored. This can lead to problems in following scenarios:
a) The response type of the request is not HTML (think JSON, XML ..)
b) The URI matches a route that does not listen to HTTP GET
I opened a [PR](https://github.com/symfony/symfony/pull/604) months ago, to partly solve scenario A, which did not make it. Now I am proposing a different solution - user can extend ``ExceptionListener`` and override the logic behind setting the ``target_path`` to match his precise needs.
In my simplified scenario, I would be using:
```
protected function setTargetPath(Request $request)
{
if ($request->isXmlHttpRequest() || 'GET' !== $request->getMethod()) {
return;
}
$request->getSession()->set('_security.target_path', $request->getUri());
}
```
@Seldaek, @schmittjoh, @lsmith77, thoughts?
---------------------------------------------------------------------------
by Seldaek at 2011/09/21 02:37:02 -0700
Seems like a better solution for flexibility's sake. Would be quite awesome if you could add a cookbook entry to symfony/symfony-docs about this, otherwise I'm afraid we'll have to explain it over and over again :)
---------------------------------------------------------------------------
by helmer at 2011/09/21 03:38:57 -0700
[Cookbook](b22c5e666e) entry done. Perhaps though I rushed ahead ..
---------------------------------------------------------------------------
by Seldaek at 2011/09/21 03:52:01 -0700
Thanks. You can already do a pull request against symfony-docs, just reference this pull request in it so it's not merged before this is merged.
Commits
-------
e1aabd2 [FrameworkBundle] Updated the Russian translations.
Discussion
----------
[FrameworkBundle] Updated the Russian translations.
Added translations for a new error messages of image validator.
Added translations for the user password validator.
Commits
-------
fea74db Added information page with better messages for Profiler
Discussion
----------
[WebProfiler] Added information page with better messages
---------------------------------------------------------------------------
by stloyd at 2011/08/30 23:29:27 -0700
@fabpot Any decision about this ?
Commits
-------
132fbe3 [WebProfilerBundle] Merge position and css_position
defdb82 [WebProfilerBundle] Remove unused line
69a50ab [WebProfilerBundle] Add the posibility to specify position of toolbar
Discussion
----------
[WebProfilerBundle] Add the posibility to specify position of toolbar
I'm facing a project where everything is at the bottom of the page, positioned with CSS.
This PR adds the possibility to specify the position of the toolbar, with configuration :
web_profiler:
toolbar: true
intercept_redirects: false
css_position: top
---------------------------------------------------------------------------
by stof at 2011/09/06 12:11:27 -0700
Looking at the code rendering the toolbar, there is already a ``position`` parameter used to display the toolbar on top in the profiler. Maybe we could look into reusing it instead of having a second one named ``css_position``.
But the phpdoc says ``bottom, normal, or null -- automatically guessed``. Using ``bottom`` will result in ``position: bottom`` in the CSS, which is broken. @fabpot is it simply a left-over of a previous version ?
---------------------------------------------------------------------------
by alexandresalome at 2011/09/16 00:56:11 -0700
I merged parameters and changed the documentation for 3 values : ```bottom, top or normal```.
Commits
-------
4ca09a9 [Validator] Validate object with it's own entity manager by default
Discussion
----------
[Validator] Validate object with it's own entity manager by default
While working with multiple object managers the default validation uses default entity manager, requiring the dev to create own validation services for each entity using other entity managers. This commit causes entity to be validated (by default) by it's own entity manager, while still preserving a possiblity to specifiy $constraint->em.
This is was a pull request to 2.0, changed to master according to stof's suggestion.
Commits
-------
7d3c2df [SecurityBundle] added a validator for the user password
Discussion
----------
[SecurityBundle] added a validator for the user password
This validator is useful when you want to validate that an input value
is equal to the user current password (in a form where the user can change
his password for instance).
Note that this should not be used to validate a login form as this is
done automatically by the built-in security mechanism.
---------------------------------------------------------------------------
by Palleas at 2011/09/21 08:36:14 -0700
This is kinda what I wrote for my project 2 days ago, I'm definitely +1 on this ;-)
---------------------------------------------------------------------------
by stealth35 at 2011/09/21 08:45:55 -0700
👍
Commits
-------
e13998d updated indonesian translation for image validator
Discussion
----------
Updated indonesian translation for image validator
---------------------------------------------------------------------------
by stof at 2011/09/21 10:49:48 -0700
Can you send a PR to the 2.0 branch for the trans-unit 41 ?
---------------------------------------------------------------------------
by alifity at 2011/09/21 11:05:48 -0700
Hi @stof, I've sent another PR for trans-unit-41 :)
This validator is useful when you want to validate that an input value
is equal to the user current password (in a form where the user can change
his password for instance).
Note that this should not be used to validate a login form as this is
done automatically by the built-in security mechanism.
Commits
-------
a0329c3 Added lifetime/cleanup support.
365e73a Fixed the find() method and changed the way the profile data is stored.
beeec5e Allow socket dsn (for example mongodb:///tmp/mongodb-27017.sock).
218eaba Fixed storage of time value.
85c3806 Added support for sorting by time like other profiler storage implementations.
73692c6 Fixed MongoDbProfilerStorage::find() when passing empty parameters.
4cd2dec Use token as identifier to make usage of the automatically created index.
Discussion
----------
[2.1] [HttpKernel] MongoDB profiler updates
I fixed one issue within the MongoDbProfilerStorage::find() function and made some more changes.
---------------------------------------------------------------------------
by snc at 2011/09/11 02:28:35 -0700
Please don't merge this in yet. There are some more commits pending...
---------------------------------------------------------------------------
by fabpot at 2011/09/14 01:07:39 -0700
@snc: is it ready for a merge?
---------------------------------------------------------------------------
by snc at 2011/09/14 01:20:32 -0700
Unfortunately not... while testing I found out that the currently merged in implementation does not work completely. The web profiler search function errors because the find function returns the wrong data. I fixed this already but now I have some strange "maximum function nesting level reached" errors when viewing profiles with children. I will work on it later today.
---------------------------------------------------------------------------
by snc at 2011/09/14 13:27:50 -0700
Now only one thing is missing... the generated container code looks like this:
`$this->services['profiler'] = $instance = new \Symfony\Component\HttpKernel\Profiler\Profiler(new \Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage('mongodb://localhost/sf2-mongo-profiler/profiler', '', '', 86400), $a);`
The current constructor only uses the first parameter (dsn). What about the username, password and lifetime? Username and passwort can already be passed via the dsn... but the lifetime feature is not part of the interface... should I implement it?
---------------------------------------------------------------------------
by fabpot at 2011/09/15 11:03:02 -0700
The `lifetime` is used to cleanup the database (see https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php#L136). So, it should probably be implemented for MongoDB as well (but it can probably be done in another PR).
---------------------------------------------------------------------------
by snc at 2011/09/19 13:42:52 -0700
Sorry for the delay, lifetime support is now implemented. What do you think about an AbstractProfilerStorageTest class to share some testing code between the different implementations (of cause in a separate PR)?
Commits
-------
83199ae [FrameworkBundle] Fix unintuitive merging behavior for assets_base_urls
4061114 [FrameworkBundle] fixes unintuitive merging behavior
Discussion
----------
[FrameworkBundle] fixes unintuitive merging behavior
---------------------------------------------------------------------------
by fabpot at 2011/09/16 10:04:53 -0700
I think this is a "bug", no? If this is the case, then we need to fix the 2.0 branch.
---------------------------------------------------------------------------
by schmittjoh at 2011/09/17 00:34:14 -0700
It is a change in behavior, but whether or how you want to merge this is really up to you.
---------------------------------------------------------------------------
by jmikola at 2011/09/19 08:09:26 -0700
I was about to create a PR for this very same quirk, as this was causing my CDN's for various environments to all get merged together. I think we can get away with merging it directly to 2.0 since `assets_base_urls` are hardly covered in the documentation at all.
Once this gets merged, I wouldn't mind writing up a blurb on them to explain how the shorthand syntax works and this merging strategy.
---------------------------------------------------------------------------
by jmikola at 2011/09/19 08:28:21 -0700
I just noticed this PR only fixes the `base_urls` config option under `packages`. We should also correct this behavior for `assets_base_urls`, which appears further up in FrameworkBundle's Configuration.php file.
---------------------------------------------------------------------------
by jmikola at 2011/09/19 08:44:57 -0700
@schmittjoh: I have the second commit for this sitting in https://github.com/jmikola/symfony/tree/configFix (rebased on your branch) if you'd prefer to merge that into your branch to update this PR.
---------------------------------------------------------------------------
by schmittjoh at 2011/09/19 08:55:42 -0700
Merged it in. Thanks.
---------------------------------------------------------------------------
by fabpot at 2011/09/19 09:01:27 -0700
ok, I'm going to merge this into master.
@jmikola: Can you submit documentation for the new way?
Commits
-------
b9b6084 [FrameworkBundle] Updated Czech translations for image validator
Discussion
----------
[FrameworkBundle] Updated Czech translations for image validator
---------------------------------------------------------------------------
by stof at 2011/09/10 12:10:08 -0700
Could you send a PR against the 2.0 branch for the trans-unit up to 41 which are already part of 2.0 ? Adding 42 to 46 should then still be done in master as they are new for 2.1
Commits
-------
c6b15b3 [WebProfilerBundle] Variables only used once
847c665 [WebProfilerBundle] Use panel URL for debugging toolbar
fe13a6c [WebProfilerBundle] Fix CS
fe76d74 [WebProfilerBundle] Propose to open debug toolbar request in an error occured.
Discussion
----------
[WebProfilerBundle] Propose to open debug toolbar request in an error occ
[WebProfilerBundle] Propose to open debug toolbar request in an error occured.
This is very useful when creating data collectors and an error occurs
when redering the toolbar via XHR.
The only problem is that the exception page renders the toolbar via JS, too.
---------------------------------------------------------------------------
by stof at 2011/09/17 05:26:10 -0700
IMO, you should propose to open the link to the profiler (if the profiler is enabled) instead of opening the toolbar alone
---------------------------------------------------------------------------
by alexandresalome at 2011/09/17 05:34:50 -0700
Thanks @stof
---------------------------------------------------------------------------
by alexandresalome at 2011/09/17 05:50:11 -0700
4 commits for 2 lines... I should change my job. Thanks @stof, again
Commits
-------
9fe87be More explicit default value for assets_version_format
Discussion
----------
Fixed default asset version format
This is not needed as it is already the value that is set when null in ``Symfony\Component\Templating\Asset\Package`` but that would make it clearer for people who just read the configuration.
Commits
-------
78c630c Added access to Doctrine's ValidateSchema command from the console. See ticket 2200.
Discussion
----------
Added access to Doctrine's ValidateSchema command from the console.
See ticket 2200.
Add a trivial Proxy wrapper class to access Doctrine's ValidateSchema() command from app/console
* 2.0:
[HttpKernel] fixed typo
fixed previous merge, done the same change to other occurences
fixes usage of mb_*
Profiler session import fixed.
[Process] workaround a faulty implementation of is_executable on Windows
Swedish translation fix.
[Locale] Fix#2179 StubIntlDateFormatter support yy format
Fixed fourth argument of Filesystem->mirror()
Commits
-------
046a125 [FrameworkBundle] Set the file storage as default storage for Symfony2
Discussion
----------
[FrameworkBundle] Set the file storage as default storage for Symfony2
---------------------------------------------------------------------------
by Seldaek at 2011/09/16 07:41:48 -0700
What's the reasoning behind this? Is SQLite causing issues? Isn't it faster than file storage?
---------------------------------------------------------------------------
by alexandresalome at 2011/09/16 07:50:50 -0700
3 reasons :
* The file storage is faster than the SQLite storage (see https://github.com/symfony/symfony/pull/1772)
* It's the only reason why Symfony2 is dependent of SQLite
* SQLite profiler has problems with concurrency (especially when concurrent access occurs).
---------------------------------------------------------------------------
by Seldaek at 2011/09/16 07:51:50 -0700
Ok sorry I missed the other PR. Sounds great :)
Commits
-------
95dc7e1 Fixed fourth argument of Filesystem->mirror()
Discussion
----------
Fixed fourth argument of Filesystem->mirror()
See #2027 and #2033 for discussion.
@fabpot said that we don't want to use symlink at all on Windows so if this is confirmed, we should also change ``Filesystem->symlink()`` implementation.
---------------------------------------------------------------------------
by alexandresalome at 2011/09/16 08:29:40 -0700
Tested on Windows, OK for me
Commits
-------
8e2cbe6 fixes usage of mb_*
Discussion
----------
Fixes usage of mb_strlen
---------------------------------------------------------------------------
by Seldaek at 2011/09/16 05:33:45 -0700
This will fail if the mbstring ext isn't enabled, you should still test for the mb_ function first.
Commits
-------
13b77bf Treat defaults enclosed between % as parameters from dic This allows as to define default like this
Discussion
----------
[Route] Treat defaults enclosed between % as parameters from dic
This allows as to define default like this
foo:
pattern: /{_locale}/login
defaults:
_controller: my_login_controller:loginAction
_locale: %session.default_locale%
---------------------------------------------------------------------------
by lsmith77 at 2011/08/10 07:00:14 -0700
this is a bit of a BC break .. but in general it does address a huge need for being able to make routes more easily configurable.
also didnt check this, but we should make sure that this doesnt open any security issues.
---------------------------------------------------------------------------
by maoueh at 2011/08/10 08:31:18 -0700
Hi,
There is an issue pending for the same feature here #1718. Maybe this one could be linked to #1718 somehow.
Regards,
Matt
---------------------------------------------------------------------------
by fabpot at 2011/09/12 23:51:53 -0700
@lsmith77: Why is it a BC break?
---------------------------------------------------------------------------
by lsmith77 at 2011/09/13 00:04:46 -0700
well its only a BC break on the off chance that someone puts stuff enclosed in % in the defaults atm and does not expect them to be interpreted as parameters. not very likely. but at the least we might want to first check if the parameter exists before replacing it.
---------------------------------------------------------------------------
by mvrhov at 2011/09/13 23:28:48 -0700
So, do I check if parameter exists inside dic and throw a notice if not, or do I just fix the comment?
Commits
-------
e6e5146 [Translation] now support ResourceBundle
Discussion
----------
[2.1][Translation] now support ResourceBundle
support `.res` and `.dat` bundles
---------------------------------------------------------------------------
by marijn at 2011/09/08 08:59:39 -0700
There are a few references to `ressource`, I guess that is a typo...
---------------------------------------------------------------------------
by stealth35 at 2011/09/08 09:13:32 -0700
@marijn thank, done
---------------------------------------------------------------------------
by fabpot at 2011/09/11 00:42:37 -0700
Is it possible to add a dumper like we have for all other loaders?
---------------------------------------------------------------------------
by stof at 2011/09/11 03:46:39 -0700
Btw, you need to rebase your branch as it conflicts with master
---------------------------------------------------------------------------
by stealth35 at 2011/09/11 04:04:23 -0700
@fabpot it's more difficult (or the easy way it's to use `exec` with `derb`), I can create the text resources
@stof oki
---------------------------------------------------------------------------
by fabpot at 2011/09/11 23:52:19 -0700
@stealth35: Can you remove the `@api` tags? We will review what is included into the public API later on. thanks.
---------------------------------------------------------------------------
by stealth35 at 2011/09/12 04:18:07 -0700
@fabpot done
Commits
-------
aecfd0a [HttpFoundation] Support user and password in url
Discussion
----------
[HttpFoundation] Support user and password in url
Allow `http://user:password@test.com` for url request and `basic auth`
Added Methods for `Request`
- `getUser`
- `getPassword `
---------------------------------------------------------------------------
by stealth35 at 2011/08/26 07:52:57 -0700
@seldaek @stof thanks guys it's done
---------------------------------------------------------------------------
by stof at 2011/08/28 11:52:11 -0700
btw, you should rebase your branch on top of the upstream master branch as it conflicts
---------------------------------------------------------------------------
by stealth35 at 2011/08/28 13:15:55 -0700
@stof done
---------------------------------------------------------------------------
by stof at 2011/09/04 02:09:11 -0700
@stealth35 you made an error when rebasing: you merged the previous version of the branch instead of forcing the push, thus duplicating all commits in the PR (rebasing rewrites the history so it creates new commits). Could you clean your branch ?
---------------------------------------------------------------------------
by stealth35 at 2011/09/05 02:00:17 -0700
@stof 👍
---------------------------------------------------------------------------
by stealth35 at 2011/09/06 08:21:00 -0700
should be 2.0 ?
---------------------------------------------------------------------------
by fabpot at 2011/09/11 23:52:30 -0700
@stealth35: Can you remove the `@api` tags? We will review what is included into the public API later on. thanks.
---------------------------------------------------------------------------
by stealth35 at 2011/09/12 04:02:01 -0700
@fabpot done
Commits
-------
a0a97c6 Removed executable bits from all php files
Discussion
----------
Removed executable bits from all PHP files
Some files had a file mode of 755 and this PR changes them to 644. The reason behind this is that git always thinks that those files are changed when accessing the repository via a samba share on windows (tested with PhpStorm).
---------------------------------------------------------------------------
by fabpot at 2011/09/09 05:51:30 -0700
That was on my radar too. Can you do the same for the 2.0 branch?
Commits
-------
ef322f6 -- add command that extracts translation messages from templates
Discussion
----------
[2.1] Extracting translation messages from templates
As seen here #1283 and here #2045, I push the command that extract translation from templates.
There are still a lot of new things here, but it seems more manageable.
---------------------------------------------------------------------------
by stof at 2011/09/04 02:04:40 -0700
@michelsalib Could you try to refactor the code to make it more flexible by moving the creating of the file to the dumpers to support other outputs (database...) ?
---------------------------------------------------------------------------
by michelsalib at 2011/09/04 02:35:50 -0700
You are right, I shall do it tonight.
---------------------------------------------------------------------------
by michelsalib at 2011/09/04 11:53:35 -0700
I just pushed a refactoring that should allow more flexibility. Dumpers are now responsive for writing the files. This way it is now possible to implement the DumperInterface that dump to a database and add it to the TranslationWriter.
I updated the tests accordingly.
---------------------------------------------------------------------------
by fabpot at 2011/09/05 23:27:27 -0700
To be consistent with other dumpers in the framework, the dumpers extending `FileDumper` should use `FileDumper` as a suffix like in `YmlFileDumper`.
---------------------------------------------------------------------------
by fabpot at 2011/09/05 23:41:12 -0700
A general note on PHPDoc: The first line of a phpdoc ends with a dot and starts with a present verb like in `Extracts translation messages from template files.`
---------------------------------------------------------------------------
by michelsalib at 2011/09/06 01:23:31 -0700
I fixed most of the remarks. I just need to go through the phpdoc (in a few minutes).
---------------------------------------------------------------------------
by stloyd at 2011/09/06 01:28:55 -0700
@michelsalib you should use `git rebase` (see [docs](http://symfony.com/doc/current/contributing/code/patches.html#id1)) instead of `git merge`.
---------------------------------------------------------------------------
by michelsalib at 2011/09/06 01:31:06 -0700
@stloyd sorry. I will rebase (squash) everything when I am finished.
---------------------------------------------------------------------------
by kaiwa at 2011/09/06 01:31:18 -0700
Hey, it might be a little bit late, but may i ask a not code-related question?
Is it correct that the `--force` option only means to write the output to a file instead of writing it to stdout?
If so,
1. is it semantically correct? I mean... i'm not a native english speaker, but from unix programs i'm used to interpret a `--force` option as something like "overwrite", "ignore errors" or "suppress warnings". An option which is used in case of trouble most time. Feels confusing to me to be forced ;-) to use the `--force` option for simply writing to files.
2. does it makes sense to have a default behaviour instead of requiring the user to give either `--force` or `--dump-messages`? In which cases does the user wants to dump the messages to the console? Is it only for debugging / to review the messages?
---------------------------------------------------------------------------
by michelsalib at 2011/09/06 01:33:58 -0700
@kaiwa Your concerns seems perfectly right. Initially I just wanted to mimic the `doctrine:schema:update` command. But it can be changed.
@fabpot what do you think ?
---------------------------------------------------------------------------
by michelsalib at 2011/09/06 02:01:22 -0700
@stloyd I tried to do a `git rebase` and I am quite lost. I think I messed something when merge instead of rebase. How can I clean/squash my PR properly ?
---------------------------------------------------------------------------
by stloyd at 2011/09/06 02:11:29 -0700
@michelsalib for now just work as it is ;-) When I back from work I will try to help you to rebase it properly.
---------------------------------------------------------------------------
by michelsalib at 2011/09/06 02:12:17 -0700
@stloyd Thank you !
---------------------------------------------------------------------------
by stloyd at 2011/09/06 12:39:18 -0700
@michelsalib I was trying to rebase your code and revert it this _bad_ commit (merge), but without success.
IMO best way would be making _brand new_ branch based on symfony/master, and the `git cherry-pick` ([hint](http://ariejan.net/2010/06/10/cherry-picking-specific-commits-from-another-branch)) commits you need (almost all in this PR but without this one with merge), then you will need to apply again _by hand_ changes from commit fce24c7fa2 (this clean up you have done there).
I'm sorry I can't give you more help...
---------------------------------------------------------------------------
by michelsalib at 2011/09/07 09:41:36 -0700
@stloyd I finally succeed to fix this PR. Thanks to your help! I must admit the whole thing with `cherry-pick` command was quite epic.
@fabpot Don't be sorry, I am about to fix the PHPDoc. I shall squash right after.
---------------------------------------------------------------------------
by michelsalib at 2011/09/07 10:07:20 -0700
I just squashed and did a last polish of the code. You might want to read it again before merge.
---------------------------------------------------------------------------
by fabpot at 2011/09/07 11:40:48 -0700
ok, code looks really good now. I think the only missing thing is some more unit tests (for the extractors for instance).
---------------------------------------------------------------------------
by michelsalib at 2011/09/07 12:18:59 -0700
Thanks, I'll look into it tomorrow.
---------------------------------------------------------------------------
by michelsalib at 2011/09/08 15:13:10 -0700
Hi,
I just added unit tests for both extractors (php and yaml).
Concerning the yaml extractor, the test is quite tricky because I need to mock the twig environment while returning a twig tree that contain a trans block and a trans filter. But it work fine with as little side effects as possible. Also I am not sure that the test should be in the TwigBundle.
IMO, the PR seems ready.
---------------------------------------------------------------------------
by stof at 2011/09/08 15:34:41 -0700
As the extractor is in bridge, the tests should be in the folder containing the tests for the bridge in tests/
---------------------------------------------------------------------------
by michelsalib at 2011/09/08 15:41:45 -0700
Thanks @stof, it is now fixed.
---------------------------------------------------------------------------
by michelsalib at 2011/09/09 00:48:47 -0700
thanks @stloyd, it is fixed now.
---------------------------------------------------------------------------
by michelsalib at 2011/09/09 01:25:24 -0700
Fixed again ;)
-- add missing files
-- tweak translation command files
-- dumpers are now responsive for writting the files
-- moved the twig extractor the bridge
-- clear temp files after unit tests
-- check the presence of dumper in translation writer
-- General cleaning of the code
-- clean phpDoc
-- fix PHPDoc
-- fixing class name in configuration
-- add unit tests for extractors (php and twig)
-- moved test to correct location
-- polish the code
-- polish the code
Commits
-------
b7c2a2e [FrameworkBundle] fixed typo in German validator translation
Discussion
----------
[FrameworkBundle] fixed typo in German validator translation
Commits
-------
8198078 updated italian translation for validators
Discussion
----------
updated italian translation in validators.it.xliff
---------------------------------------------------------------------------
by stof at 2011/09/06 14:06:39 -0700
could you do the update up-to the id 41 against the 2.0 branch (as they should be there) ? Only 42 and up are new for 2.1
---------------------------------------------------------------------------
by stloyd at 2011/09/06 14:12:28 -0700
@micheleorselli, as @stof mentioned you should make two PRs. One against __2.0__ to fix translation issues, and second against __master__ to add those new ones, available only in __2.1+__
---------------------------------------------------------------------------
by micheleorselli at 2011/09/06 15:04:17 -0700
@stof @stloyd: translation for 2.0 branch are updated in PR #2118
* 2.0:
[Validator] Sync polish translation
[FrameworkBundle] sanitize target arg in asset:install command
few optimisations for XliffFileLoader and XmlFileLoader
[FrameworkBundle] Sync the Russian translations
[FrameworkBundle] Added Dutch validator translation for trans-unit 41
[FrameworkBundle] Updated German validator translation
[FrameworkBundle] Fixed a typo in the translation file per @PeymanHR
Commits
-------
34494b3 whitespace fixes
1a86a4a Refactor mime-type to file extension guessing
e7481a3 Decouple mime-type to extension logic from File class
Discussion
----------
[2.1] Decouple mimetype-to-extension logic from File class
This allows guessing the extension from a given mime type
without requiring the existence of a local file.
If a file's meta information (mime-type, etc.) is already available (i.e. it's
been extracted once and stored in some persistent data store), it would be
nice to be able to make a best-guess on the extension based on the known mime-type.
A concrete use case of this is for the symfony-cmf, where a file has been stored
in the jackrabbit data store. When delivering this file or saving it to disk, we'd like to
use an extension that's created based on the known mime type of the file.
---------------------------------------------------------------------------
by brki at 2011/06/21 04:35:13 -0700
Now implemented similarly to the existing MimeTypeGuesser.
---------------------------------------------------------------------------
by brki at 2011/06/21 07:51:22 -0700
whitespace removed
---------------------------------------------------------------------------
by stof at 2011/09/04 05:04:54 -0700
@fabpot @brki what is the status of this PR ?
Commits
-------
89f4791 Fixed CS
a348efe Removed trailing whitespaces
135531a Replaced setExpectedException() methods by annotations
6ad83e7 Updated according to PR review
2de243c * Added Fixtures 2x2px test.gif image file * Updated tests for using fixture image instead of imagecreate function
a5a2dfa [ImageValidator] Added dedicated ImageValidator class with min width, max width, min height and max height validations
Discussion
----------
[2.1] [ImageValidator] Improved ImageValidator + tests
Added dedicated ImageValidator class with min width, max width, min height and max height validations
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/04 10:32:56 -0700
This is nice but doesn't belong in the core as it adds a dependency on GD.
---------------------------------------------------------------------------
by benjamindulau at 2011/06/04 10:41:02 -0700
@kriswallsmith i'm not sure, php.net doc says :
Note:
This function does not require the GD image library.
Well, that could also be a mistake :)
---------------------------------------------------------------------------
by pborreli at 2011/06/04 11:17:25 -0700
i think @benjamindulau is right
```
$ php -m
[PHP Modules]
bcmath
calendar
com_dotnet
Core
ctype
date
dom
ereg
filter
ftp
hash
iconv
json
libxml
mcrypt
mhash
mysqlnd
odbc
pcre
PDO
Phar
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
zip
zlib
```
```
$ php -r "var_dump(getimagesize(__DIR__.'/src/Symfony/Bundle/FrameworkBund
le/Resources/public/images/blue_picto_less.gif'));"
array(7) {
[0]=>
int(18)
[1]=>
int(18)
[2]=>
int(1)
[3]=>
string(22) "width="18" height="18""
["bits"]=>
int(5)
["channels"]=>
int(3)
["mime"]=>
string(9) "image/gif"
}
```
---------------------------------------------------------------------------
by benjamindulau at 2011/06/04 11:22:57 -0700
However, the tests use imagejpeg and imagedestroy, that's not valid.
But, i'm not sure how to correctly test the validator then.
---------------------------------------------------------------------------
by benjamindulau at 2011/06/04 11:31:51 -0700
Can i use an image from FrameworkBundle resources ?
---------------------------------------------------------------------------
by pborreli at 2011/06/06 03:47:24 -0700
just add your own image inside Fixture folder (smaller the better, 1x1, 1x2 ..)
---------------------------------------------------------------------------
by stof at 2011/09/04 05:27:42 -0700
@benjamindulau could you rebase your PR and update it according to the comments ?
---------------------------------------------------------------------------
by benjamindulau at 2011/09/04 06:31:34 -0700
Yep, i think i can find some time today to do that
---------------------------------------------------------------------------
by benjamindulau at 2011/09/04 09:27:29 -0700
I've updated the PR.
A big thank to Stof who helped me with my git mess ;-)
Commits
-------
dea46c7 [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper
Discussion
----------
[2.1][Translation] support CsvDumper
---------------------------------------------------------------------------
by michelsalib at 2011/09/05 04:56:47 -0700
The DumperInterface is probably going to change soon, it should be considered when merging : #2051.
Commits
-------
f2761dd Fix typo and include suggestion by Stof
4ac380e Adjust QtTranslations patch and include QtTranslationsDumper + test aswell
5712798 Adjust QtTranslationLoader to throw RuntimeException
21b29c2 Merge symfony/master
6bf43a1 [Translation] Add .ts as file extension to search for Qt Translation files.
5808715 [Translation] Add Qt Translation component with tests
Discussion
----------
[2.1] Qt translations
Add support for QT translations - it has a GUI and www.crowdin.net supports it.
---------------------------------------------------------------------------
by stof at 2011/05/30 07:24:48 -0700
You also need to register it in FrameworkBundle.
---------------------------------------------------------------------------
by tristanbes at 2011/06/26 12:08:47 -0700
crowdin seems to be a cool service. didn't know about this website. thanks
---------------------------------------------------------------------------
by fabpot at 2011/07/11 02:58:31 -0700
Just for the record: I've just removed all usage of `\Exception` in Symfony2 master:
6a7359389d
---------------------------------------------------------------------------
by beberlei at 2011/07/11 03:02:14 -0700
I will adjust the PR.
---------------------------------------------------------------------------
by tristanbes at 2011/08/28 11:10:02 -0700
Any news @beberlei ?
---------------------------------------------------------------------------
by beberlei at 2011/08/29 01:07:28 -0700
Yes, i have to allocate some time. Havent managed to do so yet.
---------------------------------------------------------------------------
by stof at 2011/09/04 05:28:16 -0700
@beberlei the PR also need to be rebased as it conflicts with master.
Commits
-------
41b7a19 Updated the tests so that tests will be marked as skipped when there is no MongoDB server present!
233c7db Updated the code to follow the symfony coding standards
7b24de5 Updated the code to follow the symfony coding standard using stof his remarks
fbcbdde - Fixed a small bug - Updated some phpdoc
00fdfec Added a MongoDbProfilerStorage engine
Discussion
----------
[2.1] [HttpKernel] MongoDb storage for Profiler
As a documentbased database like MongoDB is [supposedly fantastic in logging](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) I implemented a storage engine for the profiler that should enable us to use this database as storage for this.
Activate it using this way:
framework:
profiler:
dsn: mongodb://user:pass@location/database/collection
---------------------------------------------------------------------------
by stof at 2011/07/24 11:23:06 -0700
btw, the MongoDB session storage has already be rejected from the core so this should probably be moved to the DoctrineMongoDBBundle (even if it uses only the PHP extension and not Doctrine). @fabpot thoughts about this ?
---------------------------------------------------------------------------
by Wotre at 2011/07/24 11:52:56 -0700
Just my personal opinion, if it is prefered that way I will move this into the DoctrineMongoDBBundle.
While it is reasonable to bundle all Mongo related things together, I do believe that in the case of logging we want to avoid as many depencies as possible. Some exceptions can occur pretty early inside the framework, and it would be a shame if those aren't logged because this layer is written on top of doctrine. I'm not exactly familliar enough with the symfony internals as I only started using it a few days ago, but I can imagine that this can make a difference with some exceptions.
---------------------------------------------------------------------------
by stof at 2011/07/24 11:59:10 -0700
I don't ask you to use Doctrine in this code. It is fine to use the extension directly if it is enough.
Btw, the profiler is *not* used early. :)
---------------------------------------------------------------------------
by Wotre at 2011/07/26 10:45:05 -0700
So... Any final remark whether this should be moved to [the DoctrineMongoDBBundle](https://github.com/symfony/DoctrineMongoDBBundle) or not?
If it has to be moved, any comment on where in that bundle this should be put?
Also, if it has to be moved, how can we arrange the configuration using DI? Currently I've put a line in the FrameworkExtension file to use this engine for everything with a $dsn starting with mongodb; I imagine this kind of ugly depency can't really exist between the FrameworkBundle and another one.
Although it seems completely illogical to me, I will move it, but I do need some directions on how to elegantly do this...
---------------------------------------------------------------------------
by stof at 2011/07/26 11:03:04 -0700
@fabpot what do you think ?
---------------------------------------------------------------------------
by stof at 2011/09/04 01:28:48 -0700
@fabpot what do you think about the place where this should be done ?
Commits
-------
9f0bd03 [HttpKernel] Update tests for FileProfilerStorage
b7032bc [HttpKernel] Update FileProfileStorage to search from EOF
188a5fa [HttpKernel] Override the existing tokens in FileProfilerStorage
b1b1424 [HttpKernel] Delete folders in the profiler cache
88bc3ec [HttpKernel] Fixes standards of FileProfilerStorage
affe66c Merge remote-tracking branch 'origin/master' into new-profiler-storage
ea916c3 [HttpKernel] Coding convention for the file profiler storage
9ae2c8d [HttpKernel] CS in file storage
b415efd [HttpKernel] Add a test for semicolon in file storage test
1c1215f [HttpKernel] Use subfolders for better storage in file storage of profiler
4b1dc1f [HttpKernel] Fix the folder attribute of file storage to private
70f73e1 [HttpKernel] Fix tests for the file storage of profiler
d5313d9 [HttpKernel] Add tests for the file profiler storage
09fc0a2 [HttpKernel] Add Symfony credits to the file storage class for the profiler
d1d5892 [HttpKernel] Finalize the file storage for the profiler
2f65cf2 Add POC for file storage system
Discussion
----------
[2.1] [HttpKernel] File storage for profiler
Symfony2 has some problems when dealing with multiple concurrency queries in the SQLite storage, resulting in a timeout error or terrible lack.
I've implemented after discussions with @fabpot a filesystem storage.
Enable it in your project with :
framework:
profiler:
dsn: "file:%kernel.cache_dir%/profiler"
I also studied the possibility to store only big data string in files and rest in the SQLite, but not concluant.
Results of my measures (4 concurrency, 120 total) :
* SQLite with data : 1057ms
* SQLite without data : 615ms
* MySQL : 40ms
* This File storage : 54ms
---------------------------------------------------------------------------
by alexandresalome at 2011/07/22 12:01:10 -0700
An idea for the find method : a csv file containing ip;url;token
The iteration could be done over a big file, without loading the whole file in memory.
---------------------------------------------------------------------------
by alexandresalome at 2011/07/23 14:22:32 -0700
OK new version, with as explained previously : a CSV file containing the index + file for each profile.
The speed is similar to the speed of MySQL, and no memory overhead should occur with this solution.
---------------------------------------------------------------------------
by alexandresalome at 2011/07/23 14:37:14 -0700
Hm... Created tests, duplicated from SqliteProfilerStorageTest.
Any idea on how to put this code in common ? Is it usual to create a base class for 2 tests ?
---------------------------------------------------------------------------
by alexandresalome at 2011/07/23 14:48:39 -0700
Just tested with 24.000 requests, the 24.001'th request still takes less than 50ms to execute.
The index file is about 2Mb, and iterating the whole file is fast.
---------------------------------------------------------------------------
by alexandresalome at 2011/07/23 14:53:19 -0700
I've filled the file with 120Mb of data, requests are still less than 50ms for executing.
Iterating the index takes more than 30s (so it crashed), but it's because of the amount of lines. 30 seconds = 1,400,000 lines in this computer. The file = 1,500,000 lines
---------------------------------------------------------------------------
by alexandresalome at 2011/07/23 14:56:54 -0700
I've tested it with Linux, is someone can test with Windows
---------------------------------------------------------------------------
by stloyd at 2011/07/24 00:32:32 -0700
IMO to speedup it a bit more and not end up with "crash" (to not end with "limit" of files per directory, also to many files in dir slow down every OS) you should use same method to write as Twig, split up files in to directories. If you do this you can speed up index more, because you can create smaller one per directory.
Also you should fix CS (coding standards).
---------------------------------------------------------------------------
by stloyd at 2011/07/24 02:10:20 -0700
Tested on Win 7, seems ok. Similar speed to sqlite, dunno why ;-) but used a bit less of memory.
---------------------------------------------------------------------------
by alexandresalome at 2011/07/24 02:13:21 -0700
Did you tried with concurrent requests ? It makes sense when you use assetic
and your browser hits the application 4 times simultaneously for CSS
generation
---------------------------------------------------------------------------
by alexandresalome at 2011/07/24 02:17:23 -0700
I used Apache Benchmark for producing results :
ab -c 4 -n 120 URL
---------------------------------------------------------------------------
by alexandresalome at 2011/07/24 02:56:55 -0700
OK I used subfolders, based on last characters (because the first part of token is mostly the same between queries.
---------------------------------------------------------------------------
by stof at 2011/09/04 01:27:15 -0700
@fabpot any news about it ? Can it be merged ?
Commits
-------
8d50c16 few optimisations for XliffFileLoader and XmlFileLoader
Discussion
----------
few optimisations for XliffFileLoader and XmlFileLoader
- file_put_contents + file_get_contents -> copy
- use stripos insteed preg_match
- removed useless `$tmpfiles` in XliffFileLoader
Commits
-------
3a7e038 [FrameworkBundle] sanitize target arg in asset:install command
Discussion
----------
[FrameworkBundle] sanitize target arg in asset:install command
`php app/console assets:install web/`
(removed tailing /)
before
`Installing assets for Symfony\Bundle\FrameworkBundle into web//bundles/framework`
after
`Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework`
Commits
-------
d19f1d7 [Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results
Discussion
----------
[Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results
An entity should only be considered unique if its search criteria returns no matches or a single, identical entity. Multiple results indicates that conflicting entities exist.
Note: the DoctrineMongoDBBundle's unique validator checks identifier values if the object strict-equality check is false. This may be a worthwhile improvement, as it would prevent reporting a validation error for an enttiy which is going to overwrite its conflicting counter-part in the database.
---------------------------------------------------------------------------
by jmikola at 2011/09/01 14:23:27 -0700
This is the Doctrine bridge equivalent for my fix to DoctrineMongoDBBundle: https://github.com/symfony/DoctrineMongoDBBundle/pull/42
---------------------------------------------------------------------------
by fabpot at 2011/09/02 00:13:52 -0700
As this is a bug fix, can you base your PR on the symfony/2.0 branch? Thanks.
* EvanK-patch-1:
Per the [documentation][1], the `NotBlank` constraint should be using the `empty` language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field.
An entity should only be considered unique if its search criteria returns no matches or a single, identical entity. Multiple results indicates that conflicting entities exist.
Commits
-------
6bd1749 Fixed a bug when multiple expanded choices would render unchecked because of the Form Framework's strict type checking.
Discussion
----------
[DoctrineBridge] Entities to array transformer
Fixed a bug when multiple expanded choices would render unchecked because of the Form Framework's strict type checking.
---------------------------------------------------------------------------
by fabpot at 2011/08/31 09:01:47 -0700
Looks good to me. Can you squash your commits before I merge? Thanks.
Check that $mode in InputArgument::__construct() is not below 1 to actually look if any of the flags are set.
Check that $mode in InputOption::__construct() is not below 1 to actually look if any of the flags are set.
Check for the correct parameter type, as in InputOption (integer).
InputArgumentTest: Added test for negative integer $mode parameter input in constructor.
InputOptionTest: Added test for negative integer $mode parameter input in constructor.
Commits
-------
eb8f3cb added uniqueEntity message translation (fr)
df9f223 added missing french translations
f4c133e removed trailing dot to make it consistent with other validator messages
Discussion
----------
[Translation] Unique Entity message
I've added the translation of uniqueEntity validation message, I've used ``trans-unit id="41"`` which seems to be unused
Doctrine caches annotations. For methods, it uses PHP reflection and the getDeclaringClass() to create
a unique cache key. Unfortunately, if you have 2 classes that extend another one, the cache will be shared.
It's not a problem except that before this patch, the default route name was also cached (as the cache is serialized
after we changed the object). So, all other classes inherited this default route name. The fix is quite easy:
just don't change the read annotation object.
From the PHP CHANGELOG:
The flag ENT_SUBSTITUTE makes invalid multibyte sequences be replaced by
U+FFFD (UTF-8) or &#FFFD; by htmlspecialchars and htmlentities. It is an
alternative to the default behavior, which just returns an empty string and to
ENT_IGNORE, which is a security risk. The behavior follows the recommendations
of Unicode Technical Report #36.
Commits
-------
ae3b128 [ClassLoader] Support for autoloading include_path incl. tests.
Discussion
----------
Autoload
GH Issue #1823
---------------------------------------------------------------------------
by stof at 2011/07/29 00:42:10 -0700
note that another fix was proposed in #1852 but this implementation is cleaner IMO
---------------------------------------------------------------------------
by henrikbjorn at 2011/08/12 01:57:45 -0700
@fabpot @stof any suggestions? need this kind of badly
---------------------------------------------------------------------------
by stof at 2011/08/12 02:06:54 -0700
for me it is fine. I guess you need to wait the end of @fabpot's holydays to see it merged.
---------------------------------------------------------------------------
by henrikbjorn at 2011/08/25 02:24:13 -0700
Added tests in the hope it will make it in soon :)
---------------------------------------------------------------------------
by henrikbjorn at 2011/08/29 03:31:08 -0700
Any other requests / suggestions ?
---------------------------------------------------------------------------
by stof at 2011/08/29 03:36:15 -0700
could you rebase the PR ? Github says that it conflicts.
---------------------------------------------------------------------------
by henrikbjorn at 2011/08/29 04:11:43 -0700
Should be rebased now or that is what git cli says :)
---------------------------------------------------------------------------
by henrikbjorn at 2011/08/29 04:16:28 -0700
And squashed.
Commits
-------
cc098a3 [HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler.php
Discussion
----------
[HttpKernel] Add support for xdebug.file_link_format to Debug\ExceptionHandler
Format file and line as url, if xdebug.file_link_format is set. Inspired by #1893
Commits
-------
020fa51 [RedirectResponse] Added missing `doctype` and `title` tag
Discussion
----------
[RedirectResponse] Added missing `doctype` and `title` tag
Commits
-------
ea0db2d [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser
Discussion
----------
[2.1] [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser
`mime_content_type` exists just for the compat between the old PHP 5.2
`mime_magic` extension and `file_info` extension
---------------------------------------------------------------------------
by fabpot at 2011/08/19 05:31:25 -0700
I will merge it in 2.1 as some people might rely on it.
---------------------------------------------------------------------------
by stealth35 at 2011/08/19 05:46:02 -0700
ok in the meantime, we can invert the guesser checker :
```php
/**
* Registers all natively provided mime type guessers
*/
private function __construct()
{
if (FileBinaryMimeTypeGuesser::isSupported()) {
$this->register(new FileBinaryMimeTypeGuesser());
}
if (FileinfoMimeTypeGuesser::isSupported()) {
$this->register(new FileinfoMimeTypeGuesser());
}
if (ContentTypeMimeTypeGuesser::isSupported()) {
$this->register(new ContentTypeMimeTypeGuesser());
}
}
```
---------------------------------------------------------------------------
by stloyd at 2011/08/19 05:48:38 -0700
@stealth35 You should make new PR for change you mentioned above.
---------------------------------------------------------------------------
by stealth35 at 2011/08/19 05:53:12 -0700
@stloyd done PR #1989
EDIT : forget this
Commits
-------
007e395 do not set a default CONTENT_TYPE for PATCH
fa2c027 Added support for the PATCH method
Discussion
----------
[2.1] [HttpFoundation] Added support for the PATCH method
http://tools.ietf.org/html/rfc2068#section-19.6.1.1http://tools.ietf.org/html/rfc5789
---------------------------------------------------------------------------
by Seldaek at 2011/08/07 03:23:20 -0700
According to the spec it seems that PATCH requests shouldn't be of application/x-www-form-urlencoded content-type so it shouldn't match the first if, and in the second it's probably wrong to default to application/x-www-form-urlencoded, no?
---------------------------------------------------------------------------
by lsmith77 at 2011/08/07 03:31:48 -0700
Hmm you are right. I assumed the diff would be encoded as ``application/x-www-form-urlencoded`` but there indeed is no indication of that in the spec. But given that the second case would still need some sort of handling for PATCH, just not sure what exactly ``$defaults['CONTENT_TYPE']`` should be set to.
---------------------------------------------------------------------------
by Seldaek at 2011/08/07 03:48:53 -0700
As I understand it, a PATCH request must specify a content-type or it's invalid, so we could just skip the second behavior if no content-type is present.
As your first link says:
The list of differences is in a format defined by the media type of the entity (e.g.,
"application/diff") and MUST include sufficient information to allow
the server to recreate the changes necessary to convert the original
version of the resource to the desired version.
Sounds like PATCH is highly application specific, and not so standardized, probably because it's not very useful for most purposes.
---------------------------------------------------------------------------
by lsmith77 at 2011/08/07 04:02:43 -0700
Yes, but to me this means that the patch is actually correct aside from the fact that its setting a default Content-Type, which I just corrected (not sure if this use of switch is ok with our coding style). Now if the Content-Type does end up being ``application/x-www-form-urlencoded`` then I would say its correct to decode it.
Commits
-------
24bacdc Ignore VCS files in assets:install command (closes#2025)
Discussion
----------
Ignore VCS files in assets:install command (closes#2025)
---------------------------------------------------------------------------
by stloyd at 2011/08/25 06:10:22 -0700
`ignoreVCS` is set to `true` by default, AFAIK also `getIterator()` is not needed.
---------------------------------------------------------------------------
by jalliot at 2011/08/25 06:30:32 -0700
@stloyd I knew about ``ignoreVCS`` defaulting to ``true`` but I thought it made it clearer but you're right it's not really useful.
As for ``getIterator`` I thought the conversion couldn't be made automatically on a method call like here but apparently it works so I changed it.
Thanks.
---------------------------------------------------------------------------
by tiagojsag at 2011/08/25 08:41:02 -0700
This approach creates another problem: the already existing VCS files are deleted when the command is executed, which makes at least SVN throw errors.
---------------------------------------------------------------------------
by jalliot at 2011/08/25 08:50:55 -0700
@tiagojsag If you remove the call to ``remove`` on line 83, does everything work?
Because I'm not really sure we need to remove the entire dir first since ``mirror`` should be able to adapt itself.
BTW, wouldn't it be better if you didn't commit the ``web/bundles`` dir in your SVN and instead ask to call the ``assets:install`` command each time?
---------------------------------------------------------------------------
by stof at 2011/08/25 08:58:16 -0700
Great news about SVN: the incoming 1.7 version stops adding a ``.svn`` folder in every directory but uses a single one at the root of the project (like git does for instance), solving this sort of issues about copying files :)
@tiagojsag this command has always removed the old asset folders before copying the new ones, and there is not real mean to do otherwise by keeping things simple. You could consider ignoring the ``vendor/bundles`` folder in the SVN and running the command when doing checkout (thus allowing devs to use symlinks if they want)
---------------------------------------------------------------------------
by tiagojsag at 2011/08/25 09:01:39 -0700
yes, that was the solution I was using before submitting this bug report. I also agree that it's the simplest and fastest way to address this, provided that docs get updated, so that no one spends their time trying to figure out why files are not synced with their svn repo.
---------------------------------------------------------------------------
by jalliot at 2011/08/25 09:03:11 -0700
@stof That's really great to hear!
But still this PR should be merged to avoid legacy files from current versions of SVN or other VCS.
---------------------------------------------------------------------------
by stof at 2011/08/25 09:04:31 -0700
@jalliot sure. My comment was mainly about the opposite issue raised by @tiagojsag
Since the key was previously concatenating service ID and method without a separator, it's possible that two different listeners could conflict (e.g. service/method pairs: foo/bar and fo/obar).
Commits
-------
89f477e [WebProfilerBundle] Throw exception if a collector template isn't found
6ca72cf [WebProfilerBundle] Allow .html.twig in collector template names
Discussion
----------
WDT debugging
While implementing collectors I did a mistake in the template name and it never told me, so I was left wondering why my stuff didn't show up. Not so nice IMO. Also the first commit is to allow template names to be specified fully. I don't see why this shouldn't be allowed, since it is the way you specify templates everywhere else.
* domcrawler-disabled-fields:
[DomCrawler] fixed disabled fields in forms (they are available in the DOM, but their values are not submitted -- whereas before, they were simply removed from the DOM)
$node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too. https://github.com/Behat/Mink/pull/58#issuecomment-1712459
Commits
-------
e294211 [DomCrawler] Removed unused document property in Form
Discussion
----------
[DomCrawler] Removed unused document property in Form
Commits
-------
8a980bd $node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too. https://github.com/Behat/Mink/pull/58#issuecomment-1712459
Discussion
----------
$node->hasAttribute('disabled') sf2 should not create disagreement betwee
$node->hasAttribute('disabled') sf2 should not create disagreement between implementation and practice for a crawler. If sahi real browser can find an element that is disabled, then sf2 should too.
https://github.com/Behat/Mink/pull/58#issuecomment-1712459
---------------------------------------------------------------------------
by cordoval at 2011/08/09 20:34:56 -0700
@fabpot please let me know if this is going to be in sometime soon or not, just wondering why it is deviating ...
---------------------------------------------------------------------------
by fabpot at 2011/08/23 01:11:42 -0700
I have just checked in a browser and the Symfony2 implementation is actually the right one.
Try this in a browser:
<form action='#' method="post">
<input name="foo" disabled="disabled" value="foo" />
<input name="bar" value="bar" />
<input type="submit" />
</form>
<?php
print_r($_POST);
// output: Array ( [bar] => bar ) when the form is submitted
And here is the discussion about it in the HTML4 spec: http://www.w3.org/TR/html4/interact/forms.html#h-17.12:
"In this example, the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form."
And the same is tru for HTML5: http://www.w3.org/TR/html5/association-of-controls-and-forms.html#constructing-form-data-set
---------------------------------------------------------------------------
by cordoval at 2011/08/23 01:29:53 -0700
@fabpot I guess you got my scenario wrong. I am not trying to submit any form. I am just happen to have a disabled box that is checked and I want to read with the DOM Crawler that is checked. Not to submit or anything but for the purposes of testing.
Please consider also that this request comes from asserting values using behat mink, mink is fully dependent on sf2 driver for when it is used except it is told to use a different driver like a real browser like sahi. When testing in chrome and firefox, the verification with the DOM is made that the disabled box is checked properly. Symfony2 DOM Crawler however misses that spot for that use.
Even in the case where Symfony2 DOM Crawler component would have been thought not for this purpose of testing, or further for this particular scenario it would be good to make it more reusable for this kind of scenario.
Just saying....
---------------------------------------------------------------------------
by fabpot at 2011/08/23 02:00:34 -0700
Indeed, I didn't get your issue right. So, basically, all fields should be in the form, but the disabled field values should not be submitted (that makes sense).
I've prepared a fix in this patch: e8852586073bc23d4a41f4cd9cbe0d17a2f0c76d which is in the symfony/domcrawler-disabled-fields branch for now as I don't know if we can make this change in 2.0 or if we need to put it in 2.1.
---------------------------------------------------------------------------
by cordoval at 2011/08/23 02:15:01 -0700
oh no I was hoping to enter the authors, you already did the fix :'(
Commits
-------
e9d2a67 CS
3a64b08 Search in others user providers when a user is not found in the first user provider and throws the right exception.
Discussion
----------
Chain user provider doesn't search in all user providers
I commit these changes because Chain user provider doesn't search in all user providers.
Example with the Acme/DemoBundle:
// security.yml
...
providers:
chain_provider:
providers: [in_memory, in_memory_extend]
in_memory_extend:
users:
admin2: { password: adminpass2, roles: [ 'ROLE_ADMIN' ] }
in_memory:
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
...
firewalls:
...
secured_area:
pattern: ^/demo/secured/
provider: chain_provider OR in_memory_extend
...
We can see these logs :
security.INFO: User "admin2" has been authenticated successfully [] []
security.DEBUG: Write SecurityContext in the session [] []
security.DEBUG: Read SecurityContext from the session [] []
security.DEBUG: Reloading user from user provider. [] []
security.WARNING: Username "admin2" could not be found. [] []
The new code search in others user providers when a user is not found in the first user provider and throws the right exception.
---------------------------------------------------------------------------
by lsmith77 at 2011/08/14 12:20:04 -0700
I wonder if it should be a provider option to continue on a failed user lookup. I can see cases where you really dont want to iterate over all providers and others where you do.
---------------------------------------------------------------------------
by Abhoryo at 2011/08/14 17:27:16 -0700
If someone need a provider like you describe, he can create one.
Here we talk about a chain user provider.
Doc : [using-multiple-user-providers](http://symfony.com/doc/current/book/security.html#using-multiple-user-providers)
We can read in the doc: "The chain_provider will, in turn, try to load the user from both the in_memory and user_db providers."
But its not the case right now.
Commits
-------
c29fa9d [Form] Fix for treatment zero as empty data. Closes#1986
Discussion
----------
[Form] Fix for treatment zero as empty data. Closes#1986
For more info please read #1986.
Commits
-------
8d48cea [EventDispatcher] Change the license of EventDispatcher from LGPL to MIT
Discussion
----------
[EventDispatcher] Change the license of EventDispatcher from LGPL to MIT
It was previously agreed to re-license the Doctrine2 based
EventDispatcher refactoring to use the MIT license. However, the files
still retain the LGPL license notice.
This commit changes the license to MIT.
---------------------------------------------------------------------------
by fabpot at 2011/08/21 05:55:00 -0700
That's right but I would prefer that the PR comes from someone of the Doctrine core team like @beberlei or @jwage.
---------------------------------------------------------------------------
by fabpot at 2011/08/21 05:55:28 -0700
or at least, they can perhaps acknowledge this PR.
---------------------------------------------------------------------------
by beberlei at 2011/08/22 00:11:20 -0700
Acknowledged
It was previously agreed to re-license the Doctrine2 based
EventDispatcher refactoring to use the MIT license. However, the files
still retain the LGPL license notice.
This commit changes the license to MIT.
Commits
-------
d880db2 [Form] Test covered fix for invalid date (13 month/31.02.2011 etc.) send to transformer. Closes#1755df74f49 Patched src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php to throw an exception when an invalid date is passed for transformation (e.g. 31st February)
Discussion
----------
[Form] Fix for "DateTimeToArrayTransformer" with invalid dates
Hey,
this is test covered fix from @mdavis1982 (closes#1755)
---------------------------------------------------------------------------
by stloyd at 2011/08/16 01:31:32 -0700
@fabpot Can we have this fix merged ?
Commits
-------
34a1b53 [HttpFoundation] Do not save session in Session::__destroy() when saved already
Discussion
----------
[HttpFoundation] Saving session data in __destroy() has a side effect on functional tests
Having functional test with several non-insulated requests, TestSessionListener invokes session saving at the end of every request. But instance of Session remains in memory until it's collected by garbage collector which saves the same data again in __destroy() method. The problem is that session object can get collected after other requests changed session data (e. g. user logged in) resulting in former data overwriting the latter.
Commits
-------
275da0d [Validator] changed 'self' to 'static' for child class to override pattern constant
Discussion
----------
[Validator] change 'self::' to 'static::' for PATTERN constant overridable in child classes
In TimeValidator and UrlValidator, PATTERN constant is not used with late static bind(static::) while DateValidator supports it.
Commits
-------
80d1718 [Fix] Email() constraints now guess as 'email' field type
Discussion
----------
[Fix] Email() constraints now guess as 'email' field type
I don't know what this was set to "text"
Commits
-------
e88ecbb [Form] Fixed a typo in AbstractType phpdoc
Discussion
----------
[Form] Fixed a typo in AbstractType phpdoc
This PR is a new version of PR #1862.
Original comment :
Hi,
Nothing really awesome, but I fixed a typo in some phpdoc of the AbstractType class.
Commits
-------
09c41d3 [Security] Fixed incorrect merge of two modifications (53f5c23c and 85199677) to AclVoter
Discussion
----------
[Security] Fixed incorrect merge of two modifications to AclVoter
It seems two modifications to `AclVoter` (53f5c23c and 85199677) have been merged incorrectly, leading to a method call on an object that is known to be `null` and a fatal error when running the tests
Commits
-------
ee5b9ce [SwiftmailerBundle] Allow non-file spools
Discussion
----------
[SwiftmailerBundle] Allow non-file spools
Actually if I have the following configuration:
swiftmailer:
spool:
type: not_file
path: some_path
The DIC compiler will complain:
'The service "swiftmailer.spool.file" has a dependency on
a non-existent parameter "swiftmailer.spool.file.path"
Because the file spool service is declared no matter the spool type configured.
And it requires the file.path, which is not available.
This patch aims to load the file spooler only if required by the
configuration.
---------------------------------------------------------------------------
by cystbear at 2011/07/29 16:36:04 -0700
Nice catch Thibault.
Commits
-------
86f888f fix https default port check
Discussion
----------
fix https default port check
---------------------------------------------------------------------------
by Abhoryo at 2011/08/03 03:26:15 -0700
I think it's better to delete $httpsPort variable from the prototype and use only $httpPort variable.
public function urlRedirectAction($path, $permanent = false, $scheme = null, $httpPort = 80)
...
$port = '';
if (('http' === $scheme && 80 != $httpPort) || ('https' === $scheme && 443 != $httpPort)) {
$port = ':'.$httpPort;
}
But if this method is already used with the $httpsPort variable elsewhere, your change is ok with me.
---------------------------------------------------------------------------
by gimler at 2011/08/03 04:52:08 -0700
You can use different ports for http and https so when you call the function $scheme = null than it use the $request->getScheme() so you must add both ports so i think it is not a good idea to merge the http and https vars.
---------------------------------------------------------------------------
by gimler at 2011/08/03 04:53:17 -0700
damn sorry i have accidentally close the pull request ;(
---------------------------------------------------------------------------
by stof at 2011/08/03 05:13:24 -0700
I agree with @gimler. Merging them as a single parameter does not make sense here
---------------------------------------------------------------------------
by Abhoryo at 2011/08/03 05:33:12 -0700
I've juste think it's weird to set a useless parameter ($httpPort) when you want to use the last parameter ($httpsPort).
And I don't think someone want http protocole on 433 or https on 80 ?
---------------------------------------------------------------------------
by stof at 2011/08/03 05:35:16 -0700
@Abhoryo what if you are using this controller in a general way, without knowing by advance if the handled request is a secure one ? You need both parameters.
If you need to change the https port by keeping the default http port, you indeed need to pass it but blame PHP: it does not support named parameters.
---------------------------------------------------------------------------
by Abhoryo at 2011/08/03 06:02:18 -0700
Ok, right.
Commits
-------
4f9d229 The trace argument value could be string ("*DEEP NESTED ARRAY*")
6e7439e expanded namespaces within phpdoc (special for PhpStorm)
f0a6ee5 merge from master
8519967 Calling supportsClass from vote to find out if we can vote
Discussion
----------
The trace argument of an exception can be string (*DEEP NESTED ARRAY*) but with an array type specified
It leads to the exception of a foreach loop:
Invalid argument supplied for foreach() /.../vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php:103
Commits
-------
ae55a98 Added $format in serialize() method, to keep consistence and give a hint to the normalizer.
Discussion
----------
Added $format in serialize() method, to keep consistence and give a hint
Added $format in serialize() method, to keep consistence and give a hint to the normalizer.
---------------------------------------------------------------------------
by Seldaek at 2011/08/12 02:06:19 -0700
👍
Commits
-------
81fb8e1 [DomCrawler] fix finding charset in addContent
Discussion
----------
[DomCrawler] fix finding charset in addContent
According to http://www.ietf.org/rfc/rfc2045.txt content type can include other field after charset. So they should be cut.
This allows as to define default like this
foo:
pattern: /{_locale}/login
defaults:
_controller: my_login_controller:loginAction
_locale: %session.default_locale%
Commits
-------
e78bc32 Fixed: Notice: Undefined index: enable_annotations in ...
Discussion
----------
Fixed: Notice: Undefined index: enable_annotations in ...
---------------------------------------------------------------------------
by stloyd at 2011/08/04 03:57:49 -0700
IMO `isset()` should be good enough here.
---------------------------------------------------------------------------
by stof at 2011/08/04 04:18:20 -0700
I don't see how such a notice could occur. There is a default value for this node so as soon as the validation node exists, there will be a value for this node. Could you give an example of configuration that causes the notice ?
---------------------------------------------------------------------------
by mvrhov at 2011/08/04 04:23:33 -0700
I don't have any validation node set up in my config in such a case it seems that sub nodes doesn't get build. So it seems that I found a bug in config builder.
---------------------------------------------------------------------------
by stof at 2011/08/04 04:54:05 -0700
This is in fact due to a hackish stuff in the DI extension. It changes the configuration after using the Config component to merge them in the case where you enable the forms without enabling the validator, to force enabling it.
Commits
-------
ba6a09d [DoctrineBundle] Adding a message in doctrine:generate:entities to notify people when a backup file is created
Discussion
----------
[DoctrineBundle] Adding a message in doctrine:generate:entities to notify
Hey guys!
This adds a message to the doctrine:generate:entities command when a backup file is created. This is because the backup file causes confusion in some cases (where did it come from?) and in rare cases - for reasons I don't know yet - the backup file causes "Cannot redeclare class ..." errors.
This is a not a BC-break, but of course could potentially cause an issue if there's some edge case that line 112 doesn't consider. For that reason, I'm pulling against master instead of 2.0.
Thanks!
Commits
-------
6738d2b [FrameworkBundle] Adding information about exactly which cache is being cleared.
Discussion
----------
[FrameworkBundle] Adding information about env being cleared
Hey guys!
I think the `cache:clear` confuses some people - they're expecting it to wipe out any and all cache (not just the cache for a specific env+debug mode). So, this adds details on *what* is being cleared, which should at least help.
I'll also put more information into the docs.
Thanks!
---------------------------------------------------------------------------
by jmikola at 2011/08/07 18:48:48 -0700
👍 on dumping the environment at output. Does the debug option mean anything in this context, though?
---------------------------------------------------------------------------
by weaverryan at 2011/08/07 19:57:18 -0700
I can't think of a spot where it makes a difference, but of course it *could* theoretically make a difference. The command's "help" message seems to indicate that it should be treated like there's a difference, so I followed suit.
But yes, environment is the big concern, hopefully nobody gets too hung up on the debug - one of those things where I think we technically need it, but practically don't.
---------------------------------------------------------------------------
by brikou at 2011/08/08 00:44:00 -0700
@weaverryan it would also be interesting to display the env used also for router:debug and probably other commands
---------------------------------------------------------------------------
by stof at 2011/08/08 01:13:58 -0700
@weaverryan It does make a difference when warùing up the cache (which is done by default when clearing it): many service definitions change according to the debug flag, so dumping the debug container seems a weird idea (the first request will need to dump the non-debug container as they have different names). But bigger issue: some cache warmer depend of the debug state (the Doctrine one IIRC) so the warming-up would do weird things if you run the prod CLI in debug mode.
Commits
-------
b8ee401 Making the english smoother in command help description
Discussion
----------
Making the english smoother in command help description
Pretty simple :)
Thanks!
Commits
-------
c0571fc [ClassLoader] Improve exception messages of the debug class loader
Discussion
----------
[ClassLoader] Improve exception messages of the debug class loader
---------------------------------------------------------------------------
by Seldaek at 2011/07/31 14:01:40 -0700
Ok, I updated this to just clarify the message, because when I got the issue after some serious copy-paste coding, I thought it was quite confusing - it seems to imply you mistyped the class name when using the class, and therefore it was not found, while the typo is in the class's file itself.
Actually if I have the following configuration:
swiftmailer:
spool:
type: not_file
path: some_path
The DIC compiler will complain:
'The service "swiftmailer.spool.file" has a dependency on
a non-existent parameter "swiftmailer.spool.file.path"
Because the file spool service is declared no matter the spool type configured.
And it requires the file.path, which is not available.
This patch aims to load the file spooler only if required by the
configuration.
Commits
-------
cf598de [FrameworkBundle] Updated the Chinese translations by @heccjj
e16ddcf [FrameworkBundle] Renamed validators.cn.xliff to validators.zh_CN.xliff
62da90a [FrameworkBundle] Fixed the Chinese translations by @heccjj
057cf2f Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.cn.xliff via GitHub
Discussion
----------
[FrameworkBundle] Updated the Chinese translations
Commits
-------
7d5785e Fixed message 8
8ef3647 Updated danish validator translation
Discussion
----------
Updated Danish translation of validator strings
Just an updated Danish translation as requested.
---------------------------------------------------------------------------
by yethee at 2011/07/27 23:25:11 -0700
@cvaldemar, can you fix message #8?
Commits
-------
c558b78 avoid rendering the `ChoiceType` separator if all `choices` are `preferred_choices`
Discussion
----------
avoid rendering the `ChoiceType` separator if all `choices` are `preferred_choices`
---------------------------------------------------------------------------
by fabpot at 2011/07/24 00:51:21 -0700
The same change should be made to the PHP template.
---------------------------------------------------------------------------
by fabpot at 2011/07/25 00:31:39 -0700
I forgot to ask you to add some unit tests too. Thanks.
---------------------------------------------------------------------------
by craue at 2011/07/25 10:23:34 -0700
Are you asking for PHPUnit tests? If so, unfortunately, I'm not able to add those because I haven't used PHPUnit yet. ;)
---------------------------------------------------------------------------
by lenar at 2011/07/25 12:47:51 -0700
I would prefer ```choises | length``` without spaces as everywhere else.
---------------------------------------------------------------------------
by lenar at 2011/07/25 12:50:32 -0700
@fabpot: Since <option disabled> is unclickable in browser (by HTML spec) this really doesn't change anything (something not there is as unclickable) except the the look when rendered. I have hard time to imagine what could become unit-testable here by this change.
---------------------------------------------------------------------------
by stof at 2011/07/25 13:03:47 -0700
@lenar unit testing is not about what the browser could do. What should be unit-tested is that an example will only preferred choices does not output the separator, which is exactly what this PR is about
---------------------------------------------------------------------------
by stof at 2011/07/25 13:04:03 -0700
@lenar unit testing is not about what the browser could do. What should be unit-tested is that an example will only preferred choices does not output the separator, which is exactly what this PR is about
---------------------------------------------------------------------------
by lenar at 2011/07/25 13:08:33 -0700
@stof: ok, put this way you are definitely right.
---------------------------------------------------------------------------
by craue at 2011/07/25 13:37:50 -0700
@lenar: You're right about the spaces. I'm using them in my projects but will remove them here for the sake of consistency.
---------------------------------------------------------------------------
by stloyd at 2011/07/25 13:40:40 -0700
@craue I will write today/tomorrow test to cover your code and send you PR.
---------------------------------------------------------------------------
by craue at 2011/07/25 14:00:26 -0700
@stloyd: That would be nice. But I'm still not that familiar with Git(Hub). Is there anything I have to take care of?
Also, I'd like to squash my three commits into one ... if this is possible for an open PR and if I find out how to do that easily. :D
---------------------------------------------------------------------------
by fabpot at 2011/07/26 00:18:22 -0700
@craue: yes, you should squash your commits into one and use `--force` when you push (the PR will automatically be updated accordingly).
Commits
-------
85c0087 [TwigBridge] Made the locale configurable for the trans and transchoice tags
3ea31a0 [TwigBridge] Made the locale configurable for the trans and transchoice filters
Discussion
----------
Trans locale
This allows setting the locale when translating in a Twig template. This was already allowed in the Translator and in the PHP templates
Commits
-------
0832f4d Updated Persian translation
2a4fca8 translated validators resources into Persian
Discussion
----------
Persian translation
Added Persian validator translations
Commits
-------
be4b77d Updated Romanian translation
Discussion
----------
Updated Romanian translation
Updated Romanian translation for validation messages to match the latest messages.
Commits
-------
321dd45 Updated spanish and catalan translations
Discussion
----------
Updated spanish and catalan translations
Added new translations based on the indonesian updated file.
Commits
-------
9d8e6f6 [FrameworkBundle] Changed TraceableEventDispatcher to log calls to event listeners _before_ actually calling them
Discussion
----------
[FrameworkBundle] Log calls to event listereners _before_ calling them
The current implementation of `TraceableEventDispatcher` logs calls to event listeners _after_ actually calling them. This leads to strange logs when an event listener triggers another event.
For example, if I attach some `LoginListener` to the `security.interactive_login`-event, the log will look something like this:
<pre>
...
User "myusername" has been authenticated successfully
Notified event "security.interactive_login" to listener "MyVendor\MyBundle\EventListener\LoginListener::onSecurityInteractiveLogin".
Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
...
</pre>
From the logs it looks like the `kernel.request` event was fired after the user was authenticated, whereas it was actually the listener to `kernel.request` that caused the user to be authenticated.
By logging the call to the event listener _before_ calling it, the logs will look like this:
<pre>
...
Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest".
Notified event "security.interactive_login" to listener "MyVendor\MyBundle\EventListener\LoginListener::onSecurityInteractiveLogin".
User "myusername" has been authenticated successfully
...
</pre>
In my opinion this makes the causal relationship between the events clearer.
---------------------------------------------------------------------------
by stof at 2011/07/24 11:18:48 -0700
👍 for this.
Commits
-------
5219f81 Using the $status parameter instead of fixed value when creating a RedirectResponse.
Discussion
----------
Using the $status parameter instead of fixed value
I checked the usages and the optional `$status` parameter is never used, so maybe another option would be to remove the parameter completely...
---------------------------------------------------------------------------
by jaugustin at 2011/07/25 03:11:00 -0700
maybe you could test that $status is a valid redirect code
---------------------------------------------------------------------------
by stloyd at 2011/07/25 04:40:21 -0700
@jaugustin This check is already included in `RedirectResponse` class.
Commits
-------
266e60e Don't tell a lie to every WebServers
Discussion
----------
Please don't tell a lie to every WebServers
Fake Useragent name should be only in test case .
Commits
-------
03c7cfe UrlGenerator no longer appends '?' if query string is empty
Discussion
----------
UrlGenerator no longer appends '?' if query string is empty
If you generate a URL using null parameters (`array('foo' => null, 'bar' => null')`), `http_build_query` returns an empty string, resulting in a trailing `?` at the end of the generated URL.
This fixes that so that, if there are `$extra` params & `http_build_query` is empty, the URL is no longer appended.
---------------------------------------------------------------------------
by fabpot at 2011/07/22 10:15:26 -0700
Can you add unit tests?
---------------------------------------------------------------------------
by ericclemmons at 2011/07/22 10:52:21 -0700
Yes sir, will do.
-Eric Clemmons
Sent from my iPad Nano
On Jul 22, 2011, at 12:15 PM, fabpot<reply@reply.github.com> wrote:
> Can you add unit tests?
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1773#issuecomment-1633515
---------------------------------------------------------------------------
by ericclemmons at 2011/07/22 11:55:30 -0700
**Added passing test.**
Currently `master` fails test:
```
1) Symfony\Tests\Component\Routing\Generator\UrlGeneratorTest::testUrlWithNullExtraParameters
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-http://localhost/app.php/testing
+http://localhost/app.php/testing?
//tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php:114
```
If not, as classes can be loaded during the boot, there is no way to be sure that
a class will not be already loaded by a third party bundle.
If the Kernel is already booted, we don't included the compiled classes.
Revert "[Form] CollectionType now checks for data_class parameter instead of only class."
This reverts commit 2e024f87a3.
Conflicts:
tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
Revert "[Form] Added ObjectFactoryListener. Fixes #1746."
This reverts commit 0327beb0b9.
Conflicts:
tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
Commits
-------
eae6a77 fixed wrong case
d0a175bfixes#1659f300ede fixes several bugs
a4f05ac added some tests
Discussion
----------
Http util fixes
Fixes several bugs in the http utils.
Please don't add anymore features without sufficient tests. Especially for the Security\Http namespace, regressions are very likely otherwise.
---------------------------------------------------------------------------
by fabpot at 2011/07/19 22:37:26 -0700
Tests do not pass for me:
There were 2 errors:
1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #0 ('en')
InvalidArgumentException: The current node list is empty.
.../src/Symfony/Component/DomCrawler/Crawler.php:604
.../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16
2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de')
InvalidArgumentException: The current node list is empty.
.../src/Symfony/Component/DomCrawler/Crawler.php:604
.../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16
--
There were 4 failures:
1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #0 ('en')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-http://localhost/en/login
+http://localhost/login
.../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
.../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38
2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #1 ('de')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-http://localhost/de/login
+http://localhost/login
.../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
.../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38
3) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #0 ('en')
HTTP/1.0 302 Found
Cache-Control: no-cache
Content-Length: 299
Content-Type: text/html; charset=UTF-8
Date: Wed, 20 Jul 2011 05:36:27 GMT
Location: http://localhost/login
Set-Cookie: PHPSESSID=11c9c6a7e7620e13bddef223a5ba46d9; path=/; domain=
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="1;url=http://localhost/login" />
</head>
<body>
Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
</body>
</html>
Failed asserting that <integer:0> matches expected <integer:1>.
.../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50
4) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #1 ('de')
HTTP/1.0 302 Found
Cache-Control: no-cache
Content-Length: 299
Content-Type: text/html; charset=UTF-8
Date: Wed, 20 Jul 2011 05:36:28 GMT
Location: http://localhost/login
Set-Cookie: PHPSESSID=2bbe63786a088471ade3717917f4ba4f; path=/; domain=
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="1;url=http://localhost/login" />
</head>
<body>
Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
</body>
</html>
Failed asserting that <integer:0> matches expected <integer:1>.
.../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50
---------------------------------------------------------------------------
by schmittjoh at 2011/07/19 23:47:29 -0700
I fixed a wrong case, but I couldn't reproduce the other errors (tested on Ubuntu).
My guess is that the temporary directory on your machine couldn't be deleted for some reason, and the test runs with the configuration of some of the previous tests.
---------------------------------------------------------------------------
by fabpot at 2011/07/20 00:28:41 -0700
That does not make any difference for me. For instance, in `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request to `'/'.$locale.'/login'` returns the following Response:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="1;url=http://localhost/login" />
</head>
<body>
Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
</body>
</html>
---------------------------------------------------------------------------
by schmittjoh at 2011/07/20 00:31:34 -0700
That's weird, did you make sure that the temporary directory does not exist?
``rm -Rf /tmp/StandardFormLogin/``
On Wed, Jul 20, 2011 at 9:28 AM, fabpot <
reply@reply.github.com>wrote:
> That does not make any difference for me. For instance, in
> `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request
> to `'/'.$locale.'/login'` returns the following Response:
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8" />
> <meta http-equiv="refresh" content="1;url=
> http://localhost/login" />
> </head>
> <body>
> Redirecting to <a href="http://localhost/login">
> http://localhost/login</a>.
> </body>
> </html>
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1739#issuecomment-1613504
>
---------------------------------------------------------------------------
by fabpot at 2011/07/20 00:33:40 -0700
Yes, I've just checked and the directory does not exist.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/20 00:39:55 -0700
Sorry, I can't reproduce it on Ubuntu and unless someone wants to sponsor me a Mac, there is not much I can do.
Commits
-------
2e024f8 [Form] CollectionType now checks for data_class parameter instead of only class.
0327beb [Form] Added ObjectFactoryListener. Fixes#1746.
Discussion
----------
[Form] Added ObjectFactoryListener. Fixes#1746.
---------------------------------------------------------------------------
by marcw at 2011/07/21 09:32:17 -0700
This patch also fixes a validation issue because it was impossible for the validator to validate an array.
---------------------------------------------------------------------------
by stof at 2011/07/21 09:47:46 -0700
yeah, using the data_class of the prototype would be great
This commit also fixes exception pages when Twig is not enabled as a templating engine.
Instead of just displaying the raw Twig template as before, we now fallback to the default
exception handler introduced some time ago.
when esi is enabled and internal uris are generated for esi-tags, an
attribute-array consisting entirely of null-values isn't handled correctly.
The reason is that php's `http_build_query()`-method outputs an empty string
for such arrays:
http_build_query(array('foo' => '')) == 'foo='
http_build_query(array('foo' => null)) == ''
In the latter case, the generation of an URI in `HttpKernel::generateInternalUri()`
generates an URI that could not be matched by the corresponding route (ex.
`_internal/Controller/.html` opposed to `_internal/Controller/none.html` which
should be expected).
This commit adds a possible solution as well as a simple test for this issue.
Commits
-------
9bcce9f fix tests
fc4787a fix non-extensible router
Discussion
----------
Router fix
Right now, the router is hard to overwrite (you need always a compiler pass). This commit fixes this.
---------------------------------------------------------------------------
by fabpot at 2011/07/18 01:15:36 -0700
Why do you need a complier pass to override the router?
---------------------------------------------------------------------------
by schmittjoh at 2011/07/18 01:47:47 -0700
How would you suggest to overwrite it?
Basically, I want to do something like this:
```yml
services:
router:
parent: router.default
class: MyClass
calls:
- [moreDeps, []]
```
---------------------------------------------------------------------------
by Seldaek at 2011/07/18 05:07:19 -0700
Then maybe we should somehow support redefining services with the same name while keeping the old one as parent, otherwise we need this foo.default for every service out there?
---------------------------------------------------------------------------
by fabpot at 2011/07/18 06:30:34 -0700
as @Seldeak said, why do that for the router and not all services?
---------------------------------------------------------------------------
by schmittjoh at 2011/07/18 06:38:39 -0700
I have designed the SecurityBundle this way where extension is encouraged.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/18 11:15:57 -0700
I should add that this is mainly a problem for services where you still want to use the semantic configuration that is provided by the bundle. For services which are not configured by the extension, this is not so much of an issue.
Anyway, if you don't want to merge it, just close the PR. I have no problem with using a compiler pass.
---------------------------------------------------------------------------
by fabpot at 2011/07/18 11:55:11 -0700
We already have such a case with translator and translator.real. I will review the existing services to see where it makes sense to implement the same strategy.
---------------------------------------------------------------------------
by Seldaek at 2011/07/18 12:20:55 -0700
I guess you'd do it anyway, but we should pick a winner between .real and .default
---------------------------------------------------------------------------
by lsmith77 at 2011/07/18 12:26:52 -0700
I would prefer ".default" as ".real" always confused me.
Commits
-------
95011ce [HttpFoundation] Fixed creation of requests without a path.
Discussion
----------
[HttpFoundation] Fixed creation of requests without a path.
Providing urls with no path led to php warning that the index 'path' is
not set. This patch initializes 'path' if no path is set.
Commits
-------
8e169e4 Improved performance when assetic's use_controller is enabled
Discussion
----------
Improved performance when assetic's use_controller is enabled
When assetic's use_controller is enabled, assetic has to loop through all the templates and create TemplateReferences through the assetic FileResource. This in turn causes a lot of calls to getLogicalName() leading to 5x the calls to the TemplateReference's get() (16k in my case). By accessing the protected field directly compared to using get() we achieve better performance during development (33% in my case).
---------------------------------------------------------------------------
by beberlei at 2011/07/18 11:22:43 -0700
+1 - assetic is a huge performance drain for my app in dev mode aswell.
Commits
-------
5d17b92 [DoctrineBridge] Optimized the mapping drivers
Discussion
----------
[DoctrineBridge] Optimized the mapping drivers
This avoids loading all mappings when calling ``isTransient`` as it adds an overhead.
---------------------------------------------------------------------------
by beberlei at 2011/07/18 11:35:36 -0700
Its much better than the original one.
---------------------------------------------------------------------------
by stof at 2011/07/18 11:53:09 -0700
For the mapping defined in a specific class, this simply checks if the file exists (like Doctrine's implementation) but reusing the other method to keep the code DRY.
There is still an overhead when using a global mapping file but I don't see a way to avoid loading the file.
Commits
-------
872d308 [DoctrineBundle] Allowed to configure dql functions without using the multiple entity mangers syntax
Discussion
----------
[DoctrineBundle] Allowed to configure dql functions using the single EM syntax
[DoctrineBundle] Allowed to configure dql functions without using the multiple entity managers syntax
Commits
-------
b9bdab8 DoctrineAclCache unserialize sets the acl to the wrong field
Discussion
----------
DoctrineAclCache unserialize sets the acl to the wrong field
Upon unserialize of the acl, the acl is currently set to the id field which should be a string. Currently it passes the acl object into the id field which causes the following error upon unserialize.
Warning: Illegal offset type in isset or empty in Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404
This is because at line 404, $ace->getId() returns an Acl object not an id and the acl field in $ace is null.
if (isset($this->loadedAces[$ace->getId()])) {
---------------------------------------------------------------------------
by fabpot at 2011/07/16 09:31:42 -0700
@schmittjoh?
---------------------------------------------------------------------------
by schmittjoh at 2011/07/16 23:19:06 -0700
Yes, this fix is good.
Commits
-------
d37ff15 removed unused code
2d3051f tabs -> spaces
2c224ce improves the exception message, and removes unnecessary constraint to only allow strings inside strings
d0b056c fixes a bug where getParameterBag() always returns null
Discussion
----------
Fixes a bug in PHPDumper, and in parameter resolving
Commits
-------
eb85cc5 fixes a bug where the cookie was wrongly considered expired
Discussion
----------
fixes a bug where the cookie was wrongly considered expired
On a related note, what do you think about adding some more functional tests here? Not only phpunit, but I would also suggest to add behat tests since there are a lot of things which are not picked up by the in process request emulation, but only by a real client.
@fabpot, @everzet, what do you think?
Commits
-------
5e80c68 fixes a naming inconsistency
8cfca15 added change to upgrade file
4123ec4 updated some missing references
Discussion
----------
Fix inconsistent naming
---------------------------------------------------------------------------
by jalliot at 2011/07/15 08:15:01 -0700
I think you forgot one commit (the one effectively changing Session and that you reverted in the main repo)
---------------------------------------------------------------------------
by schmittjoh at 2011/07/15 09:07:17 -0700
You're right, fixed now.
When assetic's use_controller is enabled, assetic has to loop through all the templates and create TemplateReferences through the assetic FileResource. This in turn causes a lot of calls to getLogicalName() leading to 5x the calls to the TemplateReference's get() (16k in my case). By accessing the protected field directly compared to using get() we achieve better performance during development (33% in my case).
Upon unserialize of the acl, the acl is currently set to the id field which should be a string. Currently it passes the acl object into the id field which causes the following error.
Warning: Illegal offset type in isset or empty in Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404
Commits
-------
71cfb56 Thrown a \RuntimeException in RequestMatcher::checkIp6() if PHP is compiled with the option "disable-ipv6"
Discussion
----------
[HttpFoundation] Problem with RequestMatcher if PHP is compiled with the option "disable-ipv6"
Thrown a \RuntimeException in RequestMatcher::checkIp6() if PHP is compiled with the option "disable-ipv6".
Commits
-------
05cc24c [Yaml] Wrap numeric strings in quotes when dumping
Discussion
----------
[Yaml] Wrap numeric strings in quotes when dumping
This addresses an obscure case where a hash string (actually a commit-ish, "686e444") was dumped to YAML as an unquoted string value. It was later parsed from YAML as an exponential numeric and changed to ".Inf".
This commit should not change the existing behavior when dumping non-string numerics. It also doesn't appear to disturb any of the other test cases. I realize it's a huge edge case, so I'm open to discussion.
The alternative to this fix was an ugly `preg_replace()` to apply quoting around the commit-ish after dumping. I would look forward to removing that :)
This addresses an obscure case where a hash string (actually a commit-ish, "686e444") was dumped to YAML as an unquoted string value. It was later parsed from YAML as an exponential numeric and changed to ".Inf".
Commits
-------
29e4063 [Security] changed order of checks to check for more specific things first
Discussion
----------
[Security] changed order of checks
Commits
-------
61de80d [FrameworkBundle] Updated the Dutch validator translations for the changes in 95f7eedd63
Discussion
----------
[FrameworkBundle] Updated the Dutch validator translations
[FrameworkBundle] Updated the Dutch validator translations for the changes in 95f7eedd63
Commits
-------
64e9263 Updated UPDATE.md
7cf891a Renamed variable returned and used self in place of static for constants
f91f4dd Added the possibility to set cookies with the same name for different domains and paths for Symfony\Component\HttpFoundation\ResponseHeaderBag
f08eeb4 Moved managing cookies of HeaderBag in ResponseHeaderBag
Discussion
----------
[HttpFoundation] Cookies management in ResponseHeaderBag
Fixed cookies management in `Symfony\Component\HttpFoundation\HeaderBag` and `Symfony\Component\HttpFoundation\ResponseHeaderBag`
Commits
-------
26ff05bfixes#1538
Discussion
----------
fixes#1538
Constructor of Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity
--------------------------------------------------------------------------------------------------------
currently it check if the argument is instance of Symfony\Component\Security\Core\Role\Role by
``if ($role instanceof Role)``
Maybe it should be changed to
``if ($role instanceof RoleInterface)``
Because if we use another Role class which implements RoleInterface
it dosen't work when we check access, it will throw a *NoAceFoundException* when vote
Commits
-------
66c698a Updated update.md
b33e1ba [SecurityBundle] Reported namespace change of EntityUserProvider
26e96c4 [DoctrineBridge] Changed namespace of EntityUserProvider[B
1633cb3 [Security] Moved EntityUserProvider to Doctrine Bridge
Discussion
----------
[2.1] Moved EntityUserProvider class from Security Component to Doctrine Bridge
I guess that this should better be placed in the Doctrine Bridge.
---------------------------------------------------------------------------
by henrikbjorn at 2011/07/13 00:00:39 -0700
Missing entry in UPDATE.md
---------------------------------------------------------------------------
by schmittjoh at 2011/07/13 00:34:10 -0700
What is our distribution strategy for these bridges?
---------------------------------------------------------------------------
by stof at 2011/07/13 00:53:29 -0700
@schmittjoh Each bridge (Doctrine, Twig, Monolog) is available as a separate repo just like the components.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/13 00:57:41 -0700
I've just checked, but we don't seem to have PEAR packages for these.
If we make this change, then it should still be easy to install the component because there is no benefit of moving this class there. The bridges are mainly useful for extracting code from bundles.
---------------------------------------------------------------------------
by stof at 2011/07/13 01:02:42 -0700
@fabpot any plan to add the bridges on the PEAR channel ?
---------------------------------------------------------------------------
by fabpot at 2011/07/13 02:27:05 -0700
@stof: Bridges will be added with the RC5 release.
Commits
-------
ad2b224 [FrameworkBundle] Updated Russian translations.
95f7eed [FrameworkBundle] Fixed messages of the Choice constraint in all translations.
Discussion
----------
[FrameworkBundle] Fixes for all translations
Fixed the source messages of the choice contstraint for all translations, and re-sort messages.
And also updated Russian translations, added translations for all constraints.
Commits
-------
91cfb24 Made namespace for Doctrine cache unique to each environment
Discussion
----------
Made the cache namespace for the Doctrine cache extension unique to each environment
The current cache namespace for the Doctrine adapters is unique on an entity manager and the kernel root directory; however, it causes problems as settings for entity managers can differ between environments, so the addition of the environment into the namespace would address the issue.
$namespace = 'sf2orm_'.$entityManager['name'].'_'.md5($container->getParameter('kernel.root_dir'));
Solves issues with the cache not being valid for the DBAL ACL provider using D2 as the cache and switching environments.
An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or empty in ../vendor/symfony/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404")
Commits
-------
df34e0e [FrameworkBundle] Fix for setting a custom file link format (fixes#1652)
Discussion
----------
[FrameworkBundle] Fix for setting a custom file link format (fixes#1652)
[FrameworkBundle] Fix for setting a custom file link format (fixes#1652)
Solves issues with the cache not being valid for the DBAL ACL provider using D2 as the cache and switching environments.
An exception has been thrown during the rendering of a template ("Warning: Illegal offset type in isset or empty in ../vendor/symfony/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php line 404")
Commits
-------
2a24603 [Routing] Allow multiple `@Route` annotations with a default name on a single method (fixes#1647)
Discussion
----------
[Routing] Allow multiple `@Route` annotations with a default name
[Routing] Allow multiple `@Route` annotations with a default name on a single method (fixes#1647)
Before this change, the default name would be the same for multiple `@Route` with a default name on the same method. Then only the last declared route is active.
The defaults names are (for consecutive `@Route`s):
* former_default,
* former_default_1,
* former_name,
* former_default_2,
* ...
The FrameworkExtraBundle needs to be updated in sync with this PR: https://github.com/sensio/SensioFrameworkExtraBundle/pull/50
Commits
-------
95ca258 Fixed problems with running processes returns wrong exitcode (-1) on Linux.
Discussion
----------
#1636
Fixed problems with running processes returns wrong exitcode (-1) on Linux.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/11 11:07:42 -0700
This doesn't concern this PR specifically, but can we somehow start adding tests for this class? The process component seems like the by far most unstable code that we have.
---------------------------------------------------------------------------
by fabpot at 2011/07/11 23:07:43 -0700
@schmittjoh: Problem is that the behavior highly depends on the platform and PHP version.
---------------------------------------------------------------------------
by fabpot at 2011/07/11 23:14:23 -0700
@schmittjoh: By the way, we have added a bunch of tests recently (2d29a82412 (tests)/Symfony/Tests/Component/Process). Things are also "unstable" because the behavior depends on the amount of input, the amount of output, and when things happens. That means that it is also impossible to cover all possible cases reliably.
Commits
-------
d34caee merged and unified blocks `field_label` and `form_label` into `generic_label`
Discussion
----------
merged and unified blocks `field_label` and `form_label` into `generic_label`
Commits
-------
11369eb Fixed phpdoc
dbe1854 Added a AccessDeniedHttpException to wrap the AccessDeniedException.
Discussion
----------
Added a AccessDeniedHttpException to wrap the AccessDeniedException.
This is a proposal to fix#1631
It wraps the AccessDeniedException in an AccessDeniedHttpException when the firewall is not able to handle it itself. This allows getting a 403 response using the standard exception listener in this case.
Note that the app should not throw the AccessDeniedHttpException itself but keep using the AccessDeniedException to let the Security component check if the user is already fully authenticated or if it should give a chance to authenticate.
---------------------------------------------------------------------------
by fabpot at 2011/07/11 07:10:12 -0700
For reference, I've tried something more radical some time ago here: https://github.com/symfony/symfony/pull/369.
---------------------------------------------------------------------------
by stof at 2011/07/11 07:22:07 -0700
my implementation is what @schmittjoh suggested in the comments on your PR.
Commits
-------
52fdd53 [Bridge/Twig] Add required class to labels that match required fields
Discussion
----------
[Bridge/Twig] Add required class to labels that match required fields
I have used this to simply style labels that are required with a red star behind them using this CSS:
``` css
label.required::after {
content: " *";
color: #c00;
}
```
The problem is that you can't use `input[required] + label::after` as a selector since the label is typically rendered before the input. There is no way to check for an element that is *followed by* another, only elements *following*.
Of course this CSS in particular won't work except in the latest browsers, but you could still use the `label.required` selector to add a background image and so on. I think this is a very common use case and therefore I think it'd benefit the core framework.
---------------------------------------------------------------------------
by fabpot at 2011/07/05 01:27:49 -0700
Can you also update the PHP templates?
---------------------------------------------------------------------------
by schmittjoh at 2011/07/05 01:43:33 -0700
How about namespacing these css classes, like for example "sf-form-required"?
---------------------------------------------------------------------------
by stloyd at 2011/07/05 01:50:58 -0700
I would prefer an @schmittjoh naming, or even adding ability to setup it thought options.
---------------------------------------------------------------------------
by fabpot at 2011/07/05 01:54:36 -0700
Please, do not add more options. Prefix with `sf` is actually a good idea but people will argue that this is not a good idea because it gives too much information about the technology used to create the website (that's one of the things that came up pretty often in symfony1).
---------------------------------------------------------------------------
by schmittjoh at 2011/07/05 02:00:11 -0700
An option is not such a good idea imo since you likely want to have a uniform naming strategy across your entire site. How about adding a new service CssNamingStrategy?
---------------------------------------------------------------------------
by stloyd at 2011/07/05 02:01:19 -0700
Then this can be some simpler one not giving such informations i.e.: `form-label-required`, `label-required`, `framework-form-required`, `form-required` or whatever else ;-)
---------------------------------------------------------------------------
by fabpot at 2011/07/05 02:16:41 -0700
It cannot be configurable as it would potentially break bundles that come with stylesheets.
---------------------------------------------------------------------------
by stloyd at 2011/07/05 02:21:10 -0700
IMO if we decide to add this one, we could add same to `inputs/selects/etc` with `required` option.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/05 02:21:59 -0700
I think it can, consider an interface like this:
```php
interface CssNamingStrategyInterface
{
function getCssName($class);
}
```
This will give people a lot of flexibility, and it also does allow them to exclude classes which for example are provided by third-party bundles.
---------------------------------------------------------------------------
by Seldaek at 2011/07/05 02:47:54 -0700
Wow guys, if this turns into a full blown class generator solution, I'm happy to close the PR.
"required" is not a name that's commonly used for main page elements, it's typically associated with forms, and therefore I don't see the need to make it unnecessary longer/namespaced. Similarly I don't see the need to add it to the input/select/.., because they already have an attribute, which you can very easily select as: `input[required]` in CSS. That works everywhere except IE6, but we can't build for the future on very old browsers. If you really want support for IE6, you can override the templates imo. But core should be looking forward, as it already is with HTML5, form markup, etc.
As for calling it form-label-required or label-required, again, I don't see the benefit, you can use `label.required` if you want to avoid conflicts with non-label elements having a required class, or a safer `form .required`. There are plenty of options in CSS itself, let's not make this overly complex.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/05 02:52:17 -0700
see
http://code.google.com/intl/de-DE/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors
On Tue, Jul 5, 2011 at 11:47 AM, Seldaek <
reply@reply.github.com>wrote:
> Wow guys, if this turns into a full blown class generator solution, I'm
> happy to close the PR.
>
> "required" is not a name that's commonly used for main page elements, it's
> typically associated with forms, and therefore I don't see the need to make
> it unnecessary longer/namespaced. Similarly I don't see the need to add it
> to the input/select/.., because they already have an attribute, which you
> can very easily select as: `input[required]` in CSS. That works everywhere
> except IE6, but we can't build for the future on very old browsers. If you
> really want support for IE6, you can override the templates imo. But core
> should be looking forward, as it already is with HTML5, form markup, etc.
>
> As for calling it form-label-required or label-required, again, I don't see
> the benefit, you can use `label.required` if you want to avoid conflicts
> with non-label elements having a required class, or a safer `form
> .required`. There are plenty of options in CSS itself, let's not make this
> overly complex.
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1519#issuecomment-1502560
>
---------------------------------------------------------------------------
by Seldaek at 2011/07/05 03:11:50 -0700
Really? Come on, we're talking about forms, it's not like you have billions of form/input tags per page that have to be parsed by the browser when you select that. Also you don't have to select the elements, if you want true performance just use no stylesheet, your users will thank you.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/05 03:30:40 -0700
Your CSS selectors not only affect the performance of form elements, but of all elements that have a "required" class. Likewise, the same applies if we decide to add more classes.
Why close the door for people who care about performance? We can easily avoid this by making the css class more specific as suggested earlier. The idea with the renaming strategy is one step further and allows people to "obfuscate" which tool was used to generate the form, or do additional optimizations like shortening the css name.
---------------------------------------------------------------------------
by lenar at 2011/07/05 03:34:34 -0700
@Seldaek: Just for remark I've seen matrix forms spanning multiple screenfuls horizontally and vertically
containing tens of thousands inputs. Not pretty, but they do exist. Basically "poor" man's/company's excel
emulation or something.
---------------------------------------------------------------------------
by Seldaek at 2011/07/05 04:19:13 -0700
@schmittjoh, @lenar: We're catering to the most common use case, for which this will be more than fast enough. Small/medium scale websites don't have to optimize on CSS rules parsing, they usually have much bigger issues to deal with. If you really care about it, overriding the block to remove the class is just as easy as it was to for me to add it, but IMO this is the edge case.
---------------------------------------------------------------------------
by schmittjoh at 2011/07/05 05:37:19 -0700
IMO Symfony should follow best practices by encouraging to use class selectors, and not tag selectors for the reasons explained on the page I linked.
Anyway, I think everybody made his points. Time for @fabpot to make a decision :)
Commits
-------
22a49f1 Better docstring for FormError constructor
Discussion
----------
Better docstring for FormError constructor
Better docs for placeholder format of FormError.
Commits
-------
24e0d71 [FrameworkBundle] Fix a translatable string from the Form default validator
30d348d [Form] Make the default invalid message translatable
Discussion
----------
[Form] Translation
The first commit adds the ability to customize the default message when the form is invalid:
* Make it an option in the form builder,
* Allow placeholders in the message,
* The default value `This value is not valid` exists in the translation files.
The second commit updates a source string in the XLIFF files to make it translatable. All translations should be updated accordingly. The source string is from the [default validator](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Validator/DefaultValidator.php#L27).
This PR should fix The issue #997.
---------------------------------------------------------------------------
by fabpot at 2011/07/11 01:53:05 -0700
The first commit is not about making the message translatable, but to make it customizable (as the message is used for very different purposes depending on the Type).
---------------------------------------------------------------------------
by fabpot at 2011/07/11 01:55:11 -0700
The "This value is not valid" string should be added to the translation files too.
---------------------------------------------------------------------------
by vicb at 2011/07/11 02:02:51 -0700
@fabpot it was not translatable as the name was hardcoded in the message (instead of using a placeholder). So yes it becomes translatable now (and "customize"able as explained in the PR message).
I have also removed the form name from the default message as I don't think it brings any added value.
`This value is not valid` already exists in the translation files (see id=24).
Commits
-------
f7d0f65 RFC2616 changes
b9a218a [HttpFoundation] set Content-Length header to the length of content
Discussion
----------
[HttpFoundation] set Content-Length header to the length of content
I can't think of why this could be bad but if somebody knows please chime in.
The good thing is that with this change keepalive will work out of the box.
---------------------------------------------------------------------------
by Seldaek at 2011/07/06 05:34:51 -0700
That sounds like a great change. I think it might explain/fix the issues I've encountered with AppCache on my production box. Never had time to look into it, but IIRC I noticed the missing Content-Length, and it seemed to load forever.
---------------------------------------------------------------------------
by fabpot at 2011/07/06 06:46:50 -0700
The `Content-Length` is automatically added by servers like Apache. Moreover, sometimes, you should not add it: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4
---------------------------------------------------------------------------
by lenar at 2011/07/06 07:54:45 -0700
It is not added automatically by default. Yes, in case of Apache it is actually added if deflate module is enabled and if that module decides to compress the content (decision based on content-type).
About RFC2616: I will read it and add changes to this PR if applicable.
---------------------------------------------------------------------------
by fabpot at 2011/07/06 08:38:14 -0700
e943fde2ef
---------------------------------------------------------------------------
by Seldaek at 2011/07/06 08:45:22 -0700
@lenar all you have to do is skip setting the Content-Length for `1xx`, `204`, and `304` responses I believe.
---------------------------------------------------------------------------
by Seldaek at 2011/07/06 08:46:54 -0700
But this should maybe be done in sendHeaders() à la `fixContentType`, because you can't be sure about the statusCode before that.
---------------------------------------------------------------------------
by lenar at 2011/07/06 13:55:33 -0700
I propose this based on what I read and understood from RFC2616.
---------------------------------------------------------------------------
by mheleniak at 2011/07/10 03:57:26 -0700
+1
Commits
-------
e6a2d76 delay resolving values of extensions config until all files are loaded
Discussion
----------
[DependencyInjection] Delay resolving values of extensions' config until all files are loaded
This addresses #1598.
This delays resolving of extensions' configuration until all files are loaded. Without this, overriding parameters do not work for extensions.
Commits
-------
f359e3d Updated italian translations
Discussion
----------
Updated and corrected italian translations
---------------------------------------------------------------------------
by davideborsatto at 2011/07/10 12:41:29 -0700
Previously they were not translated that good, plus there were a few typos here and there.
Commits
-------
d53f312 changed "should" to "must" in message 6 and 7. also moved message 32 as replacement of message 5, according to note by yethee
e151c80 updated japanese translations
Discussion
----------
updated japanese translations
Please update japanese translations.
I picked up some messages from the latest sources of validation classes on your master branch, because translations for many other languages seems not to contain messages for recent validator classes, such as Image,Ip,Locale,Language.
Thanks in advance!
---------------------------------------------------------------------------
by yethee at 2011/07/10 09:23:01 -0700
> "One or more..." is on message#33 in my commit, should I locate #33 just after #5?
Not necessarily, the order of messages is not important, AFAIK.
Commits
-------
9714cfc Fixes fatal error when intl module is not installed.
Discussion
----------
Session instantiation breaks with Fatal error if intl module is not installed.
A check for class_exists in setPhpDefaultLocale() fixes this, though I got the feeling it should be resolved with a proxy or subscriber object; setPhpDefaultLocale feels like a hack now.
---------------------------------------------------------------------------
by stealth35 at 2011/07/10 06:32:43 -0700
Locale::setDefault don't throw any exception
Maybe just :
```php
if (class_exists('Locale', false)) {
return \Locale::setDefault($this->locale);
} else {
return false;
}
```
Commits
-------
08b4219 [DoctrineBridge] Issue #1376 - Unique Validator does not work with null values
Discussion
----------
Issue1376
[DoctrineBridge] Issue #1376 - Unique Validator does not work with null values
Commits
-------
c1cab27 [FrameworkBundle] Updated Russian translations for validators.
Discussion
----------
[FrameworkBundle] Updated Russian translations for validators.
Sync translations with the actual validator constraints.
Removed some translations (they are not found among the constraints):
- `This value should be instance of class {{ class }}`
- `This field group should not contain extra fields`
- `The uploaded file was too large. Please try to upload a smaller file`
Commits
-------
df57e0f [Validator] Added strict option to ChoiceConstraint.
Discussion
----------
[Validator] Added strict option to ChoiceConstraint.
By default, ChoiceValidator was ensuring strict type when checking if value is present in choices. This behavior is a problem when you want to validate against integer values. As all data you will receive from a request will be typed as a string, you won't be able to validate these numeric values.
This patch solves this.
In order for being nice to developers, I've set "strict" to false by default.
Commits
-------
6c736c9 Fix RedirectResponse HTML indentation and constructor phpDoc
Discussion
----------
Fix RedirectResponse HTML indentation and constructor phpDoc
Removes extra indents from the redirection response content.
Commits
-------
ac1448f [Routing] Revert to rawurlencode + whitelisting of '/'
Discussion
----------
[Routing] Revert to rawurlencode + whitelisting of '/'
After more discussion on 761724ae57 - sorry you merged too fast for once ;)
Commits
-------
6786e81 [HttpFoundation] code factorization in UploadedFile
Discussion
----------
[HttpFoundation] code factorization in UploadedFile
As both #1542 and #1544 have been merged.
Problem with fgets is that false means two things: an error or the end of the stream.
That's ok for STDIN, but it becomes a problem when using another stream (in a unit test for instance).
This change allows for more flexibility if the developer wants to flush
the Response content early (the drawback being that Response listeners
won't be able to tweak the HTTP headers anymore).
There is another benefit: avoid the infamous
"Fatal error: Exception thrown without a stack frame in Unknown on line 0".
Here is a small scenario when this can happen (thanks dtee for identifying this issue):
* Call flush() in controller to output html early, then throw exception
* ExceptionHandler triggers handle() function and return new Response object to output...
* Because the header is sent (flush() call in Controller), php's E_WARNING error get raised, which gets handled by ErrorHandler->handle() and it throws new ErrorException()
* PHP fatals to prevent Exception loop: "Fatal error: Exception thrown without a stack frame in Unknown on line 0"
Commits
-------
8a6ac0c Added Romanian translations for validators
Discussion
----------
[Validator] Added Romanian translations
Added all strings up to commit SHA: d58ba34246
Commits
-------
f8b5f35 [MonologBundle] Refactored the way to configure the email prototype for swiftmailer
874fb95 [MonologBundle] Refactored the configuration of processors
Discussion
----------
Monolog
This refactors the way processors and email prototype are configured in MonologBundle for consistency with the other bundles. The hack using ``@id`` to use a service in the semantic configuration is not used anywhere else in Symfony2.
This removes the ability to use a static callback as processor (or a PHP function) but adds the support of adding a processor only for a given logging channel (for processors attached to the logger) which was not possible previously.
---------------------------------------------------------------------------
by stof at 2011/07/06 07:33:52 -0700
the PR for the doc and the standard edition are coming.
Commits
-------
ef022c0 Removed the magical guessing of the type name to avoid WTF issues
Discussion
----------
Removed the magical guessing of the type name to avoid WTF issues
As discussed on IRC, this removes the magical method to avoid breaking the user-land code by reusing the same name than another type which overrides it. This makes the user aware that a type should have a name as they now have to implement the method themselves.
---------------------------------------------------------------------------
by jalliot at 2011/07/06 05:35:30 -0700
Doc and generator should be modified as well if it's merged.
Commits
-------
133169f Better exception message for extension in XmlFileLoader
Discussion
----------
Better exception message for XmlFileLoader
Include namespace that has been looked for an registered namespaces in the exception message to ease debugging.
Commits
-------
fa20b51 [Console] refactored definition printer
e49d61f [Console] fixed console help printing expectations
Discussion
----------
[Console] definitions printing fix
Before this change, console component printed definitions as:
``` bash
Arguments:
features Feature(s) to run. Could be a dir (features/),
a feature (*.feature) or a scenario at specific line
(*.feature:10).
Options:
--config (-c) Specify external configuration file to load. behat.yml or config/behat.yml will be used by default.
--profile (-p) Specify configuration profile to use. Define profiles in config file (--config).
--init Create features directory structure.
--format (-f) How to format features. pretty is default. Available formats are
- pretty
- progress
- html
- junit
--out Write formatter output to a file/directory instead of STDOUT (output_path).
--colors Force Behat to use ANSI color in the output.
--no-colors Do not use ANSI color in the output.
--no-time Hide time in output.
--lang Print formatter output in particular language.
--no-paths Do not print the definition path with the steps.
--no-snippets Do not print snippets for undefined steps.
--no-multiline No multiline arguments in output.
--expand Expand Scenario Outline Tables in output.
--story-syntax Print *.feature example in specified language (--lang).
--definitions Print available step definitions in specified language (--lang).
--name Only execute the feature elements (features or scenarios) which match part of the given name or regex.
```
As you might see, indentation is totally broken (also notice how it prints multiline descriptions in argument and --format option).
This PR makes output looks like this:
``` bash
Arguments:
features Feature(s) to run. Could be a dir (features/),
a feature (*.feature) or a scenario at specific line
(*.feature:10).
Options:
--config (-c) Specify external configuration file to load. behat.yml or config/behat.yml will be used by default.
--profile (-p) Specify configuration profile to use. Define profiles in config file (--config).
--init Create features directory structure.
--format (-f) How to format features. pretty is default. Available formats are
- pretty
- progress
- html
- junit
--out Write formatter output to a file/directory instead of STDOUT (output_path).
--colors Force Behat to use ANSI color in the output.
--no-colors Do not use ANSI color in the output.
--no-time Hide time in output.
--lang Print formatter output in particular language.
--no-paths Do not print the definition path with the steps.
--no-snippets Do not print snippets for undefined steps.
--no-multiline No multiline arguments in output.
--expand Expand Scenario Outline Tables in output.
--story-syntax Print *.feature example in specified language (--lang).
--definitions Print available step definitions in specified language (--lang).
--name Only execute the feature elements (features or scenarios) which match part of the given name or regex.
```
Commits
-------
d08a688 [Form] Fixed CS
954bdb5 [Form] Updated DateTimeType to accept a custom date pattern for the DateType child * Added a test also about this change
e7e744f [Form] Synced changes in this branch with current Symfony master branch
436cb95 [Form] Changed to a CreateException when the 'format' option is invalid * Updated DateTypeTest also
0045ffe [Form] Added tests to check that the date format option is validated correctly * Format option must be either a IntlDateFormatter constants (FULL, LONG, MEDIUM, SHORT) or a string
a815232 [Form] The IntlDateFormatter pattern can now be passed via the format option * Also changed the default value of the calendar paramter to \IntlDateFormatter:GREGORIAN in DateTimeToLocalizedStringTransformer which is the same as the default value in StubIntlDateFormatter
58f869a [Form] Synced custom pattern tests with master branch
c20edde [Form] Added some tests * Tests to check if the pattern option is handled correctly by DateType * Tests to check if the pattern parameter is handled correctly by DateTimeToLocalizedStringTransformer
52a1e1d moved date_pattern to IntlDateFormatter
dd104bc added code to use custom date_pattern
Discussion
----------
[Form] Added code to use custom date_pattern
Current DateType doesn't make use of the `date_pattern` option. Added code to use the custom `date_pattern` if provided.
---------------------------------------------------------------------------
by maoueh at 2011/05/02 21:52:37 -0700
You should also pass the pattern option to the DateTimeToLocalizedStringTransformer so the pattern is taken in consideration when converting from and to localized string. You can check the commit I did on my repository (maoueh/symfony@01ae75dd84) which do the same as yours for the DateType but also includes the modification needed by the DateTimeToLocalizedStringTransformer class.
Not sure if there is more work needed to fully support the pattern option. Moreover, I did not run the tests to check if everything pass correctly. It would also be a good idea to add some tests to check that the date_pattern is working as expected.
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/02 22:02:14 -0700
There is also a problem with the regex, but this is not regarding the pattern option. If you set the 'format' option to 0, it returns the IntlDateFormatter::FULL but it does not pass the regex because there is first EEEE in the standard pattern so it comes on the fallback pattern year month day
---------------------------------------------------------------------------
by kertz at 2011/05/02 23:36:05 -0700
Thanks for your suggestions @maoueh and @dot-i-fy, I will check them.
I found the `date_pattern` doesn't work when using text widget. I will try to fix this.
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/03 00:02:45 -0700
Here the regex I use now and working with IntlDateFormatter::FULL
https://gist.github.com/952929
---------------------------------------------------------------------------
by maoueh at 2011/05/03 07:13:01 -0700
@kertz: It is working for me using the text widget on my development machine. Don't know what is the problem on our side but it is working correctly for me. I'm willing to help track this problem if you want. Just let me know.
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/03 07:57:34 -0700
@kertz : It is also working for me, we just have to pay attention about the format to be used in the text input regarding IntlDateFormatter.
---------------------------------------------------------------------------
by kertz at 2011/05/03 11:15:23 -0700
Ah well I guess I screwed up the whole commit log!
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/03 11:19:08 -0700
wow !
---------------------------------------------------------------------------
by maoueh at 2011/05/03 11:23:51 -0700
Hell yeah! :) You should do a rebase the next time instead of merging Symfony master branch into yours:
`git rebase symfony/master date_pattern` and when you need to push your changes to your repository, do `git push -f origin date_pattern`. This way, it will be easier for the core team to handle the merge process.
Since @dot-i-fy opened a pull request for fixing the same issue as here, maybe it would be a good idea to close this PR?
---------------------------------------------------------------------------
by kertz at 2011/05/03 11:33:34 -0700
Well, it's done. I just pushed it a little earlier that I should have! Well I didn't know that @dot-i-fy opened a PR, where is it? This patch currently works for me.
Regarding the change in regex, well I think it should also have a ChoiceList for week days, otherwise it's not useful. Probably that alone can be a separate PR.
---------------------------------------------------------------------------
by maoueh at 2011/05/03 11:46:09 -0700
Yep it is much better now :) I think it would be a good idea to remove this commit from your PR kertz/symfony@e47cfb6d49.
The other PR is [PR751](https://github.com/symfony/symfony/pull/751). Maybe @dot-i-fy could change is PR so it will only be about the regex? In both cases, you should coordinate with each other I think.
Thanks for merging the changes I made to the DateTimeToLocalizedStringTransformer class.
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/03 12:00:06 -0700
Yeah, I will modify my commit to take only the regex in account.
Would someone work with me on the TimeType ? The pattern is also not working there but it looks like a little bit more complicated!
Thanks
---------------------------------------------------------------------------
by kertz at 2011/05/03 12:02:18 -0700
Thanks for the changes in DateTimeToLocalizedStringTransformer.
Is it really necessary to remove the initial commit?
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/03 12:06:41 -0700
What does it mean CS ?
---------------------------------------------------------------------------
by maoueh at 2011/05/03 12:08:44 -0700
@dot-i-fy: It means Code Style, the comma is not placed correctly
---------------------------------------------------------------------------
by kertz at 2011/05/03 12:11:24 -0700
`Coding Standards` seems right :) http://symfony.com/doc/2.0/contributing/code/standards.html
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/03 12:11:27 -0700
ah ok, thx
---------------------------------------------------------------------------
by maoueh at 2011/05/03 12:12:10 -0700
@kertz: I don't think it is strictly necessary to remove this commit. But I think it is a good idea since you kinda reverted it with some changes in a later commit. The core team might ask you to remove it. So leave it for now, and change it if they ask you to do so.
Hehe right, Coding Standards looks way better :)
---------------------------------------------------------------------------
by maoueh at 2011/05/03 12:30:00 -0700
@dot-i-fy: I will check later in the evening what can be done about the pattern in the TimeType class. I'm also planning on adding some tests about this PR. If I do so, I will send a PR to your repository @kertz so you will be able to add the tests to this PR.
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/03 13:04:35 -0700
I had some problems with PHPUnit, seems to be ok now. Another problem, damned, APC is showing in my browser when in app_dev.php, not in prod. Any idea ? Can't get html output in dev env.
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/04 00:43:46 -0700
@RapotOR : Are you talking about the dateType method in IntlDateFormatter ? If no can you make a snippet in gist with an example ?
If yes ...The option "format" already allows an IntlDateFormatter input, you can either set a \IntlDateFormatter::MEDIUM for example or an integer representing the dateType to use (0 -> full, 1 -> long, ... ).
The problem we are reveling here is the pattern based off the dateFormat option :
the $formatter look for Locale -> then for format option and based off these options he generate a pattern who can be different regarding the Locale. For example, for me I have my locale in php set to fr_BE, so my dates are always d-m-Y formatted but if I want to modify that it is momently not possible.
Grtz
---------------------------------------------------------------------------
by RapotOR at 2011/05/04 00:57:03 -0700
@dot-i-fy : my thought was more about having a full control of IntlDateFormatter from outside; instead of defining every variables. It is more like a DI way... especially if you have more than one DateType field!
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/04 01:11:21 -0700
Oh so, it may be indeed a nice way to follow. Don't hesitate to submit your code suggestions.
But I think that if we go deeper in the core modifications, it is maybe a solution to take the $formatter out of the dateType class and put it in a own class and call it from the dateType class ???@}#
---------------------------------------------------------------------------
by maoueh at 2011/05/05 08:22:40 -0700
@mweimerskirch: Maybe it would be better to rename your option html_pattern? Since the pattern is not strictly associated to a date type, it would be a better name in my opinion if it was named html_pattern or html5_pattern?
I think it would lead to more misunderstandings if we had a date_pattern and a pattern option. In both cases, I agree totally that one or the other needs a renaming. Moreover, if we change the pattern option in the date type, I think the format option should be changed also to date_format.
What do you think?
---------------------------------------------------------------------------
by kertz at 2011/05/05 23:58:21 -0700
@mweimerskirch
I too think when we specify `pattern` in `DateType` everyone expects it to be the date pattern. So maybe renaming the HTML5 pattern to `html_pattern` would be more appropriate?
---------------------------------------------------------------------------
by bschussek at 2011/05/18 12:20:56 -0700
Looks good. Why don't we reuse the "format" option for this? If "format" is not one of the predefined constants, we could treat it as a custom date format.
---------------------------------------------------------------------------
by maoueh at 2011/05/18 12:28:22 -0700
@bschussek: I think it is a good idea indeed. When I first played with forms, I thought that the purpose of the format option was exactly for this but I soon realized it wasn't. I'm +1 for this.
@kertz: Let me know if you don't have time to do this switch, I will gladly submit the changes to you own repo if we agree to use "format" option instead of the "pattern" one.
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/18 12:33:33 -0700
``format`` and ``pattern`` options are related to the IntlDateFormatter, I also agree with you but we have to keep in mind that we will loose the symmetry with the IntlDateFormatter class.
---------------------------------------------------------------------------
by bschussek at 2011/05/18 13:39:07 -0700
I think we can safely add this level of abstraction.
---------------------------------------------------------------------------
by kertz at 2011/05/18 20:29:11 -0700
@maoueh Would be great if you can make the changes :)
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/19 09:09:41 -0700
@bschussek : I saw you removed pattern option, what are further intentions ?
---------------------------------------------------------------------------
by maoueh at 2011/05/19 09:42:40 -0700
@kertz: I will do the changes needed tomorrow as I have some spare times. You will need to sync your branch with current master or I will need to send another PR since @bschussek removed the pattern option which will cause bad conflicts with this implementation.
---------------------------------------------------------------------------
by kertz at 2011/05/20 06:45:22 -0700
@maoueh I've merged the changes.
---------------------------------------------------------------------------
by kertz at 2011/05/20 07:11:36 -0700
@maoueh I just removed a couple of commits from the log. Seems like the tests you committed are now missing from the PR. Can you please send the tests once again? Sorry about that.
---------------------------------------------------------------------------
by maoueh at 2011/05/20 09:03:52 -0700
@kertz: I will resend them along with the code modifications to use `format` instead of `pattern`.
---------------------------------------------------------------------------
by maoueh at 2011/05/20 19:11:28 -0700
I did the changes to make it possible to pass a custom pattern via the format option. I sent a PR on @kertz repository [here](https://github.com/kertz/symfony/pull/2) that will be merge eventually in this PR.
I have two small questions about it. First, since format option can now be a string, the allowed values for the option `format` have been removed from the array returned by `getAllowedOptionValues`. The check is done instead in the method `buildForm` directly. The 'format' option can be either one of the `IntlDateFormatter` constants (FULL, LONG, MEDIUM, or SHORT) or a string. If those conditions are not respected, a `FormException` is thrown. Is this correct?
When the `format` option is a custom pattern, the IntlDateFormatter needs a valid format even if it will not be used. So I retrieved the default format option by using the `getDefaultOptions` method. Is this correct or should I specify the default value directly:
this (specify directly):
$format = \IntlDateFormatter::MEDIUM;
instead of (use predefined defaults):
$defaultOptions = $this->getDefaultOptions($options);
$format = $defaultOptions['format'];
Also added more tests to verify that the format option is validated correctly and updated previous ones.
Regards,
Matt
---------------------------------------------------------------------------
by kertz at 2011/05/20 20:38:32 -0700
Merged the changes. I have not tested this yet... Thanks @maoueh :)
---------------------------------------------------------------------------
by dot-i-fy at 2011/05/20 22:48:47 -0700
nice job @maoueh
---------------------------------------------------------------------------
by mprizmic at 2011/06/16 14:06:47 -0700
what do you think about
$pattern = $form->getAttribute('pattern');
instead of
$pattern = $form->getAttribute('formatter')->getPattern();
in line 96 of
symfony/component/form/extension/core/type/datetype.php
---------------------------------------------------------------------------
by maoueh at 2011/06/16 14:40:37 -0700
It is simpler to use the pattern of the formatter directly I think. The reason is that if the option to change the format is null, the default pattern of the formatter will be available and will be the right pattern to use. If the option is set, we modify the formatter before hand so getting the pattern from it will return the custom pattern we have set in the options.
So in both cases, no conditional is required to verify if it is set or not when retrieving the pattern from the formatter. Moreover, I think the pattern must be set as an attribute of the form for your suggestion to work correctly which is not the case right now.
Regards,
Matt
---------------------------------------------------------------------------
by stloyd at 2011/07/05 13:41:36 -0700
@fabpot What we do with that ? I have tried to rebase it with master, but my (Windows) git always gets insane and this ends up with unfixable error. This feature __should__ be in Symfony2 before final. Should I start work on it from "none" ?
---------------------------------------------------------------------------
by fabpot at 2011/07/06 05:44:26 -0700
@stloyd: I need to review the patch first.
The guesser has been removed as the constraints only knows
about the valid keys. But to be able to create the Type automatically,
we also need the values.
Commits
-------
3df5ec3 [HttpKernel] Add support for 'upload_max_filesize' ini directive in the Client
Discussion
----------
[HttpKernel] Add support for 'upload_max_filesize' ini directive
[HttpKernel] Add support for 'upload_max_filesize' ini directive in the Client
__This PR depends on #1542__
This PR prevent the SW Client from uploading files larger than the limit set in php.ini to closer mimic a real browser usage.
If both PR eventually gets merge `static protected function getMaxUploadFilesize()` should probably be factorized to the UploadedFile class.
---------------------------------------------------------------------------
by stloyd at 2011/07/05 13:35:06 -0700
+1 for both, I just have found similar "wtf" issues with "empty" `upload_max_filesize`.
---------------------------------------------------------------------------
by oscarballadares at 2011/07/05 15:13:23 -0700
I have opened an issue related to UPLOAD_ERR_INI_SIZE. There was no way to handle this exception.
Can you confirm please?
If this is the case I will close the issue I opened.
---------------------------------------------------------------------------
by vicb at 2011/07/05 23:04:08 -0700
@oscarballadares the PR you are looking for is most probably #1542 - which you should see in the message thread of your submitted issue.
The best would be for you to verify that PR #1542 fixes your issue and provide some feedback so that the issue can be close but only when the PR gets merged (if it fixes the issue).
Commits
-------
d58ba34 [Validator] Consider the ini directive 'upload_max_filesize' while validating an uploaded file (fixes GH-1441)
Discussion
----------
[Validator] FileValidator support for uploaded files
[Validator] Consider the ini directive 'upload_max_filesize' while validating an uploaded file (fixes GH-1441)
Added validator messages should get translated in all the available languages.
Commits
-------
4c6e177 [Form] Fix the default validator
Discussion
----------
[Form] Fix the default validator
When php.ini has an empty value for post_max_size
`post_max_size =`
see http://fr2.php.net/manual/en/function.ini-get.php
post_max_size can not be false as it has a default value
Commits
-------
03fee4f Fix permissions
431460f [Form] Remove choice or choice_list requirement as the following conditions already check enough and this condition prevents empty select forms (populated by ajax for example)
Discussion
----------
[Form] Choice fix
[Form] Remove choice or choice_list requirement as the following conditions already check enough and this condition prevents empty select forms (populated by ajax for example)
---------------------------------------------------------------------------
by stloyd at 2011/07/05 06:26:36 -0700
You should revert permission changes.
---------------------------------------------------------------------------
by fabpot at 2011/07/05 06:28:14 -0700
Why not replacing `if (!$options['choices'] && !$options['choice_list']) {` by `if (!isset($options['choices']) && !isset($options['choice_list'])) { `?
---------------------------------------------------------------------------
by beberlei at 2011/07/05 06:35:50 -0700
gnaa permission changes, i cant seem to configure my machine such that it does not do it, i have to do this on a per repository basis, very annoying.
@fabpot isset() is already guaranteed because these two options are in the defaults.
---------------------------------------------------------------------------
by beberlei at 2011/07/05 06:39:43 -0700
Fixed the permissions
---------------------------------------------------------------------------
by stof at 2011/07/05 06:48:37 -0700
@beberlei Can't you fix it in the global git config ?
---------------------------------------------------------------------------
by webda2l at 2011/07/05 09:48:58 -0700
I met the same problem this afternoon and vote for the isset solution. Better than nothing and work for me.
https://github.com/symfony/symfony/pull/1539
---------------------------------------------------------------------------
by stof at 2011/07/05 09:50:09 -0700
@webda2l why is a check that always return true better than nothing ? It adds overhead without adding any value in the code.
Commits
-------
bcca47a missing argument to addProcessors()
Discussion
----------
[MonologBundle] Missing argument to addProcessors()
---------------------------------------------------------------------------
by Seldaek at 2011/07/05 07:03:45 -0700
@fabpot: Please merge, this is a regression in yesterday's PR
Commits
-------
511a9a1 Edited src/Symfony/Component/Console/Helper/DialogHelper.php via GitHub
Discussion
----------
EOF triggers infinite loop in console dialog helper
* fix by throwing an exception when fgets() fails
* Also fixes "0" returning a default answer instead of "0"
---------------------------------------------------------------------------
by lenar at 2011/07/05 00:26:02 -0700
Fixes#1521.
Commits
-------
924ea92 made command consistent with other help texts (it's now './app/console', instead of 'php app/console')
8361346 Corrected help text from './symfony' to 'php app/console'
Discussion
----------
[console] Incorrect help text
When executing 'php app/console help', example commands starting with './symfony ' are shown.
I've made it consistent with the help text shown for generate:bundle; './app/console '
Commits
-------
3917ed7 Revert "* DateType, DateTimeType, TimeType: - a bit changed readability"
c85b815 Fixed few issues with Date and Time:
Discussion
----------
[Form] Fixed few issues with Date and Time
Fixed few issues with Date and Time:
* TimeType:
- seconds are no longer populated if "with_seconds" = false
- "widget = text" is now properly rendered (closes#1480)
* DateTimeToStringTransformer:
- fixed using not default "format" (probably fix#1183)
* DateType, DateTimeType, TimeType:
- fixed "input = datetime" and test covered
Commits
-------
756ea8d Call session_name() only if user gave an new one. Closes#1418
Discussion
----------
[Session] Call session_name() only if user gave an new one
Call `session_name()` only if user gave an new one, by default will use an "php.ini" option. Also added some phpdoc.
Closes#1418.
Commits
-------
2af2260 Remove useless code
Discussion
----------
Remove useless code
This PR is about removing useless code which could benefit to perfomances.
Credits go to [Jordi](https://github.com/symfony/symfony/commit/000229dbd0d161f1eebe) for this.
As a minor modif, I can understand if this could not be merged while in RC.
Commits
-------
164aea4 [Security] Add tests for the channel listener
d51cbc0 [Security] Remove useless attribute in basic authentication listener & test it
91e6dc9 [Security] Add tests for the anonymous authentication listener
3c2affb [Security] Update access listener constructor's prototype and add tests
81afd77 [Security] Add tests for the firewall map
aa6ae33 [Security] Remove useless attribute & var in firewall
Discussion
----------
Test security
---------------------------------------------------------------------------
by lsmith77 at 2011/06/29 13:41:07 -0700
@schmittjoh is probably the person to review this change ..
Commits
-------
49af102 Throwing FormNotBoundException when calling form isValid
Discussion
----------
Throwing FormNotBoundException when calling form isValid
---------------------------------------------------------------------------
by Seldaek at 2011/06/28 12:20:04 -0700
I'd have made that a `\LogicException`, but that's just me hating on custom exceptions. Otherwise as said on IRC, 👍.
---------------------------------------------------------------------------
by stloyd at 2011/06/28 12:27:27 -0700
+1 but IMO `FormException` would be here good enough.
Commits
-------
bf76bed Correct prefix from nothing to ORM\ for annotations
Discussion
----------
Correct prefix from nothing to ORM\ for annotations
For yml et xml mapping, the commands generate:doctrine:entities and doctrine:generate:entities, don't prefixed the annotations, specially for the listenners methods (prepersist, preupdate...).
Commits
-------
c867209 Adjust UPDATE.md to Annotation changes
9069d06 Fix tests to run with Doctrine Common AnnotationRegistry
d5c1bbe Disable call to AnnotationReader::setAutoloadAnnotations()
Discussion
----------
Annotation autoloading
This pull request disables the annotation autoloading through the DIC. PHP Autoloading is now removed from the AnnotationReader and replaced with its own autoloading mechanism that offers much more control over possible error states.
Commits
-------
06c3712 [Form csrf] FileTypeCsrdExtension is not required any more (as FileType now extends FieldType)
Discussion
----------
[Form csrf] FileTypeCsrdExtension is not required any more
FileType now extends FieldType.
Commits
-------
418d6a0 [Routing] Fix syntax error when dumping routes with single quotes in the requirements or pattern
2b5e22d [Routing] Fix ApacheDumper when a space appears in a default value
6c7f484 [Routing] Fix dumper so it doesn't print trailing whitespace
761724a [Routing] Adjust urlescaping rules, fixes#752
Discussion
----------
[Router] Bunch o' Fixes
The first commit changes the escaping rule to fix issues I had previously, and #752 as well, here's from the full commit message:
Only + and % are now encoded in generated routes, since they are the only characters that, if not encoded, could cause problems/conflicts when decoded. Namely + turns into a space, and % followed by numbers could do funky things.
The matcher decodes everything which works since nothing will have %NN without being escaped, and + are escaped as well.
Second commit is just a test fix for the first
Third and fourth are simply dumper escaping issues, nothing to argue about.
Note that all changes have had test cases added, and I spent a few hours torturing/testing all this stuff with both Apache and PHP dumpers, in many browsers, and with URLs as wonky as `/%01%02%03%04%05%06%07%08%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22$%25&%27%28%29*+,-./0123456789:;%3C=%3E@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B|%7D~/baz` which essentially represent the 1-255 char range minus ? and #.
The only issues I really encountered after all the patches were applied is that Apache refuses to match `%22` (= `"`) and `*` in a url. I guess it's just because they're not allowed chars in windows paths, but | and < > works fine though. Anyway this works with the PHP dumper, and it didn't work either without my patches so it's not like I broke it, I'm just saying for the record.
Commits
-------
1cc1027 added @Annotation to UniqueEntity
ee22c5d added a note to update file
efcb435 updated to doctrine changes
Discussion
----------
updated to doctrine changes
---------------------------------------------------------------------------
by excelwebzone at 2011/06/30 06:29:23 -0700
Should also be implemented to the Route class and to all SensioFrameworkExtraBundle annotation classes
* TimeType:
- seconds are no longer populated if "with_seconds" = false
- "widget = text" is now properly rendered (closes#1480)
* DateTimeToStringTransformer:
- fixed using not default "format" (probably fix#1183)
* DateType, DateTimeType, TimeType:
- fixed "input = datetime" and test covered
- a bit changed readability
Commits
-------
4e7b16f Added "trans" Twig filters to labels in the "widget_choice_options" block
Discussion
----------
Missing "trans" Twig filters for labels in the "widget_choice_options" block
Added "trans" Twig filters to labels in the "widget_choice_options" block.
A quick fix for a quick need, there might be other missing trans filters remaining.
Only + and % are now encoded in generated routes, since they are the only characters that, if not encoded, could cause problems/conflicts when decoded. Namely + turns into a space, and % followed by numbers could do funky things.
The matcher decodes everything which works since nothing will have %NN without being escaped, and + are escaped as well.
Commits
-------
f4c7333 Fix populating seconds when option "with_seconds" is set to false
Discussion
----------
[Form][DateTimeType] Fix invalid data when "with_seconds" = false
Fix populating seconds when option `with_seconds` is set to `false`.
Commits
-------
e80ce57 [HttpFoundation] Add REQUEST_TIME by default
Discussion
----------
[HttpFoundation] Add REQUEST_TIME by default
Without this the getting the REQUEST_TIME from the Request in tests is breaking.
Commits
-------
aeaf44a Removed unused code from DateTimeType
3c2539f Throw exception when "date_widget" option is not equal to "time_widget"
305c476 Overwrite child options ("widget", "empty_value") if any given
7bc19f9 Added to `DateTimeType` extension possibility to render form as `single_text` (similar to `DateType` option) (issue #1323 it requires fix for #1205)
17b41b2 Added to `TimeType` extension possibility to render form as `single_text` (similar to DateType option) (issue #1205) Adjusted `DateTimeType` to allow usage of this new feature
Discussion
----------
[Form][DateTimeType] Added "widget" and "empty_value" options
Hey,
I have just added "widget" and "empty_value" options to `DateTimeType`:
* `widget` option will overwrite existing `date_widget` and `time_widget`,
* `empty_value` behave exacly same way as it does for `ChoiceType`, `DateType` and `TimeType`
Also added and `FormException` when `date_widget` is not equal to `time_widget`, now is throwed non intuitive one (this will be changed in next days to allow different values for this options).
Closes#1323
Commits
-------
6b72cda removed whitespace
282a493 moved the constant from the interface back into the class
7ec7fbe fixed inteface name
9a82924 [Console] Extract the OutputFormatter's regular expression into the inteface.
Discussion
----------
[Console] Expose the OutputFormatter's regular expression
In my ConsoleBundle(https://github.com/CoreSphere/ConsoleBundle) I needed to decorate the OutputFormatter to enable html escaping while allow to apply styles.
For that I need to reuse the regular expression used in the original OutputFormatter. I think it would be cleaner exposing it than duplicating it.
(https://github.com/CoreSphere/ConsoleBundle/blob/master/Formatter/HtmlOutputFormatterDecorator.php#L64)
---------------------------------------------------------------------------
by fabpot at 2011/06/23 12:24:43 -0700
OutputFormatter is just one implementation of the interface, so the constant cannot be defined in the interface.
---------------------------------------------------------------------------
by laszlokorte at 2011/06/23 13:01:46 -0700
I made the false assumption all Formatters would use the same syntax for defining style. I moved it back into the class.
Commits
-------
2cf7136 [FrameworkBundle][Form] tweak the choice widget PHP template
Discussion
----------
[FrameworkBundle][Form] tweak the choice widget PHP template
* make theming easier,
* factorize code,
* make PHP similar to Twig (easier to maintain)
Commits
-------
4e3406d Sync with master and clean up
ad5d2c1 Added to `TimeType` extension possibility to render form as `single_text` (similar to DateType option) (issue #1205) Adjusted `DateTimeType` to allow usage of this new feature
Discussion
----------
[Form][TimeType] Added possibility to render form as "single_text"
Added to `TimeType` extension possibility to render form as `single_text` (similar to `DateType` option) (issue #1205)
Adjusted `DateTimeType` to allow usage of this new feature
---------------------------------------------------------------------------
by ouardisoft at 2011/06/17 03:41:18 -0700
+1
---------------------------------------------------------------------------
by stloyd at 2011/06/21 01:05:51 -0700
@fabpot Any decision about this one ? I'm asking because I also have similar fix for #1323 but it requires this one ;-)
---------------------------------------------------------------------------
by fabpot at 2011/06/22 23:32:08 -0700
@stloyd: Can you rebase to master?
---------------------------------------------------------------------------
by stloyd at 2011/06/23 05:03:44 -0700
@fabpot Done.
Commits
-------
a664a60 [Translation] support phar archives by XLIFF loader
Discussion
----------
[Translation] support phar archives by XLIFF loader
Support XLIFF translation files usage from phar package.
---------------------------------------------------------------------------
by fabpot at 2011/06/19 03:06:50 -0700
phar support is complex as not everything in PHP supports it. This patch only solves one area where phar is not supported. So, we need a solution that makes the entire framework phar-compatible, which is far from easy (realpath for instance cannot be used anywhere). So, I'm closing this PR and let's revisit the global phar support for 2.1.
---------------------------------------------------------------------------
by everzet at 2011/06/19 04:47:49 -0700
I'm not trying to package Symfony2 into phar :-) As it's indeed, very complex task even for 2.1. What i'm trying to do - i'm trying to package Behat in *.phar. And the only thing that blocks it - this PR. So, i'm not interested in full-stack phar support for entire Symfony2 framework right now, but as Symfony2 Components were created as stand-alone libs, this PR is enough to make Translation component itself supporting phar packaging. I use Translation component and XLIFF translations in Behat heavily and this PR gives me ability to create fully-working behat.phar package (tested).
Also, this PR doesn't breaks anything and even more - it's exactly the same piece of code, that we have in DependencyInjection component now: https://github.com/symfony/DependencyInjection/blob/master/Loader/XmlFileLoader.php#L327.
I'll be happy to work on phar support for 2.1. But for now, i can't see real reasons why Translation component can't already support it ;-)
Commits
-------
7db0b95 [HttpKernel] Removed unnecessary strtoupper
0891c57 [HttpKernel] Added test
1350645 [HttpKernel] Uppercased a few http methods
05c9906 [HttpKernel] Suppress response content for 304 responses out of the cache
Discussion
----------
HttpCache changes for 304 responses
Fixes#1413
To get the proper status for the Process, it needs to be terminated.
Sometimes, this is not the case when we call proc_get_status, so this
patch waits up to 1 sec to get the right information.
Commits
-------
d49e306 [DomCrawler] Fixed handling of relative query strings as links
a4451b4 [DomCrawler] Added tests for links starting with ?foo
Discussion
----------
[DomCrawler] Fixed handling of relative query strings as links
The link object concatenates links containing only a query string to the current URI. This shouldn't happen if the current URI already contains a query string.
This PR fixes the incorrect behavior (tests included).
Commits
-------
7783a05 Removed unused code from DateType Additional tests for ChoiceType and DateType based code
cdd39ac Added ability to set "empty_value" for `DateTimeType`, `DateType` and `TimeType` Additional tests covering added code
af4a7d7 More tests and more compatible code, with some suggestions from @helmer
527b738 Test covered version of fix for issue #1336
Discussion
----------
[Form] Added ability to set "empty_value" for choice list
Hey,
This PR is similar to #1336, but this one is fully test covered and have few change in behavior:
- if choice field is not set as non-required, `empty_value` is not added automaticly,
- also `empty_value` is not set if field have option `multiple` or `expanded`,
- `empty_value` for `DateType` and `TimeType` can be set "global" or per field, i.e.:
```
$builder->add('date', 'choice', array('required' => false, 'empty_value' => array('day' => 'Choose day')));
```
- `DateType` and `TimeType` code was cleaned a bit,
- added missing option to set up choice list as required when using PHP templates
---------------------------------------------------------------------------
by stloyd at 2011/06/20 04:55:45 -0700
@fabpot I'm just not sure is that change with removing "auto-adding" of `empty_value` is good (probably BC)
---------------------------------------------------------------------------
by lenar at 2011/06/20 05:24:02 -0700
Now this is a really nice way to hijack work done by others. Really encourages newcomers. Gratz!
---------------------------------------------------------------------------
by fabpot at 2011/06/20 05:57:40 -0700
@lenar: if the code in this PR is yours (at least partly), I'm not going to merge it. @stloyd, can you clarify this issue with @lenar? Thanks.
---------------------------------------------------------------------------
by lenar at 2011/06/20 06:21:11 -0700
It's @helmer's mostly, not mine, but the issue stays.
---------------------------------------------------------------------------
by fabpot at 2011/06/20 06:26:15 -0700
No matter who the code belongs to, Git allows us to keep track of all contributors. So, we need to do our best to not loose any code ownership.
---------------------------------------------------------------------------
by helmer at 2011/06/20 06:58:03 -0700
I do not care much for ownership, just that this kind of cooperation (or lack thereof) is kind of exhausting. Closed#1336.
---------------------------------------------------------------------------
by stloyd at 2011/06/20 07:47:53 -0700
@fabpot, @lenar: This PR is inspired by #1336, made by @helmer, but after looking at his code and talking with him, we cant (IMO) get an consensus. So I wrote this PR as an another way to fix issue described in #1336.
__Summary__: I don't think this one is better than fix at #1336, it's more like another approach to fix that issue.
---------------------------------------------------------------------------
by helmer at 2011/06/20 08:15:59 -0700
@stloyd: I actually think your variant is better, so good job there, thanks.
It just ain't nice to:
1) Comment on my changes being useless due to lack of tests
2) Writing brand new testsuite from your perspective that "proves" my approach is "wrong" (while ignoring my answers, why I did something precisely like I did, which I did in sync with @fabpot comments on his first attempt to improve the issue)
3) Saying my PR is broken because your new tests against it fail
4) Changing functionality to "fix" something that was not really broken
Other than that, I wanted to contribute a few lines to improve something relatively simple, and it ended up in a huge mess with more lost hours than I planned to spend on it.
On the bright side, we ended up with something good (:
---------------------------------------------------------------------------
by stloyd at 2011/06/20 08:32:30 -0700
@helmer: 1) & 2) Sorry for that "bad language", but you get me wrong a bit. Tests was written for code in master (there was no problem to change them to work with your POV). 3) Same as before, you can adopt tests easily, but never mind. Maybe later we could cooperate better ;-)
About 4) I mentioned it in description of this PR and that was point I was disagreeing with you (also about how "default" options are adopted in fields) :-)
Commits
-------
5d46e63 [Form] Add the FormHelper configuration
a43fad4 [Form] Improve unit tests for rendering
1cb2129 [FrameworkBundle][Form] Adding a cache to FormHelper::lookupTemplate()
f39ce67 [Form][FrameworkBundle] PHP theming
Discussion
----------
[2.1] RFC [Form] Php theming
This PR implements theming support for the php engine.
It works similarly as the twig theming with themes being folders and blocks being individual files.
There are probably a few things to tune before this can get merged:
### Theme naming
The current format is "\<Bundle\>:\<Controller\>" i.e. "FrameworkBundle:Form".
Is this ok or could you imagine something better ?
### Div and Table theme folders
Currently "FrameworkBundle\\Resources\\views\\Form" and "FrameworkBundle\\Resources\\views\\FormTable"
Is this ok or anything better ?
### Form helper configuration
I am not sure if the configuration is at the best possible location:
```
framework:
templating:
form:
resources: [themeA, themeB]
```
Any better idea ?
There is a [thread on the ml](http://groups.google.com/group/symfony-devs/browse_thread/thread/9b3f131fe116b511)
Commits
-------
bda4129 Make run() fully non-blocking and fix potential other problems
Discussion
----------
Make run() fully non-blocking and fix potential other problems
Multiple changes:
1) make writing to process non-blocking too - otherwise there might be increased possibility for buffer deadlock
given big enough input data. Also now it's guaranteed that all stdin data will be written.
2) get rid of fgets() - fgets() isn't really good function to use in case of non-blocking sockets. Data loss possible.
Commits
-------
7af003b [HttpFoundation] Allow stringable objects and numbers in response body + added tests
8126fb7 [HttpFoundation] Ensure response body is string, fixes#1378
Discussion
----------
[HttpFoundation] Ensure response body is string, fixes#1378
The issue in #1378 is clearly just a misuse of the class due but the error it triggers is confusing. This hopes to fix that.
---------------------------------------------------------------------------
by Seldaek at 2011/06/21 04:08:40 -0700
Added tests and support for __toString + numbers (kinda pointless but well..)
This change removes the need for the {_locale} hack.
Now, all paths in the Security component can be:
* An absolute path (/login)
* An absolute URL (http://symfony.com/login)
* A route name (login)
So, if you want to use a path that includes a global parameter (like _locale),
use a route instead of a path.
Commits
-------
2c1108c [Form] Revert the ability to override anything else than the text of the label while rendering a row
da467a6 [Form] Fix the exception message when no block is found while rendering
8670995 [Form] Optimize rendering when the block to render is known
41e07c9 [Form] Optimize rendering
ee5d975 [Form] Remove a test which is no more relevant (after recent FileType refactoring)
f729c6b [Form] Add the ability to override label & widget options when rendering a row
e09ae3f [Form][FrameworkBundle] Make FormHelper::renderSection() recursively callable, introduce FormHelper::renderBlock()
e43fb98 [Form][TwigBridge] Make FormExtension::render() recursively callable to ease theming
Discussion
----------
[Form] Some refactoring of the rendering
# First two commits
## FormExtension::render() can now be called recursively.
The main use case is theming support in for collections. Let's consider that you have a collection of `CustomType`, the type hierarchy while rendering the proto would be `field < form < custom < prototype`. Before this change any theme applied to your custom type (i.e. a `custom_row` block) would not have been taken into account while rendering the prototype because of the structure of the `prototype_row` block:
```html
{% block prototype_row %}
{% spaceless %}
<script type="text/html" id="{{ proto_id }}">{{ block('field_row') }}</script>
{% endspaceless %}
{% endblock prototype_row %}
```
which skip the `custom_row` block rendering to fallback to the `field_row` block rendering.
With this PR `prototype_row` recursively calls `FormExtension::render()`
```html
{% block prototype_row %}
{% spaceless %}
<script type="text/html" id="{{ proto_id }}">{{ form_row(form) }}</script>
{% endspaceless %}
{% endblock prototype_row %}
```
this has for effect to render the block for the parent type (i.e. `custom_row`)
## FormHelper
The `FormHelper` has been updated to more closely match the `FormExtension` architecture and the templates have been modified accordingly. `echo $view['form']->renderBlock(<block name>)` is the php equivalent of `{{ block(<block name>) }}`.
The attributes are now rendered using a template rather than by the `FormHelper::attributes()` method.
Several templates have been fixed.
# Third commit
The `$varStack` property was used to forward options to the label and the widget when rendering a row. The implementation was not working as expected. The proposed way to override label and widget options is to pass these options in the `label` and `widget` keys while callinf `render_row`.
That would be:
`{{ form_row(form.field, {"attr": {<row attributes>}, "label" : {"label": <text>, "attr": {<label attr>}}, "widget" : { "attr" : {<widget attributes}} } }}`
So there is now the ability to set attributes for the row (`<div>` or `<tr>`).
This has been discussed on [the mailing list](http://groups.google.com/group/symfony-devs/browse_thread/thread/17754128ba480545). **I would like to find a compromise with @Seldaek before this gets merged**
The `$varStack` property is now only used when recursively calling `FormExtension::render()`
# Notes
I have preferred to submit several commits in order to ease review and to keep some history.
---------------------------------------------------------------------------
by stof at 2011/06/20 05:20:56 -0700
@vicb On a side note, do you think it would be possible to support form theming in PHP templates too ? Currently, the only way to customize the rendering of forms when using PHP templates is to overwrite the FrameworkBundle's templates, and this impacts all forms. This makes the PHP rendering far less powerful than the Twig one.
I don't know the Form rendering and the PHPEngine well enough to know if it is feasible for 2.1 or not.
---------------------------------------------------------------------------
by vicb at 2011/06/20 05:35:11 -0700
@stof I hope to make it possible but I need a little bit more thinking to find the best possible solution which should not look like a hack.
---------------------------------------------------------------------------
by vicb at 2011/06/21 01:13:10 -0700
This should not be merged yet, it might have some issue with the variable stack. I am working on it.
---------------------------------------------------------------------------
by vicb at 2011/06/21 01:41:11 -0700
Sorted out the issue, it was linked to some local _optimization_, the code of this PR is ok.
---------------------------------------------------------------------------
by vicb at 2011/06/21 02:01:24 -0700
I have pushed a [POC of php theming based on this PR](https://github.com/vicb/symfony/commits/form%2Fphp-theme) to my repo - it is lacking a configuration and cache layer.
I have open [a thread on the ml](http://groups.google.com/group/symfony-devs/browse_thread/thread/9b3f131fe116b511) to discuss this.
---------------------------------------------------------------------------
by vicb at 2011/06/21 23:40:21 -0700
@fabpot fixed in the last commit.
Commits
-------
1cb5164 Replace some double quotes to single quotes
12259d1 Replace optionNal to optional
Discussion
----------
Fixed typo and double quotes within some strings
Fixed typo and double quotes within some strings
Commits
-------
159fc0e [Validator] Added symbols to IDNs validation
c827faf [Validator] Add support for IDNs and custom TLDs
Discussion
----------
[Validator] Add support for IDNs and custom TLDs
Minor changes to allow for IDNs and [custom TLDs](http://news.softpedia.com/news/ICANN-Approves-New-Custom-Generic-Top-Level-Domains-Like-google-bank-206977.shtml). This is the only sane way to support everything in a timeless manner.
---------------------------------------------------------------------------
by stealth35 at 2011/06/20 04:32:09 -0700
maybe it should be check the host with idn_to_ascii (if function exists, maybe it's should recreate un punycode en/decoder in the stub)
---------------------------------------------------------------------------
by mvrhov at 2011/06/20 04:40:10 -0700
/me :faceslap.
Haven't seen the link in PR
---------------------------------------------------------------------------
by Seldaek at 2011/06/20 04:40:40 -0700
@mvrhov: Yup, that's what pushed me to reconsider adding this.
@stealth35: I'm not sure if this is needed. I don't want this to be too strict, with another validator or with an extra option I think we can make a check that the domain actually exists, or do a GET / on it or something, but this just checks validity of the syntax.
---------------------------------------------------------------------------
by stealth35 at 2011/06/20 04:48:05 -0700
I understand :)
what about funny IDN like : [☎.com] (http://xn--y3h.com/) ?
---------------------------------------------------------------------------
by Seldaek at 2011/06/20 04:53:19 -0700
@stealth35: Fixed
---------------------------------------------------------------------------
by stealth35 at 2011/06/20 04:56:18 -0700
it's seem great,for acceptable chars [RFC] (http://www.faqs.org/rfcs/rfc3490.html) said (with UseSTD3ASCIIRules option) :
(a) Verify the absence of non-LDH ASCII code points; that is, the
absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F.
Commits
-------
abd60ac [WebProfilerBundle] Do not display toolbar loading result if it's not a valid toolbar
406c8d8 [WebProfilerBundle] Make toolbar loading non-blocking
Discussion
----------
Non-blocking WDT & prevents garbage to slip in the page
I made the loading non-blocking so that it's not preventing normal operation of the page when the WDT takes a bit long to come up (happens sometimes when the machine is busy).
The second commit also checks that the response looks correct, to prevent stack traces and such to appear in the page if there was a problem. The main issue is not really stack traces though it's mostly with security and intercept_redirect enabled, if you look at a fully secured site you get twice the redirect intercept message to the login page.
Tested in IE7/9/FF4/Opera11
Commits
-------
f315ad9 [WebProfilerBundle] Make sure the toolbar closes properly
Discussion
----------
[WebProfilerBundle] Make sure the toolbar closes properly
Due to the whitespace element between the div which clears and the toolbar div, in some browsers it was left over after you close the toolbar, this doesn't happen anymore.
Tested in IE7/9/FF4/Opera11
Commits
-------
6c46a3b [FrameworkBundle] Prevent breakage when an array callback is not callable
Discussion
----------
[FrameworkBundle] Prevent breakage when an array callback is not callable
W/o this you get warnings that objects can't be converted to strings.
Commits
-------
f400124 [HttpFoundation] Small optimization of Session flash handling
Discussion
----------
[HttpFoundation] Small optimization of Session flash handling
Due to copy-on-write, this is faster and takes less memory unless the flashes are changed during the request, but that's not very likely as typically you set flashes, redirect, then show them, and at that point you do not modify them again.
Commits
-------
72d0ebe9 [WebProfilerBundle] Added the support of the the logging context in the template
410b3e0 [HttpKernel] Added the context in the LoggerInterface
Discussion
----------
context in the LoggerInterface
This adds the context in the LoggerInterface. The change is totally BC for people using the logger. However this affects people implementing the interface.
Note that this require Seldaek/monolog#33 for the implementation
---------------------------------------------------------------------------
by Seldaek at 2011/06/17 04:24:18 -0700
@fabpot: just ping me when you are merging this one, so I can merge in monolog and we avoid out-of-sync issues.
---------------------------------------------------------------------------
by stof at 2011/06/17 04:49:05 -0700
@Seldaek you can merge in Monolog when you want. Monolog is BC so merging it before the PR in Symfony2 does not break things.
---------------------------------------------------------------------------
by Seldaek at 2011/06/17 05:08:34 -0700
Ah right, I thought the interfaces wouldn't match, but PHP allows extra args it seems so I'll merge right now.
---------------------------------------------------------------------------
by stof at 2011/06/17 05:32:58 -0700
PHP allows extra *optionnal* args and it is the case here :)
---------------------------------------------------------------------------
by Seldaek at 2011/06/17 05:35:00 -0700
Well yes otherwise you break the interface. Anyway it's merged so @fabpot, anytime :)
Commits
-------
98b6f9b Fixed tests
ad1b690 [DoctrineBundle] Updated the XSD schema
41347bc [DoctrineBundle] Added the support of custom types for the platform
Discussion
----------
Doctrine mapping types
This adds the full support of Doctrine mapping type, allowing to use them in the SchemaTool. It closes#1349
---------------------------------------------------------------------------
by stof at 2011/06/17 02:05:45 -0700
See also symfony/symfony-docs#414 for the doc
---------------------------------------------------------------------------
by fabpot at 2011/06/17 02:18:03 -0700
Tests do not pass.
---------------------------------------------------------------------------
by stof at 2011/06/17 02:25:25 -0700
Fixed
---------------------------------------------------------------------------
by beberlei at 2011/06/17 03:27:58 -0700
+1
Commits
-------
5b0f1da [HttpKernel] made WebTestCase methods static
Discussion
----------
[HttpKernel] made WebTestCase methods static
This makes it possible to load fixture data in `::setUpBeforeClass()` which makes tests run much faster.
Also, `createClient()` is not protected instead of public; I'm not sure why it was public in the first place.
Commits
-------
edf4b87 Add missing "tearDown" functions, and some missing variable declaration (this saves for me almost 20MB when run all tests) Force AsseticBundle tests to use TestCase Fix test for DoctrineBundle to use TestCase
2b0c352 Increase code coverage for: YamlParser, Validators, PhpEngine + Helpers, HttpFoundation
b88a0a0 Remove tabs
99f9337 Additional tests for PhpEngine + Helpers More tests for UrlValidator
450ed85 Additional tests for DateTimeValidator, EmailValidator and UrlValidator
Discussion
----------
[Tests] Cleanup + make code coverage more happy
Hey,
this PR is a bit bigger than usually ;-) few infos what's inside:
- Fix `DoctrineBundle` test to use `TestCase`
- Mark tests as "incomplete" instead of commenting them out
- Increase code coverage for: `Validators`, `PhpEngine` + `Helpers`, `HttpFoundation` (`Session`, `Response` etc.)
- And my favourite ;-) added missing variables definition (also removed non-used) and `tearDown()` function (if needed) to tests which allowed me saved __~15MB__ when running all tests
---------------------------------------------------------------------------
by stloyd at 2011/06/16 05:58:21 -0700
@fabpot & @marcw It was rebased and cleanup up (I split up `AsseticBundle` symfony/AsseticBundle#1 change to new repo), and added few new tests.
Commits
-------
72c074a [Session] Used \Locale::setDefault() when the locale is setted
Discussion
----------
[Session] Used \Locale::setDefault() when the locale is setted
For `DateType` in form component (by example), `\Locale::getDefault()` is used to displayed the name of months.
If `\Locale` class is not used when the locale is setted in the session, the name of months is not in a good language.
This PR solves this problem.
---------------------------------------------------------------------------
by pborreli at 2011/05/29 09:13:44 -0700
what if user doesn't have intl extension ?
---------------------------------------------------------------------------
by stof at 2011/05/29 09:24:04 -0700
You should wrap the calls to ``\Locale::setDefault`` in a ``class_exist`` check to avoid issue when using the stub implementation (for which calling ``setDefault`` is forbidden).
---------------------------------------------------------------------------
by francisbesset at 2011/05/29 09:26:40 -0700
@pborreli: Symfony have a fake Locale class and this class is used only if the server haven't intl enabled.
---------------------------------------------------------------------------
by stof at 2011/05/29 09:33:16 -0700
@francisbesset Yeah, but ``setDefault`` throw a ``BadMethodCall`` exception.
and so the check has to use ``extension_loaded`` instead of ``class_exists``.
---------------------------------------------------------------------------
by fabpot at 2011/06/13 10:12:15 -0700
Ticket #1121 is related to this PR.
---------------------------------------------------------------------------
by fabpot at 2011/06/15 06:18:28 -0700
I have just tried another implementation where the locale is passed as an argument to the built-in types and some data transformers (via a `LocaleAwareInterface` interface). That works fine as forms are immutable now, but the solution is obviously more "complex" as we need to pass the locale to many different classes. Also, using `Locale::setDefault()` has an advantage over my method: you can change the locale whenever you want within a PHP process (which can be useful even if this is an edge case). Last, but not the least, if make sense to update the PHP Locale to the user locale.
So, to sum up, this patch is probably the best solution (easy and flexible enough).
Commits
-------
e8326aa Renamed attributes to attr to be consistent with templating.
c707467 Added support for additional attributes in Form types that list field as their parent.
Discussion
----------
[Form] Added support for additional attributes
Added support for additional attributes in Form types that list field as their parent.
This is needed particularity for html5 data and data- attributes support, unfortunately $options['data'] is already taken, so adding a general $options['attributes'] is the easiest solution without breaking BC.
Now I know that this will be tempting for some to stuck style and class attributes here also, but I'd rather not restrict the keys that are passed in.
---------------------------------------------------------------------------
by Seldaek at 2011/05/22 14:51:02 -0700
Maybe it should be called attr for consistency with the template stuff, or the other should be renamed attributes. Other than that, I'm +1, data-* attributes are awesome, and abusers will find ways to abuse things either way.
---------------------------------------------------------------------------
by mvrhov at 2011/05/22 21:48:01 -0700
Naming it attr also crossed my mind when I was signing off yesterday.
Along with the possibility to go the way xml attributes are handled when node is converted to/from array.
So every option with @ prefix would automatically become html attribute. However going the latter path, it'd be harder to implement.
---------------------------------------------------------------------------
by fabpot at 2011/06/13 07:43:52 -0700
Can you give an example of a real-world use case? Thanks.
---------------------------------------------------------------------------
by Seldaek at 2011/06/13 07:54:51 -0700
You can use `array('attr' => array('data-foo' => 'bar'))`, which will output `data-foo="bar"`, which can be read easily by jQuery for example as `$('el').data('foo')`. It's a standard compliant and elegant way to pass extra data needed by the JS code along with DOM nodes, without polluting everything with script tags and all.
---------------------------------------------------------------------------
by fabpot at 2011/06/13 08:01:08 -0700
@Seldaek: I understand that. But why not doing this in the template?
---------------------------------------------------------------------------
by Seldaek at 2011/06/13 08:04:10 -0700
Well, I agree it most likely belongs in the template, but it's kind of data stuff that is not directly impacting the display rules of the element, so in some cases having the possibility to set that from the php code might be useful. Anyway I'll let @mvrhov answer maybe he had a more concrete use case. I just think it's nice to leave the door open, but I don't really need it.
---------------------------------------------------------------------------
by mvrhov at 2011/06/13 10:27:03 -0700
A bit late to the party. Ok, here is my use-case.
I have a pretty large form where part of the data is of tabular form. The number of rows is almost every time a lot larger than the number of columns
So I can either output a lot of text inputs filled with data and make already a large form intimidating. Or I can use a grid that supports editing. So I serialize that tabular data as json and put it as a value into one hidden field. Somehow I also have to get the column definitions to that grid. I decided to I serialize it and put it inside data-* attribute. Putting it into another hidden field doesn't make sense as when data is submitted back I don't need the column definitions as only the number of rows changes.
---------------------------------------------------------------------------
by fabpot at 2011/06/13 10:44:58 -0700
@mvrhov: ok, but what prevents you from doing this in the template directly?
---------------------------------------------------------------------------
by mvrhov at 2011/06/13 11:22:53 -0700
I have to get it into the view somehow. What I'd really not like to do is, iterate through that data in a controller and then pass it as another template variable.
---------------------------------------------------------------------------
by fabpot at 2011/06/14 00:10:22 -0700
But the controller is where you prepare the data that you want to send to the view. Without any concrete example, I'm going to close this PR.
---------------------------------------------------------------------------
by mvrhov at 2011/06/14 01:21:10 -0700
IMHO this has to go out through form as this is the part of the form also I do have a very slim controllers in this case 10 LOC, where half of them is just setting up an view data..
Nonetheless I went looking again very closely at the AbstractType and I do have buildView function available which I can override and set the column data I need there, and then provide custom view for that, so at least from this part this is an non issue.
With this PR all default form attributes can be set from outside and when searching for a good use-case I have found out that @henrikbjorn has implemented this via extensions [1], maybe he has a good use-case for this.
[1] - https://github.com/Comways/ComwaysFormExtraBundle/blob/master/Form/Extension/FieldTypeExtension.php
---------------------------------------------------------------------------
by henrikbjorn at 2011/06/14 01:48:53 -0700
Convenience is the only use case
---------------------------------------------------------------------------
by stof at 2011/06/14 02:08:09 -0700
@fabpot The issue is that passing it from the controller as another template variable makes it really hard when you use the type twice with different values. Passing them from the form would be the easiest way
---------------------------------------------------------------------------
by shuogawa at 2011/06/14 19:37:50 -0700
hello. thanks for great form library.
I want to support two ways to display additional attributes for form elements.
1) control in template like
{{ form_row(form.name, { 'width': '30' }) }}
2) control from php
$builder->add('name', 'text', array('attr'=>array('width'=>'30')));
If form elements configure by end user like cms,
and form elements dynamically change.
The second method is useful.
template designer can write {{form_row(form)}}
but
template designer can not write {{form_row(form.name), { 'width': '30' }}}
Thank you
---------------------------------------------------------------------------
by fabpot at 2011/06/14 23:01:18 -0700
@shuogawa: That's what I fear. Setting the `width` or any other attribute in PHP is wrong. This belongs to the templates.
---------------------------------------------------------------------------
by stloyd at 2011/06/15 00:09:05 -0700
@fabpot Then maybe just restrict allowed tags to `data-*` and don't use `attr` but some other not confusing name ? Just like we do with i.e. `maxlength`.
---------------------------------------------------------------------------
by fabpot at 2011/06/15 04:44:25 -0700
I'm going to merge it as a "convenience" tool, but the documentation should clearly state that the only usage should be for `data-*` attributes.
Commits
-------
cdf4b6a Checked log levels
a45d3ee Reverted last commit
529381b ControllerNotFound: Changed log level from info to error. Also moved throw exception code block up, to prevent the message from beeing logged multiple times.
7c29e88 Changed log level of "Matched route ..." message from info to debug
dca09fd Changed log level of "Using Controller ..." message from info to debug
Discussion
----------
Log levels
Just wanted to ask if the log level INFO is still correct for these messages?
As there are only four log levels left (DEBUG, INFO, WARNING, ERROR), DEBUG might be the more appropriate level for these messages now.
Let me give an example: An application is logging user actions (maybe to database) in order to assure comprehensibility, e. g. "User %s deleted post %d", "User %s written a message to user %s". These are not warnings of course, so the only suitable log level is INFO.
But they will be thrown together with these very common (at least two per request?) "Using controller..." and "Matched route..." messages when choosing INFO as log level.
---------------------------------------------------------------------------
by Seldaek at 2011/05/24 07:13:18 -0700
Agreed, this stuff is framework debug information.
---------------------------------------------------------------------------
by fabpot at 2011/05/24 08:53:24 -0700
Why do you want to change these two specific ones? The framework uses the INFO level at other places too. Is it a good idea to say that the framework only logs with DEBUG?
---------------------------------------------------------------------------
by stof at 2011/05/24 09:12:53 -0700
Doctrine logs at the INFO level too and I think it is useful to keep it as INFO. Being able to see the queries without having all DEBUG messages of the event dispatcher and security components is useful IMO.
---------------------------------------------------------------------------
by Seldaek at 2011/05/25 02:30:24 -0700
Yeah, that's true, maybe we just need to reintroduce (again, meh:) NOTICE between INFO and WARNING.
@kaiwa Of course the other way could be that you just add your DB handler to the app logger stack. That could be done in a onCoreRequest listener or such, basically you'd have to call `->pushHandler($yourDBHandler)` on the `monolog.logger.app` service. That way your messages will flow to it, but it won't receive noise from the framework stuff since those log on monolog.logger.request and other log channels.
---------------------------------------------------------------------------
by fabpot at 2011/05/25 02:48:26 -0700
@Seldaek: I don't think we need another level. We just need to come up with a standard rules about the usage of each level. Adapted from log4j:
* ERROR: Other runtime errors or unexpected conditions.
* WARN: Use of deprecated APIs, poor use of API, 'almost' errors, other runtime that are undesirable or unexpected, but not necessarily "wrong" (unable to write to the profiler DB, ).
* INFO: Interesting runtime events (security infos like the fact the user is logged-in or not, SQL logs, ...).
* DEBUG: Detailed information on the flow through the system (route match, security flow infos like the fact that a token was found or that remember-me cookie is found, ...).
What do you think?
---------------------------------------------------------------------------
by stloyd at 2011/05/25 02:53:38 -0700
+1 for this standard (also this PR can be merged then), but we should review code for other "wrong" log levels usage (if everyone accept this standard)
---------------------------------------------------------------------------
by fabpot at 2011/05/25 02:55:07 -0700
I won't merge this PR before all occurrences of the logger calls have been reviewed carefully and changed to the right level.
---------------------------------------------------------------------------
by kaiwa at 2011/05/25 02:58:44 -0700
@fabpot: Just noticed these two occurring for every request in my log file. You are right, there are other places where this changes must be applied if we will change the log level.
@stof: Hmm, i see. It is not possible to set the logger separately for each bundle, is it? That maybe would solve the problem. If somebody is interested in seeing the queries, he could set the log handler level to DEBUG for doctrine bundle, but still use INFO for the framwork itself. Plus he could even define a different output file or a completely different handler.
I'm not sure if something like that is possible already (?) or realizable at all... just came into my mind.
---------------------------------------------------------------------------
by Seldaek at 2011/05/25 03:01:07 -0700
Just FYI, from Monolog\Logger (which has CRITICAL and ALERT):
* Debug messages
const DEBUG = 100;
* Messages you usually don't want to see
const INFO = 200;
* Exceptional occurences that are not errors
* This is typically the logging level you want to use
const WARNING = 300;
* Errors
const ERROR = 400;
* Critical conditions (component unavailable, etc.)
const CRITICAL = 500;
* Action must be taken immediately (entire service down)
* Should trigger alert by sms, email, etc.
const ALERT = 550;
The values kind of match http error codes too, 4xx are expected errors that are not really important (404s etc) and 5xx are server errors that you'd better fix ASAP. I'm ok with the descriptions, but I think alert and critical should be included too. I'll probably update Monolog docblocks to match whatever ends up in the docs.
---------------------------------------------------------------------------
by Seldaek at 2011/05/25 03:03:21 -0700
@kaiwa you can do a lot, but not from the default monolog configuration entry, I'm not sure if we can really make that fully configurable without having a giant config mess. Please refer to my [comment above](https://github.com/symfony/symfony/pull/1073#issuecomment-1234316) to see how you could solve it. Maybe @fabpot has an idea how to make this more usable though.
---------------------------------------------------------------------------
by stof at 2011/05/25 03:19:43 -0700
@Seldaek the issue is that the different logging channels are only know in the compiler pass, not in the DI extension. So changing the level in the extension is really hard IMO.
Thus, the handlers are shared between the different logging channels (needed to open the log file only once for instance, or to send a single mail instead of one per channel) and the level is handled in the handlers, not the logger.
I'm +1 for the standard, by adding the distinction between 400 and 500 status calls using ERROR and CRITICAL (which is already the case in the code).
@kaiwa do you have time to review the calls to the logger between DEBUG and INFO or do you prefer I do it ? For instance, the Security component currently logs all message at DEBUG level and some of them should be INFO.
---------------------------------------------------------------------------
by kaiwa at 2011/05/25 04:31:04 -0700
@stof ok i'll do that
---------------------------------------------------------------------------
by kaiwa at 2011/05/25 12:22:51 -0700
Need some help :) I came across `ControllerNameParser::handleControllerNotFoundException()` which leads to redundant log messages currently:
>[2011-05-25 20:53:16] request.INFO: Unable to find controller "AppBaseBundle:Blog" - class "App\BaseBundle\Controller\BlogController" does not exist.
>[2011-05-25 20:53:16] request.ERROR: InvalidArgumentException: Unable to find controller "AppBaseBundle:Blog" - class "App\BaseBundle\Controller\BlogController" does not exist. (uncaught exception) at /home/ruth/symfony3/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php line 87
Is it necessary to call `$this->logger->info($log);` if the InvalidArgumentException will be logged anyway?
---------------------------------------------------------------------------
by stof at 2011/05/25 12:39:22 -0700
Well, the issue is that the ControllerNameParser logs messages and then uses them to throw an exception. I guess the logging call should be removed as it is redundant with the one of the ExceptionListener. @fabpot thoughts ?
---------------------------------------------------------------------------
by kaiwa at 2011/05/27 11:39:25 -0700
I checked all debug, info and log calls. Sometimes it is hard to distinguish between the levels, so it would be great if someone reviews @cdf4b6a. @stof, maybe you want to take a look?
---------------------------------------------------------------------------
by kaiwa at 2011/05/31 12:52:07 -0700
@stof, thanks for your comments. I added some replies above, please let me know your suggestions.
---------------------------------------------------------------------------
by stof at 2011/05/31 14:04:22 -0700
@kaiwa As I said before, all the security logging calls should be DEBUG (most of them) or INFO (the one syaing that authentication succeeded for instance), but not WARN or ERROR as the exception don't go outside the firewall.
The blackhole plugin that was used previously stop the propagation
of events, which means that the behavior can be slightly different
depending on the order of plugin registrations.
Instead, we now use the null transport to avoid this issue.
Commits
-------
07fa82d [Form] Revert changes impacting perfomance and readability
b709551 [Order] Make Form::types and FormView::types use the same order (Parent > Child)
e56dad6 [Form] simplify the code
bdd755e [Form] Fix the exception message when no block is found
c68c511 [Form] Make theming form prototypes consistent (start by looking for a '_<id>_<section>' block)
9ec9960 [Form] Simplify the code
4e3e276 [Form] Make the prototype view child of the collection view
Discussion
----------
[Form] Make the prototype view child of the collection view
This PR should be a base for discussion.
The [current implementation](https://github.com/symfony/symfony/pull/1188) has some drawbacks because the prototype view is not a child of the collection view:
* The 'multipart' attribute is not propagated from the prototype to the collection,
* The prototype view do not use the theme from the collection.
Those 2 points are fixed by the proposed implementation and one more benefit is that the template markup might be easier to work with:
before:
```html
<div id="form_emails">
<div>
<label for="form_emails_0">0</label>
<input type="email" id="form_emails_0" name="form[emails][0]" value="a@b.com">
</div>
<script type="text/html" id="form_emails_prototype">
<div>
<label for="$$name$$">$$name$$</label>
<input type="email" id="$$name$$" name="$$name$$" value="" />
</div>
</script>
</div>
```
after:
```html
<div id="form_emails">
<div>
<label for="form_emails_0">0</label>
<input type="email" id="form_emails_0" name="form[emails][0]" value="a@b.com">
</div>
<script type="text/html" id="form_emails_prototype">
<div>
<label for="form_emails_$$name$$">$$name$$</label>
<input type="email" id="form_emails_$$name$$" name="form[emails][$$name$$]" value="" />
</div>
</script>
</div>
```
@kriswallsmith I'd like to get your feedback on this PR. thanks.
---------------------------------------------------------------------------
by stof at 2011/06/14 07:01:01 -0700
@fabpot any ETA about merging it ? Using the prototype currently is a pain to build the name. The change makes it far easier
---------------------------------------------------------------------------
by fabpot at 2011/06/14 07:09:46 -0700
The templates are much better but I'm a bit concerned that we need to add the logic into the Form class directly. That looks quite ugly. If there is no other way, I will merge it.
---------------------------------------------------------------------------
by vicb at 2011/06/14 07:14:32 -0700
I have found no better way... I am testing some minor tweaks I want to submit.
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/14 07:34:25 -0700
I'm not happy with the code in Form.php either... would creating a PrototypeType accomplish the same thing?
---------------------------------------------------------------------------
by vicb at 2011/06/14 07:42:07 -0700
@kriswallsmith tried and dismissed, the id and name are bad & you have to go for `render_widget(form.get('proto'))` in the template. That should be fixeable but not any better.
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/14 07:45:21 -0700
What do you mean the id and name are bad? If we have a distinct type for the prototype, can't we do whatever we want using buildView() and the template?
---------------------------------------------------------------------------
by vicb at 2011/06/14 07:53:31 -0700
@kriswallsmith the id would be smthg like `form_emails_$$name$$_prototype` but yes we should be able to do whatever we want but the code might end up being more complex.
I am done with the tweaks but still open to feedback on this PR.
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/14 08:08:21 -0700
Yes, that is the type of name I would expect.
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/14 08:08:33 -0700
Oops -- I mean id.
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/14 08:09:42 -0700
Maybe I'm confused what id you're referring to. I'll try to spend some time on this today.
---------------------------------------------------------------------------
by vicb at 2011/06/14 08:23:56 -0700
That should be the id of the `<input>`, the id of the script would be `form_emails_$$name$$_prototype_prototype` (if prototype is the name of the nested node).
I am trying to setup a branch with my code (playing with git & netbeans local history)
---------------------------------------------------------------------------
by vicb at 2011/06/14 08:46:25 -0700
@kriswallsmith https://github.com/vicb/symfony/tree/kris/proto if that can help (there are still changes in Form.php)
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/14 08:47:08 -0700
Thanks, I'll take a look.
---------------------------------------------------------------------------
by vicb at 2011/06/15 00:48:38 -0700
I would have expected it to be faster however `array_map` is about twice slower... reverted !
Commits
-------
49dd558 Couple more CS fixes
5a986bf Add $keysCount & minor CS fix
91f4097 [Routing] Better nesting for RouteCollections in dumped URL matcher classes With this change, a route prefixed with '/blogger' will be nested inside '/blog' (for example)
Discussion
----------
[Routing] Better nesting for RouteCollections in dumped URL matcher classes
Consider the following routing file:
_blog:
resource: "@AcmeDemoBundle/Resources/config/routing/BlogController.yml"
prefix: /blog
_blogger:
resource: "@AcmeDemoBundle/Resources/config/routing/BloggerController.yml"
prefix: /blogger
_bloggeroo:
resource: "@AcmeDemoBundle/Resources/config/routing/BloggerooController.yml"
prefix: /bloggeroo
_blogtest:
pattern: /blogtest
defaults: { _controller: AcmeDemoBundle:Blog:test }
login:
pattern: /login
defaults: { _controller: AcmeDemoBundle:Security:login }
Note: Each imported file contains two simple blog/blogger/bloggeroo routes (e.g. blog_index & blog_view)
With this change, the cached URL matcher looks something like this:
```php
<?php
class appprodUrlMatcher
{
public function match($pathinfo)
{
$allow = array();
if (0 === strpos($pathinfo, '/blog')) {
// blog_index
if (preg_match('#^/blog/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {...}
// blog_view
if (preg_match('#^/blog/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {...}
if (0 === strpos($pathinfo, '/blogger')) {
// blogger_index
if (preg_match('#^/blogger/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {...}
// blogger_view
if (preg_match('#^/blogger/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {...}
if (0 === strpos($pathinfo, '/bloggeroo')) {
// bloggeroo_index
if (preg_match('#^/bloggeroo/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {...}
// bloggeroo_view
if (preg_match('#^/bloggeroo/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {...}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
// _blogtest
if ($pathinfo === '/blogtest') {...}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
// login
if ($pathinfo === '/login') {...}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
}
```
As far as I can see, you can throw the 404 earlier (as I've done), as by nesting all these possibilities, there is no chance another route will be matched outside the parent if statement.
---------------------------------------------------------------------------
by stloyd at 2011/06/11 08:37:15 -0700
You should follow Symfony [CS rules] (http://symfony.com/doc/current/contributing/code/standards.html), also you should modify tests.
---------------------------------------------------------------------------
by lmcd at 2011/06/11 08:46:32 -0700
Besides the inline `continue` statement, I can't see spot any other CS violations. I'm on to the updated tests.
---------------------------------------------------------------------------
by fabpot at 2011/06/13 02:19:14 -0700
What if you have this:
_blog:
resource: "@AcmeDemoBundle/Resources/config/routing/BlogController.yml"
prefix: /blog
login:
pattern: /login
defaults: { _controller: AcmeDemoBundle:Security:login }
_blogger:
resource: "@AcmeDemoBundle/Resources/config/routing/BloggerController.yml"
prefix: /blogger
You cannot send 404 early because the same `blog` prefix is used in two different places. I can see many things that will break with this patch. I'm pretty sure we can enhance the performance of the existing code but let's do that after 2.0.
---------------------------------------------------------------------------
by lmcd at 2011/06/13 05:04:03 -0700
@fabpot: The code was designed so it would work in these kind of circumstances. I ran the dumper against the routing file you provided and this is the output below.
I see no reason why you can't throw the 404 earlier, as by nesting everything with similar prefixes, we're eliminating the possibility that a route will ever be matched outside of that if statement.
```php
public function match($pathinfo)
{
$allow = array();
if (0 === strpos($pathinfo, '/blog')) {
// blog_index
if (preg_match('#^/blog/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {
...
}
// blog_view
if (preg_match('#^/blog/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {
...
}
if (0 === strpos($pathinfo, '/blogger')) {
// blog_index
if (preg_match('#^/blogger/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {
...
}
// blog_view
if (preg_match('#^/blogger/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {
...
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
// login
if ($pathinfo === '/login') {
...
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
}
```
---------------------------------------------------------------------------
by fabpot at 2011/06/13 07:48:49 -0700
Can you add some more tests to ensure that everything works fine and that we won't have regressions later on? Thanks.
Commits
-------
e718474 fixed CS and unsude variable (PR #1319)
b552354 Executable Finder will now try to match if a file is already in the open_basedir list before searching it thru that list
Discussion
----------
open_basedir exhancements for Executable Finder
I've made the some changed to the Executable Finder in order to handle the open_basedir ability to specify files in the list not just directories.
This should fixsymfony/symfony#1319
Hope I didn't made any CS violations.
Commits
-------
9d6357c [HttpFoundation] Document the changes to the File classes
136b80a [HttFoundation] Add File::getExtension() as \SplFileInfo::getExtension() was introduced in PHP 5.3.6
38b3b74 [HttpKernel] Fix and test previous commit
ac0c00c [HttpFoundation] Make File extends \SplFileInfo
Discussion
----------
[HttpFoundation] Make File extends \SplFileInfo
This is a rebased version of [PR 674](https://github.com/symfony/symfony/pull/674).
* File: The API has changed (now extends \SplFileInfo),
* File: move() creates the target directory when it does not exist
* UploadedFile: introduction of getClientXXX() methods (for Size, OriginalName, MimeType)
If this PR does not get merged UploadedFile should at least be fixed: [Client.php](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Client.php#L124) relies on a last parameter which is no more defined and which is used to bypass [move_uploaded_file()](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/File/UploadedFile.php#L155) in test mode.
If this could be merged, I'll detail the changes in UPDATE.md
---------------------------------------------------------------------------
by fabpot at 2011/06/14 08:20:59 -0700
I'll merge it. Can you update the UPDATE file?
---------------------------------------------------------------------------
by vicb at 2011/06/14 09:24:01 -0700
done
Commits
-------
4016dfb [AsseticBundle] moved ExecutableFinder back into a closure so it's only called if needed
Discussion
----------
[AsseticBundle] moved ExecutableFinder back into a closure
[AsseticBundle] moved ExecutableFinder back into a closure so it's only called if needed
---------------------------------------------------------------------------
by fabpot at 2011/06/14 05:46:14 -0700
Does it relate to #1319?
---------------------------------------------------------------------------
by kriswallsmith at 2011/06/14 05:47:25 -0700
It's related, yes, but I don't think it's a solution for the issue.
---------------------------------------------------------------------------
by dlsniper at 2011/06/14 06:00:55 -0700
The issue in #1319 has been fixed with this: 0d54f5c21e
It's in the latest master tree but finding that file only when needed is also a good idea.
# Commits
ca52a04 [Validator] Allow DateTime objects as valid Times
# Discussion
## [Validator] Allow DateTime objects as valid Times
Also added tests for `DateTime` objects as valid on `Date` and `Time` constraints.
I didn't include the test for the `DateTime` constraint, as it's already included in this PR:
https://github.com/symfony/symfony/pull/1085
---------------------------------------------------------------------------
## fabpot @ 2011/06/09 09:07:21 -0700
I don't think it makes sense to use a \DateTime instance to represent a Time.
---------------------------------------------------------------------------
## ajessu @ 2011/06/09 09:33:20 -0700
If I have an entity with a doctrine type `Time`:
Time (DateTime instance where only H:i:s get persisted)
```php
<?php
/**
* @ORM\Column(type="time")
* @Assert\Time()
*/
protected $startTime;
```
and I create a form out of this Entity, a `DateTime` object is passed when the form is submitted.
This generates an `UnexpectedTypeException`.
I just made this change to match the `Date` validator with the doctrine type `Date`, which also shares this behavior:
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Constraints/DateValidator.php#L28
Date (DateTime instance where only Y-m-d get persisted)
Rules are as follows:
* If multiple is true, then the empty_value is ignored
* If not, and if the field is not required, the empty_value is set to the empty string by default and displayed
* If the field is required, and if the user explicitely set the empty_value, then it is displayed
* kriswallsmith/form/collection-proto:
added script[type="text/html"] collection prototype to form themes
[Form] removed collection prototype from form tree
* vicb/form-render-fix:
[Form][TwigBridge] Improve the cache layer by caching blocks instead of templates
[Form][TwigBridge] Make the template cache more efficient
[Form][TwigBridge] Fix rendering
This reverts commit d044498cde.
The reason for reverting is that the name is actually used to customize
the template on a per field basis:
{% block _post_excerpt_widget %}
***{{ block('text_widget') }}***
{% endblock %}
Here, post is the name of the Type.
The definition "assetic.helper.static" references the service "templating.helper.assets" which belongs to a narrower scope. Generally, it is safer to either move "assetic.helper.static" to scope "request" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "templating.helper.assets" each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.
* theinterned/patch-1:
made logoutPath localizable as well
storing localized targetPath in a string as opposed to updating the attribute
In the spirit of 882a8e3f09 allow for localized logout target url
* kriswallsmith/form/lazier-csrf-token:
[Form] fixed xpath
[Form] moved csrf listener to its own class
fix issue with csrf token not present on collection fields because of resize listener
* lmcd/master:
$code referenced but not defined in compileRoute()
[Routing] Optimised the PHP URL matcher dumper The cached URL matcher classes contain some unneeded logic. Consider the following example:
The cached URL matcher classes contain some unneeded logic. Consider the following example:
if (0 === strpos($pathinfo, '/Blog')) {
// blog_index
if (0 === strpos($pathinfo, '/Blog') && preg_match('#^/Blog/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {
return array_merge($this->mergeDefaults($matches, array ( '_action' => 'index',)), array('_route' => 'blog_index'));
}
}
The 2nd strpos is not required, as we have already satisfied this condition in the parent if statement.
My change will produce the following code for the same routing setup::
if (0 === strpos($pathinfo, '/Blog')) {
// blog_index
if (preg_match('#^/Blog/(?P<slug>[^/]+?)$#x', $pathinfo, $matches)) {
return array_merge($this->mergeDefaults($matches, array ( '_action' => 'index',)), array('_route' => 'blog_index'));
}
}
* lsmith77/serializer_tweaks: (22 commits)
clarified that BC is broken in the Serializer component
added UPDATE notes for Serializer component changes
fix tests
marked public api
more encoder lazy loading tweaks
always use getEncoder() to enable lazy loading
cosmetic tweak
removed setEncoder/removeEncoder/addNormalizer/removeNormalizer
SerializerAwareInterface and DecoderInterface do not implement EncoderInterface anymore
handle non objects
moved the methods that can later be moved to a Builder to the bottom
use getEncoder inside encode/decode
made serialize/deserialize/encode/decode final
added Constructor
added Exception's from SerializerBundle
made (de)normalizeObject() private
renamed hasEncoder/hasDecoder to supportsSerialization/supportsDeserialization
notice fixes
typo fixes
all encoders implement EncoderInterface
...
* lmcd/master:
Added an optimisation for PHP-FPM (FastCGI Process Manager). As soon as a full Response is dispatched to the browser, the HTTP connection is closed, but the script stays alive on FPM servers.
* hhamon/doctrine_metadatafactory_fix:
[DoctrineBundle] fixed missing backslashe.
[DoctrineBundle] simplified getClassMetadataFactoryClass() method in both DisconnectedMetadataFactory and MetadataFactory classes.
[DoctrineBundle] added new DisconnectedMetadataFactory class that is now used in the doctrine:generate:entities command instead of the MetadataFactory class.
anything else is a total edge case that doesnt break with this change. it just means that for that edge case it will not be possible to "statically" determine if the encoder doesnt actually support encoding.
actually the main methods I am looking for is hasDecoder() and getEncoder() to be able to check if there is a Decoder to decode the Request body as well as if the encoder implements the TemplatingAwareInterface
The current implementation is not ready for inclusion in 2.0. It has several
known problems (security, not possible to disable it, not "cloud-compatible",
...) and it's not a must have feature anyway.
Some references:
* Security issue in FileType: https://github.com/symfony/symfony/issues/1001
* Validation fails on file, still stored in TemporaryStorage: https://github.com/symfony/symfony/issues/908
* Add a size argument & ability to configure TemporaryStorage: https://github.com/symfony/symfony/pull/748
This feature should be reworked and discussed for inclusion in 2.1.
* yethee/doctrine_bridge:
[DoctrineBridge] Removed all options of the parent type
[DoctrineBridge] Removed unneeded use statement
[DoctrineBridge] Fixed typo
[DoctrineBridge] Removed duplicating options in EntityType
* added a RegistryInterface
* changed all classes to depend on the Registry instead of a specific EntityManager
This is more consistent as the validator already took the registry and this allows
to use any entity manager in Forms.
* beberlei/AsseticDirectoryResource:
[Assetic] Make AsseticExtension::createDirectoryResourceDefinition public, so that third party bundels can easilycreate definitions to search for assetic formulae in additional directories. LiipThemeBundle needs this to make the app/Resources/themes and Bundle/Resources/themes folder searchable. Without this change the whole method would need to be copy pasted. Since the method has no side-effects at all (only factory, not pushing into the container) this change is justifyable imho.
This fixes choices when all the keys are strings (but integers really).
That's because in PHP, if you have the following array:
array('1' => 'foo', '2' => 'bar');
PHP "converts" it automatically to the following array:
array(1 => 'foo', 2 => 'bar');
* fivestar/single-choice-expanded:
[Form] Fixed FixRadioInputListener to not ignore 0.
[Form] Fixed single expanded choice type to set checked attribute when passed boolean value
* vicb/form-rendering-fix:
[Form] Fix accessibility for file inputs
[FrameworkBundle] Fix the FormHelper phpDoc
[FrameworkBundle][Form] Add some phpDoc for the FormHelper class
[FrameworkBundle][Form] Fix label rendering
[FrameworkBundle][Form] Fix rendering search inputs in PHP
[Form] FormType labels should never have a for attribute
[Form] Never render a view again
* The command names have now full support for nested namespaces. It means
that abbreviations work for each sub-namespace:
./app/console doctrine:mapping:info
# worked before
./app/console doctrine:map:in
# works now
./app/console doc:map:in
* Aliases are now first class citizen. They can have their own namespace,
like the main name. So, now, there is no difference between an alias and a
name.
* As names and aliases can be namespaced, the Command::getFullName() and
Command::getNamespace() method have been removed.
Here are the new simplified rules:
* Required cache warmers are *always* executed when the Kernel boots for the first time;
* Optional cache warmers are *only* executed from the CLI via cache:warmup
These new rules means that all the configuration settings for the cache
warmers have been removed. So, if you want the best performance, remember to
warmup the cache when going to production.
This also fixed quite a few bugs.
* gordonslondon/http-foundation/response:
[HttpFoundation] merge Response::isRedirected() with Response::isRedirect() - Response::isRedirected() has been removed
If some of the nested views are rendered individually they should not be rendered again when calling form_rest.
A typical would be when some nested file views are rendered, form_rest should not render them again.
It is still possible to render a label once the widget has been rendered. This is for checkboxes and radios
where the widget is typically rendered before the label.
* jwage/master:
Revert back to using gmmktime and use day 15 instead of 1 to avoid edge case
Use mktime instead of gmmaketime. On the 1st of every month the following options are generated:
* weaverryan/doctrine_controller_methods:
[FrameworkBundle] Adding a check for the existence of the Doctrine service
[DoctrineBundle] Fixing error per @stloyd
[FrameworkBundle][DoctrineBundle] Adding a few shortcut methods