Browse Source

Merge pull request #5507 from cakephp/3.0-remove-app-core-calls

Don't call App::path to find things in the core
Andy Dawson 11 years ago
parent
commit
05ad1eaf55
2 changed files with 8 additions and 3 deletions
  1. 1 2
      src/Shell/Task/CommandTask.php
  2. 7 1
      src/View/View.php

+ 1 - 2
src/Shell/Task/CommandTask.php

@@ -41,8 +41,7 @@ class CommandTask extends Shell {
 		$plugins = Plugin::loaded();
 		$shellList = array_fill_keys($plugins, null) + ['CORE' => null, 'app' => null];
 
-		$corePath = App::core('Shell');
-		$shells = $this->_scanDir($corePath[0]);
+		$shells = $this->_scanDir(dirname(__DIR__));
 		$shells = array_diff($shells, $skipFiles, $hiddenCommands);
 		$shellList = $this->_appendShells('CORE', $shells, $shellList);
 

+ 7 - 1
src/View/View.php

@@ -1023,7 +1023,13 @@ class View {
 				}
 			}
 		}
-		$paths = array_merge($themePaths, $pluginPaths, $viewPaths, App::core('Template'));
+
+		$paths = array_merge(
+			$themePaths,
+			$pluginPaths,
+			$viewPaths,
+			[dirname(__DIR__) . DS . 'Template' . DS]
+		);
 
 		if ($plugin !== null) {
 			return $this->_pathsForPlugin[$plugin] = $paths;