correct path to tmp and core.php file when running outside your app dir.

also wrapped HttpException class declaraion in an if !class_exists test
- the class exists in the pecl http extension.
This commit is contained in:
AD7six 2011-03-16 12:13:47 +01:00
parent 8ce605ab88
commit 4f29f58a5e
2 changed files with 26 additions and 25 deletions

View file

@ -127,14 +127,14 @@ class ShellDispatcher {
define('APP_PATH', $this->params['working'] . DS);
define('WWW_ROOT', APP_PATH . $this->params['webroot'] . DS);
if (!is_dir(ROOT . DS . APP_DIR . DS . 'tmp')) {
define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'tmp' . DS);
define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'templates' . DS . 'skel' . DS . 'tmp' . DS);
}
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
require CORE_PATH . 'Cake' . DS . 'bootstrap.php';
if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
include_once CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
App::build();
}
require_once CONSOLE_LIBS . 'ConsoleErrorHandler.php';

View file

@ -25,7 +25,9 @@
*
* @package cake.libs
*/
if (!class_exists('HttpException')) {
class HttpException extends RuntimeException { }
}
/**
* Represents an HTTP 400 error.
@ -479,4 +481,3 @@ class XmlException extends CakeException { }
* @package cake.libs
*/
class ConsoleException extends CakeException { }