[Corona] adding caching for get_raw_data

Review Request #418 — Created Feb. 17, 2016 and submitted

smillernl
Lunr
personal/sean/cache_parse_raw
a03cd5e...
lunr
Corona: adding caching for get_raw_data


  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
tardypad
  1. 
      
  2. src/Lunr/Corona/Request.php (Diff revision 1)
     
     
     
     
     
     
     

    I think the result should be cached every time whatever it is
    maybe only unless parse_raw_data failed (which should be when its result is FALSE AFAICS)

    1. parse_raw_data returns an empty string because it doesn't fail, stdin is just empty.

    2. I'd rather not have the parser read repeatedly. It's not meant to be used interactively, so forcing it to be one-off would be better IMHO.

  3. src/Lunr/Corona/Tests/RequestGetTest.php (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     

    I don't understand this
    parse_raw_data can't return different consecutive things for a same request/object, no?

    1. If you call something that calls get_raw_data multiple times it'd read stdin multiple times, clearing it after the first one.

    2. While theoretically you can have an application read multiple times from stdin, the usual usecase for this would be a cli application asking for user input. And the request parser is not meant for such a use-case.
      So stdin in the parser context is input coming from either the (web) request body, or the (cli) pipe.

  4. 
      
smillernl
tardypad
  1. Ship It!
  2. 
      
pprkut
  1. Ship It!
  2. 
      
smillernl
Review request changed

Status: Closed (submitted)

Change Summary:

Merged into master

Loading...