Commit Graph

11352 Commits

Author SHA1 Message Date
Fabien Potencier
dbcd171dd3 [WebProfilerBundle] moved all static assets directly into the templates
This has been done for several reasons:

 * for consistency with the way we already manage the WDT icons;
 * it makes the WebProfiler independant from the location of the assets (and from the asset() function)
 * this is the very first step to make the WebProfiler useable outside the full-stack framework (more commits soon)

There is still one asset() call though, which will be removed later on.
2012-10-13 10:49:57 +02:00
Fabien Potencier
ccba363f64 merged branch jonathaningram/patch-10 (PR #5718)
This PR was merged into the master branch.

Commits
-------

74e2c5e Fix incorrect inheritdoc blocks

Discussion
----------

Fix incorrect inheritdoc blocks

Also add a docblock to stopwatch member variable.
2012-10-11 15:43:13 +02:00
Fabien Potencier
1c1cda67db merged branch bschussek/issue5722 (PR #5723)
This PR was merged into the master branch.

Commits
-------

e65ff0b [Form] Removed unused method ChoiceView::isSelected()

Discussion
----------

[Form] Removed unused method ChoiceView::isSelected()

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5722
Todo: -
License of the code: MIT
Documentation PR: -
2012-10-11 09:02:32 +02:00
Bernhard Schussek
e65ff0bcc2 [Form] Removed unused method ChoiceView::isSelected() 2012-10-11 08:28:46 +02:00
Jonathan Ingram
74e2c5ef89 Fix incorrect inheritdoc blocks
Also add a docblock to stopwatch member variable.

Remove docblock from private member
2012-10-10 12:26:59 +11:00
Fabien Potencier
61ab652a3b [DomCrawler] fixed a bad merge 2012-10-09 14:26:19 +02:00
Fabien Potencier
4e971e758e merged branch szicsu/UniversalClassLoader-FIX (PR #5692)
This PR was merged into the master branch.

Commits
-------

f66f110 FIX [2.1][ClassLoader]UniversalClassLoader not working with AnnotationRegistry::registerLoader

Discussion
----------

[2.1][ClassLoader]UniversalClassLoader not working with AnnotationRe...

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: ~
Todo: ~
License of the code: MIT
Documentation PR: ~

The Doctrine\Common\Annotations\AnnotationRegistry::loadAnnotationClass examines the returning value of the loader and the load is successful only if the loader returns with "TRUE" value.
This is how method Symfony\Component\ClassLoader\ClassLoader::loadClass works, but it is not true for Symfony\Component\ClassLoader\UniversalClassLoader::loadClass.

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

by sstok at 2012-10-08T09:25:39Z

As this is a bug fix it should be done on 2.0

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

by stof at 2012-10-08T12:49:42Z

It is not a bugfix. Nothing enforces an autoloader to return a boolean in PHP.

And Symfony works with the annotation registry since 1.5 year (when it was introduced): https://github.com/symfony/symfony-standard/blob/2.0/app/autoload.php#L34-38

Btw, if you are using 2.1, I would recommend you to use the new ClassLoader instead of the UniversalClassLoader to autoload PSR-0 libraries. It has a simpler API (and returns the boolean needed by Doctrine) while supporting the same classes than the UniversalClasssLoader (both of them are supporting PSR-0 and nothing else)
2012-10-09 09:15:43 +02:00
Fabien Potencier
ddcf71c00e merged branch nanocom/fix_progress_helper (PR #5702)
This PR was merged into the master branch.

Commits
-------

bf9d2be [Console] Fixes in ProgressHelper

Discussion
----------

[Console] Fixes in ProgressHelper

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

Changed from true to false the default "newline" parameter of the method "overwrite" (to stick with the default value of OutputInterface).
2012-10-08 18:08:07 +02:00
Arnaud Kleinpeter
bf9d2be77d [Console] Fixes in ProgressHelper 2012-10-08 17:17:46 +02:00
Fabien Potencier
700d078010 merged branch sstok/security_encoder_pbkdf2 (PR #4661)
This PR was merged into the master branch.

Commits
-------

4534960 [Security] Added Pbkdf2PasswordEncoder

Discussion
----------

[2.2] [Security] Added Pbkdf2PasswordEncoder

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

This adds the PBKDF2 derived key mechanism (as defined in http://www.ietf.org/rfc/rfc2898.txt) for the Password encoder.

The original implementation comes from http://www.itnewb.com/tutorial/Encrypting-Passwords-with-PHP-for-Storage-Using-the-RSA-PBKDF2-Standard and does not contain any restrictive copyright. I have included the original author.

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

by mvrhov at 2012-06-26T10:33:59Z

This also warrants a waring that the function is extra slow. Calculation of hash with the default 5000 iterations on small ec2 instance takes approximately 800ms.

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

by sstok at 2012-06-26T11:17:25Z

@mvrhov What do you mean exactly? Should I reduce the default number of Iterations?

Edit: Oops, my own class in rollerworks/Crypt also uses 1000, not 5000.
I used the MessageDigestPasswordEncoder as my template and forgot to change that.
Fixed.

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

by mvrhov at 2012-06-26T12:04:28Z

@sstok: What I meant was that it would be nice to include that info into the PhpDoc block or inside a changelog.
Between the plain salted sha512, sha512 based Pbkdf2 and sha512 based bcrypt, bcrypt was slower than sha512, but way faster than Pbkdf2. I've measured all of them on small ec2 instance.
Oh, and BTW it was 1000 iterations in Pbkdf2 that took 800ms.

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

by sstok at 2012-06-26T12:39:46Z

```
 * Pbkdf2PasswordEncoder uses the PBKDF2 (Password-Based Key Derivation Function 2).
 *
 * Providing a high level of Cryptographic security,
 *  PBKDF2 is recommended by the National Institute of Standards and Technology (NIST).
 *
 * But also warrants a warning, using PBKDF2 (with a high number of iterations) slows down the process.
 * PBKDF2 should be used with caution and care.
```
Something like this, any suggestions are welcome ;)

PS: Should I also add this to the SecurityBundle?, but 'algorithm' always passes it to MessageDigestPasswordEncoder when it not plain. So I wonder what to do for that, using something as pbkdf2_[algorithm] like: pbkdf2_sha512

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

by jalliot at 2012-07-06T22:27:22Z

@sstok That would be a really valuable addition to Symfony :)
And I think indeed that you should modify SecurityBundle by adding a simple way to switch from the basic encoder to this one (and surely set it as the default!).

Another nice thing you could do is provide a bcrypt implementation. @elnur's [ElnurBlowfishPasswordEncoderBundle](https://github.com/elnur/ElnurBlowfishPasswordEncoderBundle) might give you some inspiration.

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

by sstok at 2012-07-08T12:25:29Z

@jalliot Thanks for the tip, changing the default is not a good idea as PBKDF2 pretty heavy when compared to Digit.
The only difference between PBKDF2 and Digit is that PBKDF2 uses HMAC and does some extra things, so they are both very secure. But the second is more secure then the other ;)

Implementing bcrypt should be no problem, I will open an new pull request for that one when ready.

Edit: I think I have an idea, setting algorithm to pbkdf2 with hash_algorithm as parameter.

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

by sstok at 2012-07-18T09:54:15Z

@schmittjoh As this is a simple change should it go for 2.1 or 2.2?

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

by jalliot at 2012-07-18T11:02:40Z

IIUC 2.1 is feature frozen so that will surely not be merged before 2.2.

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

by fabpot at 2012-07-23T14:26:30Z

This is indeed scheduled for 2.2.

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

by sstok at 2012-10-02T13:51:59Z

@fabpot ping

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

by fabpot at 2012-10-02T16:20:23Z

Before I merge this PR, can you:

 * add an entry in the CHANGELOG of the component and the bundle
 * squash your commits
 * create a PR on the docs to mention the new encoder (its usage and the limitations as you mentioned them here)

Thanks.

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

by stof at 2012-10-02T16:27:03Z

The XSD also need to be updated

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

by fabpot at 2012-10-02T16:37:53Z

@stof: AFAIR, there is unfortunately no XSD for the Security bundle.... yet

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

by mvrhov at 2012-10-02T16:56:39Z

BTW: http://php.net/manual/en/function.hash-pbkdf2.php

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

by fabpot at 2012-10-02T17:17:57Z

@mvrhov Indeed, it's going to be included in PHP as of PHP 5.5. We need to use it if available.

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

by stof at 2012-10-02T17:28:17Z

@fabpot ah true. and I don't want to try creating an XSD in this bundle as the config tree can be expanded dynamically by any bundle :)

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

by sstok at 2012-10-03T09:29:53Z

@fabpot ping

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

by sstok at 2012-10-08T09:21:09Z

@fabpot ping
2012-10-08 14:58:16 +02:00
Sebastiaan Stok
45349602e3 [Security] Added Pbkdf2PasswordEncoder
[Security] changed default iterations of Pbkdf2PasswordEncoder to 1000 instead of 5000

[Security] Improved description of PBKDF2 encoder

[SecurityBundle] added PBKDF2 PasswordEncoder

updated CHANGELOG.md

[Security] Use the build-in hash_pbkdf2() when available

[SecurityBundle] added information about hash_algorithm for configuration

[Security] always check algorithm and fixed CS
2012-10-08 11:17:32 +02:00
Tamas Szijarto
f66f110024 FIX [2.1][ClassLoader]UniversalClassLoader not working with AnnotationRegistry::registerLoader 2012-10-07 19:13:37 +02:00
Fabien Potencier
f187beed85 fixed typo 2012-10-06 22:09:27 +02:00
Fabien Potencier
5956f9f2b4 Merge branch '2.1'
* 2.1:
  fixed CS
  added doc comments
  added doc comments
  [Validator] Updated swedish translation
  Update src/Symfony/Component/Validator/Resources/translations/validators.de.xlf
  [2.1] Exclude tests from zips via gitattributes
  [HttpKernel][Translator] Fixed type-hints
  Updated lithuanian validation translation
  [DomCrawler] Allows using multiselect through Form::setValues().
  [Translation] forced the catalogue to be regenerated when a resource is added (closes symfony/Translation#1)
  Unit test for patched method OptionsResolver::validateOptionValues().
  validateOptionValues throw a notice if an allowed value is set and the corresponding option isn't.
  [Form] Hardened code of ViolationMapper against errors
  [HttpFoundation] Fixed #5611 - Request::splitHttpAcceptHeader incorrect result order.
  [Form] Fixed negative index access in PropertyPathBuilder
  Update src/Symfony/Component/Validator/Resources/translations/validators.ro.xlf

Conflicts:
	src/Symfony/Component/DomCrawler/Form.php
	src/Symfony/Component/Process/Process.php
2012-10-06 21:57:59 +02:00
Fabien Potencier
f152170899 merged branch xrstf/2.1 (PR #5687)
This PR was merged into the 2.1 branch.

Commits
-------

65cf3a0 added doc comments

Discussion
----------

added doc comments

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

by stof at 2012-10-06T11:27:23Z

closing in favor of #5686 which targets 2.0

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

by fabpot at 2012-10-06T12:38:17Z

This one cannot be closed as it contains more phpdocs than in the 2.0 branch.
2012-10-06 21:56:03 +02:00
Fabien Potencier
60b54090bb Merge branch '2.0' into 2.1
* 2.0:
  fixed CS
  added doc comments
  [HttpKernel][Translator] Fixed type-hints
  [Translation] forced the catalogue to be regenerated when a resource is added (closes symfony/Translation#1)
  [HttpFoundation] Fixed #5611 - Request::splitHttpAcceptHeader incorrect result order.

Conflicts:
	src/Symfony/Component/Process/Process.php
	tests/Symfony/Tests/Component/HttpFoundation/RequestTest.php
2012-10-06 21:54:37 +02:00
Fabien Potencier
9b3525c707 merged branch xrstf/2.0 (PR #5686)
This PR was merged into the 2.0 branch.

Commits
-------

b2614aa fixed CS
e7c2e90 added doc comments

Discussion
----------

added doc comments
2012-10-06 21:50:55 +02:00
Fabien Potencier
b3345c9abf [Config] added some phpdocs 2012-10-06 21:50:10 +02:00
Fabien Potencier
855319abfc merged branch schmittjoh/configConvenience (PR #5688)
This PR was merged into the master branch.

Commits
-------

36bbaf3 added entry to changelog
0187a1a adds two convenience methods for optional configuration sections

Discussion
----------

adds two convenience methods for optional configuration sections

This adds two convenience methods which safes some typing for optional configuration.

I have updated the FrameworkConfiguration to use these methods; the behavior is equivalent.

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

by sstok at 2012-10-06T12:21:09Z

👍

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

by fabpot at 2012-10-06T12:32:10Z

Looks good. Can you update the documentation as well and add a note in the component CHANGELOG? Thanks.

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

by schmittjoh at 2012-10-06T14:22:35Z

done
2012-10-06 21:47:09 +02:00
Johannes
36bbaf31ac added entry to changelog 2012-10-06 17:22:10 +03:00
Christoph
b2614aa7e6 fixed CS 2012-10-06 14:46:45 +02:00
Johannes M. Schmitt
0187a1ac94 adds two convenience methods for optional configuration sections 2012-10-06 14:13:41 +02:00
Christoph
65cf3a0d8a added doc comments 2012-10-06 06:44:21 +02:00
Christoph
e7c2e90069 added doc comments 2012-10-06 06:39:50 +02:00
Fabien Potencier
6463c9919c merged branch docteurklein/fix-router-resolve-string (PR #4995)
This PR was merged into the master branch.

Commits
-------

4b86765 [FrameworkBundle] recursively resolve container parameter placeholders for arrays in router _defaults

Discussion
----------

[2.2] [FrameworkBundle] avoid trying to resolve container placeholders on arrays on router _defaults

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: ~
Todo: ~
License of the code: MIT
Documentation PR: ~

Permits to pass arrays in route `_defaults`.

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

by stof at 2012-07-20T13:07:36Z

This seems weird. An array could contain parameters in it.

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

by docteurklein at 2012-07-20T13:17:00Z

@stof An object too then, no ? Why accepting objects but not arrays ? Would you propose to recursively resolve array values ?

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

by stof at 2012-07-20T13:31:06Z

@docteurklein Resolving array values recursively would be consistent with the way the DIC parameters are resolved. I don't really see how you would resolve objects (and btw, it is pretty much an edge case as you cannot really put an object in your routes if you define them in your YAML or XML config files or with annotations)

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

by docteurklein at 2012-07-20T13:36:43Z

@stof I agree. I can manage recursive array resolving if needed.

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

by fabpot at 2012-07-23T13:58:07Z

Can you squash your commits before I merge? Thanks.

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

by docteurklein at 2012-07-23T14:39:17Z

@fabpot  done.
2012-10-05 19:11:53 +02:00
Fabien Potencier
16405f901d merged branch fabpot/twig (PR #5660)
This PR was merged into the master branch.

Commits
-------

5c809d8 [TwigBundle] added support for Twig namespaced paths (Twig 1.10)

Discussion
----------

[TwigBundle] added support for Twig namespaced paths (Twig 1.10)

In a template, you can now use native Twig template names, instead of
the Symfony ones:

Before (still works):

    {% extends "AcmeDemoBundle::layout.html.twig" %}
    {% include "AcmeDemoBundle:Foo:bar.html.twig" %}

After:

    {% extends "@AcmeDemo/layout.html.twig" %}
    {% include "@AcmeDemo/Foo/bar.html.twig" %}

Using native template names is also faster.

The only drawback is that the new notation looks similar to the way we
locate resources in Symfony, which would be
`@AcmeDemoBundle/Resources/views/Foo/bar.html.twig`. We could have used
the same notation, but it is rather verbose (and by the way, using this
notation did not work anyway in templates).

TODO: update documentation

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

by fabpot at 2012-10-03T13:36:56Z

I forgot to mention why I'd like to include this change besides performance: this would allow to share templates between a project using the Symfony2 full-stack framework and any other project using Twig.

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

by henrikbjorn at 2012-10-03T13:50:48Z

👍 Will the old notation be deprecated at some point?

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

by stof at 2012-10-03T14:29:50Z

@fabpot does it still support overwriting templates ?
2012-10-05 18:44:24 +02:00
Fabien Potencier
65dd6e0ab3 merged branch drak/docb (PR #5672)
This PR was merged into the 2.0 branch.

Commits
-------

22c7a91 [HttpKernel][Translator] Fixed type-hints

Discussion
----------

[HttpKernel][Translator] Fixed type-hints

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

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

by drak at 2012-10-04T15:18:55Z

This PR is ready - the travis build fail is not related to this PR which is just docblock changes.

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

by pborreli at 2012-10-04T15:37:57Z

the travis build fail is indeed not related to your PR but your branch. see https://github.com/drak/symfony/blob/docb/.travis.yml

You should fetch upstream remote, merge, rebase and push again.

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

by drak at 2012-10-04T16:50:28Z

Thanks for the info, but the branch is 100% up to date with `2.0`, the file you quoted is as it is in the main repo: https://github.com/symfony/symfony/blob/2.0/.travis.yml - in any case, it doesnt affect merging this changeset.
2012-10-05 18:42:32 +02:00
Fabien Potencier
c828c41b5b merged branch gigablah/header_caps (PR #5662)
This PR was merged into the master branch.

Commits
-------

63a228c Map normalized header names to original capitalization

Discussion
----------

[HttpFoundation] Preserve capitalization of response header names

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/gigablah/symfony.png)](http://travis-ci.org/gigablah/symfony)
License of the code: MIT
Fixes the following tickets: -
Todo: -

`HeaderBag` normalizes header names when they are set. Therefore, custom header names (e.g. X-Sendfile, Vary) are output in lowercase. I've added an array to map header keys to their original capitalization in `ResponseHeaderBag`. Calling `allPreserveCase()` will now output the header array with capitalization preserved.

More of a cosmetic (and consistency) fix, since HTTP header names are case insensitive.

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

by pborreli at 2012-10-03T16:09:31Z

may not work with
```
ETag
Content-MD5
P3P
WWW-Authenticate
X-UA-Compatible
X-XSS-Protection
```

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

by fabpot at 2012-10-03T17:14:12Z

This overrhead is not needed most of the time. It should be done in a response listener if you have the issue. But as far as the RFC is concerned, this is not needed.

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

by gigablah at 2012-10-04T13:51:59Z

I've reworked my approach to account for the cases mentioned by @pborreli. `ResponseHeaderBag` now contains an array to map the header keys to their original capitalized names. This is much cleaner compared to string manipulation. I've also added a simple test case.

Please let me know if there's merit to this, failing which I'll just extend the class in my projects.

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

by fabpot at 2012-10-04T14:10:28Z

@gigablah This approach looks much better indeed.

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

by gigablah at 2012-10-04T15:29:29Z

Thanks! I've squashed the commits and added more test data.

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

by pborreli at 2012-10-04T15:49:05Z

Thank you, it's a nice PR 👍
2012-10-05 17:34:39 +02:00
Chris Heng
63a228c456 Map normalized header names to original capitalization 2012-10-05 18:34:13 +08:00
Fabien Potencier
8062031a0a merged branch persand/2.1 (PR #5677)
This PR was squashed before being merged into the 2.1 branch (closes #5677).

Commits
-------

cf422bf [Validator] Updated swedish translation

Discussion
----------

[Validator] Updated swedish translation

Updated existing strings with plural translations and added some new translations as well.

https://github.com/symfony/symfony/issues/5628
2012-10-04 22:14:54 +02:00
Per Sandström
cf422bfed7 [Validator] Updated swedish translation 2012-10-04 22:14:54 +02:00
Fabien Potencier
d402e475f2 merged branch maggo/patch-1 (PR #5675)
This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #5675).

Commits
-------

b0e4d4d Update src/Symfony/Component/Validator/Resources/translations/validators.de.xlf

Discussion
----------

[Validator] Fix and update validators.de.xlf

Adding new localized strings and fixing pluralization for german validation.
2012-10-04 19:40:30 +02:00
Marco
132ba25bbd Update src/Symfony/Component/Validator/Resources/translations/validators.de.xlf
Adding new localized strings and fixing pluralization for german validation.
2012-10-04 19:40:30 +02:00
Fabien Potencier
bfc1dfa8e2 merged branch igorw/gitattributes (PR #5674)
This PR was merged into the 2.1 branch.

Commits
-------

462dddf [2.1] Exclude tests from zips via gitattributes

Discussion
----------

[2.1] Exclude tests from zips via gitattributes

See also: [Composer - Light-weight distribution packages](http://getcomposer.org/doc/02-libraries.md#light-weight-distribution-packages).
2012-10-04 17:36:05 +02:00
Fabien Potencier
2be47200e0 [HttpKernel] fixed the traceable event dispatcher when an event of a name is dispatched when an event of the same name is already being dispatched 2012-10-04 17:28:41 +02:00
Igor Wiedler
462dddfac9 [2.1] Exclude tests from zips via gitattributes 2012-10-04 17:17:57 +02:00
Drak
22c7a910b8 [HttpKernel][Translator] Fixed type-hints 2012-10-04 16:11:30 +01:00
Fabien Potencier
0f67dca1fe [Process] fixed a unit test 2012-10-04 16:37:34 +02:00
Fabien Potencier
32a8502304 [Process] fixed phpdoc 2012-10-04 16:23:11 +02:00
Fabien Potencier
d55546675a [Process] updated CHANGELOG 2012-10-04 16:21:40 +02:00
Fabien Potencier
0ba4886721 merged branch boombatower/process-restart (PR #5456)
This PR was squashed before being merged into the master branch (closes #5456).

Commits
-------

be62fcc [process] provide a restart method.

Discussion
----------

[process] provide a restart method.

Pull request for issue #5452.

Another possibility would be to allow for either run() or start() scenarios, but I am not sure that is terribly useful since restart() with a new process lends itself to restarting longer running services when they crash and you want the old process so you can inspect the logs and what not.

Otherwise, something like this might work, but doesn't allow for run() to return status code. Someone can get around that by getting manually on returned process.

```php
<?php
public function restart($method = 'start', $callback = null)
{
    if ($this->isRunning()) {
        throw new \RuntimeException('Process is already running');
    }

    if ($method != 'start' && $method != 'run') {
        throw new \RuntimeException('Method must be start or run');
    }

    $process = clone $this;
    $process->$method();
    return $process;
}
```

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

by pborreli at 2012-09-07T07:17:26Z

can you add some tests please ?
2012-10-04 16:20:59 +02:00
boombatower
be62fcca7f [process] provide a restart method. 2012-10-04 16:20:58 +02:00
Fabien Potencier
c1e77d63d7 [Finder] tweaked previous merge 2012-10-04 15:24:19 +02:00
Fabien Potencier
bb12295dc2 merged branch jfsimon/issue-4031 (PR #4061)
This PR was squashed before being merged into the master branch (closes #4061).

Commits
-------

32bb754 [2.2] [WIP] [Finder] Adding native finders implementations

Discussion
----------

[2.2] [WIP] [Finder] Adding native finders implementations

Work in progress...

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

This PR intends to add native finders implementation based on shell command execution.
Planned support concerns:
- GNU `find` command -> done
- MS `FINDSTR` command

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

by fabpot at 2012-05-15T06:19:50Z

@jfsimon What's the status of this PR?

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

by jfsimon at 2012-05-15T06:43:34Z

@fabpot 2 features missing for the GNU find adapter: sorting result with `sort` command and excluding directories; 1 bug (even if tests pass, which let me thing it needs more tests): regex matching is done on full path, not basename. Then I'll need to work on MS `FINDSTR` command adapter (I talked to Pierre Couzy, and he's OK to help when he will have time to). I'll try to push the sort and directory excluding features this week.

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

by jalliot at 2012-05-15T09:51:20Z

BTW @jfsimon, in the (quite specific) case where you don't precise filenames or other options but only `contains` or `notContains`, you could call `grep` directly without the `find`. That would speed things up a bit more :)

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

by fabpot at 2012-06-28T15:20:55Z

@jfsimon Would be nice to be able to include this PR before 2.1.0 beta2. Would you have time to finish the work soon?

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

by jfsimon at 2012-06-29T11:07:19Z

@fabpot I'd say next week for GNU part with some help from @smaftoul.

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

by jfsimon at 2012-07-10T08:20:44Z

It seems that I need to perform some benchmarks as find may not be so fast :/

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

by jfsimon at 2012-07-10T16:51:19Z

@fabpot @stof do you think I can add benchmark scripts inside the component, or should I create a new repository for that?

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

by fabpot at 2012-07-10T16:57:05Z

Then benchmark scripts won't be part of the repository in the end, so you should create a new repo for that.

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

by jfsimon at 2012-07-13T17:57:03Z

@fabpot @smaftoul Benchmark is ready (more cases to come): https://github.com/jfsimon/symfony-finder-benchmark
I'm glad to see that `gnu_find` adapter is really faster than the `php` one!

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

by stof at 2012-07-13T19:17:20Z

@jfsimon could you make a gist with the result of the benchmark ? I think many people will be lazy to run it themselves when looking at this ticket, and people using windows will probably be unable to run it at all :)

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

by jfsimon at 2012-07-13T21:37:50Z

First results: https://gist.github.com/3107676

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

by jfsimon at 2012-08-01T07:26:21Z

Sorry, I forgot `[Finder]` tag in 3 commits message... is it fixable?

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

by stof at 2012-08-01T08:58:28Z

@jfsimon you can edit the commit message whne doing an interactive rebase.

and btw, you will need to do a rebase anyway: the PR conflicts with master

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

by jfsimon at 2012-08-01T13:11:20Z

@stof Okay, I rebased origin/master. As you can see, above comments are now floating in the air :/

Strangely, rebase broke my tests... I need to fix them :(

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

by stof at 2012-08-01T13:14:11Z

Weird. github still tells me that the PR cannot be merged. Did you fetch the latest master before rebasing ?

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

by jfsimon at 2012-08-01T13:19:25Z

Weird, git fetch only fetched my own repository, I had to `git fetch origin`. I'm rebasing... again.

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

by jfsimon at 2012-08-01T14:50:02Z

@stof Rebase done, tests fixed :)

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

by stof at 2012-08-01T15:18:19Z

hmm, Travis does not seems to agree with the second statement :)

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

by jfsimon at 2012-08-01T17:33:55Z

Ouch, I'm really sorry, I was in the wrong tmux window when started tests :/
Good news, I have to fix my last problem (the regex tested against full path instead of basename) to fix the tests.
I'm on it.

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

by jfsimon at 2012-08-01T18:16:10Z

Grrr...  I didnt start full test suite, shame on me.

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

by jfsimon at 2012-08-01T19:10:02Z

Same bench than before, but with non empty files: https://gist.github.com/3229865

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

by jfsimon at 2012-08-01T19:23:32Z

It seems that searching files by their name with regex is really fatser than by glob with find: https://gist.github.com/3229911
@fabpot should I convert glob to regex when using `contains` and `notContains`?

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

by jfsimon at 2012-08-01T19:55:02Z

It seems that I'm an idiot, I used `contains` instead of `name`.
Real bench is here: https://gist.github.com/3230139
@fabpot sorry for the mess, I should go to bed :/
Results are still convincing!

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

by stof at 2012-08-01T20:04:42Z

They are, but the regex are not faster than glob anymore in these results

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

by jfsimon at 2012-08-01T21:17:25Z

@travisbot you failed, not me!

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

by jfsimon at 2012-08-01T21:18:28Z

Anyone to launch benchmark with php 5.4?
https://github.com/jfsimon/symfony-finder-benchmark

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

by lyrixx at 2012-08-01T22:25:08Z

Bench with php 5.4.5
https://gist.github.com/3231244
2012-10-04 15:06:12 +02:00
Jean-François Simon
32bb754fbe [2.2] [WIP] [Finder] Adding native finders implementations 2012-10-04 15:06:11 +02:00
Fabien Potencier
47900b8aca [HttpKernel] fixed regression caused by the previous commit 2012-10-04 13:36:08 +02:00
Fabien Potencier
fbf19f0fbf [HttpKernel] made the ExceptionHandler more flexible 2012-10-04 13:24:43 +02:00
Fabien Potencier
2f497c99a9 merged branch Nercury/lt-validation-fix (PR #5670)
This PR was merged into the 2.1 branch.

Commits
-------

6a6b4ae Updated lithuanian validation translation

Discussion
----------

Updated lithuanian validation translation

Updated Lithuanian translation and added all plural form to prevent exception.
2012-10-04 11:35:12 +02:00
Nerijus Arlauskas
6a6b4aede6 Updated lithuanian validation translation 2012-10-04 12:08:15 +03:00
Fabien Potencier
a086cdc4ef fixed CS 2012-10-04 08:44:49 +02:00