Skip to content
Permalink
Browse files

Cleaning up the MediaView class

  • Loading branch information...
lorenzo committed Oct 4, 2010
1 parent a611fd0 commit 018def81f4d7b9c71c0649d839d01375c45906ab
Showing with 12 additions and 4 deletions.
  1. +12 −4 cake/libs/view/media.php
@@ -25,14 +25,22 @@ class MediaView extends View {
*
* @var boolean
*/
private $compressionEnabled = false;
protected $_compressionEnabled = false;
/**
* Reference to the Response object responsible for sending the headers
*
* @var CakeResponse
*/
public $response = null;
/**
* Constructor
*
* @param object $controller
*/
function __construct(&$controller) {
function __construct($controller = null) {
parent::__construct($controller);
if (is_object($controller) && isset($controller->response)) {
$this->response = $controller->response;
@@ -142,7 +150,7 @@ function render() {
}
$this->_clearBuffer();
if ($compress) {
$this->compressionEnabled = $this->response->compress();
$this->_compressionEnabled = $this->response->compress();
}
$this->response->send();
@@ -163,7 +171,7 @@ protected function _sendFile($handle) {
set_time_limit(0);
$buffer = fread($handle, $chunkSize);
echo $buffer;
if (!$this->compressionEnabled) {
if (!$this->_compressionEnabled) {
$this->_flushBuffer();
}
}

0 comments on commit 018def8

Please sign in to comment.
You can’t perform that action at this time.