Added get_header method to Output class. #645

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
5 participants
@garthkerr
Contributor

garthkerr commented Nov 3, 2011

No description provided.

@garthkerr

This comment has been minimized.

Show comment Hide comment
@garthkerr

garthkerr Nov 3, 2011

Contributor

I have a hook that overrides the final output. The hook needs to check if the Content-Type header has been sent. There was no way to access header information that had already been sent via:

$this->output->set_header();

The method will send back headers set by the Output class, or using the traditional header() function.

Contributor

garthkerr commented Nov 3, 2011

I have a hook that overrides the final output. The hook needs to check if the Content-Type header has been sent. There was no way to access header information that had already been sent via:

$this->output->set_header();

The method will send back headers set by the Output class, or using the traditional header() function.

@timw4mail

This comment has been minimized.

Show comment Hide comment
@timw4mail

timw4mail Nov 3, 2011

Contributor

Seems like an excellent addition to me.

Contributor

timw4mail commented Nov 3, 2011

Seems like an excellent addition to me.

@mpmont

This comment has been minimized.

Show comment Hide comment
@mpmont

mpmont Nov 8, 2011

Contributor

Loved it! even yesterday I was making a rss feed and this would be of great help to me :P

Contributor

mpmont commented Nov 8, 2011

Loved it! even yesterday I was making a rss feed and this would be of great help to me :P

@garthkerr

This comment has been minimized.

Show comment Hide comment
@garthkerr

garthkerr Dec 14, 2011

Contributor

Any traction on this? or should it be closed?

Contributor

garthkerr commented Dec 14, 2011

Any traction on this? or should it be closed?

@petsagouris

This comment has been minimized.

Show comment Hide comment
@petsagouris

petsagouris Apr 26, 2012

Contributor

@garthkerr this misses a changelog entry and user guide documentation.

Contributor

petsagouris commented Apr 26, 2012

@garthkerr this misses a changelog entry and user guide documentation.

@garthkerr

This comment has been minimized.

Show comment Hide comment
@garthkerr

garthkerr Apr 27, 2012

Contributor

@petsagouris I have added the documentation and changelog.

Contributor

garthkerr commented Apr 27, 2012

@petsagouris I have added the documentation and changelog.

@petsagouris

This comment has been minimized.

Show comment Hide comment
@petsagouris

petsagouris Apr 27, 2012

Contributor

@garthkerr thanks, a repo collaborator should review this now ;) //cc @narfbg

Contributor

petsagouris commented Apr 27, 2012

@garthkerr thanks, a repo collaborator should review this now ;) //cc @narfbg

@narfbg

View changes

system/core/Output.php
+ * For an individual header, the value is returned. For an array
+ * of headers, a key-value array is returned.
+ *
+ * @access public

This comment has been minimized.

Show comment Hide comment
@narfbg

narfbg Apr 27, 2012

Contributor

This should be removed.

@narfbg

narfbg Apr 27, 2012

Contributor

This should be removed.

@narfbg

View changes

system/core/Output.php
+ *
+ * @access public
+ * @param string
+ * @return array|bool

This comment has been minimized.

Show comment Hide comment
@narfbg

narfbg Apr 27, 2012

Contributor

Just 'array'.

@narfbg

narfbg Apr 27, 2012

Contributor

Just 'array'.

@narfbg

View changes

system/core/Output.php
+ }
+ }
+
+ if ( ! empty($headers) AND empty($header))

This comment has been minimized.

Show comment Hide comment
@narfbg

narfbg Apr 27, 2012

Contributor

AND -> &&

@narfbg

narfbg Apr 27, 2012

Contributor

AND -> &&

@garthkerr

This comment has been minimized.

Show comment Hide comment
@garthkerr

garthkerr Jun 14, 2012

Contributor

Bump?

Contributor

garthkerr commented Jun 14, 2012

Bump?

+ $value = trim($header_array[1]);
+
+ // Add new or replace existing when specified
+ if ( ! isset($headers[$field]) || $output_header[1])

This comment has been minimized.

Show comment Hide comment
@narfbg

narfbg Jun 15, 2012

Contributor

|| must be changed to OR, as per the style guide.

@narfbg

narfbg Jun 15, 2012

Contributor

|| must be changed to OR, as per the style guide.

@narfbg

This comment has been minimized.

Show comment Hide comment
@narfbg

narfbg Jun 15, 2012

Contributor

You'll also need to sync with the repo as it's currently in conflict.

Poke me after you're done as commits don't issue notifications, so I didn't see the previous one as well.

Contributor

narfbg commented Jun 15, 2012

You'll also need to sync with the repo as it's currently in conflict.

Poke me after you're done as commits don't issue notifications, so I didn't see the previous one as well.

narfbg added a commit that referenced this pull request Nov 29, 2012

Added CI_Output::get_header()
(an improved version of PR #645)

Also fixed get_content_type() to only return the MIME value and created
Output library unit tests for both of these methods.
@narfbg

This comment has been minimized.

Show comment Hide comment
@narfbg

narfbg Nov 29, 2012

Contributor

See the above commit.

Contributor

narfbg commented Nov 29, 2012

See the above commit.

@narfbg narfbg closed this Nov 29, 2012

nonchip pushed a commit to nonchip/CodeIgniter that referenced this pull request Jun 29, 2013

Added CI_Output::get_header()
(an improved version of PR #645)

Also fixed get_content_type() to only return the MIME value and created
Output library unit tests for both of these methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment