diff --git a/cake/libs/configure.php b/cake/libs/configure.php index d77a8e987..4c220fdab 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -403,10 +403,14 @@ class Configure extends Object { } Cache::config('default'); } - App::build(compact( - 'models', 'views', 'controllers', 'helpers', 'components', - 'behaviors', 'plugins', 'vendors', 'locales', 'shells' - )); + if (App::path('controllers') == array()) { + App::build(array( + 'models' => $modelPaths, 'views' => $viewPaths, 'controllers' => $controllerPaths, + 'helpers' => $helperPaths, 'components' => $componentPaths, 'behaviors' => $behaviorPaths, + 'plugins' => $pluginPaths, 'vendors' => $vendorPaths, 'locales' => $localePaths, + 'shells' => $shellPaths + )); + } } } /** @@ -1135,19 +1139,6 @@ class App extends Object { if ($paths = App::path($type .'s')) { return $paths; } - - switch ($type) { - case 'plugin': - return array(APP . 'plugins' . DS); - case 'vendor': - return array(APP . 'vendors' . DS, VENDORS, APP . 'plugins' . DS); - case 'controller': - return array(APP . 'controllers' . DS, APP); - case 'model': - return array(APP . 'models' . DS, APP); - case 'view': - return array(APP . 'views' . DS); - } } /** * Removes file location from map if the file has been deleted. diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index dc6e1357d..41bf616c9 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -130,13 +130,15 @@ class Debugger extends Object { define('E_DEPRECATED', 8192); } - $e = '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-trace\')'; + $e = '<pre class="cake-debug">'; + $e .= '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-trace\')'; $e .= '.style.display = (document.getElementById(\'{:id}-trace\').style.display == '; $e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} '; $e .= '[<b>{:path}</b>, line <b>{:line}</b>]'; $e .= '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">'; $e .= '{:links}{:info}</div>'; + $e .= '</pre>'; $this->_templates['js']['error'] = $e; $t = '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">'; @@ -164,7 +166,7 @@ class Debugger extends Object { $this->_templates['js']['code'] .= 'style="display: none;"><pre>{:code}</pre></div>'; - $e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} '; + $e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} '; $e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>'; $this->_templates['html']['error'] = $e; @@ -425,7 +427,7 @@ class Debugger extends Object { } elseif (strpos($path, ROOT) === 0) { return str_replace(ROOT, 'ROOT', $path); } - $corePaths = App::core('cake'); + $corePaths = Configure::corePaths('cake'); foreach ($corePaths as $corePath) { if (strpos($path, $corePath) === 0) { return str_replace($corePath, 'CORE' .DS . 'cake' .DS, $path); diff --git a/cake/tests/cases/libs/debugger.test.php b/cake/tests/cases/libs/debugger.test.php index 555ec2b34..9286b4667 100644 --- a/cake/tests/cases/libs/debugger.test.php +++ b/cake/tests/cases/libs/debugger.test.php @@ -93,8 +93,8 @@ class DebuggerTest extends CakeTestCase { $this->assertTrue(is_array($result)); $this->assertEqual(count($result), 4); - $expected = '<code><span style="color: #000000"><span style="color: #0000BB"><?php'; - $expected .= '</span></span></code>'; + $expected = '<code><span style="color: #000000"><?php'; + $expected .= '</span></code>'; $this->assertEqual($result[0], $expected); $return = Debugger::excerpt('[internal]', 2, 2); @@ -141,15 +141,16 @@ class DebuggerTest extends CakeTestCase { $buzz .= ''; $result = explode('</a>', ob_get_clean()); $this->assertTags($result[0], array( + 'pre' => array('class' => 'cake-debug'), 'a' => array( 'href' => "javascript:void(0);", 'onclick' => "document.getElementById('cakeErr4-trace').style.display = " . "(document.getElementById('cakeErr4-trace').style.display == 'none'" . " ? '' : 'none');" ), - 'b' => array(), 'Notice', '/b', ' (8)' + 'b' => array(), 'Notice', '/b', ' (8)', )); - + $this->assertPattern('/Undefined variable: buzz/', $result[1]); $this->assertPattern('/<a[^>]+>Code/', $result[1]); $this->assertPattern('/<a[^>]+>Context/', $result[2]);