php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74094 Too strict checks when using CLI SAPI
Submitted: 2017-02-13 18:01 UTC Modified: 2021-03-19 18:40 UTC
From: yunosh@php.net Assigned:
Status: Suspended Package: Session related
PHP Version: master-Git-2017-02-13 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yunosh@php.net
New email:
PHP Version: OS:

 

 [2017-02-13 18:01 UTC] yunosh@php.net
Description:
------------
When using the CLI SAPI, it doesn't make sense to implement the same strict HTTP header checks like in webserver SAPIs IMO. There are no headers sent in this case, so the error messages are at least misleading.
As a consequence, it makes unit testing of session related code impossible, because unit testing frameworks usually produce output before even running a single test.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-13 18:04 UTC] yunosh@php.net
This can be seen in real life here: https://travis-ci.org/horde/horde/jobs/201207489#L1860
 [2017-02-21 10:44 UTC] yunosh@php.net
I wonder if SG(request_info).no_headers should be set to 1 in the CLI SAPI.
 [2021-03-19 18:40 UTC] cmb@php.net
-Status: Open +Status: Suspended -Type: Bug +Type: Feature/Change Request
 [2021-03-19 18:40 UTC] cmb@php.net
> When using the CLI SAPI, it doesn't make sense to implement the
> same strict HTTP header checks like in webserver SAPIs IMO.

Well, what about the built-in Webserver?

> As a consequence, it makes unit testing of session related code
> impossible, because unit testing frameworks usually produce output
> before even running a single test.

What about stubbing/mocking the functions?

Anyhow, I don't regard the current behavior as a bug, and any
possible change would require discussion on the internals mailing
list.  If you're still interested in this change, please pursue
the RFC process[1].  For the time being, I suspend this ticket.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 22:01:32 2024 UTC