Commit Graph

11377 Commits

Author SHA1 Message Date
Fabien Potencier
e2f1914636 merged branch Nanocom/master (PR #5519)
Commits
-------

cc58b30 [Console] Misuse of str_pad instead of str_repeat

Discussion
----------

[Console] Misuse of str_pad instead of str_repeat
2012-09-16 09:25:14 +02:00
Fabien Potencier
6e390513e9 merged branch pborreli/config-tweak (PR #5521)
Commits
-------

baf2c46 [Config] Little tweak

Discussion
----------

[Config] Little tweak

removed 2 useless call of dirname
2012-09-16 08:38:43 +02:00
Pascal Borreli
baf2c46a07 [Config] Little tweak 2012-09-16 00:50:00 +00:00
Arnaud Kleinpeter
cc58b3092d [Console] Misuse of str_pad instead of str_repeat 2012-09-15 18:15:43 +02:00
Alexander Deruwe
c2f8563a52 Rename $key parameter to $name for consistency 2012-09-13 09:24:01 +02:00
Fabien Potencier
61d57f7eba merged 2.1 2012-09-13 08:13:00 +02:00
Michal Piotrowski
2a35941bab ParameterBag tests 2012-09-11 16:34:01 +02:00
Fabien Potencier
f23fd03732 bumped Symfony version to 2.1.2-DEV 2012-09-11 11:12:50 +02:00
Fabien Potencier
87065dc0ba merged branch besnikb/2.0 (PR #5482)
Commits
-------

3648abe =Minor chnage: replaced function by method

Discussion
----------

=Minor chnage: replaced function by method
2012-09-11 09:00:20 +02:00
Fabien Potencier
173711a462 updated VERSION for 2.1.1 2012-09-11 07:00:41 +02:00
Fabien Potencier
f6ff2fae89 updated CHANGELOG for 2.1.1 2012-09-11 06:59:00 +02:00
Fabien Potencier
d0818dd1c4 added CHANGELOG for 2.1 2012-09-11 06:58:24 +02:00
Tobias Schultze
005a9a3c5b [Routing] fixed RouteCompiler for adjacent and nested placeholders 2012-09-10 22:41:05 +02:00
Fabien Potencier
885d473366 merged branch Tobion/empty-requirement (PR #5426)
Commits
-------

02516de [Routing] fix variable with a requirement of '0'
1f5b793 [Routing] fix setting empty requirement in Route

Discussion
----------

[Routing] fix setting empty requirement

First commit: A requirement of "^$" was overlooked and wasn't recognized as empty after stripping it in Route.
Second commit: Fixes a requirement of '0' that was ignored by the Compiler.
2012-09-10 22:27:16 +02:00
Besnik Br
3648abea9b =Minor chnage: replaced function by method 2012-09-10 20:40:01 +02:00
Fabien Potencier
597819eff1 reintroduced self.version for the replace entry 2012-09-10 16:10:21 +02:00
Fabien Potencier
13937de2c8 replaced self.version/2.1.* by 2.2.* in composer.json files 2012-09-10 12:59:37 +02:00
Fabien Potencier
a9a0f420e2 merged 2.1 2012-09-10 12:54:04 +02:00
Fabien Potencier
3c32fd993d replaced self.version by 2.1.* in composer.json files 2012-09-10 12:53:42 +02:00
Fabien Potencier
c5edce7c48 merged branch eventhorizonpl/100ptc_component_httpfundation_p7 (PR #5434)
Commits
-------

8f46795 tests for HeaderBag

Discussion
----------

tests for HeaderBag

Hi,

This patch adds 100% tests coverage for HeaderBag.

Best regards,
Michal
2012-09-10 11:51:36 +02:00
Fabien Potencier
4d6dd469ce merged branch eventhorizonpl/100ptc_component_httpfundation_p6 (PR #5433)
Commits
-------

9bc8f65 Cookie tests

Discussion
----------

Cookie tests

Hi,

This patch adds 100% test coverage for Cookie class.

Best regards,
Michal
2012-09-10 11:50:31 +02:00
Fabien Potencier
329efcd3df merged branch boombatower/proccess-callable (PR #5466)
Commits
-------

622102e [Process] change all  documentation type to callable

Discussion
----------

[Process] change all  documentation type to callable

Update documentation per #5456 instead of mixing in with restart() pull request.
2012-09-10 11:48:39 +02:00
Fabien Potencier
487b8c1bbb merged branch aderuwe/issue-5477 (PR #5478)
Commits
-------

690e28e Convert parameter name to lowercase when removing an element from ParameterBag

Discussion
----------

[DependencyInjection] Convert parameter name to lowercase when removing an element from ParameterBag

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5477
License of the code: MIT

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

by sstok at 2012-09-10T08:42:30Z

👍

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

by fabpot at 2012-09-10T09:28:16Z

Shouldn't it be done on the 2.0 branch?

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

by stloyd at 2012-09-10T09:29:35Z

@fabpot AFAIK `2.0` don't have `ParameterBag#remove()` method

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

by aderuwe at 2012-09-10T09:29:52Z

The remove method is not present in 2.0.

On Mon, Sep 10, 2012 at 11:28 AM, Fabien Potencier <notifications@github.com
> wrote:

> Shouldn't it be done on the 2.0 branch?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/symfony/symfony/pull/5478#issuecomment-8418300>.
>
>
2012-09-10 11:46:45 +02:00
Fabien Potencier
8b7ba9b1e5 merged branch Tobion/numeric-placeholder (PR #5439)
Commits
-------

be28e56 [Routing] disallow numeric named variables in pattern

Discussion
----------

[Routing] compile check for numeric named variables in pattern

Because PHP raises an error for such subpatterns in PCRE and thus would break matching, e.g. this is not allowed as regex `(?<123>.+)`.
So add a compile time check for a non-working pattern like '/{123}'.

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

by sstok at 2012-09-06T08:31:42Z

Strangely enough Regex buddy gives no warning or error with the pattern.
Is the name all numeric invalid or just the beginning?

1e4 and 0xFF would be perfectly valid but returns true with is_nummeric()

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

by Tobion at 2012-09-06T08:59:07Z

Any numeric is not valid. I guess this limitation is unique to PHP's binding to PCRE.
I think it's because the returned matches array of of preg_match contains both the subpattern as integer index and as named variable. So having a numeric named variable would conflict as `array['1'] === array[1]`.
2012-09-10 11:27:26 +02:00
Fabien Potencier
71b39d51de merged branch Tobion/same-requirements-issue (PR #5435)
Commits
-------

7c5cfeb [Routing] added test why #5238 is not that easy

Discussion
----------

[Routing] added test why #5238 is not that easy

This just adds a test that wasn't covered yet and shows why #5238 is not that easy as I thought at first.
2012-09-10 11:25:47 +02:00
Fabien Potencier
e77a5337bc merged branch Tobion/patch-4 (PR #5293)
Commits
-------

0f86a33 micro-optim: replace for with foreach
4efb9fe [Form] Remove unneeded FormUtil constants

Discussion
----------

[Form] Remove FormUtil constants

The constants are not useful from outside the class as the $pluralMap is also private. So no need to expose these veriables in the API when they cannot be used in any way. Unfortunately there are not private constants, so use private static. Then I realized the variables can be removed altogether, as they are only used once anyway and the index meaning is already documented in pluralMap.

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

by empire at 2012-08-18T12:58:22Z

FormUtils is abstract class, and maybe subclass (in future) will use this constants, I think changing access modifier to `protected` is better option.

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

by Tobion at 2012-08-18T12:59:40Z

They cannot, as pluralMap is private...

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

by Partugal at 2012-08-18T14:11:17Z

extract self::$pluralMap into local variable add small speed up
4.5499801635742 ms vs 5.7430267333984 ms on 100 iterations

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

by Tobion at 2012-08-18T14:16:47Z

This is not about performance.

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

by Partugal at 2012-08-18T14:21:11Z

yes but adds
your changes vs current is
5.7430267333984 ms vs 6.4971446990967 ms on 100 iterations

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

by Tobion at 2012-08-18T14:29:48Z

How about `$map =& self::$pluralMap[$i]`?

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

by Partugal at 2012-08-18T14:59:57Z

I mean https://gist.github.com/3387253

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

by Partugal at 2012-08-18T15:01:45Z

foreach is event faster :)
(4.1971206665039 ms on my hw)

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

by Tobion at 2012-08-18T15:04:51Z

I see.

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

by Partugal at 2012-08-18T15:06:41Z

in first comment i mean code like this:
```php
$pluralMap = self::$pluralMap; // do this because access to static property is to slow
```

on my machine & is slower `$map =& $pluralMap[$i]` vs `$map = $pluralMap[$i]`
5.0 vs 4.8 ms

imho & not needed in read only code

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

by Tobion at 2012-08-18T15:15:03Z

Well, you'd need to benchmark memory too. `=&` should reduce memory primarily in this case.

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

by Partugal at 2012-08-18T15:19:35Z

```php
echo memory_get_usage() . "\n"; // 711536

$a = array_fill(5, 6000, 'banana');
echo memory_get_usage() . "\n"; // 1497632

$b = $a;
echo memory_get_usage() . "\n"; // 1497760

$b[1] = 2;
echo memory_get_usage() . "\n"; // 2283832
```

1497760  - 1497632 = 128  it is size for variable structure not for its value:

```php
echo memory_get_usage() . "\n"; // 711536

$a = 1;
echo memory_get_usage() . "\n"; // 1497632

$b = &$a;
echo memory_get_usage() . "\n"; // 1497760
```

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

by Seldaek at 2012-08-18T17:52:32Z

@Tobion http://schlueters.de/blog/archives/125-Do-not-use-PHP-references.html - search for "copy-on-write" if you don't want to read it all.

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

by Tobion at 2012-08-18T19:37:44Z

Yeah I know about copy on write. I thought there might be a difference what you assign a sub-element of an array to a variable. But apparently not.
Interestingly `$a =& $b` takes a little more memory than `$a = $b` according to `memory_get_usage ()` but not when using `memory_get_usage (true)`.

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

by bschussek at 2012-08-30T08:15:01Z

I don't like the removal of the constants. They introduce meaning into the integers and improve code clarity. The rest looks good.

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

by Tobion at 2012-08-30T13:18:19Z

My opinion of the constants:
- They are part of the public API (as const are alwalys public) but cannot be used at all, as everything else is private...
- They are each only used once.
- The meaning of the indices is already documented in `$pluralMap`
- They are not used when building `$pluralMap` so they dont imprivate code clarity and consistence either. But doing so would on the other hand make it probably more ugly. So removing them is IMO best solution.

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

by bschussek at 2012-08-30T15:21:03Z

If you really need to remove the constants, then please comment the code where they are used accordingly.

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

by Tobion at 2012-08-31T00:58:51Z

I dont see what I should comment to make it more understandable, as the the map is already assigned to a named variable like `$suffixLength = $map[1];`.

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

by bschussek at 2012-08-31T09:12:18Z

> I dont see what I should comment to make it more understandable, as the the map is already assigned to a named variable

`$map[2]` and `$map[3]` is not self-describing.

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

by Tobion at 2012-08-31T17:23:15Z

@bschussek Done.

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

by bschussek at 2012-08-31T22:13:41Z

Could you please squash your commits?
2012-09-10 11:24:41 +02:00
Alexander Deruwe
690e28e3df Convert parameter name to lowercase when removing an element from ParameterBag 2012-09-10 10:22:46 +02:00
Fabien Potencier
2e7e296fec merged branch stof/fix_phpdoc (PR #5467)
Commits
-------

05f7f78 Fixed the phpdoc in the DependencyInjection component

Discussion
----------

Fixed the phpdoc in the DependencyInjection component

I was sick of having a warning in my IDE each time I used DefinitionDecorator because of an invalid phpdoc in the constructor, so I took some time and fixed it in the whole DI component.

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

by stof at 2012-09-07T23:09:04Z

The travis failure is unrelated. It is all about some intl failures.

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

by eventhorizonpl at 2012-09-07T23:37:04Z

Reviewed-by: Michal Piotrowski <michal@eventhorizon.pl>

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

by pborreli at 2012-09-08T01:42:26Z

👍
2012-09-08 13:19:38 +02:00
Christophe Coevoet
05f7f78332 Fixed the phpdoc in the DependencyInjection component 2012-09-08 00:56:45 +02:00
boombatower
622102e2e9 [Process] change all documentation type to callable 2012-09-07 14:36:28 -07:00
Tobias Schultze
e22823bb7d [Routing] context params should have higher priority than defaults
fixes #5437
2012-09-07 03:30:48 +02:00
Fabien Potencier
4dc197c3e1 udpated composer.json to 2.2 2012-09-06 20:45:30 +02:00
Tobias Schultze
16c1b01531 [Routing] fixed 4 bugs in the UrlGenerator 2012-09-06 16:15:10 +02:00
Fabien Potencier
cba2a31e36 bumped Symfony version to 2.2.0-DEV 2012-09-06 12:12:45 +02:00
Fabien Potencier
e7059b44c7 bumped Symfony version to 2.1.1-DEV 2012-09-06 12:12:03 +02:00
Fabien Potencier
5745b53d05 updated VERSION for 2.1.0 2012-09-06 11:01:56 +02:00
Fabien Potencier
4035e1a755 Merge branch '2.0'
* 2.0:
  bumped Symfony version to 2.0.18-DEV

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
2012-09-06 10:57:51 +02:00
Fabien Potencier
00ec9b5391 Revert "merged branch Tobion/strictrequirements (PR #5181)"
This reverts commit 2da2a44382, reversing
changes made to 58855475c6.
2012-09-05 17:44:14 +02:00
Fabien Potencier
aae4ceea56 Revert "merged branch Tobion/requirementscheck (PR #5187)"
This reverts commit 2cf50b7801, reversing
changes made to 569e29d91f.
2012-09-05 17:44:10 +02:00
Fabien Potencier
fdf25289f8 Revert "merged branch Tobion/uselessparamdefaults (PR #5400)"
This reverts commit 0f61b2eb90, reversing
changes made to 5e7723fcbb.
2012-09-05 17:44:05 +02:00
Tobias Schultze
7c5cfeb776 [Routing] added test why #5238 is not that easy 2012-09-05 06:36:05 +02:00
Michal Piotrowski
8f467956c8 tests for HeaderBag 2012-09-04 20:36:25 +02:00
Michal Piotrowski
9bc8f659bd Cookie tests 2012-09-04 18:27:42 +02:00
Fabien Potencier
1dd153205b merged branch beberlei/RevertDbalAcl (PR #5253)
Commits
-------

1b5ad17 Revert "Removed MySQL-exclusive usage of unsigned integer from table creation"

Discussion
----------

[Security][DBAL] Revert MySQL unsigned removal

Revert "Removed MySQL-exclusive usage of unsigned integer from table creation"

This reverts commit 57694aaa94.

The problem is underlying in Doctrine DBAL change tracking and should
either be fixed or ignored there.

I opened a ticket on Doctrine Jira http://doctrine-project.org/jira/browse/DBAL-322

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

by fabpot at 2012-08-14T06:40:47Z

I will merge this PR after we have a release of DBAL that includes the fix for DBAL-322.

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

by acasademont at 2012-08-20T08:01:48Z

This was already fixed 2 weeks ago in doctrine/dbal#183 so i guess this can be closed

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

by acasademont at 2012-08-20T08:02:06Z

merged i mean
2012-09-04 16:49:55 +02:00
Fabien Potencier
0919361e2e merged branch eventhorizonpl/100ptc_component_httpfundation (PR #5409)
Commits
-------

3036b00 JsonResponseTest

Discussion
----------

JsonResponseTest

Hi,

This patch adds some tests for JsonResponse.

Best regards,
Michal

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

by eventhorizonpl at 2012-09-01T07:09:12Z

Done. Thanks for the review!
2012-09-04 14:24:42 +02:00
Fabien Potencier
2cd61ab8d9 merged branch eventhorizonpl/100_ptc_symfony_component_class_loader_p3 (PR #5412)
Commits
-------

8a3c8c9 load test

Discussion
----------

load test

Hi,

This patch add test that covers this situation

public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php')
{
  // each $name can only be loaded once per PHP process
  if (isset(self::$loaded[$name])) {
     return;
}

Best regards,
Michal
2012-09-04 14:23:54 +02:00
Fabien Potencier
5040599272 merged branch eventhorizonpl/100ptc_component_httpfundation_p2 (PR #5413)
Commits
-------

0af8778 Response tests

Discussion
----------

Response tests

Hi,

This patch adds some tests to ResponseTest.

Best regards,
Michal

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

by eventhorizonpl at 2012-09-01T09:45:16Z

Fixed, thanks for the review.

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

by eventhorizonpl at 2012-09-02T19:39:26Z

CS fixed. Thanks for the review :)
2012-09-04 14:19:30 +02:00
Fabien Potencier
a44c8d8c84 merged branch eventhorizonpl/100ptc_component_httpfundation_p3 (PR #5414)
Commits
-------

c74d9a9 ResponseHeaderBag tests

Discussion
----------

ResponseHeaderBag tests

Hi,

This patch adds some ResponseHeaderBag tests. Now ResponseHeaderBag got 100% test coverage :)

Best regards,
Michal
2012-09-04 14:18:55 +02:00
Fabien Potencier
ee51ca8c16 merged branch eventhorizonpl/100ptc_component_httpfundation_p4 (PR #5415)
Commits
-------

b89d4ee StreamedResponseTest

Discussion
----------

StreamedResponseTest

Hi,

This patch adds one test to StreamedResponseTest and fixes another. StreamedResponse has 100% test coverage.

Best regards,
Michal
2012-09-04 14:18:30 +02:00
Fabien Potencier
36c64e0e33 merged branch eventhorizonpl/100ptc_component_httpfundation_p5 (PR #5416)
Commits
-------

21a5841 RedirectResponse tests

Discussion
----------

RedirectResponse tests

Hi,

This patch adds 100% test coverage for RedirectResponse class.

Best regards,
Michal
2012-09-04 14:18:13 +02:00