Skip to content
This repository
Browse code

move charset/App.encoding into CakeResponse

  • Loading branch information...
commit b47e3a7d92d8b79ec69fd292165209d5d50748a3 1 parent 76d21c6
Mark authored September 27, 2012
2  app/webroot/index.php
@@ -94,4 +94,4 @@
94 94
 App::uses('Dispatcher', 'Routing');
95 95
 
96 96
 $Dispatcher = new Dispatcher();
97  
-$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
  97
+$Dispatcher->dispatch(new CakeRequest(), new CakeResponse());
2  lib/Cake/Console/Templates/skel/webroot/index.php
@@ -98,5 +98,5 @@
98 98
 $Dispatcher = new Dispatcher();
99 99
 $Dispatcher->dispatch(
100 100
 	new CakeRequest(),
101  
-	new CakeResponse(array('charset' => Configure::read('App.encoding')))
  101
+	new CakeResponse()
102 102
 );
2  lib/Cake/Controller/Component/CookieComponent.php
@@ -177,7 +177,7 @@ public function __construct(ComponentCollection $collection, $settings = array()
177 177
 		if ($controller && isset($controller->response)) {
178 178
 			$this->_response = $controller->response;
179 179
 		} else {
180  
-			$this->_response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
  180
+			$this->_response = new CakeResponse();
181 181
 		}
182 182
 	}
183 183
 
2  lib/Cake/Error/ExceptionRenderer.php
@@ -146,7 +146,7 @@ protected function _getController($exception) {
146 146
 		if (!$request = Router::getRequest(true)) {
147 147
 			$request = new CakeRequest();
148 148
 		}
149  
-		$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
  149
+		$response = new CakeResponse();
150 150
 
151 151
 		if (method_exists($exception, 'responseHeader')) {
152 152
 			$response->header($exception->responseHeader());
5  lib/Cake/Network/CakeResponse.php
@@ -384,9 +384,10 @@ public function __construct(array $options = array()) {
384 384
 		if (isset($options['type'])) {
385 385
 			$this->type($options['type']);
386 386
 		}
387  
-		if (isset($options['charset'])) {
388  
-			$this->charset($options['charset']);
  387
+		if (!isset($options['charset'])) {
  388
+			$options['charset'] = Configure::read('App.encoding');
389 389
 		}
  390
+		$this->charset($options['charset']);
390 391
 	}
391 392
 
392 393
 /**
2  lib/Cake/Test/test_app/Error/TestAppsExceptionRenderer.php
@@ -7,7 +7,7 @@ protected function _getController($exception) {
7 7
 		if (!$request = Router::getRequest(true)) {
8 8
 			$request = new CakeRequest();
9 9
 		}
10  
-		$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
  10
+		$response = new CakeResponse();
11 11
 		try {
12 12
 			$controller = new TestAppsErrorController($request, $response);
13 13
 			$controller->layout = 'banana';
2  lib/Cake/View/Helper/CacheHelper.php
@@ -302,7 +302,7 @@ protected function _writeFile($content, $timestamp, $useCallbacks = false) {
302 302
 
303 303
 		$file .= '
304 304
 				$request = unserialize(base64_decode(\'' . base64_encode(serialize($this->request)) . '\'));
305  
-				$response = new CakeResponse(array("charset" => Configure::read("App.encoding")));
  305
+				$response = new CakeResponse();
306 306
 				$controller = new ' . $this->_View->name . 'Controller($request, $response);
307 307
 				$controller->plugin = $this->plugin = \'' . $this->_View->plugin . '\';
308 308
 				$controller->helpers = $this->helpers = unserialize(base64_decode(\'' . base64_encode(serialize($this->_View->helpers)) . '\'));
2  lib/Cake/View/Helper/HtmlHelper.php
@@ -160,7 +160,7 @@ public function __construct(View $View, $settings = array()) {
160 160
 		if (is_object($this->_View->response)) {
161 161
 			$this->response = $this->_View->response;
162 162
 		} else {
163  
-			$this->response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
  163
+			$this->response = new CakeResponse();
164 164
 		}
165 165
 		if (!empty($settings['configFile'])) {
166 166
 			$this->loadConfig($settings['configFile']);
2  lib/Cake/View/View.php
@@ -330,7 +330,7 @@ public function __construct(Controller $controller = null) {
330 330
 		if (is_object($controller) && isset($controller->response)) {
331 331
 			$this->response = $controller->response;
332 332
 		} else {
333  
-			$this->response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
  333
+			$this->response = new CakeResponse();
334 334
 		}
335 335
 		$this->Helpers = new HelperCollection($this);
336 336
 		$this->Blocks = new ViewBlock();

0 notes on commit b47e3a7

Please sign in to comment.
Something went wrong with that request. Please try again.