Permalink
Browse files

move charset/App.encoding into CakeResponse

  • Loading branch information...
dereuromark committed Sep 27, 2012
1 parent 76d21c6 commit b47e3a7d92d8b79ec69fd292165209d5d50748a3
View
@@ -94,4 +94,4 @@
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse());
@@ -98,5 +98,5 @@
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse(array('charset' => Configure::read('App.encoding')))
new CakeResponse()
);
@@ -177,7 +177,7 @@ public function __construct(ComponentCollection $collection, $settings = array()
if ($controller && isset($controller->response)) {
$this->_response = $controller->response;
} else {
$this->_response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
$this->_response = new CakeResponse();
}
}
@@ -146,7 +146,7 @@ protected function _getController($exception) {
if (!$request = Router::getRequest(true)) {
$request = new CakeRequest();
}
$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
$response = new CakeResponse();
if (method_exists($exception, 'responseHeader')) {
$response->header($exception->responseHeader());
@@ -384,9 +384,10 @@ public function __construct(array $options = array()) {
if (isset($options['type'])) {
$this->type($options['type']);
}
if (isset($options['charset'])) {
$this->charset($options['charset']);
if (!isset($options['charset'])) {
$options['charset'] = Configure::read('App.encoding');
}
$this->charset($options['charset']);
}
/**
@@ -7,7 +7,7 @@ protected function _getController($exception) {
if (!$request = Router::getRequest(true)) {
$request = new CakeRequest();
}
$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
$response = new CakeResponse();
try {
$controller = new TestAppsErrorController($request, $response);
$controller->layout = 'banana';
@@ -302,7 +302,7 @@ protected function _writeFile($content, $timestamp, $useCallbacks = false) {
$file .= '
$request = unserialize(base64_decode(\'' . base64_encode(serialize($this->request)) . '\'));
$response = new CakeResponse(array("charset" => Configure::read("App.encoding")));
$response = new CakeResponse();
$controller = new ' . $this->_View->name . 'Controller($request, $response);
$controller->plugin = $this->plugin = \'' . $this->_View->plugin . '\';
$controller->helpers = $this->helpers = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->helpers)) . '\'));
@@ -160,7 +160,7 @@ public function __construct(View $View, $settings = array()) {
if (is_object($this->_View->response)) {
$this->response = $this->_View->response;
} else {
$this->response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
$this->response = new CakeResponse();
}
if (!empty($settings['configFile'])) {
$this->loadConfig($settings['configFile']);
View
@@ -330,7 +330,7 @@ public function __construct(Controller $controller = null) {
if (is_object($controller) && isset($controller->response)) {
$this->response = $controller->response;
} else {
$this->response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
$this->response = new CakeResponse();
}
$this->Helpers = new HelperCollection($this);
$this->Blocks = new ViewBlock();

0 comments on commit b47e3a7

Please sign in to comment.