Development

#4746 ([PATCH] sfRequest::getContent() and sfWebRequest::getContentType())

You must first sign up to be able to contribute.

Ticket #4746 (closed enhancement: fixed)

Opened 5 years ago

Last modified 4 years ago

[PATCH] sfRequest::getContent() and sfWebRequest::getContentType()

Reported by: Kris.Wallsmith Assigned to: fabien
Priority: minor Milestone: 1.3.0 alpha1
Component: other Version: 1.2.0 DEV
Keywords: Cc:
Qualification: Unreviewed

Description

I've attached a patch for review. This patch adds the following method to the request classes:

  • sfRequest::getContent()
  • sfWebRequest::getContentType($trim = true)

Having access to these values will enable symfony to parse parameters from POST and PUT requests with content types other than the standard urlencoded query string.

Furthermore, the standard method for returning the request content, file_get_contents('php://input'), returns NULL if the stream has already been read. Having this stream read in the core will make it easy for plugins to reliably access this data.

One thing I'm not clear on is how this will affect functional testing. A sfWebRequestTest class will probably have to be created that includes a ->setContent() method, which sfBrowser would then have access to.

Attachments

sfRequest-getContent-getContentType.diff (1.7 kB) - added by Kris.Wallsmith on 10/25/08 17:07:10.

Change History

10/25/08 17:07:10 changed by Kris.Wallsmith

  • attachment sfRequest-getContent-getContentType.diff added.

11/24/08 15:38:16 changed by FabianLange

  • milestone set to 1.3.0.

01/11/09 09:29:00 changed by dwhittle

  • status changed from new to closed.
  • resolution set to fixed.

(In [14593]) 1.3: added accessor for request content (fixes #4746 - patch from kris.wallsmith)

01/12/09 10:16:25 changed by dwhittle

See r14634 in dwhittle branch.

01/14/09 10:37:35 changed by dwhittle

(In [14699]) 1.3: added parsing of request content as put parameters (closes #5268, #4746)

09/26/09 14:42:14 changed by fabien

(In [22451]) [doc] [1.3] documented enhancements in REST support (refs #5676, #5268, #4746)

09/26/09 14:42:16 changed by fabien

(In [22452]) [1.3] fixed PUT and DELETE parameters (closes #5676, refs #5268, #4746)