Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'macnibblet/hotfix/feed-strategy'
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDotPro committed Jul 4, 2012
2 parents d71b9ff + c8d0e3a commit f8e8120
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
16 changes: 13 additions & 3 deletions library/Zend/View/Model/FeedModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ class FeedModel extends ViewModel
*/
protected $type = false;

/**
* A feed is always terminal
*
* @var bool
*/
protected $terminate = true;

/**
* @return \Zend\Feed\Writer\Feed
*/
public function getFeed()
{
if ($this->feed instanceof Feed) {
Expand All @@ -67,8 +77,8 @@ public function getFeed()

/**
* Set the feed object
*
* @param Feed $feed
*
* @param Feed $feed
* @return FeedModel
*/
public function setFeed(Feed $feed)
Expand All @@ -79,7 +89,7 @@ public function setFeed(Feed $feed)

/**
* Get the feed type
*
*
* @return false|string
*/
public function getFeedType()
Expand Down
12 changes: 11 additions & 1 deletion library/Zend/View/Strategy/FeedStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,20 @@ public function injectResponse(ViewEvent $e)
? 'application/rss+xml'
: 'application/atom+xml';

$model = $e->getModel();
$charset = '';

if ($model instanceof Model\FeedModel) {

$feed = $model->getFeed();

$charset = '; charset=' . $feed->getEncoding() . ';';
}

// Populate response
$response = $e->getResponse();
$response->setContent($result);
$headers = $response->getHeaders();
$headers->addHeaderLine('content-type', $feedType);
$headers->addHeaderLine('content-type', $feedType . $charset);
}
}
3 changes: 2 additions & 1 deletion tests/Zend/Search/Lucene/_files/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*
*.sti
*.lock*

0 comments on commit f8e8120

Please sign in to comment.