Commit Graph

7280 Commits

Author SHA1 Message Date
Kris Wallsmith
d67d419f3c [HttpFoundation] added missing trustProxy condition 2012-01-13 11:05:57 -08:00
Maksim Kotlyar
7961014140 [Yaml][Parser] changes according review 2012-01-13 17:48:38 +02:00
Maksim Kotlyar
efce640a5e [Yaml][Parser] throw an exception if not readable 2012-01-13 10:48:50 +02:00
Fabien Potencier
02a12b2c5c merged branch kriswallsmith/strpos (PR #3097)
Commits
-------

fe62401 optimized string starts with checks

Discussion
----------

optimized string starts with checks

Doing this with strpos() is slightly faster than substr().

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

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

by vicb at 2012-01-11T19:58:27Z

How faster ? even if the string is long and do not contain an occurrence of the sub-string ?
Looks like micro-(not)-optimizations to me.

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

by kriswallsmith at 2012-01-11T20:04:26Z

The difference is about 0.1s when repeated 1M times.

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

by vicb at 2012-01-11T20:08:12Z

% would be better (machine & env independant), what string size, what match offset ?
I personally vote against (`substr` is more meaningful to me and I do not like micro-optims)

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

by kriswallsmith at 2012-01-11T20:12:34Z

I personally consider this a coding standard but don't want to bikeshed here :)

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

by vicb at 2012-01-11T20:28:08Z

I have [tried](https://gist.github.com/1596588) at home.
`strpos ` **is** faster unless you have a very long string, probably because you do not need to create a new string, interesting, thanks for the tip.

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

by Tobion at 2012-01-11T22:40:18Z

I think strpos() is more useful. Say you want to change the string you have to replace 2 variables (the text and the length parameter) when using substr(). It could also introduce bugs when they don't match. With strpos() it's only the text.

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

by robocoder at 2012-01-11T22:43:22Z

alternate micro-optimization that doesn't create a temporary string:
```
strncmp($v, "@", 1) === 0
```

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

by Tobion at 2012-01-11T22:47:12Z

@robocoder probably the fastest solution but needs to be benchmarked
2012-01-12 18:48:45 +01:00
Fabien Potencier
fb3513a50e merged branch kriswallsmith/kernel/unnecessary-regex (PR #3104)
Commits
-------

7f7f82a [HttpKernel] removed unnecessary regex

Discussion
----------

[HttpKernel] removed unnecessary regex

The pattern was also flawed because of the unescaped `.`

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```
2012-01-12 18:47:17 +01:00
Fabien Potencier
c185302c0d merged branch canni/fix_collection_validator (PR #3078)
Commits
-------

7f7c2a7 Add prof-of-concept test, this test will fail without changes in previous commit
253eeba [BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess

Discussion
----------

[BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess

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

[![Build Status](https://secure.travis-ci.org/canni/symfony.png)](http://travis-ci.org/canni/symfony)

Because PHP function `array_key_exists` is buggy, it works great with native
PHP `ArrayObject` instances, but hand written implementations of `ArrayAccess`
and `Traversable` objects will fail to work with `CollectionValidator`

Tests from second commit are valid use cases, but without this change, they will fail.
2012-01-12 18:45:54 +01:00
Kris Wallsmith
7f7f82a53e [HttpKernel] removed unnecessary regex
The pattern was also flawed because of the unescaped `.`
2012-01-12 09:33:03 -08:00
Kris Wallsmith
fe62401907 optimized string starts with checks
Doing this with strpos() is slightly faster than substr().
2012-01-11 11:33:56 -08:00
Fabien Potencier
7ee2f6da75 fixed some phpdoc 2012-01-11 15:46:50 +01:00
Fabien Potencier
f57615b4a4 merged branch kriswallsmith/form/validator-fix (PR #3082)
Commits
-------

aa58330 [Form] fixed flawed condition

Discussion
----------

[Form] fixed flawed condition

The validate() method always returns an object. The test is whether there are violations in that object.

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

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

by fabpot at 2012-01-10T21:22:10Z

What about removing the if condition altogether?

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

by kriswallsmith at 2012-01-10T21:23:55Z

This way we avoid creating an `ArrayIterator` for no reason.
2012-01-11 08:15:19 +01:00
Fabien Potencier
92c048340b merged branch drak/psr0 (PR #3089)
Commits
-------

39f1ecd [ClassLoader] Update PSR-0 reference.

Discussion
----------

[ClassLoader] Update reference to PSR-0

Bug fix: no
Feature addition: n/a
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-01-11 08:14:47 +01:00
Drak
39f1ecd96d [ClassLoader] Update PSR-0 reference. 2012-01-11 09:27:00 +05:45
Kris Wallsmith
aa58330047 [Form] fixed flawed condition 2012-01-10 09:16:51 -08:00
Dariusz Górecki
7f7c2a7094 Add prof-of-concept test, this test will fail without changes in previous commit 2012-01-10 11:51:28 +01:00
Dariusz Górecki
253eebad88 [BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2779
Todo: -

Because PHP function `array_key_exists` is buggy, it works great with native
PHP `ArrayObject` instances, but hand written implementations of `ArrayAccess`
and `Traversable` objects will fail to work with `CollectionValidator`
2012-01-10 11:06:00 +01:00
Fabien Potencier
74961c8d22 merged branch maerlyn/hungarian_translation_2.0 (PR #3076)
Commits
-------

63e7f95 updated hungarian translations

Discussion
----------

Hungarian translations for 2.0

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

I have translated the trans-unit #41.
2012-01-10 10:34:36 +01:00
Maerlyn
63e7f95f60 updated hungarian translations 2012-01-10 09:39:04 +01:00
Fabien Potencier
1cbb041b99 merged branch pulzarraider/updated_sk_validator_2_0 (PR #3073)
Commits
-------

127cf52 Updated validators.sk.xlf file (for Symfony 2.0)

Discussion
----------

[FrameworkBundle] Slovak translations updated

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

This PR is for Symfony 2.0.
2012-01-10 07:35:20 +01:00
Andrej Hudec
127cf52d89 Updated validators.sk.xlf file (for Symfony 2.0) 2012-01-09 21:20:15 +01:00
Fabien Potencier
caec56fbe3 merged branch inanimatt/2.0 (PR #3068)
Commits
-------

0507840 Prevent parameters from overwriting the template filename.

Discussion
----------

Prevent parameters from overwriting the template filename.

Fixes a potential arbitrary file execution exploit.
2012-01-09 14:01:32 +01:00
Matt Robinson
0507840b67 Prevent parameters from overwriting the template filename.
Fixes a potential arbitrary file execution exploit.
2012-01-09 11:40:00 +00:00
Fabien Potencier
2f0afb2b5a fixed CS 2012-01-09 12:13:49 +01:00
Fabien Potencier
e8d1bd2902 merged branch weaverryan/security-phpdoc (PR #3055)
Commits
-------

8ee9161 [Security] Adding more extensive PHPDoc to UserInterface, AdvancedUserInterface and UserProviderInterface

Discussion
----------

More extensive PHPDoc for Security interfaces

Hey guys!

We've started to get into the habit of documenting interfaces and methods in the official docs. I think these things should be omitted from the documentation entirely, and replaced with a link to API docs that rock (I've started doing this already).

This PR just takes some of the details we have in the docs and pushes them back as PHPDoc. I use `@see`, `<code>` and changed a particular `@throws` to have a FQ class name since there's no `use` statement.

Thanks!

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

by weaverryan at 2012/01/07 20:24:15 -0800

Ok, updated and I think it's clearer now.

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

by fabpot at 2012/01/07 23:29:45 -0800

@weaverryan Great! I think that's a really good idea to document interfaces in the API, that makes a lot of sense.

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

by maastermedia at 2012/01/08 02:10:04 -0800

+1 Symfony API needs that atention also, yes. Thank you.

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

by lsmith77 at 2012/01/08 11:45:04 -0800

@fabpot: but then we should also add a list of interfaces to the API http://screencast.com/t/vu4Tljkri0
2012-01-09 12:10:47 +01:00
Fabien Potencier
40053bca03 merged branch Seldaek/console_tests_2_0 (PR #3066)
Commits
-------

c9129e5 Fix Console tests on windows

Discussion
----------

Fix Console tests on windows (2.0)

Rebased #3059 on 2.0 - once this is applied I will rebase it again because some of the fixes could not be applied to 2.0.
2012-01-09 11:49:57 +01:00
Fabien Potencier
b7a8f6d2cd merged branch hhamon/commands_description_fixes (PR #3065)
Commits
-------

96425b0 [SwiftmailerBundle] harmonized commands descriptions.
7eb1c43 [FrameworkBundle] harmonized commands descriptions.
0829094 [DoctrineBundle] harmonized commands descriptions.

Discussion
----------

Commands description fixes
2012-01-09 11:49:47 +01:00
Hugo Hamon
96425b01f7 [SwiftmailerBundle] harmonized commands descriptions. 2012-01-09 10:05:25 +01:00
Jordi Boggiano
c9129e51fe Fix Console tests on windows 2012-01-09 10:04:20 +01:00
Hugo Hamon
7eb1c436ae [FrameworkBundle] harmonized commands descriptions. 2012-01-09 10:01:34 +01:00
Hugo Hamon
082909417b [DoctrineBundle] harmonized commands descriptions. 2012-01-09 10:01:09 +01:00
Fabien Potencier
21993aa670 merged branch Tobion/assert-fix (PR #3063)
Commits
-------

1728493 made the assertions in the RequestTest more explicit and improved PHPDoc

Discussion
----------

made the assertions in the RequestTest more explicit and improved PHPDoc

as discussed in 4f1edb50d8 (comments)
2012-01-09 08:09:34 +01:00
Fabien Potencier
0336bdc7b0 merged branch maastermedia/translations (PR #3062)
Commits
-------

620a354 slovenian translations updated

Discussion
----------

Slovenian translations updated
2012-01-09 08:05:10 +01:00
Tobias Schultze
17284937f6 made the assertions in the RequestTest more explicit and improved PHPDoc 2012-01-09 06:33:53 +01:00
Peter Kokot
620a354026 slovenian translations updated 2012-01-09 03:02:36 +01:00
Ryan Weaver
8ee9161e6b [Security] Adding more extensive PHPDoc to UserInterface, AdvancedUserInterface and UserProviderInterface 2012-01-07 22:23:05 -06:00
Fabien Potencier
561cde7743 merged branch digitalkaoz/bugfix_2730_v4 (PR #3052)
Commits
-------

9441c46 [DependencyInjection] PhpDumper, fixes #2730

Discussion
----------

[DependencyInjection] PhpDumper, fixes #2730

Hey, this PR fixes #2730, if no parameters are set, the constructor wont get passed a ParameterBag

Bug fix: yes (#2730)
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

3rd and last try ;) this time i think its all fine
2012-01-07 16:41:16 +01:00
Fabien Potencier
4f1edb50d8 merged branch stof/issue_3053 (PR #3054)
Commits
-------

9bc41d0 [HttpFoundation] Fixed #3053

Discussion
----------

[HttpFoundation] Fixed #3053
2012-01-07 16:40:58 +01:00
Christophe Coevoet
9bc41d00d1 [HttpFoundation] Fixed #3053 2012-01-07 14:27:33 +01:00
digitalkaoz
9441c46bb6 [DependencyInjection] PhpDumper, fixes #2730 2012-01-06 21:20:08 +01:00
Fabien Potencier
3e9d937eb8 updated VERSION for 2.0.9 2012-01-06 07:49:25 +01:00
Fabien Potencier
ec472913ee update CONTRIBUTORS for 2.0.9 2012-01-06 07:49:05 +01:00
Fabien Potencier
4f9b9eb3f3 updated CHANGELOG for 2.0.9 2012-01-06 07:48:27 +01:00
Fabien Potencier
0492290a3b [Console] added a missing method (closes #3043) 2012-01-06 04:12:25 +01:00
Fabien Potencier
4c6c22166a merged branch Tobion/patch-4 (PR #3042)
Commits
-------

daee68a fixed typos and unified PHPDoc in the Response class

Discussion
----------

fix typos in Response
2012-01-06 04:09:51 +01:00
Tobias Schultze
daee68a54e fixed typos and unified PHPDoc in the Response class 2012-01-05 23:17:04 +01:00
Fabien Potencier
3e24636904 merged branch justinrainbow/2_0_framework_bundle_fix (PR #3039)
Commits
-------

7c8bd3d [FrameworkBundle] Invalid composer ref fix

Discussion
----------

[FrameworkBundle] Invalid composer ref fix

Changes the `composer.json` reference in the FrameworkBundle to use the `symfony/translation` package rather than the current `symfony/translator` (which doesn't exist).
2012-01-05 17:11:25 +01:00
Justin Rainbow
7c8bd3d917 [FrameworkBundle] Invalid composer ref fix
The composer.json was referencing a "symfony/translator" package
which does not exist.  This has been updated to use the
"symfony/translation" package.
2012-01-05 09:00:58 -07:00
Fabien Potencier
e09b5231d3 updated Twig to 1.5.1 to fix a regression 2012-01-05 16:02:00 +01:00
Fabien Potencier
208c2e468c removed the version attribute in all composer.json files 2012-01-05 14:51:20 +01:00
Fabien Potencier
2a33fbdd16 merged branch tystr/sanitize_queries_fix (PR #3032)
Commits
-------

261325d Cast $query['params'] to array to ensure it is a valid argument for the foreach.

Discussion
----------

[DoctrineBridge] Account for $query['params'] being null in DoctrineDataCollector's sanitizeQueries method

I was getting this error because inside the sanitizeQueries method of DoctrineDataCollector, there's no handling for $query['params'] being null.

ErrorException: Warning: Invalid argument supplied for foreach() in .../vendor/symfony/src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php line 91
2012-01-05 14:36:06 +01:00
Fabien Potencier
cd07c9150a merged branch franmomu/2.0 (PR #3038)
Commits
-------

d0c54e1 [FrameworkBundle][translations] Updated Catalan translation

Discussion
----------

[FrameworkBundle][translations] Updated Catalan translation

Updated Catalan translation
2012-01-05 14:28:36 +01:00