move charset/App.encoding into CakeResponse

This commit is contained in:
euromark 2012-09-27 20:28:19 +02:00
parent 76d21c6d56
commit b47e3a7d92
9 changed files with 11 additions and 10 deletions

View file

@ -94,4 +94,4 @@ if (!empty($failed)) {
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());

View file

@ -98,5 +98,5 @@ App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse(array('charset' => Configure::read('App.encoding')))
new CakeResponse()
);

View file

@ -177,7 +177,7 @@ class CookieComponent extends Component {
if ($controller && isset($controller->response)) {
$this->_response = $controller->response;
} else {
$this->_response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
$this->_response = new CakeResponse();
}
}

View file

@ -146,7 +146,7 @@ class ExceptionRenderer {
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());

View file

@ -384,9 +384,10 @@ class CakeResponse {
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']);
}
/**

View file

@ -7,7 +7,7 @@ class TestAppsExceptionRenderer extends ExceptionRenderer {
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';

View file

@ -302,7 +302,7 @@ class CacheHelper extends AppHelper {
$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)) . '\'));

View file

@ -160,7 +160,7 @@ class HtmlHelper extends AppHelper {
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 file

@ -330,7 +330,7 @@ class View extends Object {
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();