Commit Graph

11922 Commits

Author SHA1 Message Date
boombatower
7ea2f76266 [process] expose the process status. 2012-10-27 18:47:38 +02:00
Fabien Potencier
d4c011d56d merged branch dirkaholic/master (PR #5638)
This PR was squashed before being merged into the master branch (closes #5638).

Commits
-------

98b68c2 [2.2][Console] Add possibility to add new input options to console application

Discussion
----------

[2.2][Console] Add possibility to add new input options to console application

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

At the moment it is not possible to overwrite the input arguments of a console application to not have the default ones. Adding is possible with:

$cli->getDefinition()->addOption(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Use custom option.'));

Also added some simple tests for adding a custom HelperSet.

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

by dirkaholic at 2012-10-04T06:29:57Z

OK, is a bit inconsistent with what it's done with the helper set then, where you can use both ways. New PR for the tests is the referenced one.

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

by stof at 2012-10-04T18:57:42Z

@dirkaholic Can you rebase your branch (it conflicts with master) and squash your commit together ?

http://symfony.com/doc/current/contributing/code/patches.html#rework-your-patch may help you if you don't know how to do it

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

by dirkaholic at 2012-10-04T19:53:09Z

Done.

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

by stof at 2012-10-04T21:40:53Z

@dirkaholic the rebase worked fine but you have not squashed the commits together.

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

by dirkaholic at 2012-10-05T05:35:30Z

What do you mean ? Only the setDefinition function plus test is left here. The rest was already merged with https://github.com/symfony/symfony/issues/5668

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

by stof at 2012-10-05T10:48:53Z

@dirkaholic Squashing is about making the PR use only 1 commit instead of 2 (the second one changing only some whitespaces, which is not what its message says). But @fabpot told me that he improved his merging tool and so he can squash it when merging so it is OK.
2012-10-27 18:40:54 +02:00
Dirk Pahl
98b68c29ce [2.2][Console] Add possibility to add new input options to console application 2012-10-27 18:40:53 +02:00
Fabien Potencier
bdb5275da1 merged branch daum/master (PR #5601)
This PR was squashed before being merged into the master branch (closes #5601).

Commits
-------

7914d95 [HttpFoundation] UploadedFile: Added ability to the original extension of the file uploaded

Discussion
----------

[HttpFoundation] UploadedFile: Added ability to the original extension of the file uploaded

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

`$file->getExtension()` on uploaded files always will return blank as the temp file names do not have an extension. This adds `$file->getClientOriginalExtension()` which returns the extension based off the original file name. It also includes a test to check this function.

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

by daum at 2012-09-25T21:54:00Z

@stof just pushed updated doc block and spacing fix.

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

by stof at 2012-10-13T21:47:17Z

@fabpot anything missing to merge it ?
2012-10-27 18:37:40 +02:00
Matt Daum
7914d957f0 [HttpFoundation] UploadedFile: Added ability to the original extension of the file uploaded 2012-10-27 18:37:39 +02:00
Fabien Potencier
649872be85 merged branch jonathaningram/issue_5375 (PR #5376)
This PR was merged into the 2.0 branch.

Commits
-------

a094f7e Add check to Store::unlock to ensure file exists

Discussion
----------

[2.0] [HttpKernel] Add check to Store::unlock to ensure file exists

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

I was seeing this error in my logs when using an `AppCache`:

```
Error 2: /var/www/beta.example.com/shared/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php line 92: unlink(/var/www/beta.example.com/releases/20120827020525/app/cache/beta/http_cache/md/c2/88/66a911b5266a57bdd55131a47895b8861dfd.lck): No such file or directory
```

It was only occurring when the `http_cache` file was being primed (i.e. first load).

I've added a simple check to ensure that the file is a valid file before trying to unlink. I also added a missing `@return` docblock. Note: I've chosen to return `false` if the file does not exist as this seems to be the behaviour of the `purge` method.

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

by jonathaningram at 2012-08-29T06:46:52Z

@henrikbjorn done and rebased. Thanks.

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

by jonathaningram at 2012-09-17T22:38:47Z

@henrikbjorn any news on this one? It's currently not possible to use the HTTP Cache without the first request failing.

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

by jonathaningram at 2012-09-25T01:28:38Z

ping @fabpot sorry to keep pushing this, but any chance you could take a look at this?
2012-10-27 18:34:13 +02:00
Fabien Potencier
da1b635d87 merged branch msonnabaum/httpcache_store_locking_fixes (PR #5381)
This PR was squashed before being merged into the master branch (closes #5381).

Commits
-------

0f3126f Added lockExists to Store interface, fixed locking bugs, added tests.

Discussion
----------

Added lockExists to Store interface, fixed locking bugs, added tests.

While working on Drupal's HttpCache implementation, I discovered that the base HttpCache class does an is_file to check for a lock, which assumes a file-based cache is being used. This seems like a mistake since the rest of the Store interface is easily swappable. I added a lockExists method so that this is properly abstracted.

I also noticed there were no tests for the change I made, so I added some very basic locking tests. While adding those I found that the existing lock method is a bit broken. This line here:

```php
<?php

if (false !== $lock = @fopen($path = $this->getPath($this->getCacheKey($request).'.lck'), 'x')) {
```

will return false if the file couldn't be written for any reason, but the rest of the method assumes that if $lock == false, the lock exists already. So if the file couldnt be written due to the parent directory not existing, $path will be returned as if it exists, which is clearly not the desired behavior.

I changed this to return false if the file couldnt be written and doesn't exist, $path if it exists, and true if the lock was created. It still doesn't feel great to have bool|string return values, but that's the best I could come up with atm. I also added a check for the parent directory that creates it if it doesn't exist. The new tests fail without it.

I also broke out that code a bit as it was very difficult to read.

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

by henrikbjorn at 2012-08-30T09:11:16Z

Symfony have a editorconfig file which set the correct indentation settings. http://editorconfig.org/

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

by msonnabaum at 2012-08-30T13:00:20Z

Updated based on stof's feedback.

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

by msonnabaum at 2012-08-30T13:21:40Z

Fixed based on code style feedback.

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

by jonathaningram at 2012-09-05T12:29:47Z

@msonnabaum, this seems to be distantly related to my recent PR too: #5376.

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

by stof at 2012-10-13T20:35:55Z

@fabpot anything left to merge this ?

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

by catch56 at 2012-10-23T16:42:10Z

This looks great to me, Couldn't find anything to complain about.
2012-10-27 18:31:07 +02:00
Mark Sonnabaum
0f3126f397 Added lockExists to Store interface, fixed locking bugs, added tests. 2012-10-27 18:31:06 +02:00
Fabien Potencier
7b998d9b2d Merge branch '2.1'
* 2.1:
  [ClassLoader] fixed unbracketed namespaces (closes #5747)
  slight refactoring in UrlMatcher
  [Form] Created test for DoctrineOrmTypeGuesser see #5790
  [Form] Fixed DoctrineOrmTypeGuesser to guess the "required" option for to-one associations
2012-10-27 17:59:37 +02:00
Fabien Potencier
43aa20fcb6 Merge branch '2.0' into 2.1
* 2.0:
  [ClassLoader] fixed unbracketed namespaces (closes #5747)

Conflicts:
	src/Symfony/Component/ClassLoader/ClassCollectionLoader.php
	tests/Symfony/Tests/Component/ClassLoader/ClassCollectionLoaderTest.php
2012-10-27 17:59:21 +02:00
Fabien Potencier
6f15c4780f [ClassLoader] fixed unbracketed namespaces (closes #5747) 2012-10-27 17:55:46 +02:00
Fabien Potencier
7adee1aeb2 [ClassLoader] added some tests for previous merge 2012-10-27 17:07:38 +02:00
Fabien Potencier
537760f058 merged branch bamarni/classcollectionloader-globalnamespace (PR #5120)
This PR was merged into the master branch.

Commits
-------

adeadfb fixed comment striping on global namespace classes

Discussion
----------

[ClassCollectionLoader] fixed comment striping on global namespace classes

previously #4792, I've removed the multiple blank lines removal not to break heredocs.

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

by stof at 2012-10-13T18:04:56Z

@fabpot is there anything left to merge this ?

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

by bamarni at 2012-10-14T11:47:23Z

I've added a space when faking a namespace, so that it stils works without the tokenizer (if #5747 gets merged)
2012-10-27 17:04:59 +02:00
Fabien Potencier
d7a02b5433 [Process] fixed previous merge 2012-10-27 15:48:18 +02:00
Fabien Potencier
453ff1af76 [Process] updated the CHANGELOG 2012-10-27 15:46:00 +02:00
Fabien Potencier
a6b2aa714b merged branch romainneutron/ProcessIncrementalOutput (PR #5546)
This PR was merged into the master branch.

Commits
-------

b89e413 [Process] Add output / error output incremental getters

Discussion
----------

[2.2][Process] Add output / error output incremental getters

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

Travis fails ; tests are ok on my local clone but upstream symfony master is currently broken

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

by stof at 2012-10-13T21:20:47Z

@romainneutron is there anything left before merging ? And please open a PR to the documentation to document the new feature
2012-10-27 15:43:43 +02:00
Fabien Potencier
c7ef309e2a merged branch eventhorizonpl/100ptc_component_httpfundation_p10 (PR #5757)
This PR was merged into the master branch.

Commits
-------

85d39aa session class tests

Discussion
----------

session class tests

Hi,

This patch adds some Session class tests.

Best regards,
Michal

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

by lsmith77 at 2012-10-19T17:04:29Z

can you close and reopen this PR to retriggered the travis build?
2012-10-27 15:38:48 +02:00
Fabien Potencier
31db547a40 merged branch eventhorizonpl/100ptc_component_httpfundation_p9 (PR #5756)
This PR was merged into the master branch.

Commits
-------

99aa37c tests for Request class

Discussion
----------

tests for Request class

Hi,

This patch adds some tests for Request class.

Best regards,
Michal

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

by lsmith77 at 2012-10-19T17:04:33Z

can you close and reopen this PR to retriggered the travis build?
2012-10-27 15:38:10 +02:00
Fabien Potencier
e3ceb56b48 merged branch Burgov/doctrine_orm_type_guesser_tests (PR #5793)
This PR was merged into the 2.1 branch.

Commits
-------

5d2525b [Form] Created test for DoctrineOrmTypeGuesser see #5790
b844d6b [Form] Fixed DoctrineOrmTypeGuesser to guess the "required" option for to-one associations

Discussion
----------

[Form] Doctrine orm type guesser tests

This PR adds tests to https://github.com/symfony/symfony/pull/5790

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

by Tobion at 2012-10-20T10:53:56Z

Using real test entities would be better IMO. Using mocks ties it pretty much to the implementation.

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

by sstok at 2012-10-21T10:38:53Z

@Tobion thats true, but Doctrine Class meta data takes quite some coding to set-up.
For instance you need the EntityManager to get even get the meta data set!

So you'd end having more code to set-up then your actually testing.

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

by Burgov at 2012-10-21T12:58:58Z

I wasn't sure whether do use a test entity manager, or do it the way I finally did it.

@sstok true, it's quite some work to set it up, but on the other hand there's the base OrmTestCase class which does it for you, so it'd actually mean I'd only have to create one entity for all the cases: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php

@Tobion on the other hand I tend to use a test EM only when I actually need to test persisting and loading, while this test case here is so isolated that I didn't really feel it would be necessary.

I'd like to know which method is preferred though, I'll change it if necessary, and other tests can be added to test the rest of this specific class
2012-10-27 15:36:11 +02:00
Fabien Potencier
15731a982e merged branch jfcixmedia/2.1 (PR #5838)
This PR was squashed before being merged into the master branch (closes #5838).

Commits
-------

201f3e6 [Form] Fixed cannot unset string offsets in CsrfValidationListener

Discussion
----------

[Form] Fixed cannot unset string offsets in CsrfValidationListener

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: -

A php fatal error is happening when someone rewrite the entire form data for an object with a single input.
```
Fatal error: Cannot unset string offsets in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php on line 72
```

Example:

```html
<form action="/app_dev.php/post/create" method="post" >
    <div id="posttype">
        <div>
            <label for="posttype_name" class="required">Name</label>
            <input type="text" id="posttype_name" name="posttype[name]" required="required" maxlength="255" />
        </div>
        <div>
            <label for="posttype_text" class="required">Text</label>
            <textarea id="posttype_text" name="posttype[text]" required="required"></textarea>
        </div>
        <input type="hidden" id="posttype__token" name="posttype[_token]" value="83a1617c694fbdea43c2527f1a55c7419ce82a42" /></div>
        <p>
            <button type="submit">Create</button>
        </p>
</form>
```

If someone alters the html to add a simple input at the bottom of the form like this one:
```html
<input type="text" id="posttype" name="posttype" value="test123" />
```

The result will be a php fatal error.

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

by bschussek at 2012-10-26T09:49:05Z

Thank you for the pull request! Could you please reference the pull request in the test?

```php
// https://github.com/symfony/symfony/pull/5838
public function testStringFormData()
{
    ...
```

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

by jfcixmedia at 2012-10-26T10:21:29Z

@bschussek  Added, thanks.
2012-10-27 15:29:28 +02:00
jfcixmedia
201f3e6489 [Form] Fixed cannot unset string offsets in CsrfValidationListener 2012-10-27 15:29:27 +02:00
Fabien Potencier
5155aecb3a merged branch Tobion/patch-2 (PR #5843)
This PR was merged into the 2.1 branch.

Commits
-------

7447ef7 slight refactoring in UrlMatcher

Discussion
----------

slight refactoring in UrlMatcher

bc break: no
bug fix: no
feature addition: no

saving a variable
2012-10-26 14:49:15 +02:00
Tobias Schultze
7447ef7171 slight refactoring in UrlMatcher 2012-10-26 12:26:42 +03:00
Simon Terrien
2d9a6fcc19 Use Norm Data instead of Data
This listener is triggered when normalized data are binded.

We have to use $event->getForm()->getNormData() instead of $event->getForm()->getData().
2012-10-26 12:03:13 +03:00
Fabien Potencier
bde2e26b69 [Form] updated CHANGELOG 2012-10-25 15:43:31 +02:00
Fabien Potencier
3138332152 [Form] tweaked previous merge 2012-10-25 15:42:46 +02:00
Fabien Potencier
13319da017 merged branch Dattaya/form/trim_listener (PR #4115)
This PR was squashed before being merged into the master branch (closes #4115).

Commits
-------

878dd91 [2.2] [Form] Trim listener, unicode whitespace characters.

Discussion
----------

[2.2] [Form] Trim listener, unicode whitespace characters.

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

I have some questions. ZERO WIDTH SPACE (200B) doesn't belong to White_Space but it's invisible and treated as white space by the html4.1 spec - http://www.w3.org/TR/html4/struct/text.html#h-9.1
Same question for
* U+202F	NARROW NO-BREAK SPACE
* U+FEFF	ZERO WIDTH NO-BREAK SPACE

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

by Dattaya at 2012-04-26T09:49:25Z

It seems to me that the check `mb_check_encoding($data, 'UTF-8')` is unnecessary. For non utf8 characters `preg_replace` returns `null` if `u` flag is set.
From http://www.pcre.org/pcre.txt:
>When you set the PCRE_UTF8 flag, the byte strings  passed  as  patterns
       and subjects are (by default) checked for validity on entry to the rel-
       evant functions.
...
>If an invalid UTF-8 string is passed to PCRE, an error return is given.

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

by Dattaya at 2012-07-27T06:52:58Z

Forgot to mention that `Cc` property includes more characters than needed (`0009-000D` and `0085`) but I think control characters shouldn't appear in a form field anyway.

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

by stof at 2012-10-13T16:47:47Z

@Dattaya ping
2012-10-25 15:40:56 +02:00
Yaroslav Kiliba
878dd91d37 [2.2] [Form] Trim listener, unicode whitespace characters. 2012-10-25 15:40:54 +02:00
Fabien Potencier
38b1ab68a3 Merge branch '2.1'
* 2.1:
  bumped Symfony version to 2.0.19-DEV
  updated VERSION for 2.0.18
  update CONTRIBUTORS for 2.0.18
  updated CHANGELOG for 2.0.18
  updated vendors for 2.0.18
  Remove § about prototype_name customization in 2.0
  fix option name
  Add to DateFormats 'D M d H:i:s Y T' (closes #5830)
2012-10-25 15:12:09 +02:00
Fabien Potencier
1277e6746b Merge branch '2.0' into 2.1
* 2.0:
  bumped Symfony version to 2.0.19-DEV
  updated VERSION for 2.0.18
  update CONTRIBUTORS for 2.0.18
  updated CHANGELOG for 2.0.18
  updated vendors for 2.0.18
  Add to DateFormats 'D M d H:i:s Y T' (closes #5830)

Conflicts:
	CONTRIBUTORS.md
	src/Symfony/Component/HttpKernel/Kernel.php
	tests/Symfony/Tests/Bridge/Monolog/Processor/WebProcessorTest.php
	vendors.php
2012-10-25 15:11:50 +02:00
Fabien Potencier
887207402b bumped Symfony version to 2.0.19-DEV 2012-10-25 15:09:46 +02:00
Fabien Potencier
b95b4f7f40 merged branch stof/stub_lenient_getter (PR #5836)
This PR was merged into the master branch.

Commits
-------

bd37f24 [Locale] Implement the lenient isser in the StubIntlFormatter

Discussion
----------

[Locale] Implement the lenient isser in the StubIntlFormatter

When hardcoding other settings in the stub (the calendar, the locale...), the corresponding getters are implemented using the hardcoded value. This does the same for ``isLenient`` to be consistent.
2012-10-25 15:04:42 +02:00
Fabien Potencier
f31c6f97b6 merged branch greg0ire/fix_upgrade_prototype_name_option (PR #5833)
This PR was merged into the 2.1 branch.

Commits
-------

6fb4a1b Remove § about prototype_name customization in 2.0
8a347fd fix option name

Discussion
----------

Fix upgrade prototype name option
2012-10-25 15:04:22 +02:00
Christophe Coevoet
bd37f246e6 [Locale] Implement the lenient isser in the StubIntlFormatter 2012-10-25 14:24:18 +02:00
Fabien Potencier
03fbb485e0 updated VERSION for 2.0.18 2012-10-25 10:56:58 +02:00
Fabien Potencier
12dd94804c update CONTRIBUTORS for 2.0.18 2012-10-25 10:56:32 +02:00
Fabien Potencier
065512db62 updated CHANGELOG for 2.0.18 2012-10-25 10:56:03 +02:00
Fabien Potencier
4250c033d0 updated vendors for 2.0.18 2012-10-25 10:54:02 +02:00
Grégoire Paris
6fb4a1bbdc Remove § about prototype_name customization in 2.0
I don't think this was even possible in 2.0
2012-10-25 10:33:18 +02:00
Grégoire Paris
8a347fdba6 fix option name 2012-10-25 10:33:03 +02:00
Xavier REN
20898e53a6 Add to DateFormats 'D M d H:i:s Y T' (closes #5830)
DateFormat seen on the web
2012-10-25 09:07:48 +02:00
Fabien Potencier
67d9253127 Merge branch '2.1'
* 2.1:
  added missing use statment (closes #5825)
  Code cleanup
  [WebProfilerBundle] Fixed the use of nested macros
  Removed unused use statements.
  Nsdocblocks
  [ConfigDumpReference] avoid notice for variable nodes
  fixed fallback locale
  UniqueValidatorTest, Change message on assertions
  Documented removed _form_is_choice_group function

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php
	src/Symfony/Bundle/WebProfilerBundle/Profiler/TemplateManager.php
2012-10-24 17:41:27 +02:00
Fabien Potencier
94f5f49894 merged branch bamarni/patch-10 (PR #5783)
This PR was merged into the 2.1 branch.

Commits
-------

3553276 [ConfigDumpReference] avoid notice for variable nodes

Discussion
----------

[ConfigDumpReference] avoid notice for variable nodes

When a variable node has an array as default value, a notice occurs later on because of an "array to string conversion", which is turned to an exception in debug mode (mandatory in order to run this command).
2012-10-24 17:35:37 +02:00
Fabien Potencier
20bb205f53 merged branch umpirsky/patch-1 (PR #5798)
This PR was merged into the master branch.

Commits
-------

40341bb Changed MoneyType::$patterns visibility.
c88fe94 Changed getPattern visibility

Discussion
----------

Changed getPattern visibility

It should be possible to override this method.

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

by Inori at 2012-10-22T19:25:37Z

Probably makes sense to also change visibility of [MoneyType::$patterns](c88fe94707/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php (L23))

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

by umpirsky at 2012-10-22T20:49:09Z

@Inori Fixed, thanks.
2012-10-24 17:32:38 +02:00
Fabien Potencier
562d3516fd merged branch nomack84/code_cleanup (PR #5818)
This PR was merged into the 2.1 branch.

Commits
-------

f06432b Code cleanup

Discussion
----------

Code cleanup

Not sure at the end if this good or not. If it is useless, just close it.
2012-10-24 17:12:48 +02:00
Stano Turza
11ba41bb17 added missing use statment (closes #5825) 2012-10-24 17:10:37 +02:00
Albert Casademont
3e58893d0f [Security] Tweak UsernamePasswordFormAuthenticationListener
- Do not check twice for the only_post condition
- If the expected request is only_post, check only the post variables for the username and password parameters
2012-10-23 11:27:38 +02:00
Sasa Stamenkovic
40341bbb2f Changed MoneyType::$patterns visibility. 2012-10-22 22:46:47 +02:00
Fabien Potencier
28482f8216 merged branch stof/timeline_panel (PR #5801)
This PR was merged into the 2.1 branch.

Commits
-------

039bdfd [WebProfilerBundle] Fixed the use of nested macros

Discussion
----------

[WebProfilerBundle] Fixed the use of nested macros

Closes #5800

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

by stof at 2012-10-22T20:03:10Z

@fabpot ping. this regression is quite annoying as I like the profiler
2012-10-22 22:20:01 +02:00
Mario A. Alvarez Garcia
f06432bc73 Code cleanup 2012-10-22 10:37:12 -04:00