|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61552 Yaf_Reponse_Abstract->setHeader() does nothing
Submitted: 2012-03-29 13:46 UTC Modified: 2020-01-27 15:07 UTC
Avg. Score:3.0 ± 2.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: sachin dot nigam at netzero dot net Assigned: cmb (profile)
Status: Closed Package: yaf (PECL)
PHP Version: 5.3.10 OS: Ubuntu Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sachin dot nigam at netzero dot net
New email:
PHP Version: OS:


 [2012-03-29 13:46 UTC] sachin dot nigam at netzero dot net
setHeader() function in Yaf_Response_Abstract is not implemented, I had to change the function to get it to work:

PHP_METHOD(yaf_response, setHeader) {
	char *name,*value;
	uint name_len,value_len = 0;
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &name, &name_len,&value, &value_len) == FAILURE) {
	sapi_header_line ctr = {0};

	ctr.line_len 		= spprintf(&(ctr.line), 0, "%s: %s", name, value);
	ctr.response_code 	= 0;
	if (sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC) == SUCCESS) {

Test script:
class TestController extends Yaf_Controller_Abstract
public function indexAction(){

Expected result:
http header should be set when setHeader() is called.

Actual result:
See above - patch included as part of description.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-02 04:27 UTC]
actually, this should implement in yaf_response_http(and other header functions), 
and for now, I am working on yaf 2.2, 

so, it will be implemented in 2.2 , thanks :)
 [2012-04-03 05:12 UTC] sachin dot nigam at netzero dot net
Yes, it should be in Yaf_Response_Http :). If my method looks fine, I don't mind adding it as a patch, thanks. Good luck with 2.2 :).
 [2012-04-22 05:30 UTC]
-Assigned To: +Assigned To: laruence
 [2017-10-24 07:58 UTC]
-Status: Assigned +Status: Open -Assigned To: laruence +Assigned To:
 [2020-01-27 15:07 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-01-27 15:07 UTC]
This has already been fixed long ago.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 07 13:01:24 2020 UTC