From 24d8878ab668a07ce5c6b30b76e9f96ce0267f8d Mon Sep 17 00:00:00 2001 From: the_undefined Date: Tue, 13 May 2008 05:23:57 +0000 Subject: [PATCH] Added CAKEPHP_SHELL constant to shell dispatcher making it easy to recognize when in shell mode Fixed #4599 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6834 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/console/cake.php | 1 + cake/libs/controller/components/request_handler.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 09e70f2c4..74c66cbc0 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -150,6 +150,7 @@ class ShellDispatcher { define('CAKE_CORE_INCLUDE_PATH', dirname(dirname(dirname(__FILE__)))); define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); define('DISABLE_DEFAULT_ERROR_HANDLING', false); + define('CAKEPHP_SHELL', true); } /** * Defines current working environment. diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index cfc896d5d..77d1c7d1e 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -633,7 +633,7 @@ class RequestHandlerComponent extends Object { if (!empty($options['attachment'])) { header('Content-Disposition: attachment; filename="' . $options['attachment'] . '"'); } - if (Configure::read() < 2) { + if (Configure::read() < 2 && !defined('CAKEPHP_SHELL')) { header($header); foreach ($headers as $h) { header($h);