Merge branch 'saas-dev-publishing' of github.com:sourcefabric/airtime into saas-dev-publishing
This commit is contained in:
commit
0d585e30db
2 changed files with 41 additions and 3 deletions
|
@ -15,8 +15,45 @@ class FeedsController extends Zend_Controller_Action
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-Type: text/xml; charset=UTF-8');
|
|
||||||
|
|
||||||
echo Application_Service_PodcastService::createStationRssFeed();
|
$rssData = Application_Service_PodcastService::createStationRssFeed();
|
||||||
|
|
||||||
|
$mimeType = "text/xml";
|
||||||
|
header("Content-Type: $mimeType; charset=UTF-8");
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_RANGE'])) {
|
||||||
|
header('HTTP/1.1 206 Partial Content');
|
||||||
|
} else {
|
||||||
|
header('HTTP/1.1 200 OK');
|
||||||
|
}
|
||||||
|
header("Content-Type: $mimeType");
|
||||||
|
header("Content-Transfer-Encoding: binary");
|
||||||
|
header('Cache-Control: public, must-revalidate, max-age=0');
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
header('Accept-Ranges: bytes');
|
||||||
|
$size = strlen($rssData);
|
||||||
|
|
||||||
|
$begin = 0;
|
||||||
|
$end = $size - 1;
|
||||||
|
|
||||||
|
//ob_start(); //Must start a buffer here for these header() functions
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_RANGE'])) {
|
||||||
|
if (preg_match('/bytes=\h*(\d+)-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {
|
||||||
|
$begin = intval($matches[1]);
|
||||||
|
if (!empty($matches[2])) {
|
||||||
|
$end = intval($matches[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($size > 0) {
|
||||||
|
header('Content-Length:' . (($end - $begin) + 1));
|
||||||
|
if (isset($_SERVER['HTTP_RANGE'])) {
|
||||||
|
header("Content-Range: bytes $begin-$end/$size");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $rssData;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -36,7 +36,8 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
|
||||||
"upgrade",
|
"upgrade",
|
||||||
'whmcs-login',
|
'whmcs-login',
|
||||||
"provisioning",
|
"provisioning",
|
||||||
"embed"
|
"embed",
|
||||||
|
"feeds"
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
//Start the session
|
//Start the session
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue