diff --git a/lib/Cake/Controller/Component/Auth/ActionsAuthorize.php b/lib/Cake/Controller/Component/Auth/ActionsAuthorize.php index c2f1f35d2..684fb47a0 100644 --- a/lib/Cake/Controller/Component/Auth/ActionsAuthorize.php +++ b/lib/Cake/Controller/Component/Auth/ActionsAuthorize.php @@ -12,7 +12,8 @@ * @link http://cakephp.org CakePHP(tm) Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Component', 'auth/base_authorize'); + +App::uses('BaseAuthorize', 'Controller/Component/Auth'); /** * An authorization adapter for AuthComponent. Provides the ability to authorize using the AclComponent, diff --git a/lib/Cake/Controller/Component/Auth/BaseAuthenticate.php b/lib/Cake/Controller/Component/Auth/BaseAuthenticate.php index 1cfcc8896..aba2a8328 100644 --- a/lib/Cake/Controller/Component/Auth/BaseAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/BaseAuthenticate.php @@ -12,7 +12,8 @@ * @link http://cakephp.org CakePHP(tm) Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Core', 'Security'); + +App::uses('Security', 'Utility'); /** * Base Authentication class with common methods and properties. diff --git a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php index 2ba467e98..b2dc5d2d0 100644 --- a/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/BasicAuthenticate.php @@ -12,7 +12,8 @@ * @link http://cakephp.org CakePHP(tm) Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Component', 'auth/base_authenticate'); + +App::uses('BaseAuthorize', 'Controller/Component/Auth'); /** * Basic Authentication adapter for AuthComponent. diff --git a/lib/Cake/Controller/Component/Auth/ControllerAuthorize.php b/lib/Cake/Controller/Component/Auth/ControllerAuthorize.php index 8fd66b10d..275cf6875 100644 --- a/lib/Cake/Controller/Component/Auth/ControllerAuthorize.php +++ b/lib/Cake/Controller/Component/Auth/ControllerAuthorize.php @@ -12,7 +12,8 @@ * @link http://cakephp.org CakePHP(tm) Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Component', 'auth/base_authorize'); + +App::uses('BaseAuthorize', 'Controller/Component/Auth'); /** * An authorization adapter for AuthComponent. Provides the ability to authorize using a controller callback. diff --git a/lib/Cake/Controller/Component/Auth/CrudAuthorize.php b/lib/Cake/Controller/Component/Auth/CrudAuthorize.php index be127f43a..51cfa7cda 100644 --- a/lib/Cake/Controller/Component/Auth/CrudAuthorize.php +++ b/lib/Cake/Controller/Component/Auth/CrudAuthorize.php @@ -12,7 +12,8 @@ * @link http://cakephp.org CakePHP(tm) Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Component', 'auth/base_authorize'); + +App::uses('BaseAuthorize', 'Controller/Component/Auth'); /** * An authorization adapter for AuthComponent. Provides the ability to authorize using CRUD mappings. diff --git a/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php b/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php index c27f293c0..69c3ae228 100644 --- a/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/DigestAuthenticate.php @@ -12,7 +12,8 @@ * @link http://cakephp.org CakePHP(tm) Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Component', 'auth/base_authenticate'); + +App::uses('BaseAuthenticate', 'Controller/Component/Auth'); /** * Digest Authentication adapter for AuthComponent. diff --git a/lib/Cake/Controller/Component/Auth/FormAuthenticate.php b/lib/Cake/Controller/Component/Auth/FormAuthenticate.php index d24d9acf2..f0f708088 100644 --- a/lib/Cake/Controller/Component/Auth/FormAuthenticate.php +++ b/lib/Cake/Controller/Component/Auth/FormAuthenticate.php @@ -12,7 +12,8 @@ * @link http://cakephp.org CakePHP(tm) Project * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Component', 'auth/base_authenticate'); + +App::uses('BaseAuthenticate', 'Controller/Component/Auth'); /** * An authentication adapter for AuthComponent. Provides the ability to authenticate using POST diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 10e9bcdef..06278ed72 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -407,8 +407,10 @@ class AuthComponent extends Component { unset($config[AuthComponent::ALL]); } foreach ($config as $class => $settings) { + list($plugin, $class) = pluginSplit($class, true); $className = $class . 'Authorize'; - if (!class_exists($className) && !App::import('Component', 'auth/' . $class . '_authorize')) { + App::uses($className, $plugin . 'Controller/Component/Auth'); + if (!class_exists($className)) { throw new CakeException(__('Authorization adapter "%s" was not found.', $class)); } if (!method_exists($className, 'authorize')) { @@ -645,8 +647,10 @@ class AuthComponent extends Component { unset($config[AuthComponent::ALL]); } foreach ($config as $class => $settings) { + list($plugin, $class) = pluginSplit($class, true); $className = $class . 'Authenticate'; - if (!class_exists($className) && !App::import('Component', 'auth/' . $class . '_authenticate')) { + App::uses($className, $plugin . 'Controller/Component/Auth'); + if (!class_exists($className)) { throw new CakeException(__('Authentication adapter "%s" was not found.', $class)); } if (!method_exists($className, 'authenticate')) { diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index 36cdd31fc..03c543c6e 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -425,7 +425,7 @@ class App { public static function objects($type, $path = null, $cache = true) { $objects = array(); $extension = '/\.php$/'; - $directories = false; + $includeDirectories = false; $name = $type; if (isset(self::$legacy[$type . 's'])) { diff --git a/lib/Cake/tests/cases/libs/controller/components/acl.test.php b/lib/Cake/tests/cases/libs/controller/components/acl.test.php index c7a4ecd70..102a040d4 100644 --- a/lib/Cake/tests/cases/libs/controller/components/acl.test.php +++ b/lib/Cake/tests/cases/libs/controller/components/acl.test.php @@ -16,9 +16,10 @@ * @since CakePHP(tm) v 1.2.0.5435 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('AclComponent', 'Component'); -App::uses('DbAcl', 'Model'); - + +App::uses('AclComponent', 'Controller/Component'); +App::uses('AclNode', 'Model'); +class_exists('AclComponent'); /** * AclNodeTwoTestBase class diff --git a/lib/Cake/tests/cases/libs/controller/components/auth.test.php b/lib/Cake/tests/cases/libs/controller/components/auth.test.php index 0c47bdc62..9fb68b078 100644 --- a/lib/Cake/tests/cases/libs/controller/components/auth.test.php +++ b/lib/Cake/tests/cases/libs/controller/components/auth.test.php @@ -332,15 +332,11 @@ class AuthTest extends CakeTestCase { $this->Controller = new AuthTestController($request); -<<<<<<< HEAD - ClassRegistry::addObject('view', new View($this->Controller)); -======= $collection = new ComponentCollection(); $collection->init($this->Controller); $this->Auth = new TestAuthComponent($collection); $this->Auth->request = $request; $this->Auth->response = $this->getMock('CakeResponse'); ->>>>>>> origin/2.0 $this->Controller->Components->init($this->Controller); @@ -935,7 +931,6 @@ class AuthTest extends CakeTestCase { } /** -<<<<<<< HEAD * testPluginModel method * * @access public @@ -946,7 +941,7 @@ class AuthTest extends CakeTestCase { Cache::delete('object_map', '_cake_core_'); App::build(array( 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), - 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS) + 'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS) ), true); App::objects('plugin', null, false); @@ -996,8 +991,6 @@ class AuthTest extends CakeTestCase { } /** -======= ->>>>>>> origin/2.0 * testAjaxLogin method * * @access public @@ -1005,7 +998,7 @@ class AuthTest extends CakeTestCase { */ function testAjaxLogin() { App::build(array( - 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) + 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) )); $_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";