Skip to content
Permalink
Browse files

updating configure and debugger

  • Loading branch information...
gwoo
gwoo committed Jul 25, 2009
1 parent 986af28 commit 1924eb9dde4190b99519a21dbdfd24e5b7fe3d0b
Showing with 18 additions and 24 deletions.
  1. +8 −17 cake/libs/configure.php
  2. +5 −3 cake/libs/debugger.php
  3. +5 −4 cake/tests/cases/libs/debugger.test.php
@@ -403,10 +403,14 @@ function __loadBootstrap($boot) {
}
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 @@ function __paths($type) {
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.
@@ -130,13 +130,15 @@ function __construct() {
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 @@ function __construct() {
$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 @@ function trimPath($path) {
} 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);
@@ -93,8 +93,8 @@ function testExcerpt() {
$this->assertTrue(is_array($result));
$this->assertEqual(count($result), 4);
$expected = '<code><span style="color: #000000"><span style="color: #0000BB">&lt;?php';
$expected .= '</span></span></code>';
$expected = '<code><span style="color: #000000">&lt;?php';
$expected .= '</span></code>';
$this->assertEqual($result[0], $expected);
$return = Debugger::excerpt('[internal]', 2, 2);
@@ -141,15 +141,16 @@ function testOutput() {
$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]);

0 comments on commit 1924eb9

Please sign in to comment.
You can’t perform that action at this time.