New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Untitled #1
Closed
jwage
wants to merge
0
commits into
symfony:master
from
jwage:b1559334c97c83e996aa419cc9ec26e510921896
Closed
Untitled #1
jwage
wants to merge
0
commits into
symfony:master
from
jwage:b1559334c97c83e996aa419cc9ec26e510921896
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fabpot
added a commit
that referenced
this pull request
Jul 22, 2011
Commits ------- eae6a77 fixed wrong case d0a175b fixes #1659 f300ede fixes several bugs a4f05ac added some tests Discussion ---------- Http util fixes Fixes several bugs in the http utils. Please don't add anymore features without sufficient tests. Especially for the Security\Http namespace, regressions are very likely otherwise. --------------------------------------------------------------------------- by fabpot at 2011/07/19 22:37:26 -0700 Tests do not pass for me: There were 2 errors: 1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #0 ('en') InvalidArgumentException: The current node list is empty. .../src/Symfony/Component/DomCrawler/Crawler.php:604 .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16 2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de') InvalidArgumentException: The current node list is empty. .../src/Symfony/Component/DomCrawler/Crawler.php:604 .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16 -- There were 4 failures: 1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #0 ('en') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -http://localhost/en/login +http://localhost/login .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22 .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38 2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #1 ('de') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -http://localhost/de/login +http://localhost/login .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22 .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38 3) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #0 ('en') HTTP/1.0 302 Found Cache-Control: no-cache Content-Length: 299 Content-Type: text/html; charset=UTF-8 Date: Wed, 20 Jul 2011 05:36:27 GMT Location: http://localhost/login Set-Cookie: PHPSESSID=11c9c6a7e7620e13bddef223a5ba46d9; path=/; domain= <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="refresh" content="1;url=http://localhost/login" /> </head> <body> Redirecting to <a href="http://localhost/login">http://localhost/login</a>. </body> </html> Failed asserting that <integer:0> matches expected <integer:1>. .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50 4) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #1 ('de') HTTP/1.0 302 Found Cache-Control: no-cache Content-Length: 299 Content-Type: text/html; charset=UTF-8 Date: Wed, 20 Jul 2011 05:36:28 GMT Location: http://localhost/login Set-Cookie: PHPSESSID=2bbe63786a088471ade3717917f4ba4f; path=/; domain= <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="refresh" content="1;url=http://localhost/login" /> </head> <body> Redirecting to <a href="http://localhost/login">http://localhost/login</a>. </body> </html> Failed asserting that <integer:0> matches expected <integer:1>. .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50 --------------------------------------------------------------------------- by schmittjoh at 2011/07/19 23:47:29 -0700 I fixed a wrong case, but I couldn't reproduce the other errors (tested on Ubuntu). My guess is that the temporary directory on your machine couldn't be deleted for some reason, and the test runs with the configuration of some of the previous tests. --------------------------------------------------------------------------- by fabpot at 2011/07/20 00:28:41 -0700 That does not make any difference for me. For instance, in `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request to `'/'.$locale.'/login'` returns the following Response: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="refresh" content="1;url=http://localhost/login" /> </head> <body> Redirecting to <a href="http://localhost/login">http://localhost/login</a>. </body> </html> --------------------------------------------------------------------------- by schmittjoh at 2011/07/20 00:31:34 -0700 That's weird, did you make sure that the temporary directory does not exist? ``rm -Rf /tmp/StandardFormLogin/`` On Wed, Jul 20, 2011 at 9:28 AM, fabpot < reply@reply.github.com>wrote: > That does not make any difference for me. For instance, in > `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request > to `'/'.$locale.'/login'` returns the following Response: > > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=utf-8" /> > <meta http-equiv="refresh" content="1;url= > http://localhost/login" /> > </head> > <body> > Redirecting to <a href="http://localhost/login"> > http://localhost/login</a>. > </body> > </html> > > -- > Reply to this email directly or view it on GitHub: > #1739 (comment) > --------------------------------------------------------------------------- by fabpot at 2011/07/20 00:33:40 -0700 Yes, I've just checked and the directory does not exist. --------------------------------------------------------------------------- by schmittjoh at 2011/07/20 00:39:55 -0700 Sorry, I can't reproduce it on Ubuntu and unless someone wants to sponsor me a Mac, there is not much I can do.
fabpot
added a commit
that referenced
this pull request
Jul 27, 2011
Commits ------- 07298ac Detect EOF when reading input stream Discussion ---------- [Console] Detect EOF when reading input stream This is related to commits 511a9a1 and 3a5d508. First of them introduced abort-on-EOF and the second regressed the functionality. Problem is stream_get_line() doesn't return false on EOF. So it needs call to feof() to detect the situation. Still, it's not ideal. With fgets() it worked fine, but with stream_get_line() one has to press CTRL+D twice to get out. I presume this could be bug in PHP itself. But better than nothing. Please consider. --------------------------------------------------------------------------- by fabpot at 2011/07/19 22:47:53 -0700 I have used `stream_get_line` especially because it does not return `false` on eof. This is needed when you pass your own stream for unit tests. --------------------------------------------------------------------------- by lenar at 2011/07/25 06:05:59 -0700 This is not the best solution I think. Tests should mimic and cope with real life not the other way around. Better solution would be to fix testcase. Like this: lenar/SensioGeneratorBundle@6ff3f26. Or maybe create a special "testing" stream wrapper that wraps php://memory and gives out just linefeeds after real data ends. And then change stream_get_line() back to fgets() if there is no other reason for this change. --------------------------------------------------------------------------- by fabpot at 2011/07/25 06:24:20 -0700 When applying your patch to the generator bundle (and revert to use `fgets`), I get "RuntimeException: Aborted" exceptions. --------------------------------------------------------------------------- by lenar at 2011/07/25 06:35:08 -0700 With d326f89 added + lenar/SensioGeneratorBundle@6ff3f26 I can successfully run every test in that file. --------------------------------------------------------------------------- by fabpot at 2011/07/26 23:31:36 -0700 @lenar: not for me. I have many 'Aborted' exception on my Mac. --------------------------------------------------------------------------- by fabpot at 2011/07/26 23:41:18 -0700 And I have the exact same errors on Linux: There were 7 errors: 1) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateBundleCommandTest::testInteractiveCommand with data set #0 (array('/tmp'), 'Foo/BarBundle ', array('Foo\\BarBundle', 'FooBarBundle', '/tmp/', 'annotation', false)) RuntimeException: Aborted .../Symfony/Component/Console/Helper/DialogHelper.php:40 .../Symfony/Component/Console/Helper/DialogHelper.php:97 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php:165 .../Symfony/Component/Console/Command/Command.php:205 .../Symfony/Component/Console/Tester/CommandTester.php:66 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php:39 2) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateBundleCommandTest::testInteractiveCommand with data set #1 (array('/tmp'), 'Foo/BarBundle BarBundle foo yml n', array('Foo\\BarBundle', 'BarBundle', 'foo/', 'yml', false)) RuntimeException: Aborted .../Symfony/Component/Console/Helper/DialogHelper.php:40 .../Symfony/Component/Console/Helper/DialogHelper.php:62 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php:83 .../Symfony/Component/Console/Command/Command.php:214 .../Symfony/Component/Console/Tester/CommandTester.php:66 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php:39 3) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateBundleCommandTest::testInteractiveCommand with data set #2 (array('/tmp', 'yml', 'BarBundle', true), 'Foo/BarBundle ', array('Foo\\BarBundle', 'BarBundle', '/tmp/', 'yml', true)) RuntimeException: Aborted .../Symfony/Component/Console/Helper/DialogHelper.php:40 .../Symfony/Component/Console/Helper/DialogHelper.php:97 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateBundleCommand.php:165 .../Symfony/Component/Console/Command/Command.php:205 .../Symfony/Component/Console/Tester/CommandTester.php:66 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateBundleCommandTest.php:39 4) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #0 (array(), 'AcmeBlogBundle:Blog/Post ', array('Blog\\Post', 'annotation', array())) RuntimeException: Aborted .../Symfony/Component/Console/Helper/DialogHelper.php:40 .../Symfony/Component/Console/Helper/DialogHelper.php:97 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:145 .../Symfony/Component/Console/Command/Command.php:205 .../Symfony/Component/Console/Tester/CommandTester.php:66 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39 5) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #1 (array('AcmeBlogBundle:Blog/Post'), '', array('Blog\\Post', 'annotation', array())) RuntimeException: Aborted .../Symfony/Component/Console/Helper/DialogHelper.php:40 .../Symfony/Component/Console/Helper/DialogHelper.php:97 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:121 .../Symfony/Component/Console/Command/Command.php:205 .../Symfony/Component/Console/Tester/CommandTester.php:66 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39 6) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #2 (array(), 'AcmeBlogBundle:Blog/Post yml ', array('Blog\\Post', 'yml', array())) RuntimeException: Aborted .../Symfony/Component/Console/Helper/DialogHelper.php:40 .../Symfony/Component/Console/Helper/DialogHelper.php:62 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:153 .../Symfony/Component/Console/Command/Command.php:205 .../Symfony/Component/Console/Tester/CommandTester.php:66 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39 7) Sensio\Bundle\GeneratorBundle\Tests\Command\GenerateDoctrineEntityCommandTest::testInteractiveCommand with data set #3 (array(), 'AcmeBlogBundle:Blog/Post yml title 255 description text ', array('Blog\\Post', 'yml', array(array('title', 'string', 255), array('description', 'text')))) RuntimeException: Aborted .../Symfony/Component/Console/Helper/DialogHelper.php:40 .../Symfony/Component/Console/Helper/DialogHelper.php:62 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Command/GenerateDoctrineEntityCommand.php:153 .../Symfony/Component/Console/Command/Command.php:205 .../Symfony/Component/Console/Tester/CommandTester.php:66 .../symfony-standard/vendor/bundles/Sensio/Bundle/GeneratorBundle/Tests/Command/GenerateDoctrineEntityCommandTest.php:39 --------------------------------------------------------------------------- by lenar at 2011/07/26 23:56:46 -0700 @fabpot: and you modified all those tests? I only modified ```Tests/Command/GenerateDoctrineCrudCommandTest.php``` and that doesn't fail as I see from your log. I just provided example, though I could add necessary changes for other tests too. --------------------------------------------------------------------------- by fabpot at 2011/07/27 00:09:32 -0700 @lenar: ah, sorry about that. Then, can you provide a fix for all the other tests too? Thanks a lot. --------------------------------------------------------------------------- by lenar at 2011/07/27 00:22:54 -0700 @fabpot: actually what do you think about this kind of fix instead for tests: lenar/SensioGeneratorBundle@517f263cb01ea2ea1ef2 instead my previous proposal (lenar/SensioGeneratorBundle@6ff3f26). Really simple, short and effective. --------------------------------------------------------------------------- by fabpot at 2011/07/27 00:37:51 -0700 @lenar: looks good to me. Can you create a PR? --------------------------------------------------------------------------- by lenar at 2011/07/27 00:45:36 -0700 @fabpot: sensiolabs/SensioGeneratorBundle#60
fabpot
added a commit
that referenced
this pull request
Dec 15, 2011
Commits ------- 7c2f11f Merge pull request #1 from pminnieur/post_response 9f4391f [HttpKernel] fixed DocBlocks 2a61714 [HttpKernel] added PostResponseEvent dispatching to HttpKernel 915f440 [HttpKernel] removed BC breaks, introduced new TerminableInterface 7efe4bc [HttpKernel] Add Kernel::terminate() and HttpKernel::terminate() for post-response logic Discussion ---------- [HttpKernel] Add Kernel::terminate() and HttpKernel::terminate() for post-response logic This came out of a discussion on IRC about doing stuff post-response, and the fact that right now there is no best practice, and it basically requires adding code after the `->send()` call. It's an attempt at fixing it in an official way. Of course terminate() would need to be called explicitly, and added to the front controllers, but then it offers a standard way for everyone to listen on that event and do things without slowing down the user response. --------------------------------------------------------------------------- by stof at 2011/12/06 02:41:26 -0800 We discussed it on IRC and I suggested a way to avoid the BC break of the interface: adding a new interface (``TerminableInterface`` or whatever better name you find) containing this method. HttpKernel, Kernel and HttpCache can then implement it without breaking the existing apps using the component (Kernel and HttpCache would need an instanceof check to see if the inner kernel implements the method) For Symfony2 users it will mean they have to change their front controller to benefit from the new event of course, but this is easy to do. Btw, Silex can then be able to use it without *any* change for the end users as it can be done inside ``Application::run()`` --------------------------------------------------------------------------- by pminnieur at 2011/12/06 11:47:03 -0800 @Seldaek: I opened a pull request so that the discussion on IRC is fulfilled and no BC breaks exist: https://github.com/Seldaek/symfony/pull/1/files --------------------------------------------------------------------------- by fabpot at 2011/12/07 07:59:49 -0800 Any real-world use case for this? --------------------------------------------------------------------------- by Seldaek at 2011/12/07 08:10:31 -0800 Doing slow stuff after the user got his response back without having to implement a message queue. I believe @pminnieur wanted to use it to send logs to loggly? --------------------------------------------------------------------------- by pminnieur at 2011/12/07 09:08:41 -0800 Its a good practice to defer code execution without the introduction of a new software layer (like gearman, amqp, whatever tools people use to defer code execution) which may be way too much just for the goal of having fast responses, whatever my code does. My real world use case which made me miss this feature the first time: > I have a calendar with a scheduled Event. For a given period of time, several Event entities will be created, coupled to the scheduled event (the schedule Event just keeps track of `startDate`, `endDate` and the `dateInterval`). Let's say we want this scheduled Event to be on every Monday-Friday, on a weekly basis, for the next 10 years. This means I have to create `10*52*5` Event entities before I could even think about sending a simple redirect response. If I could defer code execution, I'd only save the scheduled Event, send the redirect response and after that, I create the `10*52*5` entities. The other use case was loggly, yes. Sending logging data over the wire before the response is send doesn't make sense in my eyes, so it could be deferred after the response is send (this especially sucks if loggly fails and i get a 500 --the frontend/public user is not interested in a working logging facility, he wants his responses). --------------------------------------------------------------------------- by mvrhov at 2011/12/07 10:07:03 -0800 This would help significantly, but the real problem, that your process is busy and unavailable for the next request, is still there. --------------------------------------------------------------------------- by fabpot at 2011/12/07 10:15:18 -0800 I think this is the wrong solution for a real problem. Saying "Its a good practice to defer code execution without the introduction of a new software layer" is just wrong. It is definitely a good practice to defer code execution, but you should use the right tool for the job. I'm -1. --------------------------------------------------------------------------- by pminnieur at 2011/12/07 10:25:44 -0800 It should just give a possibility to put unimportant but heavy lifting code behind the send request with ease. With little effort people could benefit from the usage of `fastcgi_finish_request` without introducing new software, using `register_shutdown_function` or using `__destruct `(which works for simple things, but may act weird with dependencies). It should not simulate node.js ;-) I agree that the real problem is not solved, but small problems could be solved easily. I personally don't want to setup RabbitMQ or whatever, maintain my crontab or any other software that may allow me to defer code execution. --------------------------------------------------------------------------- by Seldaek at 2011/12/08 01:08:32 -0800 @fabpot: one could say that on shared hostings it is still useful because they generally don't give you gearman or \*MQs. Anyway I think it'd be nice to really complete the HttpKernel event cycle. --------------------------------------------------------------------------- by pminnieur at 2011/12/08 01:48:57 -0800 not only on shared hostings, sometimes teams/projects just don't have the resources or knowledge or time to setup such an infrastructure. --------------------------------------------------------------------------- by videlalvaro at 2011/12/08 01:53:06 -0800 I can say we used `fastcgi_finish_request` quite a lot at poppen with symfony 1.x. It certainly helped us to send data to Graphite, save XHProf runs, send data to RabbitMQ, and so on. For example we used to connect to RabbitMQ and send the messages _after_ calling `fastcgi_finish_request` so the user never had to wait for stuff like that. Also keep in mind that if you are using Gearman or RabbitMQ or whatever tool you use to defer code execution… you are not deferring the network connection handling, sending data over the wire and what not. I know this is obvious but is often overlooked. So it would be nice to have an standard way of doing this. --------------------------------------------------------------------------- by henrikbjorn at 2011/12/13 01:42:23 -0800 This could have been useful recently while implementing a "Poor mans cronjob" system. The solution was to do a custom Response object and do the stuff after send have been called with a Connection: Close header and ignore_user_abort(); (Yes very ugly)
fabpot
added a commit
that referenced
this pull request
Jan 22, 2012
Commits ------- 753c067 [FrameworkBundle] added $view['form']->csrfToken() helper e1aced8 [Twig] added {{ csrf_token() }} helper Discussion ---------- [Twig] [FrameworkBundle] added CSRF token helper I've added a templating helper and Twig function for generating a CSRF token without the overhead of creating a form. ```html+jinja <form action="{{ path('user_delete', { 'id': user.id }) }}" method="post"> <input type="hidden" name="_method" value="delete"> <input type="hidden" name="_token" value="{{ csrf_token('delete_user_' ~ user.id) }}"> <button type="submit">delete</button> </form> ``` ```php <?php class UserController extends Controller { public function delete(User $user, Request $request) { $csrfProvider = $this->get('form.csrf_provider'); if (!$csrfProvider->isCsrfTokenValid('delete_user_'.$user->getId(), $request->request->get('_token')) { throw new RuntimeException('CSRF attack detected.'); } // etc... } } ``` The test that is failing on Travis appears to be unrelated, but I may be wrong? ``` 1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de') RuntimeException: OUTPUT: Catchable fatal error: Argument 3 passed to Symfony\Bundle\FrameworkBundle\Controller\TraceableControllerResolver::__construct() must be an instance of Symfony\Component\HttpKernel\Debug\Stopwatch, instance of Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser given, called in /tmp/2.1.0-DEV/StandardFormLogin/cache/securitybundletest/appSecuritybundletestDebugProjectContainer.php on line 94 and defined in /home/vagrant/builds/kriswallsmith/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TraceableControllerResolver.php on line 37 ``` --------------------------------------------------------------------------- by pablodip at 2012-01-10T14:18:45Z As you don't need forms to use the csrf provider, how about putting its service without the form prefix? It could even make sense to put the CsrfProvider as a component since you can use it standalone and in more cases than only forms. It would be a small component though. --------------------------------------------------------------------------- by Tobion at 2012-01-10T17:54:14Z I think it would be more clear to generate the token in the controller. Doing so in the template will spread the CSRF intention across template and controller. So I don't think this extension is necessary. --------------------------------------------------------------------------- by kriswallsmith at 2012-01-10T17:58:14Z @pablodip I'm open to the idea of a Csrf component. This would be a good place for some nonce classes as well. @Tobion I disagree. One use case is for a list of users, each with a delete form. Iterating over the users in the controller and generating a token for each, just to iterate over them again in the view is a waste and adds complexity. --------------------------------------------------------------------------- by Tobion at 2012-01-10T18:05:14Z I see. But I don't understand why the intention needs to be different for each user to delete. Usually the intention is the same for each form type. I thought this is enough. --------------------------------------------------------------------------- by kriswallsmith at 2012-01-10T18:06:13Z Yes, a static intention would suffice. --------------------------------------------------------------------------- by Tobion at 2012-01-10T18:07:08Z Then your use case is not valid anymore. --------------------------------------------------------------------------- by Tobion at 2012-01-10T18:12:25Z I would suggest to make a cookbook article out of it about how to create a simple form without the form component. And include such things as validating the result using the validator component and checking the CSRF. --------------------------------------------------------------------------- by kriswallsmith at 2012-01-10T21:32:50Z This helper makes it easier to use CSRF protection without a form and we should make it as easy as possible. Spreading the intention across controller and template is not concerning to me. Either way, a cookbook entry is a great idea. --------------------------------------------------------------------------- by Tobion at 2012-01-10T21:47:12Z Well, it's just one line more without this helper. So I disagree it makes it really easier when you know how to use the CsrfProvider which is a pre-condition anyway since you must still validate its correctness by hand. --------------------------------------------------------------------------- by kriswallsmith at 2012-01-13T13:24:15Z Another use case is when rendering a page with a bunch of simple buttons with different intentions: delete user, delete comment, follow, unfollow... Creating all of these in the controller just leads to spaghetti. --------------------------------------------------------------------------- by jwage at 2012-01-17T21:55:53Z👍 lots of use cases for something like this @opensky
fabpot
added a commit
that referenced
this pull request
Apr 7, 2012
Commits ------- 100e97e [Filesystem] Fixed warnings in makePathRelative(). f5f5c21 [Filesystem] Fixed typos in the docblocks. d4243a2 [Filesystem] Fixed a bug in remove being unable to remove symlinks to unexisting file or directory. 11a676d [Filesystem] Added unit tests for mirror method. 8c94069 [Filesystem] Added unit tests for isAbsolutePath method. 2ee4b88 [Filesystem] Added unit tests for makePathRelative method. 21860cb [Filesystem] Added unit tests for symlink method. a041feb [Filesystem] Added unit tests for rename method. 8071859 [Filesystem] Added unit tests for chmod method. bba0080 [Filesystem] Added unit tests for remove method. 8e861b7 [Filesystem] Introduced workspace directory to limit complexity of tests. a91e200 [Filesystem] Added unit tests for touch method. 7e297db [Filesystem] Added unit tests for mkdir method. 6ac5486 [Filesystem] Added unit tests for copy method. 1c833e7 [Filesystem] Added missing docblock comment. Discussion ---------- [Filesystem] Fixed a bug in remove() being unable to unlink broken symlinks While working on test coverage for Filesystem class I discovered a bug in remove() method. Before removing a file a check is made if it exists: if (!file_exists($file)) { continue; } Problem is [file_exists()](http://php.net/file_exists) returns false if link's target file doesn't exist. Therefore remove() will fail to delete a directory containing a broken link. Solution is to handle links a bit different: if (!file_exists($file) && !is_link($file)) { continue; } Additionally, this PR improves test coverage of Filesystem component. Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes --------------------------------------------------------------------------- by cordoval at 2012-04-07T00:55:59Z✌ .|•͡˘‿•͡˘|.✌ --------------------------------------------------------------------------- by fabpot at 2012-04-07T06:12:34Z Tests do not pass for me: PHPUnit 3.6.10 by Sebastian Bergmann. Configuration read from /Users/fabien/work/symfony/git/symfony/phpunit.xml.dist .........................EE....... Time: 0 seconds, Memory: 5.25Mb There were 2 errors: 1) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #0 ('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component', '../') Uninitialized string offset: 29 .../rc/Symfony/Component/Filesystem/Filesystem.php:183 .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434 2) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #1 ('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../') Uninitialized string offset: 16 .../rc/Symfony/Component/Filesystem/Filesystem.php:183 .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434 FAILURES! Tests: 34, Assertions: 67, Errors: 2. --------------------------------------------------------------------------- by jakzal at 2012-04-07T07:26:15Z Sorry for this. For some reason my PHP error reporting level was to low to catch this... Should be fixed now but I needed to modify the makePathRelative() (this bug existed before).
fabpot
pushed a commit
that referenced
this pull request
Jun 19, 2012
[FileSystem] explain possible failure of symlink creation in windows
fabpot
added a commit
that referenced
this pull request
Jun 19, 2012
Commits ------- a20fc68 Merge pull request #1 from SamsonIT/FilesystemExceptions 8eca661 [FileSystem] explains possible failure of symlink creation in windows b1f8744 Add Changelog BC Break note 24eb396 [Filesystem] Added few new behaviors: Discussion ---------- [Filesystem] Consistence and enhancements for Filesystem Bug fix: no Feature addition: yes Backwards compatibility break: **yes** Symfony2 tests pass: yes Fixes the following tickets: None License of the code: MIT This PR adds features and introduce a backward compatibility break. features : - whenever an action fails, a \RuntimeException is thrown - add access to the second and third arguments of ``touch`` function - add a recursive option for chmod - add a chown method - add a chgrp method The backward compatibility break happens in the mkdir method : Before this PR, a boolean is returned ; true if all directories were created, false otherwise. It now returns nothing. --------------------------------------------------------------------------- by travisbot at 2012-05-18T14:26:42Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1367000) (merged 83cdd622 into 1e15f21). --------------------------------------------------------------------------- by fabpot at 2012-05-20T02:40:28Z To be consistent, we should throw exception whenever some operation fails. --------------------------------------------------------------------------- by romainneutron at 2012-05-20T21:10:23Z I fix the consistency ; mkdir now throws an exception if a directory creation fails. This introduce a BC break, see PR message which has been updated with all features and BC break. Added chgrp and chown methods Add options for touch Add recursive option for chmod --------------------------------------------------------------------------- by travisbot at 2012-05-20T21:11:47Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1383619) (merged a4d1eeb8 into 1407f11). --------------------------------------------------------------------------- by travisbot at 2012-05-22T10:49:06Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399027) (merged 7e14b6bd into 517ae43). --------------------------------------------------------------------------- by travisbot at 2012-05-22T10:58:10Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399083) (merged 71852653 into 517ae43). --------------------------------------------------------------------------- by travisbot at 2012-05-22T11:18:44Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399194) (merged 7645bad3 into 517ae43). --------------------------------------------------------------------------- by travisbot at 2012-05-23T18:21:47Z This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1414091) (merged b049d5b1 into 517ae43). --------------------------------------------------------------------------- by travisbot at 2012-05-23T18:26:19Z This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1414123) (merged 34903466 into 517ae43). --------------------------------------------------------------------------- by travisbot at 2012-05-29T16:07:26Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1467173) (merged b1d1eb2e into adf07f1). --------------------------------------------------------------------------- by travisbot at 2012-05-29T16:19:38Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1467261) (merged 42015ffa into adf07f1). --------------------------------------------------------------------------- by romainneutron at 2012-06-01T14:30:45Z Any news about this PR ? --------------------------------------------------------------------------- by stloyd at 2012-06-08T09:57:39Z @romainneutron You need to [squash](http://www.silverwareconsulting.com/index.cfm/2010/6/6/Using-Git-Rebase-to-Squash-Commits) your commits, and add more proper message in squashed commit i.e.: > [Filesystem] Added few new behaviors: * whenever an action fails, a `RuntimeException` is thrown * add access to the second and third arguments of `touch()` function * add a recursive option for `chmod()` * add a `chown()` method * add a `chgrp()` method > BC break: `mkdir()` function throw exception in case of failture instead of returning Boolean value. --------------------------------------------------------------------------- by romainneutron at 2012-06-08T10:59:55Z @stloyd squash done ! --------------------------------------------------------------------------- by travisbot at 2012-06-08T11:26:20Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1565540) (merged 8f55ddb6 into f8e68e5). --------------------------------------------------------------------------- by travisbot at 2012-06-08T11:41:45Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1566247) (merged 880312b6 into f8e68e5). --------------------------------------------------------------------------- by romainneutron at 2012-06-09T11:42:24Z I've added documentation to the Filesystem component : symfony/symfony-docs#1439 --------------------------------------------------------------------------- by travisbot at 2012-06-09T16:47:20Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1577754) (merged 5647ad41 into f8a09db). --------------------------------------------------------------------------- by stloyd at 2012-06-13T14:47:31Z @romainneutron You probably need to rebase your code as some changes were merge into master for `Filesystem`. --------------------------------------------------------------------------- by romainneutron at 2012-06-13T15:17:31Z @stloyd rebase OK ! by the way, do you have any idea when/if this PR will be merged ? --------------------------------------------------------------------------- by travisbot at 2012-06-13T15:20:44Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1611591) (merged c8b86c68 into c07e916). --------------------------------------------------------------------------- by fabpot at 2012-06-16T16:40:50Z You need to add a note about the BC breaks in the CHANGELOG file. --------------------------------------------------------------------------- by fabpot at 2012-06-16T16:43:20Z Also, instead of using `\RuntimeException`, I would create a custom exception like we have done in other components (an interface + a RuntimeException that implements the interface and extends \RuntimeException). The exception name can be something like `IOException`. --------------------------------------------------------------------------- by travisbot at 2012-06-18T10:11:20Z This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1645757) (merged 925a8234 into 0b8b76b). --------------------------------------------------------------------------- by stloyd at 2012-06-18T10:14:52Z @fabpot Anything blocking merge of this PR ? (tests are failing because of issue in master, not releted to this PR) --------------------------------------------------------------------------- by romainneutron at 2012-06-18T10:29:20Z @fabpot @stloyd the latest push was just a rebase push for PR 4577 (#4577) I'm currently fixing the Exception and changelog things, I'll push very soon --------------------------------------------------------------------------- by romainneutron at 2012-06-18T10:44:38Z @fabpot I've added the exception and the exception interface, add the changelog info --------------------------------------------------------------------------- by travisbot at 2012-06-18T10:53:34Z This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1645981) (merged 634d6fb9 into 0b8b76b). --------------------------------------------------------------------------- by romainneutron at 2012-06-18T11:08:43Z As reported by @stloyd the PR is failing due to an issue in the master, I re-push and trig the PR build when this issue is solved --------------------------------------------------------------------------- by travisbot at 2012-06-18T11:16:58Z This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1646006) (merged 2f65945a into 0b8b76b).
fabpot
added a commit
that referenced
this pull request
Nov 1, 2012
This PR was merged into the master branch. Commits ------- b550677 [Finder] Fix the BSD adapter 2401274 [Finder] Added bsd adapter (need tests). Discussion ---------- [Finder] Adds bsd adapter. OK on mac os x. --------------------------------------------------------------------------- by fabpot at 2012-10-31T08:22:05Z Here are the results for the Finder tests on my Mac: ``` ............................................................... 63 / 181 ( 34%) ......................find: -regextype: unknown primary or operator F..............find: -regextype: unknown primary or operator find: -regextype: unknown primary or operator .find: -regextype: unknown primary or operator find: -regextype: unknown primary or operator ......................... 126 / 181 ( 69%) ....................................................... Time: 1 second, Memory: 10.75Mb There was 1 failure: 1) Symfony\Component\Finder\Tests\FinderTest::testIgnoreDotFiles with data set #1 (Symfony\Component\Finder\Adapter\PhpAdapter) Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ Array ( - 0 => '/var/folders/h7/55h7wcsx4g1cl...r/.bar' - 1 => '/var/folders/h7/55h7wcsx4g1cl...r/.foo' - 2 => '/var/folders/h7/55h7wcsx4g1cl...o/.bar' - 3 => '/var/folders/h7/55h7wcsx4g1cl...r/.git' - 4 => '/var/folders/h7/55h7wcsx4g1cl...er/foo' - 5 => '/var/folders/h7/55h7wcsx4g1cl...oo bar' - 6 => '/var/folders/h7/55h7wcsx4g1cl...ar.tmp' - 7 => '/var/folders/h7/55h7wcsx4g1cl...st.php' - 8 => '/var/folders/h7/55h7wcsx4g1cl...est.py' - 9 => '/var/folders/h7/55h7wcsx4g1cl...r/toto' ) .../src/Symfony/Component/Finder/Tests/Iterator/IteratorTestCase.php:25 .../src/Symfony/Component/Finder/Tests/FinderTest.php:207 phpunit:46 ``` --------------------------------------------------------------------------- by jfsimon at 2012-10-31T08:46:22Z @fabpot thank you! It seems I need to experiment a little more... --------------------------------------------------------------------------- by jfsimon at 2012-11-01T14:38:31Z @fabpot BSD adapter is OK on mac os x.
fabpot
pushed a commit
that referenced
this pull request
Dec 15, 2012
[FrameworkBundle] Added tests for trusted_proxies configuration.
fabpot
added a commit
that referenced
this pull request
Dec 15, 2012
This PR was merged into the 2.0 branch. Commits ------- f0743b1 Merge pull request #1 from pylebecq/2.0 555e777 [FrameworkBundle] Added tests for trusted_proxies configuration. a0e2391 [FrameworkBundle] used the new method for trusted proxies Discussion ---------- [FrameworkBundle] used the new method for trusted proxies This makes the framework bundle using the new method from the request class. --------------------------------------------------------------------------- by fabpot at 2012-12-05T10:38:20Z As this is a sensitive issue, can you add some tests? Thanks. --------------------------------------------------------------------------- by bamarni at 2012-12-06T13:00:24Z Well I don't know why it fails on travis, I can't run the full test suite locally because of a segfault but ```phpunit src/Symfony/Bundle/``` marks all the tests as passing. --------------------------------------------------------------------------- by fabpot at 2012-12-06T13:08:11Z But it looks like the failing tests come from what you've changed. --------------------------------------------------------------------------- by bamarni at 2012-12-06T13:29:33Z Yes, I'm not saying it's not my fault but I can't reproduce this as locally it tells me they pass, I'll try to fix this this evening. --------------------------------------------------------------------------- by bamarni at 2012-12-06T17:49:28Z Apparently it fails only when running the whole testsuite, looking at other travis builds I can see this one on 2.0 : https://travis-ci.org/symfony/symfony/jobs/3495511 which fails in a similar way than here (https://travis-ci.org/symfony/symfony/jobs/3530928). Because of a place trying to access an undefined $_SERVER key : ```PHP Notice: Undefined index: SCRIPT_NAME ...``` but I can't find where, and the stack trace references some phpunit classes. I'd be happy if someone could give me some pointers in here as I don't have any clue about how to fix this.. --------------------------------------------------------------------------- by bamarni at 2012-12-06T18:00:57Z As a consulsion I'd say I can't run the whole testsuite locally (it fails even when I revert my commit), so there is no reliable way for me to fix this, if anyone is up for continuing this feel free. --------------------------------------------------------------------------- by fabpot at 2012-12-11T09:47:48Z @bamarni Can you just update this PR with the code change and no tests at all? I will then finish the PR. Thanks. --------------------------------------------------------------------------- by bamarni at 2012-12-11T16:58:17Z @fabpot: thanks for helping me out on this, hope you won't run into the same issue!
fabpot
added a commit
that referenced
this pull request
Dec 29, 2012
This PR was merged into the 2.1 branch. Commits ------- 81967f6 [Form] Fixed failing tests for DateTimeToStringTransformer. Discussion ---------- [Form] Fixed failing tests for DateTimeToStringTransformer Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: - Todo: - License of the code: MIT Documentation PR: - Tests were only failing at the end of the month. Since February was used in the test cases, date was being moved to the next month (February has less days than other months). If a day is not passed, \DateTime's constructor will set it to the first day of the month: ```php var_dump(new \DateTime('2010-02')); object(DateTime)#1 (3) { ["date"]=> string(19) "2010-02-01 00:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" } ``` \DateTime is used in the test assertions. However, DateTimeToStringTransformer::reverseTransform() uses \DateTime::createFromFormat(), which sets a missing day to the current day: ```php var_dump(\DateTime::createFromFormat("Y-m", '2010-02')); object(DateTime)#1 (3) { ["date"]=> string(19) "2010-03-01 20:09:26" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" } ``` I changed the date in the test case to avoid failures. If we need to be sure that month's not going to be changed, I'll update my PR.
fabpot
added a commit
that referenced
this pull request
Jan 10, 2013
This PR was merged into the master branch. Commits ------- 0d6be2e Added Portuguese (Portugal) translation to Security 87df0b7 Merge pull request #1 from symfony/master Discussion ---------- Add Portuguese from Portugal Security translation Translation file for portuguese from Portugal added in Security component translations
kriswallsmith
added a commit
that referenced
this pull request
Mar 8, 2013
Fixed test to use Reflection
fabpot
added a commit
that referenced
this pull request
Mar 8, 2013
This PR was merged into the 2.1 branch. Commits ------- 27cc0df Merge pull request #1 from merk/class-loader/idempotent 95af84c Fixed test to use Reflection bb08247 [ClassLoader] tweaked test 73bead7 [ClassLoader] made DebugClassLoader idempotent Discussion ---------- [ClassLoader] made DebugClassLoader idempotent The DebugClassLoader will wrap itself if `enable()` is called multiple time, such as when running functional tests. Please merge to 2.2 and master ASAP. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | ~ --------------------------------------------------------------------------- by kriswallsmith at 2013-03-07T16:38:55Z ping @fabpot: this will speed up lots of functional tests :) --------------------------------------------------------------------------- by kriswallsmith at 2013-03-08T04:51:51Z @fabpot fixed by @merk
dawehner
pushed a commit
to dawehner/symfony
that referenced
this pull request
Jul 1, 2013
Add ChainRouter based on work by Magnus Norlander
dawehner
pushed a commit
to dawehner/symfony
that referenced
this pull request
Jul 1, 2013
Fix hard dependency on psr/log
nicolas-grekas
added a commit
that referenced
this pull request
Nov 4, 2022
…h null on non-nullable argument (GromNaN) This PR was merged into the 6.1 branch. Discussion ---------- [HttpKernel] Fix deprecation for DateTimeValueResolver with null on non-nullable argument | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | https://github.com/symfony/symfony/pull/48098/files#r1013918566 | License | MIT | Doc PR | n/a Remove deprecation message when the value is `null` and the controller argument is not nullable. ``` Deprecated: DateTimeImmutable::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated ``` This class have been modified in 6.2. The new test case needs to be updated. Commits ------- 1d7387b Fix deprecation notice when date argument is not nullable and null value is provided
nicolas-grekas
added a commit
that referenced
this pull request
Dec 4, 2022
…defined date attribute to the expected class (GromNaN) This PR was merged into the 6.1 branch. Discussion ---------- [HttpKernel] In DateTimeValueResolver, convert previously defined date attribute to the expected class | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix https://github.com/symfony/symfony/pull/48098/files#r1013997729 | License | MIT Convert an instance of `DateTimeInterface` to the expected class if the value was predefined in the request attributes. ```php # in a request listener $request->attributes->set('date', new \DateTimeImmutable()); ``` ```php class MyController { public function index(\DateTime $date) { // Use the $date } } ``` ``` Uncaught TypeError: MyController::index(): Argument #1 ($date) must be of type DateTime, DateTimeImmutable given ``` Commits ------- 22a1567 Convert previously defined date attribute to the expected class
nicolas-grekas
added a commit
that referenced
this pull request
Dec 13, 2022
This PR was merged into the 6.2 branch. Discussion ---------- [HttpKernel] Fix `CacheAttributeListener` priority | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Currently the `CacheAttributeListener` & the `IsGrantedAttributeListener` have the same priority: ``` Registered Listeners for "kernel.controller_arguments" Event ============================================================ ------- --------------------------------------------------------------------------------------------------------- ---------- Order Callable Priority ------- --------------------------------------------------------------------------------------------------------- ---------- #1 Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments() 10 #2 Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments() 10 #3 Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments() 0 ------- --------------------------------------------------------------------------------------------------------- ---------- ``` Since the `CacheAttributeListener` is alphabetically first, it's first to get triggered. This can cause an unauthenticated user to receive a 304 Not modified instead of a 302 Redirect, resulting in the user seeing some stale content from when they were authenticated instead of getting redirected to the login page. This PR changes the priority of the `CacheAttributeListener` to be lower than that of the `IsGrantedAttributeListener`. Commits ------- 90eb89f [HttpKernel] Fix CacheAttributeListener priority
nicolas-grekas
added a commit
that referenced
this pull request
Feb 23, 2023
…tributes (delbertooo) This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead. Discussion ---------- [FrameworkBundle] Fix denyAccessUnlessGranted for mixed attributes | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? |no | Tickets | - | License | MIT | Doc PR | - Checking authorization against anything that isn't `array|string` will cause PHP errors now. The method `AbstractController::denyAccessUnlessGranted()` sets the given *single* attribute into the exception in case of denied access. The `AuthorizationCheckerInterface` defines that the attribute can be anything, even objects. The parameter type hint `array|string` of `AccessDeniedException::setAttributes()` want's an array of attributes (or a string for convenience). # Example ```php use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class MyCustomAttribute { } class ProfileController extends AbstractController { public function index(): Response { $this->denyAccessUnlessGranted(new MyCustomAttribute()); //💥 ERROR: Symfony\Component\Security\Core\Exception\AccessDeniedException::setAttributes(): Argument #1 ($attributes) must be of type array|string, [...] $user = $this->getUser(); return new Response('Well hi there '.$user->getFirstName()); } } ``` # The fix As the given attribute is a *single* attribute: always wrap it into an array when creating the exception, because the exception expects an array of attributes. Commits ------- 9ed77f3 [FrameworkBundle] Fix denyAccessUnlessGranted for mixed attributes
danepowell
added a commit
to danepowell/symfony
that referenced
this pull request
Apr 24, 2023
chalasr
added a commit
that referenced
this pull request
Apr 25, 2023
…ool given (danepowell) This PR was merged into the 5.4 branch. Discussion ---------- [Console] trim(): Argument #1 () must be of type string, bool given | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? |no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> If you run a Symfony Console application in Git Bash, ANSICON is not set out of the box and results in this (suppressed) error: > trim(): Argument ($string) must be of type string, bool given AFAICT, this method is only called from Application::run() and errors are suppressed. So users will never actually see that error. Still, it could have side effects and breaks downstream projects: box-project/box#990 Commits ------- 324b160 trim(): Argument #1 () must be of type string, bool given
nicolas-grekas
added a commit
that referenced
this pull request
Apr 28, 2023
* 5.4: trim(): Argument #1 () must be of type string, bool given [Dumper] Trim leading newlines when checking if value begins with a space Fix the list of supported shells for completions in a phar
nicolas-grekas
added a commit
that referenced
this pull request
Apr 28, 2023
* 6.2: Fix test class name trim(): Argument #1 () must be of type string, bool given Check if trace.curlCommand is defined in profiler [Dumper] Trim leading newlines when checking if value begins with a space [FrameworkBundle] Make service edges unique Fix the list of supported shells for completions in a phar Fix the usage of the zsh completion through the fpath discovery
Spomky
pushed a commit
to Spomky/symfony
that referenced
this pull request
May 14, 2023
Closed
alexbuyanow
added a commit
to alexbuyanow/symfony
that referenced
this pull request
Jul 17, 2023
…parameter symfony#1 ($haystack) of type string ..." in case of 'Content-Type' equals null in dev environment with no debug
alexbuyanow
added a commit
to alexbuyanow/symfony
that referenced
this pull request
Jul 17, 2023
…parameter symfony#1 ($haystack) of type string ..." in case of 'Content-Type' equals null in dev environment with no debug. Fabbot fixes
alexbuyanow
added a commit
to alexbuyanow/symfony
that referenced
this pull request
Jul 19, 2023
…parameter symfony#1 ($haystack) of type string ..." in case of 'Content-Type' equals null in dev environment with no debug. Tests
fabpot
added a commit
that referenced
this pull request
Jul 30, 2023
This PR was squashed before being merged into the 2.8-dev branch (closes #1). Discussion ---------- Initial support | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | symfony/symfony-docs#5331 - [x] Composer dependencies - [x] Interfaces - [x] Stub - [x] HttpFoundationFactory implementation - [x] DiactorosFactory implementation - [x] StreamedResponse Commits ------- ca41146 Initial support
fabpot
added a commit
that referenced
this pull request
Jul 30, 2023
…repo (fabpot, dunglas, KorvinSzanto, xabbuh, aimeos, ahundiak, Danielss89, rougin, csunolgomez, Jérôme Parmentier, mtibben, Nyholm, ajgarlag, uphlewis, samnela, grachevko, nicolas-grekas, tinyroy, danizord, Daniel Degasperi, rbaarsma, Ekman, 4rthem, derrabus, mleczakm, iluuu1994, Tobion, chalasr, lemon-juice, franmomu, cidosx, erikn69, AurelienPillevesse) This PR was merged into the 6.4 branch. Discussion ---------- [PsrHttpMessageBridge] Import the bridge into the monorepo | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | TODO⚠️ Don't squash! I propose to import the `symfony/psr-http-message-bridge` package into the Symfony monorepo for further maintenance. Commits ------- e40dd66 [PsrHttpMessageBridge] Patch return types and fix CS 266c09f [PsrHttpMessageBridge] Import the bridge into the monorepo 0c0323a Add 'src/Symfony/Bridge/PsrHttpMessage/' from commit '581ca6067eb62640de5ff08ee1ba6850a0ee472e' 581ca60 Prepare release 2.3.1 45d0349 Fix CS 6410dda bug #122 Don't rely on Request::getPayload() to populate the parsed body (nicolas-grekas) ef03b6d Don't rely on Request::getPayload() to populate the parsed body 3c62b81 minor #120 Prepare release 2.3.0 (derrabus) 96acbfd Prepare release 2.3.0 7eedd34 feature #119 Implement ValueResolverInterface (derrabus) 0b54b85 Implement ValueResolverInterface 6b2f5df feature #117 Leverage `Request::getPayload()` to populate the parsed body of PSR-7 requests (AurelienPillevesse) 3a8caad Leverage `Request::getPayload()` to populate the parsed body of PSR-7 requests 18c9e82 minor #118 Add native types where possible (derrabus) 4fd4323 Add native types where possible 28a732c minor #115 Prepare the 2.2.0 release (derrabus) 7944831 cs fix 99ddcaa Prepare the 2.2.0 release 8a5748d feature #113 Bump psr/http-message version (erikn69) ec83c1c Bump psr/http-message version 694016e feature #114 Drop support for Symfony 4 (derrabus) b360b35 Drop support for Symfony 4 998d8d2 minor #111 Adjustments for PHP CS Fixer 3 (derrabus) 5fa5f62 Adjustments for PHP CS Fixer 3 a125b93 minor #110 Add PHP 8.2 to CI (derrabus) 4592df2 Add PHP 8.2 to CI 4617ac3 bug #109 perf: ensure timely flush stream buffers (cidosx) 8c8a75b perf: ensure timely flush stream buffers d444f85 Update changelog 155a7ae bug #107 Ignore invalid HTTP headers when creating PSR7 objects (nicolas-grekas) 9a78a16 Ignore invalid HTTP headers when creating PSR7 objects bdb2871 minor #104 Add missing .gitattributes (franmomu) 808561a Add missing .gitattributes 316f5cb bug #103 Fix for wrong type passed to moveTo() (lemon-juice) 7f3b5c1 Fix for wrong type passed to moveTo() 22b37c8 minor #101 Release v2.1.2 (chalasr) c382d76 Release v2.1.2 c81476c feature #100 Allow Symfony 6 (chalasr) c7a0be3 Allow Symfony 6 df83a38 minor #98 Add PHP 8.1 to CI (derrabus) b2bd334 Add PHP 8.1 to CI 824711c minor #99 Add return types to fixtures (derrabus) f8f70fa Add return types to fixtures d558dcd minor #97 Inline $tmpDir (derrabus) d152649 Inline $tmpDir f12a9e6 minor #96 Run PHPUnit on GitHub Actions (derrabus) ab64c69 Run PHPUnit on GitHub Actions c901299 bug #95 Allow `psr/log` 2 and 3 (derrabus) 8e13ae4 Allow psr/log 2 and 3 26068fa Minor cleanups 87fabb9 Fix copyright year 3d9241f minor #92 remove link to sensio extra bundle which removed psr7 support (Tobion) 7078739 remove link to sensio extra bundle which removed psr7 support 81db2d4 feature #89 PSR HTTP message converters for controllers (derrabus) aa26e61 PSR HTTP message converters for controllers e62b239 minor #91 Fix CS (derrabus) 2bead22 Fix CS 488df9b minor #90 Fix CI failures with Xdebug 3 and test on PHP 7.4/8.0 as well (derrabus) a6697fd Fix CI failures with Xdebug 3 and test on PHP 7.4/8.0 as well c62f7d0 Update branch-alias 51a21cb Update changelog a20fff9 bug #87 Fix populating server params from URI in HttpFoundationFactory (nicolas-grekas) 4933e04 bug #86 Create cookies as raw in HttpFoundationFactory (nicolas-grekas) 66095a5 Fix populating server params from URI in HttpFoundationFactory 42cca49 Create cookies as raw in HttpFoundationFactory cffb3a8 bug #85 Fix BinaryFileResponse with range to psr response conversion (iluuu1994) 5d5932d Fix BinaryFileResponse with range to psr response conversion e44f249 bug #81 Don't normalize query string in PsrHttpFactory (nicolas-grekas) bc25829 Don't normalize query string in PsrHttpFactory df735ec bug #78 Fix populating default port and headers in HttpFoundationFactory (mleczakm) 4f30401 Fix populating default port and headers in HttpFoundationFactory 1309b64 bug #77 fix conversion for https requests (4rthem) e86de3f minor #79 Allow installation on php 8 (derrabus) 9243f93 Allow installation on php 8. d336c73 fix conversion for https requests 126903c Fix format of CHANGELOG.md ce709cd feature #75 Remove deprecated code (fabpot) dfc5238 Remove deprecated code 9d3e80d bug #72 Use adapter for UploadedFile objects (nicolas-grekas) a4f9f6d Use adapter for UploadedFile objects ec7892b Fix CHANGELOG, bump branch-alias 7ab4fe4 minor #70 Updated CHANGELOG (rbaarsma) 9ad4bcc Updated CHANGELOG c4c904a minor #71 Cleanup after bump to Symfony v4.4 (nicolas-grekas) e9a9557 Cleanup after bump to Symfony v4.4 3d10a6c feature #66 Add support for streamed Symfony request (Ekman) df26630 Add support for streamed Symfony request 5aa8ca9 bug #69 Allow Symfony 5.0 (rbaarsma) 1158149 Allow Symfony 5.0 81ae86d Merge branch '1.1' a33352a bug #64 Fixed createResponse (ddegasperi) 7a4b449 minor #65 Fix tests (ajgarlag) 19905b0 Fix tests 580de38 Fixed createResponse 9ab9d71 minor #63 Added links to documentation (Nyholm) 59b9406 Added links to documentation c1cb51c feature #50 Add support for streamed response (danizord) 4133c7a bug #48 Convert Request/Response multiple times (Nyholm) 8564bf7 Convert Request/Response multiple times 7cc1605 Add support for streamed response aebc14b feature #62 bump to PHP 7.1 (nicolas-grekas) 8e10923 bump to PHP 7.1 5e5e0c3 Revert "Undeprecate DiactorosFactory for 1.1" 921f866 Undeprecate DiactorosFactory for 1.1 8592ca3 bug #61 removed 'Set-Cookie' from header when it is already converted to a Symfony header cookie (tinyroy) dd1111e removed 'Set-Cookie' from header when it is already converted to a Symfony header cookie ba672d8 bump branch-alias 5f9a032 typo f2c48c5 fix tests 3a52e44 bug #59 Fix SameSite attribute conversion from PSR7 to HttpFoundation (ajgarlag) 5ee1f8f Fix SameSite attribute conversion from PSR7 to HttpFoundation f6d7d3a bug #58 [Bugfix] Typo header set-sookie (grachevko) 16eb6e1 minor #57 Excluded tests from classmap (samnela) 36a8065 Deprecate DiactorosFactory, use nyholm/psr7 for tests 5076934 bug #54 Fix #51 (compatability issue with zendframework/zend-diactoros ^2.0) (uphlewis) 757ea81 [Bugfix] Typo header set-sookie 25f9c3a Excluded tests from classmap 8ff61e5 Fix compatability issue with "zendframework/zend-diactoros": "^2.0." (#51) 53c15a6 updated CHANGELOG c821241 bumped version to 1.1 f26d01f minor #47 Updated changelog (Nyholm) c2282e3 Updated changelog eddd6c8 feature #43 Create PSR-7 messages using PSR-17 factories (ajgarlag) dd81b4b Create PSR-7 messages using PSR-17 factories f11f173 feature #45 Fixed broken build (Nyholm) 8780dd3 Fixed broken build c2b7579 bug #30 Fix the request target in PSR7 Request (mtibben) 94fcfa5 Fix the request target in PSR7 Request 64640ee minor #38 Run PHP 5.3 tests on Precise (Lctrs) 64c0cb0 Run PHP 5.3 tests on Precise b209840 minor #32 Allow Symfony 4 (dunglas) 97635f1 Allow Symfony 4 147a238 minor #31 test suite compatibility with PHPUnit 6 (xabbuh) f5c46f0 test suite compatibility with PHPUnit 6 66085f2 preparing 1.0 release 533d3e4 added a CHANGELOG for 1.0 14269f9 bug #28 Fix REQUEST_METHOD on symfony request (csunol) 98ab85a Fix REQUEST_METHOD on symfony request 29be4f8 updated LICENCE year d2db47c removed obsolete CHANGELOG file 1c30b17 bug #22 Fixes #16 Symfony Request created without any URI (rougin) a59c572 Fixes #16 Symfony Request created without any URI 7a5aa92 bug #23 Fixes #9 Bridge error when no file is selected (ahundiak, Danielss89) a1a631a Update assert error message e5d62e6 Fixes based on code-review 101b608 Handles null file in createrequest bridge. d16c63c bug #18 Allow multiple calls to Request::getContent() (aimeos) 9624b8b Allow multiple calls to Request::getContent() 9c747c4 Merge pull request #19 from xabbuh/travis-config a388c43 update Travis CI configuration ac5cd86 minor #14 Remove use of deprecated 'deep' parameter in tests (KorvinSzanto) 305c0fe Remove use of deprecated 'deep' parameter 3664dc0 minor #7 Test Diactoros Factory with PHP 5.4 (dunglas) bab1530 Test Diactoros Factory with PHP 5.4 d7660b8 Suggest psr/http-message-implementation dc7e308 removed the branch alias for now as we are pre 1.0 3f8977e feature #1 Initial support (dunglas) ca41146 Initial support 01b110b added the initial set of files
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.