Permalink
Browse files

updating App::import usage. ran each test and everything seems ok.

  • Loading branch information...
1 parent 0c59c13 commit 062f471b7ff0f173f34634e0d7ada91c51d4d1aa gwoo committed Jul 26, 2009
Showing with 81 additions and 13,649 deletions.
  1. +3 −2 cake/dispatcher.php
  2. +4 −13 cake/libs/configure.php
  3. +1 −1 cake/libs/controller/components/email.php
  4. +2 −2 cake/libs/controller/controller.php
  5. +1 −1 cake/libs/model/datasources/dbo/dbo_mysqli.php
  6. +2 −1 cake/libs/model/model.php
  7. +1 −1 cake/libs/router.php
  8. +1 −1 cake/libs/view/helpers/app_helper.php
  9. +2 −1 cake/libs/view/view.php
  10. +10 −0 cake/tests/cases/console/cake.test.php
  11. +1 −1 cake/tests/cases/console/libs/acl.test.php
  12. +1 −1 cake/tests/cases/console/libs/api.test.php
  13. +1 −1 cake/tests/cases/console/libs/bake.test.php
  14. +4 −2 cake/tests/cases/console/libs/shell.test.php
  15. +3 −1 cake/tests/cases/console/libs/tasks/controller.test.php
  16. +3 −8 cake/tests/cases/console/libs/tasks/db_config.test.php
  17. +2 −1 cake/tests/cases/console/libs/tasks/extract.test.php
  18. +3 −16 cake/tests/cases/console/libs/tasks/fixture.test.php
  19. +1 −1 cake/tests/cases/console/libs/tasks/model.test.php
  20. +1 −1 cake/tests/cases/console/libs/tasks/plugin.test.php
  21. +1 −1 cake/tests/cases/console/libs/tasks/project.test.php
  22. +1 −1 cake/tests/cases/console/libs/tasks/template.test.php
  23. +7 −27 cake/tests/cases/console/libs/tasks/test.test.php
  24. +1 −1 cake/tests/cases/console/libs/tasks/view.test.php
  25. +1 −1 cake/tests/cases/libs/cake_test_fixture.test.php
  26. +1 −1 cake/tests/cases/libs/code_coverage_manager.test.php
  27. +8 −10 cake/tests/cases/libs/configure.test.php
  28. +2 −1 cake/tests/cases/libs/controller/component.test.php
  29. +2 −2 cake/tests/cases/libs/controller/components/cookie.test.php
  30. +1 −1 cake/tests/cases/libs/controller/components/request_handler.test.php
  31. +1 −1 cake/tests/cases/libs/controller/components/session.test.php
  32. +1 −1 cake/tests/cases/libs/controller/controller.test.php
  33. +1 −1 cake/tests/cases/libs/controller/pages_controller.test.php
  34. +5 −1 cake/tests/cases/libs/i18n.test.php
  35. +0 −13,494 cake/tests/cases/libs/model/model.test.php
  36. +0 −49 cake/tests/cases/libs/model/model_read.test.php
  37. +1 −0 cake/tests/cases/libs/view/helpers/cache.test.php
View
@@ -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.
@@ -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);
View
@@ -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];
@@ -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;
}
@@ -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'));
@@ -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;
@@ -25,6 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+App::import('Core', 'Multibyte');
/**
* EmailComponent
@@ -36,7 +37,6 @@
* @subpackage cake.cake.libs.controller.components
*
*/
-App::import('Core', 'Multibyte');
class EmailComponent extends Object{
/**
@@ -21,8 +21,8 @@
/**
* Include files
*/
-App::import('Core', array('Component', 'View'));
-
+App::import('Controller', 'Component', false);
+App::import('View', 'View', false);
/**
* Controller
*
@@ -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
@@ -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.
View
@@ -31,7 +31,7 @@
*
*/
if (!class_exists('Object')) {
- App::import('Core', 'Object');
+ require LIBS . 'object.php';
}
/**
@@ -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.
View
@@ -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.
@@ -109,6 +109,16 @@ function stdout($string, $newline = true) {
}
}
+/**
+ * clear method
+ *
+ * @access public
+ * @return void
+ */
+ function clear() {
+
+ }
+
/**
* _stop method
*
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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';
@@ -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);
@@ -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);
@@ -54,7 +54,7 @@ class TEST_DATABASE_CONFIG {
'database' => 'database_name',
'prefix' => '',
);
-
+
var $otherOne = array(
'driver' => 'mysql',
'persistent' => false,
@@ -73,7 +73,6 @@ class TEST_DATABASE_CONFIG {
* @subpackage cake.tests.cases.console.libs.tasks
*/
class DbConfigTaskTest extends CakeTestCase {
-
/**
* startTest method
*
@@ -89,7 +88,6 @@ function startTest() {
$this->Task->params['working'] = rtrim(APP, '/');
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
}
-
/**
* endTest method
*
@@ -100,7 +98,6 @@ function endTest() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}
-
/**
* Test the getConfig method.
*
@@ -111,7 +108,6 @@ function testGetConfig() {
$result = $this->Task->getConfig();
$this->assertEqual($result, 'otherOne');
}
-
/**
* test that initialize sets the path up.
*
@@ -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
*
@@ -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);
Oops, something went wrong.

0 comments on commit 062f471

Please sign in to comment.