mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
updating configure and debugger
This commit is contained in:
parent
986af28de0
commit
1924eb9dde
3 changed files with 18 additions and 24 deletions
|
@ -403,12 +403,16 @@ 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
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Caches the object map when the instance of the Configure class is destroyed
|
||||
*
|
||||
|
@ -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.
|
||||
|
|
|
@ -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;">';
|
||||
|
@ -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);
|
||||
|
|
|
@ -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,13 +141,14 @@ 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]);
|
||||
|
|
Loading…
Add table
Reference in a new issue