updating configure and debugger

This commit is contained in:
gwoo 2009-07-25 10:27:17 -07:00
parent 986af28de0
commit 1924eb9dde
3 changed files with 18 additions and 24 deletions

View file

@ -403,10 +403,14 @@ class Configure extends Object {
} }
Cache::config('default'); Cache::config('default');
} }
App::build(compact( if (App::path('controllers') == array()) {
'models', 'views', 'controllers', 'helpers', 'components', App::build(array(
'behaviors', 'plugins', 'vendors', 'locales', 'shells' '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')) { if ($paths = App::path($type .'s')) {
return $paths; 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. * Removes file location from map if the file has been deleted.

View file

@ -130,13 +130,15 @@ class Debugger extends Object {
define('E_DEPRECATED', 8192); 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 .= '.style.display = (document.getElementById(\'{:id}-trace\').style.display == ';
$e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} '; $e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} ';
$e .= '[<b>{:path}</b>, line <b>{:line}</b>]'; $e .= '[<b>{:path}</b>, line <b>{:line}</b>]';
$e .= '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">'; $e .= '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">';
$e .= '{:links}{:info}</div>'; $e .= '{:links}{:info}</div>';
$e .= '</pre>';
$this->_templates['js']['error'] = $e; $this->_templates['js']['error'] = $e;
$t = '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">'; $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>'; $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>'; $e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>';
$this->_templates['html']['error'] = $e; $this->_templates['html']['error'] = $e;
@ -425,7 +427,7 @@ class Debugger extends Object {
} elseif (strpos($path, ROOT) === 0) { } elseif (strpos($path, ROOT) === 0) {
return str_replace(ROOT, 'ROOT', $path); return str_replace(ROOT, 'ROOT', $path);
} }
$corePaths = App::core('cake'); $corePaths = Configure::corePaths('cake');
foreach ($corePaths as $corePath) { foreach ($corePaths as $corePath) {
if (strpos($path, $corePath) === 0) { if (strpos($path, $corePath) === 0) {
return str_replace($corePath, 'CORE' .DS . 'cake' .DS, $path); return str_replace($corePath, 'CORE' .DS . 'cake' .DS, $path);

View file

@ -93,8 +93,8 @@ class DebuggerTest extends CakeTestCase {
$this->assertTrue(is_array($result)); $this->assertTrue(is_array($result));
$this->assertEqual(count($result), 4); $this->assertEqual(count($result), 4);
$expected = '<code><span style="color: #000000"><span style="color: #0000BB">&lt;?php'; $expected = '<code><span style="color: #000000">&lt;?php';
$expected .= '</span></span></code>'; $expected .= '</span></code>';
$this->assertEqual($result[0], $expected); $this->assertEqual($result[0], $expected);
$return = Debugger::excerpt('[internal]', 2, 2); $return = Debugger::excerpt('[internal]', 2, 2);
@ -141,15 +141,16 @@ class DebuggerTest extends CakeTestCase {
$buzz .= ''; $buzz .= '';
$result = explode('</a>', ob_get_clean()); $result = explode('</a>', ob_get_clean());
$this->assertTags($result[0], array( $this->assertTags($result[0], array(
'pre' => array('class' => 'cake-debug'),
'a' => array( 'a' => array(
'href' => "javascript:void(0);", 'href' => "javascript:void(0);",
'onclick' => "document.getElementById('cakeErr4-trace').style.display = " . 'onclick' => "document.getElementById('cakeErr4-trace').style.display = " .
"(document.getElementById('cakeErr4-trace').style.display == 'none'" . "(document.getElementById('cakeErr4-trace').style.display == 'none'" .
" ? '' : 'none');" " ? '' : 'none');"
), ),
'b' => array(), 'Notice', '/b', ' (8)' 'b' => array(), 'Notice', '/b', ' (8)',
)); ));
$this->assertPattern('/Undefined variable: buzz/', $result[1]); $this->assertPattern('/Undefined variable: buzz/', $result[1]);
$this->assertPattern('/<a[^>]+>Code/', $result[1]); $this->assertPattern('/<a[^>]+>Code/', $result[1]);
$this->assertPattern('/<a[^>]+>Context/', $result[2]); $this->assertPattern('/<a[^>]+>Context/', $result[2]);