Skip to content

Commit

Permalink
Updating Shell and Bake tasks to use App::path() instead of Configure…
Browse files Browse the repository at this point in the history
…::read().
  • Loading branch information
markstory committed Jul 7, 2009
1 parent 5c9b5fe commit dc98184
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cake/console/libs/shell.php
Expand Up @@ -589,7 +589,7 @@ function _pluralHumanName($name) {
* @return string $path path to the correct plugin.
**/
function _pluginPath($pluginName) {
$pluginPaths = Configure::read('pluginPaths');
$pluginPaths = App::path('plugins');
$pluginDirName = Inflector::underscore($pluginName);
foreach ($pluginPaths as $path) {
if (is_dir($path . $pluginDirName)) {
Expand Down
2 changes: 1 addition & 1 deletion cake/console/libs/tasks/fixture.php
Expand Up @@ -65,7 +65,7 @@ function __construct(&$dispatch) {
parent::__construct($dispatch);
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
if (!class_exists('CakeSchema')) {
App::import('Model', 'Schema');
App::import('Model', 'CakeSchema');
}
}
/**
Expand Down
1 change: 1 addition & 0 deletions cake/console/libs/tasks/template.php
Expand Up @@ -184,6 +184,7 @@ function _findTemplate($path, $directory, $filename) {
}
}
$this->err(sprintf(__('Could not find template for %s', true), $filename));
$this->_stop();
return false;
}

Expand Down
3 changes: 2 additions & 1 deletion cake/tests/cases/console/libs/tasks/controller.test.php
Expand Up @@ -99,8 +99,9 @@ function startTest() {
$this->Dispatcher =& new TestControllerTaskMockShellDispatcher();
$this->Task =& new MockControllerTask($this->Dispatcher);
$this->Task->Dispatch =& new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Template->params['theme'] = 'default';
$this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch);
$this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch);
}
Expand Down
3 changes: 1 addition & 2 deletions cake/tests/cases/console/libs/tasks/db_config.test.php
Expand Up @@ -85,8 +85,7 @@ function startTest() {
$this->Dispatcher =& new TestDbConfigTaskMockShellDispatcher();
$this->Task =& new MockDbConfigTask($this->Dispatcher);
$this->Task->Dispatch =& new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
//$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Dispatch->shellPaths = App::path('shells');

$this->Task->params['working'] = rtrim(APP, '/');
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/tasks/fixture.test.php
Expand Up @@ -74,7 +74,7 @@ function startTest() {
$this->Task->Model =& new MockFixtureModelTask();
$this->Task->Dispatch = new $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template->initialize();
}
/**
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/tasks/model.test.php
Expand Up @@ -83,7 +83,7 @@ function startTest() {
$this->Dispatcher =& new TestModelTaskMockShellDispatcher();
$this->Task =& new MockModelTask($this->Dispatcher);
$this->Task->Dispatch =& new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Fixture =& new MockModelTaskFixtureTask();
$this->Task->Test =& new MockModelTaskFixtureTask();
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/tasks/plugin.test.php
Expand Up @@ -66,7 +66,7 @@ class PluginTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestPluginTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockPluginTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->path = TMP . 'tests' . DS;
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/tasks/project.test.php
Expand Up @@ -62,7 +62,7 @@ class ProjectTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestProjectTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockProjectTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->path = TMP . 'tests' . DS;
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/tasks/template.test.php
Expand Up @@ -62,7 +62,7 @@ function startTest() {
$this->Dispatcher =& new TestTemplateTaskMockShellDispatcher();
$this->Task =& new MockTemplateTask($this->Dispatcher);
$this->Task->Dispatch = new $this->Dispatcher;
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
$this->Task->Dispatch->shellPaths = App::path('shells');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/tasks/test.test.php
Expand Up @@ -133,7 +133,7 @@ class TestTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestTestTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockTestTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Dispatcher);
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/tasks/view.test.php
Expand Up @@ -103,7 +103,7 @@ class ViewTaskTest extends CakeTestCase {
*/
function startTest() {
$this->Dispatcher =& new TestViewTaskMockShellDispatcher();
$this->Dispatcher->shellPaths = Configure::read('shellPaths');
$this->Dispatcher->shellPaths = App::path('shells');
$this->Task =& new MockViewTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Dispatcher);
Expand Down

0 comments on commit dc98184

Please sign in to comment.