Skip to content

Commit

Permalink
updating App::import usage. ran each test and everything seems ok.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwoo committed Jul 26, 2009
1 parent 0c59c13 commit 062f471
Show file tree
Hide file tree
Showing 37 changed files with 81 additions and 13,649 deletions.
5 changes: 3 additions & 2 deletions cake/dispatcher.php
Expand Up @@ -30,7 +30,8 @@
/**
* List of helpers to include
*/
App::import('Core', array('Router', 'Controller'));
App::import('Core', 'Router');
App::import('Controller', 'Controller', false);

/**
* Dispatcher translates URLs to controller-action-paramter triads.
Expand Down Expand Up @@ -692,7 +693,7 @@ function cached($url) {

if (file_exists($filename)) {
if (!class_exists('View')) {
App::import('Core', 'View');
App::import('View', 'View', false);
}
$controller = null;
$view =& new View($controller, false);
Expand Down
17 changes: 4 additions & 13 deletions cake/libs/configure.php
Expand Up @@ -777,11 +777,9 @@ function objects($type, $path = null, $cache = true) {
}

if ($cache === true) {
$_this->__objects[$name] = $objects;
$_this->__cache = true;
} else {
return $objects;
}
$_this->__objects[$name] = $objects;
}

return $_this->__objects[$name];
Expand Down Expand Up @@ -976,6 +974,7 @@ function __find($file, $recursive = true) {
}
$Folder =& new Folder();
$directories = $Folder->tree($path, array('.svn', 'tests', 'templates'), 'dir');
sort($directories);
$this->__paths[$path] = $directories;
}

Expand Down Expand Up @@ -1089,7 +1088,7 @@ function __settings($type, $plugin, $parent) {
switch ($load) {
case 'model':
if (!class_exists('Model')) {
App::import('Core', 'Model', false, App::core('models'));
App::import('Model', 'Model', false, App::core('models'));
}
if (!class_exists('AppModel')) {
App::import($type, 'AppModel', false, App::path('models'));
Expand Down Expand Up @@ -1162,15 +1161,7 @@ function __paths($type) {
$paths = array();

if ($type === 'core') {
$path = App::core();

foreach ($path as $key => $value) {
$count = count($key);
for ($i = 0; $i < $count; $i++) {
$paths[] = $path[$key][$i];
}
}
return $paths;
return App::core('libs');
}
if ($paths = App::path($type .'s')) {
return $paths;
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/controller/components/email.php
Expand Up @@ -25,6 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', 'Multibyte');

/**
* EmailComponent
Expand All @@ -36,7 +37,6 @@
* @subpackage cake.cake.libs.controller.components
*
*/
App::import('Core', 'Multibyte');
class EmailComponent extends Object{

/**
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/controller/controller.php
Expand Up @@ -21,8 +21,8 @@
/**
* Include files
*/
App::import('Core', array('Component', 'View'));

App::import('Controller', 'Component', false);
App::import('View', 'View', false);
/**
* Controller
*
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/model/datasources/dbo/dbo_mysqli.php
Expand Up @@ -25,7 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', 'DboMysql');
App::import('Datasource', 'DboMysql');

/**
* MySQLi DBO driver object
Expand Down
3 changes: 2 additions & 1 deletion cake/libs/model/model.php
Expand Up @@ -24,8 +24,9 @@
* Included libs
*/
App::import('Core', array(
'ClassRegistry', 'Overloadable', 'Validation', 'ModelBehavior', 'ConnectionManager', 'Set', 'String'
'ClassRegistry', 'Overloadable', 'Validation', 'Set', 'String'
));
App::import('Model', array('ModelBehavior', 'ConnectionManager'), false);

/**
* Object-relational mapper.
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/router.php
Expand Up @@ -31,7 +31,7 @@
*
*/
if (!class_exists('Object')) {
App::import('Core', 'Object');
require LIBS . 'object.php';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/view/helpers/app_helper.php
Expand Up @@ -26,7 +26,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', 'Helper');
App::import('View', 'Helper', false);

/**
* This is a placeholder class.
Expand Down
3 changes: 2 additions & 1 deletion cake/libs/view/view.php
Expand Up @@ -27,7 +27,8 @@
/**
* Included libraries.
*/
App::import('Core', array('Helper', 'ClassRegistry'));
App::import('Core', 'ClassRegistry');
App::import('View', 'Helper', false);

/**
* View, the V in the MVC triad.
Expand Down
10 changes: 10 additions & 0 deletions cake/tests/cases/console/cake.test.php
Expand Up @@ -109,6 +109,16 @@ function stdout($string, $newline = true) {
}
}

/**
* clear method
*
* @access public
* @return void
*/
function clear() {

}

/**
* _stop method
*
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/acl.test.php
Expand Up @@ -23,7 +23,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', 'Shell');
App::import('Shell', 'Shell', false);

if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/api.test.php
Expand Up @@ -23,7 +23,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', 'Shell');
App::import('Shell', 'Shell', false);

if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/console/libs/bake.test.php
Expand Up @@ -18,7 +18,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'Shell');
App::import('Shell', 'Shell', false);

if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
Expand Down
6 changes: 4 additions & 2 deletions cake/tests/cases/console/libs/shell.test.php
Expand Up @@ -25,7 +25,9 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', array('Shell', 'Folder'));
App::import('Core', 'Folder');
App::import('Shell', 'Shell', false);


if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
Expand Down Expand Up @@ -350,7 +352,7 @@ function testCreateFile() {
* @access public
*/
function testCreateFileWindows() {
$this->skipUnless(DIRECTORY_SEPARATOR === '\\', '%s Supported on Windows only');
$this->skipUnless(DIRECTORY_SEPARATOR === '\\', 'testCreateFileWindows supported on Windows only');

$path = TMP . 'shell_test';
$file = $path . DS . 'file1.php';
Expand Down
4 changes: 3 additions & 1 deletion cake/tests/cases/console/libs/tasks/controller.test.php
Expand Up @@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'Shell');
App::import('Core', 'ClassRegistry');
App::import('View', 'Helper', false);
App::import('Shell', 'Shell', false);

if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
Expand Down
11 changes: 3 additions & 8 deletions cake/tests/cases/console/libs/tasks/db_config.test.php
Expand Up @@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'Shell');
App::import('Shell', 'Shell', false);

if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
Expand Down Expand Up @@ -54,7 +54,7 @@ class TEST_DATABASE_CONFIG {
'database' => 'database_name',
'prefix' => '',
);

var $otherOne = array(
'driver' => 'mysql',
'persistent' => false,
Expand All @@ -73,7 +73,6 @@ class TEST_DATABASE_CONFIG {
* @subpackage cake.tests.cases.console.libs.tasks
*/
class DbConfigTaskTest extends CakeTestCase {

/**
* startTest method
*
Expand All @@ -89,7 +88,6 @@ function startTest() {
$this->Task->params['working'] = rtrim(APP, '/');
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
}

/**
* endTest method
*
Expand All @@ -100,7 +98,6 @@ function endTest() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}

/**
* Test the getConfig method.
*
Expand All @@ -111,7 +108,6 @@ function testGetConfig() {
$result = $this->Task->getConfig();
$this->assertEqual($result, 'otherOne');
}

/**
* test that initialize sets the path up.
*
Expand All @@ -122,9 +118,8 @@ function testInitialize() {
$this->Task->initialize();
$this->assertFalse(empty($this->Task->path));
$this->assertEqual($this->Task->path, APP . 'config' . DS);

}

/**
* test execute and by extension __interactive
*
Expand Down
3 changes: 2 additions & 1 deletion cake/tests/cases/console/libs/tasks/extract.test.php
Expand Up @@ -25,7 +25,8 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', array('Shell', 'Folder'));
App::import('Core', 'Folder');
App::import('Shell', 'Shell', false);

if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
Expand Down

0 comments on commit 062f471

Please sign in to comment.