php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67628 Yaf_Response_Http->setHeader() not working
Submitted: 2014-07-16 10:12 UTC Modified: 2014-07-16 13:10 UTC
From: chazmead89 at gmail dot com Assigned:
Status: Closed Package: yaf (PECL)
PHP Version: 5.4.30 OS: Mac OSX - Maverick
Private report: No CVE-ID: None
 [2014-07-16 10:12 UTC] chazmead89 at gmail dot com
Description:
------------
Trying to set response headers using the Yaf_Response_Http->setHeader() does not set the header on the object.


Currently using yaf 2.9.9 -> a previous bug report states that this should have been fixed in 2.2?!

Test script:
---------------
class HomeController extends Yaf_Controller_Abstract {
  public function indexAction() {
    $response = $this->getResponse();
    $response->setHeader('Content-Type', 'text/html; charset=utf-8');
    $response->setBody('hello world');
    die('<pre>' . print_r($response, true) . '</pre>');
}

Expected result:
----------------
Yaf_Response_Http Object
(
    [_header:protected] => Array
        (
            [Content-Type] => text/html; charset=utf-8
        )

    [_body:protected] => Array
        (
            [content] => hello world
        )

    [_sendheader:protected] => 1
    [_response_code:protected] => 200
)

Actual result:
--------------
Yaf_Response_Http Object
(
    [_header:protected] => Array
        (
        )

    [_body:protected] => Array
        (
            [content] => hello world
        )

    [_sendheader:protected] => 1
    [_response_code:protected] => 200
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-16 10:23 UTC] chazmead89 at gmail dot com
This seems to only effect php 5.4.30 - After install 5.6.0RC2 this is fixed.. havn't tried other versions between these 2.
 [2014-07-16 10:54 UTC] chazmead89 at gmail dot com
Tested in PHP 5.5.12 and works Fine..

However as Debian uses 5.4 - which is probably the most comment Linux Distro, this should really be working in 5.4, otherwise the framework is fundamentally broken.

Thanks.
 [2014-07-16 10:59 UTC] chazmead89 at gmail dot com
Update to previous comment!! sorry for mass comments! lol.

5.5.12 is also broken, although the header gets set on the object, it does not seem to send the header to the browser.
 [2014-07-16 11:03 UTC] chazmead89 at gmail dot com
Previous comment is also true for 5.6.0RC2  =.=
 [2014-07-16 13:10 UTC] chazmead89 at gmail dot com
-Status: Open +Status: Closed
 [2014-07-16 13:10 UTC] chazmead89 at gmail dot com
Sorry this bug is all wrong.. some incorrect tests.  I had 2.2.9 compiled against php 5.4.30, and I now see that the patch was added as of 2.3.2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 13:01:30 2024 UTC