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
This commit is contained in:
the_undefined 2008-05-13 05:23:57 +00:00
parent 52ec5467c6
commit 24d8878ab6
2 changed files with 2 additions and 1 deletions

View file

@ -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.

View file

@ -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);