Adding bake skeleton's view directory to view paths list to avoid promlems with existing installation due to file moving done in earlier commit.

This commit is contained in:
ADmad 2012-02-16 18:15:12 +05:30
parent df0d1d681f
commit 5c792aa831
4 changed files with 12 additions and 10 deletions

View file

@ -838,7 +838,8 @@ class App {
'%s' . 'Controller' . DS . 'Component' . DS . 'Acl' . DS
),
'View' => array(
'%s' . 'View' . DS
'%s' . 'View' . DS,
CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
),
'View/Helper' => array(
'%s' . 'View' . DS . 'Helper' . DS

View file

@ -156,7 +156,8 @@ class AppTest extends CakeTestCase {
App::build(array('views' => array('/path/to/views/')));
$expected = array(
'/path/to/views/',
APP . 'View' . DS
APP . 'View' . DS,
CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
);
$result = App::path('views');
$this->assertEquals($expected, $result);

View file

@ -403,6 +403,7 @@ class ViewTest extends CakeTestCase {
$expected = array(
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
$pluginPath . 'View' . DS,
CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS,
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS,
CAKE . 'View' . DS
);

View file

@ -1097,15 +1097,14 @@ class View extends Object {
$paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
if (!empty($this->theme)) {
$themePaths = array();
$count = count($paths);
for ($i = 0; $i < $count; $i++) {
if (strpos($paths[$i], DS . 'Plugin' . DS) === false
&& strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) {
if ($plugin) {
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
}
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS;
foreach ($paths as $path) {
if (strpos($path, DS . 'Plugin' . DS) === false
&& strpos($path, DS . 'Cake' . DS . 'View') === false) {
if ($plugin) {
$themePaths[] = $path . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
}
$themePaths[] = $path . 'Themed'. DS . $this->theme . DS;
}
}
$paths = array_merge($themePaths, $paths);
}