mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
8ce605ab88
commit
4f29f58a5e
2 changed files with 26 additions and 25 deletions
|
@ -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';
|
||||
|
|
|
@ -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 { }
|
||||
|
||||
|
|
Loading…
Reference in a new issue