mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing a few failing test cases
This commit is contained in:
parent
ea79ba81a4
commit
02fa1ae60b
1 changed files with 8 additions and 4 deletions
|
@ -1082,25 +1082,29 @@ class View extends Object {
|
||||||
}
|
}
|
||||||
$paths = array();
|
$paths = array();
|
||||||
$viewPaths = App::path('View');
|
$viewPaths = App::path('View');
|
||||||
$corePaths = array_flip(array_merge(App::core('View'), App::core('Console/Templates/skel/View')));
|
$corePaths = array_merge(App::core('View'), App::core('Console/Templates/skel/View'));
|
||||||
|
|
||||||
if (!empty($plugin)) {
|
if (!empty($plugin)) {
|
||||||
$count = count($viewPaths);
|
$count = count($viewPaths);
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
if (!isset($corePaths[$viewPaths[$i]])) {
|
if (!in_array($viewPaths[$i], $corePaths)) {
|
||||||
$paths[] = $viewPaths[$i] . 'Plugin' . DS . $plugin . DS;
|
$paths[] = $viewPaths[$i] . 'Plugin' . DS . $plugin . DS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$paths = array_merge($paths, App::path('View', $plugin));
|
$paths = array_merge($paths, App::path('View', $plugin));
|
||||||
}
|
}
|
||||||
|
|
||||||
$paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
|
$paths = array_unique(array_merge($paths, $viewPaths, $corePaths));
|
||||||
if (!empty($this->theme)) {
|
if (!empty($this->theme)) {
|
||||||
|
$skipPatterns = array(
|
||||||
|
DS . 'Cake' . DS . 'View' . DS,
|
||||||
|
DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
|
||||||
|
);
|
||||||
$themePaths = array();
|
$themePaths = array();
|
||||||
$count = count($paths);
|
$count = count($paths);
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
if (strpos($paths[$i], DS . 'Plugin' . DS) === false
|
if (strpos($paths[$i], DS . 'Plugin' . DS) === false
|
||||||
&& strpos($paths[$i], DS . 'Cake' . DS) === false) {
|
&& strpos($paths[$i], $skipPatterns[1]) === false && strpos($paths[$i], $skipPatterns[0]) === false) {
|
||||||
if ($plugin) {
|
if ($plugin) {
|
||||||
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
|
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue