From da7c53b37455677ed32f0ae8e0f5228c8561d1a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 16:54:50 -0430
Subject: [PATCH 001/668] Beging of an experiment: a class utoloader for
cakephp through emulating the keyword "use" of php 5.3
---
cake/libs/app.php | 19 +++++++++++++++++++
cake/libs/dispatcher.php | 13 ++++++-------
2 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/cake/libs/app.php b/cake/libs/app.php
index f18bb0719..66df9c93b 100644
--- a/cake/libs/app.php
+++ b/cake/libs/app.php
@@ -201,6 +201,12 @@ class App {
*/
private static $__objects = array();
+/**
+ * Holds the location of each class
+ *
+ */
+ private static $__classMap = array();
+
/**
* Used to read information stored path
*
@@ -430,6 +436,17 @@ class App {
self::$__objects[$type] = $values;
}
+ public static function uses($className, $location) {
+ self::$__classMap[$className] = $location;
+ }
+
+ public static function load($className) {
+ if (isset(self::$__classMap[$className])) {
+ return App::import(self::$__classMap[$className], $className, false);
+ }
+ return false;
+ }
+
/**
* Finds classes based on $name or specific file(s) to search. Calling App::import() will
* not construct any classes contained in the files. It will only find and require() the file.
@@ -887,3 +904,5 @@ class App {
}
}
}
+
+spl_autoload_register(array('App', 'load'));
\ No newline at end of file
diff --git a/cake/libs/dispatcher.php b/cake/libs/dispatcher.php
index cb14d18ba..1a3738e89 100644
--- a/cake/libs/dispatcher.php
+++ b/cake/libs/dispatcher.php
@@ -24,10 +24,12 @@
/**
* List of helpers to include
*/
-App::import('Core', 'Router', false);
-App::import('Core', 'CakeRequest', false);
-App::import('Core', 'CakeResponse', false);
-App::import('Controller', 'Controller', false);
+App::uses('Router', 'Core');
+App::uses('CakeRequest', 'Core');
+App::uses('CakeResponse', 'Core');
+App::uses('Controller', 'Controller');
+App::uses('View', 'View');
+App::uses('Debugger', 'Core');
/**
* Dispatcher converts Requests into controller actions. It uses the dispatched Request
@@ -270,9 +272,6 @@ class Dispatcher {
}
if (file_exists($filename)) {
- if (!class_exists('View')) {
- App::import('View', 'View', false);
- }
$controller = null;
$view = new View($controller);
return $view->renderCache($filename, microtime(true));
From fd639cc956bcede06cce8354370e13c64a26021d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 17:09:50 -0430
Subject: [PATCH 002/668] Replacing use of App::import in favor of App::uses in
controller class declaration
---
cake/libs/controller/controller.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php
index d4341655b..a5c1ba8a1 100644
--- a/cake/libs/controller/controller.php
+++ b/cake/libs/controller/controller.php
@@ -21,10 +21,10 @@
/**
* Include files
*/
-App::import('Core', 'CakeResponse', false);
-App::import('Core', 'ClassRegistry', false);
-App::import('Controller', 'Component', false);
-App::import('View', 'View', false);
+App::uses('CakeResponse', 'Core');
+App::uses('ClassRegistry', 'Core');
+App::uses('ComponentCollection', 'Controller');
+App::uses('View', 'View');
/**
* Controller
From 1d129840f613bdb80f847353c0756184ac38fa2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 18:08:52 -0430
Subject: [PATCH 003/668] Changing more App::import calls for App::uses
---
cake/libs/cake_request.php | 2 +-
cake/libs/cake_session.php | 1 -
cake/libs/controller/component.php | 2 +-
cake/libs/controller/component_collection.php | 2 +-
cake/libs/controller/components/auth.php | 6 +++---
cake/libs/controller/components/cookie.php | 2 +-
cake/libs/controller/components/email.php | 2 +-
cake/libs/controller/components/request_handler.php | 5 ++---
cake/libs/controller/components/security.php | 4 ++--
cake/libs/controller/components/session.php | 5 ++---
cake/libs/controller/scaffold.php | 2 +-
cake/libs/debugger.php | 8 ++------
cake/libs/dispatcher.php | 2 +-
cake/libs/http_socket.php | 4 ++--
cake/libs/i18n.php | 4 ++--
cake/libs/l10n.php | 2 +-
cake/libs/model/behavior_collection.php | 2 +-
cake/libs/model/cake_schema.php | 4 ++--
cake/libs/model/connection_manager.php | 4 ++--
cake/libs/router.php | 4 ++--
20 files changed, 30 insertions(+), 37 deletions(-)
diff --git a/cake/libs/cake_request.php b/cake/libs/cake_request.php
index 7a464f742..088e0b968 100644
--- a/cake/libs/cake_request.php
+++ b/cake/libs/cake_request.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Set');
+App::uses('Set', 'Core');
/**
* A class that helps wrap Request information and particulars about a single request.
diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php
index aa4b0a95c..5c078c7dd 100644
--- a/cake/libs/cake_session.php
+++ b/cake/libs/cake_session.php
@@ -141,7 +141,6 @@ class CakeSession {
* @param boolean $start Should session be started right now
*/
public static function init($base = null, $start = true) {
- App::import('Core', 'Security');
self::$time = time();
$checkAgent = Configure::read('Session.checkAgent');
diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php
index c0d4b57a6..8ce908cda 100644
--- a/cake/libs/controller/component.php
+++ b/cake/libs/controller/component.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', 'ComponentCollection', false);
+App::uses('ComponentCollection', 'Controller');
/**
* Base class for an individual Component. Components provide resuable bits of
diff --git a/cake/libs/controller/component_collection.php b/cake/libs/controller/component_collection.php
index 90ec17f17..9aa589566 100644
--- a/cake/libs/controller/component_collection.php
+++ b/cake/libs/controller/component_collection.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
+App::uses('ObjectCollection', 'Core');
class ComponentCollection extends ObjectCollection {
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index a41d88e54..b09faa2f4 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -20,8 +20,9 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Router', false);
-App::import('Core', 'Security', false);
+App::uses('Router', 'Core');
+App::uses('Security', 'Core');
+App::uses('Debugger', 'Core');
/**
* Authentication control component class
@@ -287,7 +288,6 @@ class AuthComponent extends Component {
}
}
if (Configure::read('debug') > 0) {
- App::import('Debugger');
Debugger::checkSecurityKeys();
}
}
diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php
index bff3b7137..2efec17c3 100644
--- a/cake/libs/controller/components/cookie.php
+++ b/cake/libs/controller/components/cookie.php
@@ -21,7 +21,7 @@
/**
* Load Security class
*/
-App::import('Core', 'Security');
+App::uses('Security', 'Core');
/**
* Cookie Component.
diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php
index a4cb6dd02..965084589 100755
--- a/cake/libs/controller/components/email.php
+++ b/cake/libs/controller/components/email.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.3467
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Multibyte');
+App::uses('Multibyte', 'Core');
/**
* EmailComponent
diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php
index b68e5e33e..4928c945a 100644
--- a/cake/libs/controller/components/request_handler.php
+++ b/cake/libs/controller/components/request_handler.php
@@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Xml', 'Core');
+
/**
* Request object for handling HTTP requests
*
@@ -172,9 +174,6 @@ class RequestHandlerComponent extends Component {
}
if ($this->requestedWith('xml')) {
- if (!class_exists('Xml')) {
- App::import('Core', 'Xml');
- }
try {
$xml = Xml::build(trim(file_get_contents('php://input')));
diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php
index 49632a1c6..c4f8299c4 100644
--- a/cake/libs/controller/components/security.php
+++ b/cake/libs/controller/components/security.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 0.10.8.2156
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'String', false);
-App::import('Core', 'Security', false);
+App::uses('String', 'Core');
+App::uses('Security', 'Core');
/**
* SecurityComponent
diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php
index 77ab43a4d..9406e9447 100644
--- a/cake/libs/controller/components/session.php
+++ b/cake/libs/controller/components/session.php
@@ -17,9 +17,8 @@
* @since CakePHP(tm) v 0.10.0.1232
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (!class_exists('cakesession')) {
- require LIBS . 'cake_session.php';
-}
+
+App::uses('CakeSession', 'Core');
/**
* Session Component.
diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php
index 581d788c0..b0c8995af 100644
--- a/cake/libs/controller/scaffold.php
+++ b/cake/libs/controller/scaffold.php
@@ -19,7 +19,7 @@
* @since Cake v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('View', 'Scaffold');
+App::uses('Scaffold', 'View');
/**
* Scaffolding is a set of automatic actions for starting web development work faster.
diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php
index f07ab78c6..a6f060df7 100644
--- a/cake/libs/debugger.php
+++ b/cake/libs/debugger.php
@@ -24,12 +24,8 @@
* Included libraries.
*
*/
-if (!class_exists('CakeLog')) {
- require_once LIBS . 'cake_log.php';
-}
-if (!class_exists('String')) {
- require_once LIBS . 'string.php';
-}
+App::uses('CakeLog', 'Core');
+App::uses('String', 'Core');
/**
* Provide custom logging and error handling.
diff --git a/cake/libs/dispatcher.php b/cake/libs/dispatcher.php
index 1a3738e89..2b4453546 100644
--- a/cake/libs/dispatcher.php
+++ b/cake/libs/dispatcher.php
@@ -28,6 +28,7 @@ App::uses('Router', 'Core');
App::uses('CakeRequest', 'Core');
App::uses('CakeResponse', 'Core');
App::uses('Controller', 'Controller');
+App::uses('Scaffold', 'Controller');
App::uses('View', 'View');
App::uses('Debugger', 'Core');
@@ -163,7 +164,6 @@ class Dispatcher {
if (!isset($methods[$request->params['action']])) {
if ($controller->scaffold !== false) {
- App::import('Controller', 'Scaffold', false);
return new Scaffold($controller, $request);
}
throw new MissingActionException(array(
diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php
index aaf3b504c..40f66204b 100644
--- a/cake/libs/http_socket.php
+++ b/cake/libs/http_socket.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'CakeSocket');
-App::import('Core', 'Router');
+App::uses('CakeSocket', 'Core');
+App::uses('Router', 'Core');
/**
* Cake network socket connection class.
diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php
index 05ec9c9e8..bab553d1a 100644
--- a/cake/libs/i18n.php
+++ b/cake/libs/i18n.php
@@ -21,8 +21,8 @@
/**
* Included libraries.
*/
-App::import('Core', 'L10n');
-App::import('Core', 'Multibyte');
+App::uses('L10n', 'Core');
+App::uses('Multibyte', 'Core');
/**
* I18n handles translation of Text and time format strings.
diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php
index 4f5868412..1844507c3 100644
--- a/cake/libs/l10n.php
+++ b/cake/libs/l10n.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4116
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'CakeRequest');
+App::uses('CakeRequest', 'Core');
/**
* Localization
diff --git a/cake/libs/model/behavior_collection.php b/cake/libs/model/behavior_collection.php
index 3ce783c76..39f2e37d3 100644
--- a/cake/libs/model/behavior_collection.php
+++ b/cake/libs/model/behavior_collection.php
@@ -19,7 +19,7 @@
* @since CakePHP(tm) v 1.2.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
+App::uses('ObjectCollection', 'Core');
/**
* Model behavior collection class.
diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php
index dbf5d3c3f..360de5717 100644
--- a/cake/libs/model/cake_schema.php
+++ b/cake/libs/model/cake_schema.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Model');
-App::import('Core', 'ConnectionManager');
+App::uses('Model', 'Core');
+App::uses('ConnectionManager', 'Core');
/**
* Base Class for Schema management
diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php
index 40dc1e2bf..59dd5d37f 100644
--- a/cake/libs/model/connection_manager.php
+++ b/cake/libs/model/connection_manager.php
@@ -19,8 +19,6 @@
* @since CakePHP(tm) v 0.10.x.1402
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require LIBS . 'model' . DS . 'datasources' . DS . 'datasource.php';
-include_once CONFIGS . 'database.php';
/**
* Manages loaded instances of DataSource objects
@@ -59,6 +57,7 @@ class ConnectionManager {
*
*/
function __construct() {
+ include_once CONFIGS . 'database.php';
if (class_exists('DATABASE_CONFIG')) {
$this->config = new DATABASE_CONFIG();
$this->_getConnectionObjects();
@@ -102,6 +101,7 @@ class ConnectionManager {
$conn = $_this->_connectionsEnum[$name];
$class = $conn['classname'];
+ require LIBS . 'model' . DS . 'datasources' . DS . 'datasource.php';
if ($_this->loadDataSource($name) === null) {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Could not load class %s"), $class), E_USER_ERROR);
$null = null;
diff --git a/cake/libs/router.php b/cake/libs/router.php
index b51f02134..3840fdce6 100644
--- a/cake/libs/router.php
+++ b/cake/libs/router.php
@@ -18,8 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'CakeRequest');
-App::import('Core', 'route/CakeRoute');
+App::uses('CakeRequest', 'Core');
+App::uses('CakeRoute', 'Core');
/**
* Parses the request URL into controller, action, and parameters.
From b1ec3043bc656dd7cc6c7e3e05f2b730d188e04b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 18:37:21 -0430
Subject: [PATCH 004/668] Replacing App::import in favor of App::uses where
possible
---
cake/console/templates/skel/app_helper.php | 2 +-
cake/libs/cake_socket.php | 2 +-
cake/libs/model/behaviors/translate.php | 5 ++---
cake/libs/model/datasources/dbo_source.php | 2 +-
cake/libs/model/db_acl.php | 2 +-
cake/libs/model/model.php | 14 +++++++-------
cake/libs/route/plugin_short_route.php | 2 +-
cake/libs/route/redirect_route.php | 5 +++--
cake/libs/router.php | 4 ++--
cake/libs/security.php | 5 ++---
cake/libs/set.php | 5 ++---
cake/libs/validation.php | 5 ++---
cake/libs/view/helper.php | 4 +---
cake/libs/view/helper_collection.php | 2 +-
cake/libs/view/helpers/app_helper.php | 2 +-
cake/libs/view/helpers/jquery_engine.php | 3 ++-
cake/libs/view/helpers/js.php | 3 ++-
cake/libs/view/helpers/mootools_engine.php | 2 +-
cake/libs/view/helpers/prototype_engine.php | 2 +-
cake/libs/view/helpers/rss.php | 2 +-
cake/libs/view/helpers/text.php | 8 ++------
cake/libs/view/media.php | 4 ++--
cake/libs/view/scaffold.php | 2 +-
cake/libs/view/theme.php | 2 +-
cake/libs/view/view.php | 4 ++--
25 files changed, 43 insertions(+), 50 deletions(-)
diff --git a/cake/console/templates/skel/app_helper.php b/cake/console/templates/skel/app_helper.php
index 2dd482b90..5d9323d09 100644
--- a/cake/console/templates/skel/app_helper.php
+++ b/cake/console/templates/skel/app_helper.php
@@ -20,7 +20,7 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', 'Helper', false);
+App::uses('Helper', 'Helper');
/**
* This is a placeholder class.
diff --git a/cake/libs/cake_socket.php b/cake/libs/cake_socket.php
index 3bcb7ca0a..e5be4cbe5 100644
--- a/cake/libs/cake_socket.php
+++ b/cake/libs/cake_socket.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Validation');
+App::uses('Validation', 'Core');
/**
* Cake network socket connection class.
diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php
index 9e5a3c799..d7ea5ecf0 100644
--- a/cake/libs/model/behaviors/translate.php
+++ b/cake/libs/model/behaviors/translate.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('I18n', 'Core');
+
/**
* Translate behavior
*
@@ -346,9 +348,6 @@ class TranslateBehavior extends ModelBehavior {
*/
protected function _getLocale(&$model) {
if (!isset($model->locale) || is_null($model->locale)) {
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
$I18n =& I18n::getInstance();
$I18n->l10n->get(Configure::read('Config.language'));
$model->locale = $I18n->l10n->locale;
diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php
index 2e4387852..fbcf5c3af 100755
--- a/cake/libs/model/datasources/dbo_source.php
+++ b/cake/libs/model/datasources/dbo_source.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'String');
+App::uses('String', 'Core');
/**
* DboSource
diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php
index b9bd815b0..a07730061 100644
--- a/cake/libs/model/db_acl.php
+++ b/cake/libs/model/db_acl.php
@@ -23,7 +23,7 @@
/**
* Load Model and AppModel
*/
-App::import('Model', 'App');
+App::uses('AppModel', 'Model');
/**
* ACL Node
diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php
index b34d175e0..1ea708a2b 100644
--- a/cake/libs/model/model.php
+++ b/cake/libs/model/model.php
@@ -23,12 +23,13 @@
/**
* Included libs
*/
-App::import('Core', 'ClassRegistry', false);
-App::import('Core', 'Validation', false);
-App::import('Core', 'String', false);
-App::import('Model', 'BehaviorCollection', false);
-App::import('Model', 'ModelBehavior', false);
-App::import('Model', 'ConnectionManager', false);
+App::uses('ClassRegistry', 'Core');
+App::uses('Validation', 'Core');
+App::uses('String', 'Core');
+App::uses('BehaviorCollection', 'Model');
+App::uses('ModelBehavior', 'Model');
+App::uses('ConnectionManager', 'Model');
+App::uses('Xml', 'Core');
/**
* Object-relational mapper.
@@ -822,7 +823,6 @@ class Model extends Object {
}
if (is_object($one)) {
if ($one instanceof SimpleXMLElement || $one instanceof DOMNode) {
- App::import('Core', 'Xml');
$one = $this->_normalizeXmlData(Xml::toArray($one));
} else {
$one = Set::reverse($one);
diff --git a/cake/libs/route/plugin_short_route.php b/cake/libs/route/plugin_short_route.php
index 1c1c4330b..062cfcbfb 100644
--- a/cake/libs/route/plugin_short_route.php
+++ b/cake/libs/route/plugin_short_route.php
@@ -1,5 +1,5 @@
$value) {
$plugins[$key] = Inflector::underscore($value);
}
diff --git a/cake/libs/security.php b/cake/libs/security.php
index 348402de2..2cbe838b0 100644
--- a/cake/libs/security.php
+++ b/cake/libs/security.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('String', 'Core');
+
/**
* Security Library contains utility methods related to security
*
@@ -59,9 +61,6 @@ class Security {
* @return string Hash
*/
public static function generateAuthKey() {
- if (!class_exists('String')) {
- App::import('Core', 'String');
- }
return Security::hash(String::uuid());
}
diff --git a/cake/libs/set.php b/cake/libs/set.php
index 4938308cd..7a86facdf 100644
--- a/cake/libs/set.php
+++ b/cake/libs/set.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('String', 'Core');
+
/**
* Class used for manipulation of arrays.
*
@@ -582,9 +584,6 @@ class Set {
}
if (!is_array($path)) {
- if (!class_exists('String')) {
- App::import('Core', 'String');
- }
$path = String::tokenize($path, '.', '{', '}');
}
$tmp = array();
diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index 7297491bd..00e7e8fe1 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -17,9 +17,8 @@
* @since CakePHP(tm) v 1.2.0.3830
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (!class_exists('Multibyte')) {
- App::import('Core', 'Multibyte', false);
-}
+
+App::uses('Multibyte', 'Core');
/**
* Offers different validation methods.
diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php
index 20e41953c..7bec00a20 100644
--- a/cake/libs/view/helper.php
+++ b/cake/libs/view/helper.php
@@ -20,9 +20,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (!class_exists('Router')) {
- App::import('Core', 'Router');
-}
+App::uses('Router', 'Core');
/**
* Abstract base class for all other Helpers in CakePHP.
diff --git a/cake/libs/view/helper_collection.php b/cake/libs/view/helper_collection.php
index 18b700812..66200a44b 100644
--- a/cake/libs/view/helper_collection.php
+++ b/cake/libs/view/helper_collection.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
+App::uses('ObjectCollection', 'Core');
class HelperCollection extends ObjectCollection {
diff --git a/cake/libs/view/helpers/app_helper.php b/cake/libs/view/helpers/app_helper.php
index d09503bb0..cdde4bc60 100644
--- a/cake/libs/view/helpers/app_helper.php
+++ b/cake/libs/view/helpers/app_helper.php
@@ -20,7 +20,7 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('View', 'Helper', false);
+App::uses('Helper', 'View');
/**
* This is a placeholder class.
diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php
index f09c70c33..ce9c017db 100644
--- a/cake/libs/view/helpers/jquery_engine.php
+++ b/cake/libs/view/helpers/jquery_engine.php
@@ -22,7 +22,8 @@
* @subpackage cake.view.helpers
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', 'Js');
+
+App::uses('JsHelper', 'Helper');
class JqueryEngineHelper extends JsBaseEngineHelper {
/**
diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php
index c4809c30c..a8a91adb8 100644
--- a/cake/libs/view/helpers/js.php
+++ b/cake/libs/view/helpers/js.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Multibyte', 'Core');
+
/**
* Javascript Generator helper class for easy use of JavaScript.
*
@@ -665,7 +667,6 @@ abstract class JsBaseEngineHelper extends AppHelper {
* @return string Escaped string.
*/
public function escape($string) {
- App::import('Core', 'Multibyte');
return $this->_utf8ToHex($string);
}
diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php
index bd0b676dd..ec226d500 100644
--- a/cake/libs/view/helpers/mootools_engine.php
+++ b/cake/libs/view/helpers/mootools_engine.php
@@ -25,7 +25,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', 'Js');
+App::uses('JsHelper', 'Helper');
class MootoolsEngineHelper extends JsBaseEngineHelper {
/**
diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php
index 7f3e230b4..779fb5c45 100644
--- a/cake/libs/view/helpers/prototype_engine.php
+++ b/cake/libs/view/helpers/prototype_engine.php
@@ -20,7 +20,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', 'Js');
+App::uses('JsHelper', 'Helper');
class PrototypeEngineHelper extends JsBaseEngineHelper {
/**
diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php
index ae1ab6239..d85eb7a23 100644
--- a/cake/libs/view/helpers/rss.php
+++ b/cake/libs/view/helpers/rss.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Xml');
+App::uses('Xml', 'Core');
/**
* RSS Helper class for easy output RSS structures.
diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php
index 3f6933bbd..c87455035 100644
--- a/cake/libs/view/helpers/text.php
+++ b/cake/libs/view/helpers/text.php
@@ -24,12 +24,8 @@
* Included libraries.
*
*/
-if (!class_exists('HtmlHelper')) {
- App::import('Helper', 'Html');
-}
-if (!class_exists('Multibyte')) {
- App::import('Core', 'Multibyte');
-}
+App::uses('HtmlHelper', 'Helper');
+App::uses('Multibyte', 'Core');
/**
* Text helper library.
diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php
index 5bc0d179e..856e8d920 100644
--- a/cake/libs/view/media.php
+++ b/cake/libs/view/media.php
@@ -17,7 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5714
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('View', 'View', false);
+App::uses('View', 'View');
+App::uses('CakeRequest', 'Core');
class MediaView extends View {
/**
@@ -45,7 +46,6 @@ class MediaView extends View {
if (is_object($controller) && isset($controller->response)) {
$this->response = $controller->response;
} else {
- App::import('Core', 'CakeRequest');
$this->response = new CakeResponse;
}
}
diff --git a/cake/libs/view/scaffold.php b/cake/libs/view/scaffold.php
index 032676985..88015a97c 100644
--- a/cake/libs/view/scaffold.php
+++ b/cake/libs/view/scaffold.php
@@ -19,7 +19,7 @@
* @since Cake v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('View', 'Theme');
+App::uses('ThemeView', 'View');
/**
* ScaffoldView provides specific view file loading features for scaffolded views.
diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php
index 80e56ae42..02cba797f 100644
--- a/cake/libs/view/theme.php
+++ b/cake/libs/view/theme.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('View', 'View');
+App::uses('View', 'View');
/**
* Theme view class
diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php
index 557c69674..a9b5481e5 100644
--- a/cake/libs/view/view.php
+++ b/cake/libs/view/view.php
@@ -21,8 +21,8 @@
/**
* Included libraries.
*/
-App::import('View', 'HelperCollection', false);
-App::import('View', 'Helper', false);
+App::uses('HelperCollection', 'View');
+App::uses('Helper', 'View');
/**
* View, the V in the MVC triad.
From c57dd6f0f1b72d97b4656af3b69a9c318a005a08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 19:38:57 -0430
Subject: [PATCH 005/668] Starting to move files to match the PHP standards
group file naming standard
---
cake/libs/dispatcher.php => lib/Cake/Routing/Dispatcher.php | 0
{cake => lib/Cake}/basics.php | 0
{cake => lib/Cake}/bootstrap.php | 0
3 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/dispatcher.php => lib/Cake/Routing/Dispatcher.php (100%)
rename {cake => lib/Cake}/basics.php (100%)
rename {cake => lib/Cake}/bootstrap.php (100%)
diff --git a/cake/libs/dispatcher.php b/lib/Cake/Routing/Dispatcher.php
similarity index 100%
rename from cake/libs/dispatcher.php
rename to lib/Cake/Routing/Dispatcher.php
diff --git a/cake/basics.php b/lib/Cake/basics.php
similarity index 100%
rename from cake/basics.php
rename to lib/Cake/basics.php
diff --git a/cake/bootstrap.php b/lib/Cake/bootstrap.php
similarity index 100%
rename from cake/bootstrap.php
rename to lib/Cake/bootstrap.php
From 96cb90a82bfaa3ee772e91faa24e6bb263939e97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 19:48:44 -0430
Subject: [PATCH 006/668] Chanigng some constants and commenting code to start
testing
---
lib/Cake/bootstrap.php | 230 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 220 insertions(+), 10 deletions(-)
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index acfc7bb2f..e596aa359 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -24,16 +24,226 @@ if (!defined('E_DEPRECATED')) {
}
error_reporting(E_ALL & ~E_DEPRECATED);
-require CORE_PATH . 'cake' . DS . 'basics.php';
-require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
-require LIBS . 'error' . DS . 'exceptions.php';
-require LIBS . 'object.php';
-require LIBS . 'inflector.php';
+/**
+ * If the index.php file is used instead of an .htaccess file
+ * or if the user can not set the web root to use the public
+ * directory we will define ROOT there, otherwise we set it
+ * here.
+ */
+ if (!defined('ROOT')) {
+ define('ROOT', '../');
+ }
+ if (!defined('WEBROOT_DIR')) {
+ define('WEBROOT_DIR', 'webroot');
+ }
+
+/**
+ * Path to the cake directory.
+ */
+ define('CAKE', CORE_PATH . 'lib' . DS . 'Cake' . DS);
+
+/**
+ * Path to the application's directory.
+ */
+if (!defined('APP')) {
+ define('APP', ROOT.DS.APP_DIR.DS);
+}
+
+/**
+ * Path to the application's models directory.
+ */
+ define('MODELS', APP.'models'.DS);
+
+/**
+ * Path to model behaviors directory.
+ */
+ define('BEHAVIORS', MODELS.'behaviors'.DS);
+
+/**
+ * Path to the application's controllers directory.
+ */
+ define('CONTROLLERS', APP.'controllers'.DS);
+
+/**
+ * Path to the application's components directory.
+ */
+ define('COMPONENTS', CONTROLLERS.'components'.DS);
+
+/**
+ * Path to the application's libs directory.
+ */
+ define('APPLIBS', APP.'libs'.DS);
+
+/**
+ * Path to the application's views directory.
+ */
+ define('VIEWS', APP.'views'.DS);
+
+/**
+ * Path to the application's helpers directory.
+ */
+ define('HELPERS', VIEWS.'helpers'.DS);
+
+/**
+ * Path to the application's view's layouts directory.
+ */
+ define('LAYOUTS', VIEWS.'layouts'.DS);
+
+/**
+ * Path to the application's view's elements directory.
+ * It's supposed to hold pieces of PHP/HTML that are used on multiple pages
+ * and are not linked to a particular layout (like polls, footers and so on).
+ */
+ define('ELEMENTS', VIEWS.'elements'.DS);
+
+/**
+ * Path to the configuration files directory.
+ */
+if (!defined('CONFIGS')) {
+ define('CONFIGS', APP.'config'.DS);
+}
+
+/**
+ * Path to the libs directory.
+ */
+ define('LIBS', CAKE);
+
+/**
+ * Path to the public CSS directory.
+ */
+ define('CSS', WWW_ROOT.'css'.DS);
+
+/**
+ * Path to the public JavaScript directory.
+ */
+ define('JS', WWW_ROOT.'js'.DS);
+
+/**
+ * Path to the public images directory.
+ */
+ define('IMAGES', WWW_ROOT.'img'.DS);
+
+/**
+ * Path to the console libs direcotry.
+ */
+ define('CONSOLE_LIBS', CAKE.'console'.DS.'libs'.DS);
+
+/**
+ * Path to the tests directory.
+ */
+if (!defined('TESTS')) {
+ define('TESTS', APP.'tests'.DS);
+}
+
+/**
+ * Path to the core tests directory.
+ */
+if (!defined('CAKE_TESTS')) {
+ define('CAKE_TESTS', CAKE.'tests'.DS);
+}
+
+/**
+ * Path to the test suite.
+ */
+ define('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS);
+
+/**
+ * Path to the controller test directory.
+ */
+ define('CONTROLLER_TESTS', TESTS.'cases'.DS.'controllers'.DS);
+
+/**
+ * Path to the components test directory.
+ */
+ define('COMPONENT_TESTS', TESTS.'cases'.DS.'components'.DS);
+
+/**
+ * Path to the helpers test directory.
+ */
+ define('HELPER_TESTS', TESTS.'cases'.DS.'views'.DS.'helpers'.DS);
+
+/**
+ * Path to the models' test directory.
+ */
+ define('MODEL_TESTS', TESTS.'cases'.DS.'models'.DS);
+
+/**
+ * Path to the lib test directory.
+ */
+ define('LIB_TESTS', CAKE_TESTS.'cases'.DS.'lib'.DS);
+
+/**
+ * Path to the temporary files directory.
+ */
+if (!defined('TMP')) {
+ define('TMP', APP.'tmp'.DS);
+}
+
+/**
+ * Path to the logs directory.
+ */
+ define('LOGS', TMP.'logs'.DS);
+
+/**
+ * Path to the cache files directory. It can be shared between hosts in a multi-server setup.
+ */
+ define('CACHE', TMP.'cache'.DS);
+
+/**
+ * Path to the vendors directory.
+ */
+if (!defined('VENDORS')) {
+ define('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS);
+}
+
+/**
+ * Web path to the public images directory.
+ */
+if (!defined('IMAGES_URL')) {
+ define('IMAGES_URL', 'img/');
+}
+
+/**
+ * Web path to the CSS files directory.
+ */
+if (!defined('CSS_URL')) {
+ define('CSS_URL', 'css/');
+}
+
+/**
+ * Web path to the js files directory.
+ */
+if (!defined('JS_URL')) {
+ define('JS_URL', 'js/');
+}
+
+
+require LIBS . 'basics.php';
require LIBS . 'app.php';
-require LIBS . 'configure.php';
-require LIBS . 'set.php';
-require LIBS . 'cache.php';
-require LIBS . 'error' . DS . 'error_handler.php';
+//require LIBS . 'error' . DS . 'exceptions.php';
+//require LIBS . 'object.php';
+//require LIBS . 'inflector.php';
+//
+//require LIBS . 'configure.php';
+//require LIBS . 'set.php';
+//require LIBS . 'cache.php';
+//require LIBS . 'error' . DS . 'error_handler.php';
-Configure::bootstrap(isset($boot) ? $boot : true);
+//Configure::bootstrap(isset($boot) ? $boot : true);
+/**
+ * Full url prefix
+ */
+if (!defined('FULL_BASE_URL')) {
+ $s = null;
+ if (env('HTTPS')) {
+ $s ='s';
+ }
+
+ $httpHost = env('HTTP_HOST');
+
+ if (isset($httpHost)) {
+ define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost);
+ }
+ unset($httpHost, $s);
+}
\ No newline at end of file
From ca34b22dbb73ecf9793d6a296bd4086e2c3d9f5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 20:15:54 -0430
Subject: [PATCH 007/668] Renaming more core classes, next step would be to
tweek the autoloader to find only on Cake/ "namespace" (for now)
---
cake/libs/app.php => lib/Cake/Core/App.php | 0
cake/libs/router.php => lib/Cake/Routing/Router.php | 0
cake/libs/folder.php => lib/Cake/Utility/Folder.php | 0
cake/libs/inflector.php => lib/Cake/Utility/Inflector.php | 0
4 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/app.php => lib/Cake/Core/App.php (100%)
rename cake/libs/router.php => lib/Cake/Routing/Router.php (100%)
rename cake/libs/folder.php => lib/Cake/Utility/Folder.php (100%)
rename cake/libs/inflector.php => lib/Cake/Utility/Inflector.php (100%)
diff --git a/cake/libs/app.php b/lib/Cake/Core/App.php
similarity index 100%
rename from cake/libs/app.php
rename to lib/Cake/Core/App.php
diff --git a/cake/libs/router.php b/lib/Cake/Routing/Router.php
similarity index 100%
rename from cake/libs/router.php
rename to lib/Cake/Routing/Router.php
diff --git a/cake/libs/folder.php b/lib/Cake/Utility/Folder.php
similarity index 100%
rename from cake/libs/folder.php
rename to lib/Cake/Utility/Folder.php
diff --git a/cake/libs/inflector.php b/lib/Cake/Utility/Inflector.php
similarity index 100%
rename from cake/libs/inflector.php
rename to lib/Cake/Utility/Inflector.php
From 3c23080dd23f979e437edcafb4c24ca0a5478cec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 3 Dec 2010 20:53:47 -0430
Subject: [PATCH 008/668] Moving more classes to the new schema, slowly
uncommenting code and implementing new class loader
---
cake/libs/cache.php => lib/Cake/Cache/Cache.php | 0
lib/Cake/Core/App.php | 7 +++++--
.../configure.php => lib/Cake/Core/Configure.php | 0
.../Cake/Network/CakeRequest.php | 0
lib/Cake/Routing/Dispatcher.php | 6 +++---
lib/Cake/bootstrap.php | 12 ++++++++----
6 files changed, 16 insertions(+), 9 deletions(-)
rename cake/libs/cache.php => lib/Cake/Cache/Cache.php (100%)
rename cake/libs/configure.php => lib/Cake/Core/Configure.php (100%)
rename cake/libs/cake_request.php => lib/Cake/Network/CakeRequest.php (100%)
diff --git a/cake/libs/cache.php b/lib/Cake/Cache/Cache.php
similarity index 100%
rename from cake/libs/cache.php
rename to lib/Cake/Cache/Cache.php
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 66df9c93b..5caf05e40 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -442,7 +442,10 @@ class App {
public static function load($className) {
if (isset(self::$__classMap[$className])) {
- return App::import(self::$__classMap[$className], $className, false);
+ $file = LIBS . self::$__classMap[$className] . DS . $className . '.php';
+ if (file_exists($file)) {
+ return include $file;
+ }
}
return false;
}
@@ -606,7 +609,7 @@ class App {
}
if (empty(self::$__paths)) {
- self::$__paths = Cache::read('dir_map', '_cake_core_');
+ //self::$__paths = Cache::read('dir_map', '_cake_core_');
}
foreach (self::$search as $path) {
diff --git a/cake/libs/configure.php b/lib/Cake/Core/Configure.php
similarity index 100%
rename from cake/libs/configure.php
rename to lib/Cake/Core/Configure.php
diff --git a/cake/libs/cake_request.php b/lib/Cake/Network/CakeRequest.php
similarity index 100%
rename from cake/libs/cake_request.php
rename to lib/Cake/Network/CakeRequest.php
diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php
index 2b4453546..d1c396148 100644
--- a/lib/Cake/Routing/Dispatcher.php
+++ b/lib/Cake/Routing/Dispatcher.php
@@ -24,9 +24,9 @@
/**
* List of helpers to include
*/
-App::uses('Router', 'Core');
-App::uses('CakeRequest', 'Core');
-App::uses('CakeResponse', 'Core');
+App::uses('Router', 'Routing');
+App::uses('CakeRequest', 'Network');
+App::uses('CakeResponse', 'Network');
App::uses('Controller', 'Controller');
App::uses('Scaffold', 'Controller');
App::uses('View', 'View');
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index e596aa359..5a6a2e697 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -219,17 +219,21 @@ if (!defined('JS_URL')) {
require LIBS . 'basics.php';
-require LIBS . 'app.php';
+require LIBS . 'Utility' . DS . 'Inflector.php';
+require LIBS . 'Utility' . DS . 'Folder.php';
+require LIBS . 'Core' . DS .'App.php';
+
+App::uses('Configure', 'Core');
+App::uses('Cache', 'Cache');
+
//require LIBS . 'error' . DS . 'exceptions.php';
//require LIBS . 'object.php';
-//require LIBS . 'inflector.php';
-//
//require LIBS . 'configure.php';
//require LIBS . 'set.php';
//require LIBS . 'cache.php';
//require LIBS . 'error' . DS . 'error_handler.php';
-//Configure::bootstrap(isset($boot) ? $boot : true);
+Configure::bootstrap(isset($boot) ? $boot : true);
/**
* Full url prefix
From 73ad5385eb9a5ee1d0466458703013e5f60ea2e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 02:16:51 -0430
Subject: [PATCH 009/668] Moving more classes to the new layout, it is time to
bring the debugger up
---
lib/Cake/Cache/Cache.php | 25 +++----------------
.../Cake/Cache/Engine/ApcEngine.php | 0
.../Cake/Cache/Engine/FileEngine.php | 0
.../Cake/Cache/Engine/MemcacheEngine.php | 0
.../Cake/Cache/Engine/XcacheEngine.php | 0
.../Cake/Error/ErrorHandler.php | 0
.../error => lib/Cake/Error}/exceptions.php | 0
lib/Cake/bootstrap.php | 7 +++---
8 files changed, 8 insertions(+), 24 deletions(-)
rename cake/libs/cache/apc.php => lib/Cake/Cache/Engine/ApcEngine.php (100%)
rename cake/libs/cache/file.php => lib/Cake/Cache/Engine/FileEngine.php (100%)
rename cake/libs/cache/memcache.php => lib/Cake/Cache/Engine/MemcacheEngine.php (100%)
rename cake/libs/cache/xcache.php => lib/Cake/Cache/Engine/XcacheEngine.php (100%)
rename cake/libs/error/error_handler.php => lib/Cake/Error/ErrorHandler.php (100%)
rename {cake/libs/error => lib/Cake/Error}/exceptions.php (100%)
diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php
index 259bdc490..4dd4e019f 100644
--- a/lib/Cake/Cache/Cache.php
+++ b/lib/Cake/Cache/Cache.php
@@ -19,6 +19,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Inflector', 'Utility');
+
/**
* Caching for CakePHP.
*
@@ -109,7 +111,8 @@ class Cache {
list($plugin, $class) = pluginSplit($config['engine']);
$cacheClass = $class . 'Engine';
- if (!class_exists($cacheClass) && self::_loadEngine($class, $plugin) === false) {
+ App::uses($cacheClass, 'Cache/Engine');
+ if (!class_exists($cacheClass)) {
return false;
}
$cacheClass = $class . 'Engine';
@@ -151,26 +154,6 @@ class Cache {
return true;
}
-/**
- * Tries to find and include a file for a cache engine and returns object instance
- *
- * @param $name Name of the engine (without 'Engine')
- * @return mixed $engine object or null
- */
- protected static function _loadEngine($name, $plugin = null) {
- if ($plugin) {
- return App::import('Lib', $plugin . '.cache' . DS . $name, false);
- } else {
- $core = App::core();
- $path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php';
- if (file_exists($path)) {
- require $path;
- return true;
- }
- return App::import('Lib', 'cache' . DS . $name, false);
- }
- }
-
/**
* Temporarily change the settings on a cache config. The settings will persist for the next write
* operation (write, decrement, increment, clear). Any reads that are done before the write, will
diff --git a/cake/libs/cache/apc.php b/lib/Cake/Cache/Engine/ApcEngine.php
similarity index 100%
rename from cake/libs/cache/apc.php
rename to lib/Cake/Cache/Engine/ApcEngine.php
diff --git a/cake/libs/cache/file.php b/lib/Cake/Cache/Engine/FileEngine.php
similarity index 100%
rename from cake/libs/cache/file.php
rename to lib/Cake/Cache/Engine/FileEngine.php
diff --git a/cake/libs/cache/memcache.php b/lib/Cake/Cache/Engine/MemcacheEngine.php
similarity index 100%
rename from cake/libs/cache/memcache.php
rename to lib/Cake/Cache/Engine/MemcacheEngine.php
diff --git a/cake/libs/cache/xcache.php b/lib/Cake/Cache/Engine/XcacheEngine.php
similarity index 100%
rename from cake/libs/cache/xcache.php
rename to lib/Cake/Cache/Engine/XcacheEngine.php
diff --git a/cake/libs/error/error_handler.php b/lib/Cake/Error/ErrorHandler.php
similarity index 100%
rename from cake/libs/error/error_handler.php
rename to lib/Cake/Error/ErrorHandler.php
diff --git a/cake/libs/error/exceptions.php b/lib/Cake/Error/exceptions.php
similarity index 100%
rename from cake/libs/error/exceptions.php
rename to lib/Cake/Error/exceptions.php
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index 5a6a2e697..93532e608 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -219,14 +219,15 @@ if (!defined('JS_URL')) {
require LIBS . 'basics.php';
-require LIBS . 'Utility' . DS . 'Inflector.php';
-require LIBS . 'Utility' . DS . 'Folder.php';
require LIBS . 'Core' . DS .'App.php';
+require LIBS . 'Error' . DS . 'exceptions.php';
+App::uses('ErrorHandler', 'Error');
App::uses('Configure', 'Core');
App::uses('Cache', 'Cache');
-//require LIBS . 'error' . DS . 'exceptions.php';
+
+
//require LIBS . 'object.php';
//require LIBS . 'configure.php';
//require LIBS . 'set.php';
From b4387d2f515a548fb714cf4c064672b2bdb71784 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 02:34:30 -0430
Subject: [PATCH 010/668] More replacements to get class loaded using the new
file scheme
---
cake/libs/controller/components/auth.php | 4 ++--
.../Cake/Controller/ComponentCollection.php | 0
.../controller.php => lib/Cake/Controller/Controller.php | 0
lib/Cake/Core/App.php | 8 ++------
cake/libs/object.php => lib/Cake/Core/Object.php | 0
lib/Cake/Error/ErrorHandler.php | 8 ++------
lib/Cake/Routing/Dispatcher.php | 2 +-
.../Cake/Routing/Route/CakeRoute.php | 0
lib/Cake/Routing/Router.php | 4 ++--
cake/libs/debugger.php => lib/Cake/Utility/Debugger.php | 4 ++--
cake/libs/string.php => lib/Cake/Utility/String.php | 0
lib/Cake/bootstrap.php | 9 +--------
12 files changed, 12 insertions(+), 27 deletions(-)
rename cake/libs/controller/component_collection.php => lib/Cake/Controller/ComponentCollection.php (100%)
rename cake/libs/controller/controller.php => lib/Cake/Controller/Controller.php (100%)
rename cake/libs/object.php => lib/Cake/Core/Object.php (100%)
rename cake/libs/route/cake_route.php => lib/Cake/Routing/Route/CakeRoute.php (100%)
rename cake/libs/debugger.php => lib/Cake/Utility/Debugger.php (99%)
rename cake/libs/string.php => lib/Cake/Utility/String.php (100%)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index b09faa2f4..4aa3478ae 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -20,9 +20,9 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Router', 'Core');
+App::uses('Router', 'Routing');
App::uses('Security', 'Core');
-App::uses('Debugger', 'Core');
+App::uses('Debugger', 'Utility');
/**
* Authentication control component class
diff --git a/cake/libs/controller/component_collection.php b/lib/Cake/Controller/ComponentCollection.php
similarity index 100%
rename from cake/libs/controller/component_collection.php
rename to lib/Cake/Controller/ComponentCollection.php
diff --git a/cake/libs/controller/controller.php b/lib/Cake/Controller/Controller.php
similarity index 100%
rename from cake/libs/controller/controller.php
rename to lib/Cake/Controller/Controller.php
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 5caf05e40..a363ad407 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -629,9 +629,7 @@ class App {
}
if (!isset(self::$__paths[$path])) {
- if (!class_exists('Folder')) {
- require LIBS . 'folder.php';
- }
+ App::uses('Folder', 'Utility');
$Folder = new Folder();
$directories = $Folder->tree($path, array('.svn', '.git', 'CVS', 'tests', 'templates'), 'dir');
sort($directories);
@@ -865,9 +863,7 @@ class App {
* @return array List of directories or files in directory
*/
private static function __list($path, $suffix = false, $extension = false) {
- if (!class_exists('Folder')) {
- require LIBS . 'folder.php';
- }
+ App::uses('Folder', 'Utility');
$items = array();
$Folder = new Folder($path);
$contents = $Folder->read(false, true);
diff --git a/cake/libs/object.php b/lib/Cake/Core/Object.php
similarity index 100%
rename from cake/libs/object.php
rename to lib/Cake/Core/Object.php
diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php
index 85cea7ec4..732b6328d 100644
--- a/lib/Cake/Error/ErrorHandler.php
+++ b/lib/Cake/Error/ErrorHandler.php
@@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Debugger', 'Utility');
+
/**
*
* Error Handler provides basic error and exception handling for your application. It captures and
@@ -143,9 +145,6 @@ class ErrorHandler {
$debug = Configure::read('debug');
if ($debug) {
- if (!class_exists('Debugger')) {
- require LIBS . 'debugger.php';
- }
$data = array(
'level' => $log,
'code' => $code,
@@ -164,9 +163,6 @@ class ErrorHandler {
}
$message = $error . ' (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
if (!empty($errorConfig['trace'])) {
- if (!class_exists('Debugger')) {
- require LIBS . 'debugger.php';
- }
$trace = Debugger::trace(array('start' => 1, 'format' => 'log'));
$message .= "\nTrace:\n" . $trace . "\n";
}
diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php
index d1c396148..1fd36319c 100644
--- a/lib/Cake/Routing/Dispatcher.php
+++ b/lib/Cake/Routing/Dispatcher.php
@@ -30,7 +30,7 @@ App::uses('CakeResponse', 'Network');
App::uses('Controller', 'Controller');
App::uses('Scaffold', 'Controller');
App::uses('View', 'View');
-App::uses('Debugger', 'Core');
+App::uses('Debugger', 'Utility');
/**
* Dispatcher converts Requests into controller actions. It uses the dispatched Request
diff --git a/cake/libs/route/cake_route.php b/lib/Cake/Routing/Route/CakeRoute.php
similarity index 100%
rename from cake/libs/route/cake_route.php
rename to lib/Cake/Routing/Route/CakeRoute.php
diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php
index 340d04261..3824fdd0c 100644
--- a/lib/Cake/Routing/Router.php
+++ b/lib/Cake/Routing/Router.php
@@ -18,8 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('CakeRequest', 'Core');
-App::uses('CakeRoute', 'Core');
+App::uses('CakeRequest', 'Network');
+App::uses('CakeRoute', 'Routing/Route');
/**
* Parses the request URL into controller, action, and parameters.
diff --git a/cake/libs/debugger.php b/lib/Cake/Utility/Debugger.php
similarity index 99%
rename from cake/libs/debugger.php
rename to lib/Cake/Utility/Debugger.php
index a6f060df7..d1900500a 100644
--- a/cake/libs/debugger.php
+++ b/lib/Cake/Utility/Debugger.php
@@ -24,8 +24,8 @@
* Included libraries.
*
*/
-App::uses('CakeLog', 'Core');
-App::uses('String', 'Core');
+App::uses('CakeLog', 'Log');
+App::uses('String', 'Utility');
/**
* Provide custom logging and error handling.
diff --git a/cake/libs/string.php b/lib/Cake/Utility/String.php
similarity index 100%
rename from cake/libs/string.php
rename to lib/Cake/Utility/String.php
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index 93532e608..1e649440e 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -225,14 +225,7 @@ require LIBS . 'Error' . DS . 'exceptions.php';
App::uses('ErrorHandler', 'Error');
App::uses('Configure', 'Core');
App::uses('Cache', 'Cache');
-
-
-
-//require LIBS . 'object.php';
-//require LIBS . 'configure.php';
-//require LIBS . 'set.php';
-//require LIBS . 'cache.php';
-//require LIBS . 'error' . DS . 'error_handler.php';
+App::uses('Object', 'Core');
Configure::bootstrap(isset($boot) ? $boot : true);
From fbbb5c9337de2cfffa9dca839f51655acd7b3401 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 02:45:22 -0430
Subject: [PATCH 011/668] Moving more clases to the new layout while trying to
make controller related classes load
---
.../Cake/Controller/Component/AclComponent.php | 0
.../Cake/Controller/Component/AuthComponent.php | 0
.../Cake/Controller/Component/CookieComponent.php | 0
.../Cake/Controller/Component/EmailComponent.php | 0
.../Controller/Component/RequestHandlerComponent.php | 0
.../Cake/Controller/Component/SecurityComponent.php | 0
.../Cake/Controller/Component/SessionComponent.php | 0
lib/Cake/Controller/ComponentCollection.php | 9 ++-------
lib/Cake/Controller/Controller.php | 2 +-
.../Cake/Network/CakeResponse.php | 0
.../Cake/Utility/ObjectCollection.php | 0
11 files changed, 3 insertions(+), 8 deletions(-)
rename cake/libs/controller/components/acl.php => lib/Cake/Controller/Component/AclComponent.php (100%)
rename cake/libs/controller/components/auth.php => lib/Cake/Controller/Component/AuthComponent.php (100%)
rename cake/libs/controller/components/cookie.php => lib/Cake/Controller/Component/CookieComponent.php (100%)
rename cake/libs/controller/components/email.php => lib/Cake/Controller/Component/EmailComponent.php (100%)
rename cake/libs/controller/components/request_handler.php => lib/Cake/Controller/Component/RequestHandlerComponent.php (100%)
rename cake/libs/controller/components/security.php => lib/Cake/Controller/Component/SecurityComponent.php (100%)
rename cake/libs/controller/components/session.php => lib/Cake/Controller/Component/SessionComponent.php (100%)
rename cake/libs/cake_response.php => lib/Cake/Network/CakeResponse.php (100%)
rename cake/libs/object_collection.php => lib/Cake/Utility/ObjectCollection.php (100%)
diff --git a/cake/libs/controller/components/acl.php b/lib/Cake/Controller/Component/AclComponent.php
similarity index 100%
rename from cake/libs/controller/components/acl.php
rename to lib/Cake/Controller/Component/AclComponent.php
diff --git a/cake/libs/controller/components/auth.php b/lib/Cake/Controller/Component/AuthComponent.php
similarity index 100%
rename from cake/libs/controller/components/auth.php
rename to lib/Cake/Controller/Component/AuthComponent.php
diff --git a/cake/libs/controller/components/cookie.php b/lib/Cake/Controller/Component/CookieComponent.php
similarity index 100%
rename from cake/libs/controller/components/cookie.php
rename to lib/Cake/Controller/Component/CookieComponent.php
diff --git a/cake/libs/controller/components/email.php b/lib/Cake/Controller/Component/EmailComponent.php
similarity index 100%
rename from cake/libs/controller/components/email.php
rename to lib/Cake/Controller/Component/EmailComponent.php
diff --git a/cake/libs/controller/components/request_handler.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php
similarity index 100%
rename from cake/libs/controller/components/request_handler.php
rename to lib/Cake/Controller/Component/RequestHandlerComponent.php
diff --git a/cake/libs/controller/components/security.php b/lib/Cake/Controller/Component/SecurityComponent.php
similarity index 100%
rename from cake/libs/controller/components/security.php
rename to lib/Cake/Controller/Component/SecurityComponent.php
diff --git a/cake/libs/controller/components/session.php b/lib/Cake/Controller/Component/SessionComponent.php
similarity index 100%
rename from cake/libs/controller/components/session.php
rename to lib/Cake/Controller/Component/SessionComponent.php
diff --git a/lib/Cake/Controller/ComponentCollection.php b/lib/Cake/Controller/ComponentCollection.php
index 9aa589566..f17a1f729 100644
--- a/lib/Cake/Controller/ComponentCollection.php
+++ b/lib/Cake/Controller/ComponentCollection.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('ObjectCollection', 'Core');
+App::uses('ObjectCollection', 'Utility');
class ComponentCollection extends ObjectCollection {
@@ -70,13 +70,8 @@ class ComponentCollection extends ObjectCollection {
return $this->_loaded[$name];
}
$componentClass = $name . 'Component';
+ App::uses($componentClass, 'Controller/Component');
if (!class_exists($componentClass)) {
- if (!App::import('Component', $component)) {
- throw new MissingComponentFileException(array(
- 'file' => Inflector::underscore($component) . '.php',
- 'class' => $componentClass
- ));
- }
if (!class_exists($componentClass)) {
throw new MissingComponentFileException(array(
'file' => Inflector::underscore($component) . '.php',
diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php
index a5c1ba8a1..21fce12ee 100644
--- a/lib/Cake/Controller/Controller.php
+++ b/lib/Cake/Controller/Controller.php
@@ -21,7 +21,7 @@
/**
* Include files
*/
-App::uses('CakeResponse', 'Core');
+App::uses('CakeResponse', 'Network');
App::uses('ClassRegistry', 'Core');
App::uses('ComponentCollection', 'Controller');
App::uses('View', 'View');
diff --git a/cake/libs/cake_response.php b/lib/Cake/Network/CakeResponse.php
similarity index 100%
rename from cake/libs/cake_response.php
rename to lib/Cake/Network/CakeResponse.php
diff --git a/cake/libs/object_collection.php b/lib/Cake/Utility/ObjectCollection.php
similarity index 100%
rename from cake/libs/object_collection.php
rename to lib/Cake/Utility/ObjectCollection.php
From c641baaf161c013e5b60e54576836663045c7243 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 02:49:44 -0430
Subject: [PATCH 012/668] Loading component classes ang beginnings of session
loading
---
.../component.php => lib/Cake/Controller/Component.php | 0
lib/Cake/Controller/Component/SessionComponent.php | 2 +-
lib/Cake/Controller/ComponentCollection.php | 1 +
cake/libs/cake_session.php => lib/Cake/Model/CakeSession.php | 0
4 files changed, 2 insertions(+), 1 deletion(-)
rename cake/libs/controller/component.php => lib/Cake/Controller/Component.php (100%)
rename cake/libs/cake_session.php => lib/Cake/Model/CakeSession.php (100%)
diff --git a/cake/libs/controller/component.php b/lib/Cake/Controller/Component.php
similarity index 100%
rename from cake/libs/controller/component.php
rename to lib/Cake/Controller/Component.php
diff --git a/lib/Cake/Controller/Component/SessionComponent.php b/lib/Cake/Controller/Component/SessionComponent.php
index 9406e9447..855cbcd20 100644
--- a/lib/Cake/Controller/Component/SessionComponent.php
+++ b/lib/Cake/Controller/Component/SessionComponent.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('CakeSession', 'Core');
+App::uses('CakeSession', 'Model');
/**
* Session Component.
diff --git a/lib/Cake/Controller/ComponentCollection.php b/lib/Cake/Controller/ComponentCollection.php
index f17a1f729..fa4226b63 100644
--- a/lib/Cake/Controller/ComponentCollection.php
+++ b/lib/Cake/Controller/ComponentCollection.php
@@ -17,6 +17,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('ObjectCollection', 'Utility');
+App::uses('Component', 'Controller');
class ComponentCollection extends ObjectCollection {
diff --git a/cake/libs/cake_session.php b/lib/Cake/Model/CakeSession.php
similarity index 100%
rename from cake/libs/cake_session.php
rename to lib/Cake/Model/CakeSession.php
From ec93152c9a069268dfaf6c7bea9651cf237f2b09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 02:51:42 -0430
Subject: [PATCH 013/668] Loading the set class successfully
---
lib/Cake/Model/CakeSession.php | 2 ++
cake/libs/set.php => lib/Cake/Utility/Set.php | 0
2 files changed, 2 insertions(+)
rename cake/libs/set.php => lib/Cake/Utility/Set.php (100%)
diff --git a/lib/Cake/Model/CakeSession.php b/lib/Cake/Model/CakeSession.php
index 5c078c7dd..df323a60e 100644
--- a/lib/Cake/Model/CakeSession.php
+++ b/lib/Cake/Model/CakeSession.php
@@ -23,6 +23,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Set', 'Utility');
+
/**
* Session class for Cake.
*
diff --git a/cake/libs/set.php b/lib/Cake/Utility/Set.php
similarity index 100%
rename from cake/libs/set.php
rename to lib/Cake/Utility/Set.php
From fa83ecda5bacc4ae6cfe3704ff30bd5164800571 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 02:57:20 -0430
Subject: [PATCH 014/668] Beginnings of model loading
---
lib/Cake/Controller/Controller.php | 2 +-
lib/Cake/Core/App.php | 4 +---
cake/libs/model/model.php => lib/Cake/Model/Model.php | 0
.../class_registry.php => lib/Cake/Utility/ClassRegistry.php | 0
lib/Cake/Utility/Set.php | 2 +-
5 files changed, 3 insertions(+), 5 deletions(-)
rename cake/libs/model/model.php => lib/Cake/Model/Model.php (100%)
rename cake/libs/class_registry.php => lib/Cake/Utility/ClassRegistry.php (100%)
diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php
index 21fce12ee..ffa3e14eb 100644
--- a/lib/Cake/Controller/Controller.php
+++ b/lib/Cake/Controller/Controller.php
@@ -22,7 +22,7 @@
* Include files
*/
App::uses('CakeResponse', 'Network');
-App::uses('ClassRegistry', 'Core');
+App::uses('ClassRegistry', 'Utility');
App::uses('ComponentCollection', 'Controller');
App::uses('View', 'View');
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index a363ad407..4242a47d9 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -733,9 +733,7 @@ class App {
switch ($load) {
case 'model':
- if (!class_exists('Model')) {
- require LIBS . 'model' . DS . 'model.php';
- }
+ App::uses('Model', 'Model');
if (!class_exists('AppModel')) {
App::import($type, 'AppModel', false);
}
diff --git a/cake/libs/model/model.php b/lib/Cake/Model/Model.php
similarity index 100%
rename from cake/libs/model/model.php
rename to lib/Cake/Model/Model.php
diff --git a/cake/libs/class_registry.php b/lib/Cake/Utility/ClassRegistry.php
similarity index 100%
rename from cake/libs/class_registry.php
rename to lib/Cake/Utility/ClassRegistry.php
diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php
index 7a86facdf..95b499161 100644
--- a/lib/Cake/Utility/Set.php
+++ b/lib/Cake/Utility/Set.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('String', 'Core');
+App::uses('String', 'Utility');
/**
* Class used for manipulation of arrays.
From 4bb6d583b76a7fb6325f851effb6230c9d8103f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 03:00:03 -0430
Subject: [PATCH 015/668] More work towards model loading
---
.../Cake/Model/BehaviorCollection.php | 0
.../Cake/Model/ConnectionManager.php | 0
2 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/model/behavior_collection.php => lib/Cake/Model/BehaviorCollection.php (100%)
rename cake/libs/model/connection_manager.php => lib/Cake/Model/ConnectionManager.php (100%)
diff --git a/cake/libs/model/behavior_collection.php b/lib/Cake/Model/BehaviorCollection.php
similarity index 100%
rename from cake/libs/model/behavior_collection.php
rename to lib/Cake/Model/BehaviorCollection.php
diff --git a/cake/libs/model/connection_manager.php b/lib/Cake/Model/ConnectionManager.php
similarity index 100%
rename from cake/libs/model/connection_manager.php
rename to lib/Cake/Model/ConnectionManager.php
From 592abb569c6b71805bd426e74208dc08981df3cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 11:16:42 -0430
Subject: [PATCH 016/668] More work towards loading datasources
---
lib/Cake/Model/ConnectionManager.php | 3 ++-
.../datasource.php => lib/Cake/Model/Datasource/DataSource.php | 0
.../dbo_source.php => lib/Cake/Model/Datasource/DboSource.php | 0
3 files changed, 2 insertions(+), 1 deletion(-)
rename cake/libs/model/datasources/datasource.php => lib/Cake/Model/Datasource/DataSource.php (100%)
rename cake/libs/model/datasources/dbo_source.php => lib/Cake/Model/Datasource/DboSource.php (100%)
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index 59dd5d37f..e07371a03 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('DataSource', 'Model/Datasource');
+
/**
* Manages loaded instances of DataSource objects
*
@@ -101,7 +103,6 @@ class ConnectionManager {
$conn = $_this->_connectionsEnum[$name];
$class = $conn['classname'];
- require LIBS . 'model' . DS . 'datasources' . DS . 'datasource.php';
if ($_this->loadDataSource($name) === null) {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Could not load class %s"), $class), E_USER_ERROR);
$null = null;
diff --git a/cake/libs/model/datasources/datasource.php b/lib/Cake/Model/Datasource/DataSource.php
similarity index 100%
rename from cake/libs/model/datasources/datasource.php
rename to lib/Cake/Model/Datasource/DataSource.php
diff --git a/cake/libs/model/datasources/dbo_source.php b/lib/Cake/Model/Datasource/DboSource.php
similarity index 100%
rename from cake/libs/model/datasources/dbo_source.php
rename to lib/Cake/Model/Datasource/DboSource.php
From be1263d4760238c290016dce621c082666de7cb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 11:52:23 -0430
Subject: [PATCH 017/668] Moving the first database driver to the correct
folder to start testing
---
lib/Cake/Model/ConnectionManager.php | 9 +++------
.../Cake/Model/Datasource/Database/Mysql.php | 0
2 files changed, 3 insertions(+), 6 deletions(-)
rename cake/libs/model/datasources/dbo/dbo_mysql.php => lib/Cake/Model/Datasource/Database/Mysql.php (100%)
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index e07371a03..b6ff55252 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -165,14 +165,11 @@ class ConnectionManager {
return false;
}
- if (!empty($conn['parent'])) {
- $_this->loadDataSource($conn['parent']);
- }
-
$conn = array_merge(array('plugin' => null, 'classname' => null, 'parent' => null), $conn);
- $class = "{$conn['plugin']}.{$conn['classname']}";
+ $class = trim("{$conn['plugin']}.{$conn['classname']}", '.');
- if (!App::import('Datasource', $class, !is_null($conn['plugin']))) {
+ App::uses($class, 'Model/Datasource');
+ if (class_exists($class)) {
trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s'), $class), E_USER_ERROR);
return null;
}
diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php
similarity index 100%
rename from cake/libs/model/datasources/dbo/dbo_mysql.php
rename to lib/Cake/Model/Datasource/Database/Mysql.php
From 7dc8d5e74678b56ce7958511897a8170857478ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 12:24:15 -0430
Subject: [PATCH 018/668] Simplifying datasources loading, it now requires
datasources to be configured with the 'datasource' array key, which is a
relative path from Model/Datasource/
---
lib/Cake/Model/ConnectionManager.php | 49 +++++++-------------
lib/Cake/Model/Datasource/Database/Mysql.php | 4 +-
2 files changed, 19 insertions(+), 34 deletions(-)
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index b6ff55252..4f67db5f5 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -161,15 +161,20 @@ class ConnectionManager {
$conn = $_this->_connectionsEnum[$connName];
}
- if (class_exists($conn['classname'])) {
+ if (class_exists($conn['classname'], false)) {
return false;
}
- $conn = array_merge(array('plugin' => null, 'classname' => null, 'parent' => null), $conn);
- $class = trim("{$conn['plugin']}.{$conn['classname']}", '.');
+ $plugin = $package = null;
+ if (!empty($conn['plugin'])) {
+ $plugin .= '.';
+ }
+ if (!empty($conn['package'])) {
+ $package = '/' . $conn['package'];
+ }
- App::uses($class, 'Model/Datasource');
- if (class_exists($class)) {
+ App::uses($conn['classname'], $plugin . 'Model/Datasource' . $package);
+ if (!class_exists($conn['classname'])) {
trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s'), $class), E_USER_ERROR);
return null;
}
@@ -230,36 +235,14 @@ class ConnectionManager {
* @return array An indexed array with: filename, classname, plugin and parent
*/
private function __connectionData($config) {
- if (!isset($config['datasource'])) {
- $config['datasource'] = 'dbo';
- }
- $filename = $classname = $parent = $plugin = null;
+ $package = $classname = $plugin = null;
- if (!empty($config['driver'])) {
- $parent = $this->__connectionData(array('datasource' => $config['datasource']));
- $parentSource = preg_replace('/_source$/', '', $parent['filename']);
-
- list($plugin, $classname) = pluginSplit($config['driver']);
- if ($plugin) {
- $source = Inflector::underscore($classname);
- } else {
- $source = $parentSource . '_' . $config['driver'];
- $classname = Inflector::camelize(strtolower($source));
- }
- $filename = $parentSource . DS . $source;
- } else {
- list($plugin, $classname) = pluginSplit($config['datasource']);
- if ($plugin) {
- $filename = Inflector::underscore($classname);
- } else {
- $filename = Inflector::underscore($config['datasource']);
- }
- if (substr($filename, -7) != '_source') {
- $filename .= '_source';
- }
- $classname = Inflector::camelize(strtolower($filename));
+ list($plugin, $classname) = pluginSplit($config['datasource']);
+ if (strpos($classname, '/') !== false) {
+ $package = dirname($classname);
+ $classname = basename($classname);
}
- return compact('filename', 'classname', 'parent', 'plugin');
+ return compact('package', 'classname', 'plugin');
}
/**
diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php
index 069cf089a..882aa61e0 100644
--- a/lib/Cake/Model/Datasource/Database/Mysql.php
+++ b/lib/Cake/Model/Datasource/Database/Mysql.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('DboSource', 'Model/Datasource');
+
/**
* MySQL DBO driver object
*
@@ -26,7 +28,7 @@
* @package cake
* @subpackage cake.cake.libs.model.datasources.dbo
*/
-class DboMysql extends DboSource {
+class Mysql extends DboSource {
/**
* Datasource description
From be9bcb3627c81575b701419bd8fbc27e63c66ed2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 13:31:04 -0430
Subject: [PATCH 019/668] Moving view clasess to their new home
---
cake/libs/view/helper.php => lib/Cake/View/Helper.php | 0
.../helpers/app_helper.php => lib/Cake/View/Helper/AppHelper.php | 0
.../helpers/cache.php => lib/Cake/View/Helper/CacheHelper.php | 0
.../view/helpers/form.php => lib/Cake/View/Helper/FormHelper.php | 0
.../view/helpers/html.php => lib/Cake/View/Helper/HtmlHelper.php | 0
.../Cake/View/Helper/JqueryEngineHelper.php | 0
.../libs/view/helpers/js.php => lib/Cake/View/Helper/JsHelper.php | 0
.../Cake/View/Helper/MootoolsEngineHelper.php | 0
.../helpers/number.php => lib/Cake/View/Helper/NumberHelper.php | 0
.../paginator.php => lib/Cake/View/Helper/PaginatorHelper.php | 0
.../Cake/View/Helper/PrototypeEngineHelper.php | 0
.../view/helpers/rss.php => lib/Cake/View/Helper/RssHelper.php | 0
.../helpers/session.php => lib/Cake/View/Helper/SessionHelper.php | 0
.../view/helpers/text.php => lib/Cake/View/Helper/TextHelper.php | 0
.../view/helpers/time.php => lib/Cake/View/Helper/TimeHelper.php | 0
.../helper_collection.php => lib/Cake/View/HelperCollection.php | 0
cake/libs/view/media.php => lib/Cake/View/MediaView.php | 0
cake/libs/view/theme.php => lib/Cake/View/ThemeView.php | 0
cake/libs/view/view.php => lib/Cake/View/View.php | 0
19 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/view/helper.php => lib/Cake/View/Helper.php (100%)
rename cake/libs/view/helpers/app_helper.php => lib/Cake/View/Helper/AppHelper.php (100%)
rename cake/libs/view/helpers/cache.php => lib/Cake/View/Helper/CacheHelper.php (100%)
rename cake/libs/view/helpers/form.php => lib/Cake/View/Helper/FormHelper.php (100%)
rename cake/libs/view/helpers/html.php => lib/Cake/View/Helper/HtmlHelper.php (100%)
rename cake/libs/view/helpers/jquery_engine.php => lib/Cake/View/Helper/JqueryEngineHelper.php (100%)
rename cake/libs/view/helpers/js.php => lib/Cake/View/Helper/JsHelper.php (100%)
rename cake/libs/view/helpers/mootools_engine.php => lib/Cake/View/Helper/MootoolsEngineHelper.php (100%)
rename cake/libs/view/helpers/number.php => lib/Cake/View/Helper/NumberHelper.php (100%)
rename cake/libs/view/helpers/paginator.php => lib/Cake/View/Helper/PaginatorHelper.php (100%)
rename cake/libs/view/helpers/prototype_engine.php => lib/Cake/View/Helper/PrototypeEngineHelper.php (100%)
rename cake/libs/view/helpers/rss.php => lib/Cake/View/Helper/RssHelper.php (100%)
rename cake/libs/view/helpers/session.php => lib/Cake/View/Helper/SessionHelper.php (100%)
rename cake/libs/view/helpers/text.php => lib/Cake/View/Helper/TextHelper.php (100%)
rename cake/libs/view/helpers/time.php => lib/Cake/View/Helper/TimeHelper.php (100%)
rename cake/libs/view/helper_collection.php => lib/Cake/View/HelperCollection.php (100%)
rename cake/libs/view/media.php => lib/Cake/View/MediaView.php (100%)
rename cake/libs/view/theme.php => lib/Cake/View/ThemeView.php (100%)
rename cake/libs/view/view.php => lib/Cake/View/View.php (100%)
diff --git a/cake/libs/view/helper.php b/lib/Cake/View/Helper.php
similarity index 100%
rename from cake/libs/view/helper.php
rename to lib/Cake/View/Helper.php
diff --git a/cake/libs/view/helpers/app_helper.php b/lib/Cake/View/Helper/AppHelper.php
similarity index 100%
rename from cake/libs/view/helpers/app_helper.php
rename to lib/Cake/View/Helper/AppHelper.php
diff --git a/cake/libs/view/helpers/cache.php b/lib/Cake/View/Helper/CacheHelper.php
similarity index 100%
rename from cake/libs/view/helpers/cache.php
rename to lib/Cake/View/Helper/CacheHelper.php
diff --git a/cake/libs/view/helpers/form.php b/lib/Cake/View/Helper/FormHelper.php
similarity index 100%
rename from cake/libs/view/helpers/form.php
rename to lib/Cake/View/Helper/FormHelper.php
diff --git a/cake/libs/view/helpers/html.php b/lib/Cake/View/Helper/HtmlHelper.php
similarity index 100%
rename from cake/libs/view/helpers/html.php
rename to lib/Cake/View/Helper/HtmlHelper.php
diff --git a/cake/libs/view/helpers/jquery_engine.php b/lib/Cake/View/Helper/JqueryEngineHelper.php
similarity index 100%
rename from cake/libs/view/helpers/jquery_engine.php
rename to lib/Cake/View/Helper/JqueryEngineHelper.php
diff --git a/cake/libs/view/helpers/js.php b/lib/Cake/View/Helper/JsHelper.php
similarity index 100%
rename from cake/libs/view/helpers/js.php
rename to lib/Cake/View/Helper/JsHelper.php
diff --git a/cake/libs/view/helpers/mootools_engine.php b/lib/Cake/View/Helper/MootoolsEngineHelper.php
similarity index 100%
rename from cake/libs/view/helpers/mootools_engine.php
rename to lib/Cake/View/Helper/MootoolsEngineHelper.php
diff --git a/cake/libs/view/helpers/number.php b/lib/Cake/View/Helper/NumberHelper.php
similarity index 100%
rename from cake/libs/view/helpers/number.php
rename to lib/Cake/View/Helper/NumberHelper.php
diff --git a/cake/libs/view/helpers/paginator.php b/lib/Cake/View/Helper/PaginatorHelper.php
similarity index 100%
rename from cake/libs/view/helpers/paginator.php
rename to lib/Cake/View/Helper/PaginatorHelper.php
diff --git a/cake/libs/view/helpers/prototype_engine.php b/lib/Cake/View/Helper/PrototypeEngineHelper.php
similarity index 100%
rename from cake/libs/view/helpers/prototype_engine.php
rename to lib/Cake/View/Helper/PrototypeEngineHelper.php
diff --git a/cake/libs/view/helpers/rss.php b/lib/Cake/View/Helper/RssHelper.php
similarity index 100%
rename from cake/libs/view/helpers/rss.php
rename to lib/Cake/View/Helper/RssHelper.php
diff --git a/cake/libs/view/helpers/session.php b/lib/Cake/View/Helper/SessionHelper.php
similarity index 100%
rename from cake/libs/view/helpers/session.php
rename to lib/Cake/View/Helper/SessionHelper.php
diff --git a/cake/libs/view/helpers/text.php b/lib/Cake/View/Helper/TextHelper.php
similarity index 100%
rename from cake/libs/view/helpers/text.php
rename to lib/Cake/View/Helper/TextHelper.php
diff --git a/cake/libs/view/helpers/time.php b/lib/Cake/View/Helper/TimeHelper.php
similarity index 100%
rename from cake/libs/view/helpers/time.php
rename to lib/Cake/View/Helper/TimeHelper.php
diff --git a/cake/libs/view/helper_collection.php b/lib/Cake/View/HelperCollection.php
similarity index 100%
rename from cake/libs/view/helper_collection.php
rename to lib/Cake/View/HelperCollection.php
diff --git a/cake/libs/view/media.php b/lib/Cake/View/MediaView.php
similarity index 100%
rename from cake/libs/view/media.php
rename to lib/Cake/View/MediaView.php
diff --git a/cake/libs/view/theme.php b/lib/Cake/View/ThemeView.php
similarity index 100%
rename from cake/libs/view/theme.php
rename to lib/Cake/View/ThemeView.php
diff --git a/cake/libs/view/view.php b/lib/Cake/View/View.php
similarity index 100%
rename from cake/libs/view/view.php
rename to lib/Cake/View/View.php
From f3eb2159eb5790a3de7b809865b703aac5458332 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 13:40:24 -0430
Subject: [PATCH 020/668] Making helpers load
---
lib/Cake/View/Helper/CacheHelper.php | 2 ++
lib/Cake/View/Helper/FormHelper.php | 2 ++
lib/Cake/View/Helper/HtmlHelper.php | 3 +++
lib/Cake/View/Helper/JsHelper.php | 1 +
lib/Cake/View/Helper/MootoolsEngineHelper.php | 1 +
lib/Cake/View/Helper/NumberHelper.php | 2 ++
lib/Cake/View/Helper/PaginatorHelper.php | 2 ++
lib/Cake/View/Helper/PrototypeEngineHelper.php | 1 +
lib/Cake/View/Helper/RssHelper.php | 4 +++-
lib/Cake/View/Helper/SessionHelper.php | 7 ++++---
lib/Cake/View/Helper/TextHelper.php | 3 ++-
lib/Cake/View/Helper/TimeHelper.php | 2 ++
lib/Cake/View/HelperCollection.php | 17 +++++------------
lib/Cake/View/View.php | 1 -
14 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php
index 6a1c430ea..d69c4b8f1 100644
--- a/lib/Cake/View/Helper/CacheHelper.php
+++ b/lib/Cake/View/Helper/CacheHelper.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppHelper', 'View/Helper');
+
/**
* CacheHelper helps create full page view caching.
*
diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php
index 0fe0e0ad2..efce3d6a1 100644
--- a/lib/Cake/View/Helper/FormHelper.php
+++ b/lib/Cake/View/Helper/FormHelper.php
@@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppHelper', 'View/Helper');
+
/**
* Form helper library.
*
diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php
index 2509e8d56..cacc7f1ee 100644
--- a/lib/Cake/View/Helper/HtmlHelper.php
+++ b/lib/Cake/View/Helper/HtmlHelper.php
@@ -17,6 +17,9 @@
* @since CakePHP(tm) v 0.9.1
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('AppHelper', 'View/Helper');
+
/**
* Html Helper class for easy use of HTML widgets.
*
diff --git a/lib/Cake/View/Helper/JsHelper.php b/lib/Cake/View/Helper/JsHelper.php
index a8a91adb8..7a605b423 100644
--- a/lib/Cake/View/Helper/JsHelper.php
+++ b/lib/Cake/View/Helper/JsHelper.php
@@ -18,6 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppHelper', 'View/Helper');
App::uses('Multibyte', 'Core');
/**
diff --git a/lib/Cake/View/Helper/MootoolsEngineHelper.php b/lib/Cake/View/Helper/MootoolsEngineHelper.php
index ec226d500..d513527b1 100644
--- a/lib/Cake/View/Helper/MootoolsEngineHelper.php
+++ b/lib/Cake/View/Helper/MootoolsEngineHelper.php
@@ -25,6 +25,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
App::uses('JsHelper', 'Helper');
class MootoolsEngineHelper extends JsBaseEngineHelper {
diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php
index b7d612471..dfd404ee7 100644
--- a/lib/Cake/View/Helper/NumberHelper.php
+++ b/lib/Cake/View/Helper/NumberHelper.php
@@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppHelper', 'View/Helper');
+
/**
* Number helper library.
*
diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php
index 5816c6b6a..dca0562eb 100644
--- a/lib/Cake/View/Helper/PaginatorHelper.php
+++ b/lib/Cake/View/Helper/PaginatorHelper.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppHelper', 'View/Helper');
+
/**
* Pagination Helper class for easy generation of pagination links.
*
diff --git a/lib/Cake/View/Helper/PrototypeEngineHelper.php b/lib/Cake/View/Helper/PrototypeEngineHelper.php
index 779fb5c45..8781ba880 100644
--- a/lib/Cake/View/Helper/PrototypeEngineHelper.php
+++ b/lib/Cake/View/Helper/PrototypeEngineHelper.php
@@ -20,6 +20,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
App::uses('JsHelper', 'Helper');
class PrototypeEngineHelper extends JsBaseEngineHelper {
diff --git a/lib/Cake/View/Helper/RssHelper.php b/lib/Cake/View/Helper/RssHelper.php
index d85eb7a23..17ebe8628 100644
--- a/lib/Cake/View/Helper/RssHelper.php
+++ b/lib/Cake/View/Helper/RssHelper.php
@@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Xml', 'Core');
+
+App::uses('AppHelper', 'View/Helper');
+App::uses('Xml', 'Utility');
/**
* RSS Helper class for easy output RSS structures.
diff --git a/lib/Cake/View/Helper/SessionHelper.php b/lib/Cake/View/Helper/SessionHelper.php
index 0f6aa002d..997e2c422 100644
--- a/lib/Cake/View/Helper/SessionHelper.php
+++ b/lib/Cake/View/Helper/SessionHelper.php
@@ -17,9 +17,10 @@
* @since CakePHP(tm) v 1.1.7.3328
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (!class_exists('CakeSession')) {
- require LIBS . 'cake_session.php';
-}
+
+App::uses('AppHelper', 'View/Helper');
+App::uses('CakeSession', 'Model');
+
/**
* Session Helper.
*
diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php
index c87455035..11b04c0a2 100644
--- a/lib/Cake/View/Helper/TextHelper.php
+++ b/lib/Cake/View/Helper/TextHelper.php
@@ -24,8 +24,9 @@
* Included libraries.
*
*/
+App::uses('AppHelper', 'View/Helper');
App::uses('HtmlHelper', 'Helper');
-App::uses('Multibyte', 'Core');
+App::uses('Multibyte', 'Utility');
/**
* Text helper library.
diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php
index df1a34051..4c1d8aec3 100644
--- a/lib/Cake/View/Helper/TimeHelper.php
+++ b/lib/Cake/View/Helper/TimeHelper.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppHelper', 'View/Helper');
+
/**
* Time Helper class for easy use of time data.
*
diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php
index 66200a44b..99e709c03 100644
--- a/lib/Cake/View/HelperCollection.php
+++ b/lib/Cake/View/HelperCollection.php
@@ -54,19 +54,12 @@ class HelperCollection extends ObjectCollection {
return $this->_loaded[$name];
}
$helperClass = $name . 'Helper';
+ App::uses($helperClass, 'View/Helper');
if (!class_exists($helperClass)) {
- if (!App::import('Helper', $helper)) {
- throw new MissingHelperFileException(array(
- 'class' => $helperClass,
- 'file' => Inflector::underscore($name) . '.php'
- ));
- }
- if (!class_exists($helperClass)) {
- throw new MissingHelperClassException(array(
- 'class' => $helperClass,
- 'file' => Inflector::underscore($name) . '.php'
- ));
- }
+ throw new MissingHelperClassException(array(
+ 'class' => $helperClass,
+ 'file' => Inflector::underscore($name) . '.php'
+ ));
}
$this->_loaded[$name] = new $helperClass($this->_View, $settings);
diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php
index a9b5481e5..9ca29b464 100644
--- a/lib/Cake/View/View.php
+++ b/lib/Cake/View/View.php
@@ -22,7 +22,6 @@
* Included libraries.
*/
App::uses('HelperCollection', 'View');
-App::uses('Helper', 'View');
/**
* View, the V in the MVC triad.
From 6b40c9c85426b2228311dace1536282a607881b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 13:45:07 -0430
Subject: [PATCH 021/668] Moving I18n related classes to the new folder schema
---
cake/libs/validation.php | 2 +-
.../Controller/Component/EmailComponent.php | 2 +-
cake/libs/i18n.php => lib/Cake/I18n/I18n.php | 0
cake/libs/l10n.php => lib/Cake/I18n/L10n.php | 0
.../Cake/I18n/Multibyte.php | 0
lib/Cake/View/Helper/JsHelper.php | 2 +-
lib/Cake/View/Helper/TextHelper.php | 2 +-
lib/Cake/basics.php | 28 +++++--------------
8 files changed, 11 insertions(+), 25 deletions(-)
rename cake/libs/i18n.php => lib/Cake/I18n/I18n.php (100%)
rename cake/libs/l10n.php => lib/Cake/I18n/L10n.php (100%)
rename cake/libs/multibyte.php => lib/Cake/I18n/Multibyte.php (100%)
diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index 00e7e8fe1..d4db77ed2 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Multibyte', 'Core');
+App::uses('Multibyte', 'I18n');
/**
* Offers different validation methods.
diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php
index 965084589..47ab6775b 100755
--- a/lib/Cake/Controller/Component/EmailComponent.php
+++ b/lib/Cake/Controller/Component/EmailComponent.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.3467
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Multibyte', 'Core');
+App::uses('Multibyte', 'I18n');
/**
* EmailComponent
diff --git a/cake/libs/i18n.php b/lib/Cake/I18n/I18n.php
similarity index 100%
rename from cake/libs/i18n.php
rename to lib/Cake/I18n/I18n.php
diff --git a/cake/libs/l10n.php b/lib/Cake/I18n/L10n.php
similarity index 100%
rename from cake/libs/l10n.php
rename to lib/Cake/I18n/L10n.php
diff --git a/cake/libs/multibyte.php b/lib/Cake/I18n/Multibyte.php
similarity index 100%
rename from cake/libs/multibyte.php
rename to lib/Cake/I18n/Multibyte.php
diff --git a/lib/Cake/View/Helper/JsHelper.php b/lib/Cake/View/Helper/JsHelper.php
index 7a605b423..e07c5779c 100644
--- a/lib/Cake/View/Helper/JsHelper.php
+++ b/lib/Cake/View/Helper/JsHelper.php
@@ -19,7 +19,7 @@
*/
App::uses('AppHelper', 'View/Helper');
-App::uses('Multibyte', 'Core');
+App::uses('Multibyte', 'I18n');
/**
* Javascript Generator helper class for easy use of JavaScript.
diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php
index 11b04c0a2..1d836ae70 100644
--- a/lib/Cake/View/Helper/TextHelper.php
+++ b/lib/Cake/View/Helper/TextHelper.php
@@ -26,7 +26,7 @@
*/
App::uses('AppHelper', 'View/Helper');
App::uses('HtmlHelper', 'Helper');
-App::uses('Multibyte', 'Utility');
+App::uses('Multibyte', 'I18n');
/**
* Text helper library.
diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php
index ca935acde..1b1fbc5a5 100644
--- a/lib/Cake/basics.php
+++ b/lib/Cake/basics.php
@@ -469,9 +469,7 @@ if (!function_exists('sortByKey')) {
if (!$singular) {
return;
}
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
+ App::uses('I18n', 'I18n');
return I18n::translate($singular);
}
@@ -489,9 +487,7 @@ if (!function_exists('sortByKey')) {
if (!$singular) {
return;
}
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
+ App::uses('I18n', 'I18n');
return I18n::translate($singular, $plural, null, 6, $count);
}
@@ -507,9 +503,7 @@ if (!function_exists('sortByKey')) {
if (!$msg) {
return;
}
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
+ App::uses('I18n', 'I18n');
return I18n::translate($msg, null, $domain);
}
@@ -529,9 +523,7 @@ if (!function_exists('sortByKey')) {
if (!$singular) {
return;
}
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
+ App::uses('I18n', 'I18n');
return I18n::translate($singular, $plural, $domain, 6, $count);
}
@@ -562,9 +554,7 @@ if (!function_exists('sortByKey')) {
if (!$msg) {
return;
}
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
+ App::uses('I18n', 'I18n');
return I18n::translate($msg, null, $domain, $category);
}
@@ -599,9 +589,7 @@ if (!function_exists('sortByKey')) {
if (!$singular) {
return;
}
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
+ App::uses('I18n', 'I18n');
return I18n::translate($singular, $plural, $domain, $category, $count);
}
@@ -628,9 +616,7 @@ if (!function_exists('sortByKey')) {
if (!$msg) {
return;
}
- if (!class_exists('I18n')) {
- App::import('Core', 'i18n');
- }
+ App::uses('I18n', 'I18n');
return I18n::translate($msg, null, null, $category);
}
From ff8b1a10413c34781a52e2a6fa1b0d6df6569fdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 13:50:26 -0430
Subject: [PATCH 022/668] Stating to move loggers to the new folder
---
lib/Cake/Error/ErrorHandler.php | 7 +------
lib/Cake/I18n/I18n.php | 4 ++--
cake/libs/cake_log.php => lib/Cake/Log/CakeLog.php | 0
.../log/file_log.php => lib/Cake/Log/Engine/FileLog.php | 0
4 files changed, 3 insertions(+), 8 deletions(-)
rename cake/libs/cake_log.php => lib/Cake/Log/CakeLog.php (100%)
rename cake/libs/log/file_log.php => lib/Cake/Log/Engine/FileLog.php (100%)
diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php
index 732b6328d..7dcdb6931 100644
--- a/lib/Cake/Error/ErrorHandler.php
+++ b/lib/Cake/Error/ErrorHandler.php
@@ -21,6 +21,7 @@
*/
App::uses('Debugger', 'Utility');
+App::uses('CakeLog', 'Log');
/**
*
@@ -109,9 +110,6 @@ class ErrorHandler {
App::import('Core', 'error/ExceptionRenderer');
$config = Configure::read('Exception');
if (!empty($config['log'])) {
- if (!class_exists('CakeLog')) {
- require LIBS . 'cake_log.php';
- }
CakeLog::write(LOG_ERR, '[' . get_class($exception) . '] ' . $exception->getMessage());
}
if ($config['renderer'] !== 'ExceptionRenderer') {
@@ -158,9 +156,6 @@ class ErrorHandler {
);
return Debugger::getInstance()->outputError($data);
} else {
- if (!class_exists('CakeLog')) {
- require LIBS . 'cake_log.php';
- }
$message = $error . ' (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
if (!empty($errorConfig['trace'])) {
$trace = Debugger::trace(array('start' => 1, 'format' => 'log'));
diff --git a/lib/Cake/I18n/I18n.php b/lib/Cake/I18n/I18n.php
index bab553d1a..b85d9b75b 100644
--- a/lib/Cake/I18n/I18n.php
+++ b/lib/Cake/I18n/I18n.php
@@ -21,8 +21,8 @@
/**
* Included libraries.
*/
-App::uses('L10n', 'Core');
-App::uses('Multibyte', 'Core');
+App::uses('L10n', 'I18n');
+App::uses('Multibyte', 'I18n');
/**
* I18n handles translation of Text and time format strings.
diff --git a/cake/libs/cake_log.php b/lib/Cake/Log/CakeLog.php
similarity index 100%
rename from cake/libs/cake_log.php
rename to lib/Cake/Log/CakeLog.php
diff --git a/cake/libs/log/file_log.php b/lib/Cake/Log/Engine/FileLog.php
similarity index 100%
rename from cake/libs/log/file_log.php
rename to lib/Cake/Log/Engine/FileLog.php
From 80452397b6a65619b7d6d43914e5b1d546f25f00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 13:56:26 -0430
Subject: [PATCH 023/668] Changing the way loggers are loaded, this will
probable need some changes on userland
---
lib/Cake/Log/CakeLog.php | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/lib/Cake/Log/CakeLog.php b/lib/Cake/Log/CakeLog.php
index f1c5b32cf..f09f9c79b 100644
--- a/lib/Cake/Log/CakeLog.php
+++ b/lib/Cake/Log/CakeLog.php
@@ -124,15 +124,9 @@ class CakeLog {
* @return mixed boolean false on any failures, string of classname to use if search was successful.
*/
protected static function _getLogger($loggerName) {
- list($plugin, $loggerName) = pluginSplit($loggerName);
+ list($plugin, $loggerName) = pluginSplit($loggerName, true);
- if ($plugin) {
- App::import('Lib', $plugin . '.log/' . $loggerName);
- } else {
- if (!App::import('Lib', 'log/' . $loggerName)) {
- App::import('Core', 'log/' . $loggerName);
- }
- }
+ App::uses($loggerName, $plugin . 'Log/Engine');
if (!class_exists($loggerName)) {
throw new Exception(sprintf(__('Could not load class %s'), $loggerName));
}
@@ -165,9 +159,7 @@ class CakeLog {
* @return void
*/
protected static function _autoConfig() {
- if (!class_exists('FileLog')) {
- App::import('Core', 'log/FileLog');
- }
+ self::_getLogger('FileLog');
self::$_streams['default'] = new FileLog(array('path' => LOGS));
}
From e3f85ccda895e49e6a642f4256a365a7d45b468f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 14:06:30 -0430
Subject: [PATCH 024/668] loading the ExceptionRenderer
---
lib/Cake/Error/ErrorHandler.php | 2 +-
.../Cake/Error/ExceptionRenderer.php | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename cake/libs/error/exception_renderer.php => lib/Cake/Error/ExceptionRenderer.php (100%)
diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php
index 7dcdb6931..5124136c2 100644
--- a/lib/Cake/Error/ErrorHandler.php
+++ b/lib/Cake/Error/ErrorHandler.php
@@ -22,6 +22,7 @@
App::uses('Debugger', 'Utility');
App::uses('CakeLog', 'Log');
+App::uses('ExceptionRenderer', 'Error');
/**
*
@@ -107,7 +108,6 @@ class ErrorHandler {
* @see http://php.net/manual/en/function.set-exception-handler.php
*/
public static function handleException(Exception $exception) {
- App::import('Core', 'error/ExceptionRenderer');
$config = Configure::read('Exception');
if (!empty($config['log'])) {
CakeLog::write(LOG_ERR, '[' . get_class($exception) . '] ' . $exception->getMessage());
diff --git a/cake/libs/error/exception_renderer.php b/lib/Cake/Error/ExceptionRenderer.php
similarity index 100%
rename from cake/libs/error/exception_renderer.php
rename to lib/Cake/Error/ExceptionRenderer.php
From e425b68a867cbd9a4532bd7c4677131ae6155ec6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 15:11:15 -0430
Subject: [PATCH 025/668] Loading the CakeErrorController
---
.../Cake/Controller/CakeErrorController.php | 0
lib/Cake/Error/ExceptionRenderer.php | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
rename cake/libs/controller/cake_error_controller.php => lib/Cake/Controller/CakeErrorController.php (100%)
diff --git a/cake/libs/controller/cake_error_controller.php b/lib/Cake/Controller/CakeErrorController.php
similarity index 100%
rename from cake/libs/controller/cake_error_controller.php
rename to lib/Cake/Controller/CakeErrorController.php
diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php
index 0d6c71b83..1ea26c502 100644
--- a/lib/Cake/Error/ExceptionRenderer.php
+++ b/lib/Cake/Error/ExceptionRenderer.php
@@ -141,7 +141,7 @@ class ExceptionRenderer {
*/
protected function _getController($exception) {
static $__previousError = null;
- App::import('Controller', 'CakeError');
+ App::uses('CakeErrorController', 'Controller');
if ($__previousError != $exception) {
$__previousError = $exception;
From 377cbc546b1f204f5b8070f22ef8f367be97acdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 22:06:53 -0430
Subject: [PATCH 026/668] Fixing some errors in loading view classes
---
.../Cake/Controller/AppController.php | 0
lib/Cake/Core/App.php | 2 +-
lib/Cake/Core/Object.php | 2 ++
lib/Cake/View/Helper/PaginatorHelper.php | 4 +---
4 files changed, 4 insertions(+), 4 deletions(-)
rename cake/libs/controller/app_controller.php => lib/Cake/Controller/AppController.php (100%)
diff --git a/cake/libs/controller/app_controller.php b/lib/Cake/Controller/AppController.php
similarity index 100%
rename from cake/libs/controller/app_controller.php
rename to lib/Cake/Controller/AppController.php
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 4242a47d9..eb7d0319f 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -609,7 +609,7 @@ class App {
}
if (empty(self::$__paths)) {
- //self::$__paths = Cache::read('dir_map', '_cake_core_');
+ self::$__paths = Cache::read('dir_map', '_cake_core_');
}
foreach (self::$search as $path) {
diff --git a/lib/Cake/Core/Object.php b/lib/Cake/Core/Object.php
index 0f1d49030..e1f232728 100644
--- a/lib/Cake/Core/Object.php
+++ b/lib/Cake/Core/Object.php
@@ -21,6 +21,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Set', 'Utility');
+
/**
* Object class provides a few generic methods used in several subclasses.
*
diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php
index dca0562eb..7d19d4753 100644
--- a/lib/Cake/View/Helper/PaginatorHelper.php
+++ b/lib/Cake/View/Helper/PaginatorHelper.php
@@ -96,9 +96,7 @@ class PaginatorHelper extends AppHelper {
$ajaxProvider = isset($settings['ajax']) ? $settings['ajax'] : 'Js';
$this->helpers[] = $ajaxProvider;
$this->_ajaxHelperClass = $ajaxProvider;
- if (!class_exists($ajaxProvider . 'Helper')) {
- App::import('Helper', $ajaxProvider);
- }
+ App::uses($ajaxProvider . 'Helper', 'View/Helper');
$classname = $ajaxProvider . 'Helper';
if (!method_exists($classname, 'link')) {
throw new Exception(sprintf(
From 02495188ef6203a5f2cfc84f945e029308f11ab6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 4 Dec 2010 22:59:55 -0430
Subject: [PATCH 027/668] Moving the pages controller
---
.../Cake/Controller/PagesController.php | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/controller/pages_controller.php => lib/Cake/Controller/PagesController.php (100%)
diff --git a/cake/libs/controller/pages_controller.php b/lib/Cake/Controller/PagesController.php
similarity index 100%
rename from cake/libs/controller/pages_controller.php
rename to lib/Cake/Controller/PagesController.php
From fcd23b09789b7daab393e2346a0b50c418c18c31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 5 Dec 2010 10:54:42 -0430
Subject: [PATCH 028/668] Starting to change the class loading for app classes
---
lib/Cake/Controller/PagesController.php | 2 +
lib/Cake/Core/App.php | 62 ++++++++++---------
.../Cake/Model/AppModel.php | 0
lib/Cake/Routing/Dispatcher.php | 12 ++--
lib/Cake/Utility/ClassRegistry.php | 13 ++--
lib/Cake/View/View.php | 2 +-
lib/Cake/bootstrap.php | 2 +
7 files changed, 51 insertions(+), 42 deletions(-)
rename cake/libs/model/app_model.php => lib/Cake/Model/AppModel.php (100%)
diff --git a/lib/Cake/Controller/PagesController.php b/lib/Cake/Controller/PagesController.php
index bc7a380e7..60d9e0290 100644
--- a/lib/Cake/Controller/PagesController.php
+++ b/lib/Cake/Controller/PagesController.php
@@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppController', 'Controller');
+
/**
* Static content controller
*
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index eb7d0319f..b85aa9921 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -207,6 +207,12 @@ class App {
*/
private static $__classMap = array();
+/**
+ * Holds the possible paths for each package name
+ *
+ */
+ private static $__packages = array();
+
/**
* Used to read information stored path
*
@@ -218,10 +224,10 @@ class App {
* @return string array
*/
public static function path($type) {
- if (!isset(self::${$type})) {
+ if (!isset(self::$__packages[$type])) {
return array();
}
- return self::${$type};
+ return self::$__packages[$type];
}
/**
@@ -234,14 +240,14 @@ class App {
*/
public static function build($paths = array(), $reset = false) {
$defaults = array(
- 'models' => array(MODELS),
- 'behaviors' => array(BEHAVIORS),
- 'datasources' => array(MODELS . 'datasources'),
- 'controllers' => array(CONTROLLERS),
- 'components' => array(COMPONENTS),
+ 'Model' => array(MODELS),
+ 'Model/Behavior' => array(BEHAVIORS),
+ 'Datasource' => array(MODELS . 'datasources'),
+ 'Controller' => array(CONTROLLERS),
+ 'Controller/Component' => array(COMPONENTS),
'libs' => array(APPLIBS),
- 'views' => array(VIEWS),
- 'helpers' => array(HELPERS),
+ 'View' => array(VIEWS),
+ 'View/Helper' => array(HELPERS),
'locales' => array(APP . 'locale' . DS),
'shells' => array(
APP . 'console' . DS . 'shells' . DS,
@@ -254,7 +260,7 @@ class App {
if ($reset == true) {
foreach ($paths as $type => $new) {
- self::${$type} = (array)$new;
+ self::$__packages[$type] = (array)$new;
}
return $paths;
}
@@ -263,27 +269,19 @@ class App {
$app = array('models' => true, 'controllers' => true, 'helpers' => true);
foreach ($defaults as $type => $default) {
- $merge = array();
- if (isset($app[$type])) {
- $merge = array(APP);
- }
- if (isset($core[$type])) {
- $merge = array_merge($merge, (array)$core[$type]);
- }
-
- if (empty(self::${$type}) || empty($paths)) {
- self::${$type} = $default;
+ if (empty(self::$__packages[$type]) || empty($paths)) {
+ self::$__packages[$type] = $default;
}
if (!empty($paths[$type])) {
$path = array_flip(array_flip(array_merge(
- (array)$paths[$type], self::${$type}, $merge
+ (array)$paths[$type], self::$__packages[$type], $merge
)));
- self::${$type} = array_values($path);
+ self::$__packages[$type] = array_values($path);
} else {
- $path = array_flip(array_flip(array_merge(self::${$type}, $merge)));
- self::${$type} = array_values($path);
+ $path = array_flip(array_flip(self::$__packages[$type]));
+ self::$__packages[$type] = array_values($path);
}
}
}
@@ -442,9 +440,15 @@ class App {
public static function load($className) {
if (isset(self::$__classMap[$className])) {
- $file = LIBS . self::$__classMap[$className] . DS . $className . '.php';
- if (file_exists($file)) {
- return include $file;
+ $package = self::$__classMap[$className];
+ $paths = self::path($package);
+ $paths[] = LIBS . self::$__classMap[$className] . DS;
+
+ foreach ($paths as $path) {
+ $file = $path . $className . '.php';
+ if (file_exists($file)) {
+ return include $file;
+ }
}
}
return false;
@@ -900,6 +904,4 @@ class App {
Cache::write('object_map', self::$__objects, '_cake_core_');
}
}
-}
-
-spl_autoload_register(array('App', 'load'));
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/cake/libs/model/app_model.php b/lib/Cake/Model/AppModel.php
similarity index 100%
rename from cake/libs/model/app_model.php
rename to lib/Cake/Model/AppModel.php
diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php
index 1fd36319c..251b56f6e 100644
--- a/lib/Cake/Routing/Dispatcher.php
+++ b/lib/Cake/Routing/Dispatcher.php
@@ -223,10 +223,7 @@ class Dispatcher {
if (!$ctrlClass) {
return false;
}
- $ctrlClass .= 'Controller';
- if (class_exists($ctrlClass)) {
- return new $ctrlClass($request);
- }
+ return new $ctrlClass($request);
}
/**
@@ -245,8 +242,11 @@ class Dispatcher {
$controller = Inflector::camelize($request->params['controller']);
}
if ($pluginPath . $controller) {
- if (App::import('Controller', $pluginPath . $controller)) {
- return $controller;
+ $class = $controller . 'Controller';
+ App::uses('AppController', 'Controller');
+ App::uses($class, $pluginPath . 'Controller');
+ if (class_exists($class)) {
+ return $class;
}
}
return false;
diff --git a/lib/Cake/Utility/ClassRegistry.php b/lib/Cake/Utility/ClassRegistry.php
index cc2ebeb3b..a80abdc98 100644
--- a/lib/Cake/Utility/ClassRegistry.php
+++ b/lib/Cake/Utility/ClassRegistry.php
@@ -134,14 +134,17 @@ class ClassRegistry {
return $model;
}
- if (class_exists($class) || App::import($type, $pluginPath . $class)) {
+ App::uses('Model', 'Model');
+ App::uses('AppModel', 'Model');
+ App::uses($class, $pluginPath . $type);
+ if (class_exists($class)) {
${$class} = new $class($settings);
} elseif ($type === 'Model') {
- if ($plugin && class_exists($plugin . 'AppModel')) {
- $appModel = $plugin . 'AppModel';
- } else {
+ //if ($plugin && class_exists($plugin . 'AppModel')) {
+ // $appModel = $plugin . 'AppModel';
+ //} else {
$appModel = 'AppModel';
- }
+ //}
$settings['name'] = $class;
${$class} = new $appModel($settings);
}
diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php
index 9ca29b464..c080ccc65 100644
--- a/lib/Cake/View/View.php
+++ b/lib/Cake/View/View.php
@@ -799,7 +799,7 @@ class View extends Object {
return $this->__paths;
}
$paths = array();
- $viewPaths = App::path('views');
+ $viewPaths = App::path('View');
$corePaths = array_flip(App::core('views'));
if (!empty($plugin)) {
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index 1e649440e..f7ca698e3 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -222,6 +222,8 @@ require LIBS . 'basics.php';
require LIBS . 'Core' . DS .'App.php';
require LIBS . 'Error' . DS . 'exceptions.php';
+spl_autoload_register(array('App', 'load'));
+
App::uses('ErrorHandler', 'Error');
App::uses('Configure', 'Core');
App::uses('Cache', 'Cache');
From 0596f5a2453b1d3de72856c5c0e8dc04e71ffcbc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 5 Dec 2010 12:00:36 -0430
Subject: [PATCH 029/668] Adding cache support for class loader
---
lib/Cake/Core/App.php | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index b85aa9921..fb4bdb9b3 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -440,6 +440,11 @@ class App {
public static function load($className) {
if (isset(self::$__classMap[$className])) {
+
+ if ($file = self::__mapped($className)) {
+ return include $file;
+ }
+
$package = self::$__classMap[$className];
$paths = self::path($package);
$paths[] = LIBS . self::$__classMap[$className] . DS;
@@ -447,6 +452,7 @@ class App {
foreach ($paths as $path) {
$file = $path . $className . '.php';
if (file_exists($file)) {
+ self::__map($file, $className);
return include $file;
}
}
@@ -678,16 +684,15 @@ class App {
*
* @param string $file full path to file
* @param string $name unique name for this map
- * @param string $type type object being mapped
* @param string $plugin camelized if object is from a plugin, the name of the plugin
* @return void
* @access private
*/
- private static function __map($file, $name, $type, $plugin) {
+ private static function __map($file, $name, $plugin = null) {
if ($plugin) {
- self::$__map['Plugin'][$plugin][$type][$name] = $file;
+ self::$__map['Plugin'][$plugin][$name] = $file;
} else {
- self::$__map[$type][$name] = $file;
+ self::$__map[$name] = $file;
}
}
@@ -695,21 +700,20 @@ class App {
* Returns a file's complete path.
*
* @param string $name unique name
- * @param string $type type object
* @param string $plugin camelized if object is from a plugin, the name of the plugin
* @return mixed, file path if found, false otherwise
* @access private
*/
- private static function __mapped($name, $type, $plugin) {
+ private static function __mapped($name, $plugin = null) {
if ($plugin) {
- if (isset(self::$__map['Plugin'][$plugin][$type]) && isset(self::$__map['Plugin'][$plugin][$type][$name])) {
- return self::$__map['Plugin'][$plugin][$type][$name];
+ if (isset(self::$__map['Plugin'][$plugin][$name])) {
+ return self::$__map['Plugin'][$plugin][$name];
}
return false;
}
- if (isset(self::$__map[$type]) && isset(self::$__map[$type][$name])) {
- return self::$__map[$type][$name];
+ if (isset(self::$__map[$name])) {
+ return self::$__map[$name];
}
return false;
}
@@ -897,9 +901,6 @@ class App {
*/
public static function shutdown() {
if (self::$__cache) {
- $core = App::core('cake');
- unset(self::$__paths[rtrim($core[0], DS)]);
- Cache::write('dir_map', array_filter(self::$__paths), '_cake_core_');
Cache::write('file_map', array_filter(self::$__map), '_cake_core_');
Cache::write('object_map', self::$__objects, '_cake_core_');
}
From c542ac20c9940e147e3bd02278e26b8f4c9a75ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 5 Dec 2010 13:07:01 -0430
Subject: [PATCH 030/668] Moving core view to the new folder and allowing the
view class to find those views
---
lib/Cake/Core/App.php | 4 ++--
lib/Cake/Utility/ClassRegistry.php | 8 ++++----
.../view/scaffold.php => lib/Cake/View/ScaffoldView.php | 0
lib/Cake/View/View.php | 3 ++-
.../Cake/View}/elements/email/html/default.ctp | 0
.../Cake/View}/elements/email/text/default.ctp | 0
.../Cake/View}/elements/exception_stack_trace.ctp | 0
{cake/libs/view => lib/Cake/View}/elements/sql_dump.ctp | 0
{cake/libs/view => lib/Cake/View}/errors/error400.ctp | 0
{cake/libs/view => lib/Cake/View}/errors/error500.ctp | 0
.../libs/view => lib/Cake/View}/errors/missing_action.ctp | 0
.../Cake/View}/errors/missing_behavior_class.ctp | 0
.../Cake/View}/errors/missing_behavior_file.ctp | 0
.../Cake/View}/errors/missing_component_class.ctp | 0
.../Cake/View}/errors/missing_component_file.ctp | 0
.../view => lib/Cake/View}/errors/missing_connection.ctp | 0
.../view => lib/Cake/View}/errors/missing_controller.ctp | 0
.../view => lib/Cake/View}/errors/missing_database.ctp | 0
.../Cake/View}/errors/missing_helper_class.ctp | 0
.../view => lib/Cake/View}/errors/missing_helper_file.ctp | 0
.../libs/view => lib/Cake/View}/errors/missing_layout.ctp | 0
.../libs/view => lib/Cake/View}/errors/missing_table.ctp | 0
{cake/libs/view => lib/Cake/View}/errors/missing_view.ctp | 0
.../libs/view => lib/Cake/View}/errors/private_action.ctp | 0
.../libs/view => lib/Cake/View}/errors/scaffold_error.ctp | 0
{cake/libs/view => lib/Cake/View}/layouts/ajax.ctp | 0
{cake/libs/view => lib/Cake/View}/layouts/default.ctp | 0
.../view => lib/Cake/View}/layouts/email/html/default.ctp | 0
.../view => lib/Cake/View}/layouts/email/text/default.ctp | 0
{cake/libs/view => lib/Cake/View}/layouts/flash.ctp | 0
{cake/libs/view => lib/Cake/View}/layouts/js/default.ctp | 0
{cake/libs/view => lib/Cake/View}/layouts/rss/default.ctp | 0
{cake/libs/view => lib/Cake/View}/layouts/xml/default.ctp | 0
{cake/libs/view => lib/Cake/View}/pages/home.ctp | 0
{cake/libs/view => lib/Cake/View}/scaffolds/edit.ctp | 0
{cake/libs/view => lib/Cake/View}/scaffolds/index.ctp | 0
{cake/libs/view => lib/Cake/View}/scaffolds/view.ctp | 0
37 files changed, 8 insertions(+), 7 deletions(-)
rename cake/libs/view/scaffold.php => lib/Cake/View/ScaffoldView.php (100%)
rename {cake/libs/view => lib/Cake/View}/elements/email/html/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/elements/email/text/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/elements/exception_stack_trace.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/elements/sql_dump.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/error400.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/error500.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_action.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_behavior_class.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_behavior_file.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_component_class.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_component_file.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_connection.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_controller.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_database.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_helper_class.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_helper_file.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_layout.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_table.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/missing_view.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/private_action.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/errors/scaffold_error.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/ajax.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/email/html/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/email/text/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/flash.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/js/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/rss/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/layouts/xml/default.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/pages/home.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/scaffolds/edit.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/scaffolds/index.ctp (100%)
rename {cake/libs/view => lib/Cake/View}/scaffolds/view.ctp (100%)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index fb4bdb9b3..6f04c7798 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -330,7 +330,7 @@ class App {
static $paths = false;
if (!$paths) {
$paths = array();
- $libs = dirname(__FILE__) . DS;
+ $libs = LIBS;
$cake = dirname($libs) . DS;
$path = dirname($cake) . DS;
@@ -341,7 +341,7 @@ class App {
$paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS;
$paths['controllers'][] = $libs . 'controller' . DS;
$paths['components'][] = $libs . 'controller' . DS . 'components' . DS;
- $paths['views'][] = $libs . 'view' . DS;
+ $paths['views'][] = $libs . 'View' . DS;
$paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS;
$paths['plugins'][] = $path . 'plugins' . DS;
$paths['vendors'][] = $path . 'vendors' . DS;
diff --git a/lib/Cake/Utility/ClassRegistry.php b/lib/Cake/Utility/ClassRegistry.php
index a80abdc98..9762462ea 100644
--- a/lib/Cake/Utility/ClassRegistry.php
+++ b/lib/Cake/Utility/ClassRegistry.php
@@ -140,11 +140,11 @@ class ClassRegistry {
if (class_exists($class)) {
${$class} = new $class($settings);
} elseif ($type === 'Model') {
- //if ($plugin && class_exists($plugin . 'AppModel')) {
- // $appModel = $plugin . 'AppModel';
- //} else {
+ if ($plugin && class_exists($plugin . 'AppModel')) {
+ $appModel = $plugin . 'AppModel';
+ } else {
$appModel = 'AppModel';
- //}
+ }
$settings['name'] = $class;
${$class} = new $appModel($settings);
}
diff --git a/cake/libs/view/scaffold.php b/lib/Cake/View/ScaffoldView.php
similarity index 100%
rename from cake/libs/view/scaffold.php
rename to lib/Cake/View/ScaffoldView.php
diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php
index c080ccc65..b0676d666 100644
--- a/lib/Cake/View/View.php
+++ b/lib/Cake/View/View.php
@@ -811,7 +811,8 @@ class View extends Object {
}
$paths[] = App::pluginPath($plugin) . 'views' . DS;
}
- $this->__paths = array_merge($paths, $viewPaths);
+
+ $this->__paths = array_merge($paths, $viewPaths, array_flip($corePaths));
return $this->__paths;
}
}
diff --git a/cake/libs/view/elements/email/html/default.ctp b/lib/Cake/View/elements/email/html/default.ctp
similarity index 100%
rename from cake/libs/view/elements/email/html/default.ctp
rename to lib/Cake/View/elements/email/html/default.ctp
diff --git a/cake/libs/view/elements/email/text/default.ctp b/lib/Cake/View/elements/email/text/default.ctp
similarity index 100%
rename from cake/libs/view/elements/email/text/default.ctp
rename to lib/Cake/View/elements/email/text/default.ctp
diff --git a/cake/libs/view/elements/exception_stack_trace.ctp b/lib/Cake/View/elements/exception_stack_trace.ctp
similarity index 100%
rename from cake/libs/view/elements/exception_stack_trace.ctp
rename to lib/Cake/View/elements/exception_stack_trace.ctp
diff --git a/cake/libs/view/elements/sql_dump.ctp b/lib/Cake/View/elements/sql_dump.ctp
similarity index 100%
rename from cake/libs/view/elements/sql_dump.ctp
rename to lib/Cake/View/elements/sql_dump.ctp
diff --git a/cake/libs/view/errors/error400.ctp b/lib/Cake/View/errors/error400.ctp
similarity index 100%
rename from cake/libs/view/errors/error400.ctp
rename to lib/Cake/View/errors/error400.ctp
diff --git a/cake/libs/view/errors/error500.ctp b/lib/Cake/View/errors/error500.ctp
similarity index 100%
rename from cake/libs/view/errors/error500.ctp
rename to lib/Cake/View/errors/error500.ctp
diff --git a/cake/libs/view/errors/missing_action.ctp b/lib/Cake/View/errors/missing_action.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_action.ctp
rename to lib/Cake/View/errors/missing_action.ctp
diff --git a/cake/libs/view/errors/missing_behavior_class.ctp b/lib/Cake/View/errors/missing_behavior_class.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_behavior_class.ctp
rename to lib/Cake/View/errors/missing_behavior_class.ctp
diff --git a/cake/libs/view/errors/missing_behavior_file.ctp b/lib/Cake/View/errors/missing_behavior_file.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_behavior_file.ctp
rename to lib/Cake/View/errors/missing_behavior_file.ctp
diff --git a/cake/libs/view/errors/missing_component_class.ctp b/lib/Cake/View/errors/missing_component_class.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_component_class.ctp
rename to lib/Cake/View/errors/missing_component_class.ctp
diff --git a/cake/libs/view/errors/missing_component_file.ctp b/lib/Cake/View/errors/missing_component_file.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_component_file.ctp
rename to lib/Cake/View/errors/missing_component_file.ctp
diff --git a/cake/libs/view/errors/missing_connection.ctp b/lib/Cake/View/errors/missing_connection.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_connection.ctp
rename to lib/Cake/View/errors/missing_connection.ctp
diff --git a/cake/libs/view/errors/missing_controller.ctp b/lib/Cake/View/errors/missing_controller.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_controller.ctp
rename to lib/Cake/View/errors/missing_controller.ctp
diff --git a/cake/libs/view/errors/missing_database.ctp b/lib/Cake/View/errors/missing_database.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_database.ctp
rename to lib/Cake/View/errors/missing_database.ctp
diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/lib/Cake/View/errors/missing_helper_class.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_helper_class.ctp
rename to lib/Cake/View/errors/missing_helper_class.ctp
diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/lib/Cake/View/errors/missing_helper_file.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_helper_file.ctp
rename to lib/Cake/View/errors/missing_helper_file.ctp
diff --git a/cake/libs/view/errors/missing_layout.ctp b/lib/Cake/View/errors/missing_layout.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_layout.ctp
rename to lib/Cake/View/errors/missing_layout.ctp
diff --git a/cake/libs/view/errors/missing_table.ctp b/lib/Cake/View/errors/missing_table.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_table.ctp
rename to lib/Cake/View/errors/missing_table.ctp
diff --git a/cake/libs/view/errors/missing_view.ctp b/lib/Cake/View/errors/missing_view.ctp
similarity index 100%
rename from cake/libs/view/errors/missing_view.ctp
rename to lib/Cake/View/errors/missing_view.ctp
diff --git a/cake/libs/view/errors/private_action.ctp b/lib/Cake/View/errors/private_action.ctp
similarity index 100%
rename from cake/libs/view/errors/private_action.ctp
rename to lib/Cake/View/errors/private_action.ctp
diff --git a/cake/libs/view/errors/scaffold_error.ctp b/lib/Cake/View/errors/scaffold_error.ctp
similarity index 100%
rename from cake/libs/view/errors/scaffold_error.ctp
rename to lib/Cake/View/errors/scaffold_error.ctp
diff --git a/cake/libs/view/layouts/ajax.ctp b/lib/Cake/View/layouts/ajax.ctp
similarity index 100%
rename from cake/libs/view/layouts/ajax.ctp
rename to lib/Cake/View/layouts/ajax.ctp
diff --git a/cake/libs/view/layouts/default.ctp b/lib/Cake/View/layouts/default.ctp
similarity index 100%
rename from cake/libs/view/layouts/default.ctp
rename to lib/Cake/View/layouts/default.ctp
diff --git a/cake/libs/view/layouts/email/html/default.ctp b/lib/Cake/View/layouts/email/html/default.ctp
similarity index 100%
rename from cake/libs/view/layouts/email/html/default.ctp
rename to lib/Cake/View/layouts/email/html/default.ctp
diff --git a/cake/libs/view/layouts/email/text/default.ctp b/lib/Cake/View/layouts/email/text/default.ctp
similarity index 100%
rename from cake/libs/view/layouts/email/text/default.ctp
rename to lib/Cake/View/layouts/email/text/default.ctp
diff --git a/cake/libs/view/layouts/flash.ctp b/lib/Cake/View/layouts/flash.ctp
similarity index 100%
rename from cake/libs/view/layouts/flash.ctp
rename to lib/Cake/View/layouts/flash.ctp
diff --git a/cake/libs/view/layouts/js/default.ctp b/lib/Cake/View/layouts/js/default.ctp
similarity index 100%
rename from cake/libs/view/layouts/js/default.ctp
rename to lib/Cake/View/layouts/js/default.ctp
diff --git a/cake/libs/view/layouts/rss/default.ctp b/lib/Cake/View/layouts/rss/default.ctp
similarity index 100%
rename from cake/libs/view/layouts/rss/default.ctp
rename to lib/Cake/View/layouts/rss/default.ctp
diff --git a/cake/libs/view/layouts/xml/default.ctp b/lib/Cake/View/layouts/xml/default.ctp
similarity index 100%
rename from cake/libs/view/layouts/xml/default.ctp
rename to lib/Cake/View/layouts/xml/default.ctp
diff --git a/cake/libs/view/pages/home.ctp b/lib/Cake/View/pages/home.ctp
similarity index 100%
rename from cake/libs/view/pages/home.ctp
rename to lib/Cake/View/pages/home.ctp
diff --git a/cake/libs/view/scaffolds/edit.ctp b/lib/Cake/View/scaffolds/edit.ctp
similarity index 100%
rename from cake/libs/view/scaffolds/edit.ctp
rename to lib/Cake/View/scaffolds/edit.ctp
diff --git a/cake/libs/view/scaffolds/index.ctp b/lib/Cake/View/scaffolds/index.ctp
similarity index 100%
rename from cake/libs/view/scaffolds/index.ctp
rename to lib/Cake/View/scaffolds/index.ctp
diff --git a/cake/libs/view/scaffolds/view.ctp b/lib/Cake/View/scaffolds/view.ctp
similarity index 100%
rename from cake/libs/view/scaffolds/view.ctp
rename to lib/Cake/View/scaffolds/view.ctp
From b19b25a78872d6bf06f0eaba28daf4b23972638d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 5 Dec 2010 13:21:28 -0430
Subject: [PATCH 031/668] Moving some spare clases to the corresponding
packages
---
.../controller/scaffold.php => lib/Cake/Controller/Scaffold.php | 0
cake/libs/cake_socket.php => lib/Cake/Network/CakeSocket.php | 0
cake/libs/http_socket.php => lib/Cake/Network/HttpSocket.php | 0
cake/libs/file.php => lib/Cake/Utility/File.php | 0
cake/libs/magic_db.php => lib/Cake/Utility/MagicDb.php | 0
cake/libs/sanitize.php => lib/Cake/Utility/Sanitize.php | 0
cake/libs/security.php => lib/Cake/Utility/Security.php | 0
cake/libs/validation.php => lib/Cake/Utility/Validation.php | 0
cake/libs/xml.php => lib/Cake/Utility/Xml.php | 0
9 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/controller/scaffold.php => lib/Cake/Controller/Scaffold.php (100%)
rename cake/libs/cake_socket.php => lib/Cake/Network/CakeSocket.php (100%)
rename cake/libs/http_socket.php => lib/Cake/Network/HttpSocket.php (100%)
rename cake/libs/file.php => lib/Cake/Utility/File.php (100%)
rename cake/libs/magic_db.php => lib/Cake/Utility/MagicDb.php (100%)
rename cake/libs/sanitize.php => lib/Cake/Utility/Sanitize.php (100%)
rename cake/libs/security.php => lib/Cake/Utility/Security.php (100%)
rename cake/libs/validation.php => lib/Cake/Utility/Validation.php (100%)
rename cake/libs/xml.php => lib/Cake/Utility/Xml.php (100%)
diff --git a/cake/libs/controller/scaffold.php b/lib/Cake/Controller/Scaffold.php
similarity index 100%
rename from cake/libs/controller/scaffold.php
rename to lib/Cake/Controller/Scaffold.php
diff --git a/cake/libs/cake_socket.php b/lib/Cake/Network/CakeSocket.php
similarity index 100%
rename from cake/libs/cake_socket.php
rename to lib/Cake/Network/CakeSocket.php
diff --git a/cake/libs/http_socket.php b/lib/Cake/Network/HttpSocket.php
similarity index 100%
rename from cake/libs/http_socket.php
rename to lib/Cake/Network/HttpSocket.php
diff --git a/cake/libs/file.php b/lib/Cake/Utility/File.php
similarity index 100%
rename from cake/libs/file.php
rename to lib/Cake/Utility/File.php
diff --git a/cake/libs/magic_db.php b/lib/Cake/Utility/MagicDb.php
similarity index 100%
rename from cake/libs/magic_db.php
rename to lib/Cake/Utility/MagicDb.php
diff --git a/cake/libs/sanitize.php b/lib/Cake/Utility/Sanitize.php
similarity index 100%
rename from cake/libs/sanitize.php
rename to lib/Cake/Utility/Sanitize.php
diff --git a/cake/libs/security.php b/lib/Cake/Utility/Security.php
similarity index 100%
rename from cake/libs/security.php
rename to lib/Cake/Utility/Security.php
diff --git a/cake/libs/validation.php b/lib/Cake/Utility/Validation.php
similarity index 100%
rename from cake/libs/validation.php
rename to lib/Cake/Utility/Validation.php
diff --git a/cake/libs/xml.php b/lib/Cake/Utility/Xml.php
similarity index 100%
rename from cake/libs/xml.php
rename to lib/Cake/Utility/Xml.php
From 2fed702c5787efbbfb6f4f918b319deea0bae212 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 5 Dec 2010 15:00:02 -0430
Subject: [PATCH 032/668] Moving more model classes to the new package
---
cake/libs/model/cake_schema.php => lib/Cake/Model/CakeSchema.php | 0
.../dbo_mssql.php => lib/Cake/Model/Datasource/Database/Mssql.php | 0
.../Cake/Model/Datasource/Database/Oracle.php | 0
.../Cake/Model/Datasource/Database/Postgres.php | 0
.../Cake/Model/Datasource/Database/Sqlite.php | 0
cake/libs/model/db_acl.php => lib/Cake/Model/DbAcl.php | 0
.../model/model_behavior.php => lib/Cake/Model/ModelBehavior.php | 0
7 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/model/cake_schema.php => lib/Cake/Model/CakeSchema.php (100%)
rename cake/libs/model/datasources/dbo/dbo_mssql.php => lib/Cake/Model/Datasource/Database/Mssql.php (100%)
rename cake/libs/model/datasources/dbo/dbo_oracle.php => lib/Cake/Model/Datasource/Database/Oracle.php (100%)
rename cake/libs/model/datasources/dbo/dbo_postgres.php => lib/Cake/Model/Datasource/Database/Postgres.php (100%)
rename cake/libs/model/datasources/dbo/dbo_sqlite.php => lib/Cake/Model/Datasource/Database/Sqlite.php (100%)
rename cake/libs/model/db_acl.php => lib/Cake/Model/DbAcl.php (100%)
rename cake/libs/model/model_behavior.php => lib/Cake/Model/ModelBehavior.php (100%)
diff --git a/cake/libs/model/cake_schema.php b/lib/Cake/Model/CakeSchema.php
similarity index 100%
rename from cake/libs/model/cake_schema.php
rename to lib/Cake/Model/CakeSchema.php
diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/lib/Cake/Model/Datasource/Database/Mssql.php
similarity index 100%
rename from cake/libs/model/datasources/dbo/dbo_mssql.php
rename to lib/Cake/Model/Datasource/Database/Mssql.php
diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/lib/Cake/Model/Datasource/Database/Oracle.php
similarity index 100%
rename from cake/libs/model/datasources/dbo/dbo_oracle.php
rename to lib/Cake/Model/Datasource/Database/Oracle.php
diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php
similarity index 100%
rename from cake/libs/model/datasources/dbo/dbo_postgres.php
rename to lib/Cake/Model/Datasource/Database/Postgres.php
diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php
similarity index 100%
rename from cake/libs/model/datasources/dbo/dbo_sqlite.php
rename to lib/Cake/Model/Datasource/Database/Sqlite.php
diff --git a/cake/libs/model/db_acl.php b/lib/Cake/Model/DbAcl.php
similarity index 100%
rename from cake/libs/model/db_acl.php
rename to lib/Cake/Model/DbAcl.php
diff --git a/cake/libs/model/model_behavior.php b/lib/Cake/Model/ModelBehavior.php
similarity index 100%
rename from cake/libs/model/model_behavior.php
rename to lib/Cake/Model/ModelBehavior.php
From 5c0c9841e24ac2283f0c4bf2cd5d4eb44ab601dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 5 Dec 2010 20:38:17 -0430
Subject: [PATCH 033/668] Removing dead code
---
lib/Cake/Core/App.php | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 6f04c7798..2d9003566 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -265,9 +265,6 @@ class App {
return $paths;
}
- $core = self::core();
- $app = array('models' => true, 'controllers' => true, 'helpers' => true);
-
foreach ($defaults as $type => $default) {
if (empty(self::$__packages[$type]) || empty($paths)) {
From d311cf237b572d7aed87eb97cc788addfbfafc81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 5 Dec 2010 23:50:05 -0430
Subject: [PATCH 034/668] Moving behaviors
---
.../behaviors/acl.php => lib/Cake/Model/Behavior/AclBehavior.php | 0
.../Cake/Model/Behavior/ContainableBehavior.php | 0
.../Cake/Model/Behavior/TranslateBehavior.php | 0
.../tree.php => lib/Cake/Model/Behavior/TreeBehavior.php | 0
4 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/model/behaviors/acl.php => lib/Cake/Model/Behavior/AclBehavior.php (100%)
rename cake/libs/model/behaviors/containable.php => lib/Cake/Model/Behavior/ContainableBehavior.php (100%)
rename cake/libs/model/behaviors/translate.php => lib/Cake/Model/Behavior/TranslateBehavior.php (100%)
rename cake/libs/model/behaviors/tree.php => lib/Cake/Model/Behavior/TreeBehavior.php (100%)
diff --git a/cake/libs/model/behaviors/acl.php b/lib/Cake/Model/Behavior/AclBehavior.php
similarity index 100%
rename from cake/libs/model/behaviors/acl.php
rename to lib/Cake/Model/Behavior/AclBehavior.php
diff --git a/cake/libs/model/behaviors/containable.php b/lib/Cake/Model/Behavior/ContainableBehavior.php
similarity index 100%
rename from cake/libs/model/behaviors/containable.php
rename to lib/Cake/Model/Behavior/ContainableBehavior.php
diff --git a/cake/libs/model/behaviors/translate.php b/lib/Cake/Model/Behavior/TranslateBehavior.php
similarity index 100%
rename from cake/libs/model/behaviors/translate.php
rename to lib/Cake/Model/Behavior/TranslateBehavior.php
diff --git a/cake/libs/model/behaviors/tree.php b/lib/Cake/Model/Behavior/TreeBehavior.php
similarity index 100%
rename from cake/libs/model/behaviors/tree.php
rename to lib/Cake/Model/Behavior/TreeBehavior.php
From 88a4a6609ed2355b5043150067fee6d364b21a1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 6 Dec 2010 00:10:56 -0430
Subject: [PATCH 035/668] Moving the config folder
---
cake/config/paths.php | 231 --------------------
{cake/libs => lib/Cake}/config/ini_file.php | 0
2 files changed, 231 deletions(-)
delete mode 100644 cake/config/paths.php
rename {cake/libs => lib/Cake}/config/ini_file.php (100%)
diff --git a/cake/config/paths.php b/cake/config/paths.php
deleted file mode 100644
index e8ac21c49..000000000
--- a/cake/config/paths.php
+++ /dev/null
@@ -1,231 +0,0 @@
-
Date: Mon, 6 Dec 2010 09:38:06 -0430
Subject: [PATCH 036/668] A couple of micro-optimizations found using a
profileA couple of micro-optimizations found using a profilerr
---
lib/Cake/Controller/Controller.php | 11 ++++-------
lib/Cake/Model/CakeSession.php | 11 ++++++-----
lib/Cake/Utility/Set.php | 9 ++++++---
3 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php
index ed0ac3e6a..7d7c58bb5 100644
--- a/lib/Cake/Controller/Controller.php
+++ b/lib/Cake/Controller/Controller.php
@@ -300,18 +300,15 @@ class Controller extends Object {
*/
public function __construct($request = null) {
if ($this->name === null) {
- $r = null;
- if (!preg_match('/(.*)Controller/i', get_class($this), $r)) {
- echo __("Controller::__construct() : Can not get or parse my own class name, exiting.");
- $this->_stop();
- }
- $this->name = $r[1];
+ $this->name = substr(get_class($this), 0, strlen(get_class($this)) -10);
}
if ($this->viewPath == null) {
$this->viewPath = Inflector::underscore($this->name);
}
- $this->modelClass = Inflector::classify($this->name);
+ if (empty($this->uses)) {
+ $this->modelClass = Inflector::singularize($this->name);
+ }
$this->modelKey = Inflector::underscore($this->modelClass);
$this->Components = new ComponentCollection();
diff --git a/lib/Cake/Model/CakeSession.php b/lib/Cake/Model/CakeSession.php
index 973a655af..fd67272ad 100644
--- a/lib/Cake/Model/CakeSession.php
+++ b/lib/Cake/Model/CakeSession.php
@@ -345,11 +345,12 @@ class CakeSession {
* @return boolean
*/
protected static function _validAgentAndTime() {
+ $config = self::read('Config');
$validAgent = (
Configure::read('Session.checkAgent') === false ||
- self::$_userAgent == self::read('Config.userAgent')
+ self::$_userAgent == $config['userAgent']
);
- return ($validAgent && self::$time <= self::read('Config.time'));
+ return ($validAgent && self::$time <= $config['time']);
}
/**
@@ -672,14 +673,14 @@ class CakeSession {
* @return void
*/
protected static function _checkValid() {
- if (self::read('Config')) {
+ if ($config = self::read('Config')) {
$sessionConfig = Configure::read('Session');
if (self::_validAgentAndTime()) {
- $time = self::read('Config.time');
+ $time = $config['time'];
self::write('Config.time', self::$sessionTime);
if (isset($sessionConfig['autoRegenerate']) && $sessionConfig['autoRegenerate'] === true) {
- $check = self::read('Config.countdown');
+ $check = $config['countdown'];
$check -= 1;
self::write('Config.countdown', $check);
diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php
index 95b499161..37a1836d4 100644
--- a/lib/Cake/Utility/Set.php
+++ b/lib/Cake/Utility/Set.php
@@ -583,12 +583,14 @@ class Set {
return $data;
}
- if (!is_array($path)) {
+ if (is_string($path) && strpos($path, '{') !== false) {
$path = String::tokenize($path, '.', '{', '}');
+ } else {
+ $path = explode('.', $path);
}
$tmp = array();
- if (!is_array($path) || empty($path)) {
+ if (empty($path)) {
return null;
}
@@ -662,11 +664,12 @@ class Set {
}
$_list =& $list;
+ $count = count($path);
foreach ($path as $i => $key) {
if (is_numeric($key) && intval($key) > 0 || $key === '0') {
$key = intval($key);
}
- if ($i === count($path) - 1) {
+ if ($i === $count - 1) {
$_list[$key] = $data;
} else {
if (!isset($_list[$key])) {
From 2ce2ea222cac122b055c285868df11de422efc37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 6 Dec 2010 09:44:43 -0430
Subject: [PATCH 037/668] Moving config readers to their new package
---
.../Cake/Configure/IniReader.php | 0
.../Cake/Configure/PhpReader.php | 0
lib/Cake/config/ini_file.php | 101 ------------------
3 files changed, 101 deletions(-)
rename cake/libs/config/ini_reader.php => lib/Cake/Configure/IniReader.php (100%)
rename cake/libs/config/php_reader.php => lib/Cake/Configure/PhpReader.php (100%)
delete mode 100644 lib/Cake/config/ini_file.php
diff --git a/cake/libs/config/ini_reader.php b/lib/Cake/Configure/IniReader.php
similarity index 100%
rename from cake/libs/config/ini_reader.php
rename to lib/Cake/Configure/IniReader.php
diff --git a/cake/libs/config/php_reader.php b/lib/Cake/Configure/PhpReader.php
similarity index 100%
rename from cake/libs/config/php_reader.php
rename to lib/Cake/Configure/PhpReader.php
diff --git a/lib/Cake/config/ini_file.php b/lib/Cake/config/ini_file.php
deleted file mode 100644
index 722dbcb08..000000000
--- a/lib/Cake/config/ini_file.php
+++ /dev/null
@@ -1,101 +0,0 @@
-_values = $contents[$section];
- } else {
- $this->_values = $contents;
- }
- }
-
-/**
- * Get the contents of the ini file as a plain array.
- *
- * @return array
- */
- public function asArray() {
- return $this->_values;
- }
-
-/**
- * Part of ArrayAccess implementation.
- *
- * @param string $name
- */
- public function offsetExists($name) {
- return isset($this->_values[$name]);
- }
-
-/**
- * Part of ArrayAccess implementation.
- *
- * @param string $name
- */
- public function offsetGet($name) {
- if (!isset($this->_values[$name])) {
- return null;
- }
- return $this->_values[$name];
- }
-
-/**
- * Part of ArrayAccess implementation.
- *
- * @param string $name
- */
- public function offsetSet($name, $value) {
- throw new LogicException('You cannot modify an IniFile parse result.');
- }
-
-/**
- * Part of ArrayAccess implementation.
- *
- * @param string $name
- */
- public function offsetUnset($name) {
- unset($this->_values[$name]);
- }
-}
\ No newline at end of file
From 66744c68b03cf19cefbb55e2baa0c1a53b9181c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 6 Dec 2010 22:47:43 -0430
Subject: [PATCH 038/668] Making ConnectionManager an static object instead of
a singleton
---
lib/Cake/Model/ConnectionManager.php | 109 ++++++++++++++-------------
1 file changed, 57 insertions(+), 52 deletions(-)
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index 9e435902e..de3a4e90c 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -36,7 +36,7 @@ class ConnectionManager {
* @var DATABASE_CONFIG
* @access public
*/
- public $config = null;
+ public static $config = null;
/**
* Holds instances DataSource objects
@@ -44,7 +44,7 @@ class ConnectionManager {
* @var array
* @access protected
*/
- protected $_dataSources = array();
+ protected static $_dataSources = array();
/**
* Contains a list of all file and class names used in Connection settings
@@ -52,33 +52,27 @@ class ConnectionManager {
* @var array
* @access protected
*/
- protected $_connectionsEnum = array();
+ protected static $_connectionsEnum = array();
/**
- * Constructor.
+ * Indicates if the init code for this class has alredy been executed
+ *
+ * @var boolean
+ */
+ private static $_init = false;
+
+/**
+ * Loads connections configuration.
*
*/
- function __construct() {
+ private static function init() {
include_once CONFIGS . 'database.php';
if (class_exists('DATABASE_CONFIG')) {
- $this->config = new DATABASE_CONFIG();
- $this->_getConnectionObjects();
+ self::$config = new DATABASE_CONFIG();
+ self::_getConnectionObjects();
}
- }
-
-/**
- * Gets a reference to the ConnectionManger object instance
- *
- * @return object Instance
- */
- public static function &getInstance() {
- static $instance = array();
-
- if (!$instance) {
- $instance[0] = new ConnectionManager();
- }
-
- return $instance[0];
+ register_shutdown_function('ConnectionManager::shutdown');
+ self::$_init = true;
}
/**
@@ -87,32 +81,33 @@ class ConnectionManager {
* @param string $name The name of the DataSource, as defined in app/config/database.php
* @return object Instance
*/
- public static function &getDataSource($name) {
- $_this = ConnectionManager::getInstance();
+ public static function getDataSource($name) {
+ if (empty(self::$_init)) {
+ self::init();
+ }
- if (!empty($_this->_dataSources[$name])) {
- $return = $_this->_dataSources[$name];
+ if (!empty(self::$_dataSources[$name])) {
+ $return = self::$_dataSources[$name];
return $return;
}
- if (empty($_this->_connectionsEnum[$name])) {
+ if (empty(self::$_connectionsEnum[$name])) {
trigger_error(__("ConnectionManager::getDataSource - Non-existent data source %s", $name), E_USER_ERROR);
$null = null;
return $null;
}
- $conn = $_this->_connectionsEnum[$name];
+ $conn = self::$_connectionsEnum[$name];
$class = $conn['classname'];
- if ($_this->loadDataSource($name) === null) {
+ if (self::loadDataSource($name) === null) {
trigger_error(__("ConnectionManager::getDataSource - Could not load class %s", $class), E_USER_ERROR);
$null = null;
return $null;
}
- $_this->_dataSources[$name] = new $class($_this->config->{$name});
- $_this->_dataSources[$name]->configKeyName = $name;
+ self::$_dataSources[$name] = new $class(self::$config->{$name});
+ self::$_dataSources[$name]->configKeyName = $name;
- $return = $_this->_dataSources[$name];
- return $return;
+ return self::$_dataSources[$name];
}
/**
@@ -121,8 +116,10 @@ class ConnectionManager {
* @return array List of available connections
*/
public static function sourceList() {
- $_this = ConnectionManager::getInstance();
- return array_keys($_this->_dataSources);
+ if (empty(self::$_init)) {
+ self::init();
+ }
+ return array_keys(self::$_dataSources);
}
/**
@@ -135,8 +132,10 @@ class ConnectionManager {
* in the ConnectionManager.
*/
public static function getSourceName(&$source) {
- $_this = ConnectionManager::getInstance();
- foreach ($_this->_dataSources as $name => $ds) {
+ if (empty(self::$_init)) {
+ self::init();
+ }
+ foreach (self::$_dataSources as $name => $ds) {
if ($ds == $source) {
return $name;
}
@@ -153,12 +152,14 @@ class ConnectionManager {
* @return boolean True on success, null on failure or false if the class is already loaded
*/
public static function loadDataSource($connName) {
- $_this = ConnectionManager::getInstance();
+ if (empty(self::$_init)) {
+ self::init();
+ }
if (is_array($connName)) {
$conn = $connName;
} else {
- $conn = $_this->_connectionsEnum[$connName];
+ $conn = self::$_connectionsEnum[$connName];
}
if (class_exists($conn['classname'], false)) {
@@ -188,8 +189,10 @@ class ConnectionManager {
* (as defined in Connections), and the value is an array with keys 'filename' and 'classname'.
*/
public static function enumConnectionObjects() {
- $_this = ConnectionManager::getInstance();
- return $_this->_connectionsEnum;
+ if (empty(self::$_init)) {
+ self::init();
+ }
+ return self::$_connectionsEnum;
}
/**
@@ -199,16 +202,18 @@ class ConnectionManager {
* @param array $config The DataSource configuration settings
* @return object A reference to the DataSource object, or null if creation failed
*/
- public static function &create($name = '', $config = array()) {
- $_this = ConnectionManager::getInstance();
+ public static function create($name = '', $config = array()) {
+ if (empty(self::$_init)) {
+ self::init();
+ }
- if (empty($name) || empty($config) || array_key_exists($name, $_this->_connectionsEnum)) {
+ if (empty($name) || empty($config) || array_key_exists($name, self::$_connectionsEnum)) {
$null = null;
return $null;
}
- $_this->config->{$name} = $config;
- $_this->_connectionsEnum[$name] = $_this->__connectionData($config);
- $return = $_this->getDataSource($name);
+ self::$config->{$name} = $config;
+ self::$_connectionsEnum[$name] = self::_connectionData($config);
+ $return = self::getDataSource($name);
return $return;
}
@@ -217,12 +222,12 @@ class ConnectionManager {
*
* @return void
*/
- protected function _getConnectionObjects() {
- $connections = get_object_vars($this->config);
+ protected static function _getConnectionObjects() {
+ $connections = get_object_vars(self::$config);
if ($connections != null) {
foreach ($connections as $name => $config) {
- $this->_connectionsEnum[$name] = $this->__connectionData($config);
+ self::$_connectionsEnum[$name] = self::_connectionData($config);
}
} else {
throw new MissingConnectionException(array('class' => 'ConnectionManager'));
@@ -234,7 +239,7 @@ class ConnectionManager {
*
* @return array An indexed array with: filename, classname, plugin and parent
*/
- private function __connectionData($config) {
+ private static function _connectionData($config) {
$package = $classname = $plugin = null;
list($plugin, $classname) = pluginSplit($config['datasource']);
@@ -249,7 +254,7 @@ class ConnectionManager {
* Destructor.
*
*/
- function __destruct() {
+ public static function shutdown() {
if (Configure::read('Session.defaults') == 'database' && function_exists('session_write_close')) {
session_write_close();
}
From 513eb5342629e9a8767192ed143a0266c6888b35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 6 Dec 2010 22:48:30 -0430
Subject: [PATCH 039/668] Fixing package location in DboSource
---
lib/Cake/Model/Datasource/DboSource.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php
index 339d4d05f..a11f4fcd8 100755
--- a/lib/Cake/Model/Datasource/DboSource.php
+++ b/lib/Cake/Model/Datasource/DboSource.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('String', 'Core');
+App::uses('String', 'Utility');
/**
* DboSource
From 1d67d1611c5eddb471ac7bcf163618560c03a907 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 6 Dec 2010 22:49:15 -0430
Subject: [PATCH 040/668] Micro optimizations in Helper class, as those
functions are calles very often the may sum up some milliseconds
---
lib/Cake/View/Helper.php | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php
index 389b3845a..25f62f2be 100644
--- a/lib/Cake/View/Helper.php
+++ b/lib/Cake/View/Helper.php
@@ -257,11 +257,9 @@ class Helper extends Object {
* @return string Path with a timestamp added, or not.
*/
public function assetTimestamp($path) {
- $timestampEnabled = (
- (Configure::read('Asset.timestamp') === true && Configure::read('debug') > 0) ||
- Configure::read('Asset.timestamp') === 'force'
- );
- if (strpos($path, '?') === false && $timestampEnabled) {
+ $stamp = Configure::read('Asset.timestamp');
+ $timestampEnabled = $stamp === 'force' || ($stamp === true && Configure::read('debug') > 0);
+ if ($timestampEnabled && strpos($path, '?') === false) {
$filepath = preg_replace('/^' . preg_quote($this->request->webroot, '/') . '/', '', $path);
$webrootPath = WWW_ROOT . str_replace('/', DS, $filepath);
if (file_exists($webrootPath)) {
@@ -347,18 +345,19 @@ class Helper extends Object {
* @return string Composed attributes.
*/
public function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
- if (is_array($options)) {
- $options = array_merge(array('escape' => true), $options);
+ if (!is_string($options)) {
+ $options = $options + array('escape' => true);
if (!is_array($exclude)) {
$exclude = array();
}
- $filtered = array_diff_key($options, array_merge(array_flip($exclude), array('escape' => true)));
+
+ $exclude = array('escape' => true) + array_flip($exclude);
$escape = $options['escape'];
$attributes = array();
- foreach ($filtered as $key => $value) {
- if ($value !== false && $value !== null) {
+ foreach ($options as $key => $value) {
+ if (!isset($exclude[$key]) && $value !== false && $value !== null) {
$attributes[] = $this->__formatAttribute($key, $value, $escape);
}
}
@@ -381,13 +380,20 @@ class Helper extends Object {
function __formatAttribute($key, $value, $escape = true) {
$attribute = '';
$attributeFormat = '%s="%s"';
- $minimizedAttributes = array('compact', 'checked', 'declare', 'readonly', 'disabled',
- 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize');
+ static $minimizedAttributes = array();
+ if (empty($minimizedAttributes)) {
+ $minimizedAttributes = array_flip(array(
+ 'compact', 'checked', 'declare', 'readonly', 'disabled',
+ 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap',
+ 'multiple', 'noresize'
+ ));
+ }
+
if (is_array($value)) {
$value = '';
}
- if (in_array($key, $minimizedAttributes)) {
+ if (isset($minimizedAttributes[$key])) {
if ($value === 1 || $value === true || $value === 'true' || $value === '1' || $value == $key) {
$attribute = sprintf($attributeFormat, $key, $key);
}
From c431ddd22c973c1b797df8edf5e98de2e59578cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 6 Dec 2010 22:57:09 -0430
Subject: [PATCH 041/668] Refactoring Dispatcher::_isPrivate to directly check
for controller methods, doing in in the controller could be unnecessary
---
lib/Cake/Controller/Controller.php | 7 ++-----
lib/Cake/Routing/Dispatcher.php | 4 ++--
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php
index 2580f53d0..c423a9227 100644
--- a/lib/Cake/Controller/Controller.php
+++ b/lib/Cake/Controller/Controller.php
@@ -308,15 +308,12 @@ class Controller extends Object {
}
if (empty($this->uses)) {
$this->modelClass = Inflector::singularize($this->name);
+ } else {
+ $this->modelClass = current($this->uses);
}
$this->modelKey = Inflector::underscore($this->modelClass);
$this->Components = new ComponentCollection();
- $childMethods = get_class_methods($this);
- $parentMethods = get_class_methods('Controller');
-
- $this->methods = array_diff($childMethods, $parentMethods);
-
if ($request instanceof CakeRequest) {
$this->_setRequest($request);
}
diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php
index 251b56f6e..4f56056c8 100644
--- a/lib/Cake/Routing/Dispatcher.php
+++ b/lib/Cake/Routing/Dispatcher.php
@@ -143,7 +143,7 @@ class Dispatcher {
$privateAction = in_array($prefix, $prefixes);
}
}
- return $privateAction;
+ return $privateAction && ! in_array($request->params['action'], get_class_methods('Controller'));
}
/**
@@ -160,7 +160,7 @@ class Dispatcher {
$controller->constructClasses();
$controller->startupProcess();
- $methods = array_flip($controller->methods);
+ $methods = array_flip(get_class_methods($controller));
if (!isset($methods[$request->params['action']])) {
if ($controller->scaffold !== false) {
From 6de52f795f6d07b330fc097e7613c70febf9a3a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 6 Dec 2010 23:15:18 -0430
Subject: [PATCH 042/668] Completing the round of micro optimization, it was
fun while it lasted
---
lib/Cake/Network/CakeRequest.php | 2 +-
lib/Cake/Routing/Dispatcher.php | 3 ++-
lib/Cake/Utility/Set.php | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php
index 67003f142..5ac7a4922 100644
--- a/lib/Cake/Network/CakeRequest.php
+++ b/lib/Cake/Network/CakeRequest.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Set', 'Core');
+App::uses('Set', 'Utility');
/**
* A class that helps wrap Request information and particulars about a single request.
diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php
index 4f56056c8..b52123a6d 100644
--- a/lib/Cake/Routing/Dispatcher.php
+++ b/lib/Cake/Routing/Dispatcher.php
@@ -143,7 +143,8 @@ class Dispatcher {
$privateAction = in_array($prefix, $prefixes);
}
}
- return $privateAction && ! in_array($request->params['action'], get_class_methods('Controller'));
+
+ return $privateAction || in_array($request->params['action'], get_class_methods('Controller'));
}
/**
diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php
index 37a1836d4..ff2af8519 100644
--- a/lib/Cake/Utility/Set.php
+++ b/lib/Cake/Utility/Set.php
@@ -46,7 +46,7 @@ class Set {
$r = (array)current($args);
while (($arg = next($args)) !== false) {
foreach ((array)$arg as $key => $val) {
- if (is_array($val) && isset($r[$key]) && is_array($r[$key])) {
+ if (!empty($r[$key]) && is_array($r[$key])) {
$r[$key] = Set::merge($r[$key], $val);
} elseif (is_int($key)) {
$r[] = $val;
From 9e6475400564d86bfe4dd0dc7a7213dc092f5cf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 00:00:20 -0430
Subject: [PATCH 043/668] Adding check to no overwrite cache if it has not been
modified
---
lib/Cake/Core/App.php | 9 ++++++++-
.../Cake/Model/Datasource/Session/CacheSession.php | 0
.../Cake/Model/Datasource/Session/DatabaseSession.php | 0
.../Cake/Routing/Route/PluginShortRoute.php | 0
.../Cake/Routing/Route/RedirectRoute.php | 0
5 files changed, 8 insertions(+), 1 deletion(-)
rename cake/libs/session/cache_session.php => lib/Cake/Model/Datasource/Session/CacheSession.php (100%)
rename cake/libs/session/database_session.php => lib/Cake/Model/Datasource/Session/DatabaseSession.php (100%)
rename cake/libs/route/plugin_short_route.php => lib/Cake/Routing/Route/PluginShortRoute.php (100%)
rename cake/libs/route/redirect_route.php => lib/Cake/Routing/Route/RedirectRoute.php (100%)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 2d9003566..91b2e3f1d 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -213,6 +213,12 @@ class App {
*/
private static $__packages = array();
+/**
+ * Inicates whether the cache should be stored again because of an addition to it
+ *
+ */
+ private static $_cacheChange = false;
+
/**
* Used to read information stored path
*
@@ -691,6 +697,7 @@ class App {
} else {
self::$__map[$name] = $file;
}
+ self::$_cacheChange = true;
}
/**
@@ -897,7 +904,7 @@ class App {
* @return void
*/
public static function shutdown() {
- if (self::$__cache) {
+ if (self::$__cache && self::$_cacheChange) {
Cache::write('file_map', array_filter(self::$__map), '_cake_core_');
Cache::write('object_map', self::$__objects, '_cake_core_');
}
diff --git a/cake/libs/session/cache_session.php b/lib/Cake/Model/Datasource/Session/CacheSession.php
similarity index 100%
rename from cake/libs/session/cache_session.php
rename to lib/Cake/Model/Datasource/Session/CacheSession.php
diff --git a/cake/libs/session/database_session.php b/lib/Cake/Model/Datasource/Session/DatabaseSession.php
similarity index 100%
rename from cake/libs/session/database_session.php
rename to lib/Cake/Model/Datasource/Session/DatabaseSession.php
diff --git a/cake/libs/route/plugin_short_route.php b/lib/Cake/Routing/Route/PluginShortRoute.php
similarity index 100%
rename from cake/libs/route/plugin_short_route.php
rename to lib/Cake/Routing/Route/PluginShortRoute.php
diff --git a/cake/libs/route/redirect_route.php b/lib/Cake/Routing/Route/RedirectRoute.php
similarity index 100%
rename from cake/libs/route/redirect_route.php
rename to lib/Cake/Routing/Route/RedirectRoute.php
From 0732552739be6f029a017a26de3b6fc7a3e07982 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 00:02:42 -0430
Subject: [PATCH 044/668] Movig CakeSession to a better suited package
---
lib/Cake/Controller/Component/SessionComponent.php | 2 +-
lib/Cake/Model/{ => Datasource}/CakeSession.php | 0
lib/Cake/View/Helper/SessionHelper.php | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
rename lib/Cake/Model/{ => Datasource}/CakeSession.php (100%)
diff --git a/lib/Cake/Controller/Component/SessionComponent.php b/lib/Cake/Controller/Component/SessionComponent.php
index 855cbcd20..5e326d5e8 100644
--- a/lib/Cake/Controller/Component/SessionComponent.php
+++ b/lib/Cake/Controller/Component/SessionComponent.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('CakeSession', 'Model');
+App::uses('CakeSession', 'Model/Datasource');
/**
* Session Component.
diff --git a/lib/Cake/Model/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php
similarity index 100%
rename from lib/Cake/Model/CakeSession.php
rename to lib/Cake/Model/Datasource/CakeSession.php
diff --git a/lib/Cake/View/Helper/SessionHelper.php b/lib/Cake/View/Helper/SessionHelper.php
index 997e2c422..67d09f056 100644
--- a/lib/Cake/View/Helper/SessionHelper.php
+++ b/lib/Cake/View/Helper/SessionHelper.php
@@ -19,7 +19,7 @@
*/
App::uses('AppHelper', 'View/Helper');
-App::uses('CakeSession', 'Model');
+App::uses('CakeSession', 'Model/Datasource');
/**
* Session Helper.
From 322093a0220167f249e916f11826a39393a748d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 00:17:50 -0430
Subject: [PATCH 045/668] Separating cache storing in App shutdown
---
lib/Cake/Core/App.php | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 91b2e3f1d..1410637ba 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -214,11 +214,17 @@ class App {
private static $__packages = array();
/**
- * Inicates whether the cache should be stored again because of an addition to it
+ * Inicates whether the class cache should be stored again because of an addition to it
*
*/
private static $_cacheChange = false;
+/**
+ * Inicates whether the object cache should be stored again because of an addition to it
+ *
+ */
+ private static $_objectCacheChange = false;
+
/**
* Used to read information stored path
*
@@ -420,6 +426,7 @@ class App {
self::$__cache = true;
}
self::$__objects[$name] = $objects;
+ self::$_objectCacheChange = true;
}
return self::$__objects[$name];
@@ -906,6 +913,8 @@ class App {
public static function shutdown() {
if (self::$__cache && self::$_cacheChange) {
Cache::write('file_map', array_filter(self::$__map), '_cake_core_');
+ }
+ if (self::$__cache && self::$_objectCacheChange) {
Cache::write('object_map', self::$__objects, '_cake_core_');
}
}
From 1c0a4c9e0a5181a1f7b9a3e551a62b73b7a3811c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 00:47:53 -0430
Subject: [PATCH 046/668] Starting to move console classes
---
.../app_shell.php => lib/Cake/Console/AppShell.php | 0
.../Cake/Console/Command/AclShell.php | 0
.../Cake/Console/Command/ApiShell.php | 0
.../Cake/Console/Command/BakeShell.php | 0
.../Cake/Console/Command/CommandListShell.php | 0
.../Cake/Console/Command/ConsoleShell.php | 0
.../Cake/Console/Command/I18nShell.php | 0
.../Cake/Console/Command/SchemaShell.php | 0
.../Cake/Console/Command/Task/BakeTask.php | 0
.../Cake/Console/Command/Task/ControllerTask.php | 0
.../Cake/Console/Command/Task/DbConfigTask.php | 0
.../Cake/Console/Command/Task/ExtractTask.php | 0
.../Cake/Console/Command/Task/FixtureTask.php | 0
.../Cake/Console/Command/Task/ModelTask.php | 0
.../Cake/Console/Command/Task/PluginTask.php | 0
.../Cake/Console/Command/Task/ProjectTask.php | 0
.../Cake/Console/Command/Task/TemplateTask.php | 0
.../Cake/Console/Command/Task/TestTask.php | 0
.../Cake/Console/Command/Task/ViewTask.php | 0
.../Cake/Console/Command/TestSuiteShell.php | 0
.../Cake/Console/ConsoleErrorHandler.php | 0
.../Cake/Console/ConsoleInput.php | 0
.../Cake/Console/ConsoleInputArgument.php | 0
.../Cake/Console/ConsoleInputOption.php | 0
.../Cake/Console/ConsoleInputSubcommand.php | 0
.../Cake/Console/ConsoleOptionParser.php | 0
.../Cake/Console/ConsoleOutput.php | 0
.../Cake/Console/HelpFormatter.php | 0
.../shells/shell.php => lib/Cake/Console/Shell.php | 0
.../Cake/Console/ShellDispatcher.php | 0
.../Cake/Console/TaskCollection.php | 0
{cake/console => lib/Cake/Console}/cake | 0
{cake/console => lib/Cake/Console}/cake.bat | 0
{cake/console => lib/Cake/Console}/cake.php | 0
.../default/actions/controller_actions.ctp | 0
.../templates/default/classes/controller.ctp | 0
.../Console}/templates/default/classes/fixture.ctp | 0
.../Console}/templates/default/classes/model.ctp | 0
.../Console}/templates/default/classes/test.ctp | 0
.../Cake/Console}/templates/default/views/form.ctp | 0
.../Cake/Console}/templates/default/views/home.ctp | 0
.../Cake/Console}/templates/default/views/index.ctp | 0
.../Cake/Console}/templates/default/views/view.ctp | 0
.../Cake/Console}/templates/skel/.htaccess | 0
.../Cake/Console}/templates/skel/app_controller.php | 0
.../Cake/Console}/templates/skel/app_helper.php | 0
.../Cake/Console}/templates/skel/app_model.php | 0
.../Cake/Console}/templates/skel/config/acl.ini.php | 0
.../Console}/templates/skel/config/bootstrap.php | 0
.../Cake/Console}/templates/skel/config/core.php | 0
.../templates/skel/config/database.php.default | 0
.../Cake/Console}/templates/skel/config/routes.php | 0
.../templates/skel/config/schema/db_acl.php | 0
.../templates/skel/config/schema/db_acl.sql | 0
.../Console}/templates/skel/config/schema/i18n.php | 0
.../Console}/templates/skel/config/schema/i18n.sql | 0
.../templates/skel/config/schema/sessions.php | 0
.../templates/skel/config/schema/sessions.sql | 0
.../Cake/Console}/templates/skel/console/cake | 0
.../Cake/Console}/templates/skel/console/cake.bat | 0
.../Cake/Console}/templates/skel/console/cake.php | 0
.../templates/skel/console/shells/tasks/empty | 0
.../templates/skel/controllers/components/empty | 0
.../templates/skel/controllers/pages_controller.php | 0
.../Cake/Console}/templates/skel/index.php | 0
.../Cake/Console}/templates/skel/libs/empty | 0
.../templates/skel/locale/eng/LC_MESSAGES/empty | 0
.../Console}/templates/skel/models/behaviors/empty | 0
.../templates/skel/models/datasources/empty | 0
.../Cake/Console}/templates/skel/plugins/empty | 0
.../templates/skel/tests/cases/behaviors/empty | 0
.../templates/skel/tests/cases/components/empty | 0
.../templates/skel/tests/cases/controllers/empty | 0
.../templates/skel/tests/cases/datasources/empty | 0
.../templates/skel/tests/cases/helpers/empty | 0
.../templates/skel/tests/cases/models/empty | 0
.../templates/skel/tests/cases/shells/empty | 0
.../Console}/templates/skel/tests/fixtures/empty | 0
.../Console}/templates/skel/tmp/cache/models/empty | 0
.../templates/skel/tmp/cache/persistent/empty | 0
.../Console}/templates/skel/tmp/cache/views/empty | 0
.../Cake/Console}/templates/skel/tmp/logs/empty | 0
.../Cake/Console}/templates/skel/tmp/sessions/empty | 0
.../Cake/Console}/templates/skel/tmp/tests/empty | 0
.../Cake/Console}/templates/skel/vendors/empty | 0
.../skel/views/elements/email/html/default.ctp | 0
.../skel/views/elements/email/text/default.ctp | 0
.../Console}/templates/skel/views/elements/empty | 0
.../Cake/Console}/templates/skel/views/errors/empty | 0
.../Console}/templates/skel/views/helpers/empty | 0
.../Console}/templates/skel/views/layouts/ajax.ctp | 0
.../templates/skel/views/layouts/default.ctp | 0
.../skel/views/layouts/email/html/default.ctp | 0
.../skel/views/layouts/email/text/default.ctp | 0
.../Console}/templates/skel/views/layouts/flash.ctp | 0
.../templates/skel/views/layouts/js/default.ctp | 0
.../templates/skel/views/layouts/rss/default.ctp | 0
.../templates/skel/views/layouts/xml/default.ctp | 0
.../Cake/Console}/templates/skel/views/pages/empty | 0
.../Console}/templates/skel/views/scaffolds/empty | 0
.../Cake/Console}/templates/skel/webroot/.htaccess | 0
.../Cake/Console}/templates/skel/webroot/css.php | 0
.../templates/skel/webroot/css/cake.generic.css | 0
.../Console}/templates/skel/webroot/favicon.ico | Bin
.../templates/skel/webroot/img/cake.icon.png | Bin
.../templates/skel/webroot/img/cake.power.gif | Bin
.../Cake/Console}/templates/skel/webroot/index.php | 0
.../Cake/Console}/templates/skel/webroot/js/empty | 0
.../Cake/Console}/templates/skel/webroot/test.php | 0
109 files changed, 0 insertions(+), 0 deletions(-)
rename cake/console/shells/app_shell.php => lib/Cake/Console/AppShell.php (100%)
rename cake/console/shells/acl.php => lib/Cake/Console/Command/AclShell.php (100%)
rename cake/console/shells/api.php => lib/Cake/Console/Command/ApiShell.php (100%)
rename cake/console/shells/bake.php => lib/Cake/Console/Command/BakeShell.php (100%)
rename cake/console/shells/command_list.php => lib/Cake/Console/Command/CommandListShell.php (100%)
rename cake/console/shells/console.php => lib/Cake/Console/Command/ConsoleShell.php (100%)
rename cake/console/shells/i18n.php => lib/Cake/Console/Command/I18nShell.php (100%)
rename cake/console/shells/schema.php => lib/Cake/Console/Command/SchemaShell.php (100%)
rename cake/console/shells/tasks/bake.php => lib/Cake/Console/Command/Task/BakeTask.php (100%)
rename cake/console/shells/tasks/controller.php => lib/Cake/Console/Command/Task/ControllerTask.php (100%)
rename cake/console/shells/tasks/db_config.php => lib/Cake/Console/Command/Task/DbConfigTask.php (100%)
rename cake/console/shells/tasks/extract.php => lib/Cake/Console/Command/Task/ExtractTask.php (100%)
rename cake/console/shells/tasks/fixture.php => lib/Cake/Console/Command/Task/FixtureTask.php (100%)
rename cake/console/shells/tasks/model.php => lib/Cake/Console/Command/Task/ModelTask.php (100%)
rename cake/console/shells/tasks/plugin.php => lib/Cake/Console/Command/Task/PluginTask.php (100%)
rename cake/console/shells/tasks/project.php => lib/Cake/Console/Command/Task/ProjectTask.php (100%)
rename cake/console/shells/tasks/template.php => lib/Cake/Console/Command/Task/TemplateTask.php (100%)
rename cake/console/shells/tasks/test.php => lib/Cake/Console/Command/Task/TestTask.php (100%)
rename cake/console/shells/tasks/view.php => lib/Cake/Console/Command/Task/ViewTask.php (100%)
rename cake/console/shells/testsuite.php => lib/Cake/Console/Command/TestSuiteShell.php (100%)
rename cake/console/libs/console_error_handler.php => lib/Cake/Console/ConsoleErrorHandler.php (100%)
rename cake/console/libs/console_input.php => lib/Cake/Console/ConsoleInput.php (100%)
rename cake/console/libs/console_input_argument.php => lib/Cake/Console/ConsoleInputArgument.php (100%)
rename cake/console/libs/console_input_option.php => lib/Cake/Console/ConsoleInputOption.php (100%)
rename cake/console/libs/console_input_subcommand.php => lib/Cake/Console/ConsoleInputSubcommand.php (100%)
rename cake/console/libs/console_option_parser.php => lib/Cake/Console/ConsoleOptionParser.php (100%)
rename cake/console/libs/console_output.php => lib/Cake/Console/ConsoleOutput.php (100%)
rename cake/console/libs/help_formatter.php => lib/Cake/Console/HelpFormatter.php (100%)
rename cake/console/shells/shell.php => lib/Cake/Console/Shell.php (100%)
rename cake/console/shell_dispatcher.php => lib/Cake/Console/ShellDispatcher.php (100%)
rename cake/console/libs/task_collection.php => lib/Cake/Console/TaskCollection.php (100%)
rename {cake/console => lib/Cake/Console}/cake (100%)
rename {cake/console => lib/Cake/Console}/cake.bat (100%)
rename {cake/console => lib/Cake/Console}/cake.php (100%)
rename {cake/console => lib/Cake/Console}/templates/default/actions/controller_actions.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/classes/controller.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/classes/fixture.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/classes/model.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/classes/test.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/views/form.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/views/home.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/views/index.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/default/views/view.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/.htaccess (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/app_controller.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/app_helper.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/app_model.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/acl.ini.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/bootstrap.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/core.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/database.php.default (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/routes.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/schema/db_acl.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/schema/db_acl.sql (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/schema/i18n.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/schema/i18n.sql (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/schema/sessions.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/config/schema/sessions.sql (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/console/cake (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/console/cake.bat (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/console/cake.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/console/shells/tasks/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/controllers/components/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/controllers/pages_controller.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/index.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/libs/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/locale/eng/LC_MESSAGES/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/models/behaviors/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/models/datasources/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/plugins/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/cases/behaviors/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/cases/components/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/cases/controllers/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/cases/datasources/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/cases/helpers/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/cases/models/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/cases/shells/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tests/fixtures/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tmp/cache/models/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tmp/cache/persistent/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tmp/cache/views/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tmp/logs/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tmp/sessions/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/tmp/tests/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/vendors/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/elements/email/html/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/elements/email/text/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/elements/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/errors/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/helpers/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/ajax.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/email/html/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/email/text/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/flash.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/js/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/rss/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/layouts/xml/default.ctp (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/pages/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/views/scaffolds/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/.htaccess (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/css.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/css/cake.generic.css (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/favicon.ico (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/img/cake.icon.png (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/img/cake.power.gif (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/index.php (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/js/empty (100%)
rename {cake/console => lib/Cake/Console}/templates/skel/webroot/test.php (100%)
diff --git a/cake/console/shells/app_shell.php b/lib/Cake/Console/AppShell.php
similarity index 100%
rename from cake/console/shells/app_shell.php
rename to lib/Cake/Console/AppShell.php
diff --git a/cake/console/shells/acl.php b/lib/Cake/Console/Command/AclShell.php
similarity index 100%
rename from cake/console/shells/acl.php
rename to lib/Cake/Console/Command/AclShell.php
diff --git a/cake/console/shells/api.php b/lib/Cake/Console/Command/ApiShell.php
similarity index 100%
rename from cake/console/shells/api.php
rename to lib/Cake/Console/Command/ApiShell.php
diff --git a/cake/console/shells/bake.php b/lib/Cake/Console/Command/BakeShell.php
similarity index 100%
rename from cake/console/shells/bake.php
rename to lib/Cake/Console/Command/BakeShell.php
diff --git a/cake/console/shells/command_list.php b/lib/Cake/Console/Command/CommandListShell.php
similarity index 100%
rename from cake/console/shells/command_list.php
rename to lib/Cake/Console/Command/CommandListShell.php
diff --git a/cake/console/shells/console.php b/lib/Cake/Console/Command/ConsoleShell.php
similarity index 100%
rename from cake/console/shells/console.php
rename to lib/Cake/Console/Command/ConsoleShell.php
diff --git a/cake/console/shells/i18n.php b/lib/Cake/Console/Command/I18nShell.php
similarity index 100%
rename from cake/console/shells/i18n.php
rename to lib/Cake/Console/Command/I18nShell.php
diff --git a/cake/console/shells/schema.php b/lib/Cake/Console/Command/SchemaShell.php
similarity index 100%
rename from cake/console/shells/schema.php
rename to lib/Cake/Console/Command/SchemaShell.php
diff --git a/cake/console/shells/tasks/bake.php b/lib/Cake/Console/Command/Task/BakeTask.php
similarity index 100%
rename from cake/console/shells/tasks/bake.php
rename to lib/Cake/Console/Command/Task/BakeTask.php
diff --git a/cake/console/shells/tasks/controller.php b/lib/Cake/Console/Command/Task/ControllerTask.php
similarity index 100%
rename from cake/console/shells/tasks/controller.php
rename to lib/Cake/Console/Command/Task/ControllerTask.php
diff --git a/cake/console/shells/tasks/db_config.php b/lib/Cake/Console/Command/Task/DbConfigTask.php
similarity index 100%
rename from cake/console/shells/tasks/db_config.php
rename to lib/Cake/Console/Command/Task/DbConfigTask.php
diff --git a/cake/console/shells/tasks/extract.php b/lib/Cake/Console/Command/Task/ExtractTask.php
similarity index 100%
rename from cake/console/shells/tasks/extract.php
rename to lib/Cake/Console/Command/Task/ExtractTask.php
diff --git a/cake/console/shells/tasks/fixture.php b/lib/Cake/Console/Command/Task/FixtureTask.php
similarity index 100%
rename from cake/console/shells/tasks/fixture.php
rename to lib/Cake/Console/Command/Task/FixtureTask.php
diff --git a/cake/console/shells/tasks/model.php b/lib/Cake/Console/Command/Task/ModelTask.php
similarity index 100%
rename from cake/console/shells/tasks/model.php
rename to lib/Cake/Console/Command/Task/ModelTask.php
diff --git a/cake/console/shells/tasks/plugin.php b/lib/Cake/Console/Command/Task/PluginTask.php
similarity index 100%
rename from cake/console/shells/tasks/plugin.php
rename to lib/Cake/Console/Command/Task/PluginTask.php
diff --git a/cake/console/shells/tasks/project.php b/lib/Cake/Console/Command/Task/ProjectTask.php
similarity index 100%
rename from cake/console/shells/tasks/project.php
rename to lib/Cake/Console/Command/Task/ProjectTask.php
diff --git a/cake/console/shells/tasks/template.php b/lib/Cake/Console/Command/Task/TemplateTask.php
similarity index 100%
rename from cake/console/shells/tasks/template.php
rename to lib/Cake/Console/Command/Task/TemplateTask.php
diff --git a/cake/console/shells/tasks/test.php b/lib/Cake/Console/Command/Task/TestTask.php
similarity index 100%
rename from cake/console/shells/tasks/test.php
rename to lib/Cake/Console/Command/Task/TestTask.php
diff --git a/cake/console/shells/tasks/view.php b/lib/Cake/Console/Command/Task/ViewTask.php
similarity index 100%
rename from cake/console/shells/tasks/view.php
rename to lib/Cake/Console/Command/Task/ViewTask.php
diff --git a/cake/console/shells/testsuite.php b/lib/Cake/Console/Command/TestSuiteShell.php
similarity index 100%
rename from cake/console/shells/testsuite.php
rename to lib/Cake/Console/Command/TestSuiteShell.php
diff --git a/cake/console/libs/console_error_handler.php b/lib/Cake/Console/ConsoleErrorHandler.php
similarity index 100%
rename from cake/console/libs/console_error_handler.php
rename to lib/Cake/Console/ConsoleErrorHandler.php
diff --git a/cake/console/libs/console_input.php b/lib/Cake/Console/ConsoleInput.php
similarity index 100%
rename from cake/console/libs/console_input.php
rename to lib/Cake/Console/ConsoleInput.php
diff --git a/cake/console/libs/console_input_argument.php b/lib/Cake/Console/ConsoleInputArgument.php
similarity index 100%
rename from cake/console/libs/console_input_argument.php
rename to lib/Cake/Console/ConsoleInputArgument.php
diff --git a/cake/console/libs/console_input_option.php b/lib/Cake/Console/ConsoleInputOption.php
similarity index 100%
rename from cake/console/libs/console_input_option.php
rename to lib/Cake/Console/ConsoleInputOption.php
diff --git a/cake/console/libs/console_input_subcommand.php b/lib/Cake/Console/ConsoleInputSubcommand.php
similarity index 100%
rename from cake/console/libs/console_input_subcommand.php
rename to lib/Cake/Console/ConsoleInputSubcommand.php
diff --git a/cake/console/libs/console_option_parser.php b/lib/Cake/Console/ConsoleOptionParser.php
similarity index 100%
rename from cake/console/libs/console_option_parser.php
rename to lib/Cake/Console/ConsoleOptionParser.php
diff --git a/cake/console/libs/console_output.php b/lib/Cake/Console/ConsoleOutput.php
similarity index 100%
rename from cake/console/libs/console_output.php
rename to lib/Cake/Console/ConsoleOutput.php
diff --git a/cake/console/libs/help_formatter.php b/lib/Cake/Console/HelpFormatter.php
similarity index 100%
rename from cake/console/libs/help_formatter.php
rename to lib/Cake/Console/HelpFormatter.php
diff --git a/cake/console/shells/shell.php b/lib/Cake/Console/Shell.php
similarity index 100%
rename from cake/console/shells/shell.php
rename to lib/Cake/Console/Shell.php
diff --git a/cake/console/shell_dispatcher.php b/lib/Cake/Console/ShellDispatcher.php
similarity index 100%
rename from cake/console/shell_dispatcher.php
rename to lib/Cake/Console/ShellDispatcher.php
diff --git a/cake/console/libs/task_collection.php b/lib/Cake/Console/TaskCollection.php
similarity index 100%
rename from cake/console/libs/task_collection.php
rename to lib/Cake/Console/TaskCollection.php
diff --git a/cake/console/cake b/lib/Cake/Console/cake
similarity index 100%
rename from cake/console/cake
rename to lib/Cake/Console/cake
diff --git a/cake/console/cake.bat b/lib/Cake/Console/cake.bat
similarity index 100%
rename from cake/console/cake.bat
rename to lib/Cake/Console/cake.bat
diff --git a/cake/console/cake.php b/lib/Cake/Console/cake.php
similarity index 100%
rename from cake/console/cake.php
rename to lib/Cake/Console/cake.php
diff --git a/cake/console/templates/default/actions/controller_actions.ctp b/lib/Cake/Console/templates/default/actions/controller_actions.ctp
similarity index 100%
rename from cake/console/templates/default/actions/controller_actions.ctp
rename to lib/Cake/Console/templates/default/actions/controller_actions.ctp
diff --git a/cake/console/templates/default/classes/controller.ctp b/lib/Cake/Console/templates/default/classes/controller.ctp
similarity index 100%
rename from cake/console/templates/default/classes/controller.ctp
rename to lib/Cake/Console/templates/default/classes/controller.ctp
diff --git a/cake/console/templates/default/classes/fixture.ctp b/lib/Cake/Console/templates/default/classes/fixture.ctp
similarity index 100%
rename from cake/console/templates/default/classes/fixture.ctp
rename to lib/Cake/Console/templates/default/classes/fixture.ctp
diff --git a/cake/console/templates/default/classes/model.ctp b/lib/Cake/Console/templates/default/classes/model.ctp
similarity index 100%
rename from cake/console/templates/default/classes/model.ctp
rename to lib/Cake/Console/templates/default/classes/model.ctp
diff --git a/cake/console/templates/default/classes/test.ctp b/lib/Cake/Console/templates/default/classes/test.ctp
similarity index 100%
rename from cake/console/templates/default/classes/test.ctp
rename to lib/Cake/Console/templates/default/classes/test.ctp
diff --git a/cake/console/templates/default/views/form.ctp b/lib/Cake/Console/templates/default/views/form.ctp
similarity index 100%
rename from cake/console/templates/default/views/form.ctp
rename to lib/Cake/Console/templates/default/views/form.ctp
diff --git a/cake/console/templates/default/views/home.ctp b/lib/Cake/Console/templates/default/views/home.ctp
similarity index 100%
rename from cake/console/templates/default/views/home.ctp
rename to lib/Cake/Console/templates/default/views/home.ctp
diff --git a/cake/console/templates/default/views/index.ctp b/lib/Cake/Console/templates/default/views/index.ctp
similarity index 100%
rename from cake/console/templates/default/views/index.ctp
rename to lib/Cake/Console/templates/default/views/index.ctp
diff --git a/cake/console/templates/default/views/view.ctp b/lib/Cake/Console/templates/default/views/view.ctp
similarity index 100%
rename from cake/console/templates/default/views/view.ctp
rename to lib/Cake/Console/templates/default/views/view.ctp
diff --git a/cake/console/templates/skel/.htaccess b/lib/Cake/Console/templates/skel/.htaccess
similarity index 100%
rename from cake/console/templates/skel/.htaccess
rename to lib/Cake/Console/templates/skel/.htaccess
diff --git a/cake/console/templates/skel/app_controller.php b/lib/Cake/Console/templates/skel/app_controller.php
similarity index 100%
rename from cake/console/templates/skel/app_controller.php
rename to lib/Cake/Console/templates/skel/app_controller.php
diff --git a/cake/console/templates/skel/app_helper.php b/lib/Cake/Console/templates/skel/app_helper.php
similarity index 100%
rename from cake/console/templates/skel/app_helper.php
rename to lib/Cake/Console/templates/skel/app_helper.php
diff --git a/cake/console/templates/skel/app_model.php b/lib/Cake/Console/templates/skel/app_model.php
similarity index 100%
rename from cake/console/templates/skel/app_model.php
rename to lib/Cake/Console/templates/skel/app_model.php
diff --git a/cake/console/templates/skel/config/acl.ini.php b/lib/Cake/Console/templates/skel/config/acl.ini.php
similarity index 100%
rename from cake/console/templates/skel/config/acl.ini.php
rename to lib/Cake/Console/templates/skel/config/acl.ini.php
diff --git a/cake/console/templates/skel/config/bootstrap.php b/lib/Cake/Console/templates/skel/config/bootstrap.php
similarity index 100%
rename from cake/console/templates/skel/config/bootstrap.php
rename to lib/Cake/Console/templates/skel/config/bootstrap.php
diff --git a/cake/console/templates/skel/config/core.php b/lib/Cake/Console/templates/skel/config/core.php
similarity index 100%
rename from cake/console/templates/skel/config/core.php
rename to lib/Cake/Console/templates/skel/config/core.php
diff --git a/cake/console/templates/skel/config/database.php.default b/lib/Cake/Console/templates/skel/config/database.php.default
similarity index 100%
rename from cake/console/templates/skel/config/database.php.default
rename to lib/Cake/Console/templates/skel/config/database.php.default
diff --git a/cake/console/templates/skel/config/routes.php b/lib/Cake/Console/templates/skel/config/routes.php
similarity index 100%
rename from cake/console/templates/skel/config/routes.php
rename to lib/Cake/Console/templates/skel/config/routes.php
diff --git a/cake/console/templates/skel/config/schema/db_acl.php b/lib/Cake/Console/templates/skel/config/schema/db_acl.php
similarity index 100%
rename from cake/console/templates/skel/config/schema/db_acl.php
rename to lib/Cake/Console/templates/skel/config/schema/db_acl.php
diff --git a/cake/console/templates/skel/config/schema/db_acl.sql b/lib/Cake/Console/templates/skel/config/schema/db_acl.sql
similarity index 100%
rename from cake/console/templates/skel/config/schema/db_acl.sql
rename to lib/Cake/Console/templates/skel/config/schema/db_acl.sql
diff --git a/cake/console/templates/skel/config/schema/i18n.php b/lib/Cake/Console/templates/skel/config/schema/i18n.php
similarity index 100%
rename from cake/console/templates/skel/config/schema/i18n.php
rename to lib/Cake/Console/templates/skel/config/schema/i18n.php
diff --git a/cake/console/templates/skel/config/schema/i18n.sql b/lib/Cake/Console/templates/skel/config/schema/i18n.sql
similarity index 100%
rename from cake/console/templates/skel/config/schema/i18n.sql
rename to lib/Cake/Console/templates/skel/config/schema/i18n.sql
diff --git a/cake/console/templates/skel/config/schema/sessions.php b/lib/Cake/Console/templates/skel/config/schema/sessions.php
similarity index 100%
rename from cake/console/templates/skel/config/schema/sessions.php
rename to lib/Cake/Console/templates/skel/config/schema/sessions.php
diff --git a/cake/console/templates/skel/config/schema/sessions.sql b/lib/Cake/Console/templates/skel/config/schema/sessions.sql
similarity index 100%
rename from cake/console/templates/skel/config/schema/sessions.sql
rename to lib/Cake/Console/templates/skel/config/schema/sessions.sql
diff --git a/cake/console/templates/skel/console/cake b/lib/Cake/Console/templates/skel/console/cake
similarity index 100%
rename from cake/console/templates/skel/console/cake
rename to lib/Cake/Console/templates/skel/console/cake
diff --git a/cake/console/templates/skel/console/cake.bat b/lib/Cake/Console/templates/skel/console/cake.bat
similarity index 100%
rename from cake/console/templates/skel/console/cake.bat
rename to lib/Cake/Console/templates/skel/console/cake.bat
diff --git a/cake/console/templates/skel/console/cake.php b/lib/Cake/Console/templates/skel/console/cake.php
similarity index 100%
rename from cake/console/templates/skel/console/cake.php
rename to lib/Cake/Console/templates/skel/console/cake.php
diff --git a/cake/console/templates/skel/console/shells/tasks/empty b/lib/Cake/Console/templates/skel/console/shells/tasks/empty
similarity index 100%
rename from cake/console/templates/skel/console/shells/tasks/empty
rename to lib/Cake/Console/templates/skel/console/shells/tasks/empty
diff --git a/cake/console/templates/skel/controllers/components/empty b/lib/Cake/Console/templates/skel/controllers/components/empty
similarity index 100%
rename from cake/console/templates/skel/controllers/components/empty
rename to lib/Cake/Console/templates/skel/controllers/components/empty
diff --git a/cake/console/templates/skel/controllers/pages_controller.php b/lib/Cake/Console/templates/skel/controllers/pages_controller.php
similarity index 100%
rename from cake/console/templates/skel/controllers/pages_controller.php
rename to lib/Cake/Console/templates/skel/controllers/pages_controller.php
diff --git a/cake/console/templates/skel/index.php b/lib/Cake/Console/templates/skel/index.php
similarity index 100%
rename from cake/console/templates/skel/index.php
rename to lib/Cake/Console/templates/skel/index.php
diff --git a/cake/console/templates/skel/libs/empty b/lib/Cake/Console/templates/skel/libs/empty
similarity index 100%
rename from cake/console/templates/skel/libs/empty
rename to lib/Cake/Console/templates/skel/libs/empty
diff --git a/cake/console/templates/skel/locale/eng/LC_MESSAGES/empty b/lib/Cake/Console/templates/skel/locale/eng/LC_MESSAGES/empty
similarity index 100%
rename from cake/console/templates/skel/locale/eng/LC_MESSAGES/empty
rename to lib/Cake/Console/templates/skel/locale/eng/LC_MESSAGES/empty
diff --git a/cake/console/templates/skel/models/behaviors/empty b/lib/Cake/Console/templates/skel/models/behaviors/empty
similarity index 100%
rename from cake/console/templates/skel/models/behaviors/empty
rename to lib/Cake/Console/templates/skel/models/behaviors/empty
diff --git a/cake/console/templates/skel/models/datasources/empty b/lib/Cake/Console/templates/skel/models/datasources/empty
similarity index 100%
rename from cake/console/templates/skel/models/datasources/empty
rename to lib/Cake/Console/templates/skel/models/datasources/empty
diff --git a/cake/console/templates/skel/plugins/empty b/lib/Cake/Console/templates/skel/plugins/empty
similarity index 100%
rename from cake/console/templates/skel/plugins/empty
rename to lib/Cake/Console/templates/skel/plugins/empty
diff --git a/cake/console/templates/skel/tests/cases/behaviors/empty b/lib/Cake/Console/templates/skel/tests/cases/behaviors/empty
similarity index 100%
rename from cake/console/templates/skel/tests/cases/behaviors/empty
rename to lib/Cake/Console/templates/skel/tests/cases/behaviors/empty
diff --git a/cake/console/templates/skel/tests/cases/components/empty b/lib/Cake/Console/templates/skel/tests/cases/components/empty
similarity index 100%
rename from cake/console/templates/skel/tests/cases/components/empty
rename to lib/Cake/Console/templates/skel/tests/cases/components/empty
diff --git a/cake/console/templates/skel/tests/cases/controllers/empty b/lib/Cake/Console/templates/skel/tests/cases/controllers/empty
similarity index 100%
rename from cake/console/templates/skel/tests/cases/controllers/empty
rename to lib/Cake/Console/templates/skel/tests/cases/controllers/empty
diff --git a/cake/console/templates/skel/tests/cases/datasources/empty b/lib/Cake/Console/templates/skel/tests/cases/datasources/empty
similarity index 100%
rename from cake/console/templates/skel/tests/cases/datasources/empty
rename to lib/Cake/Console/templates/skel/tests/cases/datasources/empty
diff --git a/cake/console/templates/skel/tests/cases/helpers/empty b/lib/Cake/Console/templates/skel/tests/cases/helpers/empty
similarity index 100%
rename from cake/console/templates/skel/tests/cases/helpers/empty
rename to lib/Cake/Console/templates/skel/tests/cases/helpers/empty
diff --git a/cake/console/templates/skel/tests/cases/models/empty b/lib/Cake/Console/templates/skel/tests/cases/models/empty
similarity index 100%
rename from cake/console/templates/skel/tests/cases/models/empty
rename to lib/Cake/Console/templates/skel/tests/cases/models/empty
diff --git a/cake/console/templates/skel/tests/cases/shells/empty b/lib/Cake/Console/templates/skel/tests/cases/shells/empty
similarity index 100%
rename from cake/console/templates/skel/tests/cases/shells/empty
rename to lib/Cake/Console/templates/skel/tests/cases/shells/empty
diff --git a/cake/console/templates/skel/tests/fixtures/empty b/lib/Cake/Console/templates/skel/tests/fixtures/empty
similarity index 100%
rename from cake/console/templates/skel/tests/fixtures/empty
rename to lib/Cake/Console/templates/skel/tests/fixtures/empty
diff --git a/cake/console/templates/skel/tmp/cache/models/empty b/lib/Cake/Console/templates/skel/tmp/cache/models/empty
similarity index 100%
rename from cake/console/templates/skel/tmp/cache/models/empty
rename to lib/Cake/Console/templates/skel/tmp/cache/models/empty
diff --git a/cake/console/templates/skel/tmp/cache/persistent/empty b/lib/Cake/Console/templates/skel/tmp/cache/persistent/empty
similarity index 100%
rename from cake/console/templates/skel/tmp/cache/persistent/empty
rename to lib/Cake/Console/templates/skel/tmp/cache/persistent/empty
diff --git a/cake/console/templates/skel/tmp/cache/views/empty b/lib/Cake/Console/templates/skel/tmp/cache/views/empty
similarity index 100%
rename from cake/console/templates/skel/tmp/cache/views/empty
rename to lib/Cake/Console/templates/skel/tmp/cache/views/empty
diff --git a/cake/console/templates/skel/tmp/logs/empty b/lib/Cake/Console/templates/skel/tmp/logs/empty
similarity index 100%
rename from cake/console/templates/skel/tmp/logs/empty
rename to lib/Cake/Console/templates/skel/tmp/logs/empty
diff --git a/cake/console/templates/skel/tmp/sessions/empty b/lib/Cake/Console/templates/skel/tmp/sessions/empty
similarity index 100%
rename from cake/console/templates/skel/tmp/sessions/empty
rename to lib/Cake/Console/templates/skel/tmp/sessions/empty
diff --git a/cake/console/templates/skel/tmp/tests/empty b/lib/Cake/Console/templates/skel/tmp/tests/empty
similarity index 100%
rename from cake/console/templates/skel/tmp/tests/empty
rename to lib/Cake/Console/templates/skel/tmp/tests/empty
diff --git a/cake/console/templates/skel/vendors/empty b/lib/Cake/Console/templates/skel/vendors/empty
similarity index 100%
rename from cake/console/templates/skel/vendors/empty
rename to lib/Cake/Console/templates/skel/vendors/empty
diff --git a/cake/console/templates/skel/views/elements/email/html/default.ctp b/lib/Cake/Console/templates/skel/views/elements/email/html/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/elements/email/html/default.ctp
rename to lib/Cake/Console/templates/skel/views/elements/email/html/default.ctp
diff --git a/cake/console/templates/skel/views/elements/email/text/default.ctp b/lib/Cake/Console/templates/skel/views/elements/email/text/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/elements/email/text/default.ctp
rename to lib/Cake/Console/templates/skel/views/elements/email/text/default.ctp
diff --git a/cake/console/templates/skel/views/elements/empty b/lib/Cake/Console/templates/skel/views/elements/empty
similarity index 100%
rename from cake/console/templates/skel/views/elements/empty
rename to lib/Cake/Console/templates/skel/views/elements/empty
diff --git a/cake/console/templates/skel/views/errors/empty b/lib/Cake/Console/templates/skel/views/errors/empty
similarity index 100%
rename from cake/console/templates/skel/views/errors/empty
rename to lib/Cake/Console/templates/skel/views/errors/empty
diff --git a/cake/console/templates/skel/views/helpers/empty b/lib/Cake/Console/templates/skel/views/helpers/empty
similarity index 100%
rename from cake/console/templates/skel/views/helpers/empty
rename to lib/Cake/Console/templates/skel/views/helpers/empty
diff --git a/cake/console/templates/skel/views/layouts/ajax.ctp b/lib/Cake/Console/templates/skel/views/layouts/ajax.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/ajax.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/ajax.ctp
diff --git a/cake/console/templates/skel/views/layouts/default.ctp b/lib/Cake/Console/templates/skel/views/layouts/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/default.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/default.ctp
diff --git a/cake/console/templates/skel/views/layouts/email/html/default.ctp b/lib/Cake/Console/templates/skel/views/layouts/email/html/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/email/html/default.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/email/html/default.ctp
diff --git a/cake/console/templates/skel/views/layouts/email/text/default.ctp b/lib/Cake/Console/templates/skel/views/layouts/email/text/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/email/text/default.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/email/text/default.ctp
diff --git a/cake/console/templates/skel/views/layouts/flash.ctp b/lib/Cake/Console/templates/skel/views/layouts/flash.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/flash.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/flash.ctp
diff --git a/cake/console/templates/skel/views/layouts/js/default.ctp b/lib/Cake/Console/templates/skel/views/layouts/js/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/js/default.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/js/default.ctp
diff --git a/cake/console/templates/skel/views/layouts/rss/default.ctp b/lib/Cake/Console/templates/skel/views/layouts/rss/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/rss/default.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/rss/default.ctp
diff --git a/cake/console/templates/skel/views/layouts/xml/default.ctp b/lib/Cake/Console/templates/skel/views/layouts/xml/default.ctp
similarity index 100%
rename from cake/console/templates/skel/views/layouts/xml/default.ctp
rename to lib/Cake/Console/templates/skel/views/layouts/xml/default.ctp
diff --git a/cake/console/templates/skel/views/pages/empty b/lib/Cake/Console/templates/skel/views/pages/empty
similarity index 100%
rename from cake/console/templates/skel/views/pages/empty
rename to lib/Cake/Console/templates/skel/views/pages/empty
diff --git a/cake/console/templates/skel/views/scaffolds/empty b/lib/Cake/Console/templates/skel/views/scaffolds/empty
similarity index 100%
rename from cake/console/templates/skel/views/scaffolds/empty
rename to lib/Cake/Console/templates/skel/views/scaffolds/empty
diff --git a/cake/console/templates/skel/webroot/.htaccess b/lib/Cake/Console/templates/skel/webroot/.htaccess
similarity index 100%
rename from cake/console/templates/skel/webroot/.htaccess
rename to lib/Cake/Console/templates/skel/webroot/.htaccess
diff --git a/cake/console/templates/skel/webroot/css.php b/lib/Cake/Console/templates/skel/webroot/css.php
similarity index 100%
rename from cake/console/templates/skel/webroot/css.php
rename to lib/Cake/Console/templates/skel/webroot/css.php
diff --git a/cake/console/templates/skel/webroot/css/cake.generic.css b/lib/Cake/Console/templates/skel/webroot/css/cake.generic.css
similarity index 100%
rename from cake/console/templates/skel/webroot/css/cake.generic.css
rename to lib/Cake/Console/templates/skel/webroot/css/cake.generic.css
diff --git a/cake/console/templates/skel/webroot/favicon.ico b/lib/Cake/Console/templates/skel/webroot/favicon.ico
similarity index 100%
rename from cake/console/templates/skel/webroot/favicon.ico
rename to lib/Cake/Console/templates/skel/webroot/favicon.ico
diff --git a/cake/console/templates/skel/webroot/img/cake.icon.png b/lib/Cake/Console/templates/skel/webroot/img/cake.icon.png
similarity index 100%
rename from cake/console/templates/skel/webroot/img/cake.icon.png
rename to lib/Cake/Console/templates/skel/webroot/img/cake.icon.png
diff --git a/cake/console/templates/skel/webroot/img/cake.power.gif b/lib/Cake/Console/templates/skel/webroot/img/cake.power.gif
similarity index 100%
rename from cake/console/templates/skel/webroot/img/cake.power.gif
rename to lib/Cake/Console/templates/skel/webroot/img/cake.power.gif
diff --git a/cake/console/templates/skel/webroot/index.php b/lib/Cake/Console/templates/skel/webroot/index.php
similarity index 100%
rename from cake/console/templates/skel/webroot/index.php
rename to lib/Cake/Console/templates/skel/webroot/index.php
diff --git a/cake/console/templates/skel/webroot/js/empty b/lib/Cake/Console/templates/skel/webroot/js/empty
similarity index 100%
rename from cake/console/templates/skel/webroot/js/empty
rename to lib/Cake/Console/templates/skel/webroot/js/empty
diff --git a/cake/console/templates/skel/webroot/test.php b/lib/Cake/Console/templates/skel/webroot/test.php
similarity index 100%
rename from cake/console/templates/skel/webroot/test.php
rename to lib/Cake/Console/templates/skel/webroot/test.php
From e3690ebccba6f8b29f50c4ffbc69d7869a805112 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 01:26:10 -0430
Subject: [PATCH 047/668] Making shells run again
---
lib/Cake/Console/Command/CommandListShell.php | 8 ++++----
lib/Cake/Console/ConsoleErrorHandler.php | 4 ++--
lib/Cake/Console/ConsoleOptionParser.php | 9 +++++----
lib/Cake/Console/Shell.php | 9 +++++----
lib/Cake/Console/ShellDispatcher.php | 13 +++++--------
lib/Cake/Console/TaskCollection.php | 2 +-
lib/Cake/Console/cake.php | 2 +-
lib/Cake/Core/App.php | 2 +-
lib/Cake/Core/Configure.php | 2 +-
lib/Cake/I18n/L10n.php | 2 +-
lib/Cake/bootstrap.php | 4 ++--
{cake => lib/Cake}/config/config.php | 0
.../Cake}/config/unicode/casefolding/0080_00ff.php | 0
.../Cake}/config/unicode/casefolding/0100_017f.php | 0
.../Cake}/config/unicode/casefolding/0180_024F.php | 0
.../Cake}/config/unicode/casefolding/0250_02af.php | 0
.../Cake}/config/unicode/casefolding/0370_03ff.php | 0
.../Cake}/config/unicode/casefolding/0400_04ff.php | 0
.../Cake}/config/unicode/casefolding/0500_052f.php | 0
.../Cake}/config/unicode/casefolding/0530_058f.php | 0
.../Cake}/config/unicode/casefolding/1e00_1eff.php | 0
.../Cake}/config/unicode/casefolding/1f00_1fff.php | 0
.../Cake}/config/unicode/casefolding/2100_214f.php | 0
.../Cake}/config/unicode/casefolding/2150_218f.php | 0
.../Cake}/config/unicode/casefolding/2460_24ff.php | 0
.../Cake}/config/unicode/casefolding/2c00_2c5f.php | 0
.../Cake}/config/unicode/casefolding/2c60_2c7f.php | 0
.../Cake}/config/unicode/casefolding/2c80_2cff.php | 0
.../Cake}/config/unicode/casefolding/ff00_ffef.php | 0
29 files changed, 28 insertions(+), 29 deletions(-)
rename {cake => lib/Cake}/config/config.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0080_00ff.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0100_017f.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0180_024F.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0250_02af.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0370_03ff.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0400_04ff.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0500_052f.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/0530_058f.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/1e00_1eff.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/1f00_1fff.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/2100_214f.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/2150_218f.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/2460_24ff.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/2c00_2c5f.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/2c60_2c7f.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/2c80_2cff.php (100%)
rename {cake => lib/Cake}/config/unicode/casefolding/ff00_ffef.php (100%)
diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php
index cd05af4ba..4df4dc847 100644
--- a/lib/Cake/Console/Command/CommandListShell.php
+++ b/lib/Cake/Console/Command/CommandListShell.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Shell', 'Console');
+
/**
* Shows a list of commands available from the console.
*
@@ -111,10 +113,8 @@ class CommandListShell extends Shell {
continue;
}
foreach ($shells as $shell) {
- if ($shell !== 'shell.php' && $shell !== 'app_shell.php') {
- $shell = str_replace('.php', '', $shell);
- $shellList[$shell][$type] = $type;
- }
+ $shell = str_replace('Shell.php', '', $shell);
+ $shellList[$shell][$type] = $type;
}
}
return $shellList;
diff --git a/lib/Cake/Console/ConsoleErrorHandler.php b/lib/Cake/Console/ConsoleErrorHandler.php
index 120c09d74..9eaebb2e5 100644
--- a/lib/Cake/Console/ConsoleErrorHandler.php
+++ b/lib/Cake/Console/ConsoleErrorHandler.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ErrorHandler');
-require_once 'console_output.php';
+App::uses('ErrorHandler', 'Error');
+App::uses('ConsoleOutput', 'Console');
/**
* Error Handler for Cake console. Does simple printing of the
diff --git a/lib/Cake/Console/ConsoleOptionParser.php b/lib/Cake/Console/ConsoleOptionParser.php
index 8a9f8af65..8eec763d6 100644
--- a/lib/Cake/Console/ConsoleOptionParser.php
+++ b/lib/Cake/Console/ConsoleOptionParser.php
@@ -17,10 +17,11 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once CONSOLE_LIBS . 'console_input_option.php';
-require_once CONSOLE_LIBS . 'console_input_argument.php';
-require_once CONSOLE_LIBS . 'console_input_subcommand.php';
-require_once CONSOLE_LIBS . 'help_formatter.php';
+App::uses('TaskCollection', 'Console');
+App::uses('ConsoleOutput', 'Console');
+App::uses('ConsoleInput', 'Console');
+App::uses('ConsoleInputOption', 'Console');
+App::uses('ConsoleOptionParser', 'Console');
/**
* Handles parsing the ARGV in the command line and provides support
diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php
index 55c81f94d..4f40bc8de 100644
--- a/lib/Cake/Console/Shell.php
+++ b/lib/Cake/Console/Shell.php
@@ -17,10 +17,11 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once CONSOLE_LIBS . 'task_collection.php';
-require_once CONSOLE_LIBS . 'console_output.php';
-require_once CONSOLE_LIBS . 'console_input.php';
-require_once CONSOLE_LIBS . 'console_option_parser.php';
+
+App::uses('TaskCollection', 'Console');
+App::uses('ConsoleOutput', 'Console');
+App::uses('ConsoleInput', 'Console');
+App::uses('ConsoleOptionParser', 'Console');
/**
* Base class for command-line utilities for automating programmer chores.
diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php
index a80407613..ad75dd1d7 100644
--- a/lib/Cake/Console/ShellDispatcher.php
+++ b/lib/Cake/Console/ShellDispatcher.php
@@ -133,13 +133,13 @@ class ShellDispatcher {
}
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
- require CORE_PATH . 'cake' . DS . 'bootstrap.php';
+ require CORE_PATH . 'Cake' . DS . 'bootstrap.php';
if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
include_once CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
App::build();
}
- require_once CONSOLE_LIBS . 'console_error_handler.php';
+ require_once CONSOLE_LIBS . 'ConsoleErrorHandler.php';
set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
set_error_handler(array('ConsoleErrorHandler', 'handleError'), Configure::read('Error.level'));
@@ -209,14 +209,11 @@ class ShellDispatcher {
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell, true);
- $loaded = App::import('Shell', $plugin . $shell);
$class = Inflector::camelize($shell) . 'Shell';
-
- if (!$loaded) {
- throw new MissingShellFileException(array('shell' => $shell));
- }
+ $loaded = App::uses($class, $plugin . 'Console/Command');
+
if (!class_exists($class)) {
- throw new MissingShellClassException(array('shell' => $class));
+ throw new MissingShellFileException(array('shell' => $shell));
}
$Shell = new $class();
return $Shell;
diff --git a/lib/Cake/Console/TaskCollection.php b/lib/Cake/Console/TaskCollection.php
index d28b13b6d..00a1c4b54 100644
--- a/lib/Cake/Console/TaskCollection.php
+++ b/lib/Cake/Console/TaskCollection.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
+App::uses('ObjectCollection', 'Utility');
class TaskCollection extends ObjectCollection {
/**
diff --git a/lib/Cake/Console/cake.php b/lib/Cake/Console/cake.php
index 02468c38f..fc0c0b484 100644
--- a/lib/Cake/Console/cake.php
+++ b/lib/Cake/Console/cake.php
@@ -20,7 +20,7 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'shell_dispatcher.php');
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'ShellDispatcher.php');
return ShellDispatcher::run($argv);
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 1410637ba..444f99057 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -354,7 +354,7 @@ class App {
$paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS;
$paths['plugins'][] = $path . 'plugins' . DS;
$paths['vendors'][] = $path . 'vendors' . DS;
- $paths['shells'][] = $cake . 'console' . DS . 'shells' . DS;
+ $paths['shells'][] = $libs . 'Console' . DS . 'Command' . DS;
// Provide BC path to vendors/shells
$paths['shells'][] = $path . 'vendors' . DS . 'shells' . DS;
}
diff --git a/lib/Cake/Core/Configure.php b/lib/Cake/Core/Configure.php
index fca858832..243956433 100644
--- a/lib/Cake/Core/Configure.php
+++ b/lib/Cake/Core/Configure.php
@@ -345,7 +345,7 @@ class Configure {
*/
public static function version() {
if (!isset(self::$_values['Cake']['version'])) {
- require(CORE_PATH . 'cake' . DS . 'config' . DS . 'config.php');
+ require(LIBS . 'config' . DS . 'config.php');
self::write($config);
}
return self::$_values['Cake']['version'];
diff --git a/lib/Cake/I18n/L10n.php b/lib/Cake/I18n/L10n.php
index 1844507c3..08b25ca92 100644
--- a/lib/Cake/I18n/L10n.php
+++ b/lib/Cake/I18n/L10n.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4116
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('CakeRequest', 'Core');
+App::uses('CakeRequest', 'Network');
/**
* Localization
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index f7ca698e3..a6b0099f6 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -40,7 +40,7 @@ error_reporting(E_ALL & ~E_DEPRECATED);
/**
* Path to the cake directory.
*/
- define('CAKE', CORE_PATH . 'lib' . DS . 'Cake' . DS);
+ define('CAKE', CORE_PATH . 'Cake' . DS);
/**
* Path to the application's directory.
@@ -126,7 +126,7 @@ if (!defined('CONFIGS')) {
/**
* Path to the console libs direcotry.
*/
- define('CONSOLE_LIBS', CAKE.'console'.DS.'libs'.DS);
+ define('CONSOLE_LIBS', CAKE . 'Console' . DS);
/**
* Path to the tests directory.
diff --git a/cake/config/config.php b/lib/Cake/config/config.php
similarity index 100%
rename from cake/config/config.php
rename to lib/Cake/config/config.php
diff --git a/cake/config/unicode/casefolding/0080_00ff.php b/lib/Cake/config/unicode/casefolding/0080_00ff.php
similarity index 100%
rename from cake/config/unicode/casefolding/0080_00ff.php
rename to lib/Cake/config/unicode/casefolding/0080_00ff.php
diff --git a/cake/config/unicode/casefolding/0100_017f.php b/lib/Cake/config/unicode/casefolding/0100_017f.php
similarity index 100%
rename from cake/config/unicode/casefolding/0100_017f.php
rename to lib/Cake/config/unicode/casefolding/0100_017f.php
diff --git a/cake/config/unicode/casefolding/0180_024F.php b/lib/Cake/config/unicode/casefolding/0180_024F.php
similarity index 100%
rename from cake/config/unicode/casefolding/0180_024F.php
rename to lib/Cake/config/unicode/casefolding/0180_024F.php
diff --git a/cake/config/unicode/casefolding/0250_02af.php b/lib/Cake/config/unicode/casefolding/0250_02af.php
similarity index 100%
rename from cake/config/unicode/casefolding/0250_02af.php
rename to lib/Cake/config/unicode/casefolding/0250_02af.php
diff --git a/cake/config/unicode/casefolding/0370_03ff.php b/lib/Cake/config/unicode/casefolding/0370_03ff.php
similarity index 100%
rename from cake/config/unicode/casefolding/0370_03ff.php
rename to lib/Cake/config/unicode/casefolding/0370_03ff.php
diff --git a/cake/config/unicode/casefolding/0400_04ff.php b/lib/Cake/config/unicode/casefolding/0400_04ff.php
similarity index 100%
rename from cake/config/unicode/casefolding/0400_04ff.php
rename to lib/Cake/config/unicode/casefolding/0400_04ff.php
diff --git a/cake/config/unicode/casefolding/0500_052f.php b/lib/Cake/config/unicode/casefolding/0500_052f.php
similarity index 100%
rename from cake/config/unicode/casefolding/0500_052f.php
rename to lib/Cake/config/unicode/casefolding/0500_052f.php
diff --git a/cake/config/unicode/casefolding/0530_058f.php b/lib/Cake/config/unicode/casefolding/0530_058f.php
similarity index 100%
rename from cake/config/unicode/casefolding/0530_058f.php
rename to lib/Cake/config/unicode/casefolding/0530_058f.php
diff --git a/cake/config/unicode/casefolding/1e00_1eff.php b/lib/Cake/config/unicode/casefolding/1e00_1eff.php
similarity index 100%
rename from cake/config/unicode/casefolding/1e00_1eff.php
rename to lib/Cake/config/unicode/casefolding/1e00_1eff.php
diff --git a/cake/config/unicode/casefolding/1f00_1fff.php b/lib/Cake/config/unicode/casefolding/1f00_1fff.php
similarity index 100%
rename from cake/config/unicode/casefolding/1f00_1fff.php
rename to lib/Cake/config/unicode/casefolding/1f00_1fff.php
diff --git a/cake/config/unicode/casefolding/2100_214f.php b/lib/Cake/config/unicode/casefolding/2100_214f.php
similarity index 100%
rename from cake/config/unicode/casefolding/2100_214f.php
rename to lib/Cake/config/unicode/casefolding/2100_214f.php
diff --git a/cake/config/unicode/casefolding/2150_218f.php b/lib/Cake/config/unicode/casefolding/2150_218f.php
similarity index 100%
rename from cake/config/unicode/casefolding/2150_218f.php
rename to lib/Cake/config/unicode/casefolding/2150_218f.php
diff --git a/cake/config/unicode/casefolding/2460_24ff.php b/lib/Cake/config/unicode/casefolding/2460_24ff.php
similarity index 100%
rename from cake/config/unicode/casefolding/2460_24ff.php
rename to lib/Cake/config/unicode/casefolding/2460_24ff.php
diff --git a/cake/config/unicode/casefolding/2c00_2c5f.php b/lib/Cake/config/unicode/casefolding/2c00_2c5f.php
similarity index 100%
rename from cake/config/unicode/casefolding/2c00_2c5f.php
rename to lib/Cake/config/unicode/casefolding/2c00_2c5f.php
diff --git a/cake/config/unicode/casefolding/2c60_2c7f.php b/lib/Cake/config/unicode/casefolding/2c60_2c7f.php
similarity index 100%
rename from cake/config/unicode/casefolding/2c60_2c7f.php
rename to lib/Cake/config/unicode/casefolding/2c60_2c7f.php
diff --git a/cake/config/unicode/casefolding/2c80_2cff.php b/lib/Cake/config/unicode/casefolding/2c80_2cff.php
similarity index 100%
rename from cake/config/unicode/casefolding/2c80_2cff.php
rename to lib/Cake/config/unicode/casefolding/2c80_2cff.php
diff --git a/cake/config/unicode/casefolding/ff00_ffef.php b/lib/Cake/config/unicode/casefolding/ff00_ffef.php
similarity index 100%
rename from cake/config/unicode/casefolding/ff00_ffef.php
rename to lib/Cake/config/unicode/casefolding/ff00_ffef.php
From b5122e6e8120a83b41878715acb0814125130fa3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 01:44:17 -0430
Subject: [PATCH 048/668] Fixing more console classes
---
lib/Cake/Console/Command/CommandListShell.php | 2 --
lib/Cake/Console/Command/Task/ModelTask.php | 5 ++---
lib/Cake/Console/ConsoleOptionParser.php | 1 +
lib/Cake/Console/HelpFormatter.php | 2 +-
lib/Cake/Console/Shell.php | 1 +
lib/Cake/Console/ShellDispatcher.php | 5 ++++-
lib/Cake/Console/TaskCollection.php | 4 +---
lib/Cake/Model/Model.php | 8 ++++----
8 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php
index 4df4dc847..65a576b48 100644
--- a/lib/Cake/Console/Command/CommandListShell.php
+++ b/lib/Cake/Console/Command/CommandListShell.php
@@ -18,8 +18,6 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Shell', 'Console');
-
/**
* Shows a list of commands available from the console.
*
diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php
index 7616ef14c..c893de33a 100644
--- a/lib/Cake/Console/Command/Task/ModelTask.php
+++ b/lib/Cake/Console/Command/Task/ModelTask.php
@@ -18,7 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-include_once dirname(__FILE__) . DS . 'bake.php';
+App::uses('BakeTask', 'Console/Command/Task');
+App::uses('ConnectionManager', 'Model');
/**
* Task class for creating and updating model files.
@@ -791,7 +792,6 @@ class ModelTask extends BakeTask {
if (!isset($useDbConfig)) {
$useDbConfig = $this->connection;
}
- App::import('Model', 'ConnectionManager', false);
$db = ConnectionManager::getDataSource($useDbConfig);
$useTable = Inflector::tableize($modelName);
@@ -820,7 +820,6 @@ class ModelTask extends BakeTask {
if (!isset($useDbConfig)) {
$useDbConfig = $this->connection;
}
- App::import('Model', 'ConnectionManager', false);
$tables = array();
$db = ConnectionManager::getDataSource($useDbConfig);
diff --git a/lib/Cake/Console/ConsoleOptionParser.php b/lib/Cake/Console/ConsoleOptionParser.php
index 8eec763d6..179999a1b 100644
--- a/lib/Cake/Console/ConsoleOptionParser.php
+++ b/lib/Cake/Console/ConsoleOptionParser.php
@@ -21,6 +21,7 @@ App::uses('TaskCollection', 'Console');
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ConsoleInputOption', 'Console');
+App::uses('ConsoleInputArgument', 'Console');
App::uses('ConsoleOptionParser', 'Console');
/**
diff --git a/lib/Cake/Console/HelpFormatter.php b/lib/Cake/Console/HelpFormatter.php
index 002689899..0b7add61d 100644
--- a/lib/Cake/Console/HelpFormatter.php
+++ b/lib/Cake/Console/HelpFormatter.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'String', false);
+App::import('String', 'Utility');
/**
* HelpFormatter formats help for console shells. Can format to either
diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php
index 4f40bc8de..ff671ef34 100644
--- a/lib/Cake/Console/Shell.php
+++ b/lib/Cake/Console/Shell.php
@@ -21,6 +21,7 @@
App::uses('TaskCollection', 'Console');
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
+App::uses('ConsoleInputSubcommand', 'Console');
App::uses('ConsoleOptionParser', 'Console');
/**
diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php
index ad75dd1d7..45b07f0c5 100644
--- a/lib/Cake/Console/ShellDispatcher.php
+++ b/lib/Cake/Console/ShellDispatcher.php
@@ -209,8 +209,11 @@ class ShellDispatcher {
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell, true);
+
$class = Inflector::camelize($shell) . 'Shell';
- $loaded = App::uses($class, $plugin . 'Console/Command');
+
+ App::uses('Shell', 'Console');
+ App::uses($class, $plugin . 'Console/Command');
if (!class_exists($class)) {
throw new MissingShellFileException(array('shell' => $shell));
diff --git a/lib/Cake/Console/TaskCollection.php b/lib/Cake/Console/TaskCollection.php
index 00a1c4b54..b681d571d 100644
--- a/lib/Cake/Console/TaskCollection.php
+++ b/lib/Cake/Console/TaskCollection.php
@@ -61,10 +61,8 @@ class TaskCollection extends ObjectCollection {
}
$taskFile = Inflector::underscore($name);
$taskClass = $name . 'Task';
+ App::uses($taskClass, 'Console/Command/Task');
if (!class_exists($taskClass)) {
- if (!App::import('Shell', $plugin . $this->taskPathPrefix . $name)) {
- throw new MissingTaskFileException($taskFile . '.php');
- }
if (!class_exists($taskClass)) {
throw new MissingTaskClassException($taskClass);
}
diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php
index 9cb46a682..3c3f234e9 100644
--- a/lib/Cake/Model/Model.php
+++ b/lib/Cake/Model/Model.php
@@ -23,13 +23,13 @@
/**
* Included libs
*/
-App::uses('ClassRegistry', 'Core');
-App::uses('Validation', 'Core');
-App::uses('String', 'Core');
+App::uses('ClassRegistry', 'Utility');
+App::uses('Validation', 'Utility');
+App::uses('String', 'Utility');
App::uses('BehaviorCollection', 'Model');
App::uses('ModelBehavior', 'Model');
App::uses('ConnectionManager', 'Model');
-App::uses('Xml', 'Core');
+App::uses('Xml', 'Utility');
/**
* Object-relational mapper.
From 66145db2a9653f507cb2b894d67fd54ad76a130e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 19:50:56 -0430
Subject: [PATCH 049/668] Fixing class loading for bake tasks
---
lib/Cake/Console/Command/Task/ControllerTask.php | 2 +-
lib/Cake/Console/Command/Task/ExtractTask.php | 2 +-
lib/Cake/Console/Command/Task/FixtureTask.php | 4 +++-
lib/Cake/Console/Command/Task/ProjectTask.php | 3 ++-
lib/Cake/Console/Command/Task/TemplateTask.php | 3 ++-
lib/Cake/Console/Command/Task/TestTask.php | 4 ++--
lib/Cake/Console/Command/Task/ViewTask.php | 5 +++--
7 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php
index 6ec3c4371..46f512365 100644
--- a/lib/Cake/Console/Command/Task/ControllerTask.php
+++ b/lib/Cake/Console/Command/Task/ControllerTask.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-include_once dirname(__FILE__) . DS . 'bake.php';
+App::uses('BakeTask', 'Console/Command/Task');
/**
* Task class for creating and updating controller files.
diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php
index 34c24314e..89af9153c 100644
--- a/lib/Cake/Console/Command/Task/ExtractTask.php
+++ b/lib/Cake/Console/Command/Task/ExtractTask.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'File');
+App::uses('File', 'Utility');
/**
* Language string extractor
*
diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php
index 3bf60f3ae..cc081c84c 100644
--- a/lib/Cake/Console/Command/Task/FixtureTask.php
+++ b/lib/Cake/Console/Command/Task/FixtureTask.php
@@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-include_once dirname(__FILE__) . DS . 'bake.php';
+
+App::uses('BakeTask', 'Console/Command/Task');
+
/**
* Task class for creating and updating fixtures files.
*
diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php
index bb2a8f34b..4a5538220 100644
--- a/lib/Cake/Console/Command/Task/ProjectTask.php
+++ b/lib/Cake/Console/Command/Task/ProjectTask.php
@@ -18,7 +18,8 @@
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'File');
+
+App::uses('File', 'Utility');
/**
* Task class for creating new project apps and plugins
diff --git a/lib/Cake/Console/Command/Task/TemplateTask.php b/lib/Cake/Console/Command/Task/TemplateTask.php
index 85eed96c6..b30881581 100644
--- a/lib/Cake/Console/Command/Task/TemplateTask.php
+++ b/lib/Cake/Console/Command/Task/TemplateTask.php
@@ -17,7 +17,8 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Folder');
+
+App::uses('Folder', 'Utility');
class TemplateTask extends Shell {
diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php
index 093457421..3a52b6569 100644
--- a/lib/Cake/Console/Command/Task/TestTask.php
+++ b/lib/Cake/Console/Command/Task/TestTask.php
@@ -18,8 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-include_once dirname(__FILE__) . DS . 'bake.php';
-App::import('Model', 'ClassRegistry');
+App::uses('BakeTask', 'Console/Command/Task');
+App::uses('ClassRegistry', 'Utility');
/**
* Task class for creating and updating test files.
diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php
index bf8777238..fc3baa8ae 100644
--- a/lib/Cake/Console/Command/Task/ViewTask.php
+++ b/lib/Cake/Console/Command/Task/ViewTask.php
@@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', 'Controller', false);
-include_once dirname(__FILE__) . DS . 'bake.php';
+
+App::uses('Controller', 'Controller');
+App::uses('BakeTask', 'Console/Command/Task');
/**
* Task class for creating and updating view files.
From 1c368abc1a3b10aa657b9877e0fc64140babc11a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 19:51:26 -0430
Subject: [PATCH 050/668] Adding back cache loading for "objects" in App class
---
lib/Cake/Core/App.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 444f99057..f22d8925d 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -609,6 +609,7 @@ class App {
*/
public static function init() {
self::$__map = (array)Cache::read('file_map', '_cake_core_');
+ self::$__objects = (array)Cache::read('object_map', '_cake_core_');
register_shutdown_function(array('App', 'shutdown'));
}
From 09120b715c75ff7bf9c4ab103fa2ed1474570f85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 19:58:09 -0430
Subject: [PATCH 051/668] Modifying index.php so the framework is able to
bootstrap itself again
---
app/webroot/index.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/webroot/index.php b/app/webroot/index.php
index 719f172c4..70991f787 100644
--- a/app/webroot/index.php
+++ b/app/webroot/index.php
@@ -50,7 +50,7 @@
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
- define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ define('CAKE_CORE_INCLUDE_PATH', ROOT . DS .'lib');
}
/**
@@ -74,7 +74,7 @@
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
return;
} else {
- require LIBS . 'dispatcher.php';
+ require LIBS . 'Routing' . DS .'Dispatcher.php';
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(isset($_GET['url']) ? $_GET['url'] : null));
}
From 7828f7d2fb0e37af468af304c329c7a4ca4df949 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 19:59:07 -0430
Subject: [PATCH 052/668] Lazy loading connections in ConnectionManager,
changing some class names and imports
---
lib/Cake/Model/ConnectionManager.php | 16 ++++++++--------
lib/Cake/Model/Datasource/CakeSession.php | 5 +----
lib/Cake/Model/Datasource/Database/Sqlite.php | 4 +++-
lib/Cake/Utility/File.php | 4 +---
lib/Cake/View/pages/home.ctp | 11 ++++-------
5 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index de3a4e90c..208d6ba9d 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -69,7 +69,6 @@ class ConnectionManager {
include_once CONFIGS . 'database.php';
if (class_exists('DATABASE_CONFIG')) {
self::$config = new DATABASE_CONFIG();
- self::_getConnectionObjects();
}
register_shutdown_function('ConnectionManager::shutdown');
self::$_init = true;
@@ -91,11 +90,16 @@ class ConnectionManager {
return $return;
}
+ if (empty(self::$_connectionsEnum[$name])) {
+ self::_getConnectionObject($name);
+ }
+
if (empty(self::$_connectionsEnum[$name])) {
trigger_error(__("ConnectionManager::getDataSource - Non-existent data source %s", $name), E_USER_ERROR);
$null = null;
return $null;
}
+
$conn = self::$_connectionsEnum[$name];
$class = $conn['classname'];
@@ -222,13 +226,9 @@ class ConnectionManager {
*
* @return void
*/
- protected static function _getConnectionObjects() {
- $connections = get_object_vars(self::$config);
-
- if ($connections != null) {
- foreach ($connections as $name => $config) {
- self::$_connectionsEnum[$name] = self::_connectionData($config);
- }
+ protected static function _getConnectionObject($name) {
+ if (!empty(self::$config->{$name})) {
+ self::$_connectionsEnum[$name] = self::_connectionData(self::$config->{$name});
} else {
throw new MissingConnectionException(array('class' => 'ConnectionManager'));
}
diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php
index fd67272ad..589153383 100644
--- a/lib/Cake/Model/Datasource/CakeSession.php
+++ b/lib/Cake/Model/Datasource/CakeSession.php
@@ -559,10 +559,7 @@ class CakeSession {
*/
protected static function _getHandler($handler) {
list($plugin, $class) = pluginSplit($handler, true);
- $found = App::import('Lib', $plugin . 'session/' . $class);
- if (!$found) {
- App::import('Core', 'session/' . $class);
- }
+ App::uses($class, $plugin . 'Model/Datasource/Session');
if (!class_exists($class)) {
throw new Exception(__('Could not load %s to handle the session.', $class));
}
diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php
index e4a50b4c2..817e00cf1 100644
--- a/lib/Cake/Model/Datasource/Database/Sqlite.php
+++ b/lib/Cake/Model/Datasource/Database/Sqlite.php
@@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('DboSource', 'Model/Datasource');
+
/**
* DBO implementation for the SQLite3 DBMS.
*
@@ -26,7 +28,7 @@
* @package datasources
* @subpackage cake.cake.libs.model.datasources.dbo
*/
-class DboSqlite extends DboSource {
+class Sqlite extends DboSource {
/**
* Datasource Description
diff --git a/lib/Cake/Utility/File.php b/lib/Cake/Utility/File.php
index 663004840..2d9e268d7 100644
--- a/lib/Cake/Utility/File.php
+++ b/lib/Cake/Utility/File.php
@@ -22,9 +22,7 @@
* Included libraries.
*
*/
-if (!class_exists('Folder')) {
- require LIBS . 'folder.php';
-}
+App::uses('File', 'Utility');
/**
* Convenience class for reading, writing and appending to files.
diff --git a/lib/Cake/View/pages/home.ctp b/lib/Cake/View/pages/home.ctp
index 95ead2a18..81a6d5818 100644
--- a/lib/Cake/View/pages/home.ctp
+++ b/lib/Cake/View/pages/home.ctp
@@ -72,7 +72,7 @@ endif;
?>
';
__('PCRE has not been compiled with Unicode support.');
@@ -83,15 +83,12 @@ endif;
?>
getDataSource('default');
+ App::uses('ConnectionManager', 'Model');
+ $connected = ConnectionManager::getDataSource('default');
?>
isConnected()):
+ if ($connected && $connected->isConnected()):
echo '';
echo __('Cake is able to connect to the database.');
echo '';
From 02ad0495593b361a262a99ed520140c799789877 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 7 Dec 2010 20:42:50 -0430
Subject: [PATCH 053/668] Fixing more shells, and updating code in home.ctp
---
lib/Cake/Console/Command/ConsoleShell.php | 17 ++++++++---------
lib/Cake/Console/Command/SchemaShell.php | 4 ++--
lib/Cake/Console/ConsoleOptionParser.php | 1 +
lib/Cake/Console/HelpFormatter.php | 2 +-
lib/Cake/Model/CakeSchema.php | 5 +++--
lib/Cake/Utility/File.php | 2 +-
lib/Cake/View/pages/home.ctp | 4 ++--
7 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php
index 20ab1615d..404c348ed 100644
--- a/lib/Cake/Console/Command/ConsoleShell.php
+++ b/lib/Cake/Console/Command/ConsoleShell.php
@@ -53,7 +53,7 @@ class ConsoleShell extends Shell {
*
*/
public function initialize() {
- require_once CAKE . 'dispatcher.php';
+ App::uses('Dispatcher', 'Routing');
$this->Dispatcher = new Dispatcher();
$this->models = App::objects('model');
App::import('Model', $this->models);
@@ -335,21 +335,20 @@ class ConsoleShell extends Shell {
* @return boolean True if config reload was a success, otherwise false
*/
protected function _loadRoutes() {
- $router = Router::getInstance();
-
- $router->reload();
- extract($router->getNamedExpressions());
+ Router::reload();
+ extract(Router::getNamedExpressions());
if (!@include(CONFIGS . 'routes.php')) {
return false;
}
- $router->parse('/');
+ Router::parse('/');
- foreach (array_keys($router->getNamedExpressions()) as $var) {
+ foreach (array_keys(Router::getNamedExpressions()) as $var) {
unset(${$var});
}
- for ($i = 0, $len = count($router->routes); $i < $len; $i++) {
- $router->routes[$i]->compile();
+
+ foreach (Router::$routes as $route) {
+ $route->compile();
}
return true;
}
diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php
index 969fad12a..280a86c69 100644
--- a/lib/Cake/Console/Command/SchemaShell.php
+++ b/lib/Cake/Console/Command/SchemaShell.php
@@ -20,8 +20,8 @@
* @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'File', false);
-App::import('Model', 'CakeSchema', false);
+App::uses('File', 'Utility');
+App::uses('CakeSchema', 'Model');
/**
* Schema is a command-line database management utility for automating programmer chores.
diff --git a/lib/Cake/Console/ConsoleOptionParser.php b/lib/Cake/Console/ConsoleOptionParser.php
index 179999a1b..fabad4c5b 100644
--- a/lib/Cake/Console/ConsoleOptionParser.php
+++ b/lib/Cake/Console/ConsoleOptionParser.php
@@ -23,6 +23,7 @@ App::uses('ConsoleInput', 'Console');
App::uses('ConsoleInputOption', 'Console');
App::uses('ConsoleInputArgument', 'Console');
App::uses('ConsoleOptionParser', 'Console');
+App::uses('HelpFormatter', 'Console');
/**
* Handles parsing the ARGV in the command line and provides support
diff --git a/lib/Cake/Console/HelpFormatter.php b/lib/Cake/Console/HelpFormatter.php
index 0b7add61d..40f3b3cc8 100644
--- a/lib/Cake/Console/HelpFormatter.php
+++ b/lib/Cake/Console/HelpFormatter.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('String', 'Utility');
+App::uses('String', 'Utility');
/**
* HelpFormatter formats help for console shells. Can format to either
diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php
index bfe7c3ffe..17bc19f84 100644
--- a/lib/Cake/Model/CakeSchema.php
+++ b/lib/Cake/Model/CakeSchema.php
@@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Model', 'Core');
-App::uses('ConnectionManager', 'Core');
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
+App::uses('ConnectionManager', 'Model');
/**
* Base Class for Schema management
diff --git a/lib/Cake/Utility/File.php b/lib/Cake/Utility/File.php
index 2d9e268d7..a7778ceda 100644
--- a/lib/Cake/Utility/File.php
+++ b/lib/Cake/Utility/File.php
@@ -22,7 +22,7 @@
* Included libraries.
*
*/
-App::uses('File', 'Utility');
+App::uses('Folder', 'Utility');
/**
* Convenience class for reading, writing and appending to files.
diff --git a/lib/Cake/View/pages/home.ctp b/lib/Cake/View/pages/home.ctp
index 81a6d5818..d861c5c12 100644
--- a/lib/Cake/View/pages/home.ctp
+++ b/lib/Cake/View/pages/home.ctp
@@ -16,14 +16,14 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (Configure::read() == 0):
+if (Configure::read('debug') == 0):
throw new NotFoundException();
endif;
?>
0):
+if (Configure::read('debug') > 0):
Debugger::checkSecurityKeys();
endif;
?>
From 4c9ad2dec8b5c12ecb3f20db7f067a3315b145e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Wed, 8 Dec 2010 00:34:45 -0430
Subject: [PATCH 054/668] Starting the tedious process of moving the testsuite
and tests
---
.../lib/cake_test_case.php => lib/Cake/TestSuite/CakeTestCase.php | 0
.../cake_test_suite.php => lib/Cake/TestSuite/CakeTestSuite.php | 0
.../Cake/TestSuite/CakeTestSuiteDispatcher.php | 0
.../Cake/TestSuite/CakeWebTestCase.php | 0
.../Cake/TestSuite/Coverage/BaseCoverageReport.php | 0
.../Cake/TestSuite/Coverage/HtmlCoverageReport.php | 0
.../Cake/TestSuite/Coverage/TextCoverageReport.php | 0
.../Cake/TestSuite/Fixture/CakeFixtureManager.php | 0
.../Cake/TestSuite/Fixture/CakeTestFixture.php | 0
.../Cake/TestSuite/Fixture/CakeTestModel.php | 0
.../Cake/TestSuite/Reporter/CakeBaseReporter.php | 0
.../Cake/TestSuite/Reporter/CakeHtmlReporter.php | 0
.../Cake/TestSuite/Reporter/CakeTextReporter.php | 0
.../lib/test_manager.php => lib/Cake/TestSuite/TestManager.php | 0
.../lib/test_runner.php => lib/Cake/TestSuite/TestRunner.php | 0
{cake/tests/lib => lib/Cake/TestSuite}/templates/footer.php | 0
{cake/tests/lib => lib/Cake/TestSuite}/templates/header.php | 0
{cake/tests/lib => lib/Cake/TestSuite}/templates/menu.php | 0
.../lib => lib/Cake/TestSuite}/templates/missing_conenction.php | 0
{cake/tests/lib => lib/Cake/TestSuite}/templates/phpunit.php | 0
{cake/tests/lib => lib/Cake/TestSuite}/templates/xdebug.php | 0
21 files changed, 0 insertions(+), 0 deletions(-)
rename cake/tests/lib/cake_test_case.php => lib/Cake/TestSuite/CakeTestCase.php (100%)
rename cake/tests/lib/cake_test_suite.php => lib/Cake/TestSuite/CakeTestSuite.php (100%)
rename cake/tests/lib/cake_test_suite_dispatcher.php => lib/Cake/TestSuite/CakeTestSuiteDispatcher.php (100%)
rename cake/tests/lib/cake_web_test_case.php => lib/Cake/TestSuite/CakeWebTestCase.php (100%)
rename cake/tests/lib/coverage/base_coverage_report.php => lib/Cake/TestSuite/Coverage/BaseCoverageReport.php (100%)
rename cake/tests/lib/coverage/html_coverage_report.php => lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php (100%)
rename cake/tests/lib/coverage/text_coverage_report.php => lib/Cake/TestSuite/Coverage/TextCoverageReport.php (100%)
rename cake/tests/lib/cake_fixture_manager.php => lib/Cake/TestSuite/Fixture/CakeFixtureManager.php (100%)
rename cake/tests/lib/cake_test_fixture.php => lib/Cake/TestSuite/Fixture/CakeTestFixture.php (100%)
rename cake/tests/lib/cake_test_model.php => lib/Cake/TestSuite/Fixture/CakeTestModel.php (100%)
rename cake/tests/lib/reporter/cake_base_reporter.php => lib/Cake/TestSuite/Reporter/CakeBaseReporter.php (100%)
rename cake/tests/lib/reporter/cake_html_reporter.php => lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php (100%)
rename cake/tests/lib/reporter/cake_text_reporter.php => lib/Cake/TestSuite/Reporter/CakeTextReporter.php (100%)
rename cake/tests/lib/test_manager.php => lib/Cake/TestSuite/TestManager.php (100%)
rename cake/tests/lib/test_runner.php => lib/Cake/TestSuite/TestRunner.php (100%)
rename {cake/tests/lib => lib/Cake/TestSuite}/templates/footer.php (100%)
rename {cake/tests/lib => lib/Cake/TestSuite}/templates/header.php (100%)
rename {cake/tests/lib => lib/Cake/TestSuite}/templates/menu.php (100%)
rename {cake/tests/lib => lib/Cake/TestSuite}/templates/missing_conenction.php (100%)
rename {cake/tests/lib => lib/Cake/TestSuite}/templates/phpunit.php (100%)
rename {cake/tests/lib => lib/Cake/TestSuite}/templates/xdebug.php (100%)
diff --git a/cake/tests/lib/cake_test_case.php b/lib/Cake/TestSuite/CakeTestCase.php
similarity index 100%
rename from cake/tests/lib/cake_test_case.php
rename to lib/Cake/TestSuite/CakeTestCase.php
diff --git a/cake/tests/lib/cake_test_suite.php b/lib/Cake/TestSuite/CakeTestSuite.php
similarity index 100%
rename from cake/tests/lib/cake_test_suite.php
rename to lib/Cake/TestSuite/CakeTestSuite.php
diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
similarity index 100%
rename from cake/tests/lib/cake_test_suite_dispatcher.php
rename to lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
diff --git a/cake/tests/lib/cake_web_test_case.php b/lib/Cake/TestSuite/CakeWebTestCase.php
similarity index 100%
rename from cake/tests/lib/cake_web_test_case.php
rename to lib/Cake/TestSuite/CakeWebTestCase.php
diff --git a/cake/tests/lib/coverage/base_coverage_report.php b/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
similarity index 100%
rename from cake/tests/lib/coverage/base_coverage_report.php
rename to lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
diff --git a/cake/tests/lib/coverage/html_coverage_report.php b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
similarity index 100%
rename from cake/tests/lib/coverage/html_coverage_report.php
rename to lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
diff --git a/cake/tests/lib/coverage/text_coverage_report.php b/lib/Cake/TestSuite/Coverage/TextCoverageReport.php
similarity index 100%
rename from cake/tests/lib/coverage/text_coverage_report.php
rename to lib/Cake/TestSuite/Coverage/TextCoverageReport.php
diff --git a/cake/tests/lib/cake_fixture_manager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
similarity index 100%
rename from cake/tests/lib/cake_fixture_manager.php
rename to lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
diff --git a/cake/tests/lib/cake_test_fixture.php b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php
similarity index 100%
rename from cake/tests/lib/cake_test_fixture.php
rename to lib/Cake/TestSuite/Fixture/CakeTestFixture.php
diff --git a/cake/tests/lib/cake_test_model.php b/lib/Cake/TestSuite/Fixture/CakeTestModel.php
similarity index 100%
rename from cake/tests/lib/cake_test_model.php
rename to lib/Cake/TestSuite/Fixture/CakeTestModel.php
diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php
similarity index 100%
rename from cake/tests/lib/reporter/cake_base_reporter.php
rename to lib/Cake/TestSuite/Reporter/CakeBaseReporter.php
diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
similarity index 100%
rename from cake/tests/lib/reporter/cake_html_reporter.php
rename to lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/lib/Cake/TestSuite/Reporter/CakeTextReporter.php
similarity index 100%
rename from cake/tests/lib/reporter/cake_text_reporter.php
rename to lib/Cake/TestSuite/Reporter/CakeTextReporter.php
diff --git a/cake/tests/lib/test_manager.php b/lib/Cake/TestSuite/TestManager.php
similarity index 100%
rename from cake/tests/lib/test_manager.php
rename to lib/Cake/TestSuite/TestManager.php
diff --git a/cake/tests/lib/test_runner.php b/lib/Cake/TestSuite/TestRunner.php
similarity index 100%
rename from cake/tests/lib/test_runner.php
rename to lib/Cake/TestSuite/TestRunner.php
diff --git a/cake/tests/lib/templates/footer.php b/lib/Cake/TestSuite/templates/footer.php
similarity index 100%
rename from cake/tests/lib/templates/footer.php
rename to lib/Cake/TestSuite/templates/footer.php
diff --git a/cake/tests/lib/templates/header.php b/lib/Cake/TestSuite/templates/header.php
similarity index 100%
rename from cake/tests/lib/templates/header.php
rename to lib/Cake/TestSuite/templates/header.php
diff --git a/cake/tests/lib/templates/menu.php b/lib/Cake/TestSuite/templates/menu.php
similarity index 100%
rename from cake/tests/lib/templates/menu.php
rename to lib/Cake/TestSuite/templates/menu.php
diff --git a/cake/tests/lib/templates/missing_conenction.php b/lib/Cake/TestSuite/templates/missing_conenction.php
similarity index 100%
rename from cake/tests/lib/templates/missing_conenction.php
rename to lib/Cake/TestSuite/templates/missing_conenction.php
diff --git a/cake/tests/lib/templates/phpunit.php b/lib/Cake/TestSuite/templates/phpunit.php
similarity index 100%
rename from cake/tests/lib/templates/phpunit.php
rename to lib/Cake/TestSuite/templates/phpunit.php
diff --git a/cake/tests/lib/templates/xdebug.php b/lib/Cake/TestSuite/templates/xdebug.php
similarity index 100%
rename from cake/tests/lib/templates/xdebug.php
rename to lib/Cake/TestSuite/templates/xdebug.php
From 4a287faa1e6b0251e3efab0074ce514d143f3b8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Wed, 8 Dec 2010 01:36:38 -0430
Subject: [PATCH 055/668] Moving the tests folder
---
{cake => lib/Cake}/tests/cases/basics.test.php | 0
.../Cake}/tests/cases/console/all_console.test.php | 0
.../tests/cases/console/all_console_libs.test.php | 0
.../Cake}/tests/cases/console/all_shells.test.php | 0
.../Cake}/tests/cases/console/all_tasks.test.php | 0
.../console/libs/console_error_handler.test.php | 0
.../console/libs/console_option_parser.test.php | 0
.../cases/console/libs/console_output.test.php | 0
.../cases/console/libs/help_formatter.test.php | 0
.../cases/console/libs/task_collection.test.php | 0
.../tests/cases/console/shell_dispatcher.test.php | 0
.../Cake}/tests/cases/console/shells/acl.test.php | 0
.../Cake}/tests/cases/console/shells/api.test.php | 0
.../Cake}/tests/cases/console/shells/bake.test.php | 0
.../cases/console/shells/command_list.test.php | 0
.../tests/cases/console/shells/schema.test.php | 0
.../Cake}/tests/cases/console/shells/shell.test.php | 0
.../cases/console/shells/tasks/controller.test.php | 0
.../cases/console/shells/tasks/db_config.test.php | 0
.../cases/console/shells/tasks/extract.test.php | 0
.../cases/console/shells/tasks/fixture.test.php | 0
.../tests/cases/console/shells/tasks/model.test.php | 0
.../cases/console/shells/tasks/plugin.test.php | 0
.../cases/console/shells/tasks/project.test.php | 0
.../cases/console/shells/tasks/template.test.php | 0
.../tests/cases/console/shells/tasks/test.test.php | 0
.../tests/cases/console/shells/tasks/view.test.php | 0
.../tests/cases/console/shells/testsuite.test.php | 0
.../Cake}/tests/cases/libs/all_behaviors.test.php | 0
.../tests/cases/libs/all_cache_engines.test.php | 0
.../Cake}/tests/cases/libs/all_components.test.php | 0
.../Cake}/tests/cases/libs/all_configure.test.php | 0
.../Cake}/tests/cases/libs/all_controllers.test.php | 0
.../Cake}/tests/cases/libs/all_database.test.php | 0
.../Cake}/tests/cases/libs/all_error.test.php | 0
.../Cake}/tests/cases/libs/all_helpers.test.php | 0
.../Cake}/tests/cases/libs/all_js_helpers.test.php | 0
.../Cake}/tests/cases/libs/all_libs.test.php | 0
.../tests/cases/libs/all_localization.test.php | 0
.../Cake}/tests/cases/libs/all_model.test.php | 0
.../Cake}/tests/cases/libs/all_routing.test.php | 0
.../Cake}/tests/cases/libs/all_socket.test.php | 0
.../Cake}/tests/cases/libs/all_test_suite.test.php | 0
.../Cake}/tests/cases/libs/all_tests.test.php | 0
.../Cake}/tests/cases/libs/all_views.test.php | 0
.../Cake}/tests/cases/libs/all_xml.test.php | 0
{cake => lib/Cake}/tests/cases/libs/app.test.php | 0
{cake => lib/Cake}/tests/cases/libs/cache.test.php | 0
.../Cake}/tests/cases/libs/cache/apc.test.php | 0
.../Cake}/tests/cases/libs/cache/file.test.php | 0
.../Cake}/tests/cases/libs/cache/memcache.test.php | 0
.../Cake}/tests/cases/libs/cache/xcache.test.php | 0
.../Cake}/tests/cases/libs/cake_log.test.php | 0
.../Cake}/tests/cases/libs/cake_request.test.php | 0
.../Cake}/tests/cases/libs/cake_response.test.php | 0
.../Cake}/tests/cases/libs/cake_session.test.php | 0
.../Cake}/tests/cases/libs/cake_socket.test.php | 0
.../Cake}/tests/cases/libs/cake_test_case.test.php | 0
.../tests/cases/libs/cake_test_fixture.test.php | 0
.../Cake}/tests/cases/libs/class_registry.test.php | 0
.../tests/cases/libs/config/ini_reader.test.php | 0
.../tests/cases/libs/config/php_reader.test.php | 0
.../Cake}/tests/cases/libs/configure.test.php | 0
.../tests/cases/libs/controller/component.test.php | 0
.../libs/controller/component_collection.test.php | 0
.../cases/libs/controller/components/acl.test.php | 0
.../cases/libs/controller/components/auth.test.php | 0
.../libs/controller/components/cookie.test.php | 0
.../cases/libs/controller/components/email.test.php | 0
.../controller/components/request_handler.test.php | 0
.../libs/controller/components/security.test.php | 0
.../libs/controller/components/session.test.php | 0
.../tests/cases/libs/controller/controller.test.php | 0
.../libs/controller/controller_merge_vars.test.php | 0
.../cases/libs/controller/pages_controller.test.php | 0
.../tests/cases/libs/controller/scaffold.test.php | 0
.../Cake}/tests/cases/libs/debugger.test.php | 0
.../Cake}/tests/cases/libs/dispatcher.test.php | 0
.../tests/cases/libs/error/error_handler.test.php | 0
.../cases/libs/error/exception_renderer.test.php | 0
{cake => lib/Cake}/tests/cases/libs/file.test.php | 0
{cake => lib/Cake}/tests/cases/libs/folder.test.php | 0
.../tests/cases/libs/html_coverage_report.test.php | 0
.../Cake}/tests/cases/libs/http_socket.test.php | 0
{cake => lib/Cake}/tests/cases/libs/i18n.test.php | 0
.../Cake}/tests/cases/libs/inflector.test.php | 0
{cake => lib/Cake}/tests/cases/libs/l10n.test.php | 0
.../Cake}/tests/cases/libs/log/file_log.test.php | 0
.../Cake}/tests/cases/libs/magic_db.test.php | 0
.../cases/libs/model/behavior_collection.test.php | 0
.../tests/cases/libs/model/behaviors/acl.test.php | 0
.../cases/libs/model/behaviors/containable.test.php | 0
.../cases/libs/model/behaviors/translate.test.php | 0
.../tests/cases/libs/model/behaviors/tree.test.php | 0
.../tests/cases/libs/model/cake_schema.test.php | 0
.../cases/libs/model/connection_manager.test.php | 0
.../libs/model/datasources/dbo/dbo_mssql.test.php | 0
.../libs/model/datasources/dbo/dbo_mysql.test.php | 0
.../libs/model/datasources/dbo/dbo_oracle.test.php | 0
.../model/datasources/dbo/dbo_postgres.test.php | 0
.../libs/model/datasources/dbo/dbo_sqlite.test.php | 0
.../libs/model/datasources/dbo_source.test.php | 0
.../Cake}/tests/cases/libs/model/db_acl.test.php | 0
.../Cake}/tests/cases/libs/model/model.test.php | 0
.../tests/cases/libs/model/model_delete.test.php | 0
.../cases/libs/model/model_integration.test.php | 0
.../tests/cases/libs/model/model_read.test.php | 0
.../cases/libs/model/model_validation.test.php | 0
.../tests/cases/libs/model/model_write.test.php | 0
.../Cake}/tests/cases/libs/model/models.php | 0
.../Cake}/tests/cases/libs/multibyte.test.php | 0
{cake => lib/Cake}/tests/cases/libs/object.test.php | 0
.../tests/cases/libs/object_collection.test.php | 0
.../tests/cases/libs/route/cake_route.test.php | 0
.../cases/libs/route/plugin_short_route.test.php | 0
.../tests/cases/libs/route/redirect_route.test.php | 0
{cake => lib/Cake}/tests/cases/libs/router.test.php | 0
.../Cake}/tests/cases/libs/sanitize.test.php | 0
.../Cake}/tests/cases/libs/security.test.php | 0
.../tests/cases/libs/session/cache_session.test.php | 0
.../cases/libs/session/database_session.test.php | 0
{cake => lib/Cake}/tests/cases/libs/set.test.php | 0
{cake => lib/Cake}/tests/cases/libs/string.test.php | 0
.../Cake}/tests/cases/libs/test_manager.test.php | 0
.../Cake}/tests/cases/libs/validation.test.php | 0
.../Cake}/tests/cases/libs/view/helper.test.php | 0
.../cases/libs/view/helper_collection.test.php | 0
.../tests/cases/libs/view/helpers/cache.test.php | 0
.../tests/cases/libs/view/helpers/form.test.php | 0
.../tests/cases/libs/view/helpers/html.test.php | 0
.../cases/libs/view/helpers/jquery_engine.test.php | 0
.../Cake}/tests/cases/libs/view/helpers/js.test.php | 0
.../libs/view/helpers/mootools_engine.test.php | 0
.../tests/cases/libs/view/helpers/number.test.php | 0
.../cases/libs/view/helpers/paginator.test.php | 0
.../libs/view/helpers/prototype_engine.test.php | 0
.../tests/cases/libs/view/helpers/rss.test.php | 0
.../tests/cases/libs/view/helpers/session.test.php | 0
.../tests/cases/libs/view/helpers/text.test.php | 0
.../tests/cases/libs/view/helpers/time.test.php | 0
.../Cake}/tests/cases/libs/view/media.test.php | 0
.../Cake}/tests/cases/libs/view/theme.test.php | 0
.../Cake}/tests/cases/libs/view/view.test.php | 0
{cake => lib/Cake}/tests/cases/libs/xml.test.php | 0
.../Cake}/tests/fixtures/account_fixture.php | 0
.../Cake}/tests/fixtures/aco_action_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/aco_fixture.php | 0
.../Cake}/tests/fixtures/aco_two_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/ad_fixture.php | 0
.../Cake}/tests/fixtures/advertisement_fixture.php | 0
.../Cake}/tests/fixtures/after_tree_fixture.php | 0
.../tests/fixtures/another_article_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/apple_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/aro_fixture.php | 0
.../Cake}/tests/fixtures/aro_two_fixture.php | 0
.../Cake}/tests/fixtures/aros_aco_fixture.php | 0
.../Cake}/tests/fixtures/aros_aco_two_fixture.php | 0
.../tests/fixtures/article_featured_fixture.php | 0
.../fixtures/article_featureds_tags_fixture.php | 0
.../Cake}/tests/fixtures/article_fixture.php | 0
.../Cake}/tests/fixtures/articles_tag_fixture.php | 0
.../Cake}/tests/fixtures/assert_tags_test_case.php | 0
.../Cake}/tests/fixtures/attachment_fixture.php | 0
.../fixtures/auth_user_custom_field_fixture.php | 0
.../Cake}/tests/fixtures/auth_user_fixture.php | 0
.../Cake}/tests/fixtures/author_fixture.php | 0
.../Cake}/tests/fixtures/bake_article_fixture.php | 0
.../fixtures/bake_articles_bake_tag_fixture.php | 0
.../Cake}/tests/fixtures/bake_comment_fixture.php | 0
.../Cake}/tests/fixtures/bake_tag_fixture.php | 0
.../Cake}/tests/fixtures/basket_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/bid_fixture.php | 0
.../Cake}/tests/fixtures/binary_test_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/book_fixture.php | 0
.../tests/fixtures/cache_test_model_fixture.php | 0
.../Cake}/tests/fixtures/callback_fixture.php | 0
.../Cake}/tests/fixtures/campaign_fixture.php | 0
.../Cake}/tests/fixtures/category_fixture.php | 0
.../tests/fixtures/category_thread_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/cd_fixture.php | 0
.../Cake}/tests/fixtures/comment_fixture.php | 0
.../tests/fixtures/content_account_fixture.php | 0
.../Cake}/tests/fixtures/content_fixture.php | 0
.../tests/fixtures/counter_cache_post_fixture.php | 0
...r_cache_post_nonstandard_primary_key_fixture.php | 0
.../tests/fixtures/counter_cache_user_fixture.php | 0
...r_cache_user_nonstandard_primary_key_fixture.php | 0
.../Cake}/tests/fixtures/data_test_fixture.php | 0
.../Cake}/tests/fixtures/datatype_fixture.php | 0
.../Cake}/tests/fixtures/dependency_fixture.php | 0
.../Cake}/tests/fixtures/device_fixture.php | 0
.../tests/fixtures/device_type_category_fixture.php | 0
.../Cake}/tests/fixtures/device_type_fixture.php | 0
.../tests/fixtures/document_directory_fixture.php | 0
.../Cake}/tests/fixtures/document_fixture.php | 0
.../fixtures/exterior_type_category_fixture.php | 0
.../Cake}/tests/fixtures/feature_set_fixture.php | 0
.../Cake}/tests/fixtures/featured_fixture.php | 0
.../Cake}/tests/fixtures/film_file_fixture.php | 0
.../Cake}/tests/fixtures/fixturized_test_case.php | 0
.../Cake}/tests/fixtures/flag_tree_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/fruit_fixture.php | 0
.../tests/fixtures/fruits_uuid_tag_fixture.php | 0
.../tests/fixtures/group_update_all_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/home_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/image_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/item_fixture.php | 0
.../tests/fixtures/items_portfolio_fixture.php | 0
.../Cake}/tests/fixtures/join_a_b_fixture.php | 0
.../Cake}/tests/fixtures/join_a_c_fixture.php | 0
.../Cake}/tests/fixtures/join_a_fixture.php | 0
.../Cake}/tests/fixtures/join_b_fixture.php | 0
.../Cake}/tests/fixtures/join_c_fixture.php | 0
.../Cake}/tests/fixtures/join_thing_fixture.php | 0
.../Cake}/tests/fixtures/message_fixture.php | 0
.../fixtures/my_categories_my_products_fixture.php | 0
.../fixtures/my_categories_my_users_fixture.php | 0
.../Cake}/tests/fixtures/my_category_fixture.php | 0
.../Cake}/tests/fixtures/my_product_fixture.php | 0
.../Cake}/tests/fixtures/my_user_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/node_fixture.php | 0
.../Cake}/tests/fixtures/number_tree_fixture.php | 0
.../tests/fixtures/number_tree_two_fixture.php | 0
.../tests/fixtures/numeric_article_fixture.php | 0
.../tests/fixtures/overall_favorite_fixture.php | 0
.../Cake}/tests/fixtures/person_fixture.php | 0
.../Cake}/tests/fixtures/portfolio_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/post_fixture.php | 0
.../Cake}/tests/fixtures/posts_tag_fixture.php | 0
.../Cake}/tests/fixtures/primary_model_fixture.php | 0
.../Cake}/tests/fixtures/product_fixture.php | 0
.../tests/fixtures/product_update_all_fixture.php | 0
.../Cake}/tests/fixtures/project_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/rss.xml | 0
{cake => lib/Cake}/tests/fixtures/sample.xml | 0
.../Cake}/tests/fixtures/sample_fixture.php | 0
.../tests/fixtures/secondary_model_fixture.php | 0
.../Cake}/tests/fixtures/session_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/soap_request.xml | 0
{cake => lib/Cake}/tests/fixtures/soap_response.xml | 0
.../Cake}/tests/fixtures/something_else_fixture.php | 0
.../Cake}/tests/fixtures/something_fixture.php | 0
.../Cake}/tests/fixtures/stories_tag_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/story_fixture.php | 0
.../Cake}/tests/fixtures/syfile_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/tag_fixture.php | 0
.../tests/fixtures/test_plugin_article_fixture.php | 0
.../tests/fixtures/test_plugin_comment_fixture.php | 0
.../tests/fixtures/the_paper_monkies_fixture.php | 0
.../Cake}/tests/fixtures/thread_fixture.php | 0
.../tests/fixtures/translate_article_fixture.php | 0
.../Cake}/tests/fixtures/translate_fixture.php | 0
.../tests/fixtures/translate_table_fixture.php | 0
.../fixtures/translate_with_prefix_fixture.php | 0
.../tests/fixtures/translated_article_fixture.php | 0
.../tests/fixtures/translated_item_fixture.php | 0
.../tests/fixtures/unconventional_tree_fixture.php | 0
.../tests/fixtures/underscore_field_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/user_fixture.php | 0
{cake => lib/Cake}/tests/fixtures/uuid_fixture.php | 0
.../Cake}/tests/fixtures/uuid_tag_fixture.php | 0
.../Cake}/tests/fixtures/uuid_tree_fixture.php | 0
.../Cake}/tests/fixtures/uuiditem_fixture.php | 0
.../fixtures/uuiditems_uuidportfolio_fixture.php | 0
.../uuiditems_uuidportfolio_numericid_fixture.php | 0
.../Cake}/tests/fixtures/uuidportfolio_fixture.php | 0
.../Cake}/tests/test_app/config/acl.ini.php | 0
{cake => lib/Cake}/tests/test_app/config/empty.php | 0
{cake => lib/Cake}/tests/test_app/config/nested.ini | 0
.../Cake}/tests/test_app/config/var_test.php | 0
.../Cake}/tests/test_app/console/shells/sample.php | 0
.../Cake}/tests/test_app/console/shells/tasks/empty | 0
.../console/templates/test/classes/test_object.ctp | 0
.../tests/test_app/controllers/components/empty | 0
.../test_app/controllers/tests_apps_controller.php | 0
.../controllers/tests_apps_posts_controller.php | 0
.../tests/test_app/libs/cache/test_app_cache.php | 0
{cake => lib/Cake}/tests/test_app/libs/library.php | 0
.../Cake}/tests/test_app/libs/log/test_app_log.php | 0
.../test_app/libs/session/test_app_lib_session.php | 0
.../locale/cache_test_po/LC_MESSAGES/default.po | 0
.../locale/cache_test_po/LC_MESSAGES/dom1.po | 0
.../locale/cache_test_po/LC_MESSAGES/dom2.po | 0
.../Cake}/tests/test_app/locale/ja_jp/LC_TIME | 0
.../tests/test_app/locale/po/LC_MESSAGES/default.po | 0
.../tests/test_app/locale/po/LC_MONETARY/default.po | 0
{cake => lib/Cake}/tests/test_app/locale/po/LC_TIME | 0
.../test_app/locale/rule_0_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_0_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_0_po/LC_MESSAGES/core.po | 0
.../locale/rule_0_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_10_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_10_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_10_po/LC_MESSAGES/core.po | 0
.../locale/rule_10_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_11_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_11_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_11_po/LC_MESSAGES/core.po | 0
.../locale/rule_11_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_12_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_12_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_12_po/LC_MESSAGES/core.po | 0
.../locale/rule_12_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_13_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_13_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_13_po/LC_MESSAGES/core.po | 0
.../locale/rule_13_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_14_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_14_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_14_po/LC_MESSAGES/core.po | 0
.../locale/rule_14_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_1_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_1_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_1_po/LC_MESSAGES/core.po | 0
.../locale/rule_1_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_2_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_2_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_2_po/LC_MESSAGES/core.po | 0
.../locale/rule_2_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_3_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_3_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_3_po/LC_MESSAGES/core.po | 0
.../locale/rule_3_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_4_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_4_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_4_po/LC_MESSAGES/core.po | 0
.../locale/rule_4_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_5_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_5_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_5_po/LC_MESSAGES/core.po | 0
.../locale/rule_5_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_6_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_6_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_6_po/LC_MESSAGES/core.po | 0
.../locale/rule_6_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_7_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_7_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_7_po/LC_MESSAGES/core.po | 0
.../locale/rule_7_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_8_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_8_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_8_po/LC_MESSAGES/core.po | 0
.../locale/rule_8_po/LC_MESSAGES/default.po | 0
.../test_app/locale/rule_9_mo/LC_MESSAGES/core.mo | Bin
.../locale/rule_9_mo/LC_MESSAGES/default.mo | Bin
.../test_app/locale/rule_9_po/LC_MESSAGES/core.po | 0
.../locale/rule_9_po/LC_MESSAGES/default.po | 0
.../Cake}/tests/test_app/locale/time_test/LC_TIME | 0
.../Cake}/tests/test_app/models/behaviors/empty | 0
.../models/behaviors/persister_one_behavior.php | 0
.../models/behaviors/persister_two_behavior.php | 0
.../Cake}/tests/test_app/models/comment.php | 0
.../models/datasources/test/test_local_driver.php | 0
.../models/datasources/test2_other_source.php | 0
.../test_app/models/datasources/test2_source.php | 0
.../Cake}/tests/test_app/models/persister_one.php | 0
.../Cake}/tests/test_app/models/persister_two.php | 0
{cake => lib/Cake}/tests/test_app/models/post.php | 0
.../plugins/plugin_js/webroot/js/one/plugin_one.js | 0
.../plugins/plugin_js/webroot/js/plugin_js.js | 0
.../test_app/plugins/test_plugin/config/load.php | 0
.../plugins/test_plugin/config/more.load.php | 0
.../plugins/test_plugin/config/schema/schema.php | 0
.../plugins/test_plugin/console/shells/example.php | 0
.../plugins/test_plugin/console/shells/tasks/empty | 0
.../test_plugin/console/shells/tasks/other_task.php | 0
.../plugins/test_plugin/console/templates/empty | 0
.../controllers/components/other_component.php | 0
.../controllers/components/plugins_component.php | 0
.../components/test_plugin_component.php | 0
.../components/test_plugin_other_component.php | 0
.../controllers/test_plugin_controller.php | 0
.../test_plugin/controllers/tests_controller.php | 0
.../test_plugin/libs/cache/test_plugin_cache.php | 0
.../test_plugin/libs/log/test_plugin_log.php | 0
.../libs/session/test_plugin_session.php | 0
.../test_plugin/libs/test_plugin_library.php | 0
.../locale/po/LC_MESSAGES/test_plugin.po | 0
.../locale/po/LC_MONETARY/test_plugin.po | 0
.../models/behaviors/test_plugin_persister_one.php | 0
.../models/behaviors/test_plugin_persister_two.php | 0
.../models/datasources/dbo/dbo_dummy.php | 0
.../models/datasources/test/test_driver.php | 0
.../models/datasources/test_other_source.php | 0
.../test_plugin/models/datasources/test_source.php | 0
.../test_plugin/models/test_plugin_auth_user.php | 0
.../test_plugin/models/test_plugin_authors.php | 0
.../test_plugin/models/test_plugin_comment.php | 0
.../plugins/test_plugin/models/test_plugin_post.php | 0
.../test_plugin/test_plugin_app_controller.php | 0
.../plugins/test_plugin/test_plugin_app_model.php | 0
.../test_plugin/vendors/sample/sample_plugin.php | 0
.../plugins/test_plugin/vendors/welcome.php | 0
.../test_plugin/views/elements/plugin_element.ctp | 0
.../views/elements/test_plugin_element.ctp | 0
.../test_plugin/views/helpers/other_helper.php | 0
.../test_plugin/views/helpers/plugged_helper.php | 0
.../test_plugin/views/helpers/test_plugin_app.php | 0
.../plugins/test_plugin/views/layouts/default.ctp | 0
.../plugins/test_plugin/views/tests/index.ctp | 0
.../test_plugin/views/tests/scaffold.edit.ctp | 0
.../test_plugin/webroot/css/test_plugin_asset.css | 0
.../plugins/test_plugin/webroot/css/theme_one.htc | 0
.../test_plugin/webroot/css/unknown.extension | 0
.../test_plugin/webroot/flash/plugin_test.swf | 0
.../plugins/test_plugin/webroot/img/cake.icon.gif | Bin
.../test_plugin/webroot/js/test_plugin/test.js | 0
.../test_plugin/webroot/pdfs/plugin_test.pdf | Bin
.../test_app/plugins/test_plugin/webroot/root.js | 0
.../test_plugin_two/console/shells/example.php | 0
.../test_plugin_two/console/shells/tasks/empty | 0
.../test_plugin_two/console/shells/welcome.php | 0
.../plugins/test_plugin_two/console/templates/empty | 0
{cake => lib/Cake}/tests/test_app/tmp/dir_map | 0
.../Cake}/tests/test_app/vendors/Test/MyTest.php | 0
.../Cake}/tests/test_app/vendors/Test/hello.php | 0
.../Cake}/tests/test_app/vendors/css/test_asset.css | 0
.../Cake}/tests/test_app/vendors/img/test.jpg | Bin
.../vendors/sample/configure_test_vendor_sample.php | 0
.../tests/test_app/vendors/somename/some.name.php | 0
.../Cake}/tests/test_app/vendors/welcome.php | 0
.../test_app/views/elements/email/html/custom.ctp | 0
.../test_app/views/elements/email/html/default.ctp | 0
.../test_app/views/elements/email/text/custom.ctp | 0
.../test_app/views/elements/email/text/default.ctp | 0
.../test_app/views/elements/email/text/wide.ctp | 0
.../Cake}/tests/test_app/views/elements/empty | 0
.../views/elements/nocache/contains_nocache.ctp | 0
.../tests/test_app/views/elements/nocache/plain.ctp | 0
.../tests/test_app/views/elements/nocache/sub1.ctp | 0
.../tests/test_app/views/elements/nocache/sub2.ctp | 0
.../test_app/views/elements/session_helper.ctp | 0
.../tests/test_app/views/elements/test_element.ctp | 0
.../Cake}/tests/test_app/views/errors/empty | 0
.../Cake}/tests/test_app/views/helpers/banana.php | 0
.../Cake}/tests/test_app/views/helpers/empty | 0
.../Cake}/tests/test_app/views/layouts/ajax.ctp | 0
.../Cake}/tests/test_app/views/layouts/ajax2.ctp | 0
.../test_app/views/layouts/cache_empty_sections.ctp | 0
.../tests/test_app/views/layouts/cache_layout.ctp | 0
.../Cake}/tests/test_app/views/layouts/default.ctp | 0
.../test_app/views/layouts/email/html/default.ctp | 0
.../test_app/views/layouts/email/html/thin.ctp | 0
.../test_app/views/layouts/email/text/default.ctp | 0
.../Cake}/tests/test_app/views/layouts/flash.ctp | 0
.../tests/test_app/views/layouts/js/default.ctp | 0
.../tests/test_app/views/layouts/multi_cache.ctp | 0
.../tests/test_app/views/layouts/rss/default.ctp | 0
.../tests/test_app/views/layouts/xml/default.ctp | 0
{cake => lib/Cake}/tests/test_app/views/pages/empty | 0
.../Cake}/tests/test_app/views/pages/extract.ctp | 0
.../Cake}/tests/test_app/views/pages/home.ctp | 0
.../test_app/views/posts/cache_empty_sections.ctp | 0
.../Cake}/tests/test_app/views/posts/cache_form.ctp | 0
.../tests/test_app/views/posts/helper_overwrite.ctp | 0
.../Cake}/tests/test_app/views/posts/index.ctp | 0
.../tests/test_app/views/posts/multiple_nocache.ctp | 0
.../views/posts/nocache_multiple_element.ctp | 0
.../tests/test_app/views/posts/scaffold.edit.ctp | 0
.../test_app/views/posts/sequencial_nocache.ctp | 0
.../test_app/views/posts/test_nocache_tags.ctp | 0
.../Cake}/tests/test_app/views/scaffolds/empty | 0
.../Cake}/tests/test_app/views/tests_apps/index.ctp | 0
.../themed/test_theme/elements/test_element.ctp | 0
.../views/themed/test_theme/layouts/default.ctp | 0
.../plugins/test_plugin/layouts/plugin_default.ctp | 0
.../test_theme/plugins/test_plugin/tests/index.ctp | 0
.../views/themed/test_theme/posts/index.ctp | 0
.../themed/test_theme/posts/scaffold.index.ctp | 0
.../themed/test_theme/webroot/css/test_asset.css | 0
.../themed/test_theme/webroot/css/theme_webroot.css | 0
.../themed/test_theme/webroot/flash/theme_test.swf | 0
.../themed/test_theme/webroot/img/cake.power.gif | Bin
.../views/themed/test_theme/webroot/img/test.jpg | Bin
.../themed/test_theme/webroot/js/one/theme_one.js | 0
.../views/themed/test_theme/webroot/js/theme.js | 0
.../themed/test_theme/webroot/pdfs/theme_test.pdf | Bin
.../webroot/theme/test_theme/css/theme_webroot.css | 0
.../webroot/theme/test_theme/css/webroot_test.css | 0
.../webroot/theme/test_theme/img/cake.power.gif | Bin
.../test_app/webroot/theme/test_theme/img/test.jpg | Bin
481 files changed, 0 insertions(+), 0 deletions(-)
rename {cake => lib/Cake}/tests/cases/basics.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/all_console.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/all_console_libs.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/all_shells.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/all_tasks.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/libs/console_error_handler.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/libs/console_option_parser.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/libs/console_output.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/libs/help_formatter.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/libs/task_collection.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shell_dispatcher.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/acl.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/api.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/bake.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/command_list.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/schema.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/shell.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/controller.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/db_config.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/extract.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/fixture.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/model.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/plugin.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/project.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/template.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/test.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/tasks/view.test.php (100%)
rename {cake => lib/Cake}/tests/cases/console/shells/testsuite.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_behaviors.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_cache_engines.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_components.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_configure.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_controllers.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_database.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_error.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_helpers.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_js_helpers.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_libs.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_localization.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_model.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_routing.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_socket.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_test_suite.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_tests.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_views.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/all_xml.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/app.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cache.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cache/apc.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cache/file.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cache/memcache.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cache/xcache.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cake_log.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cake_request.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cake_response.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cake_session.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cake_socket.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cake_test_case.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/cake_test_fixture.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/class_registry.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/config/ini_reader.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/config/php_reader.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/configure.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/component.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/component_collection.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/components/acl.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/components/auth.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/components/cookie.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/components/email.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/components/request_handler.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/components/security.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/components/session.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/controller.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/controller_merge_vars.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/pages_controller.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/controller/scaffold.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/debugger.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/dispatcher.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/error/error_handler.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/error/exception_renderer.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/file.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/folder.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/html_coverage_report.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/http_socket.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/i18n.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/inflector.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/l10n.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/log/file_log.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/magic_db.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/behavior_collection.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/behaviors/acl.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/behaviors/containable.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/behaviors/translate.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/behaviors/tree.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/cake_schema.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/connection_manager.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/datasources/dbo_source.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/db_acl.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/model.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/model_delete.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/model_integration.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/model_read.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/model_validation.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/model_write.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/model/models.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/multibyte.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/object.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/object_collection.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/route/cake_route.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/route/plugin_short_route.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/route/redirect_route.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/router.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/sanitize.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/security.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/session/cache_session.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/session/database_session.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/set.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/string.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/test_manager.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/validation.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helper.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helper_collection.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/cache.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/form.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/html.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/jquery_engine.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/js.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/mootools_engine.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/number.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/paginator.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/prototype_engine.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/rss.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/session.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/text.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/helpers/time.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/media.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/theme.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/view/view.test.php (100%)
rename {cake => lib/Cake}/tests/cases/libs/xml.test.php (100%)
rename {cake => lib/Cake}/tests/fixtures/account_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/aco_action_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/aco_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/aco_two_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/ad_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/advertisement_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/after_tree_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/another_article_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/apple_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/aro_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/aro_two_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/aros_aco_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/aros_aco_two_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/article_featured_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/article_featureds_tags_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/article_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/articles_tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/assert_tags_test_case.php (100%)
rename {cake => lib/Cake}/tests/fixtures/attachment_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/auth_user_custom_field_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/auth_user_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/author_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/bake_article_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/bake_articles_bake_tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/bake_comment_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/bake_tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/basket_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/bid_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/binary_test_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/book_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/cache_test_model_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/callback_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/campaign_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/category_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/category_thread_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/cd_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/comment_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/content_account_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/content_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/counter_cache_post_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/counter_cache_user_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/data_test_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/datatype_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/dependency_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/device_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/device_type_category_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/device_type_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/document_directory_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/document_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/exterior_type_category_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/feature_set_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/featured_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/film_file_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/fixturized_test_case.php (100%)
rename {cake => lib/Cake}/tests/fixtures/flag_tree_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/fruit_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/fruits_uuid_tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/group_update_all_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/home_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/image_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/item_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/items_portfolio_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/join_a_b_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/join_a_c_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/join_a_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/join_b_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/join_c_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/join_thing_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/message_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/my_categories_my_products_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/my_categories_my_users_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/my_category_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/my_product_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/my_user_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/node_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/number_tree_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/number_tree_two_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/numeric_article_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/overall_favorite_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/person_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/portfolio_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/post_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/posts_tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/primary_model_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/product_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/product_update_all_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/project_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/rss.xml (100%)
rename {cake => lib/Cake}/tests/fixtures/sample.xml (100%)
rename {cake => lib/Cake}/tests/fixtures/sample_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/secondary_model_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/session_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/soap_request.xml (100%)
rename {cake => lib/Cake}/tests/fixtures/soap_response.xml (100%)
rename {cake => lib/Cake}/tests/fixtures/something_else_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/something_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/stories_tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/story_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/syfile_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/test_plugin_article_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/test_plugin_comment_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/the_paper_monkies_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/thread_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/translate_article_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/translate_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/translate_table_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/translate_with_prefix_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/translated_article_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/translated_item_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/unconventional_tree_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/underscore_field_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/user_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/uuid_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/uuid_tag_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/uuid_tree_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/uuiditem_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/uuiditems_uuidportfolio_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php (100%)
rename {cake => lib/Cake}/tests/fixtures/uuidportfolio_fixture.php (100%)
rename {cake => lib/Cake}/tests/test_app/config/acl.ini.php (100%)
rename {cake => lib/Cake}/tests/test_app/config/empty.php (100%)
rename {cake => lib/Cake}/tests/test_app/config/nested.ini (100%)
rename {cake => lib/Cake}/tests/test_app/config/var_test.php (100%)
rename {cake => lib/Cake}/tests/test_app/console/shells/sample.php (100%)
rename {cake => lib/Cake}/tests/test_app/console/shells/tasks/empty (100%)
rename {cake => lib/Cake}/tests/test_app/console/templates/test/classes/test_object.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/controllers/components/empty (100%)
rename {cake => lib/Cake}/tests/test_app/controllers/tests_apps_controller.php (100%)
rename {cake => lib/Cake}/tests/test_app/controllers/tests_apps_posts_controller.php (100%)
rename {cake => lib/Cake}/tests/test_app/libs/cache/test_app_cache.php (100%)
rename {cake => lib/Cake}/tests/test_app/libs/library.php (100%)
rename {cake => lib/Cake}/tests/test_app/libs/log/test_app_log.php (100%)
rename {cake => lib/Cake}/tests/test_app/libs/session/test_app_lib_session.php (100%)
rename {cake => lib/Cake}/tests/test_app/locale/cache_test_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom1.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom2.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/ja_jp/LC_TIME (100%)
rename {cake => lib/Cake}/tests/test_app/locale/po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/po/LC_MONETARY/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/po/LC_TIME (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_0_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_0_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_0_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_0_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_10_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_10_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_10_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_10_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_11_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_11_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_11_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_11_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_12_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_12_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_12_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_12_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_13_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_13_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_13_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_13_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_14_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_14_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_14_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_14_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_1_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_1_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_1_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_1_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_2_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_2_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_2_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_2_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_3_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_3_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_3_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_3_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_4_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_4_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_4_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_4_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_5_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_5_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_5_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_5_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_6_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_6_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_6_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_6_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_7_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_7_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_7_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_7_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_8_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_8_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_8_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_8_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_9_mo/LC_MESSAGES/core.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_9_mo/LC_MESSAGES/default.mo (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_9_po/LC_MESSAGES/core.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/rule_9_po/LC_MESSAGES/default.po (100%)
rename {cake => lib/Cake}/tests/test_app/locale/time_test/LC_TIME (100%)
rename {cake => lib/Cake}/tests/test_app/models/behaviors/empty (100%)
rename {cake => lib/Cake}/tests/test_app/models/behaviors/persister_one_behavior.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/behaviors/persister_two_behavior.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/comment.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/datasources/test/test_local_driver.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/datasources/test2_other_source.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/datasources/test2_source.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/persister_one.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/persister_two.php (100%)
rename {cake => lib/Cake}/tests/test_app/models/post.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/plugin_js/webroot/js/one/plugin_one.js (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/plugin_js/webroot/js/plugin_js.js (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/config/load.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/config/more.load.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/config/schema/schema.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/console/shells/example.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/console/shells/tasks/empty (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/console/shells/tasks/other_task.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/console/templates/empty (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/controllers/components/other_component.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/controllers/tests_controller.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/libs/session/test_plugin_session.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/libs/test_plugin_library.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/locale/po/LC_MESSAGES/test_plugin.po (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/locale/po/LC_MONETARY/test_plugin.po (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/datasources/test_other_source.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/datasources/test_source.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/models/test_plugin_post.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/test_plugin_app_model.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/vendors/welcome.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/elements/plugin_element.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/elements/test_plugin_element.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/helpers/test_plugin_app.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/layouts/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/tests/index.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/css/test_plugin_asset.css (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/css/theme_one.htc (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/css/unknown.extension (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/flash/plugin_test.swf (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/img/cake.icon.gif (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/js/test_plugin/test.js (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/pdfs/plugin_test.pdf (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/webroot/root.js (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin_two/console/shells/example.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin_two/console/shells/tasks/empty (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin_two/console/shells/welcome.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin_two/console/templates/empty (100%)
rename {cake => lib/Cake}/tests/test_app/tmp/dir_map (100%)
rename {cake => lib/Cake}/tests/test_app/vendors/Test/MyTest.php (100%)
rename {cake => lib/Cake}/tests/test_app/vendors/Test/hello.php (100%)
rename {cake => lib/Cake}/tests/test_app/vendors/css/test_asset.css (100%)
rename {cake => lib/Cake}/tests/test_app/vendors/img/test.jpg (100%)
rename {cake => lib/Cake}/tests/test_app/vendors/sample/configure_test_vendor_sample.php (100%)
rename {cake => lib/Cake}/tests/test_app/vendors/somename/some.name.php (100%)
rename {cake => lib/Cake}/tests/test_app/vendors/welcome.php (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/email/html/custom.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/email/html/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/email/text/custom.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/email/text/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/email/text/wide.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/empty (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/nocache/contains_nocache.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/nocache/plain.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/nocache/sub1.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/nocache/sub2.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/session_helper.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/test_element.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/errors/empty (100%)
rename {cake => lib/Cake}/tests/test_app/views/helpers/banana.php (100%)
rename {cake => lib/Cake}/tests/test_app/views/helpers/empty (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/ajax.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/ajax2.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/cache_empty_sections.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/cache_layout.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/email/html/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/email/html/thin.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/email/text/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/flash.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/js/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/multi_cache.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/rss/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/xml/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/pages/empty (100%)
rename {cake => lib/Cake}/tests/test_app/views/pages/extract.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/pages/home.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/cache_empty_sections.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/cache_form.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/helper_overwrite.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/index.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/multiple_nocache.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/nocache_multiple_element.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/scaffold.edit.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/sequencial_nocache.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/test_nocache_tags.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/scaffolds/empty (100%)
rename {cake => lib/Cake}/tests/test_app/views/tests_apps/index.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/elements/test_element.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/layouts/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/plugins/test_plugin/layouts/plugin_default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/plugins/test_plugin/tests/index.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/posts/index.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/css/test_asset.css (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/flash/theme_test.swf (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/img/cake.power.gif (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/img/test.jpg (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/js/one/theme_one.js (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/js/theme.js (100%)
rename {cake => lib/Cake}/tests/test_app/views/themed/test_theme/webroot/pdfs/theme_test.pdf (100%)
rename {cake => lib/Cake}/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css (100%)
rename {cake => lib/Cake}/tests/test_app/webroot/theme/test_theme/css/webroot_test.css (100%)
rename {cake => lib/Cake}/tests/test_app/webroot/theme/test_theme/img/cake.power.gif (100%)
rename {cake => lib/Cake}/tests/test_app/webroot/theme/test_theme/img/test.jpg (100%)
diff --git a/cake/tests/cases/basics.test.php b/lib/Cake/tests/cases/basics.test.php
similarity index 100%
rename from cake/tests/cases/basics.test.php
rename to lib/Cake/tests/cases/basics.test.php
diff --git a/cake/tests/cases/console/all_console.test.php b/lib/Cake/tests/cases/console/all_console.test.php
similarity index 100%
rename from cake/tests/cases/console/all_console.test.php
rename to lib/Cake/tests/cases/console/all_console.test.php
diff --git a/cake/tests/cases/console/all_console_libs.test.php b/lib/Cake/tests/cases/console/all_console_libs.test.php
similarity index 100%
rename from cake/tests/cases/console/all_console_libs.test.php
rename to lib/Cake/tests/cases/console/all_console_libs.test.php
diff --git a/cake/tests/cases/console/all_shells.test.php b/lib/Cake/tests/cases/console/all_shells.test.php
similarity index 100%
rename from cake/tests/cases/console/all_shells.test.php
rename to lib/Cake/tests/cases/console/all_shells.test.php
diff --git a/cake/tests/cases/console/all_tasks.test.php b/lib/Cake/tests/cases/console/all_tasks.test.php
similarity index 100%
rename from cake/tests/cases/console/all_tasks.test.php
rename to lib/Cake/tests/cases/console/all_tasks.test.php
diff --git a/cake/tests/cases/console/libs/console_error_handler.test.php b/lib/Cake/tests/cases/console/libs/console_error_handler.test.php
similarity index 100%
rename from cake/tests/cases/console/libs/console_error_handler.test.php
rename to lib/Cake/tests/cases/console/libs/console_error_handler.test.php
diff --git a/cake/tests/cases/console/libs/console_option_parser.test.php b/lib/Cake/tests/cases/console/libs/console_option_parser.test.php
similarity index 100%
rename from cake/tests/cases/console/libs/console_option_parser.test.php
rename to lib/Cake/tests/cases/console/libs/console_option_parser.test.php
diff --git a/cake/tests/cases/console/libs/console_output.test.php b/lib/Cake/tests/cases/console/libs/console_output.test.php
similarity index 100%
rename from cake/tests/cases/console/libs/console_output.test.php
rename to lib/Cake/tests/cases/console/libs/console_output.test.php
diff --git a/cake/tests/cases/console/libs/help_formatter.test.php b/lib/Cake/tests/cases/console/libs/help_formatter.test.php
similarity index 100%
rename from cake/tests/cases/console/libs/help_formatter.test.php
rename to lib/Cake/tests/cases/console/libs/help_formatter.test.php
diff --git a/cake/tests/cases/console/libs/task_collection.test.php b/lib/Cake/tests/cases/console/libs/task_collection.test.php
similarity index 100%
rename from cake/tests/cases/console/libs/task_collection.test.php
rename to lib/Cake/tests/cases/console/libs/task_collection.test.php
diff --git a/cake/tests/cases/console/shell_dispatcher.test.php b/lib/Cake/tests/cases/console/shell_dispatcher.test.php
similarity index 100%
rename from cake/tests/cases/console/shell_dispatcher.test.php
rename to lib/Cake/tests/cases/console/shell_dispatcher.test.php
diff --git a/cake/tests/cases/console/shells/acl.test.php b/lib/Cake/tests/cases/console/shells/acl.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/acl.test.php
rename to lib/Cake/tests/cases/console/shells/acl.test.php
diff --git a/cake/tests/cases/console/shells/api.test.php b/lib/Cake/tests/cases/console/shells/api.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/api.test.php
rename to lib/Cake/tests/cases/console/shells/api.test.php
diff --git a/cake/tests/cases/console/shells/bake.test.php b/lib/Cake/tests/cases/console/shells/bake.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/bake.test.php
rename to lib/Cake/tests/cases/console/shells/bake.test.php
diff --git a/cake/tests/cases/console/shells/command_list.test.php b/lib/Cake/tests/cases/console/shells/command_list.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/command_list.test.php
rename to lib/Cake/tests/cases/console/shells/command_list.test.php
diff --git a/cake/tests/cases/console/shells/schema.test.php b/lib/Cake/tests/cases/console/shells/schema.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/schema.test.php
rename to lib/Cake/tests/cases/console/shells/schema.test.php
diff --git a/cake/tests/cases/console/shells/shell.test.php b/lib/Cake/tests/cases/console/shells/shell.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/shell.test.php
rename to lib/Cake/tests/cases/console/shells/shell.test.php
diff --git a/cake/tests/cases/console/shells/tasks/controller.test.php b/lib/Cake/tests/cases/console/shells/tasks/controller.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/controller.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/controller.test.php
diff --git a/cake/tests/cases/console/shells/tasks/db_config.test.php b/lib/Cake/tests/cases/console/shells/tasks/db_config.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/db_config.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/db_config.test.php
diff --git a/cake/tests/cases/console/shells/tasks/extract.test.php b/lib/Cake/tests/cases/console/shells/tasks/extract.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/extract.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/extract.test.php
diff --git a/cake/tests/cases/console/shells/tasks/fixture.test.php b/lib/Cake/tests/cases/console/shells/tasks/fixture.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/fixture.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/fixture.test.php
diff --git a/cake/tests/cases/console/shells/tasks/model.test.php b/lib/Cake/tests/cases/console/shells/tasks/model.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/model.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/model.test.php
diff --git a/cake/tests/cases/console/shells/tasks/plugin.test.php b/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/plugin.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
diff --git a/cake/tests/cases/console/shells/tasks/project.test.php b/lib/Cake/tests/cases/console/shells/tasks/project.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/project.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/project.test.php
diff --git a/cake/tests/cases/console/shells/tasks/template.test.php b/lib/Cake/tests/cases/console/shells/tasks/template.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/template.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/template.test.php
diff --git a/cake/tests/cases/console/shells/tasks/test.test.php b/lib/Cake/tests/cases/console/shells/tasks/test.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/test.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/test.test.php
diff --git a/cake/tests/cases/console/shells/tasks/view.test.php b/lib/Cake/tests/cases/console/shells/tasks/view.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/tasks/view.test.php
rename to lib/Cake/tests/cases/console/shells/tasks/view.test.php
diff --git a/cake/tests/cases/console/shells/testsuite.test.php b/lib/Cake/tests/cases/console/shells/testsuite.test.php
similarity index 100%
rename from cake/tests/cases/console/shells/testsuite.test.php
rename to lib/Cake/tests/cases/console/shells/testsuite.test.php
diff --git a/cake/tests/cases/libs/all_behaviors.test.php b/lib/Cake/tests/cases/libs/all_behaviors.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_behaviors.test.php
rename to lib/Cake/tests/cases/libs/all_behaviors.test.php
diff --git a/cake/tests/cases/libs/all_cache_engines.test.php b/lib/Cake/tests/cases/libs/all_cache_engines.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_cache_engines.test.php
rename to lib/Cake/tests/cases/libs/all_cache_engines.test.php
diff --git a/cake/tests/cases/libs/all_components.test.php b/lib/Cake/tests/cases/libs/all_components.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_components.test.php
rename to lib/Cake/tests/cases/libs/all_components.test.php
diff --git a/cake/tests/cases/libs/all_configure.test.php b/lib/Cake/tests/cases/libs/all_configure.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_configure.test.php
rename to lib/Cake/tests/cases/libs/all_configure.test.php
diff --git a/cake/tests/cases/libs/all_controllers.test.php b/lib/Cake/tests/cases/libs/all_controllers.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_controllers.test.php
rename to lib/Cake/tests/cases/libs/all_controllers.test.php
diff --git a/cake/tests/cases/libs/all_database.test.php b/lib/Cake/tests/cases/libs/all_database.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_database.test.php
rename to lib/Cake/tests/cases/libs/all_database.test.php
diff --git a/cake/tests/cases/libs/all_error.test.php b/lib/Cake/tests/cases/libs/all_error.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_error.test.php
rename to lib/Cake/tests/cases/libs/all_error.test.php
diff --git a/cake/tests/cases/libs/all_helpers.test.php b/lib/Cake/tests/cases/libs/all_helpers.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_helpers.test.php
rename to lib/Cake/tests/cases/libs/all_helpers.test.php
diff --git a/cake/tests/cases/libs/all_js_helpers.test.php b/lib/Cake/tests/cases/libs/all_js_helpers.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_js_helpers.test.php
rename to lib/Cake/tests/cases/libs/all_js_helpers.test.php
diff --git a/cake/tests/cases/libs/all_libs.test.php b/lib/Cake/tests/cases/libs/all_libs.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_libs.test.php
rename to lib/Cake/tests/cases/libs/all_libs.test.php
diff --git a/cake/tests/cases/libs/all_localization.test.php b/lib/Cake/tests/cases/libs/all_localization.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_localization.test.php
rename to lib/Cake/tests/cases/libs/all_localization.test.php
diff --git a/cake/tests/cases/libs/all_model.test.php b/lib/Cake/tests/cases/libs/all_model.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_model.test.php
rename to lib/Cake/tests/cases/libs/all_model.test.php
diff --git a/cake/tests/cases/libs/all_routing.test.php b/lib/Cake/tests/cases/libs/all_routing.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_routing.test.php
rename to lib/Cake/tests/cases/libs/all_routing.test.php
diff --git a/cake/tests/cases/libs/all_socket.test.php b/lib/Cake/tests/cases/libs/all_socket.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_socket.test.php
rename to lib/Cake/tests/cases/libs/all_socket.test.php
diff --git a/cake/tests/cases/libs/all_test_suite.test.php b/lib/Cake/tests/cases/libs/all_test_suite.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_test_suite.test.php
rename to lib/Cake/tests/cases/libs/all_test_suite.test.php
diff --git a/cake/tests/cases/libs/all_tests.test.php b/lib/Cake/tests/cases/libs/all_tests.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_tests.test.php
rename to lib/Cake/tests/cases/libs/all_tests.test.php
diff --git a/cake/tests/cases/libs/all_views.test.php b/lib/Cake/tests/cases/libs/all_views.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_views.test.php
rename to lib/Cake/tests/cases/libs/all_views.test.php
diff --git a/cake/tests/cases/libs/all_xml.test.php b/lib/Cake/tests/cases/libs/all_xml.test.php
similarity index 100%
rename from cake/tests/cases/libs/all_xml.test.php
rename to lib/Cake/tests/cases/libs/all_xml.test.php
diff --git a/cake/tests/cases/libs/app.test.php b/lib/Cake/tests/cases/libs/app.test.php
similarity index 100%
rename from cake/tests/cases/libs/app.test.php
rename to lib/Cake/tests/cases/libs/app.test.php
diff --git a/cake/tests/cases/libs/cache.test.php b/lib/Cake/tests/cases/libs/cache.test.php
similarity index 100%
rename from cake/tests/cases/libs/cache.test.php
rename to lib/Cake/tests/cases/libs/cache.test.php
diff --git a/cake/tests/cases/libs/cache/apc.test.php b/lib/Cake/tests/cases/libs/cache/apc.test.php
similarity index 100%
rename from cake/tests/cases/libs/cache/apc.test.php
rename to lib/Cake/tests/cases/libs/cache/apc.test.php
diff --git a/cake/tests/cases/libs/cache/file.test.php b/lib/Cake/tests/cases/libs/cache/file.test.php
similarity index 100%
rename from cake/tests/cases/libs/cache/file.test.php
rename to lib/Cake/tests/cases/libs/cache/file.test.php
diff --git a/cake/tests/cases/libs/cache/memcache.test.php b/lib/Cake/tests/cases/libs/cache/memcache.test.php
similarity index 100%
rename from cake/tests/cases/libs/cache/memcache.test.php
rename to lib/Cake/tests/cases/libs/cache/memcache.test.php
diff --git a/cake/tests/cases/libs/cache/xcache.test.php b/lib/Cake/tests/cases/libs/cache/xcache.test.php
similarity index 100%
rename from cake/tests/cases/libs/cache/xcache.test.php
rename to lib/Cake/tests/cases/libs/cache/xcache.test.php
diff --git a/cake/tests/cases/libs/cake_log.test.php b/lib/Cake/tests/cases/libs/cake_log.test.php
similarity index 100%
rename from cake/tests/cases/libs/cake_log.test.php
rename to lib/Cake/tests/cases/libs/cake_log.test.php
diff --git a/cake/tests/cases/libs/cake_request.test.php b/lib/Cake/tests/cases/libs/cake_request.test.php
similarity index 100%
rename from cake/tests/cases/libs/cake_request.test.php
rename to lib/Cake/tests/cases/libs/cake_request.test.php
diff --git a/cake/tests/cases/libs/cake_response.test.php b/lib/Cake/tests/cases/libs/cake_response.test.php
similarity index 100%
rename from cake/tests/cases/libs/cake_response.test.php
rename to lib/Cake/tests/cases/libs/cake_response.test.php
diff --git a/cake/tests/cases/libs/cake_session.test.php b/lib/Cake/tests/cases/libs/cake_session.test.php
similarity index 100%
rename from cake/tests/cases/libs/cake_session.test.php
rename to lib/Cake/tests/cases/libs/cake_session.test.php
diff --git a/cake/tests/cases/libs/cake_socket.test.php b/lib/Cake/tests/cases/libs/cake_socket.test.php
similarity index 100%
rename from cake/tests/cases/libs/cake_socket.test.php
rename to lib/Cake/tests/cases/libs/cake_socket.test.php
diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/lib/Cake/tests/cases/libs/cake_test_case.test.php
similarity index 100%
rename from cake/tests/cases/libs/cake_test_case.test.php
rename to lib/Cake/tests/cases/libs/cake_test_case.test.php
diff --git a/cake/tests/cases/libs/cake_test_fixture.test.php b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
similarity index 100%
rename from cake/tests/cases/libs/cake_test_fixture.test.php
rename to lib/Cake/tests/cases/libs/cake_test_fixture.test.php
diff --git a/cake/tests/cases/libs/class_registry.test.php b/lib/Cake/tests/cases/libs/class_registry.test.php
similarity index 100%
rename from cake/tests/cases/libs/class_registry.test.php
rename to lib/Cake/tests/cases/libs/class_registry.test.php
diff --git a/cake/tests/cases/libs/config/ini_reader.test.php b/lib/Cake/tests/cases/libs/config/ini_reader.test.php
similarity index 100%
rename from cake/tests/cases/libs/config/ini_reader.test.php
rename to lib/Cake/tests/cases/libs/config/ini_reader.test.php
diff --git a/cake/tests/cases/libs/config/php_reader.test.php b/lib/Cake/tests/cases/libs/config/php_reader.test.php
similarity index 100%
rename from cake/tests/cases/libs/config/php_reader.test.php
rename to lib/Cake/tests/cases/libs/config/php_reader.test.php
diff --git a/cake/tests/cases/libs/configure.test.php b/lib/Cake/tests/cases/libs/configure.test.php
similarity index 100%
rename from cake/tests/cases/libs/configure.test.php
rename to lib/Cake/tests/cases/libs/configure.test.php
diff --git a/cake/tests/cases/libs/controller/component.test.php b/lib/Cake/tests/cases/libs/controller/component.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/component.test.php
rename to lib/Cake/tests/cases/libs/controller/component.test.php
diff --git a/cake/tests/cases/libs/controller/component_collection.test.php b/lib/Cake/tests/cases/libs/controller/component_collection.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/component_collection.test.php
rename to lib/Cake/tests/cases/libs/controller/component_collection.test.php
diff --git a/cake/tests/cases/libs/controller/components/acl.test.php b/lib/Cake/tests/cases/libs/controller/components/acl.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/components/acl.test.php
rename to lib/Cake/tests/cases/libs/controller/components/acl.test.php
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/lib/Cake/tests/cases/libs/controller/components/auth.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/components/auth.test.php
rename to lib/Cake/tests/cases/libs/controller/components/auth.test.php
diff --git a/cake/tests/cases/libs/controller/components/cookie.test.php b/lib/Cake/tests/cases/libs/controller/components/cookie.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/components/cookie.test.php
rename to lib/Cake/tests/cases/libs/controller/components/cookie.test.php
diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/lib/Cake/tests/cases/libs/controller/components/email.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/components/email.test.php
rename to lib/Cake/tests/cases/libs/controller/components/email.test.php
diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/components/request_handler.test.php
rename to lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/lib/Cake/tests/cases/libs/controller/components/security.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/components/security.test.php
rename to lib/Cake/tests/cases/libs/controller/components/security.test.php
diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/lib/Cake/tests/cases/libs/controller/components/session.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/components/session.test.php
rename to lib/Cake/tests/cases/libs/controller/components/session.test.php
diff --git a/cake/tests/cases/libs/controller/controller.test.php b/lib/Cake/tests/cases/libs/controller/controller.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/controller.test.php
rename to lib/Cake/tests/cases/libs/controller/controller.test.php
diff --git a/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/lib/Cake/tests/cases/libs/controller/controller_merge_vars.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/controller_merge_vars.test.php
rename to lib/Cake/tests/cases/libs/controller/controller_merge_vars.test.php
diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/lib/Cake/tests/cases/libs/controller/pages_controller.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/pages_controller.test.php
rename to lib/Cake/tests/cases/libs/controller/pages_controller.test.php
diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/lib/Cake/tests/cases/libs/controller/scaffold.test.php
similarity index 100%
rename from cake/tests/cases/libs/controller/scaffold.test.php
rename to lib/Cake/tests/cases/libs/controller/scaffold.test.php
diff --git a/cake/tests/cases/libs/debugger.test.php b/lib/Cake/tests/cases/libs/debugger.test.php
similarity index 100%
rename from cake/tests/cases/libs/debugger.test.php
rename to lib/Cake/tests/cases/libs/debugger.test.php
diff --git a/cake/tests/cases/libs/dispatcher.test.php b/lib/Cake/tests/cases/libs/dispatcher.test.php
similarity index 100%
rename from cake/tests/cases/libs/dispatcher.test.php
rename to lib/Cake/tests/cases/libs/dispatcher.test.php
diff --git a/cake/tests/cases/libs/error/error_handler.test.php b/lib/Cake/tests/cases/libs/error/error_handler.test.php
similarity index 100%
rename from cake/tests/cases/libs/error/error_handler.test.php
rename to lib/Cake/tests/cases/libs/error/error_handler.test.php
diff --git a/cake/tests/cases/libs/error/exception_renderer.test.php b/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
similarity index 100%
rename from cake/tests/cases/libs/error/exception_renderer.test.php
rename to lib/Cake/tests/cases/libs/error/exception_renderer.test.php
diff --git a/cake/tests/cases/libs/file.test.php b/lib/Cake/tests/cases/libs/file.test.php
similarity index 100%
rename from cake/tests/cases/libs/file.test.php
rename to lib/Cake/tests/cases/libs/file.test.php
diff --git a/cake/tests/cases/libs/folder.test.php b/lib/Cake/tests/cases/libs/folder.test.php
similarity index 100%
rename from cake/tests/cases/libs/folder.test.php
rename to lib/Cake/tests/cases/libs/folder.test.php
diff --git a/cake/tests/cases/libs/html_coverage_report.test.php b/lib/Cake/tests/cases/libs/html_coverage_report.test.php
similarity index 100%
rename from cake/tests/cases/libs/html_coverage_report.test.php
rename to lib/Cake/tests/cases/libs/html_coverage_report.test.php
diff --git a/cake/tests/cases/libs/http_socket.test.php b/lib/Cake/tests/cases/libs/http_socket.test.php
similarity index 100%
rename from cake/tests/cases/libs/http_socket.test.php
rename to lib/Cake/tests/cases/libs/http_socket.test.php
diff --git a/cake/tests/cases/libs/i18n.test.php b/lib/Cake/tests/cases/libs/i18n.test.php
similarity index 100%
rename from cake/tests/cases/libs/i18n.test.php
rename to lib/Cake/tests/cases/libs/i18n.test.php
diff --git a/cake/tests/cases/libs/inflector.test.php b/lib/Cake/tests/cases/libs/inflector.test.php
similarity index 100%
rename from cake/tests/cases/libs/inflector.test.php
rename to lib/Cake/tests/cases/libs/inflector.test.php
diff --git a/cake/tests/cases/libs/l10n.test.php b/lib/Cake/tests/cases/libs/l10n.test.php
similarity index 100%
rename from cake/tests/cases/libs/l10n.test.php
rename to lib/Cake/tests/cases/libs/l10n.test.php
diff --git a/cake/tests/cases/libs/log/file_log.test.php b/lib/Cake/tests/cases/libs/log/file_log.test.php
similarity index 100%
rename from cake/tests/cases/libs/log/file_log.test.php
rename to lib/Cake/tests/cases/libs/log/file_log.test.php
diff --git a/cake/tests/cases/libs/magic_db.test.php b/lib/Cake/tests/cases/libs/magic_db.test.php
similarity index 100%
rename from cake/tests/cases/libs/magic_db.test.php
rename to lib/Cake/tests/cases/libs/magic_db.test.php
diff --git a/cake/tests/cases/libs/model/behavior_collection.test.php b/lib/Cake/tests/cases/libs/model/behavior_collection.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/behavior_collection.test.php
rename to lib/Cake/tests/cases/libs/model/behavior_collection.test.php
diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/behaviors/acl.test.php
rename to lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/lib/Cake/tests/cases/libs/model/behaviors/containable.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/behaviors/containable.test.php
rename to lib/Cake/tests/cases/libs/model/behaviors/containable.test.php
diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/lib/Cake/tests/cases/libs/model/behaviors/translate.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/behaviors/translate.test.php
rename to lib/Cake/tests/cases/libs/model/behaviors/translate.test.php
diff --git a/cake/tests/cases/libs/model/behaviors/tree.test.php b/lib/Cake/tests/cases/libs/model/behaviors/tree.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/behaviors/tree.test.php
rename to lib/Cake/tests/cases/libs/model/behaviors/tree.test.php
diff --git a/cake/tests/cases/libs/model/cake_schema.test.php b/lib/Cake/tests/cases/libs/model/cake_schema.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/cake_schema.test.php
rename to lib/Cake/tests/cases/libs/model/cake_schema.test.php
diff --git a/cake/tests/cases/libs/model/connection_manager.test.php b/lib/Cake/tests/cases/libs/model/connection_manager.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/connection_manager.test.php
rename to lib/Cake/tests/cases/libs/model/connection_manager.test.php
diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
rename to lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
rename to lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php
rename to lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php
diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
rename to lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
rename to lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo_source.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/datasources/dbo_source.test.php
rename to lib/Cake/tests/cases/libs/model/datasources/dbo_source.test.php
diff --git a/cake/tests/cases/libs/model/db_acl.test.php b/lib/Cake/tests/cases/libs/model/db_acl.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/db_acl.test.php
rename to lib/Cake/tests/cases/libs/model/db_acl.test.php
diff --git a/cake/tests/cases/libs/model/model.test.php b/lib/Cake/tests/cases/libs/model/model.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/model.test.php
rename to lib/Cake/tests/cases/libs/model/model.test.php
diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/lib/Cake/tests/cases/libs/model/model_delete.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/model_delete.test.php
rename to lib/Cake/tests/cases/libs/model/model_delete.test.php
diff --git a/cake/tests/cases/libs/model/model_integration.test.php b/lib/Cake/tests/cases/libs/model/model_integration.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/model_integration.test.php
rename to lib/Cake/tests/cases/libs/model/model_integration.test.php
diff --git a/cake/tests/cases/libs/model/model_read.test.php b/lib/Cake/tests/cases/libs/model/model_read.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/model_read.test.php
rename to lib/Cake/tests/cases/libs/model/model_read.test.php
diff --git a/cake/tests/cases/libs/model/model_validation.test.php b/lib/Cake/tests/cases/libs/model/model_validation.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/model_validation.test.php
rename to lib/Cake/tests/cases/libs/model/model_validation.test.php
diff --git a/cake/tests/cases/libs/model/model_write.test.php b/lib/Cake/tests/cases/libs/model/model_write.test.php
similarity index 100%
rename from cake/tests/cases/libs/model/model_write.test.php
rename to lib/Cake/tests/cases/libs/model/model_write.test.php
diff --git a/cake/tests/cases/libs/model/models.php b/lib/Cake/tests/cases/libs/model/models.php
similarity index 100%
rename from cake/tests/cases/libs/model/models.php
rename to lib/Cake/tests/cases/libs/model/models.php
diff --git a/cake/tests/cases/libs/multibyte.test.php b/lib/Cake/tests/cases/libs/multibyte.test.php
similarity index 100%
rename from cake/tests/cases/libs/multibyte.test.php
rename to lib/Cake/tests/cases/libs/multibyte.test.php
diff --git a/cake/tests/cases/libs/object.test.php b/lib/Cake/tests/cases/libs/object.test.php
similarity index 100%
rename from cake/tests/cases/libs/object.test.php
rename to lib/Cake/tests/cases/libs/object.test.php
diff --git a/cake/tests/cases/libs/object_collection.test.php b/lib/Cake/tests/cases/libs/object_collection.test.php
similarity index 100%
rename from cake/tests/cases/libs/object_collection.test.php
rename to lib/Cake/tests/cases/libs/object_collection.test.php
diff --git a/cake/tests/cases/libs/route/cake_route.test.php b/lib/Cake/tests/cases/libs/route/cake_route.test.php
similarity index 100%
rename from cake/tests/cases/libs/route/cake_route.test.php
rename to lib/Cake/tests/cases/libs/route/cake_route.test.php
diff --git a/cake/tests/cases/libs/route/plugin_short_route.test.php b/lib/Cake/tests/cases/libs/route/plugin_short_route.test.php
similarity index 100%
rename from cake/tests/cases/libs/route/plugin_short_route.test.php
rename to lib/Cake/tests/cases/libs/route/plugin_short_route.test.php
diff --git a/cake/tests/cases/libs/route/redirect_route.test.php b/lib/Cake/tests/cases/libs/route/redirect_route.test.php
similarity index 100%
rename from cake/tests/cases/libs/route/redirect_route.test.php
rename to lib/Cake/tests/cases/libs/route/redirect_route.test.php
diff --git a/cake/tests/cases/libs/router.test.php b/lib/Cake/tests/cases/libs/router.test.php
similarity index 100%
rename from cake/tests/cases/libs/router.test.php
rename to lib/Cake/tests/cases/libs/router.test.php
diff --git a/cake/tests/cases/libs/sanitize.test.php b/lib/Cake/tests/cases/libs/sanitize.test.php
similarity index 100%
rename from cake/tests/cases/libs/sanitize.test.php
rename to lib/Cake/tests/cases/libs/sanitize.test.php
diff --git a/cake/tests/cases/libs/security.test.php b/lib/Cake/tests/cases/libs/security.test.php
similarity index 100%
rename from cake/tests/cases/libs/security.test.php
rename to lib/Cake/tests/cases/libs/security.test.php
diff --git a/cake/tests/cases/libs/session/cache_session.test.php b/lib/Cake/tests/cases/libs/session/cache_session.test.php
similarity index 100%
rename from cake/tests/cases/libs/session/cache_session.test.php
rename to lib/Cake/tests/cases/libs/session/cache_session.test.php
diff --git a/cake/tests/cases/libs/session/database_session.test.php b/lib/Cake/tests/cases/libs/session/database_session.test.php
similarity index 100%
rename from cake/tests/cases/libs/session/database_session.test.php
rename to lib/Cake/tests/cases/libs/session/database_session.test.php
diff --git a/cake/tests/cases/libs/set.test.php b/lib/Cake/tests/cases/libs/set.test.php
similarity index 100%
rename from cake/tests/cases/libs/set.test.php
rename to lib/Cake/tests/cases/libs/set.test.php
diff --git a/cake/tests/cases/libs/string.test.php b/lib/Cake/tests/cases/libs/string.test.php
similarity index 100%
rename from cake/tests/cases/libs/string.test.php
rename to lib/Cake/tests/cases/libs/string.test.php
diff --git a/cake/tests/cases/libs/test_manager.test.php b/lib/Cake/tests/cases/libs/test_manager.test.php
similarity index 100%
rename from cake/tests/cases/libs/test_manager.test.php
rename to lib/Cake/tests/cases/libs/test_manager.test.php
diff --git a/cake/tests/cases/libs/validation.test.php b/lib/Cake/tests/cases/libs/validation.test.php
similarity index 100%
rename from cake/tests/cases/libs/validation.test.php
rename to lib/Cake/tests/cases/libs/validation.test.php
diff --git a/cake/tests/cases/libs/view/helper.test.php b/lib/Cake/tests/cases/libs/view/helper.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helper.test.php
rename to lib/Cake/tests/cases/libs/view/helper.test.php
diff --git a/cake/tests/cases/libs/view/helper_collection.test.php b/lib/Cake/tests/cases/libs/view/helper_collection.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helper_collection.test.php
rename to lib/Cake/tests/cases/libs/view/helper_collection.test.php
diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/lib/Cake/tests/cases/libs/view/helpers/cache.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/cache.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/cache.test.php
diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/lib/Cake/tests/cases/libs/view/helpers/form.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/form.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/form.test.php
diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/lib/Cake/tests/cases/libs/view/helpers/html.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/html.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/html.test.php
diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/lib/Cake/tests/cases/libs/view/helpers/jquery_engine.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/jquery_engine.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/jquery_engine.test.php
diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/lib/Cake/tests/cases/libs/view/helpers/js.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/js.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/js.test.php
diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/lib/Cake/tests/cases/libs/view/helpers/mootools_engine.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/mootools_engine.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/mootools_engine.test.php
diff --git a/cake/tests/cases/libs/view/helpers/number.test.php b/lib/Cake/tests/cases/libs/view/helpers/number.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/number.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/number.test.php
diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/lib/Cake/tests/cases/libs/view/helpers/paginator.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/paginator.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/paginator.test.php
diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/lib/Cake/tests/cases/libs/view/helpers/prototype_engine.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/prototype_engine.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/prototype_engine.test.php
diff --git a/cake/tests/cases/libs/view/helpers/rss.test.php b/lib/Cake/tests/cases/libs/view/helpers/rss.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/rss.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/rss.test.php
diff --git a/cake/tests/cases/libs/view/helpers/session.test.php b/lib/Cake/tests/cases/libs/view/helpers/session.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/session.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/session.test.php
diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/lib/Cake/tests/cases/libs/view/helpers/text.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/text.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/text.test.php
diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/lib/Cake/tests/cases/libs/view/helpers/time.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/helpers/time.test.php
rename to lib/Cake/tests/cases/libs/view/helpers/time.test.php
diff --git a/cake/tests/cases/libs/view/media.test.php b/lib/Cake/tests/cases/libs/view/media.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/media.test.php
rename to lib/Cake/tests/cases/libs/view/media.test.php
diff --git a/cake/tests/cases/libs/view/theme.test.php b/lib/Cake/tests/cases/libs/view/theme.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/theme.test.php
rename to lib/Cake/tests/cases/libs/view/theme.test.php
diff --git a/cake/tests/cases/libs/view/view.test.php b/lib/Cake/tests/cases/libs/view/view.test.php
similarity index 100%
rename from cake/tests/cases/libs/view/view.test.php
rename to lib/Cake/tests/cases/libs/view/view.test.php
diff --git a/cake/tests/cases/libs/xml.test.php b/lib/Cake/tests/cases/libs/xml.test.php
similarity index 100%
rename from cake/tests/cases/libs/xml.test.php
rename to lib/Cake/tests/cases/libs/xml.test.php
diff --git a/cake/tests/fixtures/account_fixture.php b/lib/Cake/tests/fixtures/account_fixture.php
similarity index 100%
rename from cake/tests/fixtures/account_fixture.php
rename to lib/Cake/tests/fixtures/account_fixture.php
diff --git a/cake/tests/fixtures/aco_action_fixture.php b/lib/Cake/tests/fixtures/aco_action_fixture.php
similarity index 100%
rename from cake/tests/fixtures/aco_action_fixture.php
rename to lib/Cake/tests/fixtures/aco_action_fixture.php
diff --git a/cake/tests/fixtures/aco_fixture.php b/lib/Cake/tests/fixtures/aco_fixture.php
similarity index 100%
rename from cake/tests/fixtures/aco_fixture.php
rename to lib/Cake/tests/fixtures/aco_fixture.php
diff --git a/cake/tests/fixtures/aco_two_fixture.php b/lib/Cake/tests/fixtures/aco_two_fixture.php
similarity index 100%
rename from cake/tests/fixtures/aco_two_fixture.php
rename to lib/Cake/tests/fixtures/aco_two_fixture.php
diff --git a/cake/tests/fixtures/ad_fixture.php b/lib/Cake/tests/fixtures/ad_fixture.php
similarity index 100%
rename from cake/tests/fixtures/ad_fixture.php
rename to lib/Cake/tests/fixtures/ad_fixture.php
diff --git a/cake/tests/fixtures/advertisement_fixture.php b/lib/Cake/tests/fixtures/advertisement_fixture.php
similarity index 100%
rename from cake/tests/fixtures/advertisement_fixture.php
rename to lib/Cake/tests/fixtures/advertisement_fixture.php
diff --git a/cake/tests/fixtures/after_tree_fixture.php b/lib/Cake/tests/fixtures/after_tree_fixture.php
similarity index 100%
rename from cake/tests/fixtures/after_tree_fixture.php
rename to lib/Cake/tests/fixtures/after_tree_fixture.php
diff --git a/cake/tests/fixtures/another_article_fixture.php b/lib/Cake/tests/fixtures/another_article_fixture.php
similarity index 100%
rename from cake/tests/fixtures/another_article_fixture.php
rename to lib/Cake/tests/fixtures/another_article_fixture.php
diff --git a/cake/tests/fixtures/apple_fixture.php b/lib/Cake/tests/fixtures/apple_fixture.php
similarity index 100%
rename from cake/tests/fixtures/apple_fixture.php
rename to lib/Cake/tests/fixtures/apple_fixture.php
diff --git a/cake/tests/fixtures/aro_fixture.php b/lib/Cake/tests/fixtures/aro_fixture.php
similarity index 100%
rename from cake/tests/fixtures/aro_fixture.php
rename to lib/Cake/tests/fixtures/aro_fixture.php
diff --git a/cake/tests/fixtures/aro_two_fixture.php b/lib/Cake/tests/fixtures/aro_two_fixture.php
similarity index 100%
rename from cake/tests/fixtures/aro_two_fixture.php
rename to lib/Cake/tests/fixtures/aro_two_fixture.php
diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/lib/Cake/tests/fixtures/aros_aco_fixture.php
similarity index 100%
rename from cake/tests/fixtures/aros_aco_fixture.php
rename to lib/Cake/tests/fixtures/aros_aco_fixture.php
diff --git a/cake/tests/fixtures/aros_aco_two_fixture.php b/lib/Cake/tests/fixtures/aros_aco_two_fixture.php
similarity index 100%
rename from cake/tests/fixtures/aros_aco_two_fixture.php
rename to lib/Cake/tests/fixtures/aros_aco_two_fixture.php
diff --git a/cake/tests/fixtures/article_featured_fixture.php b/lib/Cake/tests/fixtures/article_featured_fixture.php
similarity index 100%
rename from cake/tests/fixtures/article_featured_fixture.php
rename to lib/Cake/tests/fixtures/article_featured_fixture.php
diff --git a/cake/tests/fixtures/article_featureds_tags_fixture.php b/lib/Cake/tests/fixtures/article_featureds_tags_fixture.php
similarity index 100%
rename from cake/tests/fixtures/article_featureds_tags_fixture.php
rename to lib/Cake/tests/fixtures/article_featureds_tags_fixture.php
diff --git a/cake/tests/fixtures/article_fixture.php b/lib/Cake/tests/fixtures/article_fixture.php
similarity index 100%
rename from cake/tests/fixtures/article_fixture.php
rename to lib/Cake/tests/fixtures/article_fixture.php
diff --git a/cake/tests/fixtures/articles_tag_fixture.php b/lib/Cake/tests/fixtures/articles_tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/articles_tag_fixture.php
rename to lib/Cake/tests/fixtures/articles_tag_fixture.php
diff --git a/cake/tests/fixtures/assert_tags_test_case.php b/lib/Cake/tests/fixtures/assert_tags_test_case.php
similarity index 100%
rename from cake/tests/fixtures/assert_tags_test_case.php
rename to lib/Cake/tests/fixtures/assert_tags_test_case.php
diff --git a/cake/tests/fixtures/attachment_fixture.php b/lib/Cake/tests/fixtures/attachment_fixture.php
similarity index 100%
rename from cake/tests/fixtures/attachment_fixture.php
rename to lib/Cake/tests/fixtures/attachment_fixture.php
diff --git a/cake/tests/fixtures/auth_user_custom_field_fixture.php b/lib/Cake/tests/fixtures/auth_user_custom_field_fixture.php
similarity index 100%
rename from cake/tests/fixtures/auth_user_custom_field_fixture.php
rename to lib/Cake/tests/fixtures/auth_user_custom_field_fixture.php
diff --git a/cake/tests/fixtures/auth_user_fixture.php b/lib/Cake/tests/fixtures/auth_user_fixture.php
similarity index 100%
rename from cake/tests/fixtures/auth_user_fixture.php
rename to lib/Cake/tests/fixtures/auth_user_fixture.php
diff --git a/cake/tests/fixtures/author_fixture.php b/lib/Cake/tests/fixtures/author_fixture.php
similarity index 100%
rename from cake/tests/fixtures/author_fixture.php
rename to lib/Cake/tests/fixtures/author_fixture.php
diff --git a/cake/tests/fixtures/bake_article_fixture.php b/lib/Cake/tests/fixtures/bake_article_fixture.php
similarity index 100%
rename from cake/tests/fixtures/bake_article_fixture.php
rename to lib/Cake/tests/fixtures/bake_article_fixture.php
diff --git a/cake/tests/fixtures/bake_articles_bake_tag_fixture.php b/lib/Cake/tests/fixtures/bake_articles_bake_tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/bake_articles_bake_tag_fixture.php
rename to lib/Cake/tests/fixtures/bake_articles_bake_tag_fixture.php
diff --git a/cake/tests/fixtures/bake_comment_fixture.php b/lib/Cake/tests/fixtures/bake_comment_fixture.php
similarity index 100%
rename from cake/tests/fixtures/bake_comment_fixture.php
rename to lib/Cake/tests/fixtures/bake_comment_fixture.php
diff --git a/cake/tests/fixtures/bake_tag_fixture.php b/lib/Cake/tests/fixtures/bake_tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/bake_tag_fixture.php
rename to lib/Cake/tests/fixtures/bake_tag_fixture.php
diff --git a/cake/tests/fixtures/basket_fixture.php b/lib/Cake/tests/fixtures/basket_fixture.php
similarity index 100%
rename from cake/tests/fixtures/basket_fixture.php
rename to lib/Cake/tests/fixtures/basket_fixture.php
diff --git a/cake/tests/fixtures/bid_fixture.php b/lib/Cake/tests/fixtures/bid_fixture.php
similarity index 100%
rename from cake/tests/fixtures/bid_fixture.php
rename to lib/Cake/tests/fixtures/bid_fixture.php
diff --git a/cake/tests/fixtures/binary_test_fixture.php b/lib/Cake/tests/fixtures/binary_test_fixture.php
similarity index 100%
rename from cake/tests/fixtures/binary_test_fixture.php
rename to lib/Cake/tests/fixtures/binary_test_fixture.php
diff --git a/cake/tests/fixtures/book_fixture.php b/lib/Cake/tests/fixtures/book_fixture.php
similarity index 100%
rename from cake/tests/fixtures/book_fixture.php
rename to lib/Cake/tests/fixtures/book_fixture.php
diff --git a/cake/tests/fixtures/cache_test_model_fixture.php b/lib/Cake/tests/fixtures/cache_test_model_fixture.php
similarity index 100%
rename from cake/tests/fixtures/cache_test_model_fixture.php
rename to lib/Cake/tests/fixtures/cache_test_model_fixture.php
diff --git a/cake/tests/fixtures/callback_fixture.php b/lib/Cake/tests/fixtures/callback_fixture.php
similarity index 100%
rename from cake/tests/fixtures/callback_fixture.php
rename to lib/Cake/tests/fixtures/callback_fixture.php
diff --git a/cake/tests/fixtures/campaign_fixture.php b/lib/Cake/tests/fixtures/campaign_fixture.php
similarity index 100%
rename from cake/tests/fixtures/campaign_fixture.php
rename to lib/Cake/tests/fixtures/campaign_fixture.php
diff --git a/cake/tests/fixtures/category_fixture.php b/lib/Cake/tests/fixtures/category_fixture.php
similarity index 100%
rename from cake/tests/fixtures/category_fixture.php
rename to lib/Cake/tests/fixtures/category_fixture.php
diff --git a/cake/tests/fixtures/category_thread_fixture.php b/lib/Cake/tests/fixtures/category_thread_fixture.php
similarity index 100%
rename from cake/tests/fixtures/category_thread_fixture.php
rename to lib/Cake/tests/fixtures/category_thread_fixture.php
diff --git a/cake/tests/fixtures/cd_fixture.php b/lib/Cake/tests/fixtures/cd_fixture.php
similarity index 100%
rename from cake/tests/fixtures/cd_fixture.php
rename to lib/Cake/tests/fixtures/cd_fixture.php
diff --git a/cake/tests/fixtures/comment_fixture.php b/lib/Cake/tests/fixtures/comment_fixture.php
similarity index 100%
rename from cake/tests/fixtures/comment_fixture.php
rename to lib/Cake/tests/fixtures/comment_fixture.php
diff --git a/cake/tests/fixtures/content_account_fixture.php b/lib/Cake/tests/fixtures/content_account_fixture.php
similarity index 100%
rename from cake/tests/fixtures/content_account_fixture.php
rename to lib/Cake/tests/fixtures/content_account_fixture.php
diff --git a/cake/tests/fixtures/content_fixture.php b/lib/Cake/tests/fixtures/content_fixture.php
similarity index 100%
rename from cake/tests/fixtures/content_fixture.php
rename to lib/Cake/tests/fixtures/content_fixture.php
diff --git a/cake/tests/fixtures/counter_cache_post_fixture.php b/lib/Cake/tests/fixtures/counter_cache_post_fixture.php
similarity index 100%
rename from cake/tests/fixtures/counter_cache_post_fixture.php
rename to lib/Cake/tests/fixtures/counter_cache_post_fixture.php
diff --git a/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php b/lib/Cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php
similarity index 100%
rename from cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php
rename to lib/Cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php
diff --git a/cake/tests/fixtures/counter_cache_user_fixture.php b/lib/Cake/tests/fixtures/counter_cache_user_fixture.php
similarity index 100%
rename from cake/tests/fixtures/counter_cache_user_fixture.php
rename to lib/Cake/tests/fixtures/counter_cache_user_fixture.php
diff --git a/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php b/lib/Cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php
similarity index 100%
rename from cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php
rename to lib/Cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php
diff --git a/cake/tests/fixtures/data_test_fixture.php b/lib/Cake/tests/fixtures/data_test_fixture.php
similarity index 100%
rename from cake/tests/fixtures/data_test_fixture.php
rename to lib/Cake/tests/fixtures/data_test_fixture.php
diff --git a/cake/tests/fixtures/datatype_fixture.php b/lib/Cake/tests/fixtures/datatype_fixture.php
similarity index 100%
rename from cake/tests/fixtures/datatype_fixture.php
rename to lib/Cake/tests/fixtures/datatype_fixture.php
diff --git a/cake/tests/fixtures/dependency_fixture.php b/lib/Cake/tests/fixtures/dependency_fixture.php
similarity index 100%
rename from cake/tests/fixtures/dependency_fixture.php
rename to lib/Cake/tests/fixtures/dependency_fixture.php
diff --git a/cake/tests/fixtures/device_fixture.php b/lib/Cake/tests/fixtures/device_fixture.php
similarity index 100%
rename from cake/tests/fixtures/device_fixture.php
rename to lib/Cake/tests/fixtures/device_fixture.php
diff --git a/cake/tests/fixtures/device_type_category_fixture.php b/lib/Cake/tests/fixtures/device_type_category_fixture.php
similarity index 100%
rename from cake/tests/fixtures/device_type_category_fixture.php
rename to lib/Cake/tests/fixtures/device_type_category_fixture.php
diff --git a/cake/tests/fixtures/device_type_fixture.php b/lib/Cake/tests/fixtures/device_type_fixture.php
similarity index 100%
rename from cake/tests/fixtures/device_type_fixture.php
rename to lib/Cake/tests/fixtures/device_type_fixture.php
diff --git a/cake/tests/fixtures/document_directory_fixture.php b/lib/Cake/tests/fixtures/document_directory_fixture.php
similarity index 100%
rename from cake/tests/fixtures/document_directory_fixture.php
rename to lib/Cake/tests/fixtures/document_directory_fixture.php
diff --git a/cake/tests/fixtures/document_fixture.php b/lib/Cake/tests/fixtures/document_fixture.php
similarity index 100%
rename from cake/tests/fixtures/document_fixture.php
rename to lib/Cake/tests/fixtures/document_fixture.php
diff --git a/cake/tests/fixtures/exterior_type_category_fixture.php b/lib/Cake/tests/fixtures/exterior_type_category_fixture.php
similarity index 100%
rename from cake/tests/fixtures/exterior_type_category_fixture.php
rename to lib/Cake/tests/fixtures/exterior_type_category_fixture.php
diff --git a/cake/tests/fixtures/feature_set_fixture.php b/lib/Cake/tests/fixtures/feature_set_fixture.php
similarity index 100%
rename from cake/tests/fixtures/feature_set_fixture.php
rename to lib/Cake/tests/fixtures/feature_set_fixture.php
diff --git a/cake/tests/fixtures/featured_fixture.php b/lib/Cake/tests/fixtures/featured_fixture.php
similarity index 100%
rename from cake/tests/fixtures/featured_fixture.php
rename to lib/Cake/tests/fixtures/featured_fixture.php
diff --git a/cake/tests/fixtures/film_file_fixture.php b/lib/Cake/tests/fixtures/film_file_fixture.php
similarity index 100%
rename from cake/tests/fixtures/film_file_fixture.php
rename to lib/Cake/tests/fixtures/film_file_fixture.php
diff --git a/cake/tests/fixtures/fixturized_test_case.php b/lib/Cake/tests/fixtures/fixturized_test_case.php
similarity index 100%
rename from cake/tests/fixtures/fixturized_test_case.php
rename to lib/Cake/tests/fixtures/fixturized_test_case.php
diff --git a/cake/tests/fixtures/flag_tree_fixture.php b/lib/Cake/tests/fixtures/flag_tree_fixture.php
similarity index 100%
rename from cake/tests/fixtures/flag_tree_fixture.php
rename to lib/Cake/tests/fixtures/flag_tree_fixture.php
diff --git a/cake/tests/fixtures/fruit_fixture.php b/lib/Cake/tests/fixtures/fruit_fixture.php
similarity index 100%
rename from cake/tests/fixtures/fruit_fixture.php
rename to lib/Cake/tests/fixtures/fruit_fixture.php
diff --git a/cake/tests/fixtures/fruits_uuid_tag_fixture.php b/lib/Cake/tests/fixtures/fruits_uuid_tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/fruits_uuid_tag_fixture.php
rename to lib/Cake/tests/fixtures/fruits_uuid_tag_fixture.php
diff --git a/cake/tests/fixtures/group_update_all_fixture.php b/lib/Cake/tests/fixtures/group_update_all_fixture.php
similarity index 100%
rename from cake/tests/fixtures/group_update_all_fixture.php
rename to lib/Cake/tests/fixtures/group_update_all_fixture.php
diff --git a/cake/tests/fixtures/home_fixture.php b/lib/Cake/tests/fixtures/home_fixture.php
similarity index 100%
rename from cake/tests/fixtures/home_fixture.php
rename to lib/Cake/tests/fixtures/home_fixture.php
diff --git a/cake/tests/fixtures/image_fixture.php b/lib/Cake/tests/fixtures/image_fixture.php
similarity index 100%
rename from cake/tests/fixtures/image_fixture.php
rename to lib/Cake/tests/fixtures/image_fixture.php
diff --git a/cake/tests/fixtures/item_fixture.php b/lib/Cake/tests/fixtures/item_fixture.php
similarity index 100%
rename from cake/tests/fixtures/item_fixture.php
rename to lib/Cake/tests/fixtures/item_fixture.php
diff --git a/cake/tests/fixtures/items_portfolio_fixture.php b/lib/Cake/tests/fixtures/items_portfolio_fixture.php
similarity index 100%
rename from cake/tests/fixtures/items_portfolio_fixture.php
rename to lib/Cake/tests/fixtures/items_portfolio_fixture.php
diff --git a/cake/tests/fixtures/join_a_b_fixture.php b/lib/Cake/tests/fixtures/join_a_b_fixture.php
similarity index 100%
rename from cake/tests/fixtures/join_a_b_fixture.php
rename to lib/Cake/tests/fixtures/join_a_b_fixture.php
diff --git a/cake/tests/fixtures/join_a_c_fixture.php b/lib/Cake/tests/fixtures/join_a_c_fixture.php
similarity index 100%
rename from cake/tests/fixtures/join_a_c_fixture.php
rename to lib/Cake/tests/fixtures/join_a_c_fixture.php
diff --git a/cake/tests/fixtures/join_a_fixture.php b/lib/Cake/tests/fixtures/join_a_fixture.php
similarity index 100%
rename from cake/tests/fixtures/join_a_fixture.php
rename to lib/Cake/tests/fixtures/join_a_fixture.php
diff --git a/cake/tests/fixtures/join_b_fixture.php b/lib/Cake/tests/fixtures/join_b_fixture.php
similarity index 100%
rename from cake/tests/fixtures/join_b_fixture.php
rename to lib/Cake/tests/fixtures/join_b_fixture.php
diff --git a/cake/tests/fixtures/join_c_fixture.php b/lib/Cake/tests/fixtures/join_c_fixture.php
similarity index 100%
rename from cake/tests/fixtures/join_c_fixture.php
rename to lib/Cake/tests/fixtures/join_c_fixture.php
diff --git a/cake/tests/fixtures/join_thing_fixture.php b/lib/Cake/tests/fixtures/join_thing_fixture.php
similarity index 100%
rename from cake/tests/fixtures/join_thing_fixture.php
rename to lib/Cake/tests/fixtures/join_thing_fixture.php
diff --git a/cake/tests/fixtures/message_fixture.php b/lib/Cake/tests/fixtures/message_fixture.php
similarity index 100%
rename from cake/tests/fixtures/message_fixture.php
rename to lib/Cake/tests/fixtures/message_fixture.php
diff --git a/cake/tests/fixtures/my_categories_my_products_fixture.php b/lib/Cake/tests/fixtures/my_categories_my_products_fixture.php
similarity index 100%
rename from cake/tests/fixtures/my_categories_my_products_fixture.php
rename to lib/Cake/tests/fixtures/my_categories_my_products_fixture.php
diff --git a/cake/tests/fixtures/my_categories_my_users_fixture.php b/lib/Cake/tests/fixtures/my_categories_my_users_fixture.php
similarity index 100%
rename from cake/tests/fixtures/my_categories_my_users_fixture.php
rename to lib/Cake/tests/fixtures/my_categories_my_users_fixture.php
diff --git a/cake/tests/fixtures/my_category_fixture.php b/lib/Cake/tests/fixtures/my_category_fixture.php
similarity index 100%
rename from cake/tests/fixtures/my_category_fixture.php
rename to lib/Cake/tests/fixtures/my_category_fixture.php
diff --git a/cake/tests/fixtures/my_product_fixture.php b/lib/Cake/tests/fixtures/my_product_fixture.php
similarity index 100%
rename from cake/tests/fixtures/my_product_fixture.php
rename to lib/Cake/tests/fixtures/my_product_fixture.php
diff --git a/cake/tests/fixtures/my_user_fixture.php b/lib/Cake/tests/fixtures/my_user_fixture.php
similarity index 100%
rename from cake/tests/fixtures/my_user_fixture.php
rename to lib/Cake/tests/fixtures/my_user_fixture.php
diff --git a/cake/tests/fixtures/node_fixture.php b/lib/Cake/tests/fixtures/node_fixture.php
similarity index 100%
rename from cake/tests/fixtures/node_fixture.php
rename to lib/Cake/tests/fixtures/node_fixture.php
diff --git a/cake/tests/fixtures/number_tree_fixture.php b/lib/Cake/tests/fixtures/number_tree_fixture.php
similarity index 100%
rename from cake/tests/fixtures/number_tree_fixture.php
rename to lib/Cake/tests/fixtures/number_tree_fixture.php
diff --git a/cake/tests/fixtures/number_tree_two_fixture.php b/lib/Cake/tests/fixtures/number_tree_two_fixture.php
similarity index 100%
rename from cake/tests/fixtures/number_tree_two_fixture.php
rename to lib/Cake/tests/fixtures/number_tree_two_fixture.php
diff --git a/cake/tests/fixtures/numeric_article_fixture.php b/lib/Cake/tests/fixtures/numeric_article_fixture.php
similarity index 100%
rename from cake/tests/fixtures/numeric_article_fixture.php
rename to lib/Cake/tests/fixtures/numeric_article_fixture.php
diff --git a/cake/tests/fixtures/overall_favorite_fixture.php b/lib/Cake/tests/fixtures/overall_favorite_fixture.php
similarity index 100%
rename from cake/tests/fixtures/overall_favorite_fixture.php
rename to lib/Cake/tests/fixtures/overall_favorite_fixture.php
diff --git a/cake/tests/fixtures/person_fixture.php b/lib/Cake/tests/fixtures/person_fixture.php
similarity index 100%
rename from cake/tests/fixtures/person_fixture.php
rename to lib/Cake/tests/fixtures/person_fixture.php
diff --git a/cake/tests/fixtures/portfolio_fixture.php b/lib/Cake/tests/fixtures/portfolio_fixture.php
similarity index 100%
rename from cake/tests/fixtures/portfolio_fixture.php
rename to lib/Cake/tests/fixtures/portfolio_fixture.php
diff --git a/cake/tests/fixtures/post_fixture.php b/lib/Cake/tests/fixtures/post_fixture.php
similarity index 100%
rename from cake/tests/fixtures/post_fixture.php
rename to lib/Cake/tests/fixtures/post_fixture.php
diff --git a/cake/tests/fixtures/posts_tag_fixture.php b/lib/Cake/tests/fixtures/posts_tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/posts_tag_fixture.php
rename to lib/Cake/tests/fixtures/posts_tag_fixture.php
diff --git a/cake/tests/fixtures/primary_model_fixture.php b/lib/Cake/tests/fixtures/primary_model_fixture.php
similarity index 100%
rename from cake/tests/fixtures/primary_model_fixture.php
rename to lib/Cake/tests/fixtures/primary_model_fixture.php
diff --git a/cake/tests/fixtures/product_fixture.php b/lib/Cake/tests/fixtures/product_fixture.php
similarity index 100%
rename from cake/tests/fixtures/product_fixture.php
rename to lib/Cake/tests/fixtures/product_fixture.php
diff --git a/cake/tests/fixtures/product_update_all_fixture.php b/lib/Cake/tests/fixtures/product_update_all_fixture.php
similarity index 100%
rename from cake/tests/fixtures/product_update_all_fixture.php
rename to lib/Cake/tests/fixtures/product_update_all_fixture.php
diff --git a/cake/tests/fixtures/project_fixture.php b/lib/Cake/tests/fixtures/project_fixture.php
similarity index 100%
rename from cake/tests/fixtures/project_fixture.php
rename to lib/Cake/tests/fixtures/project_fixture.php
diff --git a/cake/tests/fixtures/rss.xml b/lib/Cake/tests/fixtures/rss.xml
similarity index 100%
rename from cake/tests/fixtures/rss.xml
rename to lib/Cake/tests/fixtures/rss.xml
diff --git a/cake/tests/fixtures/sample.xml b/lib/Cake/tests/fixtures/sample.xml
similarity index 100%
rename from cake/tests/fixtures/sample.xml
rename to lib/Cake/tests/fixtures/sample.xml
diff --git a/cake/tests/fixtures/sample_fixture.php b/lib/Cake/tests/fixtures/sample_fixture.php
similarity index 100%
rename from cake/tests/fixtures/sample_fixture.php
rename to lib/Cake/tests/fixtures/sample_fixture.php
diff --git a/cake/tests/fixtures/secondary_model_fixture.php b/lib/Cake/tests/fixtures/secondary_model_fixture.php
similarity index 100%
rename from cake/tests/fixtures/secondary_model_fixture.php
rename to lib/Cake/tests/fixtures/secondary_model_fixture.php
diff --git a/cake/tests/fixtures/session_fixture.php b/lib/Cake/tests/fixtures/session_fixture.php
similarity index 100%
rename from cake/tests/fixtures/session_fixture.php
rename to lib/Cake/tests/fixtures/session_fixture.php
diff --git a/cake/tests/fixtures/soap_request.xml b/lib/Cake/tests/fixtures/soap_request.xml
similarity index 100%
rename from cake/tests/fixtures/soap_request.xml
rename to lib/Cake/tests/fixtures/soap_request.xml
diff --git a/cake/tests/fixtures/soap_response.xml b/lib/Cake/tests/fixtures/soap_response.xml
similarity index 100%
rename from cake/tests/fixtures/soap_response.xml
rename to lib/Cake/tests/fixtures/soap_response.xml
diff --git a/cake/tests/fixtures/something_else_fixture.php b/lib/Cake/tests/fixtures/something_else_fixture.php
similarity index 100%
rename from cake/tests/fixtures/something_else_fixture.php
rename to lib/Cake/tests/fixtures/something_else_fixture.php
diff --git a/cake/tests/fixtures/something_fixture.php b/lib/Cake/tests/fixtures/something_fixture.php
similarity index 100%
rename from cake/tests/fixtures/something_fixture.php
rename to lib/Cake/tests/fixtures/something_fixture.php
diff --git a/cake/tests/fixtures/stories_tag_fixture.php b/lib/Cake/tests/fixtures/stories_tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/stories_tag_fixture.php
rename to lib/Cake/tests/fixtures/stories_tag_fixture.php
diff --git a/cake/tests/fixtures/story_fixture.php b/lib/Cake/tests/fixtures/story_fixture.php
similarity index 100%
rename from cake/tests/fixtures/story_fixture.php
rename to lib/Cake/tests/fixtures/story_fixture.php
diff --git a/cake/tests/fixtures/syfile_fixture.php b/lib/Cake/tests/fixtures/syfile_fixture.php
similarity index 100%
rename from cake/tests/fixtures/syfile_fixture.php
rename to lib/Cake/tests/fixtures/syfile_fixture.php
diff --git a/cake/tests/fixtures/tag_fixture.php b/lib/Cake/tests/fixtures/tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/tag_fixture.php
rename to lib/Cake/tests/fixtures/tag_fixture.php
diff --git a/cake/tests/fixtures/test_plugin_article_fixture.php b/lib/Cake/tests/fixtures/test_plugin_article_fixture.php
similarity index 100%
rename from cake/tests/fixtures/test_plugin_article_fixture.php
rename to lib/Cake/tests/fixtures/test_plugin_article_fixture.php
diff --git a/cake/tests/fixtures/test_plugin_comment_fixture.php b/lib/Cake/tests/fixtures/test_plugin_comment_fixture.php
similarity index 100%
rename from cake/tests/fixtures/test_plugin_comment_fixture.php
rename to lib/Cake/tests/fixtures/test_plugin_comment_fixture.php
diff --git a/cake/tests/fixtures/the_paper_monkies_fixture.php b/lib/Cake/tests/fixtures/the_paper_monkies_fixture.php
similarity index 100%
rename from cake/tests/fixtures/the_paper_monkies_fixture.php
rename to lib/Cake/tests/fixtures/the_paper_monkies_fixture.php
diff --git a/cake/tests/fixtures/thread_fixture.php b/lib/Cake/tests/fixtures/thread_fixture.php
similarity index 100%
rename from cake/tests/fixtures/thread_fixture.php
rename to lib/Cake/tests/fixtures/thread_fixture.php
diff --git a/cake/tests/fixtures/translate_article_fixture.php b/lib/Cake/tests/fixtures/translate_article_fixture.php
similarity index 100%
rename from cake/tests/fixtures/translate_article_fixture.php
rename to lib/Cake/tests/fixtures/translate_article_fixture.php
diff --git a/cake/tests/fixtures/translate_fixture.php b/lib/Cake/tests/fixtures/translate_fixture.php
similarity index 100%
rename from cake/tests/fixtures/translate_fixture.php
rename to lib/Cake/tests/fixtures/translate_fixture.php
diff --git a/cake/tests/fixtures/translate_table_fixture.php b/lib/Cake/tests/fixtures/translate_table_fixture.php
similarity index 100%
rename from cake/tests/fixtures/translate_table_fixture.php
rename to lib/Cake/tests/fixtures/translate_table_fixture.php
diff --git a/cake/tests/fixtures/translate_with_prefix_fixture.php b/lib/Cake/tests/fixtures/translate_with_prefix_fixture.php
similarity index 100%
rename from cake/tests/fixtures/translate_with_prefix_fixture.php
rename to lib/Cake/tests/fixtures/translate_with_prefix_fixture.php
diff --git a/cake/tests/fixtures/translated_article_fixture.php b/lib/Cake/tests/fixtures/translated_article_fixture.php
similarity index 100%
rename from cake/tests/fixtures/translated_article_fixture.php
rename to lib/Cake/tests/fixtures/translated_article_fixture.php
diff --git a/cake/tests/fixtures/translated_item_fixture.php b/lib/Cake/tests/fixtures/translated_item_fixture.php
similarity index 100%
rename from cake/tests/fixtures/translated_item_fixture.php
rename to lib/Cake/tests/fixtures/translated_item_fixture.php
diff --git a/cake/tests/fixtures/unconventional_tree_fixture.php b/lib/Cake/tests/fixtures/unconventional_tree_fixture.php
similarity index 100%
rename from cake/tests/fixtures/unconventional_tree_fixture.php
rename to lib/Cake/tests/fixtures/unconventional_tree_fixture.php
diff --git a/cake/tests/fixtures/underscore_field_fixture.php b/lib/Cake/tests/fixtures/underscore_field_fixture.php
similarity index 100%
rename from cake/tests/fixtures/underscore_field_fixture.php
rename to lib/Cake/tests/fixtures/underscore_field_fixture.php
diff --git a/cake/tests/fixtures/user_fixture.php b/lib/Cake/tests/fixtures/user_fixture.php
similarity index 100%
rename from cake/tests/fixtures/user_fixture.php
rename to lib/Cake/tests/fixtures/user_fixture.php
diff --git a/cake/tests/fixtures/uuid_fixture.php b/lib/Cake/tests/fixtures/uuid_fixture.php
similarity index 100%
rename from cake/tests/fixtures/uuid_fixture.php
rename to lib/Cake/tests/fixtures/uuid_fixture.php
diff --git a/cake/tests/fixtures/uuid_tag_fixture.php b/lib/Cake/tests/fixtures/uuid_tag_fixture.php
similarity index 100%
rename from cake/tests/fixtures/uuid_tag_fixture.php
rename to lib/Cake/tests/fixtures/uuid_tag_fixture.php
diff --git a/cake/tests/fixtures/uuid_tree_fixture.php b/lib/Cake/tests/fixtures/uuid_tree_fixture.php
similarity index 100%
rename from cake/tests/fixtures/uuid_tree_fixture.php
rename to lib/Cake/tests/fixtures/uuid_tree_fixture.php
diff --git a/cake/tests/fixtures/uuiditem_fixture.php b/lib/Cake/tests/fixtures/uuiditem_fixture.php
similarity index 100%
rename from cake/tests/fixtures/uuiditem_fixture.php
rename to lib/Cake/tests/fixtures/uuiditem_fixture.php
diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php b/lib/Cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php
similarity index 100%
rename from cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php
rename to lib/Cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php
diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php b/lib/Cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php
similarity index 100%
rename from cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php
rename to lib/Cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php
diff --git a/cake/tests/fixtures/uuidportfolio_fixture.php b/lib/Cake/tests/fixtures/uuidportfolio_fixture.php
similarity index 100%
rename from cake/tests/fixtures/uuidportfolio_fixture.php
rename to lib/Cake/tests/fixtures/uuidportfolio_fixture.php
diff --git a/cake/tests/test_app/config/acl.ini.php b/lib/Cake/tests/test_app/config/acl.ini.php
similarity index 100%
rename from cake/tests/test_app/config/acl.ini.php
rename to lib/Cake/tests/test_app/config/acl.ini.php
diff --git a/cake/tests/test_app/config/empty.php b/lib/Cake/tests/test_app/config/empty.php
similarity index 100%
rename from cake/tests/test_app/config/empty.php
rename to lib/Cake/tests/test_app/config/empty.php
diff --git a/cake/tests/test_app/config/nested.ini b/lib/Cake/tests/test_app/config/nested.ini
similarity index 100%
rename from cake/tests/test_app/config/nested.ini
rename to lib/Cake/tests/test_app/config/nested.ini
diff --git a/cake/tests/test_app/config/var_test.php b/lib/Cake/tests/test_app/config/var_test.php
similarity index 100%
rename from cake/tests/test_app/config/var_test.php
rename to lib/Cake/tests/test_app/config/var_test.php
diff --git a/cake/tests/test_app/console/shells/sample.php b/lib/Cake/tests/test_app/console/shells/sample.php
similarity index 100%
rename from cake/tests/test_app/console/shells/sample.php
rename to lib/Cake/tests/test_app/console/shells/sample.php
diff --git a/cake/tests/test_app/console/shells/tasks/empty b/lib/Cake/tests/test_app/console/shells/tasks/empty
similarity index 100%
rename from cake/tests/test_app/console/shells/tasks/empty
rename to lib/Cake/tests/test_app/console/shells/tasks/empty
diff --git a/cake/tests/test_app/console/templates/test/classes/test_object.ctp b/lib/Cake/tests/test_app/console/templates/test/classes/test_object.ctp
similarity index 100%
rename from cake/tests/test_app/console/templates/test/classes/test_object.ctp
rename to lib/Cake/tests/test_app/console/templates/test/classes/test_object.ctp
diff --git a/cake/tests/test_app/controllers/components/empty b/lib/Cake/tests/test_app/controllers/components/empty
similarity index 100%
rename from cake/tests/test_app/controllers/components/empty
rename to lib/Cake/tests/test_app/controllers/components/empty
diff --git a/cake/tests/test_app/controllers/tests_apps_controller.php b/lib/Cake/tests/test_app/controllers/tests_apps_controller.php
similarity index 100%
rename from cake/tests/test_app/controllers/tests_apps_controller.php
rename to lib/Cake/tests/test_app/controllers/tests_apps_controller.php
diff --git a/cake/tests/test_app/controllers/tests_apps_posts_controller.php b/lib/Cake/tests/test_app/controllers/tests_apps_posts_controller.php
similarity index 100%
rename from cake/tests/test_app/controllers/tests_apps_posts_controller.php
rename to lib/Cake/tests/test_app/controllers/tests_apps_posts_controller.php
diff --git a/cake/tests/test_app/libs/cache/test_app_cache.php b/lib/Cake/tests/test_app/libs/cache/test_app_cache.php
similarity index 100%
rename from cake/tests/test_app/libs/cache/test_app_cache.php
rename to lib/Cake/tests/test_app/libs/cache/test_app_cache.php
diff --git a/cake/tests/test_app/libs/library.php b/lib/Cake/tests/test_app/libs/library.php
similarity index 100%
rename from cake/tests/test_app/libs/library.php
rename to lib/Cake/tests/test_app/libs/library.php
diff --git a/cake/tests/test_app/libs/log/test_app_log.php b/lib/Cake/tests/test_app/libs/log/test_app_log.php
similarity index 100%
rename from cake/tests/test_app/libs/log/test_app_log.php
rename to lib/Cake/tests/test_app/libs/log/test_app_log.php
diff --git a/cake/tests/test_app/libs/session/test_app_lib_session.php b/lib/Cake/tests/test_app/libs/session/test_app_lib_session.php
similarity index 100%
rename from cake/tests/test_app/libs/session/test_app_lib_session.php
rename to lib/Cake/tests/test_app/libs/session/test_app_lib_session.php
diff --git a/cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom1.po b/lib/Cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom1.po
similarity index 100%
rename from cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom1.po
rename to lib/Cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom1.po
diff --git a/cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom2.po b/lib/Cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom2.po
similarity index 100%
rename from cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom2.po
rename to lib/Cake/tests/test_app/locale/cache_test_po/LC_MESSAGES/dom2.po
diff --git a/cake/tests/test_app/locale/ja_jp/LC_TIME b/lib/Cake/tests/test_app/locale/ja_jp/LC_TIME
similarity index 100%
rename from cake/tests/test_app/locale/ja_jp/LC_TIME
rename to lib/Cake/tests/test_app/locale/ja_jp/LC_TIME
diff --git a/cake/tests/test_app/locale/po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/po/LC_MONETARY/default.po b/lib/Cake/tests/test_app/locale/po/LC_MONETARY/default.po
similarity index 100%
rename from cake/tests/test_app/locale/po/LC_MONETARY/default.po
rename to lib/Cake/tests/test_app/locale/po/LC_MONETARY/default.po
diff --git a/cake/tests/test_app/locale/po/LC_TIME b/lib/Cake/tests/test_app/locale/po/LC_TIME
similarity index 100%
rename from cake/tests/test_app/locale/po/LC_TIME
rename to lib/Cake/tests/test_app/locale/po/LC_TIME
diff --git a/cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_11_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_11_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_12_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_12_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_13_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_13_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_14_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_14_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/core.mo b/lib/Cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/core.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/core.mo
rename to lib/Cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/core.mo
diff --git a/cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/default.mo b/lib/Cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/default.mo
similarity index 100%
rename from cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/default.mo
rename to lib/Cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/default.mo
diff --git a/cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/core.po b/lib/Cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/core.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/core.po
rename to lib/Cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/core.po
diff --git a/cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/default.po b/lib/Cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/default.po
similarity index 100%
rename from cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/default.po
rename to lib/Cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/default.po
diff --git a/cake/tests/test_app/locale/time_test/LC_TIME b/lib/Cake/tests/test_app/locale/time_test/LC_TIME
similarity index 100%
rename from cake/tests/test_app/locale/time_test/LC_TIME
rename to lib/Cake/tests/test_app/locale/time_test/LC_TIME
diff --git a/cake/tests/test_app/models/behaviors/empty b/lib/Cake/tests/test_app/models/behaviors/empty
similarity index 100%
rename from cake/tests/test_app/models/behaviors/empty
rename to lib/Cake/tests/test_app/models/behaviors/empty
diff --git a/cake/tests/test_app/models/behaviors/persister_one_behavior.php b/lib/Cake/tests/test_app/models/behaviors/persister_one_behavior.php
similarity index 100%
rename from cake/tests/test_app/models/behaviors/persister_one_behavior.php
rename to lib/Cake/tests/test_app/models/behaviors/persister_one_behavior.php
diff --git a/cake/tests/test_app/models/behaviors/persister_two_behavior.php b/lib/Cake/tests/test_app/models/behaviors/persister_two_behavior.php
similarity index 100%
rename from cake/tests/test_app/models/behaviors/persister_two_behavior.php
rename to lib/Cake/tests/test_app/models/behaviors/persister_two_behavior.php
diff --git a/cake/tests/test_app/models/comment.php b/lib/Cake/tests/test_app/models/comment.php
similarity index 100%
rename from cake/tests/test_app/models/comment.php
rename to lib/Cake/tests/test_app/models/comment.php
diff --git a/cake/tests/test_app/models/datasources/test/test_local_driver.php b/lib/Cake/tests/test_app/models/datasources/test/test_local_driver.php
similarity index 100%
rename from cake/tests/test_app/models/datasources/test/test_local_driver.php
rename to lib/Cake/tests/test_app/models/datasources/test/test_local_driver.php
diff --git a/cake/tests/test_app/models/datasources/test2_other_source.php b/lib/Cake/tests/test_app/models/datasources/test2_other_source.php
similarity index 100%
rename from cake/tests/test_app/models/datasources/test2_other_source.php
rename to lib/Cake/tests/test_app/models/datasources/test2_other_source.php
diff --git a/cake/tests/test_app/models/datasources/test2_source.php b/lib/Cake/tests/test_app/models/datasources/test2_source.php
similarity index 100%
rename from cake/tests/test_app/models/datasources/test2_source.php
rename to lib/Cake/tests/test_app/models/datasources/test2_source.php
diff --git a/cake/tests/test_app/models/persister_one.php b/lib/Cake/tests/test_app/models/persister_one.php
similarity index 100%
rename from cake/tests/test_app/models/persister_one.php
rename to lib/Cake/tests/test_app/models/persister_one.php
diff --git a/cake/tests/test_app/models/persister_two.php b/lib/Cake/tests/test_app/models/persister_two.php
similarity index 100%
rename from cake/tests/test_app/models/persister_two.php
rename to lib/Cake/tests/test_app/models/persister_two.php
diff --git a/cake/tests/test_app/models/post.php b/lib/Cake/tests/test_app/models/post.php
similarity index 100%
rename from cake/tests/test_app/models/post.php
rename to lib/Cake/tests/test_app/models/post.php
diff --git a/cake/tests/test_app/plugins/plugin_js/webroot/js/one/plugin_one.js b/lib/Cake/tests/test_app/plugins/plugin_js/webroot/js/one/plugin_one.js
similarity index 100%
rename from cake/tests/test_app/plugins/plugin_js/webroot/js/one/plugin_one.js
rename to lib/Cake/tests/test_app/plugins/plugin_js/webroot/js/one/plugin_one.js
diff --git a/cake/tests/test_app/plugins/plugin_js/webroot/js/plugin_js.js b/lib/Cake/tests/test_app/plugins/plugin_js/webroot/js/plugin_js.js
similarity index 100%
rename from cake/tests/test_app/plugins/plugin_js/webroot/js/plugin_js.js
rename to lib/Cake/tests/test_app/plugins/plugin_js/webroot/js/plugin_js.js
diff --git a/cake/tests/test_app/plugins/test_plugin/config/load.php b/lib/Cake/tests/test_app/plugins/test_plugin/config/load.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/config/load.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/config/load.php
diff --git a/cake/tests/test_app/plugins/test_plugin/config/more.load.php b/lib/Cake/tests/test_app/plugins/test_plugin/config/more.load.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/config/more.load.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/config/more.load.php
diff --git a/cake/tests/test_app/plugins/test_plugin/config/schema/schema.php b/lib/Cake/tests/test_app/plugins/test_plugin/config/schema/schema.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/config/schema/schema.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/config/schema/schema.php
diff --git a/cake/tests/test_app/plugins/test_plugin/console/shells/example.php b/lib/Cake/tests/test_app/plugins/test_plugin/console/shells/example.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/console/shells/example.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/console/shells/example.php
diff --git a/cake/tests/test_app/plugins/test_plugin/console/shells/tasks/empty b/lib/Cake/tests/test_app/plugins/test_plugin/console/shells/tasks/empty
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/console/shells/tasks/empty
rename to lib/Cake/tests/test_app/plugins/test_plugin/console/shells/tasks/empty
diff --git a/cake/tests/test_app/plugins/test_plugin/console/shells/tasks/other_task.php b/lib/Cake/tests/test_app/plugins/test_plugin/console/shells/tasks/other_task.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/console/shells/tasks/other_task.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/console/shells/tasks/other_task.php
diff --git a/cake/tests/test_app/plugins/test_plugin/console/templates/empty b/lib/Cake/tests/test_app/plugins/test_plugin/console/templates/empty
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/console/templates/empty
rename to lib/Cake/tests/test_app/plugins/test_plugin/console/templates/empty
diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php b/lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php
diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php b/lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php
diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php b/lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php
diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php b/lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php
diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php b/lib/Cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php
diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php b/lib/Cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php
diff --git a/cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php b/lib/Cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php
diff --git a/cake/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php b/lib/Cake/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php
diff --git a/cake/tests/test_app/plugins/test_plugin/libs/session/test_plugin_session.php b/lib/Cake/tests/test_app/plugins/test_plugin/libs/session/test_plugin_session.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/libs/session/test_plugin_session.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/libs/session/test_plugin_session.php
diff --git a/cake/tests/test_app/plugins/test_plugin/libs/test_plugin_library.php b/lib/Cake/tests/test_app/plugins/test_plugin/libs/test_plugin_library.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/libs/test_plugin_library.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/libs/test_plugin_library.php
diff --git a/cake/tests/test_app/plugins/test_plugin/locale/po/LC_MESSAGES/test_plugin.po b/lib/Cake/tests/test_app/plugins/test_plugin/locale/po/LC_MESSAGES/test_plugin.po
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/locale/po/LC_MESSAGES/test_plugin.po
rename to lib/Cake/tests/test_app/plugins/test_plugin/locale/po/LC_MESSAGES/test_plugin.po
diff --git a/cake/tests/test_app/plugins/test_plugin/locale/po/LC_MONETARY/test_plugin.po b/lib/Cake/tests/test_app/plugins/test_plugin/locale/po/LC_MONETARY/test_plugin.po
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/locale/po/LC_MONETARY/test_plugin.po
rename to lib/Cake/tests/test_app/plugins/test_plugin/locale/po/LC_MONETARY/test_plugin.po
diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/datasources/test_other_source.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/test_other_source.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/datasources/test_other_source.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/test_other_source.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/datasources/test_source.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/test_source.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/datasources/test_source.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/test_source.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php
diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php
diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php b/lib/Cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php
diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php b/lib/Cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php
diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php b/lib/Cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php
diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php b/lib/Cake/tests/test_app/plugins/test_plugin/vendors/welcome.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/vendors/welcome.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/vendors/welcome.php
diff --git a/cake/tests/test_app/plugins/test_plugin/views/elements/plugin_element.ctp b/lib/Cake/tests/test_app/plugins/test_plugin/views/elements/plugin_element.ctp
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/elements/plugin_element.ctp
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/elements/plugin_element.ctp
diff --git a/cake/tests/test_app/plugins/test_plugin/views/elements/test_plugin_element.ctp b/lib/Cake/tests/test_app/plugins/test_plugin/views/elements/test_plugin_element.ctp
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/elements/test_plugin_element.ctp
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/elements/test_plugin_element.ctp
diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php b/lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php
diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php b/lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php
diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/test_plugin_app.php b/lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/test_plugin_app.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/helpers/test_plugin_app.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/test_plugin_app.php
diff --git a/cake/tests/test_app/plugins/test_plugin/views/layouts/default.ctp b/lib/Cake/tests/test_app/plugins/test_plugin/views/layouts/default.ctp
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/layouts/default.ctp
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/layouts/default.ctp
diff --git a/cake/tests/test_app/plugins/test_plugin/views/tests/index.ctp b/lib/Cake/tests/test_app/plugins/test_plugin/views/tests/index.ctp
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/tests/index.ctp
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/tests/index.ctp
diff --git a/cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp b/lib/Cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/css/test_plugin_asset.css b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/css/test_plugin_asset.css
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/css/test_plugin_asset.css
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/css/test_plugin_asset.css
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/css/theme_one.htc b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/css/theme_one.htc
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/css/theme_one.htc
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/css/theme_one.htc
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/css/unknown.extension b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/css/unknown.extension
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/css/unknown.extension
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/css/unknown.extension
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/flash/plugin_test.swf b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/flash/plugin_test.swf
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/flash/plugin_test.swf
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/flash/plugin_test.swf
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/img/cake.icon.gif b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/img/cake.icon.gif
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/img/cake.icon.gif
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/img/cake.icon.gif
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/js/test_plugin/test.js b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/js/test_plugin/test.js
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/js/test_plugin/test.js
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/js/test_plugin/test.js
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/pdfs/plugin_test.pdf b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/pdfs/plugin_test.pdf
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/pdfs/plugin_test.pdf
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/pdfs/plugin_test.pdf
diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/root.js b/lib/Cake/tests/test_app/plugins/test_plugin/webroot/root.js
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/webroot/root.js
rename to lib/Cake/tests/test_app/plugins/test_plugin/webroot/root.js
diff --git a/cake/tests/test_app/plugins/test_plugin_two/console/shells/example.php b/lib/Cake/tests/test_app/plugins/test_plugin_two/console/shells/example.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin_two/console/shells/example.php
rename to lib/Cake/tests/test_app/plugins/test_plugin_two/console/shells/example.php
diff --git a/cake/tests/test_app/plugins/test_plugin_two/console/shells/tasks/empty b/lib/Cake/tests/test_app/plugins/test_plugin_two/console/shells/tasks/empty
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin_two/console/shells/tasks/empty
rename to lib/Cake/tests/test_app/plugins/test_plugin_two/console/shells/tasks/empty
diff --git a/cake/tests/test_app/plugins/test_plugin_two/console/shells/welcome.php b/lib/Cake/tests/test_app/plugins/test_plugin_two/console/shells/welcome.php
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin_two/console/shells/welcome.php
rename to lib/Cake/tests/test_app/plugins/test_plugin_two/console/shells/welcome.php
diff --git a/cake/tests/test_app/plugins/test_plugin_two/console/templates/empty b/lib/Cake/tests/test_app/plugins/test_plugin_two/console/templates/empty
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin_two/console/templates/empty
rename to lib/Cake/tests/test_app/plugins/test_plugin_two/console/templates/empty
diff --git a/cake/tests/test_app/tmp/dir_map b/lib/Cake/tests/test_app/tmp/dir_map
similarity index 100%
rename from cake/tests/test_app/tmp/dir_map
rename to lib/Cake/tests/test_app/tmp/dir_map
diff --git a/cake/tests/test_app/vendors/Test/MyTest.php b/lib/Cake/tests/test_app/vendors/Test/MyTest.php
similarity index 100%
rename from cake/tests/test_app/vendors/Test/MyTest.php
rename to lib/Cake/tests/test_app/vendors/Test/MyTest.php
diff --git a/cake/tests/test_app/vendors/Test/hello.php b/lib/Cake/tests/test_app/vendors/Test/hello.php
similarity index 100%
rename from cake/tests/test_app/vendors/Test/hello.php
rename to lib/Cake/tests/test_app/vendors/Test/hello.php
diff --git a/cake/tests/test_app/vendors/css/test_asset.css b/lib/Cake/tests/test_app/vendors/css/test_asset.css
similarity index 100%
rename from cake/tests/test_app/vendors/css/test_asset.css
rename to lib/Cake/tests/test_app/vendors/css/test_asset.css
diff --git a/cake/tests/test_app/vendors/img/test.jpg b/lib/Cake/tests/test_app/vendors/img/test.jpg
similarity index 100%
rename from cake/tests/test_app/vendors/img/test.jpg
rename to lib/Cake/tests/test_app/vendors/img/test.jpg
diff --git a/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php b/lib/Cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php
similarity index 100%
rename from cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php
rename to lib/Cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php
diff --git a/cake/tests/test_app/vendors/somename/some.name.php b/lib/Cake/tests/test_app/vendors/somename/some.name.php
similarity index 100%
rename from cake/tests/test_app/vendors/somename/some.name.php
rename to lib/Cake/tests/test_app/vendors/somename/some.name.php
diff --git a/cake/tests/test_app/vendors/welcome.php b/lib/Cake/tests/test_app/vendors/welcome.php
similarity index 100%
rename from cake/tests/test_app/vendors/welcome.php
rename to lib/Cake/tests/test_app/vendors/welcome.php
diff --git a/cake/tests/test_app/views/elements/email/html/custom.ctp b/lib/Cake/tests/test_app/views/elements/email/html/custom.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/email/html/custom.ctp
rename to lib/Cake/tests/test_app/views/elements/email/html/custom.ctp
diff --git a/cake/tests/test_app/views/elements/email/html/default.ctp b/lib/Cake/tests/test_app/views/elements/email/html/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/email/html/default.ctp
rename to lib/Cake/tests/test_app/views/elements/email/html/default.ctp
diff --git a/cake/tests/test_app/views/elements/email/text/custom.ctp b/lib/Cake/tests/test_app/views/elements/email/text/custom.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/email/text/custom.ctp
rename to lib/Cake/tests/test_app/views/elements/email/text/custom.ctp
diff --git a/cake/tests/test_app/views/elements/email/text/default.ctp b/lib/Cake/tests/test_app/views/elements/email/text/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/email/text/default.ctp
rename to lib/Cake/tests/test_app/views/elements/email/text/default.ctp
diff --git a/cake/tests/test_app/views/elements/email/text/wide.ctp b/lib/Cake/tests/test_app/views/elements/email/text/wide.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/email/text/wide.ctp
rename to lib/Cake/tests/test_app/views/elements/email/text/wide.ctp
diff --git a/cake/tests/test_app/views/elements/empty b/lib/Cake/tests/test_app/views/elements/empty
similarity index 100%
rename from cake/tests/test_app/views/elements/empty
rename to lib/Cake/tests/test_app/views/elements/empty
diff --git a/cake/tests/test_app/views/elements/nocache/contains_nocache.ctp b/lib/Cake/tests/test_app/views/elements/nocache/contains_nocache.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/nocache/contains_nocache.ctp
rename to lib/Cake/tests/test_app/views/elements/nocache/contains_nocache.ctp
diff --git a/cake/tests/test_app/views/elements/nocache/plain.ctp b/lib/Cake/tests/test_app/views/elements/nocache/plain.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/nocache/plain.ctp
rename to lib/Cake/tests/test_app/views/elements/nocache/plain.ctp
diff --git a/cake/tests/test_app/views/elements/nocache/sub1.ctp b/lib/Cake/tests/test_app/views/elements/nocache/sub1.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/nocache/sub1.ctp
rename to lib/Cake/tests/test_app/views/elements/nocache/sub1.ctp
diff --git a/cake/tests/test_app/views/elements/nocache/sub2.ctp b/lib/Cake/tests/test_app/views/elements/nocache/sub2.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/nocache/sub2.ctp
rename to lib/Cake/tests/test_app/views/elements/nocache/sub2.ctp
diff --git a/cake/tests/test_app/views/elements/session_helper.ctp b/lib/Cake/tests/test_app/views/elements/session_helper.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/session_helper.ctp
rename to lib/Cake/tests/test_app/views/elements/session_helper.ctp
diff --git a/cake/tests/test_app/views/elements/test_element.ctp b/lib/Cake/tests/test_app/views/elements/test_element.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/test_element.ctp
rename to lib/Cake/tests/test_app/views/elements/test_element.ctp
diff --git a/cake/tests/test_app/views/errors/empty b/lib/Cake/tests/test_app/views/errors/empty
similarity index 100%
rename from cake/tests/test_app/views/errors/empty
rename to lib/Cake/tests/test_app/views/errors/empty
diff --git a/cake/tests/test_app/views/helpers/banana.php b/lib/Cake/tests/test_app/views/helpers/banana.php
similarity index 100%
rename from cake/tests/test_app/views/helpers/banana.php
rename to lib/Cake/tests/test_app/views/helpers/banana.php
diff --git a/cake/tests/test_app/views/helpers/empty b/lib/Cake/tests/test_app/views/helpers/empty
similarity index 100%
rename from cake/tests/test_app/views/helpers/empty
rename to lib/Cake/tests/test_app/views/helpers/empty
diff --git a/cake/tests/test_app/views/layouts/ajax.ctp b/lib/Cake/tests/test_app/views/layouts/ajax.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/ajax.ctp
rename to lib/Cake/tests/test_app/views/layouts/ajax.ctp
diff --git a/cake/tests/test_app/views/layouts/ajax2.ctp b/lib/Cake/tests/test_app/views/layouts/ajax2.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/ajax2.ctp
rename to lib/Cake/tests/test_app/views/layouts/ajax2.ctp
diff --git a/cake/tests/test_app/views/layouts/cache_empty_sections.ctp b/lib/Cake/tests/test_app/views/layouts/cache_empty_sections.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/cache_empty_sections.ctp
rename to lib/Cake/tests/test_app/views/layouts/cache_empty_sections.ctp
diff --git a/cake/tests/test_app/views/layouts/cache_layout.ctp b/lib/Cake/tests/test_app/views/layouts/cache_layout.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/cache_layout.ctp
rename to lib/Cake/tests/test_app/views/layouts/cache_layout.ctp
diff --git a/cake/tests/test_app/views/layouts/default.ctp b/lib/Cake/tests/test_app/views/layouts/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/default.ctp
rename to lib/Cake/tests/test_app/views/layouts/default.ctp
diff --git a/cake/tests/test_app/views/layouts/email/html/default.ctp b/lib/Cake/tests/test_app/views/layouts/email/html/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/email/html/default.ctp
rename to lib/Cake/tests/test_app/views/layouts/email/html/default.ctp
diff --git a/cake/tests/test_app/views/layouts/email/html/thin.ctp b/lib/Cake/tests/test_app/views/layouts/email/html/thin.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/email/html/thin.ctp
rename to lib/Cake/tests/test_app/views/layouts/email/html/thin.ctp
diff --git a/cake/tests/test_app/views/layouts/email/text/default.ctp b/lib/Cake/tests/test_app/views/layouts/email/text/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/email/text/default.ctp
rename to lib/Cake/tests/test_app/views/layouts/email/text/default.ctp
diff --git a/cake/tests/test_app/views/layouts/flash.ctp b/lib/Cake/tests/test_app/views/layouts/flash.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/flash.ctp
rename to lib/Cake/tests/test_app/views/layouts/flash.ctp
diff --git a/cake/tests/test_app/views/layouts/js/default.ctp b/lib/Cake/tests/test_app/views/layouts/js/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/js/default.ctp
rename to lib/Cake/tests/test_app/views/layouts/js/default.ctp
diff --git a/cake/tests/test_app/views/layouts/multi_cache.ctp b/lib/Cake/tests/test_app/views/layouts/multi_cache.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/multi_cache.ctp
rename to lib/Cake/tests/test_app/views/layouts/multi_cache.ctp
diff --git a/cake/tests/test_app/views/layouts/rss/default.ctp b/lib/Cake/tests/test_app/views/layouts/rss/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/rss/default.ctp
rename to lib/Cake/tests/test_app/views/layouts/rss/default.ctp
diff --git a/cake/tests/test_app/views/layouts/xml/default.ctp b/lib/Cake/tests/test_app/views/layouts/xml/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/xml/default.ctp
rename to lib/Cake/tests/test_app/views/layouts/xml/default.ctp
diff --git a/cake/tests/test_app/views/pages/empty b/lib/Cake/tests/test_app/views/pages/empty
similarity index 100%
rename from cake/tests/test_app/views/pages/empty
rename to lib/Cake/tests/test_app/views/pages/empty
diff --git a/cake/tests/test_app/views/pages/extract.ctp b/lib/Cake/tests/test_app/views/pages/extract.ctp
similarity index 100%
rename from cake/tests/test_app/views/pages/extract.ctp
rename to lib/Cake/tests/test_app/views/pages/extract.ctp
diff --git a/cake/tests/test_app/views/pages/home.ctp b/lib/Cake/tests/test_app/views/pages/home.ctp
similarity index 100%
rename from cake/tests/test_app/views/pages/home.ctp
rename to lib/Cake/tests/test_app/views/pages/home.ctp
diff --git a/cake/tests/test_app/views/posts/cache_empty_sections.ctp b/lib/Cake/tests/test_app/views/posts/cache_empty_sections.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/cache_empty_sections.ctp
rename to lib/Cake/tests/test_app/views/posts/cache_empty_sections.ctp
diff --git a/cake/tests/test_app/views/posts/cache_form.ctp b/lib/Cake/tests/test_app/views/posts/cache_form.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/cache_form.ctp
rename to lib/Cake/tests/test_app/views/posts/cache_form.ctp
diff --git a/cake/tests/test_app/views/posts/helper_overwrite.ctp b/lib/Cake/tests/test_app/views/posts/helper_overwrite.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/helper_overwrite.ctp
rename to lib/Cake/tests/test_app/views/posts/helper_overwrite.ctp
diff --git a/cake/tests/test_app/views/posts/index.ctp b/lib/Cake/tests/test_app/views/posts/index.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/index.ctp
rename to lib/Cake/tests/test_app/views/posts/index.ctp
diff --git a/cake/tests/test_app/views/posts/multiple_nocache.ctp b/lib/Cake/tests/test_app/views/posts/multiple_nocache.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/multiple_nocache.ctp
rename to lib/Cake/tests/test_app/views/posts/multiple_nocache.ctp
diff --git a/cake/tests/test_app/views/posts/nocache_multiple_element.ctp b/lib/Cake/tests/test_app/views/posts/nocache_multiple_element.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/nocache_multiple_element.ctp
rename to lib/Cake/tests/test_app/views/posts/nocache_multiple_element.ctp
diff --git a/cake/tests/test_app/views/posts/scaffold.edit.ctp b/lib/Cake/tests/test_app/views/posts/scaffold.edit.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/scaffold.edit.ctp
rename to lib/Cake/tests/test_app/views/posts/scaffold.edit.ctp
diff --git a/cake/tests/test_app/views/posts/sequencial_nocache.ctp b/lib/Cake/tests/test_app/views/posts/sequencial_nocache.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/sequencial_nocache.ctp
rename to lib/Cake/tests/test_app/views/posts/sequencial_nocache.ctp
diff --git a/cake/tests/test_app/views/posts/test_nocache_tags.ctp b/lib/Cake/tests/test_app/views/posts/test_nocache_tags.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/test_nocache_tags.ctp
rename to lib/Cake/tests/test_app/views/posts/test_nocache_tags.ctp
diff --git a/cake/tests/test_app/views/scaffolds/empty b/lib/Cake/tests/test_app/views/scaffolds/empty
similarity index 100%
rename from cake/tests/test_app/views/scaffolds/empty
rename to lib/Cake/tests/test_app/views/scaffolds/empty
diff --git a/cake/tests/test_app/views/tests_apps/index.ctp b/lib/Cake/tests/test_app/views/tests_apps/index.ctp
similarity index 100%
rename from cake/tests/test_app/views/tests_apps/index.ctp
rename to lib/Cake/tests/test_app/views/tests_apps/index.ctp
diff --git a/cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp b/lib/Cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp
rename to lib/Cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp
diff --git a/cake/tests/test_app/views/themed/test_theme/layouts/default.ctp b/lib/Cake/tests/test_app/views/themed/test_theme/layouts/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/layouts/default.ctp
rename to lib/Cake/tests/test_app/views/themed/test_theme/layouts/default.ctp
diff --git a/cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/layouts/plugin_default.ctp b/lib/Cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/layouts/plugin_default.ctp
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/layouts/plugin_default.ctp
rename to lib/Cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/layouts/plugin_default.ctp
diff --git a/cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/tests/index.ctp b/lib/Cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/tests/index.ctp
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/tests/index.ctp
rename to lib/Cake/tests/test_app/views/themed/test_theme/plugins/test_plugin/tests/index.ctp
diff --git a/cake/tests/test_app/views/themed/test_theme/posts/index.ctp b/lib/Cake/tests/test_app/views/themed/test_theme/posts/index.ctp
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/posts/index.ctp
rename to lib/Cake/tests/test_app/views/themed/test_theme/posts/index.ctp
diff --git a/cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp b/lib/Cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp
rename to lib/Cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/css/test_asset.css b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/css/test_asset.css
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/css/test_asset.css
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/css/test_asset.css
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/css/theme_webroot.css
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/flash/theme_test.swf b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/flash/theme_test.swf
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/flash/theme_test.swf
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/flash/theme_test.swf
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/img/cake.power.gif b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/img/cake.power.gif
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/img/cake.power.gif
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/img/cake.power.gif
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/img/test.jpg b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/img/test.jpg
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/img/test.jpg
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/img/test.jpg
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/js/one/theme_one.js b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/js/one/theme_one.js
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/js/one/theme_one.js
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/js/one/theme_one.js
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/js/theme.js b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/js/theme.js
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/js/theme.js
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/js/theme.js
diff --git a/cake/tests/test_app/views/themed/test_theme/webroot/pdfs/theme_test.pdf b/lib/Cake/tests/test_app/views/themed/test_theme/webroot/pdfs/theme_test.pdf
similarity index 100%
rename from cake/tests/test_app/views/themed/test_theme/webroot/pdfs/theme_test.pdf
rename to lib/Cake/tests/test_app/views/themed/test_theme/webroot/pdfs/theme_test.pdf
diff --git a/cake/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css b/lib/Cake/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css
similarity index 100%
rename from cake/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css
rename to lib/Cake/tests/test_app/webroot/theme/test_theme/css/theme_webroot.css
diff --git a/cake/tests/test_app/webroot/theme/test_theme/css/webroot_test.css b/lib/Cake/tests/test_app/webroot/theme/test_theme/css/webroot_test.css
similarity index 100%
rename from cake/tests/test_app/webroot/theme/test_theme/css/webroot_test.css
rename to lib/Cake/tests/test_app/webroot/theme/test_theme/css/webroot_test.css
diff --git a/cake/tests/test_app/webroot/theme/test_theme/img/cake.power.gif b/lib/Cake/tests/test_app/webroot/theme/test_theme/img/cake.power.gif
similarity index 100%
rename from cake/tests/test_app/webroot/theme/test_theme/img/cake.power.gif
rename to lib/Cake/tests/test_app/webroot/theme/test_theme/img/cake.power.gif
diff --git a/cake/tests/test_app/webroot/theme/test_theme/img/test.jpg b/lib/Cake/tests/test_app/webroot/theme/test_theme/img/test.jpg
similarity index 100%
rename from cake/tests/test_app/webroot/theme/test_theme/img/test.jpg
rename to lib/Cake/tests/test_app/webroot/theme/test_theme/img/test.jpg
From 848461f7a0d82e39b06969f9adf5728be97e5b9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Wed, 8 Dec 2010 01:49:36 -0430
Subject: [PATCH 056/668] Making the testsuite run again
---
lib/Cake/Console/Command/Task/ExtractTask.php | 2 +-
lib/Cake/Console/Command/TestSuiteShell.php | 10 +++++-----
lib/Cake/Model/ConnectionManager.php | 2 +-
lib/Cake/TestSuite/CakeTestCase.php | 6 +++---
.../TestSuite/Fixture/CakeFixtureManager.php | 19 ++-----------------
lib/Cake/TestSuite/Fixture/CakeTestModel.php | 3 ++-
lib/Cake/TestSuite/TestManager.php | 10 +++++-----
lib/Cake/TestSuite/TestRunner.php | 2 +-
lib/Cake/tests/cases/libs/xml.test.php | 3 ++-
9 files changed, 22 insertions(+), 35 deletions(-)
diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php
index 89af9153c..e79df6b8d 100644
--- a/lib/Cake/Console/Command/Task/ExtractTask.php
+++ b/lib/Cake/Console/Command/Task/ExtractTask.php
@@ -114,7 +114,7 @@ class ExtractTask extends Shell {
$this->__paths = explode(',', $this->params['paths']);
} else {
$defaultPath = APP_PATH;
- $message = __("What is the full path you would like to extract?\nExample: %s\n[Q]uit [D]one", $this->Dispatch->params['root'] . DS . 'myapp');
+ $message = __("What is the full path you would like to extract?\nExample: %s\n[Q]uit [D]one", $defaultPath);
while (true) {
$response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') {
diff --git a/lib/Cake/Console/Command/TestSuiteShell.php b/lib/Cake/Console/Command/TestSuiteShell.php
index 8814242a2..3b3b1f901 100644
--- a/lib/Cake/Console/Command/TestSuiteShell.php
+++ b/lib/Cake/Console/Command/TestSuiteShell.php
@@ -19,6 +19,11 @@
* @since CakePHP(tm) v 1.2.0.4433
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('CakeTestSuiteDispatcher', 'TestSuite');
+App::uses('TestRunner', 'TestSuite');
+App::uses('TestManager', 'TestSuite');
+
class TestSuiteShell extends Shell {
/**
@@ -155,8 +160,6 @@ class TestSuiteShell extends Shell {
* @return void
*/
public function initialize() {
- require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_test_suite_dispatcher.php';
-
$corePath = App::core('cake');
if (isset($corePath[0])) {
define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
@@ -166,7 +169,6 @@ class TestSuiteShell extends Shell {
$this->_dispatcher = new CakeTestSuiteDispatcher();
$this->_dispatcher->loadTestFramework();
- require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php';
}
/**
@@ -252,8 +254,6 @@ class TestSuiteShell extends Shell {
* @return void
*/
protected function run($runnerArgs, $options = array()) {
- require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_runner.php';
-
restore_error_handler();
restore_error_handler();
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index 208d6ba9d..324dcf554 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -230,7 +230,7 @@ class ConnectionManager {
if (!empty(self::$config->{$name})) {
self::$_connectionsEnum[$name] = self::_connectionData(self::$config->{$name});
} else {
- throw new MissingConnectionException(array('class' => 'ConnectionManager'));
+ throw new MissingConnectionException(array('class' => $name));
}
}
diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php
index 184dc7912..95819c5e1 100644
--- a/lib/Cake/TestSuite/CakeTestCase.php
+++ b/lib/Cake/TestSuite/CakeTestCase.php
@@ -20,9 +20,9 @@
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
-require_once CAKE_TESTS_LIB . 'cake_fixture_manager.php';
-require_once CAKE_TESTS_LIB . 'cake_test_model.php';
-require_once CAKE_TESTS_LIB . 'cake_test_fixture.php';
+App::uses('CakeFixtureManager', 'TestSuite/Fixture');
+App::uses('CakeTestModel', 'TestSuite/Fixture');
+App::uses('CakeTestFixture', 'TestSuite/Fixture');
/**
* CakeTestCase class
diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
index 099da5557..ea09473e7 100644
--- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
+++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
@@ -55,7 +55,7 @@ class CakeFixtureManager {
* @param CakeTestCase $test the test case to inspect
* @return void
*/
- public function fixturize(CakeTestCase $test) {
+ public function fixturize($test) {
if (empty($test->fixtures) || !empty($this->_processed[get_class($test)])) {
$test->db = $this->_db;
return;
@@ -81,22 +81,7 @@ class CakeFixtureManager {
if ($this->_initialized) {
return;
}
- $testDbAvailable = in_array('test', array_keys(ConnectionManager::enumConnectionObjects()));
-
- $_prefix = null;
-
- if ($testDbAvailable) {
- // Try for test DB
- @$db = ConnectionManager::getDataSource('test');
- $testDbAvailable = $db->isConnected();
- } else {
- throw new MissingConnectionException(__('You need to create a $test datasource connection to start using fixtures'));
- }
-
- if (!$testDbAvailable) {
- throw new MissingConnectionException(__('Unable to connect to the $test datasource'));
- }
-
+ $db = ConnectionManager::getDataSource('test');
$this->_db = $db;
ClassRegistry::config(array('ds' => 'test'));
$this->_initialized = true;
diff --git a/lib/Cake/TestSuite/Fixture/CakeTestModel.php b/lib/Cake/TestSuite/Fixture/CakeTestModel.php
index 819c3cbe2..6c7d3d4b3 100644
--- a/lib/Cake/TestSuite/Fixture/CakeTestModel.php
+++ b/lib/Cake/TestSuite/Fixture/CakeTestModel.php
@@ -17,7 +17,8 @@
* @since CakePHP(tm) v 1.2.0.4667
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once LIBS.'model'.DS.'model.php';
+
+App::uses('Model', 'Model');
/**
* Short description for class.
diff --git a/lib/Cake/TestSuite/TestManager.php b/lib/Cake/TestSuite/TestManager.php
index f4f5b4571..cf56a20b7 100644
--- a/lib/Cake/TestSuite/TestManager.php
+++ b/lib/Cake/TestSuite/TestManager.php
@@ -17,13 +17,15 @@
* @since CakePHP(tm) v 1.2.0.4433
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-define('CORE_TEST_CASES', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'cases');
-define('CORE_TEST_GROUPS', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'groups');
+define('CORE_TEST_CASES', LIBS . 'tests' . DS . 'cases');
+define('CORE_TEST_GROUPS', LIBS . 'tests' . DS . 'groups');
define('APP_TEST_CASES', TESTS . 'cases');
define('APP_TEST_GROUPS', TESTS . 'groups');
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
-require_once CAKE_TESTS_LIB . 'cake_test_suite.php';
+App::uses('CakeTestSuite', 'TestSuite');
+App::uses('CakeTestCase', 'TestSuite');
+App::uses('CakeFixtureManager', 'TestSuite/Fixture');
/**
* TestManager is the base class that handles loading and initiating the running
@@ -88,8 +90,6 @@ class TestManager {
* @return void
*/
public function __construct($params = array()) {
- require_once(CAKE_TESTS_LIB . 'cake_test_case.php');
-
$this->params = $params;
if (isset($params['app'])) {
$this->appTest = true;
diff --git a/lib/Cake/TestSuite/TestRunner.php b/lib/Cake/TestSuite/TestRunner.php
index c2ca7f809..afd299e3a 100644
--- a/lib/Cake/TestSuite/TestRunner.php
+++ b/lib/Cake/TestSuite/TestRunner.php
@@ -20,7 +20,7 @@
require 'PHPUnit/TextUI/Command.php';
-require_once 'test_manager.php';
+App::uses('TestManager', 'TestSuite');
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
diff --git a/lib/Cake/tests/cases/libs/xml.test.php b/lib/Cake/tests/cases/libs/xml.test.php
index 666a4f45d..ee00efd2b 100644
--- a/lib/Cake/tests/cases/libs/xml.test.php
+++ b/lib/Cake/tests/cases/libs/xml.test.php
@@ -17,7 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5432
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Xml');
+App::uses('Xml', 'Utility');
+App::uses('CakeTestModel', 'TestSuite/Fixture');
/**
* Article class
From b8344ecd3389e355eaa41e36afbe52085fd9d2b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Wed, 8 Dec 2010 23:15:18 -0430
Subject: [PATCH 057/668] Replacing some of the App::import by App::uses
---
lib/Cake/Console/Command/AclShell.php | 4 +--
lib/Cake/Console/Command/ApiShell.php | 2 +-
lib/Cake/Console/Command/BakeShell.php | 9 ++++--
lib/Cake/Console/Command/ConsoleShell.php | 2 +-
.../Console/Command/Task/ControllerTask.php | 6 ++--
.../Console/Command/Task/DbConfigTask.php | 2 +-
lib/Cake/Console/Command/Task/FixtureTask.php | 6 ++--
lib/Cake/Console/Command/Task/ModelTask.php | 2 +-
lib/Cake/Console/Command/Task/PluginTask.php | 3 +-
lib/Cake/Console/Command/Task/ViewTask.php | 14 +++++----
lib/Cake/Console/ConsoleErrorHandler.php | 2 +-
.../Controller/Component/AclComponent.php | 2 +-
.../Controller/Component/EmailComponent.php | 6 ++--
.../Component/RequestHandlerComponent.php | 3 +-
lib/Cake/Controller/Controller.php | 4 +--
lib/Cake/Core/App.php | 6 ++--
lib/Cake/Error/ErrorHandler.php | 2 +-
lib/Cake/Error/ExceptionRenderer.php | 5 ++--
lib/Cake/I18n/I18n.php | 2 +-
lib/Cake/I18n/Multibyte.php | 2 +-
lib/Cake/Model/BehaviorCollection.php | 7 +----
lib/Cake/Model/CakeSchema.php | 6 ++--
lib/Cake/Model/Datasource/DboSource.php | 3 +-
lib/Cake/Utility/Set.php | 2 +-
lib/Cake/View/pages/home.ctp | 2 +-
lib/Cake/basics.php | 4 +--
lib/Cake/tests/cases/basics.test.php | 3 +-
.../console/libs/task_collection.test.php | 4 +--
.../tests/cases/console/shells/acl.test.php | 6 ++--
.../tests/cases/console/shells/api.test.php | 7 ++---
.../tests/cases/console/shells/bake.test.php | 16 +++++-----
.../console/shells/command_list.test.php | 2 +-
.../cases/console/shells/schema.test.php | 9 ++----
.../tests/cases/console/shells/shell.test.php | 6 ++--
.../console/shells/tasks/controller.test.php | 30 ++++++++-----------
.../console/shells/tasks/db_config.test.php | 7 ++---
.../console/shells/tasks/extract.test.php | 8 ++---
.../console/shells/tasks/fixture.test.php | 12 ++++----
.../cases/console/shells/tasks/model.test.php | 12 ++++----
.../console/shells/tasks/plugin.test.php | 13 ++++----
.../console/shells/tasks/project.test.php | 9 +++---
.../console/shells/tasks/template.test.php | 7 ++---
.../cases/console/shells/tasks/test.test.php | 15 ++++------
43 files changed, 127 insertions(+), 147 deletions(-)
diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php
index e29e4f4ef..04aaa4936 100644
--- a/lib/Cake/Console/Command/AclShell.php
+++ b/lib/Cake/Console/Command/AclShell.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Component', 'Acl');
-App::import('Model', 'DbAcl');
+App::uses('AclComponent', 'Controller/Component');
+App::uses('DbAcl', 'Model');
/**
* Shell for ACL management. This console is known to have issues with zend.ze1_compatibility_mode
diff --git a/lib/Cake/Console/Command/ApiShell.php b/lib/Cake/Console/Command/ApiShell.php
index 0c036d09d..a9a436a29 100644
--- a/lib/Cake/Console/Command/ApiShell.php
+++ b/lib/Cake/Console/Command/ApiShell.php
@@ -19,7 +19,7 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'File');
+App::uses('File', 'Utility');
/**
* API shell to show method signatures of CakePHP core classes.
diff --git a/lib/Cake/Console/Command/BakeShell.php b/lib/Cake/Console/Command/BakeShell.php
index 77dd36201..ed09609f0 100644
--- a/lib/Cake/Console/Command/BakeShell.php
+++ b/lib/Cake/Console/Command/BakeShell.php
@@ -22,6 +22,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Model', 'Model');
+
/**
* Bake is a command-line code generation utility for automating programmer chores.
*
@@ -151,11 +153,11 @@ class BakeShell extends Shell {
$modelExists = false;
$model = $this->_modelName($name);
- if (App::import('Model', $model)) {
+ App::uses($model, 'Model');
+ if (class_exists($model)) {
$object = new $model();
$modelExists = true;
} else {
- App::import('Model', 'Model', false);
$object = new Model(array('name' => $name, 'ds' => $this->connection));
}
@@ -176,7 +178,8 @@ class BakeShell extends Shell {
$this->Controller->bakeTest($controller);
}
}
- if (App::import('Controller', $controller)) {
+ App::uses($controller . 'Controller', 'Controller')
+ if (class_exists($controller . 'Controller')) {
$this->View->args = array($controller);
$this->View->execute();
}
diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php
index 404c348ed..5cedf5a97 100644
--- a/lib/Cake/Console/Command/ConsoleShell.php
+++ b/lib/Cake/Console/Command/ConsoleShell.php
@@ -56,11 +56,11 @@ class ConsoleShell extends Shell {
App::uses('Dispatcher', 'Routing');
$this->Dispatcher = new Dispatcher();
$this->models = App::objects('model');
- App::import('Model', $this->models);
foreach ($this->models as $model) {
$class = Inflector::camelize(str_replace('.php', '', $model));
$this->models[$model] = $class;
+ App::uses($class, 'Model');
$this->{$class} = new $class();
}
$this->out('Model classes:');
diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php
index 46f512365..449a3aa84 100644
--- a/lib/Cake/Console/Command/Task/ControllerTask.php
+++ b/lib/Cake/Console/Command/Task/ControllerTask.php
@@ -108,7 +108,8 @@ class ControllerTask extends BakeTask {
foreach ($this->__tables as $table) {
$model = $this->_modelName($table);
$controller = $this->_controllerName($model);
- if (App::import('Model', $model)) {
+ App::uses($model, 'Model');
+ if (!class_exists($model)) {
$actions = $this->bakeActions($controller);
if ($this->bake($controller, $actions) && $unitTestExists) {
$this->bakeTest($controller);
@@ -273,7 +274,8 @@ class ControllerTask extends BakeTask {
if ($plugin) {
$modelImport = $plugin . '.' . $modelImport;
}
- if (!App::import('Model', $modelImport)) {
+ App::uses($modelImport, 'Model');
+ if (!class_exists($modelImport)) {
$this->err(__('You must have a model for this class to build basic methods. Please try again.'));
$this->_stop();
}
diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php
index a98b6b053..9f866b1c1 100644
--- a/lib/Cake/Console/Command/Task/DbConfigTask.php
+++ b/lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -353,7 +353,7 @@ class DbConfigTask extends Shell {
* @return void
*/
public function getConfig() {
- App::import('Model', 'ConnectionManager', false);
+ App::uses('ConnectionManager', 'Model');
$useDbConfig = 'default';
$configs = get_class_vars($this->databaseClassName);
diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php
index cc081c84c..2e0a4c31e 100644
--- a/lib/Cake/Console/Command/Task/FixtureTask.php
+++ b/lib/Cake/Console/Command/Task/FixtureTask.php
@@ -19,6 +19,7 @@
*/
App::uses('BakeTask', 'Console/Command/Task');
+App::uses('Model', 'Model');
/**
* Task class for creating and updating fixtures files.
@@ -186,9 +187,7 @@ class FixtureTask extends BakeTask {
* @return string Baked fixture content
*/
public function bake($model, $useTable = false, $importOptions = array()) {
- if (!class_exists('CakeSchema')) {
- App::import('Model', 'CakeSchema', false);
- }
+ App::uses('CakeSchema', 'Model');
$table = $schema = $records = $import = $modelImport = $recordImport = null;
if (!$useTable) {
$useTable = Inflector::tableize($model);
@@ -394,7 +393,6 @@ class FixtureTask extends BakeTask {
} else {
$condition = 'WHERE 1=1 LIMIT ' . (isset($this->params['count']) ? $this->params['count'] : 10);
}
- App::import('Model', 'Model', false);
$modelObject = new Model(array('name' => $modelName, 'table' => $useTable, 'ds' => $this->connection));
$records = $modelObject->find('all', array(
'conditions' => $condition,
diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php
index c893de33a..e0bc29378 100644
--- a/lib/Cake/Console/Command/Task/ModelTask.php
+++ b/lib/Cake/Console/Command/Task/ModelTask.php
@@ -20,6 +20,7 @@
App::uses('BakeTask', 'Console/Command/Task');
App::uses('ConnectionManager', 'Model');
+App::uses('Model', 'Model');
/**
* Task class for creating and updating model files.
@@ -74,7 +75,6 @@ class ModelTask extends BakeTask {
*
*/
public function execute() {
- App::import('Model', 'Model', false);
parent::execute();
if (empty($this->args)) {
diff --git a/lib/Cake/Console/Command/Task/PluginTask.php b/lib/Cake/Console/Command/Task/PluginTask.php
index 6ae7bd5cb..84c296623 100644
--- a/lib/Cake/Console/Command/Task/PluginTask.php
+++ b/lib/Cake/Console/Command/Task/PluginTask.php
@@ -17,7 +17,8 @@
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'File');
+
+App::uses('File', 'Utility');
/**
* Task class for creating a plugin
diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php
index fc3baa8ae..106ba864a 100644
--- a/lib/Cake/Console/Command/Task/ViewTask.php
+++ b/lib/Cake/Console/Command/Task/ViewTask.php
@@ -191,7 +191,8 @@ class ViewTask extends BakeTask {
$model = $this->_modelName($table);
$this->controllerName = $this->_controllerName($model);
$this->controllerPath = Inflector::underscore($this->controllerName);
- if (App::import('Model', $model)) {
+ App::uses($model, 'Model');
+ if (class_exists($model)) {
$vars = $this->__loadController();
if (!$actions) {
$actions = $this->_methodsToBake();
@@ -272,17 +273,18 @@ class ViewTask extends BakeTask {
$this->err(__('Controller not found'));
}
- $import = $this->controllerName;
+ $plugin = null;
if ($this->plugin) {
- $import = $this->plugin . '.' . $this->controllerName;
+ $plugin = $this->plugin . '.';
}
- if (!App::import('Controller', $import)) {
- $file = $this->controllerPath . '_controller.php';
+ $controllerClassName = $this->controllerName . 'Controller';
+ App::uses($controllerName, $plugin . 'Controller');
+ if (!class_exists($controllerClassName)) {
+ $file = $controllerClassName . '.php';
$this->err(__("The file '%s' could not be found.\nIn order to bake a view, you'll need to first create the controller.", $file));
$this->_stop();
}
- $controllerClassName = $this->controllerName . 'Controller';
$controllerObj = new $controllerClassName();
$controllerObj->plugin = $this->plugin;
$controllerObj->constructClasses();
diff --git a/lib/Cake/Console/ConsoleErrorHandler.php b/lib/Cake/Console/ConsoleErrorHandler.php
index 9eaebb2e5..dbd84aa99 100644
--- a/lib/Cake/Console/ConsoleErrorHandler.php
+++ b/lib/Cake/Console/ConsoleErrorHandler.php
@@ -19,6 +19,7 @@
*/
App::uses('ErrorHandler', 'Error');
App::uses('ConsoleOutput', 'Console');
+App::uses('CakeLog', 'Log');
/**
* Error Handler for Cake console. Does simple printing of the
@@ -79,7 +80,6 @@ class ConsoleErrorHandler extends ErrorHandler {
$stderr->write(__("%s Error: %s\n", $name, $message));
if (Configure::read('debug') == 0) {
- App::import('Core', 'CakeLog');
CakeLog::write($log, $message);
}
}
diff --git a/lib/Cake/Controller/Component/AclComponent.php b/lib/Cake/Controller/Component/AclComponent.php
index 3a09c590b..7fc8a0a10 100644
--- a/lib/Cake/Controller/Component/AclComponent.php
+++ b/lib/Cake/Controller/Component/AclComponent.php
@@ -662,7 +662,7 @@ class IniAcl extends Object implements AclInterface {
* @return array INI section structure
*/
public function readConfigFile($filename) {
- App::import('Core', 'config/IniReader');
+ App::uses('IniReader', 'Configure');
$iniFile = new IniReader(dirname($filename) . DS);
return $iniFile->read(basename($filename));
}
diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php
index 47ab6775b..9a3aa9f9b 100755
--- a/lib/Cake/Controller/Component/EmailComponent.php
+++ b/lib/Cake/Controller/Component/EmailComponent.php
@@ -433,9 +433,9 @@ class EmailComponent extends Component {
$viewClass = $this->Controller->view;
if ($viewClass != 'View') {
- list($plugin, $viewClass) = pluginSplit($viewClass);
+ list($plugin, $viewClass) = pluginSplit($viewClass, true);
$viewClass = $viewClass . 'View';
- App::import('View', $this->Controller->view);
+ App::uses($viewClass, $plugin . 'View');
}
$View = new $viewClass($this->Controller, false);
@@ -810,7 +810,7 @@ class EmailComponent extends Component {
* @access private
*/
function _smtp() {
- App::import('Core', 'CakeSocket');
+ App::uses('CakeSocket', 'Network');
$defaults = array(
'host' => 'localhost',
diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php
index 4928c945a..4f5cc3dfe 100644
--- a/lib/Cake/Controller/Component/RequestHandlerComponent.php
+++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php
@@ -542,7 +542,8 @@ class RequestHandlerComponent extends Component {
);
if (!$isAdded) {
- if (App::import('Helper', $helper)) {
+ App::uses($helper . 'Helper', 'Helper');
+ if (class_exists($helper . 'Helper')) {
$controller->helpers[] = $helper;
}
}
diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php
index c423a9227..68b255fc7 100644
--- a/lib/Cake/Controller/Controller.php
+++ b/lib/Cake/Controller/Controller.php
@@ -789,9 +789,9 @@ class Controller extends Object {
$viewClass = $this->view;
if ($this->view != 'View') {
- list($plugin, $viewClass) = pluginSplit($viewClass);
+ list($plugin, $viewClass) = pluginSplit($viewClass, true);
$viewClass = $viewClass . 'View';
- App::import('View', $this->view);
+ App::uses($viewClass, $plugin . 'View');
}
$this->request->params['models'] = $this->modelNames;
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index f22d8925d..2e4383ac8 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -23,8 +23,8 @@
* ### Adding paths
*
* You can add paths to the search indexes App uses to find classes using `App::build()`. Adding
- * additional controller paths for example would alter where CakePHP looks for controllers when you
- * call App::import('Controller', 'Posts'); This allows you to split your application up across the filesystem.
+ * additional controller paths for example would alter where CakePHP looks for controllers.
+ * This allows you to split your application up across the filesystem.
*
* ### Inspecting loaded paths
*
@@ -261,7 +261,7 @@ class App {
'View' => array(VIEWS),
'View/Helper' => array(HELPERS),
'locales' => array(APP . 'locale' . DS),
- 'shells' => array(
+ 'Console' => array(
APP . 'console' . DS . 'shells' . DS,
APP . 'vendors' . DS . 'shells' . DS,
VENDORS . 'shells' . DS
diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php
index 5124136c2..1af6cc156 100644
--- a/lib/Cake/Error/ErrorHandler.php
+++ b/lib/Cake/Error/ErrorHandler.php
@@ -113,7 +113,7 @@ class ErrorHandler {
CakeLog::write(LOG_ERR, '[' . get_class($exception) . '] ' . $exception->getMessage());
}
if ($config['renderer'] !== 'ExceptionRenderer') {
- App::import('Lib', $config['renderer']);
+ App::uses($config['renderer'], 'Error');
}
$error = new $config['renderer']($exception);
$error->render();
diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php
index 1ea26c502..5b5289d29 100644
--- a/lib/Cake/Error/ExceptionRenderer.php
+++ b/lib/Cake/Error/ExceptionRenderer.php
@@ -20,6 +20,9 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::import('Sanitize', 'Utility');
+
/**
* Exception Renderer.
*
@@ -88,8 +91,6 @@ class ExceptionRenderer {
* @param array $messages Error messages
*/
function __construct(Exception $exception) {
- App::import('Core', 'Sanitize');
-
$this->controller = $this->_getController($exception);
if (method_exists($this->controller, 'apperror')) {
diff --git a/lib/Cake/I18n/I18n.php b/lib/Cake/I18n/I18n.php
index b85d9b75b..b899a7cab 100644
--- a/lib/Cake/I18n/I18n.php
+++ b/lib/Cake/I18n/I18n.php
@@ -101,7 +101,7 @@ class I18n {
/**
* Used by the translation functions in basics.php
- * Can also be used like I18n::translate(); but only if the App::import('I18n'); has been used to load the class.
+ * Returns a translated string based on current language and translation files stored in locale folder
*
* @param string $singular String to translate
* @param string $plural Plural string (if any)
diff --git a/lib/Cake/I18n/Multibyte.php b/lib/Cake/I18n/Multibyte.php
index 69c23188f..b1045e7b7 100644
--- a/lib/Cake/I18n/Multibyte.php
+++ b/lib/Cake/I18n/Multibyte.php
@@ -1078,7 +1078,7 @@ class Multibyte {
return null;
}
if (!Configure::configured('_cake_core_')) {
- App::import('Core', 'config/PhpReader');
+ App::uses('PhpReader', 'Configure');
Configure::config('_cake_core_', new PhpReader(CAKE . 'config' . DS));
}
Configure::load('unicode' . DS . 'casefolding' . DS . $range, '_cake_core_');
diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php
index 05fad7db9..064e9a37d 100644
--- a/lib/Cake/Model/BehaviorCollection.php
+++ b/lib/Cake/Model/BehaviorCollection.php
@@ -94,12 +94,7 @@ class BehaviorCollection extends ObjectCollection {
list($plugin, $name) = pluginSplit($behavior);
$class = $name . 'Behavior';
- if (!App::import('Behavior', $behavior)) {
- throw new MissingBehaviorFileException(array(
- 'file' => Inflector::underscore($behavior) . '.php',
- 'class' => $class
- ));
- }
+ App::uses($class, 'Model/Behavior');
if (!class_exists($class)) {
throw new MissingBehaviorClassException(array(
'file' => Inflector::underscore($behavior) . '.php',
diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php
index 17bc19f84..df7601308 100644
--- a/lib/Cake/Model/CakeSchema.php
+++ b/lib/Cake/Model/CakeSchema.php
@@ -207,9 +207,8 @@ class CakeSchema extends Object {
));
$db = ConnectionManager::getDataSource($connection);
- App::import('Model', 'AppModel');
if (isset($this->plugin)) {
- App::import('Model', Inflector::camelize($this->plugin) . 'AppModel');
+ App::uses(Inflector::camelize($this->plugin) . 'AppModel', $this->plugin . '.Model');
}
$tables = array();
@@ -234,7 +233,8 @@ class CakeSchema extends Object {
if (isset($this->plugin)) {
$importModel = $this->plugin . '.' . $model;
}
- if (!App::import('Model', $importModel)) {
+ App::uses($importModel, 'Model');
+ if (!class_exists($importModel)) {
continue;
}
$vars = get_class_vars($model);
diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php
index a11f4fcd8..83c962a32 100755
--- a/lib/Cake/Model/Datasource/DboSource.php
+++ b/lib/Cake/Model/Datasource/DboSource.php
@@ -17,7 +17,9 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
App::uses('String', 'Utility');
+App::uses('View', 'View');
/**
* DboSource
@@ -763,7 +765,6 @@ class DboSource extends DataSource {
return;
}
if (PHP_SAPI != 'cli') {
- App::import('Core', 'View');
$controller = null;
$View = new View($controller, false);
$View->set('logs', array($this->configKeyName => $log));
diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php
index ff2af8519..9fbdc8218 100644
--- a/lib/Cake/Utility/Set.php
+++ b/lib/Cake/Utility/Set.php
@@ -585,7 +585,7 @@ class Set {
if (is_string($path) && strpos($path, '{') !== false) {
$path = String::tokenize($path, '.', '{', '}');
- } else {
+ } elseif (is_string($path)) {
$path = explode('.', $path);
}
$tmp = array();
diff --git a/lib/Cake/View/pages/home.ctp b/lib/Cake/View/pages/home.ctp
index d861c5c12..9beb7b0d0 100644
--- a/lib/Cake/View/pages/home.ctp
+++ b/lib/Cake/View/pages/home.ctp
@@ -24,7 +24,7 @@ endif;
0):
- Debugger::checkSecurityKeys();
+ //Debugger::checkSecurityKeys();
endif;
?>
diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php
index 287f0fc20..2d23d220d 100644
--- a/lib/Cake/basics.php
+++ b/lib/Cake/basics.php
@@ -670,9 +670,7 @@ if (!function_exists('sortByKey')) {
* @param string $message Message to write to log
*/
function LogError($message) {
- if (!class_exists('CakeLog')) {
- App::import('Core', 'CakeLog');
- }
+ App::uses('CakeLog', 'Log');
$bad = array("\n", "\r", "\t");
$good = ' ';
CakeLog::write('error', str_replace($bad, $good, $message));
diff --git a/lib/Cake/tests/cases/basics.test.php b/lib/Cake/tests/cases/basics.test.php
index f6051717b..b3b028cd4 100644
--- a/lib/Cake/tests/cases/basics.test.php
+++ b/lib/Cake/tests/cases/basics.test.php
@@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
require_once CAKE . 'basics.php';
-App::import('Core', 'Folder');
+App::uses('Folder', 'Utility');
/**
* BasicsTest class
diff --git a/lib/Cake/tests/cases/console/libs/task_collection.test.php b/lib/Cake/tests/cases/console/libs/task_collection.test.php
index da7d6eaef..b918469e6 100644
--- a/lib/Cake/tests/cases/console/libs/task_collection.test.php
+++ b/lib/Cake/tests/cases/console/libs/task_collection.test.php
@@ -18,8 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'TaskCollection', false);
-App::import('Shell', 'Shell', false);
+App::uses('TaskCollection', 'Console');
+App::uses('Shell', 'Console');
class TaskCollectionTest extends CakeTestCase {
/**
diff --git a/lib/Cake/tests/cases/console/shells/acl.test.php b/lib/Cake/tests/cases/console/shells/acl.test.php
index 0bb6489b1..7a0270084 100644
--- a/lib/Cake/tests/cases/console/shells/acl.test.php
+++ b/lib/Cake/tests/cases/console/shells/acl.test.php
@@ -17,10 +17,10 @@
* @since CakePHP v 1.2.0.7726
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'Acl');
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('AclShell', 'Console/Command');
/**
* AclShellTest class
diff --git a/lib/Cake/tests/cases/console/shells/api.test.php b/lib/Cake/tests/cases/console/shells/api.test.php
index 82f134552..4c76f4aa8 100644
--- a/lib/Cake/tests/cases/console/shells/api.test.php
+++ b/lib/Cake/tests/cases/console/shells/api.test.php
@@ -17,11 +17,10 @@
* @since CakePHP v 1.2.0.7726
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'Api');
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('ApiShell', 'Console/Command');
/**
* ApiShellTest class
diff --git a/lib/Cake/tests/cases/console/shells/bake.test.php b/lib/Cake/tests/cases/console/shells/bake.test.php
index 6f68e8bb3..f627c069a 100644
--- a/lib/Cake/tests/cases/console/shells/bake.test.php
+++ b/lib/Cake/tests/cases/console/shells/bake.test.php
@@ -18,14 +18,14 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'Bake', false);
-App::import('Shell', 'tasks/model', false);
-App::import('Shell', 'tasks/controller', false);
-App::import('Shell', 'tasks/db_config', false);
-App::import('Core', 'Controller');
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('BakeShell', 'Console/Command');
+App::uses('ModelTask', 'Console/Command/Task');
+App::uses('ControllerTask', 'Console/Command/Task');
+App::uses('DbConfigTask', 'Console/Command/Task');
+App::uses('Controller', 'Controller');
if (!class_exists('UsersController')) {
class UsersController extends Controller {
@@ -76,7 +76,7 @@ class BakeShellTest extends CakeTestCase {
* @return void
*/
public function testAllWithModelName() {
- App::import('Model', 'User');
+ App::uses('User', 'Model');
$userExists = class_exists('User');
if ($this->skipIf($userExists, 'User class exists, cannot test `bake all [param]`. %s')) {
return;
diff --git a/lib/Cake/tests/cases/console/shells/command_list.test.php b/lib/Cake/tests/cases/console/shells/command_list.test.php
index bdabc2230..48fecaaa8 100644
--- a/lib/Cake/tests/cases/console/shells/command_list.test.php
+++ b/lib/Cake/tests/cases/console/shells/command_list.test.php
@@ -17,7 +17,7 @@
* @since CakePHP v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'CommandList', false);
+App::import('CommandListShell', 'Console/Command');
class TestStringOutput extends ConsoleOutput {
diff --git a/lib/Cake/tests/cases/console/shells/schema.test.php b/lib/Cake/tests/cases/console/shells/schema.test.php
index 6a7a619a1..d438335e2 100644
--- a/lib/Cake/tests/cases/console/shells/schema.test.php
+++ b/lib/Cake/tests/cases/console/shells/schema.test.php
@@ -17,13 +17,10 @@
* @since CakePHP v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'Schema', false);
-App::import('Model', 'CakeSchema', false);
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
-
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('CakeSchema', 'Model');
/**
* Test for Schema database management
diff --git a/lib/Cake/tests/cases/console/shells/shell.test.php b/lib/Cake/tests/cases/console/shells/shell.test.php
index 91c623cda..fcd8d4dd6 100644
--- a/lib/Cake/tests/cases/console/shells/shell.test.php
+++ b/lib/Cake/tests/cases/console/shells/shell.test.php
@@ -19,10 +19,10 @@
* @since CakePHP v 1.2.0.7726
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Folder');
-App::import('Shell', 'Shell', false);
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('Folder', 'Utility');
/**
* ShellTestShell class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/controller.test.php b/lib/Cake/tests/cases/console/shells/tasks/controller.test.php
index f3601376e..ef2bd70e0 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/controller.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/controller.test.php
@@ -17,33 +17,27 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ClassRegistry');
-App::import('View', 'Helper', false);
-App::import('Shell', 'Shell', false);
-App::import('Shell', array(
- 'tasks/project',
- 'tasks/controller',
- 'tasks/model',
- 'tasks/template',
- 'tasks/test'
-));
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('CakeSchema', 'Model');
+App::uses('ClassRegistry', 'Utility');
+App::uses('Helper', 'View/Helper');
+App::uses('ProjectTask', 'Console/Command/Task');
+App::uses('ControllerTask', 'Console/Command/Task');
+App::uses('ModelTask', 'Console/Command/Task');
+App::uses('TemplateTask', 'Console/Command/Task');
+App::uses('TestTask', 'Console/Command/Task');
+App::uses('Model', 'Model');
-$imported = App::import('Model', 'BakeArticle');
-$imported = $imported || App::import('Model', 'BakeComment');
-$imported = $imported || App::import('Model', 'BakeTag');
-
-if (!$imported) {
+if (class_exists('BakeArticle')) {
define('ARTICLE_MODEL_CREATED', true);
- App::import('Core', 'Model');
class BakeArticle extends Model {
public $name = 'BakeArticle';
public $hasMany = array('BakeComment');
public $hasAndBelongsToMany = array('BakeTag');
}
-
}
/**
diff --git a/lib/Cake/tests/cases/console/shells/tasks/db_config.test.php b/lib/Cake/tests/cases/console/shells/tasks/db_config.test.php
index aca87ac94..50aa43873 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/db_config.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/db_config.test.php
@@ -17,11 +17,10 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'tasks/DbConfig');
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('DbConfigTask', 'Console/Command/Task');
class TEST_DATABASE_CONFIG {
public $default = array(
diff --git a/lib/Cake/tests/cases/console/shells/tasks/extract.test.php b/lib/Cake/tests/cases/console/shells/tasks/extract.test.php
index 21993e0d4..6d634e5b4 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/extract.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/extract.test.php
@@ -19,11 +19,11 @@
* @since CakePHP v 1.2.0.7726
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Folder');
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'tasks/Extract', false);
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('Folder', 'Utility');
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('ExtractTask', 'Console/Command/Task');
/**
* ExtractTaskTest class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/fixture.test.php b/lib/Cake/tests/cases/console/shells/tasks/fixture.test.php
index 7121f7fd1..c00b4fb94 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/fixture.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/fixture.test.php
@@ -17,14 +17,12 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', array(
- 'tasks/fixture',
- 'tasks/template',
- 'tasks/db_config'
-));
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('FixtureTask', 'Console/Command/Task');
+App::uses('TemplateTask', 'Console/Command/Task');
+App::uses('DbConfigTask', 'Console/Command/Task');
/**
* FixtureTaskTest class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/model.test.php b/lib/Cake/tests/cases/console/shells/tasks/model.test.php
index ac2a2c7fc..fa48d5921 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/model.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/model.test.php
@@ -19,14 +19,12 @@
* @since CakePHP v 1.2.6
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', array(
- 'tasks/model',
- 'tasks/fixture',
- 'tasks/template'
-));
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('FixtureTask', 'Console/Command/Task');
+App::uses('TemplateTask', 'Console/Command/Task');
+App::uses('ModelTask', 'Console/Command/Task');
/**
* ModelTaskTest class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php b/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
index 327b258c2..652159880 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
@@ -19,15 +19,12 @@
* @since CakePHP v 1.3.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', array(
- 'tasks/plugin',
- 'tasks/model'
-));
-App::import('Core', array('File'));
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('PluginTask', 'Console/Command/Task');
+App::uses('ModelTask', 'Console/Command/Task');
+App::import('File', 'Utility');
/**
* PluginTaskPlugin class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/project.test.php b/lib/Cake/tests/cases/console/shells/tasks/project.test.php
index 8e92b7949..63870f4bd 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/project.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/project.test.php
@@ -19,12 +19,11 @@
* @since CakePHP v 1.3.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'tasks/project');
-App::import('Core', 'File');
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('ProjecTask', 'Console/Command/Task');
+App::import('File', 'Utility');
/**
* ProjectTask Test class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/template.test.php b/lib/Cake/tests/cases/console/shells/tasks/template.test.php
index bbd81404d..c2b162dd8 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/template.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/template.test.php
@@ -20,11 +20,10 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'tasks/template');
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('TemplateTask', 'Console/Command/Task');
/**
* TemplateTaskTest class
*
diff --git a/lib/Cake/tests/cases/console/shells/tasks/test.test.php b/lib/Cake/tests/cases/console/shells/tasks/test.test.php
index 14b603e54..4a77aaeab 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/test.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/test.test.php
@@ -19,16 +19,13 @@
* @since CakePHP v 1.2.0.7726
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', array(
- 'tasks/test',
- 'tasks/template'
-));
-App::import('Controller', 'Controller', false);
-App::import('Model', 'Model', false);
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('TestTask', 'Console/Command/Task');
+App::uses('TemplateTask', 'Console/Command/Task');
+App::uses('Controller', 'Controller');
+App::uses('Model', 'Model');
/**
* Test Article model
From f84351dd07f7658598ea90519de46d9f6e80bbdf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Thu, 9 Dec 2010 00:43:11 -0430
Subject: [PATCH 058/668] More replacements of App::import to App::uses
---
lib/Cake/Error/ExceptionRenderer.php | 2 +-
.../cases/console/shells/command_list.test.php | 3 ++-
.../cases/console/shells/tasks/plugin.test.php | 2 +-
.../cases/console/shells/tasks/project.test.php | 2 +-
.../cases/console/shells/tasks/view.test.php | 16 +++++++---------
.../cases/console/shells/testsuite.test.php | 7 ++-----
lib/Cake/tests/cases/libs/cake_log.test.php | 5 +++--
lib/Cake/tests/cases/libs/cake_request.test.php | 7 +++----
lib/Cake/tests/cases/libs/cake_response.test.php | 2 +-
lib/Cake/tests/cases/libs/cake_session.test.php | 5 ++---
lib/Cake/tests/cases/libs/cake_socket.test.php | 3 ++-
.../tests/cases/libs/cake_test_case.test.php | 9 +++++----
.../tests/cases/libs/cake_test_fixture.test.php | 2 +-
.../tests/cases/libs/class_registry.test.php | 2 +-
.../tests/cases/libs/config/ini_reader.test.php | 2 +-
.../tests/cases/libs/config/php_reader.test.php | 2 +-
lib/Cake/tests/cases/libs/configure.test.php | 2 +-
.../cases/libs/controller/component.test.php | 7 ++++---
.../controller/component_collection.test.php | 5 +++--
.../libs/controller/components/acl.test.php | 5 +++--
.../cases/libs/route/redirect_route.test.php | 8 +++++---
lib/Cake/tests/cases/libs/router.test.php | 5 +++--
22 files changed, 53 insertions(+), 50 deletions(-)
diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php
index 5b5289d29..c62e45d7d 100644
--- a/lib/Cake/Error/ExceptionRenderer.php
+++ b/lib/Cake/Error/ExceptionRenderer.php
@@ -21,7 +21,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Sanitize', 'Utility');
+App::uses('Sanitize', 'Utility');
/**
* Exception Renderer.
diff --git a/lib/Cake/tests/cases/console/shells/command_list.test.php b/lib/Cake/tests/cases/console/shells/command_list.test.php
index 48fecaaa8..6f25ed68b 100644
--- a/lib/Cake/tests/cases/console/shells/command_list.test.php
+++ b/lib/Cake/tests/cases/console/shells/command_list.test.php
@@ -17,7 +17,8 @@
* @since CakePHP v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('CommandListShell', 'Console/Command');
+
+App::uses('CommandListShell', 'Console/Command');
class TestStringOutput extends ConsoleOutput {
diff --git a/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php b/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
index 652159880..ad86a6a50 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/plugin.test.php
@@ -24,7 +24,7 @@ App::uses('ShellDispatcher', 'Console');
App::uses('Shell', 'Console');
App::uses('PluginTask', 'Console/Command/Task');
App::uses('ModelTask', 'Console/Command/Task');
-App::import('File', 'Utility');
+App::uses('File', 'Utility');
/**
* PluginTaskPlugin class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/project.test.php b/lib/Cake/tests/cases/console/shells/tasks/project.test.php
index 63870f4bd..cdd27e451 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/project.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/project.test.php
@@ -23,7 +23,7 @@
App::uses('ShellDispatcher', 'Console');
App::uses('Shell', 'Console');
App::uses('ProjecTask', 'Console/Command/Task');
-App::import('File', 'Utility');
+App::uses('File', 'Utility');
/**
* ProjectTask Test class
diff --git a/lib/Cake/tests/cases/console/shells/tasks/view.test.php b/lib/Cake/tests/cases/console/shells/tasks/view.test.php
index 5a2dfcce5..e742bff64 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/view.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/view.test.php
@@ -19,16 +19,14 @@
* @since CakePHP v 1.2.0.7726
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', array(
- 'tasks/view',
- 'tasks/controller',
- 'tasks/template',
- 'tasks/project',
- 'tasks/db_config'
-));
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
+App::uses('ShellDispatcher', 'Console');
+App::uses('Shell', 'Console');
+App::uses('ViewTask', 'Console/Command/Task');
+App::uses('ControllerTask', 'Console/Command/Task');
+App::uses('TemplateTask', 'Console/Command/Task');
+App::uses('ProjectTask', 'Console/Command/Task');
+App::uses('DbConfigTask', 'Console/Command/Task');
/**
* Test View Task Comment Model
diff --git a/lib/Cake/tests/cases/console/shells/testsuite.test.php b/lib/Cake/tests/cases/console/shells/testsuite.test.php
index bfe463dbf..80bd9873a 100644
--- a/lib/Cake/tests/cases/console/shells/testsuite.test.php
+++ b/lib/Cake/tests/cases/console/shells/testsuite.test.php
@@ -18,11 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Shell', 'Shell', false);
-App::import('Shell', 'Testsuite');
-
-require_once CAKE . 'console' . DS . 'shell_dispatcher.php';
-
+App::uses('ShellDispatcher', 'Console');
+App::uses('TestSuiteShell', 'Console/Command');
class TestSuiteShellTest extends CakeTestCase {
diff --git a/lib/Cake/tests/cases/libs/cake_log.test.php b/lib/Cake/tests/cases/libs/cake_log.test.php
index 52c5c5abc..2569eae58 100644
--- a/lib/Cake/tests/cases/libs/cake_log.test.php
+++ b/lib/Cake/tests/cases/libs/cake_log.test.php
@@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2.0.5432
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Log');
-App::import('Core', 'log/FileLog');
+
+App::uses('CakeLog', 'Log');
+App::uses('FileLog', 'Log/Engine');
/**
* CakeLogTest class
diff --git a/lib/Cake/tests/cases/libs/cake_request.test.php b/lib/Cake/tests/cases/libs/cake_request.test.php
index af4ad93cb..28036de43 100644
--- a/lib/Cake/tests/cases/libs/cake_request.test.php
+++ b/lib/Cake/tests/cases/libs/cake_request.test.php
@@ -17,10 +17,9 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (!class_exists('dispatcher')) {
- require CAKE . 'dispatcher.php';
-}
-App::import('Core', 'CakeRequest');
+
+App::uses('Dispatcher', 'Routing')
+App::uses('CakeRequest', 'Network');
class CakeRequestTestCase extends CakeTestCase {
/**
diff --git a/lib/Cake/tests/cases/libs/cake_response.test.php b/lib/Cake/tests/cases/libs/cake_response.test.php
index eee0cfc69..bf43304c8 100644
--- a/lib/Cake/tests/cases/libs/cake_response.test.php
+++ b/lib/Cake/tests/cases/libs/cake_response.test.php
@@ -1,6 +1,6 @@
Date: Thu, 9 Dec 2010 01:25:24 -0430
Subject: [PATCH 059/668] More App::imports converted
---
.../tests/cases/libs/cake_test_fixture.test.php | 2 +-
.../cases/libs/controller/components/auth.test.php | 11 ++++++-----
.../libs/controller/components/cookie.test.php | 7 +++++--
.../cases/libs/controller/components/email.test.php | 6 +++---
.../controller/components/request_handler.test.php | 7 ++++---
.../libs/controller/components/security.test.php | 4 ++--
.../libs/controller/components/session.test.php | 4 ++--
.../tests/cases/libs/controller/controller.test.php | 13 +++++++------
.../libs/controller/controller_merge_vars.test.php | 2 +-
.../cases/libs/controller/pages_controller.test.php | 6 +++---
.../tests/cases/libs/controller/scaffold.test.php | 4 ++--
lib/Cake/tests/cases/libs/debugger.test.php | 4 ++--
lib/Cake/tests/cases/libs/dispatcher.test.php | 8 ++++----
.../tests/cases/libs/error/error_handler.test.php | 4 +++-
.../cases/libs/error/exception_renderer.test.php | 4 +++-
lib/Cake/tests/cases/libs/file.test.php | 2 +-
lib/Cake/tests/cases/libs/http_socket.test.php | 3 ++-
lib/Cake/tests/cases/libs/i18n.test.php | 2 +-
lib/Cake/tests/cases/libs/inflector.test.php | 2 +-
lib/Cake/tests/cases/libs/l10n.test.php | 2 +-
lib/Cake/tests/cases/libs/log/file_log.test.php | 2 +-
.../cases/libs/model/behavior_collection.test.php | 3 ++-
.../tests/cases/libs/model/behaviors/acl.test.php | 4 ++--
.../cases/libs/model/behaviors/containable.test.php | 4 +++-
.../cases/libs/model/behaviors/translate.test.php | 3 ++-
.../tests/cases/libs/model/behaviors/tree.test.php | 4 +++-
.../tests/cases/libs/model/cake_schema.test.php | 3 ++-
.../cases/libs/model/connection_manager.test.php | 2 +-
.../libs/model/datasources/dbo/dbo_mysql.test.php | 9 +++++----
.../model/datasources/dbo/dbo_postgres.test.php | 7 +++++--
.../libs/model/datasources/dbo/dbo_sqlite.test.php | 4 +++-
.../libs/model/datasources/dbo_source.test.php | 4 +++-
lib/Cake/tests/cases/libs/model/db_acl.test.php | 5 +++--
lib/Cake/tests/cases/libs/model/model.test.php | 4 +++-
.../cases/libs/model/model_integration.test.php | 3 ++-
.../tests/cases/libs/model/model_write.test.php | 2 +-
lib/Cake/tests/cases/libs/multibyte.test.php | 2 +-
lib/Cake/tests/cases/libs/set.test.php | 2 +-
lib/Cake/tests/cases/libs/view/theme.test.php | 2 +-
39 files changed, 98 insertions(+), 68 deletions(-)
diff --git a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
index e82420834..4541b2526 100644
--- a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
+++ b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4667
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('DboSource', 'Model/Datasource');
+App::uses('DboSource', 'Model/Datasource');
/**
* CakeTestFixtureTestFixture 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 98f389efd..bc7e01ab4 100644
--- a/lib/Cake/tests/cases/libs/controller/components/auth.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/auth.test.php
@@ -17,10 +17,11 @@
* @since CakePHP(tm) v 1.2.0.5347
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Controller');
-App::import('Component', array('Auth', 'Acl'));
-App::import('Model', 'DbAcl');
-App::import('Core', 'Xml');
+App::uses('Controller', 'Controller');
+App::uses('AuthComponent', 'Controller/Component');
+App::uses('AclComponent', 'Controller/Component');
+App::uses('DbAcl', 'Model');
+App::uses('Xml', 'Utility');
/**
* TestAuthComponent class
@@ -1456,7 +1457,7 @@ class AuthTest extends CakeTestCase {
));
$_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";
- App::import('Core', 'Dispatcher');
+ App::uses('Dispatcher', 'Routing');
ob_start();
$Dispatcher = new Dispatcher();
diff --git a/lib/Cake/tests/cases/libs/controller/components/cookie.test.php b/lib/Cake/tests/cases/libs/controller/components/cookie.test.php
index cd16ca19e..41d962c08 100644
--- a/lib/Cake/tests/cases/libs/controller/components/cookie.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/cookie.test.php
@@ -17,8 +17,11 @@
* @since CakePHP(tm) v 1.2.0.5435
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', array('Component', 'Controller'), false);
-App::import('Component', 'Cookie');
+
+App::uses('Component', 'Controller');
+App::uses('Controller', 'Controller');
+App::uses('CookieComponent', 'Controller/Component');
+
/**
* CookieComponentTestController class
diff --git a/lib/Cake/tests/cases/libs/controller/components/email.test.php b/lib/Cake/tests/cases/libs/controller/components/email.test.php
index f8fd2e4a5..65bfc3ce5 100755
--- a/lib/Cake/tests/cases/libs/controller/components/email.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/email.test.php
@@ -19,9 +19,9 @@
* @since CakePHP(tm) v 1.2.0.5347
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Controller');
-App::import('Component', 'Email');
-App::import('Core', 'CakeSocket');
+App::uses('Controller', 'Controller');
+App::uses('EmailComponent', 'Controller/Component');
+App::uses('CakeSocket', 'Network');
/**
* EmailTestComponent class
diff --git a/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php b/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
index a9fe81d81..ddafab1f6 100644
--- a/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
@@ -17,9 +17,10 @@
* @since CakePHP(tm) v 1.2.0.5435
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', 'Controller', false);
-App::import('Component', array('RequestHandler'));
-App::import('Core', array('CakeRequest', 'CakeResponse'));
+App::uses('Controller', 'Controller');
+App::uses('RequestHandlerComponent', 'Controller/Component');
+App::uses('CakeRequest', 'Network');
+App::uses('CakeResponse', 'Network');
/**
* RequestHandlerTestController class
diff --git a/lib/Cake/tests/cases/libs/controller/components/security.test.php b/lib/Cake/tests/cases/libs/controller/components/security.test.php
index 22274277a..599fe27b6 100644
--- a/lib/Cake/tests/cases/libs/controller/components/security.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/security.test.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5435
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', 'Controller', false);
-App::import('Component', 'Security');
+App::uses('Controller', 'Controller');
+App::uses('SecurityComponent', 'Component');
/**
* TestSecurityComponent
diff --git a/lib/Cake/tests/cases/libs/controller/components/session.test.php b/lib/Cake/tests/cases/libs/controller/components/session.test.php
index bf605f1df..30c1a1ec2 100644
--- a/lib/Cake/tests/cases/libs/controller/components/session.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/session.test.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5436
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', 'Controller', false);
-App::import('Component', 'Session');
+App::uses('Controller', 'Controller');
+App::uses('SessionComponent', 'Controller/Component');
/**
* SessionTestController class
diff --git a/lib/Cake/tests/cases/libs/controller/controller.test.php b/lib/Cake/tests/cases/libs/controller/controller.test.php
index e55ed54b6..411df3309 100644
--- a/lib/Cake/tests/cases/libs/controller/controller.test.php
+++ b/lib/Cake/tests/cases/libs/controller/controller.test.php
@@ -17,10 +17,11 @@
* @since CakePHP(tm) v 1.2.0.5436
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Controller', 'Controller', false);
-App::import('Core', array('CakeRequest', 'CakeResponse'));
-App::import('Component', 'Security');
-App::import('Component', 'Cookie');
+App::uses('Controller', 'Controller');
+App::uses('CakeRequest', 'Network');
+App::uses('CakeResponse', 'Network');
+App::uses('SecurityComponent', 'Controller/Component');
+App::uses('CookieComponent', 'Controller/Component');
/**
* AppController class
@@ -28,7 +29,7 @@ App::import('Component', 'Cookie');
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
-if (!class_exists('AppController')) {
+if (!class_exists('AppController', false)) {
/**
* AppController class
*
@@ -498,7 +499,7 @@ class ControllerTest extends CakeTestCase {
'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
));
- App::import('Controller', 'TestPlugin.TestPlugin');
+ App::uses('TestPluginController', 'TestPlugin.Controller');
$Controller = new TestPluginController();
$Controller->plugin = 'TestPlugin';
diff --git a/lib/Cake/tests/cases/libs/controller/controller_merge_vars.test.php b/lib/Cake/tests/cases/libs/controller/controller_merge_vars.test.php
index a3199b3a2..eb3301a4f 100644
--- a/lib/Cake/tests/cases/libs/controller/controller_merge_vars.test.php
+++ b/lib/Cake/tests/cases/libs/controller/controller_merge_vars.test.php
@@ -19,7 +19,7 @@
* @since CakePHP(tm) v 1.2.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Controller');
+App::uses('Controller', 'Controller');
if (!class_exists('AppController')) {
diff --git a/lib/Cake/tests/cases/libs/controller/pages_controller.test.php b/lib/Cake/tests/cases/libs/controller/pages_controller.test.php
index 8188d3976..0c0f8813b 100644
--- a/lib/Cake/tests/cases/libs/controller/pages_controller.test.php
+++ b/lib/Cake/tests/cases/libs/controller/pages_controller.test.php
@@ -17,12 +17,12 @@
* @since CakePHP(tm) v 1.2.0.5436
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (!class_exists('AppController')) {
- require_once LIBS . 'controller' . DS . 'app_controller.php';
+if (!class_exists('AppController', false)) {
+ require_once LIBS . 'Controller' . DS . 'AppController.php';
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true);
}
-App::import('Controller', 'Pages');
+App::uses('PagesController', 'Controller');
/**
* PagesControllerTest class
diff --git a/lib/Cake/tests/cases/libs/controller/scaffold.test.php b/lib/Cake/tests/cases/libs/controller/scaffold.test.php
index 2ebd3f5e3..7f90f4be1 100644
--- a/lib/Cake/tests/cases/libs/controller/scaffold.test.php
+++ b/lib/Cake/tests/cases/libs/controller/scaffold.test.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5436
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Scaffold', false);
-App::import('Core', 'Controller', false);
+App::uses('Scaffold', 'Controller');
+App::uses('Controller', 'Controller');
/**
* ScaffoldMockController class
diff --git a/lib/Cake/tests/cases/libs/debugger.test.php b/lib/Cake/tests/cases/libs/debugger.test.php
index d6ea5ac8e..c6638abb7 100644
--- a/lib/Cake/tests/cases/libs/debugger.test.php
+++ b/lib/Cake/tests/cases/libs/debugger.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.5432
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Debugger');
+App::uses('Debugger', 'Utility');
/**
* DebugggerTestCaseDebuggger class
@@ -217,7 +217,7 @@ class DebuggerTest extends CakeTestCase {
* @return void
*/
function testExportVar() {
- App::import('Controller');
+ App::uses('Controller', 'Controller');
$Controller = new Controller();
$Controller->helpers = array('Html', 'Form');
$View = new View($Controller);
diff --git a/lib/Cake/tests/cases/libs/dispatcher.test.php b/lib/Cake/tests/cases/libs/dispatcher.test.php
index 35f161e7a..a92f72fb9 100644
--- a/lib/Cake/tests/cases/libs/dispatcher.test.php
+++ b/lib/Cake/tests/cases/libs/dispatcher.test.php
@@ -17,11 +17,11 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Dispatcher', false);
-App::import('Core', 'CakeResponse', false);
+App::uses('Dispatcher', 'Routing');
+App::uses('CakeResponse', 'Network');
-if (!class_exists('AppController')) {
- require_once LIBS . 'controller' . DS . 'app_controller.php';
+if (!class_exists('AppController', false)) {
+ require_once LIBS . 'Controller' . DS . 'AppController.php';
} elseif (!defined('APP_CONTROLLER_EXISTS')){
define('APP_CONTROLLER_EXISTS', true);
}
diff --git a/lib/Cake/tests/cases/libs/error/error_handler.test.php b/lib/Cake/tests/cases/libs/error/error_handler.test.php
index 736524251..21d7eadd4 100644
--- a/lib/Cake/tests/cases/libs/error/error_handler.test.php
+++ b/lib/Cake/tests/cases/libs/error/error_handler.test.php
@@ -18,7 +18,9 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('ErrorHandler', 'Controller', 'Router'));
+App::uses('ErrorHandler', 'Error');
+App::uses('Controller', 'Controller');
+App::uses('Router', 'Routing');
/**
* ErrorHandlerTest class
diff --git a/lib/Cake/tests/cases/libs/error/exception_renderer.test.php b/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
index c99c6b118..f7293db84 100644
--- a/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
+++ b/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
@@ -18,7 +18,9 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('ExceptionRenderer', 'Controller', 'Component'));
+App::uses('ExceptionRenderer', 'Error');
+App::uses('Controller', 'Controller');
+App::uses('Component', 'Controller');
/**
* Short description for class.
diff --git a/lib/Cake/tests/cases/libs/file.test.php b/lib/Cake/tests/cases/libs/file.test.php
index 2895deb88..ebaa2062b 100644
--- a/lib/Cake/tests/cases/libs/file.test.php
+++ b/lib/Cake/tests/cases/libs/file.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'File');
+App::uses('File', 'Utility');
/**
* FileTest class
diff --git a/lib/Cake/tests/cases/libs/http_socket.test.php b/lib/Cake/tests/cases/libs/http_socket.test.php
index 5b3f79e0c..51e9e45bd 100644
--- a/lib/Cake/tests/cases/libs/http_socket.test.php
+++ b/lib/Cake/tests/cases/libs/http_socket.test.php
@@ -17,7 +17,8 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'HttpSocket');
+
+App::uses('HttpSocket', 'Network');
class TestHttpSocket extends HttpSocket {
diff --git a/lib/Cake/tests/cases/libs/i18n.test.php b/lib/Cake/tests/cases/libs/i18n.test.php
index 1ca37bcb1..a446df605 100644
--- a/lib/Cake/tests/cases/libs/i18n.test.php
+++ b/lib/Cake/tests/cases/libs/i18n.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.5432
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'i18n');
+App::uses('I18n', 'I18n');
/**
* I18nTest class
diff --git a/lib/Cake/tests/cases/libs/inflector.test.php b/lib/Cake/tests/cases/libs/inflector.test.php
index 4d383c887..1535f82fa 100644
--- a/lib/Cake/tests/cases/libs/inflector.test.php
+++ b/lib/Cake/tests/cases/libs/inflector.test.php
@@ -24,7 +24,7 @@
* Included libraries.
*
*/
-App::import('Core', 'Inflector');
+App::uses('Inflector', 'Utility');
/**
* Short description for class.
diff --git a/lib/Cake/tests/cases/libs/l10n.test.php b/lib/Cake/tests/cases/libs/l10n.test.php
index a1b35aee1..d685f3ed1 100644
--- a/lib/Cake/tests/cases/libs/l10n.test.php
+++ b/lib/Cake/tests/cases/libs/l10n.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.5432
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'l10n');
+App::uses('L10n', 'I18n');
/**
* L10nTest class
diff --git a/lib/Cake/tests/cases/libs/log/file_log.test.php b/lib/Cake/tests/cases/libs/log/file_log.test.php
index f07ab9771..623b66d88 100644
--- a/lib/Cake/tests/cases/libs/log/file_log.test.php
+++ b/lib/Cake/tests/cases/libs/log/file_log.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'log/FileLog');
+App::uses('FileLog', 'Log/Engine');
/**
* CakeLogTest class
diff --git a/lib/Cake/tests/cases/libs/model/behavior_collection.test.php b/lib/Cake/tests/cases/libs/model/behavior_collection.test.php
index 12ce1dd4f..de10eeaa1 100644
--- a/lib/Cake/tests/cases/libs/model/behavior_collection.test.php
+++ b/lib/Cake/tests/cases/libs/model/behavior_collection.test.php
@@ -19,7 +19,8 @@
* @since 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Model', 'AppModel');
+
+App::uses('AppModel', 'Model');
require_once dirname(__FILE__) . DS . 'models.php';
/**
diff --git a/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php b/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
index a7705dcd9..d644b8381 100644
--- a/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
+++ b/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
@@ -19,8 +19,8 @@
* @since CakePHP v 1.2.0.4487
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Behavior', 'Acl');
-App::import('Core', 'db_acl');
+App::uses('AclBehavior', 'Model/Behavior');
+App::uses('DbAcl', 'Model');
/**
* Test Person class - self joined model
diff --git a/lib/Cake/tests/cases/libs/model/behaviors/containable.test.php b/lib/Cake/tests/cases/libs/model/behaviors/containable.test.php
index 10ea65fb5..4b1050395 100644
--- a/lib/Cake/tests/cases/libs/model/behaviors/containable.test.php
+++ b/lib/Cake/tests/cases/libs/model/behaviors/containable.test.php
@@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.2.0.5669
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('AppModel', 'Model'));
+
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
require_once(dirname(dirname(__FILE__)) . DS . 'models.php');
/**
diff --git a/lib/Cake/tests/cases/libs/model/behaviors/translate.test.php b/lib/Cake/tests/cases/libs/model/behaviors/translate.test.php
index ee13fe3bb..50f2ff3ab 100644
--- a/lib/Cake/tests/cases/libs/model/behaviors/translate.test.php
+++ b/lib/Cake/tests/cases/libs/model/behaviors/translate.test.php
@@ -21,7 +21,8 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
}
-App::import('Core', array('AppModel', 'Model'));
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
require_once(dirname(dirname(__FILE__)) . DS . 'models.php');
/**
diff --git a/lib/Cake/tests/cases/libs/model/behaviors/tree.test.php b/lib/Cake/tests/cases/libs/model/behaviors/tree.test.php
index 75375459f..fd56daa12 100644
--- a/lib/Cake/tests/cases/libs/model/behaviors/tree.test.php
+++ b/lib/Cake/tests/cases/libs/model/behaviors/tree.test.php
@@ -19,7 +19,9 @@
* @since CakePHP(tm) v 1.2.0.5330
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('AppModel', 'Model'));
+
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
require_once(dirname(dirname(__FILE__)) . DS . 'models.php');
/**
diff --git a/lib/Cake/tests/cases/libs/model/cake_schema.test.php b/lib/Cake/tests/cases/libs/model/cake_schema.test.php
index ff5c8ffdd..5132fb557 100644
--- a/lib/Cake/tests/cases/libs/model/cake_schema.test.php
+++ b/lib/Cake/tests/cases/libs/model/cake_schema.test.php
@@ -18,7 +18,8 @@
* @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Model', 'CakeSchema', false);
+
+App::uses('CakeSchema', 'Model');
/**
* Test for Schema database management
diff --git a/lib/Cake/tests/cases/libs/model/connection_manager.test.php b/lib/Cake/tests/cases/libs/model/connection_manager.test.php
index 04212fa4a..1798fb6b9 100644
--- a/lib/Cake/tests/cases/libs/model/connection_manager.test.php
+++ b/lib/Cake/tests/cases/libs/model/connection_manager.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ConnectionManager');
+App::uses('ConnectionManager', 'Model');
/**
* ConnectionManagerTest
diff --git a/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
index bd29b5d39..30cecc0a3 100644
--- a/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
+++ b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
@@ -17,8 +17,11 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboMysql'));
-App::import('Model', 'App');
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
+App::uses('Mysql', 'Model/Datasource/Database');
+App::uses('CakeSchema', 'Model');
+
require_once dirname(dirname(dirname(__FILE__))) . DS . 'models.php';
/**
@@ -457,7 +460,6 @@ class DboMysqlTest extends CakeTestCase {
* @return void
*/
function testAlterSchemaIndexes() {
- App::import('Model', 'CakeSchema');
$this->Dbo->cacheSources = $this->Dbo->testing = false;
$schema1 = new CakeSchema(array(
@@ -577,7 +579,6 @@ class DboMysqlTest extends CakeTestCase {
* @return void
*/
function testAlteringTableParameters() {
- App::import('Model', 'CakeSchema');
$this->Dbo->cacheSources = $this->Dbo->testing = false;
$schema1 = new CakeSchema(array(
diff --git a/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
index c71836f5d..ebb803c92 100644
--- a/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
+++ b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
@@ -17,8 +17,11 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboPostgres'));
-App::import('Model', 'App');
+
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
+App::uses('Postgres', 'Model/Datasource/Database');
+
require_once dirname(dirname(dirname(__FILE__))) . DS . 'models.php';
/**
diff --git a/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
index b42b6209a..a71fc7075 100644
--- a/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
+++ b/lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
@@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboSqlite'));
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
+App::uses('Sqlite', 'Model/Datasource/Database');
/**
* DboSqliteTestDb class
diff --git a/lib/Cake/tests/cases/libs/model/datasources/dbo_source.test.php b/lib/Cake/tests/cases/libs/model/datasources/dbo_source.test.php
index 9ac868c3b..ab95b50cc 100644
--- a/lib/Cake/tests/cases/libs/model/datasources/dbo_source.test.php
+++ b/lib/Cake/tests/cases/libs/model/datasources/dbo_source.test.php
@@ -18,7 +18,9 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Model', array('Model', 'DataSource', 'DboSource', 'DboMysql', 'App'));
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
+App::uses('DboSource', 'Model/Datasource');
require_once dirname(dirname(__FILE__)) . DS . 'models.php';
/**
diff --git a/lib/Cake/tests/cases/libs/model/db_acl.test.php b/lib/Cake/tests/cases/libs/model/db_acl.test.php
index fb0a9f3f3..694fdaffe 100644
--- a/lib/Cake/tests/cases/libs/model/db_acl.test.php
+++ b/lib/Cake/tests/cases/libs/model/db_acl.test.php
@@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Component', 'Acl');
-App::import('Core', 'db_acl');
+
+App::uses('AclComponent', 'Controller/Component');
+App::uses('DbAcl', 'Model');
/**
* DB ACL wrapper test class
diff --git a/lib/Cake/tests/cases/libs/model/model.test.php b/lib/Cake/tests/cases/libs/model/model.test.php
index 9809b3a0d..4e1411ea2 100644
--- a/lib/Cake/tests/cases/libs/model/model.test.php
+++ b/lib/Cake/tests/cases/libs/model/model.test.php
@@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('AppModel', 'Model'));
+
+App::uses('Model', 'Model');
+App::uses('AppModel', 'Model');
require_once dirname(__FILE__) . DS . 'models.php';
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
diff --git a/lib/Cake/tests/cases/libs/model/model_integration.test.php b/lib/Cake/tests/cases/libs/model/model_integration.test.php
index a8b5a6796..cd6063df3 100644
--- a/lib/Cake/tests/cases/libs/model/model_integration.test.php
+++ b/lib/Cake/tests/cases/libs/model/model_integration.test.php
@@ -19,8 +19,9 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
require_once dirname(__FILE__) . DS . 'model.test.php';
-App::import('Core', 'DboSource');
+App::uses('DboSource', 'Model/Datasource/Database');
/**
* DboMock class
diff --git a/lib/Cake/tests/cases/libs/model/model_write.test.php b/lib/Cake/tests/cases/libs/model/model_write.test.php
index 4cac5959e..f80fc0263 100644
--- a/lib/Cake/tests/cases/libs/model/model_write.test.php
+++ b/lib/Cake/tests/cases/libs/model/model_write.test.php
@@ -1016,7 +1016,7 @@ class ModelWriteTest extends BaseModelTest {
function testSaveFromXml() {
$this->markTestSkipped('This feature needs to be fixed or dropped');
$this->loadFixtures('Article');
- App::import('Core', 'Xml');
+ App::uses('Xml', 'Utility');
$Article = new Article();
$result = $Article->save(Xml::build(''));
diff --git a/lib/Cake/tests/cases/libs/multibyte.test.php b/lib/Cake/tests/cases/libs/multibyte.test.php
index 9ec3538ea..7da643c34 100644
--- a/lib/Cake/tests/cases/libs/multibyte.test.php
+++ b/lib/Cake/tests/cases/libs/multibyte.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.6833
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Multibyte');
+App::import('Multibyte', 'I18n');
/**
* MultibyteTest class
diff --git a/lib/Cake/tests/cases/libs/set.test.php b/lib/Cake/tests/cases/libs/set.test.php
index 9fbc4086b..ebabe84a5 100644
--- a/lib/Cake/tests/cases/libs/set.test.php
+++ b/lib/Cake/tests/cases/libs/set.test.php
@@ -2708,7 +2708,7 @@ class SetTest extends CakeTestCase {
* @return void
*/
function testXmlSetReverse() {
- App::import('Core', 'Xml');
+ App::uses('Xml', 'Utility');
$string = '
diff --git a/lib/Cake/tests/cases/libs/view/theme.test.php b/lib/Cake/tests/cases/libs/view/theme.test.php
index 314d38ba7..ffc8ee045 100644
--- a/lib/Cake/tests/cases/libs/view/theme.test.php
+++ b/lib/Cake/tests/cases/libs/view/theme.test.php
@@ -19,7 +19,7 @@
*/
App::import('View', 'View');
App::import('View', 'Theme');
-App::import('Core', 'Controller');
+App::uses('Controller', 'Controller');
/**
From 29077654040ae4074558725a50342a9f85f18632 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 10 Dec 2010 01:53:27 -0430
Subject: [PATCH 060/668] Replacing almost all remaining uses of App::import
---
lib/Cake/TestSuite/Fixture/CakeTestFixture.php | 12 ++++++++----
lib/Cake/TestSuite/templates/footer.php | 2 +-
lib/Cake/tests/cases/libs/folder.test.php | 2 +-
lib/Cake/tests/cases/libs/multibyte.test.php | 2 +-
lib/Cake/tests/cases/libs/object.test.php | 5 ++++-
lib/Cake/tests/cases/libs/object_collection.test.php | 2 +-
lib/Cake/tests/cases/libs/route/cake_route.test.php | 4 ++--
.../cases/libs/route/plugin_short_route.test.php | 4 ++--
lib/Cake/tests/cases/libs/sanitize.test.php | 2 +-
lib/Cake/tests/cases/libs/security.test.php | 2 +-
.../tests/cases/libs/session/cache_session.test.php | 4 ++--
.../cases/libs/session/database_session.test.php | 6 +++---
lib/Cake/tests/cases/libs/set.test.php | 2 +-
lib/Cake/tests/cases/libs/string.test.php | 2 +-
lib/Cake/tests/cases/libs/validation.test.php | 2 +-
lib/Cake/tests/cases/libs/view/helper.test.php | 5 ++++-
.../tests/cases/libs/view/helper_collection.test.php | 4 ++--
.../tests/cases/libs/view/helpers/cache.test.php | 7 +++++--
lib/Cake/tests/cases/libs/view/helpers/form.test.php | 11 ++++++++---
lib/Cake/tests/cases/libs/view/helpers/html.test.php | 12 +++++++++---
.../cases/libs/view/helpers/jquery_engine.test.php | 7 +++++--
lib/Cake/tests/cases/libs/view/helpers/js.test.php | 7 +++++--
.../cases/libs/view/helpers/mootools_engine.test.php | 5 ++++-
.../tests/cases/libs/view/helpers/number.test.php | 2 +-
.../tests/cases/libs/view/helpers/paginator.test.php | 7 +++++--
.../libs/view/helpers/prototype_engine.test.php | 5 ++++-
lib/Cake/tests/cases/libs/view/helpers/rss.test.php | 5 +++--
.../tests/cases/libs/view/helpers/session.test.php | 6 ++++--
lib/Cake/tests/cases/libs/view/helpers/text.test.php | 4 ++--
lib/Cake/tests/cases/libs/view/helpers/time.test.php | 4 ++--
lib/Cake/tests/cases/libs/view/media.test.php | 5 ++++-
lib/Cake/tests/cases/libs/view/theme.test.php | 4 ++--
lib/Cake/tests/cases/libs/view/view.test.php | 8 +++++---
33 files changed, 104 insertions(+), 57 deletions(-)
diff --git a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php
index b7676cf5c..db66430c9 100644
--- a/lib/Cake/TestSuite/Fixture/CakeTestFixture.php
+++ b/lib/Cake/TestSuite/Fixture/CakeTestFixture.php
@@ -20,6 +20,8 @@
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
+App::uses('CakeSchema', 'Model');
+
/**
* Short description for class.
*
@@ -52,7 +54,6 @@ class CakeTestFixture {
*
*/
public function __construct() {
- App::import('Model', 'CakeSchema');
$this->Schema = new CakeSchema(array('name' => 'TestSuite', 'connection' => 'test'));
$this->init();
}
@@ -68,9 +69,12 @@ class CakeTestFixture {
is_array($this->import) ? $this->import : array('model' => $this->import)
);
- if (isset($import['model']) && App::import('Model', $import['model'])) {
- App::import('Model', $import['model']);
- list(, $modelClass) = pluginSplit($import['model']);
+ if (isset($import['model'])) {
+ list($plugin, $modelClass) = pluginSplit($import['model'], true);
+ App::uses($modelClass, $plugin . 'Model');
+ if (!class_exists($modelClass)) {
+ throw new MissingModelException(array('class' => $modelClass));
+ }
$model = new $modelClass(null, null, $import['connection']);
$db = $model->getDataSource();
if (empty($model->tablePrefix)) {
diff --git a/lib/Cake/TestSuite/templates/footer.php b/lib/Cake/TestSuite/templates/footer.php
index e9b6c6746..172195f02 100644
--- a/lib/Cake/TestSuite/templates/footer.php
+++ b/lib/Cake/TestSuite/templates/footer.php
@@ -27,7 +27,7 @@
element('sql_dump');
diff --git a/lib/Cake/tests/cases/libs/folder.test.php b/lib/Cake/tests/cases/libs/folder.test.php
index 428520610..739047e57 100644
--- a/lib/Cake/tests/cases/libs/folder.test.php
+++ b/lib/Cake/tests/cases/libs/folder.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'File');
+App::uses('File', 'Utility');
/**
* FolderTest class
diff --git a/lib/Cake/tests/cases/libs/multibyte.test.php b/lib/Cake/tests/cases/libs/multibyte.test.php
index 7da643c34..6eb0068b5 100644
--- a/lib/Cake/tests/cases/libs/multibyte.test.php
+++ b/lib/Cake/tests/cases/libs/multibyte.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.6833
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Multibyte', 'I18n');
+App::uses('Multibyte', 'I18n');
/**
* MultibyteTest class
diff --git a/lib/Cake/tests/cases/libs/object.test.php b/lib/Cake/tests/cases/libs/object.test.php
index a371cf9f2..f5ad44cad 100644
--- a/lib/Cake/tests/cases/libs/object.test.php
+++ b/lib/Cake/tests/cases/libs/object.test.php
@@ -17,7 +17,10 @@
* @since CakePHP(tm) v 1.2.0.5432
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('Object', 'Controller', 'Model'));
+
+App::uses('Object', 'Core');
+App::uses('Controller', 'Controller');
+App::uses('Model', 'Model');
/**
* RequestActionPost class
diff --git a/lib/Cake/tests/cases/libs/object_collection.test.php b/lib/Cake/tests/cases/libs/object_collection.test.php
index 9d0861861..ffc061cd2 100644
--- a/lib/Cake/tests/cases/libs/object_collection.test.php
+++ b/lib/Cake/tests/cases/libs/object_collection.test.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
+App::uses('ObjectCollection', 'Utility');
/**
* A generic object class
diff --git a/lib/Cake/tests/cases/libs/route/cake_route.test.php b/lib/Cake/tests/cases/libs/route/cake_route.test.php
index dae305b23..76f76f336 100644
--- a/lib/Cake/tests/cases/libs/route/cake_route.test.php
+++ b/lib/Cake/tests/cases/libs/route/cake_route.test.php
@@ -1,7 +1,7 @@
skipIf(!is_writable(WWW_ROOT . 'theme'), 'Cannot write to webroot/theme')) {
return;
}
- App::import('Core', 'File');
+ App::uses('File', 'Utility');
$testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'img' . DS . '__cake_test_image.gif';
$file = new File($testfile, true);
@@ -596,7 +602,7 @@ class HtmlHelperTest extends CakeTestCase {
if ($this->skipIf(!is_writable(WWW_ROOT . 'theme'), 'Cannot write to webroot/theme')) {
return;
}
- App::import('Core', 'File');
+ App::uses('File', 'Utility');
$testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'js' . DS . '__test_js.js';
$file = new File($testfile, true);
diff --git a/lib/Cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/lib/Cake/tests/cases/libs/view/helpers/jquery_engine.test.php
index 87c2b8b2b..ecbff4bb8 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/jquery_engine.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/jquery_engine.test.php
@@ -18,8 +18,11 @@
* @subpackage cake.tests.cases.views.helpers
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', array('Html', 'Js', 'JqueryEngine'));
-App::import('Core', 'View');
+
+App::uses('HtmlHelper', 'View/Helper');
+App::uses('JsHelper', 'View/Helper');
+App::uses('JqueryEngineHelper', 'View/Helper');
+App::uses('View', 'View');
class JqueryEngineHelperTest extends CakeTestCase {
/**
diff --git a/lib/Cake/tests/cases/libs/view/helpers/js.test.php b/lib/Cake/tests/cases/libs/view/helpers/js.test.php
index 1fd1602a7..1b03d5648 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/js.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/js.test.php
@@ -19,8 +19,11 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', array('Js', 'Html', 'Form'));
-App::import('Core', array('View', 'ClassRegistry'));
+App::uses('HtmlHelper', 'View/Helper');
+App::uses('JsHelper', 'View/Helper');
+App::uses('FormHelper', 'View/Helper');
+App::uses('View', 'View');
+App::uses('ClassRegistry', 'Utility');
class OptionEngineHelper extends JsBaseEngineHelper {
protected $_optionMap = array(
diff --git a/lib/Cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/lib/Cake/tests/cases/libs/view/helpers/mootools_engine.test.php
index 53af75a80..fa4253842 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/mootools_engine.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/mootools_engine.test.php
@@ -20,7 +20,10 @@
* @subpackage cake.tests.cases.views.helpers
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', array('Html', 'Js', 'MootoolsEngine'));
+
+App::uses('HtmlHelper', 'View/Helper');
+App::uses('JsHelper', 'View/Helper');
+App::uses('MooToolsEngineHelper', 'View/Helper');
class MooEngineHelperTest extends CakeTestCase {
/**
diff --git a/lib/Cake/tests/cases/libs/view/helpers/number.test.php b/lib/Cake/tests/cases/libs/view/helpers/number.test.php
index 1d1d04c4c..9919416fb 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/number.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/number.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', 'Number');
+App::uses('NumberHelper', 'View/Helper');
/**
* NumberHelperTest class
diff --git a/lib/Cake/tests/cases/libs/view/helpers/paginator.test.php b/lib/Cake/tests/cases/libs/view/helpers/paginator.test.php
index 2d0bda4a9..ef720ccc8 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/paginator.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/paginator.test.php
@@ -17,8 +17,11 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'View');
-App::import('Helper', array('Html', 'Paginator', 'Form', 'Js'));
+App::uses('View', 'View');
+App::uses('HtmlHelper', 'View/Helper');
+App::uses('JsHelper', 'View/Helper');
+App::uses('PaginatorHelper', 'View/Helper');
+App::uses('FormHelper', 'View/Helper');
if (!defined('FULL_BASE_URL')) {
define('FULL_BASE_URL', 'http://cakephp.org');
diff --git a/lib/Cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/lib/Cake/tests/cases/libs/view/helpers/prototype_engine.test.php
index 395b25cd7..77c2b1b87 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/prototype_engine.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/prototype_engine.test.php
@@ -18,7 +18,10 @@
* @subpackage cake.tests.cases.views.helpers
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', array('Html', 'Js', 'PrototypeEngine'));
+
+App::uses('HtmlHelper', 'View/Helper');
+App::uses('JsHelper', 'View/Helper');
+App::uses('PrototypeEngineHelper', 'View/Helper');
class PrototypeEngineHelperTest extends CakeTestCase {
/**
diff --git a/lib/Cake/tests/cases/libs/view/helpers/rss.test.php b/lib/Cake/tests/cases/libs/view/helpers/rss.test.php
index afc3e54e9..0e6e18474 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/rss.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/rss.test.php
@@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('View', 'View');
-App::import('Helper', array('Rss', 'Time'));
+App::uses('View', 'View');
+App::uses('RssHelper', 'View/Helper');
+App::uses('TimeHelper', 'View/Helper');
/**
* RssHelperTest class
diff --git a/lib/Cake/tests/cases/libs/view/helpers/session.test.php b/lib/Cake/tests/cases/libs/view/helpers/session.test.php
index c61421bd1..2fa1dad0a 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/session.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/session.test.php
@@ -17,8 +17,10 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('Controller', 'View'));
-App::import('Helper', array('Session'));
+
+App::uses('Controller', 'Controller');
+App::uses('View', 'View');
+App::uses('SessionHelper', 'View/Helper');
/**
* SessionHelperTest class
diff --git a/lib/Cake/tests/cases/libs/view/helpers/text.test.php b/lib/Cake/tests/cases/libs/view/helpers/text.test.php
index cdb5dcecb..2ac412374 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/text.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/text.test.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'View');
-App::import('Helper', 'Text');
+App::uses('View', 'View');
+App::uses('TextHelper', 'Helper');
/**
* TextHelperTest class
diff --git a/lib/Cake/tests/cases/libs/view/helpers/time.test.php b/lib/Cake/tests/cases/libs/view/helpers/time.test.php
index 668467296..d5ba62b61 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/time.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/time.test.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Helper', 'Time');
-App::import('Core', 'View');
+App::uses('TimeHelper', 'View/Helper');
+App::uses('View', 'View');
/**
* TimeHelperTest class
diff --git a/lib/Cake/tests/cases/libs/view/media.test.php b/lib/Cake/tests/cases/libs/view/media.test.php
index 39b9d190d..a9352f5d9 100644
--- a/lib/Cake/tests/cases/libs/view/media.test.php
+++ b/lib/Cake/tests/cases/libs/view/media.test.php
@@ -17,7 +17,10 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('Media', 'Controller', 'CakeResponse'));
+
+App::uses('Controller', 'Controller');
+App::uses('MediaView', 'View');
+App::uses('CakeResponse', 'Network');
/**
* MediaViewTest class
diff --git a/lib/Cake/tests/cases/libs/view/theme.test.php b/lib/Cake/tests/cases/libs/view/theme.test.php
index ffc8ee045..69a986ad7 100644
--- a/lib/Cake/tests/cases/libs/view/theme.test.php
+++ b/lib/Cake/tests/cases/libs/view/theme.test.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('View', 'View');
-App::import('View', 'Theme');
+App::uses('View', 'View');
+App::uses('ThemeView', 'View');
App::uses('Controller', 'Controller');
diff --git a/lib/Cake/tests/cases/libs/view/view.test.php b/lib/Cake/tests/cases/libs/view/view.test.php
index 8038ff010..9824b125a 100644
--- a/lib/Cake/tests/cases/libs/view/view.test.php
+++ b/lib/Cake/tests/cases/libs/view/view.test.php
@@ -17,9 +17,11 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', array('View', 'Controller'));
-App::import('Helper', 'Cache');
-App::import('Core', array('ErrorHandler'));
+
+App::uses('View', 'View');
+App::uses('Controller', 'Controller');
+App::uses('CacheHelper', 'View/Helper');
+App::uses('ErrorHandler', 'Error');
/**
From 4e722ddb74dae3ee0ba6638a1b5ec4e51bb9ac06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 11 Dec 2010 01:13:01 -0430
Subject: [PATCH 061/668] Fixing some constants to load the web testsuite
---
app/webroot/index.php | 2 +-
app/webroot/test.php | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/webroot/index.php b/app/webroot/index.php
index 70991f787..d011f3939 100644
--- a/app/webroot/index.php
+++ b/app/webroot/index.php
@@ -68,7 +68,7 @@
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
- if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
+ if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
diff --git a/app/webroot/test.php b/app/webroot/test.php
index 7a27e8e29..2f6a55e7a 100644
--- a/app/webroot/test.php
+++ b/app/webroot/test.php
@@ -50,7 +50,7 @@ ini_set('display_errors', 1);
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
- define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ define('CAKE_CORE_INCLUDE_PATH', ROOT . DS .'lib');
}
/**
@@ -68,7 +68,7 @@ if (!defined('CORE_PATH')) {
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
-if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
+if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
@@ -83,6 +83,6 @@ if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
}
-require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
+require_once CAKE_TESTS_LIB . 'CakeTestSuiteDispatcher.php';
CakeTestSuiteDispatcher::run();
From 4389764050cb3aa2762f2f518a5903a0952c3670 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 11 Dec 2010 01:13:42 -0430
Subject: [PATCH 062/668] Fixing core path
---
lib/Cake/Core/App.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 2e4383ac8..cf751135c 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -339,8 +339,7 @@ class App {
static $paths = false;
if (!$paths) {
$paths = array();
- $libs = LIBS;
- $cake = dirname($libs) . DS;
+ $cake = $libs = LIBS;
$path = dirname($cake) . DS;
$paths['cake'][] = $cake;
From 8e5bd76752a52873a913c5d985c73b07625b9e74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 11 Dec 2010 01:17:55 -0430
Subject: [PATCH 063/668] Fixing several errors when running the testsuite
---
lib/Cake/Core/App.php | 3 +--
lib/Cake/Model/BehaviorCollection.php | 2 +-
lib/Cake/Model/Datasource/DboSource.php | 1 +
lib/Cake/Network/HttpSocket.php | 2 +-
lib/Cake/Routing/Router.php | 2 +-
lib/Cake/TestSuite/CakeTestCase.php | 3 +--
lib/Cake/TestSuite/CakeTestSuiteDispatcher.php | 12 ++++++------
lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php | 3 ++-
lib/Cake/TestSuite/Fixture/CakeFixtureManager.php | 4 ++++
lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php | 2 +-
lib/Cake/TestSuite/TestManager.php | 2 ++
lib/Cake/View/Helper.php | 2 +-
lib/Cake/View/Helper/JqueryEngineHelper.php | 3 ++-
lib/Cake/View/HelperCollection.php | 2 +-
lib/Cake/View/View.php | 1 +
lib/Cake/bootstrap.php | 2 +-
lib/Cake/tests/cases/libs/cake_test_case.test.php | 6 +++---
lib/Cake/tests/cases/libs/cake_test_fixture.test.php | 1 +
.../tests/cases/libs/html_coverage_report.test.php | 2 +-
lib/Cake/tests/cases/libs/set.test.php | 1 +
lib/Cake/tests/cases/libs/view/helper.test.php | 1 +
lib/Cake/tests/cases/libs/view/helpers/text.test.php | 3 ++-
lib/Cake/tests/cases/libs/view/view.test.php | 1 +
23 files changed, 37 insertions(+), 24 deletions(-)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index cf751135c..a5f7019a0 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -285,8 +285,7 @@ class App {
if (!empty($paths[$type])) {
$path = array_flip(array_flip(array_merge(
- (array)$paths[$type], self::$__packages[$type], $merge
- )));
+ (array)$paths[$type], self::$__packages[$type])));
self::$__packages[$type] = array_values($path);
} else {
$path = array_flip(array_flip(self::$__packages[$type]));
diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php
index 064e9a37d..4cd769509 100644
--- a/lib/Cake/Model/BehaviorCollection.php
+++ b/lib/Cake/Model/BehaviorCollection.php
@@ -19,7 +19,7 @@
* @since CakePHP(tm) v 1.2.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('ObjectCollection', 'Core');
+App::uses('ObjectCollection', 'Utility');
/**
* Model behavior collection class.
diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php
index 83c962a32..c756d6aaa 100755
--- a/lib/Cake/Model/Datasource/DboSource.php
+++ b/lib/Cake/Model/Datasource/DboSource.php
@@ -18,6 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('DataSource', 'Model/Datasource');
App::uses('String', 'Utility');
App::uses('View', 'View');
diff --git a/lib/Cake/Network/HttpSocket.php b/lib/Cake/Network/HttpSocket.php
index 307448cf2..b80bebc12 100644
--- a/lib/Cake/Network/HttpSocket.php
+++ b/lib/Cake/Network/HttpSocket.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('CakeSocket', 'Core');
-App::uses('Router', 'Core');
+App::uses('Router', 'Routing');
/**
* Cake network socket connection class.
diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php
index 3824fdd0c..9f4d298c8 100644
--- a/lib/Cake/Routing/Router.php
+++ b/lib/Cake/Routing/Router.php
@@ -286,7 +286,7 @@ class Router {
* @return array Array of routes
*/
public static function redirect($route, $url, $options) {
- App::uses('RedirectRoute', 'Core');
+ App::uses('RedirectRoute', 'Routing/Route');
$options['routeClass'] = 'RedirectRoute';
return self::connect($route, $url, $options);
}
diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php
index 95819c5e1..d8fd93038 100644
--- a/lib/Cake/TestSuite/CakeTestCase.php
+++ b/lib/Cake/TestSuite/CakeTestCase.php
@@ -21,7 +21,6 @@
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
App::uses('CakeFixtureManager', 'TestSuite/Fixture');
-App::uses('CakeTestModel', 'TestSuite/Fixture');
App::uses('CakeTestFixture', 'TestSuite/Fixture');
/**
@@ -30,7 +29,7 @@ App::uses('CakeTestFixture', 'TestSuite/Fixture');
* @package cake
* @subpackage cake.cake.tests.lib
*/
-class CakeTestCase extends PHPUnit_Framework_TestCase {
+abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
/**
* The class responsible for managinf the creation, loading and removing of fixtures
diff --git a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
index 4642dc2b4..d67be7f1a 100644
--- a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
+++ b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
@@ -18,6 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('TestManager', 'TestSuite');
/**
* CakeTestSuiteDispatcher handles web requests to the test suite and runs the correct action.
*
@@ -201,7 +202,6 @@ class CakeTestSuiteDispatcher {
*/
function &getManager() {
if (empty($this->Manager)) {
- require_once CAKE_TESTS_LIB . 'test_manager.php';
$this->Manager = new $this->_managerClass($this->params);
}
return $this->Manager;
@@ -217,13 +217,13 @@ class CakeTestSuiteDispatcher {
if (!self::$_Reporter) {
$type = strtolower($this->params['output']);
$coreClass = 'Cake' . ucwords($this->params['output']) . 'Reporter';
- $coreFile = CAKE_TESTS_LIB . 'reporter/cake_' . $type . '_reporter.php';
-
$appClass = $this->params['output'] . 'Reporter';
- $appFile = APPLIBS . 'test_suite/reporter/' . $type . '_reporter.php';
- if (include_once $coreFile) {
+ App::uses($coreClass, 'TestSuite/Reporter');
+ App::uses($appClass, 'TestSuite/Reporter');
+
+ if (class_exists($coreClass)) {
self::$_Reporter = new $coreClass(null, $this->params);
- } elseif (include_once $appFile) {
+ } elseif (class_exists($appClass)) {
self::$_Reporter = new $appClass(null, $this->params);
}
}
diff --git a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
index ae4fa081c..802f462ca 100644
--- a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
+++ b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php
@@ -17,10 +17,11 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once dirname(__FILE__) . '/base_coverage_report.php';
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
+App::uses('BaseCoverageReport', 'TestSuite/Coverage');
+
class HtmlCoverageReport extends BaseCoverageReport {
/**
diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
index ea09473e7..66bf11352 100644
--- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
+++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
@@ -19,6 +19,9 @@
*/
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
+App::uses('ConnectionManager', 'Model');
+App::uses('ClassRegistry', 'Utility');
+
class CakeFixtureManager {
/**
@@ -100,6 +103,7 @@ class CakeFixtureManager {
if (isset($this->_loaded[$fixture])) {
continue;
}
+
if (strpos($fixture, 'core.') === 0) {
$fixture = substr($fixture, strlen('core.'));
foreach (App::core('cake') as $key => $path) {
diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
index 186c3fe73..1f4d6331c 100755
--- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
+++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4433
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-include_once dirname(__FILE__) . DS . 'cake_base_reporter.php';
+App::uses('CakeBaseReporter', 'TestSuite/Reporter');
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
diff --git a/lib/Cake/TestSuite/TestManager.php b/lib/Cake/TestSuite/TestManager.php
index cf56a20b7..2498f106d 100644
--- a/lib/Cake/TestSuite/TestManager.php
+++ b/lib/Cake/TestSuite/TestManager.php
@@ -23,9 +23,11 @@ define('APP_TEST_CASES', TESTS . 'cases');
define('APP_TEST_GROUPS', TESTS . 'groups');
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
+
App::uses('CakeTestSuite', 'TestSuite');
App::uses('CakeTestCase', 'TestSuite');
App::uses('CakeFixtureManager', 'TestSuite/Fixture');
+App::uses('CakeTestModel', 'TestSuite/Fixture');
/**
* TestManager is the base class that handles loading and initiating the running
diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php
index f9d26e447..f0a43a33c 100644
--- a/lib/Cake/View/Helper.php
+++ b/lib/Cake/View/Helper.php
@@ -20,7 +20,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Router', 'Core');
+App::uses('Router', 'Routing');
/**
* Abstract base class for all other Helpers in CakePHP.
diff --git a/lib/Cake/View/Helper/JqueryEngineHelper.php b/lib/Cake/View/Helper/JqueryEngineHelper.php
index ce9c017db..bc3d90423 100644
--- a/lib/Cake/View/Helper/JqueryEngineHelper.php
+++ b/lib/Cake/View/Helper/JqueryEngineHelper.php
@@ -23,7 +23,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('JsHelper', 'Helper');
+App::uses('JsHelper', 'View/Helper');
+App::uses('JsBaseEngineHelper', 'View/Helper');
class JqueryEngineHelper extends JsBaseEngineHelper {
/**
diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php
index 99e709c03..fe5f74ad5 100644
--- a/lib/Cake/View/HelperCollection.php
+++ b/lib/Cake/View/HelperCollection.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('ObjectCollection', 'Core');
+App::uses('ObjectCollection', 'Utility');
class HelperCollection extends ObjectCollection {
diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php
index ef241d334..f25469f07 100644
--- a/lib/Cake/View/View.php
+++ b/lib/Cake/View/View.php
@@ -22,6 +22,7 @@
* Included libraries.
*/
App::uses('HelperCollection', 'View');
+App::uses('Router', 'Routing');
/**
* View, the V in the MVC triad.
diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index a6b0099f6..97f38c04a 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -145,7 +145,7 @@ if (!defined('CAKE_TESTS')) {
/**
* Path to the test suite.
*/
- define('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS);
+ define('CAKE_TESTS_LIB', LIBS . 'TestSuite' . DS);
/**
* Path to the controller test directory.
diff --git a/lib/Cake/tests/cases/libs/cake_test_case.test.php b/lib/Cake/tests/cases/libs/cake_test_case.test.php
index c0623529d..34d8a4a9b 100644
--- a/lib/Cake/tests/cases/libs/cake_test_case.test.php
+++ b/lib/Cake/tests/cases/libs/cake_test_case.test.php
@@ -24,7 +24,7 @@ App::uses('Controller', 'Controller');
App::uses('CakeHtmlReporter', 'TestSuite/Reporter');
if (!class_exists('AppController', false)) {
- require_once LIBS . 'Controller' . DS . 'app_controller.php';
+ require_once LIBS . 'Controller' . DS . 'AppController.php';
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true);
}
@@ -38,8 +38,8 @@ if (!class_exists('AppController', false)) {
class CakeTestCaseTest extends CakeTestCase {
public static function setUpBeforeClass() {
- require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php';
- require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php';
+ require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php';
+ require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php';
}
/**
diff --git a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
index 4541b2526..fa851e52e 100644
--- a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
+++ b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
@@ -18,6 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('DboSource', 'Model/Datasource');
+App::uses('Model', 'Model');
/**
* CakeTestFixtureTestFixture class
diff --git a/lib/Cake/tests/cases/libs/html_coverage_report.test.php b/lib/Cake/tests/cases/libs/html_coverage_report.test.php
index 39f41fb60..325271131 100644
--- a/lib/Cake/tests/cases/libs/html_coverage_report.test.php
+++ b/lib/Cake/tests/cases/libs/html_coverage_report.test.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once CAKE . 'tests' . DS . 'lib' . DS . 'coverage' . DS . 'html_coverage_report.php';
+App::uses('HtmlCoverageReport', 'TestSuite/Coverage');
class HtmlCoverageReportTest extends CakeTestCase {
/**
diff --git a/lib/Cake/tests/cases/libs/set.test.php b/lib/Cake/tests/cases/libs/set.test.php
index e17a6af06..e0c5c3348 100644
--- a/lib/Cake/tests/cases/libs/set.test.php
+++ b/lib/Cake/tests/cases/libs/set.test.php
@@ -18,6 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('Set', 'Utility');
+App::uses('Model', 'Model');
/**
* SetTest class
diff --git a/lib/Cake/tests/cases/libs/view/helper.test.php b/lib/Cake/tests/cases/libs/view/helper.test.php
index f14704e1c..c00ee271c 100644
--- a/lib/Cake/tests/cases/libs/view/helper.test.php
+++ b/lib/Cake/tests/cases/libs/view/helper.test.php
@@ -20,6 +20,7 @@
App::uses('View', 'View');
App::uses('Helper', 'View');
+App::uses('Model', 'Model');
App::uses('Router', 'Routing');
/**
diff --git a/lib/Cake/tests/cases/libs/view/helpers/text.test.php b/lib/Cake/tests/cases/libs/view/helpers/text.test.php
index 2ac412374..b867c988a 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/text.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/text.test.php
@@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
App::uses('View', 'View');
-App::uses('TextHelper', 'Helper');
+App::uses('TextHelper', 'View/Helper');
/**
* TextHelperTest class
diff --git a/lib/Cake/tests/cases/libs/view/view.test.php b/lib/Cake/tests/cases/libs/view/view.test.php
index 9824b125a..34ca6ae0f 100644
--- a/lib/Cake/tests/cases/libs/view/view.test.php
+++ b/lib/Cake/tests/cases/libs/view/view.test.php
@@ -19,6 +19,7 @@
*/
App::uses('View', 'View');
+App::uses('Helper', 'View');
App::uses('Controller', 'Controller');
App::uses('CacheHelper', 'View/Helper');
App::uses('ErrorHandler', 'Error');
From 5ffc84d28a82de9b12eb85c71de1fed760472143 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 12 Dec 2010 21:14:30 -0500
Subject: [PATCH 064/668] Calling parent constructors in helpers that have it
omitted. Fixes #1359
---
cake/libs/view/helpers/js.php | 1 +
cake/libs/view/helpers/paginator.php | 1 +
2 files changed, 2 insertions(+)
diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php
index 546792c68..5c3571bef 100644
--- a/cake/libs/view/helpers/js.php
+++ b/cake/libs/view/helpers/js.php
@@ -501,6 +501,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return void
*/
function __construct() {
+ parent::__construct();
$this->useNative = function_exists('json_encode');
}
diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php
index f3bb2cdb0..ca5f45541 100644
--- a/cake/libs/view/helpers/paginator.php
+++ b/cake/libs/view/helpers/paginator.php
@@ -88,6 +88,7 @@ class PaginatorHelper extends AppHelper {
* @return void
*/
function __construct($config = array()) {
+ parent::__construct($config);
$ajaxProvider = isset($config['ajax']) ? $config['ajax'] : 'Js';
$this->helpers[] = $ajaxProvider;
$this->_ajaxHelperClass = $ajaxProvider;
From e410509684a9aaeaa1fd7107459d80c4b290d220 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 13 Dec 2010 22:00:37 -0500
Subject: [PATCH 065/668] Fixing TestTask not being able to find plugin objects
when baking test skeletons interactively. Test case added. Fixes #1361
---
cake/console/libs/tasks/test.php | 15 +++++++++++-
.../cases/console/libs/tasks/test.test.php | 23 ++++++++++++++++++-
cake/tests/cases/libs/model/db_acl.test.php | 3 ++-
3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php
index d90a1eb4a..ed9c7e433 100644
--- a/cake/console/libs/tasks/test.php
+++ b/cake/console/libs/tasks/test.php
@@ -181,7 +181,20 @@ class TestTask extends BakeTask {
* @access public
*/
function getClassName($objectType) {
- $options = App::objects(strtolower($objectType));
+ $type = strtolower($objectType);
+ if ($this->plugin) {
+ $path = Inflector::pluralize($type);
+ if ($type === 'helper') {
+ $path = 'views' . DS . $path;
+ } elseif ($type === 'component') {
+ $path = 'controllers' . DS . $path;
+ } elseif ($type === 'behavior') {
+ $path = 'models' . DS . $path;
+ }
+ $options = App::objects($type, App::pluginPath($this->plugin) . $path, false);
+ } else {
+ $options = App::objects($type);
+ }
$this->out(sprintf(__('Choose a %s class', true), $objectType));
$keys = array();
foreach ($options as $key => $option) {
diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php
index e660cdea8..b6f1e8c2a 100644
--- a/cake/tests/cases/console/libs/tasks/test.test.php
+++ b/cake/tests/cases/console/libs/tasks/test.test.php
@@ -44,7 +44,7 @@ Mock::generatePartial(
);
Mock::generatePartial(
'TestTask', 'MockTestTask',
- array('in', '_stop', 'err', 'out', 'createFile', 'isLoadableClass')
+ array('in', '_stop', 'err', 'out', 'hr', 'createFile', 'isLoadableClass')
);
/**
@@ -278,6 +278,7 @@ class TestTaskTest extends CakeTestCase {
*/
function endTest() {
ClassRegistry::flush();
+ App::build();
}
/**
@@ -560,6 +561,26 @@ class TestTaskTest extends CakeTestCase {
$this->Task->bake('Helper', 'Form');
}
+/**
+ * test interactive with plugins lists from the plugin
+ *
+ * @return void
+ */
+ function testInteractiveWithPlugin() {
+ $testApp = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS;
+ App::build(array(
+ 'plugins' => array($testApp)
+ ), true);
+
+ $this->Task->plugin = 'TestPlugin';
+ $path = $testApp . 'test_plugin' . DS . 'tests' . DS . 'cases' . DS . 'helpers' . DS . 'other_helper.test.php';
+ $this->Task->setReturnValueAt(0, 'in', 5); //helper
+ $this->Task->setReturnValueAt(1, 'in', 1); //OtherHelper
+ $this->Task->expectAt(0, 'createFile', array($path, '*'));
+ $this->Task->expectAt(9, 'out', array('1. OtherHelper'));
+ $this->Task->execute();
+ }
+
/**
* Test filename generation for each type + plugins
*
diff --git a/cake/tests/cases/libs/model/db_acl.test.php b/cake/tests/cases/libs/model/db_acl.test.php
index 73e9cf6a6..b970d2332 100644
--- a/cake/tests/cases/libs/model/db_acl.test.php
+++ b/cake/tests/cases/libs/model/db_acl.test.php
@@ -211,7 +211,8 @@ class DbAroUserTest extends CakeTestModel {
* @access public
*/
var $useTable = 'auth_users';
- /**
+
+/**
* bindNode method
*
* @param mixed $ref
From 53a687049ce78e2d2211f51ca89e72d06edd5e40 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 13 Dec 2010 23:23:02 -0500
Subject: [PATCH 066/668] Fixing encoding of address aliases. They are now
mime-encoded like other headers. Tests added. Fixes #1360
---
cake/libs/controller/components/email.php | 5 +++--
.../libs/controller/components/email.test.php | 20 +++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php
index 2aa96c3e0..83ee15df2 100755
--- a/cake/libs/controller/components/email.php
+++ b/cake/libs/controller/components/email.php
@@ -774,14 +774,15 @@ class EmailComponent extends Object{
* @access private
*/
function _formatAddress($string, $smtp = false) {
- $hasAlias = preg_match('/((.*)\s)?<(.+)>/', $string, $matches);
+ $hasAlias = preg_match('/((.*))?\s?<(.+)>/', $string, $matches);
if ($smtp && $hasAlias) {
return $this->_strip('<' . $matches[3] . '>');
} elseif ($smtp) {
return $this->_strip('<' . $string . '>');
}
+
if ($hasAlias && !empty($matches[2])) {
- return $this->_strip($matches[2] . ' <' . $matches[3] . '>');
+ return $this->_encode($matches[2]) . $this->_strip(' <' . $matches[3] . '>');
}
return $this->_strip($string);
}
diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php
index ed80c1b2b..0dbb72d0e 100755
--- a/cake/tests/cases/libs/controller/components/email.test.php
+++ b/cake/tests/cases/libs/controller/components/email.test.php
@@ -1216,6 +1216,9 @@ HTMLBLOC;
$result = $this->Controller->EmailTest->formatAddress('alias ');
$this->assertEqual($result, 'alias ');
+
+ $result = $this->Controller->EmailTest->formatAddress('alias');
+ $this->assertEqual($result, 'alias ');
$result = $this->Controller->EmailTest->formatAddress('email@example.com');
$this->assertEqual($result, 'email@example.com');
@@ -1232,4 +1235,21 @@ HTMLBLOC;
$result = $this->Controller->EmailTest->formatAddress('alias name ', true);
$this->assertEqual($result, '');
}
+
+/**
+ * test formatting addresses with multibyte chars
+ *
+ * @return void
+ */
+ function testFormatAddressMultibyte() {
+ $this->Controller->EmailTest->charset = 'UTF-8';
+ $result = $this->Controller->EmailTest->formatAddress('ÄÖÜTest ');
+ $this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdCA=?= ');
+
+ $result = $this->Controller->EmailTest->formatAddress('ÄÖÜTest');
+ $this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdA==?= ');
+
+ $result = $this->Controller->EmailTest->formatAddress('ÄÖÜTest ', true);
+ $this->assertEqual($result, '');
+ }
}
From 7416e58759856f5c4944eb9d4442aa9f3f7d0525 Mon Sep 17 00:00:00 2001
From: Jeremy Harris
Date: Tue, 14 Dec 2010 20:55:34 -0800
Subject: [PATCH 067/668] Allowed comma-delimited list in smtp $to var to be
consistent with standard mail delivery. Fixes #1353
---
cake/libs/controller/components/email.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php
index 83ee15df2..3bb1357ac 100755
--- a/cake/libs/controller/components/email.php
+++ b/cake/libs/controller/components/email.php
@@ -893,7 +893,7 @@ class EmailComponent extends Object{
}
if (!is_array($this->to)) {
- $tos = array($this->to);
+ $tos = array_map('trim', explode(',', $this->to));
} else {
$tos = $this->to;
}
From 8436fd53d0adc9cbcd96e3d6f09550ca3c03295a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Wed, 15 Dec 2010 01:20:02 -0430
Subject: [PATCH 068/668] Changing initial uses of App::uses() to the new
packages system
---
lib/Cake/Controller/Component/AuthComponent.php | 2 +-
lib/Cake/Controller/Component/CookieComponent.php | 2 +-
lib/Cake/Controller/Component/RequestHandlerComponent.php | 2 +-
lib/Cake/Controller/Component/SecurityComponent.php | 4 ++--
lib/Cake/Network/CakeSocket.php | 2 +-
lib/Cake/Network/HttpSocket.php | 2 +-
lib/Cake/Routing/Route/PluginShortRoute.php | 2 +-
lib/Cake/Routing/Route/RedirectRoute.php | 4 ++--
lib/Cake/Routing/Router.php | 2 +-
lib/Cake/Utility/Security.php | 2 +-
lib/Cake/View/MediaView.php | 2 +-
11 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php
index 7122804af..f96e6dbe9 100644
--- a/lib/Cake/Controller/Component/AuthComponent.php
+++ b/lib/Cake/Controller/Component/AuthComponent.php
@@ -21,7 +21,7 @@
*/
App::uses('Router', 'Routing');
-App::uses('Security', 'Core');
+App::uses('Security', 'Utility');
App::uses('Debugger', 'Utility');
/**
diff --git a/lib/Cake/Controller/Component/CookieComponent.php b/lib/Cake/Controller/Component/CookieComponent.php
index 781d5012c..df0be063d 100644
--- a/lib/Cake/Controller/Component/CookieComponent.php
+++ b/lib/Cake/Controller/Component/CookieComponent.php
@@ -21,7 +21,7 @@
/**
* Load Security class
*/
-App::uses('Security', 'Core');
+App::uses('Security', 'Utility');
/**
* Cookie Component.
diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php
index 4f5cc3dfe..06f4db96b 100644
--- a/lib/Cake/Controller/Component/RequestHandlerComponent.php
+++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php
@@ -20,7 +20,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Xml', 'Core');
+App::uses('Xml', 'Utility');
/**
* Request object for handling HTTP requests
diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php
index 96d275792..e9d0de4a5 100644
--- a/lib/Cake/Controller/Component/SecurityComponent.php
+++ b/lib/Cake/Controller/Component/SecurityComponent.php
@@ -17,8 +17,8 @@
* @since CakePHP(tm) v 0.10.8.2156
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('String', 'Core');
-App::uses('Security', 'Core');
+App::uses('String', 'Utility');
+App::uses('Security', 'Utility');
/**
* SecurityComponent
diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php
index d6dd6f8be..8c0a031e1 100644
--- a/lib/Cake/Network/CakeSocket.php
+++ b/lib/Cake/Network/CakeSocket.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Validation', 'Core');
+App::uses('Validation', 'Utility');
/**
* Cake network socket connection class.
diff --git a/lib/Cake/Network/HttpSocket.php b/lib/Cake/Network/HttpSocket.php
index e2dec93c4..c636cfd63 100644
--- a/lib/Cake/Network/HttpSocket.php
+++ b/lib/Cake/Network/HttpSocket.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('CakeSocket', 'Core');
+App::uses('CakeSocket', 'Network');
App::uses('Router', 'Routing');
/**
diff --git a/lib/Cake/Routing/Route/PluginShortRoute.php b/lib/Cake/Routing/Route/PluginShortRoute.php
index 062cfcbfb..3077226b4 100644
--- a/lib/Cake/Routing/Route/PluginShortRoute.php
+++ b/lib/Cake/Routing/Route/PluginShortRoute.php
@@ -1,5 +1,5 @@
$value) {
$plugins[$key] = Inflector::underscore($value);
}
diff --git a/lib/Cake/Utility/Security.php b/lib/Cake/Utility/Security.php
index 2cbe838b0..ecc59d310 100644
--- a/lib/Cake/Utility/Security.php
+++ b/lib/Cake/Utility/Security.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('String', 'Core');
+App::uses('String', 'Utility');
/**
* Security Library contains utility methods related to security
diff --git a/lib/Cake/View/MediaView.php b/lib/Cake/View/MediaView.php
index 856e8d920..f6cacd078 100644
--- a/lib/Cake/View/MediaView.php
+++ b/lib/Cake/View/MediaView.php
@@ -18,7 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('View', 'View');
-App::uses('CakeRequest', 'Core');
+App::uses('CakeRequest', 'Network');
class MediaView extends View {
/**
From 387281e506501f5747d8df0ccd169a017b4b8ef6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Wed, 15 Dec 2010 01:32:37 -0430
Subject: [PATCH 069/668] Moving newly created classes to the new folders
---
.../Cake/Controller/Component/PaginatorComponent.php | 0
.../Cake/Network/Http/BasicAuthentication.php | 0
.../Cake/Network/Http/DigestAuthentication.php | 0
.../http_response.php => lib/Cake/Network/Http/HttpResponse.php | 0
lib/Cake/Network/{ => Http}/HttpSocket.php | 0
{cake/libs/view => lib/Cake/View}/scaffolds/form.ctp | 0
6 files changed, 0 insertions(+), 0 deletions(-)
rename cake/libs/controller/components/paginator.php => lib/Cake/Controller/Component/PaginatorComponent.php (100%)
rename cake/libs/http/basic_authentication.php => lib/Cake/Network/Http/BasicAuthentication.php (100%)
rename cake/libs/http/digest_authentication.php => lib/Cake/Network/Http/DigestAuthentication.php (100%)
rename cake/libs/http_response.php => lib/Cake/Network/Http/HttpResponse.php (100%)
rename lib/Cake/Network/{ => Http}/HttpSocket.php (100%)
rename {cake/libs/view => lib/Cake/View}/scaffolds/form.ctp (100%)
diff --git a/cake/libs/controller/components/paginator.php b/lib/Cake/Controller/Component/PaginatorComponent.php
similarity index 100%
rename from cake/libs/controller/components/paginator.php
rename to lib/Cake/Controller/Component/PaginatorComponent.php
diff --git a/cake/libs/http/basic_authentication.php b/lib/Cake/Network/Http/BasicAuthentication.php
similarity index 100%
rename from cake/libs/http/basic_authentication.php
rename to lib/Cake/Network/Http/BasicAuthentication.php
diff --git a/cake/libs/http/digest_authentication.php b/lib/Cake/Network/Http/DigestAuthentication.php
similarity index 100%
rename from cake/libs/http/digest_authentication.php
rename to lib/Cake/Network/Http/DigestAuthentication.php
diff --git a/cake/libs/http_response.php b/lib/Cake/Network/Http/HttpResponse.php
similarity index 100%
rename from cake/libs/http_response.php
rename to lib/Cake/Network/Http/HttpResponse.php
diff --git a/lib/Cake/Network/HttpSocket.php b/lib/Cake/Network/Http/HttpSocket.php
similarity index 100%
rename from lib/Cake/Network/HttpSocket.php
rename to lib/Cake/Network/Http/HttpSocket.php
diff --git a/cake/libs/view/scaffolds/form.ctp b/lib/Cake/View/scaffolds/form.ctp
similarity index 100%
rename from cake/libs/view/scaffolds/form.ctp
rename to lib/Cake/View/scaffolds/form.ctp
From a7c7436d8ec758795e0cf38b6062befd12933134 Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sat, 18 Dec 2010 19:31:10 -0200
Subject: [PATCH 070/668] Passing viewVars to cache views, avoiding
cake:nocache problems.
---
cake/libs/view/helpers/cache.php | 2 ++
cake/libs/view/view.php | 1 +
.../cases/libs/view/helpers/cache.test.php | 36 +++++++++++++++++++
3 files changed, 39 insertions(+)
diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php
index adea15cc5..52ebd75b9 100644
--- a/cake/libs/view/helpers/cache.php
+++ b/cake/libs/view/helpers/cache.php
@@ -233,6 +233,7 @@ class CacheHelper extends AppHelper {
$controller->params = $this->params = unserialize(stripslashes(\'' . addslashes(serialize($this->params)) . '\'));
$controller->action = $this->action = unserialize(\'' . serialize($this->action) . '\');
$controller->data = $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->data)) . '\'));
+ $controller->viewVars = $this->viewVars = unserialize(stripslashes(\'' . addslashes(serialize($this->viewVars)) . '\'));
$controller->theme = $this->theme = \'' . $this->theme . '\';
Router::setRequestInfo(array($this->params, array(\'base\' => $this->base, \'webroot\' => $this->webroot)));';
@@ -253,6 +254,7 @@ class CacheHelper extends AppHelper {
$this->loaded[$camelBackedHelper] =& ${$camelBackedHelper};
$this->{$helper} =& $loadedHelpers[$helper];
}
+ extract($this->viewVars, EXTR_SKIP);
?>';
$content = preg_replace("/(<\\?xml)/", "",$content);
$file .= $content;
diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php
index fd1999e9a..dbf7b5f9b 100644
--- a/cake/libs/view/view.php
+++ b/cake/libs/view/view.php
@@ -751,6 +751,7 @@ class View extends Object {
$cache->controllerName = $this->name;
$cache->layout = $this->layout;
$cache->cacheAction = $this->cacheAction;
+ $cache->viewVars = $this->viewVars;
$cache->cache($___viewFn, $out, $cached);
}
}
diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php
index 3a42ec0fa..d2d6b43ee 100644
--- a/cake/tests/cases/libs/view/helpers/cache.test.php
+++ b/cake/tests/cases/libs/view/helpers/cache.test.php
@@ -308,6 +308,42 @@ class CacheHelperTest extends CakeTestCase {
$this->assertPattern('/7\. layout after content and after element with no cache tags/', $contents);
}
+/**
+ * test cache of view vars
+ *
+ * @access public
+ * @return void
+ */
+ function testCacheViewVars() {
+ $this->Controller->cache_parsing();
+ $this->Controller->params = array(
+ 'controller' => 'cache_test',
+ 'action' => 'cache_parsing',
+ 'url' => array(),
+ 'pass' => array(),
+ 'named' => array()
+ );
+ $this->Controller->cacheAction = 21600;
+ $this->Controller->here = '/cacheTest/cache_parsing';
+ $this->Controller->action = 'cache_parsing';
+
+ $View = new View($this->Controller);
+ $result = $View->render('index');
+ $this->assertNoPattern('/cake:nocache/', $result);
+ $this->assertNoPattern('/php echo/', $result);
+
+ $filename = CACHE . 'views' . DS . 'cachetest_cache_parsing.php';
+ $this->assertTrue(file_exists($filename));
+
+ $contents = file_get_contents($filename);
+ $this->assertPattern('/\$this\-\>viewVars.*variable/', $contents);
+ $this->assertPattern('/extract\(\$this\-\>viewVars, EXTR_SKIP\);/', $contents);
+ $this->assertPattern('/php echo \$variable/', $contents);
+ $this->assertPattern('/variableValue/', $contents);
+
+ @unlink($filename);
+ }
+
/**
* test cacheAction set to a boolean
*
From 5d2b4c758dd2de4ac470e25416f35bcb9a3c16cb Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sat, 18 Dec 2010 19:41:57 -0200
Subject: [PATCH 071/668] Minor optimization in cache views.
---
cake/libs/view/helpers/cache.php | 10 +++++-----
cake/tests/cases/libs/view/helpers/cache.test.php | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php
index 52ebd75b9..e2e911b8c 100644
--- a/cake/libs/view/helpers/cache.php
+++ b/cake/libs/view/helpers/cache.php
@@ -225,15 +225,15 @@ class CacheHelper extends AppHelper {
$file .= '$controller =& new ' . $this->controllerName . 'Controller();
$controller->plugin = $this->plugin = \''.$this->plugin.'\';
- $controller->helpers = $this->helpers = unserialize(\'' . serialize($this->helpers) . '\');
+ $controller->helpers = $this->helpers = ' . var_export($this->helpers, true) . ';
$controller->base = $this->base = \'' . $this->base . '\';
$controller->layout = $this->layout = \'' . $this->layout. '\';
$controller->webroot = $this->webroot = \'' . $this->webroot . '\';
$controller->here = $this->here = \'' . $this->here . '\';
- $controller->params = $this->params = unserialize(stripslashes(\'' . addslashes(serialize($this->params)) . '\'));
- $controller->action = $this->action = unserialize(\'' . serialize($this->action) . '\');
- $controller->data = $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->data)) . '\'));
- $controller->viewVars = $this->viewVars = unserialize(stripslashes(\'' . addslashes(serialize($this->viewVars)) . '\'));
+ $controller->params = $this->params = ' . var_export($this->params, true) . ';
+ $controller->action = $this->action = ' . var_export($this->action, true) . ';
+ $controller->data = $this->data = ' . var_export($this->data, true) . ';
+ $controller->viewVars = $this->viewVars = ' . var_export($this->viewVars, true) . ';
$controller->theme = $this->theme = \'' . $this->theme . '\';
Router::setRequestInfo(array($this->params, array(\'base\' => $this->base, \'webroot\' => $this->webroot)));';
diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php
index d2d6b43ee..45edea332 100644
--- a/cake/tests/cases/libs/view/helpers/cache.test.php
+++ b/cake/tests/cases/libs/view/helpers/cache.test.php
@@ -336,7 +336,7 @@ class CacheHelperTest extends CakeTestCase {
$this->assertTrue(file_exists($filename));
$contents = file_get_contents($filename);
- $this->assertPattern('/\$this\-\>viewVars.*variable/', $contents);
+ $this->assertPattern('/\$this\-\>viewVars/', $contents);
$this->assertPattern('/extract\(\$this\-\>viewVars, EXTR_SKIP\);/', $contents);
$this->assertPattern('/php echo \$variable/', $contents);
$this->assertPattern('/variableValue/', $contents);
From 5efa201b9bddb2563e09521f18facd0e1ee7de6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 21:52:03 -0430
Subject: [PATCH 072/668] Moving recently created files into the new folders
---
{cake => lib/Cake}/tests/test_app/config/routes.php | 0
.../test_app/plugins/test_plugin/views/tests/scaffold.form.ctp | 0
.../tests/test_app/views/elements/email/html/nested_element.ctp | 0
{cake => lib/Cake}/tests/test_app/views/elements/html_call.ctp | 0
{cake => lib/Cake}/tests/test_app/views/elements/type_check.ctp | 0
{cake => lib/Cake}/tests/test_app/views/layouts/json/default.ctp | 0
{cake => lib/Cake}/tests/test_app/views/posts/scaffold.form.ctp | 0
{cake => lib/Cake}/tests/test_app/views/tests_apps/json/index.ctp | 0
8 files changed, 0 insertions(+), 0 deletions(-)
rename {cake => lib/Cake}/tests/test_app/config/routes.php (100%)
rename {cake => lib/Cake}/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/email/html/nested_element.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/html_call.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/elements/type_check.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/layouts/json/default.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/posts/scaffold.form.ctp (100%)
rename {cake => lib/Cake}/tests/test_app/views/tests_apps/json/index.ctp (100%)
diff --git a/cake/tests/test_app/config/routes.php b/lib/Cake/tests/test_app/config/routes.php
similarity index 100%
rename from cake/tests/test_app/config/routes.php
rename to lib/Cake/tests/test_app/config/routes.php
diff --git a/cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp b/lib/Cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp
similarity index 100%
rename from cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp
diff --git a/cake/tests/test_app/views/elements/email/html/nested_element.ctp b/lib/Cake/tests/test_app/views/elements/email/html/nested_element.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/email/html/nested_element.ctp
rename to lib/Cake/tests/test_app/views/elements/email/html/nested_element.ctp
diff --git a/cake/tests/test_app/views/elements/html_call.ctp b/lib/Cake/tests/test_app/views/elements/html_call.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/html_call.ctp
rename to lib/Cake/tests/test_app/views/elements/html_call.ctp
diff --git a/cake/tests/test_app/views/elements/type_check.ctp b/lib/Cake/tests/test_app/views/elements/type_check.ctp
similarity index 100%
rename from cake/tests/test_app/views/elements/type_check.ctp
rename to lib/Cake/tests/test_app/views/elements/type_check.ctp
diff --git a/cake/tests/test_app/views/layouts/json/default.ctp b/lib/Cake/tests/test_app/views/layouts/json/default.ctp
similarity index 100%
rename from cake/tests/test_app/views/layouts/json/default.ctp
rename to lib/Cake/tests/test_app/views/layouts/json/default.ctp
diff --git a/cake/tests/test_app/views/posts/scaffold.form.ctp b/lib/Cake/tests/test_app/views/posts/scaffold.form.ctp
similarity index 100%
rename from cake/tests/test_app/views/posts/scaffold.form.ctp
rename to lib/Cake/tests/test_app/views/posts/scaffold.form.ctp
diff --git a/cake/tests/test_app/views/tests_apps/json/index.ctp b/lib/Cake/tests/test_app/views/tests_apps/json/index.ctp
similarity index 100%
rename from cake/tests/test_app/views/tests_apps/json/index.ctp
rename to lib/Cake/tests/test_app/views/tests_apps/json/index.ctp
From 8bcabdea6a30d8b72991bd5ad195a9206be603ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:02:25 -0430
Subject: [PATCH 073/668] Fixing constants for test suite
---
app/webroot/test.php | 7 +------
lib/Cake/Console/Command/TestSuiteShell.php | 8 +-------
lib/Cake/tests/cases/libs/folder.test.php | 1 +
3 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/app/webroot/test.php b/app/webroot/test.php
index 2f6a55e7a..fdf97f457 100644
--- a/app/webroot/test.php
+++ b/app/webroot/test.php
@@ -72,12 +72,7 @@ if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
-$corePath = App::core('cake');
-if (isset($corePath[0])) {
- define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
-} else {
- define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
-}
+define('TEST_CAKE_CORE_INCLUDE_PATH', LIBS);
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
diff --git a/lib/Cake/Console/Command/TestSuiteShell.php b/lib/Cake/Console/Command/TestSuiteShell.php
index 3b3b1f901..9705d05de 100644
--- a/lib/Cake/Console/Command/TestSuiteShell.php
+++ b/lib/Cake/Console/Command/TestSuiteShell.php
@@ -160,13 +160,7 @@ class TestSuiteShell extends Shell {
* @return void
*/
public function initialize() {
- $corePath = App::core('cake');
- if (isset($corePath[0])) {
- define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
- } else {
- define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
- }
-
+ define('TEST_CAKE_CORE_INCLUDE_PATH', LIBS);
$this->_dispatcher = new CakeTestSuiteDispatcher();
$this->_dispatcher->loadTestFramework();
}
diff --git a/lib/Cake/tests/cases/libs/folder.test.php b/lib/Cake/tests/cases/libs/folder.test.php
index f70b60e84..65ca682ab 100644
--- a/lib/Cake/tests/cases/libs/folder.test.php
+++ b/lib/Cake/tests/cases/libs/folder.test.php
@@ -17,6 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4206
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Folder', 'Utility');
App::uses('File', 'Utility');
/**
From ad78f1dc746a9a8e9f637fb0c20a28b5bc7c73b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:07:30 -0430
Subject: [PATCH 074/668] Adding support for plugin classes back, Allowing the
user to override core classes in app/libs Adding some backward compatibility
for App::path() and App::build()
---
lib/Cake/Core/App.php | 177 +++++++++++++++++++++++++++++-------------
1 file changed, 122 insertions(+), 55 deletions(-)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index a5f7019a0..8b7ad40bc 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -213,6 +213,27 @@ class App {
*/
private static $__packages = array();
+/**
+ *
+ *
+ */
+ private static $__packageFormat = array();
+
+/**
+ * Maps an old style cakephp class type to the corresponding package
+ *
+ */
+ public static $legacy = array(
+ 'models' => 'Model',
+ 'behaviors' => 'Model/Behavior',
+ 'datasources' => 'Model/Datasource',
+ 'controllers' => 'Controller',
+ 'components' => 'Model/Datasource',
+ 'views' => 'View',
+ 'helpers' => 'View/Helper',
+ 'shells' => 'Console'
+ );
+
/**
* Inicates whether the class cache should be stored again because of an addition to it
*
@@ -235,7 +256,24 @@ class App {
* @param string $type type of path
* @return string array
*/
- public static function path($type) {
+ public static function path($type, $plugin = null) {
+ if (!empty(self::$legacy[$type])) {
+ $type = self::$legacy[$type];
+ }
+
+ if (!empty($plugin)) {
+ $path = array();
+ $pluginPath = self::pluginPath($plugin);
+ if (!empty(self::$__packageFormat[$type])) {
+ foreach (self::$__packageFormat[$type] as $f) {
+ $path[] = sprintf($f, $pluginPath);
+ }
+ return $path;
+ }
+
+ return $pluginPath . 'libs' . DS . $type;
+ }
+
if (!isset(self::$__packages[$type])) {
return array();
}
@@ -251,32 +289,50 @@ class App {
* @return void
*/
public static function build($paths = array(), $reset = false) {
- $defaults = array(
- 'Model' => array(MODELS),
- 'Model/Behavior' => array(BEHAVIORS),
- 'Datasource' => array(MODELS . 'datasources'),
- 'Controller' => array(CONTROLLERS),
- 'Controller/Component' => array(COMPONENTS),
- 'libs' => array(APPLIBS),
- 'View' => array(VIEWS),
- 'View/Helper' => array(HELPERS),
- 'locales' => array(APP . 'locale' . DS),
- 'Console' => array(
- APP . 'console' . DS . 'shells' . DS,
- APP . 'vendors' . DS . 'shells' . DS,
- VENDORS . 'shells' . DS
- ),
- 'vendors' => array(APP . 'vendors' . DS, VENDORS),
- 'plugins' => array(APP . 'plugins' . DS)
- );
+ if (empty(self::$__packageFormat)) {
+ self::$__packageFormat = array(
+ 'Model' => array('%s' . 'models' . DS),
+ 'Model/Behavior' => array('%s' . 'models' . DS . 'behaviors' . DS),
+ 'Model/Datasource' => array('%s' . 'models' . DS . 'datasources' . DS),
+ 'Model/Datasource/Database' => array('%s' . 'models' . DS . 'datasources' . DS . 'database' . DS),
+ 'Controller' => array('%s' . 'controllers' . DS),
+ 'Controller/Component' => array('%s' . 'controllers' . DS . 'components' . DS),
+ 'View' => array('%s' . 'views' . DS),
+ 'View/Helper' => array('%s' . 'views' . DS . 'helpers' . DS),
+ 'Console' => array(
+ '%s' . 'console' . DS . 'shells' . DS,
+ '%s' . 'vendors' . DS . 'shells' . DS,
+ VENDORS . 'shells' . DS
+ ),
+ 'libs' => array('%s' . 'libs' . DS),
+ 'locales' => array('%s' . 'locale' . DS),
+ 'vendors' => array('%s' . 'vendors' . DS, VENDORS),
+ 'plugins' => array(APP . 'plugins' . DS)
+ );
+
+ self::$__packageFormat['Console/Command'] = self::$__packageFormat['Console'];
+ }
if ($reset == true) {
foreach ($paths as $type => $new) {
+ if (!empty(self::$legacy[$type])) {
+ $type = self::$legacy[$type];
+ }
self::$__packages[$type] = (array)$new;
}
return $paths;
}
+ $defaults = array();
+ foreach (self::$__packageFormat as $package => $format) {
+ foreach ($format as $f) {
+ $defaults[$package][] = sprintf($f, APP);
+ }
+ }
+
+ $mergeExclude = array('libs', 'locales', 'vendors', 'plugins');
+ $appLibs = empty($paths['libs']) ? $defaults['libs'] : $paths['libs'];
+
foreach ($defaults as $type => $default) {
if (empty(self::$__packages[$type]) || empty($paths)) {
@@ -284,13 +340,12 @@ class App {
}
if (!empty($paths[$type])) {
- $path = array_flip(array_flip(array_merge(
- (array)$paths[$type], self::$__packages[$type])));
- self::$__packages[$type] = array_values($path);
+ $path = array_merge((array)$paths[$type], self::$__packages[$type]);
} else {
- $path = array_flip(array_flip(self::$__packages[$type]));
- self::$__packages[$type] = array_values($path);
+ $path = self::$__packages[$type];
}
+
+ self::$__packages[$type] = array_values(array_unique($path));
}
}
@@ -302,12 +357,12 @@ class App {
*/
public static function pluginPath($plugin) {
$pluginDir = Inflector::underscore($plugin);
- for ($i = 0, $length = count(self::$plugins); $i < $length; $i++) {
- if (is_dir(self::$plugins[$i] . $pluginDir)) {
- return self::$plugins[$i] . $pluginDir . DS ;
+ foreach (self::$__packages['plugins'] as $pluginPath) {
+ if (is_dir($pluginPath . $pluginDir)) {
+ return $pluginPath . $pluginDir . DS ;
}
}
- return self::$plugins[0] . $pluginDir . DS;
+ return self::$__packages['plugins'][0] . $pluginDir . DS;
}
/**
@@ -318,46 +373,35 @@ class App {
*/
public static function themePath($theme) {
$themeDir = 'themed' . DS . Inflector::underscore($theme);
- for ($i = 0, $length = count(self::$views); $i < $length; $i++) {
- if (is_dir(self::$views[$i] . $themeDir)) {
- return self::$views[$i] . $themeDir . DS ;
+ foreach (self::$__packages['View'] as $path) {
+ if (is_dir($path . $themeDir)) {
+ return $path . $themeDir . DS ;
}
}
- return self::$views[0] . $themeDir . DS;
+ return self::$__packages['View'][0] . $themeDir . DS;
}
/**
* Returns a key/value list of all paths where core libs are found.
* Passing $type only returns the values for a given value of $key.
*
- * @param string $type valid values are: 'model', 'behavior', 'controller', 'component',
- * 'view', 'helper', 'datasource', 'libs', and 'cake'
+ * @param string $type valid values are: 'cake' ,'plugins', 'vendors' and 'shells'
* @return array numeric keyed array of core lib paths
*/
public static function core($type = null) {
static $paths = false;
if (!$paths) {
$paths = array();
- $cake = $libs = LIBS;
- $path = dirname($cake) . DS;
-
- $paths['cake'][] = $cake;
- $paths['libs'][] = $libs;
- $paths['models'][] = $libs . 'model' . DS;
- $paths['datasources'][] = $libs . 'model' . DS . 'datasources' . DS;
- $paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS;
- $paths['controllers'][] = $libs . 'controller' . DS;
- $paths['components'][] = $libs . 'controller' . DS . 'components' . DS;
- $paths['views'][] = $libs . 'View' . DS;
- $paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS;
- $paths['plugins'][] = $path . 'plugins' . DS;
- $paths['vendors'][] = $path . 'vendors' . DS;
- $paths['shells'][] = $libs . 'Console' . DS . 'Command' . DS;
+ $root = dirname(dirname(LIBS)) . DS;
+ $paths['cake'][] = $root;
+ $paths['plugins'][] = $root . 'plugins' . DS;
+ $paths['vendors'][] = $root . 'vendors' . DS;
+ $paths['shells'][] = LIBS . 'Console' . DS . 'Command' . DS;
// Provide BC path to vendors/shells
- $paths['shells'][] = $path . 'vendors' . DS . 'shells' . DS;
+ $paths['shells'][] = $root . 'vendors' . DS . 'shells' . DS;
}
- if ($type && isset($paths[$type])) {
- return $paths[$type];
+ if ($type) {
+ return isset($paths[$type]) ? $paths[$type] : array(LIBS . $type . DS);
}
return $paths;
}
@@ -453,9 +497,14 @@ class App {
return include $file;
}
- $package = self::$__classMap[$className];
- $paths = self::path($package);
- $paths[] = LIBS . self::$__classMap[$className] . DS;
+ list($plugin, $package) = pluginSplit(self::$__classMap[$className]);
+ $paths = self::path($package, $plugin);
+
+ if (empty($plugin)) {
+ $appLibs = empty(self::$__packages['libs']) ? APPLIBS : self::$__packages['libs'];
+ $paths[] = $appLibs . self::$__classMap[$className] . DS;
+ $paths[] = LIBS . self::$__classMap[$className] . DS;
+ }
foreach ($paths as $path) {
$file = $path . $className . '.php';
@@ -464,7 +513,25 @@ class App {
return include $file;
}
}
+
+ //To help apps migrate to 2.0 old style file names are allowed
+ foreach ($paths as $path) {
+ $underscored = Inflector::underscore($className);
+ $tries = array($path . $underscored . '.php');
+ $parts = explode('_', $underscored);
+ if (count($parts) > 1) {
+ array_pop($parts);
+ $tries[] = $path . implode('_', $parts) . '.php';
+ }
+ foreach ($tries as $file) {
+ if (file_exists($file)) {
+ self::__map($file, $className);
+ return include $file;
+ }
+ }
+ }
}
+
return false;
}
From 151a4bdb33fa73fe44b196e5499e71925379e7d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:09:08 -0430
Subject: [PATCH 075/668] Fixing view files finding and making tests pass
---
lib/Cake/View/HelperCollection.php | 4 ++--
lib/Cake/View/View.php | 6 +++---
lib/Cake/tests/cases/libs/view/view.test.php | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php
index fe5f74ad5..fa7503456 100644
--- a/lib/Cake/View/HelperCollection.php
+++ b/lib/Cake/View/HelperCollection.php
@@ -54,11 +54,11 @@ class HelperCollection extends ObjectCollection {
return $this->_loaded[$name];
}
$helperClass = $name . 'Helper';
- App::uses($helperClass, 'View/Helper');
+ App::uses($helperClass, $plugin . 'View/Helper');
if (!class_exists($helperClass)) {
throw new MissingHelperClassException(array(
'class' => $helperClass,
- 'file' => Inflector::underscore($name) . '.php'
+ 'file' => $helperClass . '.php'
));
}
$this->_loaded[$name] = new $helperClass($this->_View, $settings);
diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php
index f524328ed..e24fed5c4 100644
--- a/lib/Cake/View/View.php
+++ b/lib/Cake/View/View.php
@@ -803,7 +803,7 @@ class View extends Object {
}
$paths = array();
$viewPaths = App::path('View');
- $corePaths = array_flip(App::core('views'));
+ $corePaths = array_flip(App::core('View'));
if (!empty($plugin)) {
$count = count($viewPaths);
@@ -812,10 +812,10 @@ class View extends Object {
$paths[] = $viewPaths[$i] . 'plugins' . DS . $plugin . DS;
}
}
- $paths[] = App::pluginPath($plugin) . 'views' . DS;
+ $paths = array_merge($paths, App::path('View', $plugin));
}
- $this->__paths = array_merge($paths, $viewPaths, array_flip($corePaths));
+ $this->__paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
return $this->__paths;
}
}
diff --git a/lib/Cake/tests/cases/libs/view/view.test.php b/lib/Cake/tests/cases/libs/view/view.test.php
index 17c5c6274..61762f475 100644
--- a/lib/Cake/tests/cases/libs/view/view.test.php
+++ b/lib/Cake/tests/cases/libs/view/view.test.php
@@ -204,7 +204,7 @@ class ViewTest extends CakeTestCase {
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
+ TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
)
), true);
@@ -268,7 +268,7 @@ class ViewTest extends CakeTestCase {
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
+ TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
);
$this->assertEqual($paths, $expected);
}
From 5e1b49918bf8d3d99f628226d851e48511cc6e4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:26:23 -0430
Subject: [PATCH 076/668] Fixing App::core('cake')
---
lib/Cake/Core/App.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index 8b7ad40bc..e541c5f51 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -393,7 +393,7 @@ class App {
if (!$paths) {
$paths = array();
$root = dirname(dirname(LIBS)) . DS;
- $paths['cake'][] = $root;
+ $paths['cake'][] = LIBS;
$paths['plugins'][] = $root . 'plugins' . DS;
$paths['vendors'][] = $root . 'vendors' . DS;
$paths['shells'][] = LIBS . 'Console' . DS . 'Command' . DS;
From 633f1dc1e5f72a1ed25e60bdb1b54e54506bd4ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:27:02 -0430
Subject: [PATCH 077/668] Fixing warning in ConnectionManager
---
lib/Cake/Model/ConnectionManager.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index 324dcf554..5500e7547 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -180,7 +180,7 @@ class ConnectionManager {
App::uses($conn['classname'], $plugin . 'Model/Datasource' . $package);
if (!class_exists($conn['classname'])) {
- trigger_error(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', $class), E_USER_ERROR);
+ trigger_error(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', $conn['classname']), E_USER_ERROR);
return null;
}
return true;
From e8c73170ba2d2211637e5e88c4582609ef6b1c9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:27:28 -0430
Subject: [PATCH 078/668] Ficing a couple of notices when using a mocked
CakeRequest
---
lib/Cake/Network/CakeRequest.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php
index bd0ad3bb4..403624505 100644
--- a/lib/Cake/Network/CakeRequest.php
+++ b/lib/Cake/Network/CakeRequest.php
@@ -273,7 +273,7 @@ class CakeRequest implements ArrayAccess {
$config = Configure::read('App');
extract($config);
- if (!$base) {
+ if (empty($base)) {
$base = $this->base;
}
@@ -281,7 +281,7 @@ class CakeRequest implements ArrayAccess {
$this->webroot = $base . '/';
return $base;
}
- if (!$baseUrl) {
+ if (empty($baseUrl)) {
$replace = array('<', '>', '*', '\'', '"');
$base = str_replace($replace, '', dirname(env('PHP_SELF')));
From 5f7ca8d2b660ff4b8a802c4506c6542e98a22fb5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:27:55 -0430
Subject: [PATCH 079/668] Removing some internal chenck for the "driver" key in
database configs
---
.../tests/cases/libs/model/model_write.test.php | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/Cake/tests/cases/libs/model/model_write.test.php b/lib/Cake/tests/cases/libs/model/model_write.test.php
index 43f8846ef..bf72dbf2a 100644
--- a/lib/Cake/tests/cases/libs/model/model_write.test.php
+++ b/lib/Cake/tests/cases/libs/model/model_write.test.php
@@ -148,7 +148,7 @@ class ModelWriteTest extends BaseModelTest {
*/
function testAutoSaveUuid() {
// SQLite does not support non-integer primary keys
- $this->skipIf($this->db->config['driver'] == 'sqlite');
+ $this->skipIf($this->db instanceof Sqlite);
$this->loadFixtures('Uuid');
$TestModel = new Uuid();
@@ -170,7 +170,7 @@ class ModelWriteTest extends BaseModelTest {
*/
public function testSaveUuidNull() {
// SQLite does not support non-integer primary keys
- $this->skipIf($this->db->config['driver'] == 'sqlite');
+ $this->skipIf($this->db instanceof Sqlite);
$this->loadFixtures('Uuid');
$TestModel = new Uuid();
@@ -192,7 +192,7 @@ class ModelWriteTest extends BaseModelTest {
*/
function testZeroDefaultFieldValue() {
$this->skipIf(
- $this->db->config['driver'] == 'sqlite',
+ $this->db instanceof Sqlite,
'%s SQLite uses loose typing, this operation is unsupported'
);
$this->loadFixtures('DataTest');
@@ -409,7 +409,7 @@ class ModelWriteTest extends BaseModelTest {
*/
public function testCounterCacheWithSelfJoin() {
$skip = $this->skipIf(
- ($this->db->config['driver'] == 'sqlite'),
+ ($this->db instanceof Sqlite),
'SQLite 2.x does not support ALTER TABLE ADD COLUMN'
);
if ($skip) {
@@ -2988,7 +2988,7 @@ class ModelWriteTest extends BaseModelTest {
$this->getMock('DboSource', array(), array(), 'MockTransactionDboSource');
$db = ConnectionManager::create('mock_transaction', array(
- 'datasource' => 'MockTransactionDbo',
+ 'datasource' => 'MockTransactionDboSource',
));
$db->expects($this->at(2))
->method('isInterfaceSupported')
@@ -3023,7 +3023,7 @@ class ModelWriteTest extends BaseModelTest {
$mock = $this->getMock('DboSource', array(), array(), 'MockTransactionAssociatedDboSource', false);
$db =& ConnectionManager::create('mock_transaction_assoc', array(
- 'datasource' => 'MockTransactionAssociatedDbo',
+ 'datasource' => 'MockTransactionAssociatedDboSource',
));
$this->mockObjects[] = $db;
$db->columns = $testDb->columns;
@@ -3841,7 +3841,7 @@ class ModelWriteTest extends BaseModelTest {
*/
function testProductUpdateAll() {
$this->skipIf(
- $this->db->config['driver'] != 'mysql',
+ !$this->db instanceof Mysql,
'%s Currently, there is no way of doing joins in an update statement in postgresql or sqlite'
);
$this->loadFixtures('ProductUpdateAll', 'GroupUpdateAll');
@@ -3892,7 +3892,7 @@ class ModelWriteTest extends BaseModelTest {
*/
function testProductUpdateAllWithoutForeignKey() {
$this->skipIf(
- $this->db->config['driver'] != 'mysql',
+ !$this->db instanceof Mysql,
'%s Currently, there is no way of doing joins in an update statement in postgresql'
);
$this->loadFixtures('ProductUpdateAll', 'GroupUpdateAll');
From 5605bf2d9ee9d746cf11b2a3ad21d8ea00e14c86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sat, 18 Dec 2010 22:32:20 -0430
Subject: [PATCH 080/668] Fixing failing test for HelperCollection
---
lib/Cake/tests/cases/libs/view/helper_collection.test.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Cake/tests/cases/libs/view/helper_collection.test.php b/lib/Cake/tests/cases/libs/view/helper_collection.test.php
index 43048973b..54aa16cde 100644
--- a/lib/Cake/tests/cases/libs/view/helper_collection.test.php
+++ b/lib/Cake/tests/cases/libs/view/helper_collection.test.php
@@ -73,7 +73,7 @@ class HelperCollectionTest extends CakeTestCase {
/**
* test missinghelper exception
*
- * @expectedException MissingHelperFileException
+ * @expectedException MissingHelperClassException
* @return void
*/
function testLoadMissingHelperFile() {
From 5fa028839e9004c1bd3347f4a35fef45d8de628d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 19 Dec 2010 23:17:53 -0430
Subject: [PATCH 081/668] Fixing paths location in cake.php files
---
app/console/cake.php | 2 +-
lib/Cake/Console/templates/skel/console/cake.php | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/console/cake.php b/app/console/cake.php
index af02ae4ff..6a91ffc98 100755
--- a/app/console/cake.php
+++ b/app/console/cake.php
@@ -20,6 +20,6 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'cake' . DIRECTORY_SEPARATOR . 'console' . DIRECTORY_SEPARATOR . 'shell_dispatcher.php');
+require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'lib'. DIRECTORY_SEPARATOR . 'Cake' . DIRECTORY_SEPARATOR . 'Console' . DIRECTORY_SEPARATOR . 'ShellDispatcher.php');
return ShellDispatcher::run($argv);
diff --git a/lib/Cake/Console/templates/skel/console/cake.php b/lib/Cake/Console/templates/skel/console/cake.php
index 8ccac0bfb..fc0c0b484 100644
--- a/lib/Cake/Console/templates/skel/console/cake.php
+++ b/lib/Cake/Console/templates/skel/console/cake.php
@@ -20,6 +20,7 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-require_once(__CAKE_PATH__ . 'shell_dispatcher.php');
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'ShellDispatcher.php');
return ShellDispatcher::run($argv);
+
From b2ad8fe113aaa4025c75d2f89cea0b2c047f6ac7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 19 Dec 2010 23:33:37 -0430
Subject: [PATCH 082/668] Removing constant TEST_CAKE_CORE_INCLUDE_PATH
---
app/webroot/test.php | 2 -
.../cases/libs/controller_test_case.test.php | 20 +++---
lib/Cake/Console/Command/TestSuiteShell.php | 1 -
.../Console/templates/skel/webroot/test.php | 13 +---
.../TestSuite/Coverage/BaseCoverageReport.php | 2 +-
.../TestSuite/Fixture/CakeFixtureManager.php | 2 +-
lib/Cake/tests/cases/basics.test.php | 2 +-
.../console/libs/task_collection.test.php | 2 +-
.../cases/console/shell_dispatcher.test.php | 4 +-
.../console/shells/command_list.test.php | 4 +-
.../cases/console/shells/schema.test.php | 12 ++--
.../tests/cases/console/shells/shell.test.php | 4 +-
.../console/shells/tasks/extract.test.php | 8 +--
.../console/shells/tasks/template.test.php | 4 +-
lib/Cake/tests/cases/libs/app.test.php | 46 ++++++-------
lib/Cake/tests/cases/libs/cache.test.php | 12 ++--
lib/Cake/tests/cases/libs/cake_log.test.php | 4 +-
.../tests/cases/libs/cake_session.test.php | 8 +--
.../cases/libs/config/ini_reader.test.php | 2 +-
.../cases/libs/config/php_reader.test.php | 4 +-
lib/Cake/tests/cases/libs/configure.test.php | 4 +-
.../cases/libs/controller/component.test.php | 12 ++--
.../controller/component_collection.test.php | 2 +-
.../libs/controller/components/acl.test.php | 4 +-
.../libs/controller/components/auth.test.php | 11 ++-
.../libs/controller/components/email.test.php | 13 ++--
.../components/request_handler.test.php | 4 +-
.../cases/libs/controller/controller.test.php | 32 ++++-----
.../libs/controller/pages_controller.test.php | 12 +++-
.../cases/libs/controller/scaffold.test.php | 34 +++++-----
lib/Cake/tests/cases/libs/dispatcher.test.php | 28 ++++----
.../cases/libs/error/error_handler.test.php | 4 +-
.../libs/error/exception_renderer.test.php | 6 +-
lib/Cake/tests/cases/libs/folder.test.php | 68 +++++++++----------
.../cases/libs/html_coverage_report.test.php | 8 +--
lib/Cake/tests/cases/libs/i18n.test.php | 6 +-
.../cases/libs/model/cake_schema.test.php | 4 +-
.../libs/model/connection_manager.test.php | 14 ++--
lib/Cake/tests/cases/libs/object.test.php | 24 +++----
lib/Cake/tests/cases/libs/router.test.php | 4 +-
.../tests/cases/libs/view/helper.test.php | 10 +--
.../libs/view/helper_collection.test.php | 2 +-
.../cases/libs/view/helpers/cache.test.php | 2 +-
.../cases/libs/view/helpers/html.test.php | 8 +--
.../cases/libs/view/helpers/session.test.php | 2 +-
.../cases/libs/view/helpers/time.test.php | 4 +-
lib/Cake/tests/cases/libs/view/media.test.php | 6 +-
lib/Cake/tests/cases/libs/view/theme.test.php | 21 +++---
lib/Cake/tests/cases/libs/view/view.test.php | 40 +++++------
lib/Cake/tests/cases/libs/xml.test.php | 10 +--
50 files changed, 277 insertions(+), 278 deletions(-)
diff --git a/app/webroot/test.php b/app/webroot/test.php
index fdf97f457..94c7f8784 100644
--- a/app/webroot/test.php
+++ b/app/webroot/test.php
@@ -72,8 +72,6 @@ if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
-define('TEST_CAKE_CORE_INCLUDE_PATH', LIBS);
-
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
}
diff --git a/cake/tests/cases/libs/controller_test_case.test.php b/cake/tests/cases/libs/controller_test_case.test.php
index c457da428..0ec621ccb 100644
--- a/cake/tests/cases/libs/controller_test_case.test.php
+++ b/cake/tests/cases/libs/controller_test_case.test.php
@@ -21,7 +21,7 @@
*/
App::import('Controller', 'Controller', false);
App::import('Core', array('AppModel', 'Model'));
-require_once TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_html_reporter.php';
+require_once LIBS . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_html_reporter.php';
require_once dirname(__FILE__) . DS . 'model' . DS . 'models.php';
/**
@@ -108,10 +108,10 @@ class ControllerTestCaseTest extends CakeTestCase {
function setUp() {
parent::setUp();
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS)
));
$this->Case = new ControllerTestCase();
Router::reload();
@@ -222,7 +222,7 @@ class ControllerTestCaseTest extends CakeTestCase {
* Tests using loaded routes during tests
*/
function testUseRoutes() {
- include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
+ include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$controller = $this->Case->generate('TestsApps');
$controller->Components->load('RequestHandler');
$result = $this->Case->testAction('/tests_apps/index.json', array('return' => 'view'));
@@ -230,16 +230,16 @@ class ControllerTestCaseTest extends CakeTestCase {
$expected = array('cakephp' => 'cool');
$this->assertEquals($result, $expected);
- include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
+ include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$result = $this->Case->testAction('/some_alias');
$this->assertEquals($result, 5);
- include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
+ include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$this->Case->testAction('/redirect_me_now');
$result = $this->Case->headers['Location'];
$this->assertEquals($result, 'http://cakephp.org');
- include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
+ include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$this->Case->testAction('/redirect_me');
$result = $this->Case->headers['Location'];
$this->assertEquals($result, Router::url(array('controller' => 'tests_apps', 'action' => 'some_method'), true));
@@ -251,7 +251,7 @@ class ControllerTestCaseTest extends CakeTestCase {
* @expectedException MissingActionException
*/
function testSkipRoutes() {
- include TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
+ include LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS . 'routes.php';
$this->Case->loadRoutes = false;
diff --git a/lib/Cake/Console/Command/TestSuiteShell.php b/lib/Cake/Console/Command/TestSuiteShell.php
index 9705d05de..c62205162 100644
--- a/lib/Cake/Console/Command/TestSuiteShell.php
+++ b/lib/Cake/Console/Command/TestSuiteShell.php
@@ -160,7 +160,6 @@ class TestSuiteShell extends Shell {
* @return void
*/
public function initialize() {
- define('TEST_CAKE_CORE_INCLUDE_PATH', LIBS);
$this->_dispatcher = new CakeTestSuiteDispatcher();
$this->_dispatcher->loadTestFramework();
}
diff --git a/lib/Cake/Console/templates/skel/webroot/test.php b/lib/Cake/Console/templates/skel/webroot/test.php
index 7a27e8e29..94c7f8784 100644
--- a/lib/Cake/Console/templates/skel/webroot/test.php
+++ b/lib/Cake/Console/templates/skel/webroot/test.php
@@ -50,7 +50,7 @@ ini_set('display_errors', 1);
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
- define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ define('CAKE_CORE_INCLUDE_PATH', ROOT . DS .'lib');
}
/**
@@ -68,21 +68,14 @@ if (!defined('CORE_PATH')) {
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
-if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
+if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
-$corePath = App::core('cake');
-if (isset($corePath[0])) {
- define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS);
-} else {
- define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
-}
-
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
}
-require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
+require_once CAKE_TESTS_LIB . 'CakeTestSuiteDispatcher.php';
CakeTestSuiteDispatcher::run();
diff --git a/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php b/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
index d532f06d6..c259c338d 100644
--- a/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
+++ b/lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
@@ -102,7 +102,7 @@ abstract class BaseCoverageReport {
} elseif ($this->pluginTest) {
$path = App::pluginPath($this->pluginTest);
} else {
- $path = TEST_CAKE_CORE_INCLUDE_PATH;
+ $path = LIBS;
}
return $path;
}
diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
index 66bf11352..b46c48c26 100644
--- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
+++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
@@ -128,7 +128,7 @@ class CakeFixtureManager {
$fixturePaths = array(
TESTS . 'fixtures',
VENDORS . 'tests' . DS . 'fixtures',
- TEST_CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'tests' . DS . 'fixtures'
+ LIBS . DS . 'cake' . DS . 'tests' . DS . 'fixtures'
);
}
diff --git a/lib/Cake/tests/cases/basics.test.php b/lib/Cake/tests/cases/basics.test.php
index fca3079df..255158a88 100644
--- a/lib/Cake/tests/cases/basics.test.php
+++ b/lib/Cake/tests/cases/basics.test.php
@@ -36,7 +36,7 @@ class BasicsTest extends CakeTestCase {
*/
public function setUp() {
App::build(array(
- 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
+ 'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
));
$this->_language = Configure::read('Config.language');
}
diff --git a/lib/Cake/tests/cases/console/libs/task_collection.test.php b/lib/Cake/tests/cases/console/libs/task_collection.test.php
index e2efdfb0e..ac22f2ac2 100644
--- a/lib/Cake/tests/cases/console/libs/task_collection.test.php
+++ b/lib/Cake/tests/cases/console/libs/task_collection.test.php
@@ -89,7 +89,7 @@ class TaskCollectionTest extends CakeTestCase {
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
$shell = $this->getMock('Shell', array(), array(), '', false);
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Tasks = new TaskCollection($shell, $dispatcher);
diff --git a/lib/Cake/tests/cases/console/shell_dispatcher.test.php b/lib/Cake/tests/cases/console/shell_dispatcher.test.php
index 2da5bbe81..f0e342f51 100644
--- a/lib/Cake/tests/cases/console/shell_dispatcher.test.php
+++ b/lib/Cake/tests/cases/console/shell_dispatcher.test.php
@@ -119,11 +119,11 @@ class ShellDispatcherTest extends CakeTestCase {
parent::setUp();
App::build(array(
'plugins' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
),
'shells' => array(
CORE_PATH ? CONSOLE_LIBS : ROOT . DS . CONSOLE_LIBS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
)
), true);
}
diff --git a/lib/Cake/tests/cases/console/shells/command_list.test.php b/lib/Cake/tests/cases/console/shells/command_list.test.php
index 6f25ed68b..602037cf3 100644
--- a/lib/Cake/tests/cases/console/shells/command_list.test.php
+++ b/lib/Cake/tests/cases/console/shells/command_list.test.php
@@ -39,13 +39,13 @@ class CommandListTest extends CakeTestCase {
parent::setUp();
App::build(array(
'plugins' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
),
'shells' => array(
CORE_PATH ?
CORE_PATH . CAKE . 'console' . DS . 'shells' . DS :
CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'shells' .DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS
)
), true);
App::objects('plugin', null, false);
diff --git a/lib/Cake/tests/cases/console/shells/schema.test.php b/lib/Cake/tests/cases/console/shells/schema.test.php
index d438335e2..ae95a52df 100644
--- a/lib/Cake/tests/cases/console/shells/schema.test.php
+++ b/lib/Cake/tests/cases/console/shells/schema.test.php
@@ -187,7 +187,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testViewWithPlugins() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->args = array('TestPlugin.schema');
$this->Shell->startup();
@@ -236,7 +236,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testDumpFileWritingWithPlugins() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->args = array('TestPlugin.TestPluginApp');
$this->Shell->params = array(
@@ -332,7 +332,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testGenerateWithPlugins() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
App::objects('plugin', null, false);
@@ -445,14 +445,14 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testPluginParam() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->params = array(
'plugin' => 'TestPlugin',
'connection' => 'test'
);
$this->Shell->startup();
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'config' . DS . 'schema';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'config' . DS . 'schema';
$this->assertEqual($this->Shell->Schema->path, $expected);
}
@@ -463,7 +463,7 @@ class SchemaShellTest extends CakeTestCase {
*/
public function testPluginDotSyntaxWithCreate() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$this->Shell->params = array(
'connection' => 'test'
diff --git a/lib/Cake/tests/cases/console/shells/shell.test.php b/lib/Cake/tests/cases/console/shells/shell.test.php
index fcd8d4dd6..457af05d5 100644
--- a/lib/Cake/tests/cases/console/shells/shell.test.php
+++ b/lib/Cake/tests/cases/console/shells/shell.test.php
@@ -174,8 +174,8 @@ class ShellTest extends CakeTestCase {
*/
public function testInitialize() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
), true);
$this->Shell->uses = array('TestPlugin.TestPluginPost');
diff --git a/lib/Cake/tests/cases/console/shells/tasks/extract.test.php b/lib/Cake/tests/cases/console/shells/tasks/extract.test.php
index 6d634e5b4..e4c81e182 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/extract.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/extract.test.php
@@ -72,7 +72,7 @@ class ExtractTaskTest extends CakeTestCase {
public function testExecute() {
$this->Task->interactive = false;
- $this->Task->params['paths'] = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages';
+ $this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages';
$this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in')
@@ -154,7 +154,7 @@ class ExtractTaskTest extends CakeTestCase {
function testExtractWithExclude() {
$this->Task->interactive = false;
- $this->Task->params['paths'] = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views';
+ $this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views';
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['exclude'] = 'pages,layouts';
@@ -181,8 +181,8 @@ class ExtractTaskTest extends CakeTestCase {
$this->Task->interactive = false;
$this->Task->params['paths'] =
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages,' .
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'posts';
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages,' .
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'posts';
$this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err');
diff --git a/lib/Cake/tests/cases/console/shells/tasks/template.test.php b/lib/Cake/tests/cases/console/shells/tasks/template.test.php
index c2b162dd8..273beb968 100644
--- a/lib/Cake/tests/cases/console/shells/tasks/template.test.php
+++ b/lib/Cake/tests/cases/console/shells/tasks/template.test.php
@@ -126,7 +126,7 @@ class TemplateTaskTest extends CakeTestCase {
public function testGenerate() {
App::build(array(
'shells' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS
)
));
$this->Task->initialize();
@@ -146,7 +146,7 @@ class TemplateTaskTest extends CakeTestCase {
public function testGenerateWithTemplateFallbacks() {
App::build(array(
'shells' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'console' . DS,
+ LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS,
CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS
)
));
diff --git a/lib/Cake/tests/cases/libs/app.test.php b/lib/Cake/tests/cases/libs/app.test.php
index cbebd4bf3..4a70fdf8a 100644
--- a/lib/Cake/tests/cases/libs/app.test.php
+++ b/lib/Cake/tests/cases/libs/app.test.php
@@ -94,7 +94,7 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testListObjects() {
- $result = App::objects('class', TEST_CAKE_CORE_INCLUDE_PATH . 'libs', false);
+ $result = App::objects('class', LIBS . 'libs', false);
$this->assertTrue(in_array('Xml', $result));
$this->assertTrue(in_array('Cache', $result));
$this->assertTrue(in_array('HttpSocket', $result));
@@ -132,7 +132,7 @@ class AppImportTest extends CakeTestCase {
App::build(array(
'plugins' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS
)
));
$result = App::objects('plugin', null, false);
@@ -149,18 +149,18 @@ class AppImportTest extends CakeTestCase {
*/
function testPluginPath() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$path = App::pluginPath('test_plugin');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
$this->assertEqual($path, $expected);
$path = App::pluginPath('TestPlugin');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
$this->assertEqual($path, $expected);
$path = App::pluginPath('TestPluginTwo');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS;
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS;
$this->assertEqual($path, $expected);
App::build();
}
@@ -172,14 +172,14 @@ class AppImportTest extends CakeTestCase {
*/
function testThemePath() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS)
));
$path = App::themePath('test_theme');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
$this->assertEqual($path, $expected);
$path = App::themePath('TestTheme');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;
$this->assertEqual($path, $expected);
App::build();
@@ -284,8 +284,8 @@ class AppImportTest extends CakeTestCase {
*/
function testPluginImporting() {
App::build(array(
- 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$result = App::import('Controller', 'TestPlugin.Tests');
@@ -330,10 +330,10 @@ class AppImportTest extends CakeTestCase {
App::build(array(
'helpers' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS
)
));
- App::build(array('vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH)));
+ App::build(array('vendors' => array(LIBS)));
$this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.');
App::import('Helper', 'Banana');
$this->assertTrue(class_exists('BananaHelper'), 'BananaHelper was not loaded.');
@@ -348,10 +348,10 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testFileLoading () {
- $file = App::import('File', 'RealFile', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php');
+ $file = App::import('File', 'RealFile', false, array(), LIBS . 'config' . DS . 'config.php');
$this->assertTrue($file);
- $file = App::import('File', 'NoFile', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'cake' . DS . 'config.php');
+ $file = App::import('File', 'NoFile', false, array(), LIBS . 'config' . DS . 'cake' . DS . 'config.php');
$this->assertFalse($file);
}
@@ -363,12 +363,12 @@ class AppImportTest extends CakeTestCase {
*/
function testFileLoadingWithArray() {
$type = array('type' => 'File', 'name' => 'SomeName', 'parent' => false,
- 'file' => TEST_CAKE_CORE_INCLUDE_PATH . DS . 'config' . DS . 'config.php');
+ 'file' => LIBS . DS . 'config' . DS . 'config.php');
$file = App::import($type);
$this->assertTrue($file);
$type = array('type' => 'File', 'name' => 'NoFile', 'parent' => false,
- 'file' => TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'cake' . DS . 'config.php');
+ 'file' => LIBS . 'config' . DS . 'cake' . DS . 'config.php');
$file = App::import($type);
$this->assertFalse($file);
}
@@ -380,13 +380,13 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testFileLoadingReturnValue () {
- $file = App::import('File', 'Name', false, array(), TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', true);
+ $file = App::import('File', 'Name', false, array(), LIBS . 'config' . DS . 'config.php', true);
$this->assertTrue(!empty($file));
$this->assertTrue(isset($file['Cake.version']));
$type = array('type' => 'File', 'name' => 'OtherName', 'parent' => false,
- 'file' => TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', 'return' => true);
+ 'file' => LIBS . 'config' . DS . 'config.php', 'return' => true);
$file = App::import($type);
$this->assertTrue(!empty($file));
@@ -400,7 +400,7 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testLoadingWithSearch () {
- $file = App::import('File', 'NewName', false, array(TEST_CAKE_CORE_INCLUDE_PATH ), 'config.php');
+ $file = App::import('File', 'NewName', false, array(LIBS ), 'config.php');
$this->assertTrue($file);
$file = App::import('File', 'AnotherNewName', false, array(LIBS), 'config.php');
@@ -414,7 +414,7 @@ class AppImportTest extends CakeTestCase {
* @return void
*/
function testLoadingWithSearchArray () {
- $type = array('type' => 'File', 'name' => 'RandomName', 'parent' => false, 'file' => 'config.php', 'search' => array(TEST_CAKE_CORE_INCLUDE_PATH ));
+ $type = array('type' => 'File', 'name' => 'RandomName', 'parent' => false, 'file' => 'config.php', 'search' => array(LIBS ));
$file = App::import($type);
$this->assertTrue($file);
@@ -476,8 +476,8 @@ class AppImportTest extends CakeTestCase {
*/
function testLoadingVendor() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'vendors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
), true);
ob_start();
diff --git a/lib/Cake/tests/cases/libs/cache.test.php b/lib/Cake/tests/cases/libs/cache.test.php
index ad24b70d3..5edbe94fc 100644
--- a/lib/Cake/tests/cases/libs/cache.test.php
+++ b/lib/Cake/tests/cases/libs/cache.test.php
@@ -92,8 +92,8 @@ class CacheTest extends CakeTestCase {
*/
function testConfigWithLibAndPluginEngines() {
App::build(array(
- 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$settings = array('engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_');
@@ -260,8 +260,8 @@ class CacheTest extends CakeTestCase {
*/
function testDrop() {
App::build(array(
- 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$result = Cache::drop('some_config_that_does_not_exist');
@@ -313,8 +313,8 @@ class CacheTest extends CakeTestCase {
*/
function testWriteTriggerError() {
App::build(array(
- 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
Cache::config('test_trigger', array('engine' => 'TestAppCache'));
diff --git a/lib/Cake/tests/cases/libs/cake_log.test.php b/lib/Cake/tests/cases/libs/cake_log.test.php
index 96b64c96b..a6a3115cf 100644
--- a/lib/Cake/tests/cases/libs/cake_log.test.php
+++ b/lib/Cake/tests/cases/libs/cake_log.test.php
@@ -49,8 +49,8 @@ class CakeLogTest extends CakeTestCase {
*/
function testImportingLoggers() {
App::build(array(
- 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$result = CakeLog::config('libtest', array(
diff --git a/lib/Cake/tests/cases/libs/cake_session.test.php b/lib/Cake/tests/cases/libs/cake_session.test.php
index bbed31d39..d0e96aba5 100644
--- a/lib/Cake/tests/cases/libs/cake_session.test.php
+++ b/lib/Cake/tests/cases/libs/cake_session.test.php
@@ -529,8 +529,8 @@ class CakeSessionTest extends CakeTestCase {
*/
function testUsingAppLibsHandler() {
App::build(array(
- 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
Configure::write('Session', array(
'defaults' => 'cake',
@@ -551,8 +551,8 @@ class CakeSessionTest extends CakeTestCase {
*/
function testUsingPluginHandler() {
App::build(array(
- 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
Configure::write('Session', array(
diff --git a/lib/Cake/tests/cases/libs/config/ini_reader.test.php b/lib/Cake/tests/cases/libs/config/ini_reader.test.php
index 6f47c3f69..8022ca69e 100644
--- a/lib/Cake/tests/cases/libs/config/ini_reader.test.php
+++ b/lib/Cake/tests/cases/libs/config/ini_reader.test.php
@@ -35,7 +35,7 @@ class IniReaderTest extends CakeTestCase {
*/
function setup() {
parent::setup();
- $this->path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
+ $this->path = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS;
}
/**
diff --git a/lib/Cake/tests/cases/libs/config/php_reader.test.php b/lib/Cake/tests/cases/libs/config/php_reader.test.php
index bb89378ba..29d47ff89 100644
--- a/lib/Cake/tests/cases/libs/config/php_reader.test.php
+++ b/lib/Cake/tests/cases/libs/config/php_reader.test.php
@@ -27,7 +27,7 @@ class PhpReaderTest extends CakeTestCase {
*/
function setUp() {
parent::setUp();
- $this->path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
+ $this->path = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS;
}
/**
* test reading files
@@ -81,7 +81,7 @@ class PhpReaderTest extends CakeTestCase {
*/
function testReadPluginValue() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
$reader = new PhpReader($this->path);
$result = $reader->read('TestPlugin.load');
diff --git a/lib/Cake/tests/cases/libs/configure.test.php b/lib/Cake/tests/cases/libs/configure.test.php
index 6fb85efed..16717b39a 100644
--- a/lib/Cake/tests/cases/libs/configure.test.php
+++ b/lib/Cake/tests/cases/libs/configure.test.php
@@ -200,7 +200,7 @@ class ConfigureTest extends CakeTestCase {
* @return void
*/
function testLoad() {
- Configure::config('test', new PhpReader(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config' . DS));
+ Configure::config('test', new PhpReader(LIBS . 'tests' . DS . 'test_app' . DS . 'config' . DS));
$result = Configure::load('var_test', 'test');
$this->assertTrue($result);
@@ -215,7 +215,7 @@ class ConfigureTest extends CakeTestCase {
* @return void
*/
function testLoadPlugin() {
- App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)), true);
+ App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)), true);
Configure::config('test', new PhpReader());
$result = Configure::load('test_plugin.load', 'test');
diff --git a/lib/Cake/tests/cases/libs/controller/component.test.php b/lib/Cake/tests/cases/libs/controller/component.test.php
index 43dff8cd6..1d1464d6d 100644
--- a/lib/Cake/tests/cases/libs/controller/component.test.php
+++ b/lib/Cake/tests/cases/libs/controller/component.test.php
@@ -53,7 +53,7 @@ class ParamTestComponent extends Component {
* @access public
* @return void
*/
- function initialize($controllerz) {
+ function initialize(&$controller, $settings) {
foreach ($settings as $key => $value) {
if (is_numeric($key)) {
$this->{$value} = true;
@@ -121,7 +121,7 @@ class AppleComponent extends Component {
* @access public
* @return void
*/
- function startup($controller) {
+ function startup(&$controller) {
$this->testName = $controller->name;
}
}
@@ -149,7 +149,7 @@ class OrangeComponent extends Component {
* @access public
* @return void
*/
- function initialize($controller) {
+ function initialize(&$controller) {
$this->Controller = $controller;
$this->Banana->testField = 'OrangeField';
}
@@ -160,7 +160,7 @@ class OrangeComponent extends Component {
* @param Controller $controller
* @return string
*/
- public function startup($controller) {
+ public function startup(&$controller) {
$controller->foo = 'pass';
}
}
@@ -187,7 +187,7 @@ class BananaComponent extends Component {
* @param Controller $controller
* @return string
*/
- public function startup($controller) {
+ public function startup(&$controller) {
$controller->bar = 'fail';
}
}
@@ -261,7 +261,7 @@ class ComponentTest extends CakeTestCase {
function setUp() {
$this->_pluginPaths = App::path('plugins');
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
}
diff --git a/lib/Cake/tests/cases/libs/controller/component_collection.test.php b/lib/Cake/tests/cases/libs/controller/component_collection.test.php
index acc98ed28..ab0ea91de 100644
--- a/lib/Cake/tests/cases/libs/controller/component_collection.test.php
+++ b/lib/Cake/tests/cases/libs/controller/component_collection.test.php
@@ -89,7 +89,7 @@ class ComponentCollectionTest extends CakeTestCase {
*/
function testLoadPluginComponent() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
$result = $this->Components->load('TestPlugin.OtherComponent');
$this->assertType('OtherComponentComponent', $result, 'Component class is wrong.');
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 06a219b4a..e2415797c 100644
--- a/lib/Cake/tests/cases/libs/controller/components/acl.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/acl.test.php
@@ -268,7 +268,7 @@ class IniAclTest extends CakeTestCase {
* @return void
*/
function testCheck() {
- $iniFile = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
+ $iniFile = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
$Ini = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile);
@@ -291,7 +291,7 @@ class IniAclTest extends CakeTestCase {
* @return void
*/
function testCheckArray() {
- $iniFile = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
+ $iniFile = LIBS . 'tests' . DS . 'test_app' . DS . 'config'. DS . 'acl.ini.php';
$Ini = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile);
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 35f0356bc..dda510668 100644
--- a/lib/Cake/tests/cases/libs/controller/components/auth.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/auth.test.php
@@ -53,7 +53,7 @@ class TestAuthComponent extends AuthComponent {
* @access public
* @return void
*/
- function _stop($status = 0) {
+ function _stop() {
$this->testStop = true;
}
}
@@ -499,8 +499,7 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->beforeFilter();
- $view = new View($this->Controller);
- ClassRegistry::addObject('view', $view);
+ ClassRegistry::addObject('view', new View($this->Controller));
$this->Controller->Session->delete('Auth');
$this->Controller->Session->delete('Message.auth');
@@ -1396,8 +1395,8 @@ class AuthTest extends CakeTestCase {
// Adding plugins
Cache::delete('object_map', '_cake_core_');
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
), true);
App::objects('plugin', null, false);
@@ -1454,7 +1453,7 @@ class AuthTest extends CakeTestCase {
*/
function testAjaxLogin() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";
diff --git a/lib/Cake/tests/cases/libs/controller/components/email.test.php b/lib/Cake/tests/cases/libs/controller/components/email.test.php
index 2863308b0..36db895a7 100755
--- a/lib/Cake/tests/cases/libs/controller/components/email.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/email.test.php
@@ -230,11 +230,10 @@ class EmailComponentTest extends CakeTestCase {
$this->Controller->Components->init($this->Controller);
$this->Controller->EmailTest->initialize($this->Controller, array());
- $view = new View($this->Controller);
- ClassRegistry::addObject('view', $view);
+ ClassRegistry::addObject('view', new View($this->Controller));
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
}
@@ -754,7 +753,7 @@ HTMLBLOC;
*/
function testMessageRetrievalWithoutTemplate() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Controller->EmailTest->to = 'postmaster@localhost';
@@ -792,7 +791,7 @@ HTMLBLOC;
*/
function testMessageRetrievalWithTemplate() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Controller->set('value', 22091985);
@@ -1124,8 +1123,8 @@ HTMLBLOC;
function testPluginCustomViewClass() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Controller->view = 'TestPlugin.Email';
diff --git a/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php b/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
index ddafab1f6..112ffa472 100644
--- a/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
@@ -673,7 +673,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/
function testAjaxRedirectAsRequestAction() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
@@ -702,7 +702,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/
function testAjaxRedirectAsRequestActionStillRenderingLayout() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
diff --git a/lib/Cake/tests/cases/libs/controller/controller.test.php b/lib/Cake/tests/cases/libs/controller/controller.test.php
index fd36df0fa..97003eb8d 100644
--- a/lib/Cake/tests/cases/libs/controller/controller.test.php
+++ b/lib/Cake/tests/cases/libs/controller/controller.test.php
@@ -107,13 +107,13 @@ class ControllerPost extends CakeTestModel {
* @access public
* @return void
*/
- function find($conditions = null, $fields = array(), $order = null, $recursive = null) {
- if ($conditions == 'popular') {
+ function find($type, $options = array()) {
+ if ($type == 'popular') {
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
- $options = Set::merge($fields, compact('conditions'));
- return parent::find('all', $fields);
+ $options = Set::merge($options, compact('conditions'));
+ return parent::find('all', $options);
}
- return parent::find($conditions, $fields);
+ return parent::find($type, $options);
}
}
@@ -320,7 +320,7 @@ class TestComponent extends Object {
* @access public
* @return void
*/
- function initialize($controller) {
+ function initialize(&$controller) {
}
/**
@@ -329,7 +329,7 @@ class TestComponent extends Object {
* @access public
* @return void
*/
- function startup($controller) {
+ function startup(&$controller) {
}
/**
* shutdown method
@@ -337,14 +337,14 @@ class TestComponent extends Object {
* @access public
* @return void
*/
- function shutdown($controller) {
+ function shutdown(&$controller) {
}
/**
* beforeRender callback
*
* @return void
*/
- function beforeRender($controller) {
+ function beforeRender(&$controller) {
if ($this->viewclass) {
$controller->view = $this->viewclass;
}
@@ -442,9 +442,9 @@ class ControllerTest extends CakeTestCase {
*/
function testLoadModelInPlugins() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS),
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS)
));
App::uses('TestPluginController', 'TestPlugin.Controller');
@@ -491,7 +491,7 @@ class ControllerTest extends CakeTestCase {
unset($Controller);
- App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
+ App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
$Controller = new Controller($request);
$Controller->uses = array('TestPlugin.TestPluginPost');
@@ -581,7 +581,7 @@ class ControllerTest extends CakeTestCase {
$this->assertEqual($result, $expected);
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$Controller = new Controller($request);
$Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
@@ -643,7 +643,7 @@ class ControllerTest extends CakeTestCase {
*/
function testRender() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
$request = new CakeRequest('controller_posts/index');
@@ -685,7 +685,7 @@ class ControllerTest extends CakeTestCase {
$core = App::core('views');
App::build(array(
'views' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
$core[0]
)
), true);
diff --git a/lib/Cake/tests/cases/libs/controller/pages_controller.test.php b/lib/Cake/tests/cases/libs/controller/pages_controller.test.php
index ce3d7a0ec..be422e227 100644
--- a/lib/Cake/tests/cases/libs/controller/pages_controller.test.php
+++ b/lib/Cake/tests/cases/libs/controller/pages_controller.test.php
@@ -28,6 +28,16 @@ App::uses('PagesController', 'Controller');
*/
class PagesControllerTest extends CakeTestCase {
+/**
+ * endTest method
+ *
+ * @access public
+ * @return void
+ */
+ function endTest() {
+ App::build();
+ }
+
/**
* testDisplay method
*
@@ -36,7 +46,7 @@ class PagesControllerTest extends CakeTestCase {
*/
function testDisplay() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS, LIBS . 'libs' . DS . 'view' . DS)
));
$Pages = new PagesController(new CakeRequest(null, false));
diff --git a/lib/Cake/tests/cases/libs/controller/scaffold.test.php b/lib/Cake/tests/cases/libs/controller/scaffold.test.php
index 147380c7f..67ec7e9f2 100644
--- a/lib/Cake/tests/cases/libs/controller/scaffold.test.php
+++ b/lib/Cake/tests/cases/libs/controller/scaffold.test.php
@@ -93,8 +93,8 @@ class TestScaffoldMock extends Scaffold {
*
* @param unknown_type $params
*/
- function _scaffold(CakeRequest $request) {
- $this->_params = $request;
+ function _scaffold($params) {
+ $this->_params = $params;
}
/**
@@ -287,8 +287,8 @@ class ScaffoldViewTest extends CakeTestCase {
$this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
}
@@ -315,35 +315,35 @@ class ScaffoldViewTest extends CakeTestCase {
$this->Controller->request->params['action'] = 'index';
$ScaffoldView = new TestScaffoldView($this->Controller);
$result = $ScaffoldView->testGetFilename('index');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('edit');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('add');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('view');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_index');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_view');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_edit');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_add');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
+ $expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('error');
@@ -357,11 +357,11 @@ class ScaffoldViewTest extends CakeTestCase {
$ScaffoldView = new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_edit');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('edit');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
$Controller = new ScaffoldMockController($this->request);
@@ -376,12 +376,12 @@ class ScaffoldViewTest extends CakeTestCase {
$ScaffoldView = new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_add');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins'
. DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('add');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins'
. DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.form.ctp';
$this->assertEqual($result, $expected);
@@ -400,7 +400,7 @@ class ScaffoldViewTest extends CakeTestCase {
$ScaffoldView = new TestScaffoldView($this->Controller);
$result = $ScaffoldView->testGetFilename('index');
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS
. 'themed' . DS . 'test_theme' . DS . 'posts' . DS . 'scaffold.index.ctp';
$this->assertEqual($result, $expected);
}
diff --git a/lib/Cake/tests/cases/libs/dispatcher.test.php b/lib/Cake/tests/cases/libs/dispatcher.test.php
index d950510d8..008a286cf 100644
--- a/lib/Cake/tests/cases/libs/dispatcher.test.php
+++ b/lib/Cake/tests/cases/libs/dispatcher.test.php
@@ -787,7 +787,7 @@ class DispatcherTest extends CakeTestCase {
*/
public function testDispatchBasic() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$Dispatcher = new TestDispatcher();
Configure::write('App.baseUrl', '/index.php');
@@ -1078,7 +1078,7 @@ class DispatcherTest extends CakeTestCase {
}
Router::reload();
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
App::objects('plugin', null, false);
@@ -1178,7 +1178,7 @@ class DispatcherTest extends CakeTestCase {
public function testTestPluginDispatch() {
$Dispatcher = new TestDispatcher();
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
App::objects('plugin', null, false);
Router::reload();
@@ -1236,9 +1236,9 @@ class DispatcherTest extends CakeTestCase {
Router::reload();
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'vendors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'vendors'. DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$Dispatcher = new TestDispatcher();
@@ -1262,21 +1262,21 @@ class DispatcherTest extends CakeTestCase {
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/flash/theme_test.swf'));
$result = ob_get_clean();
- $file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'flash' . DS . 'theme_test.swf');
+ $file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'flash' . DS . 'theme_test.swf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load swf file from the theme.', $result);
ob_start();
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/pdfs/theme_test.pdf'));
$result = ob_get_clean();
- $file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'pdfs' . DS . 'theme_test.pdf');
+ $file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'pdfs' . DS . 'theme_test.pdf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load pdf file from the theme.', $result);
ob_start();
$Dispatcher->dispatch(new CakeRequest('theme/test_theme/img/test.jpg'));
$result = ob_get_clean();
- $file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'img' . DS . 'test.jpg');
+ $file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'webroot' . DS . 'img' . DS . 'test.jpg');
$this->assertEqual($file, $result);
ob_start();
@@ -1297,20 +1297,20 @@ class DispatcherTest extends CakeTestCase {
ob_start();
$Dispatcher->asset('test_plugin/root.js');
$result = ob_get_clean();
- $expected = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'root.js');
+ $expected = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'root.js');
$this->assertEqual($result, $expected);
ob_start();
$Dispatcher->dispatch(new CakeRequest('test_plugin/flash/plugin_test.swf'));
$result = ob_get_clean();
- $file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'flash' . DS . 'plugin_test.swf');
+ $file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'flash' . DS . 'plugin_test.swf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load swf file from the plugin.', $result);
ob_start();
$Dispatcher->dispatch(new CakeRequest('test_plugin/pdfs/plugin_test.pdf'));
$result = ob_get_clean();
- $file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'pdfs' . DS . 'plugin_test.pdf');
+ $file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'pdfs' . DS . 'plugin_test.pdf');
$this->assertEqual($file, $result);
$this->assertEqual('this is just a test to load pdf file from the plugin.', $result);
@@ -1332,7 +1332,7 @@ class DispatcherTest extends CakeTestCase {
ob_start();
$Dispatcher->asset('test_plugin/img/cake.icon.gif');
$result = ob_get_clean();
- $file = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' .DS . 'webroot' . DS . 'img' . DS . 'cake.icon.gif');
+ $file = file_get_contents(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' .DS . 'webroot' . DS . 'img' . DS . 'cake.icon.gif');
$this->assertEqual($file, $result);
ob_start();
@@ -1435,7 +1435,7 @@ class DispatcherTest extends CakeTestCase {
Router::connect('/', array('controller' => 'test_cached_pages', 'action' => 'index'));
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
), true);
$dispatcher = new TestDispatcher();
diff --git a/lib/Cake/tests/cases/libs/error/error_handler.test.php b/lib/Cake/tests/cases/libs/error/error_handler.test.php
index dbdc0c8fc..ece3a77ec 100644
--- a/lib/Cake/tests/cases/libs/error/error_handler.test.php
+++ b/lib/Cake/tests/cases/libs/error/error_handler.test.php
@@ -39,8 +39,8 @@ class ErrorHandlerTest extends CakeTestCase {
function setUp() {
App::build(array(
'views' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
+ LIBS . 'libs' . DS . 'view' . DS
)
), true);
Router::reload();
diff --git a/lib/Cake/tests/cases/libs/error/exception_renderer.test.php b/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
index aaf04e4e7..4d130f62d 100644
--- a/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
+++ b/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
@@ -69,7 +69,7 @@ class BlueberryComponent extends Component {
* @access public
* @return void
*/
- function initialize($controller) {
+ function initialize(&$controller) {
$this->testName = 'BlueberryComponent';
}
}
@@ -162,8 +162,8 @@ class ExceptionRendererTest extends CakeTestCase {
function setUp() {
App::build(array(
'views' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
+ LIBS . 'libs' . DS . 'view' . DS
)
), true);
Router::reload();
diff --git a/lib/Cake/tests/cases/libs/folder.test.php b/lib/Cake/tests/cases/libs/folder.test.php
index 65ca682ab..d8b220700 100644
--- a/lib/Cake/tests/cases/libs/folder.test.php
+++ b/lib/Cake/tests/cases/libs/folder.test.php
@@ -149,7 +149,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testOperations() {
- $path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'templates' . DS . 'skel';
+ $path = LIBS . 'console' . DS . 'templates' . DS . 'skel';
$Folder = new Folder($path);
$result = is_dir($Folder->pwd());
@@ -222,7 +222,7 @@ class FolderTest extends CakeTestCase {
public function testChmod() {
$this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Folder permissions tests not supported on Windows');
- $path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'templates' . DS . 'skel';
+ $path = LIBS . 'console' . DS . 'templates' . DS . 'skel';
$Folder = new Folder($path);
$subdir = 'test_folder_new';
@@ -318,42 +318,42 @@ class FolderTest extends CakeTestCase {
$Folder = new Folder();
$expected = array(
array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'config',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding'
+ LIBS . 'config',
+ LIBS . 'config' . DS . 'unicode',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding'
),
array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0080_00ff.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0100_017f.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0180_024F.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0250_02af.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0370_03ff.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0400_04ff.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0500_052f.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0530_058f.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1e00_1eff.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1f00_1fff.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2100_214f.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2150_218f.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2460_24ff.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c00_2c5f.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c60_2c7f.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c80_2cff.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . 'ff00_ffef.php'
+ LIBS . 'config' . DS . 'config.php',
+ LIBS . 'config' . DS . 'paths.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0080_00ff.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0100_017f.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0180_024F.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0250_02af.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0370_03ff.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0400_04ff.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0500_052f.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '0530_058f.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1e00_1eff.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '1f00_1fff.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2100_214f.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2150_218f.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2460_24ff.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c00_2c5f.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c60_2c7f.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . '2c80_2cff.php',
+ LIBS . 'config' . DS . 'unicode' . DS . 'casefolding' . DS . 'ff00_ffef.php'
)
);
- $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false);
+ $result = $Folder->tree(LIBS . 'config', false);
$this->assertIdentical(array_diff($expected[0], $result[0]), array());
$this->assertIdentical(array_diff($result[0], $expected[0]), array());
- $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'dir');
+ $result = $Folder->tree(LIBS . 'config', false, 'dir');
$this->assertIdentical(array_diff($expected[0], $result), array());
$this->assertIdentical(array_diff($result, $expected[0]), array());
- $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'files');
+ $result = $Folder->tree(LIBS . 'config', false, 'files');
$this->assertIdentical(array_diff($expected[1], $result), array());
$this->assertIdentical(array_diff($result, $expected[1]), array());
}
@@ -490,7 +490,7 @@ class FolderTest extends CakeTestCase {
*/
function testFind() {
$Folder = new Folder();
- $Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');
+ $Folder->cd(LIBS . 'config');
$result = $Folder->find();
$expected = array('config.php', 'paths.php');
$this->assertIdentical(array_diff($expected, $result), array());
@@ -543,19 +543,19 @@ class FolderTest extends CakeTestCase {
*/
function testFindRecursive() {
$Folder = new Folder();
- $Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH);
+ $Folder->cd(LIBS);
$result = $Folder->findRecursive('(config|paths)\.php');
$expected = array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php'
+ LIBS . 'config' . DS . 'config.php',
+ LIBS . 'config' . DS . 'paths.php'
);
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($result, $expected), array());
$result = $Folder->findRecursive('(config|paths)\.php', true);
$expected = array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
- TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php'
+ LIBS . 'config' . DS . 'config.php',
+ LIBS . 'config' . DS . 'paths.php'
);
$this->assertIdentical($result, $expected);
@@ -589,7 +589,7 @@ class FolderTest extends CakeTestCase {
);
$this->assertIdentical($result, $expected);
- $Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');
+ $Folder->cd(LIBS . 'config');
$Folder->cd(TMP);
$Folder->delete($Folder->pwd() . DS . 'testme');
$File->delete();
diff --git a/lib/Cake/tests/cases/libs/html_coverage_report.test.php b/lib/Cake/tests/cases/libs/html_coverage_report.test.php
index 325271131..d07aeb29a 100644
--- a/lib/Cake/tests/cases/libs/html_coverage_report.test.php
+++ b/lib/Cake/tests/cases/libs/html_coverage_report.test.php
@@ -41,7 +41,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
function testGetPathFilter() {
$this->Coverage->appTest = false;
$result = $this->Coverage->getPathFilter();
- $this->assertEquals(TEST_CAKE_CORE_INCLUDE_PATH, $result);
+ $this->assertEquals(LIBS, $result);
$this->Coverage->appTest = true;
$result = $this->Coverage->getPathFilter();
@@ -60,7 +60,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
*/
function testFilterCoverageDataByPathRemovingElements() {
$data = array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'dispatcher.php' => array(
+ LIBS . 'dispatcher.php' => array(
10 => -1,
12 => 1
),
@@ -70,8 +70,8 @@ class HtmlCoverageReportTest extends CakeTestCase {
)
);
$this->Coverage->setCoverage($data);
- $result = $this->Coverage->filterCoverageDataByPath(TEST_CAKE_CORE_INCLUDE_PATH);
- $this->assertTrue(isset($result[TEST_CAKE_CORE_INCLUDE_PATH . 'dispatcher.php']));
+ $result = $this->Coverage->filterCoverageDataByPath(LIBS);
+ $this->assertTrue(isset($result[LIBS . 'dispatcher.php']));
$this->assertFalse(isset($result[APP . 'app_model.php']));
}
diff --git a/lib/Cake/tests/cases/libs/i18n.test.php b/lib/Cake/tests/cases/libs/i18n.test.php
index a446df605..f481835e3 100644
--- a/lib/Cake/tests/cases/libs/i18n.test.php
+++ b/lib/Cake/tests/cases/libs/i18n.test.php
@@ -36,8 +36,8 @@ class I18nTest extends CakeTestCase {
function setUp() {
Cache::delete('object_map', '_cake_core_');
App::build(array(
- 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
App::objects('plugin', null, false);
}
@@ -2434,7 +2434,7 @@ class I18nTest extends CakeTestCase {
*/
function testPluginTranslation() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
Configure::write('Config.language', 'po');
diff --git a/lib/Cake/tests/cases/libs/model/cake_schema.test.php b/lib/Cake/tests/cases/libs/model/cake_schema.test.php
index 5132fb557..b62e96ecb 100644
--- a/lib/Cake/tests/cases/libs/model/cake_schema.test.php
+++ b/lib/Cake/tests/cases/libs/model/cake_schema.test.php
@@ -659,7 +659,7 @@ class CakeSchemaTest extends CakeTestCase {
function testSchemaReadWithPlugins() {
App::objects('model', null, false);
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$Schema = new CakeSchema();
@@ -977,7 +977,7 @@ class CakeSchemaTest extends CakeTestCase {
*/
function testSchemaLoadingFromPlugin() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$Other = $this->Schema->load(array('name' => 'TestPluginApp', 'plugin' => 'TestPlugin'));
$this->assertEqual($Other->name, 'TestPluginApp');
diff --git a/lib/Cake/tests/cases/libs/model/connection_manager.test.php b/lib/Cake/tests/cases/libs/model/connection_manager.test.php
index 1798fb6b9..c121cee07 100644
--- a/lib/Cake/tests/cases/libs/model/connection_manager.test.php
+++ b/lib/Cake/tests/cases/libs/model/connection_manager.test.php
@@ -99,7 +99,7 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetPluginDataSource() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$name = 'test_source';
@@ -121,7 +121,7 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetPluginDataSourceAndPluginDriver() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$name = 'test_plugin_source_and_driver';
@@ -145,7 +145,7 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetLocalDataSourceAndPluginDriver() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
));
$name = 'test_local_source_and_plugin_driver';
@@ -168,8 +168,8 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testGetPluginDataSourceAndLocalDriver() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'datasources' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'datasources' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
));
$name = 'test_plugin_source_and_local_driver';
@@ -284,8 +284,8 @@ class ConnectionManagerTest extends CakeTestCase {
*/
function testConnectionData() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'datasources' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'datasources' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS)
));
$expected = array(
diff --git a/lib/Cake/tests/cases/libs/object.test.php b/lib/Cake/tests/cases/libs/object.test.php
index f5ad44cad..cc10aa86b 100644
--- a/lib/Cake/tests/cases/libs/object.test.php
+++ b/lib/Cake/tests/cases/libs/object.test.php
@@ -485,9 +485,9 @@ class ObjectTest extends CakeTestCase {
Configure::write('Cache.disable', false);
App::build(array(
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'. DS),
- 'behaviors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins'. DS),
+ 'behaviors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
), true);
$this->assertFalse(class_exists('PersisterOneBehaviorBehavior'));
@@ -546,8 +546,8 @@ class ObjectTest extends CakeTestCase {
$this->assertFalse(class_exists('ContainableBehavior'));
App::build(array(
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
- 'behaviors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
+ 'behaviors' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS),
), true);
$this->assertFalse(class_exists('PersistOneBehaviorBehavior'));
@@ -690,9 +690,9 @@ class ObjectTest extends CakeTestCase {
*/
function testRequestAction() {
App::build(array(
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
- 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
+ 'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
));
$result = $this->object->requestAction('');
$this->assertFalse($result);
@@ -730,7 +730,7 @@ class ObjectTest extends CakeTestCase {
*/
function testRequestActionPlugins() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
App::objects('plugin', null, false);
Router::reload();
@@ -770,9 +770,9 @@ class ObjectTest extends CakeTestCase {
*/
function testRequestActionArray() {
App::build(array(
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
- 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
+ 'models' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
+ 'controllers' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)
));
$result = $this->object->requestAction(
diff --git a/lib/Cake/tests/cases/libs/router.test.php b/lib/Cake/tests/cases/libs/router.test.php
index fc01a246c..8b58b521b 100644
--- a/lib/Cake/tests/cases/libs/router.test.php
+++ b/lib/Cake/tests/cases/libs/router.test.php
@@ -1177,7 +1177,7 @@ class RouterTest extends CakeTestCase {
$paths = App::path('plugins');
App::build(array(
'plugins' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
)
), true);
App::objects('plugin', null, false);
@@ -2191,7 +2191,7 @@ class RouterTest extends CakeTestCase {
function testConnectDefaultRoutes() {
App::build(array(
'plugins' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
)
), true);
App::objects('plugin', null, false);
diff --git a/lib/Cake/tests/cases/libs/view/helper.test.php b/lib/Cake/tests/cases/libs/view/helper.test.php
index ce8f655cb..063ae9fc9 100644
--- a/lib/Cake/tests/cases/libs/view/helper.test.php
+++ b/lib/Cake/tests/cases/libs/view/helper.test.php
@@ -553,8 +553,8 @@ class HelperTest extends CakeTestCase {
$_timestamp = Configure::read('Asset.timestamp');
Configure::write('Asset.timestamp', 'force');
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
));
$result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css');
@@ -793,7 +793,7 @@ class HelperTest extends CakeTestCase {
$this->Helper->theme = 'test_theme';
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$result = $this->Helper->webroot('/img/cake.power.gif');
@@ -805,7 +805,7 @@ class HelperTest extends CakeTestCase {
$this->assertEqual($result, $expected);
$webRoot = Configure::read('App.www_root');
- Configure::write('App.www_root', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
+ Configure::write('App.www_root', LIBS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
$result = $this->Helper->webroot('/img/cake.power.gif');
$expected = '/theme/test_theme/img/cake.power.gif';
@@ -859,7 +859,7 @@ class HelperTest extends CakeTestCase {
*/
function testLazyLoadingHelpers() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
$Helper = new TestHelper($this->View);
$this->assertType('OtherHelperHelper', $Helper->OtherHelper);
diff --git a/lib/Cake/tests/cases/libs/view/helper_collection.test.php b/lib/Cake/tests/cases/libs/view/helper_collection.test.php
index 54aa16cde..6ca842e7f 100644
--- a/lib/Cake/tests/cases/libs/view/helper_collection.test.php
+++ b/lib/Cake/tests/cases/libs/view/helper_collection.test.php
@@ -87,7 +87,7 @@ class HelperCollectionTest extends CakeTestCase {
*/
function testLoadPluginHelper() {
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
));
$result = $this->Helpers->load('TestPlugin.OtherHelper');
$this->assertType('OtherHelperHelper', $result, 'Helper class is wrong.');
diff --git a/lib/Cake/tests/cases/libs/view/helpers/cache.test.php b/lib/Cake/tests/cases/libs/view/helpers/cache.test.php
index c56463a85..db4b03f02 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/cache.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/cache.test.php
@@ -86,7 +86,7 @@ class CacheHelperTest extends CakeTestCase {
Configure::write('Cache.check', true);
Configure::write('Cache.disable', false);
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
), true);
}
diff --git a/lib/Cake/tests/cases/libs/view/helpers/html.test.php b/lib/Cake/tests/cases/libs/view/helpers/html.test.php
index 4d3a7dac1..a8fb606b6 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/html.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/html.test.php
@@ -327,7 +327,7 @@ class HtmlHelperTest extends CakeTestCase {
$file = new File($testfile, true);
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
Configure::write('Asset.timestamp', true);
Configure::write('debug', 1);
@@ -362,10 +362,10 @@ class HtmlHelperTest extends CakeTestCase {
*/
function testThemeAssetsInMainWebrootPath() {
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$webRoot = Configure::read('App.www_root');
- Configure::write('App.www_root', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
+ Configure::write('App.www_root', LIBS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS);
$this->Html->theme = 'test_theme';
$result = $this->Html->css('webroot_test');
@@ -608,7 +608,7 @@ class HtmlHelperTest extends CakeTestCase {
$file = new File($testfile, true);
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$this->Html->webroot = '/';
diff --git a/lib/Cake/tests/cases/libs/view/helpers/session.test.php b/lib/Cake/tests/cases/libs/view/helpers/session.test.php
index 2fa1dad0a..eb278b9de 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/session.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/session.test.php
@@ -129,7 +129,7 @@ class SessionHelperTest extends CakeTestCase {
$this->assertEqual($result, $expected);
App::build(array(
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$result = $this->Session->flash('notification', true);
$result = str_replace("\r\n", "\n", $result);
diff --git a/lib/Cake/tests/cases/libs/view/helpers/time.test.php b/lib/Cake/tests/cases/libs/view/helpers/time.test.php
index d5ba62b61..885e17674 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/time.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/time.test.php
@@ -658,7 +658,7 @@ class TimeHelperTest extends CakeTestCase {
*/
function testConvertSpecifiers() {
App::build(array(
- 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
+ 'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
), true);
Configure::write('Config.language', 'time_test');
$time = strtotime('Thu Jan 14 11:43:39 2010');
@@ -748,7 +748,7 @@ class TimeHelperTest extends CakeTestCase {
*/
function testI18nFormat() {
App::build(array(
- 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
+ 'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS)
), true);
Configure::write('Config.language', 'time_test');
$time = strtotime('Thu Jan 14 13:59:28 2010');
diff --git a/lib/Cake/tests/cases/libs/view/media.test.php b/lib/Cake/tests/cases/libs/view/media.test.php
index a9352f5d9..22d633d02 100644
--- a/lib/Cake/tests/cases/libs/view/media.test.php
+++ b/lib/Cake/tests/cases/libs/view/media.test.php
@@ -74,7 +74,7 @@ class MediaViewTest extends CakeTestCase {
*/
function testRender() {
$this->MediaView->viewVars = array(
- 'path' => TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
+ 'path' => LIBS . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
@@ -120,7 +120,7 @@ class MediaViewTest extends CakeTestCase {
*/
function testConnectionAborted() {
$this->MediaView->viewVars = array(
- 'path' => TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
+ 'path' => LIBS . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
@@ -146,7 +146,7 @@ class MediaViewTest extends CakeTestCase {
*/
function testConnectionAbortedOnBuffering() {
$this->MediaView->viewVars = array(
- 'path' => TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
+ 'path' => LIBS . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS,
'id' => 'test_asset.css',
'extension' => 'css',
);
diff --git a/lib/Cake/tests/cases/libs/view/theme.test.php b/lib/Cake/tests/cases/libs/view/theme.test.php
index 69a986ad7..8c7344328 100644
--- a/lib/Cake/tests/cases/libs/view/theme.test.php
+++ b/lib/Cake/tests/cases/libs/view/theme.test.php
@@ -121,8 +121,8 @@ class ThemeViewTest extends CakeTestCase {
$this->PostsController->index();
$this->ThemeView = new ThemeView($this->PostsController);
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
}
@@ -154,15 +154,16 @@ class ThemeViewTest extends CakeTestCase {
$this->Controller->theme = 'test_theme';
$ThemeView = new TestThemeView($this->Controller);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'tests' . DS .'index.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'tests' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('index');
+ debug($expected);
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'layouts' . DS .'plugin_default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'layouts' . DS .'plugin_default.ctp';
$result = $ThemeView->getLayoutFileName('plugin_default');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$result = $ThemeView->getLayoutFileName('default');
$this->assertEqual($result, $expected);
}
@@ -182,25 +183,25 @@ class ThemeViewTest extends CakeTestCase {
$ThemeView = new TestThemeView($this->Controller);
$ThemeView->theme = 'test_theme';
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
$result = $ThemeView->getViewFileName('home');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'posts' . DS .'index.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'posts' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('/posts/index');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);
$ThemeView->layoutPath = 'rss';
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);
$ThemeView->layoutPath = 'email' . DS . 'html';
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
$result = $ThemeView->getLayoutFileName();
$this->assertEqual($result, $expected);
}
diff --git a/lib/Cake/tests/cases/libs/view/view.test.php b/lib/Cake/tests/cases/libs/view/view.test.php
index 61762f475..8b90213cc 100644
--- a/lib/Cake/tests/cases/libs/view/view.test.php
+++ b/lib/Cake/tests/cases/libs/view/view.test.php
@@ -201,10 +201,10 @@ class ViewTest extends CakeTestCase {
$this->PostsController->index();
$this->View = new View($this->PostsController);
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'views' => array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS,
+ LIBS . 'View' . DS
)
), true);
@@ -238,11 +238,11 @@ class ViewTest extends CakeTestCase {
$View = new TestView($this->Controller);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
$result = $View->getViewFileName('index');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
}
@@ -265,10 +265,10 @@ class ViewTest extends CakeTestCase {
$paths = $View->paths('test_plugin');
$expected = array(
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS,
- TEST_CAKE_CORE_INCLUDE_PATH . 'View' . DS
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
+ LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
+ LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS,
+ LIBS . 'View' . DS
);
$this->assertEqual($paths, $expected);
}
@@ -286,15 +286,15 @@ class ViewTest extends CakeTestCase {
$View = new TestView($this->Controller);
App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp';
$result = $View->getViewFileName('index');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
}
@@ -314,29 +314,29 @@ class ViewTest extends CakeTestCase {
$View = new TestView($this->Controller);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp';
$result = $View->getViewFileName('home');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$result = $View->getViewFileName('/posts/index');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$result = $View->getViewFileName('../posts/index');
$this->assertEqual($result, $expected);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS .'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
$View->layoutPath = 'rss';
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'rss' . DS . 'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
$View->layoutPath = 'email' . DS . 'html';
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp';
$result = $View->getLayoutFileName();
$this->assertEqual($result, $expected);
@@ -733,7 +733,7 @@ class ViewTest extends CakeTestCase {
$result = $View->getViewFileName('../themed/test_theme/posts/index');
$this->assertPattern('/themed(\/|\\\)test_theme(\/|\\\)posts(\/|\\\)index.ctp/', $result);
- $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
+ $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS .'posts' . DS .'index.ctp';
$result = $View->getViewFileName('../posts/index');
$this->assertEqual($result, $expected);
diff --git a/lib/Cake/tests/cases/libs/xml.test.php b/lib/Cake/tests/cases/libs/xml.test.php
index ee00efd2b..6a61d6cab 100644
--- a/lib/Cake/tests/cases/libs/xml.test.php
+++ b/lib/Cake/tests/cases/libs/xml.test.php
@@ -137,7 +137,7 @@ class XmlTest extends CakeTestCase {
$this->assertEqual($obj->firstChild->nodeName, 'tag');
$this->assertEqual($obj->firstChild->nodeValue, 'value');
- $xml = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
+ $xml = LIBS . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
$obj = Xml::build($xml);
$this->assertEqual($obj->getName(), 'tags');
$this->assertEqual(count($obj), 2);
@@ -378,7 +378,7 @@ class XmlTest extends CakeTestCase {
$obj = Xml::build($xml);
$this->assertEqual(Xml::toArray($obj), array('tag' => 'name'));
- $xml = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
+ $xml = LIBS . 'tests' . DS . 'fixtures' . DS . 'sample.xml';
$obj = Xml::build($xml);
$expected = array(
'tags' => array(
@@ -520,7 +520,7 @@ class XmlTest extends CakeTestCase {
* @return void
*/
public function testRss() {
- $rss = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'rss.xml');
+ $rss = file_get_contents(LIBS . 'tests' . DS . 'fixtures' . DS . 'rss.xml');
$rssAsArray = Xml::toArray(Xml::build($rss));
$this->assertEqual($rssAsArray['rss']['@version'], '2.0');
$this->assertEqual(count($rssAsArray['rss']['channel']['item']), 2);
@@ -651,7 +651,7 @@ class XmlTest extends CakeTestCase {
* @return void
*/
public function testSoap() {
- $xmlRequest = Xml::build(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'soap_request.xml');
+ $xmlRequest = Xml::build(LIBS . 'tests' . DS . 'fixtures' . DS . 'soap_request.xml');
$expected = array(
'Envelope' => array(
'@soap:encodingStyle' => 'http://www.w3.org/2001/12/soap-encoding',
@@ -664,7 +664,7 @@ class XmlTest extends CakeTestCase {
);
$this->assertEqual(Xml::toArray($xmlRequest), $expected);
- $xmlResponse = Xml::build(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'fixtures' . DS . 'soap_response.xml');
+ $xmlResponse = Xml::build(LIBS . 'tests' . DS . 'fixtures' . DS . 'soap_response.xml');
$expected = array(
'Envelope' => array(
'@soap:encodingStyle' => 'http://www.w3.org/2001/12/soap-encoding',
From 2cb2609a4342da449d70d4322ac47d02b9e3fccf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 19 Dec 2010 23:49:20 -0430
Subject: [PATCH 083/668] Making ThemeView test pass
---
lib/Cake/View/ThemeView.php | 2 +-
lib/Cake/tests/cases/libs/view/theme.test.php | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/Cake/View/ThemeView.php b/lib/Cake/View/ThemeView.php
index 02cba797f..bbb6ab623 100644
--- a/lib/Cake/View/ThemeView.php
+++ b/lib/Cake/View/ThemeView.php
@@ -60,7 +60,7 @@ class ThemeView extends View {
$count = count($paths);
for ($i = 0; $i < $count; $i++) {
if (strpos($paths[$i], DS . 'plugins' . DS) === false
- && strpos($paths[$i], DS . 'libs' . DS . 'view') === false) {
+ && strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) {
if ($plugin) {
$themePaths[] = $paths[$i] . 'themed'. DS . $this->theme . DS . 'plugins' . DS . $plugin . DS;
}
diff --git a/lib/Cake/tests/cases/libs/view/theme.test.php b/lib/Cake/tests/cases/libs/view/theme.test.php
index 8c7344328..19004383f 100644
--- a/lib/Cake/tests/cases/libs/view/theme.test.php
+++ b/lib/Cake/tests/cases/libs/view/theme.test.php
@@ -122,7 +122,7 @@ class ThemeViewTest extends CakeTestCase {
$this->ThemeView = new ThemeView($this->PostsController);
App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
}
@@ -156,7 +156,6 @@ class ThemeViewTest extends CakeTestCase {
$ThemeView = new TestThemeView($this->Controller);
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'tests' . DS .'index.ctp';
$result = $ThemeView->getViewFileName('index');
- debug($expected);
$this->assertEqual($result, $expected);
$expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'layouts' . DS .'plugin_default.ctp';
From 3fff5d144a7591400c7436a30af197112dc2dd25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 19 Dec 2010 23:58:47 -0430
Subject: [PATCH 084/668] Making SessionHelper tests pass again
---
lib/Cake/tests/cases/libs/view/helpers/session.test.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/Cake/tests/cases/libs/view/helpers/session.test.php b/lib/Cake/tests/cases/libs/view/helpers/session.test.php
index eb278b9de..63be0cba0 100644
--- a/lib/Cake/tests/cases/libs/view/helpers/session.test.php
+++ b/lib/Cake/tests/cases/libs/view/helpers/session.test.php
@@ -41,6 +41,7 @@ class SessionHelperTest extends CakeTestCase {
$controller = null;
$this->View = new View($controller);
$this->Session = new SessionHelper($this->View);
+ CakeSession::start();
$_SESSION = array(
'test' => 'info',
@@ -129,7 +130,7 @@ class SessionHelperTest extends CakeTestCase {
$this->assertEqual($result, $expected);
App::build(array(
- 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
+ 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
));
$result = $this->Session->flash('notification', true);
$result = str_replace("\r\n", "\n", $result);
From 04929ae1df80420bb53d6257c6125e3fe51ca70d Mon Sep 17 00:00:00 2001
From: mark_story
Date: Tue, 21 Dec 2010 20:40:19 -0500
Subject: [PATCH 085/668] Applying patch from 'Thorsten Buss'. Fixes issues in
DboSource, where mismatching types on join columns could result in incorrect
query generation. Fixes #708
---
cake/libs/model/datasources/datasource.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php
index 94b5d5cef..5de46be8a 100644
--- a/cake/libs/model/datasources/datasource.php
+++ b/cake/libs/model/datasources/datasource.php
@@ -503,6 +503,7 @@ class DataSource extends Object {
foreach ($keys as $key) {
$val = null;
+ $type = null;
if (strpos($query, $key) !== false) {
switch ($key) {
@@ -526,6 +527,7 @@ class DataSource extends Object {
$val = '';
}
}
+ $type = $model->getColumnType($model->primaryKey);
break;
case '{$__cakeForeignKey__$}':
foreach ($model->__associations as $id => $name) {
@@ -533,6 +535,8 @@ class DataSource extends Object {
if ($assocName === $association) {
if (isset($assoc['foreignKey'])) {
$foreignKey = $assoc['foreignKey'];
+ $assocModel = $model->$assocName;
+ $type = $assocModel->getColumnType($assocModel->primaryKey);
if (isset($data[$model->alias][$foreignKey])) {
$val = $data[$model->alias][$foreignKey];
@@ -561,7 +565,7 @@ class DataSource extends Object {
if (empty($val) && $val !== '0') {
return false;
}
- $query = str_replace($key, $this->value($val, $model->getColumnType($model->primaryKey)), $query);
+ $query = str_replace($key, $this->value($val, $type), $query);
}
}
return $query;
From 43401c271a34f32b710ce18d1d0b15f2310b026a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Tue, 21 Dec 2010 21:46:12 -0430
Subject: [PATCH 086/668] Fixing App::uses usage un CakeRouteTest
---
lib/Cake/tests/cases/libs/route/cake_route.test.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Cake/tests/cases/libs/route/cake_route.test.php b/lib/Cake/tests/cases/libs/route/cake_route.test.php
index 76f76f336..904a1ca88 100644
--- a/lib/Cake/tests/cases/libs/route/cake_route.test.php
+++ b/lib/Cake/tests/cases/libs/route/cake_route.test.php
@@ -1,6 +1,6 @@
Date: Tue, 21 Dec 2010 22:01:38 -0430
Subject: [PATCH 087/668] Extracting JsBaseEngineHelper to its own file, fixing
some JsHelper related test cases
---
lib/Cake/View/Helper/JqueryEngineHelper.php | 2 +-
lib/Cake/View/Helper/JsBaseEngineHelper.php | 652 ++++++++++++++++++
lib/Cake/View/Helper/JsHelper.php | 635 +----------------
lib/Cake/View/Helper/MootoolsEngineHelper.php | 2 +-
.../View/Helper/PrototypeEngineHelper.php | 2 +-
.../tests/cases/libs/view/helpers/js.test.php | 1 +
.../view/helpers/mootools_engine.test.php | 2 +-
7 files changed, 659 insertions(+), 637 deletions(-)
create mode 100644 lib/Cake/View/Helper/JsBaseEngineHelper.php
diff --git a/lib/Cake/View/Helper/JqueryEngineHelper.php b/lib/Cake/View/Helper/JqueryEngineHelper.php
index bc3d90423..17e226d6f 100644
--- a/lib/Cake/View/Helper/JqueryEngineHelper.php
+++ b/lib/Cake/View/Helper/JqueryEngineHelper.php
@@ -23,7 +23,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('JsHelper', 'View/Helper');
+App::uses('AppHelper', 'View/Helper');
App::uses('JsBaseEngineHelper', 'View/Helper');
class JqueryEngineHelper extends JsBaseEngineHelper {
diff --git a/lib/Cake/View/Helper/JsBaseEngineHelper.php b/lib/Cake/View/Helper/JsBaseEngineHelper.php
new file mode 100644
index 000000000..8d52f6939
--- /dev/null
+++ b/lib/Cake/View/Helper/JsBaseEngineHelper.php
@@ -0,0 +1,652 @@
+ default arguments.
+ *
+ * @var array
+ * @access protected
+ */
+ protected $_callbackArguments = array();
+
+/**
+ * Constructor.
+ *
+ * @return void
+ */
+ function __construct() {
+ $this->useNative = function_exists('json_encode');
+ }
+
+/**
+ * Create an `alert()` message in Javascript
+ *
+ * @param string $message Message you want to alter.
+ * @return string completed alert()
+ */
+ public function alert($message) {
+ return 'alert("' . $this->escape($message) . '");';
+ }
+
+/**
+ * Redirects to a URL. Creates a window.location modification snippet
+ * that can be used to trigger 'redirects' from Javascript.
+ *
+ * @param mixed $url
+ * @param array $options
+ * @return string completed redirect in javascript
+ */
+ public function redirect($url = null) {
+ return 'window.location = "' . Router::url($url) . '";';
+ }
+
+/**
+ * Create a `confirm()` message
+ *
+ * @param string $message Message you want confirmed.
+ * @return string completed confirm()
+ */
+ public function confirm($message) {
+ return 'confirm("' . $this->escape($message) . '");';
+ }
+
+/**
+ * Generate a confirm snippet that returns false from the current
+ * function scope.
+ *
+ * @param string $message Message to use in the confirm dialog.
+ * @return string completed confirm with return script
+ */
+ public function confirmReturn($message) {
+ $out = 'var _confirm = ' . $this->confirm($message);
+ $out .= "if (!_confirm) {\n\treturn false;\n}";
+ return $out;
+ }
+
+/**
+ * Create a `prompt()` Javascript function
+ *
+ * @param string $message Message you want to prompt.
+ * @param string $default Default message
+ * @return string completed prompt()
+ */
+ public function prompt($message, $default = '') {
+ return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");';
+ }
+
+/**
+ * Generates a JavaScript object in JavaScript Object Notation (JSON)
+ * from an array. Will use native JSON encode method if available, and $useNative == true
+ *
+ * ### Options:
+ *
+ * - `prefix` - String prepended to the returned data.
+ * - `postfix` - String appended to the returned data.
+ *
+ * @param array $data Data to be converted.
+ * @param array $options Set of options, see above.
+ * @return string A JSON code block
+ */
+ public function object($data = array(), $options = array()) {
+ $defaultOptions = array(
+ 'prefix' => '', 'postfix' => '',
+ );
+ $options = array_merge($defaultOptions, $options);
+
+ if (is_object($data)) {
+ $data = get_object_vars($data);
+ }
+
+ $out = $keys = array();
+ $numeric = true;
+
+ if ($this->useNative && function_exists('json_encode')) {
+ $rt = json_encode($data);
+ } else {
+ if (is_null($data)) {
+ return 'null';
+ }
+ if (is_bool($data)) {
+ return $data ? 'true' : 'false';
+ }
+ if (is_array($data)) {
+ $keys = array_keys($data);
+ }
+
+ if (!empty($keys)) {
+ $numeric = (array_values($keys) === array_keys(array_values($keys)));
+ }
+
+ foreach ($data as $key => $val) {
+ if (is_array($val) || is_object($val)) {
+ $val = $this->object($val);
+ } else {
+ $val = $this->value($val);
+ }
+ if (!$numeric) {
+ $val = '"' . $this->value($key, false) . '":' . $val;
+ }
+ $out[] = $val;
+ }
+
+ if (!$numeric) {
+ $rt = '{' . join(',', $out) . '}';
+ } else {
+ $rt = '[' . join(',', $out) . ']';
+ }
+ }
+ $rt = $options['prefix'] . $rt . $options['postfix'];
+ return $rt;
+ }
+
+/**
+ * Converts a PHP-native variable of any type to a JSON-equivalent representation
+ *
+ * @param mixed $val A PHP variable to be converted to JSON
+ * @param boolean $quoteStrings If false, leaves string values unquoted
+ * @return string a JavaScript-safe/JSON representation of $val
+ */
+ public function value($val, $quoteString = true) {
+ switch (true) {
+ case (is_array($val) || is_object($val)):
+ $val = $this->object($val);
+ break;
+ case ($val === null):
+ $val = 'null';
+ break;
+ case (is_bool($val)):
+ $val = ($val === true) ? 'true' : 'false';
+ break;
+ case (is_int($val)):
+ $val = $val;
+ break;
+ case (is_float($val)):
+ $val = sprintf("%.11f", $val);
+ break;
+ default:
+ $val = $this->escape($val);
+ if ($quoteString) {
+ $val = '"' . $val . '"';
+ }
+ break;
+ }
+ return $val;
+ }
+
+/**
+ * Escape a string to be JSON friendly.
+ *
+ * List of escaped elements:
+ *
+ * - "\r" => '\n'
+ * - "\n" => '\n'
+ * - '"' => '\"'
+ *
+ * @param string $script String that needs to get escaped.
+ * @return string Escaped string.
+ */
+ public function escape($string) {
+ return $this->_utf8ToHex($string);
+ }
+
+/**
+ * Encode a string into JSON. Converts and escapes necessary characters.
+ *
+ * @param string $string The string that needs to be utf8->hex encoded
+ * @return void
+ */
+ protected function _utf8ToHex($string) {
+ $length = strlen($string);
+ $return = '';
+ for ($i = 0; $i < $length; ++$i) {
+ $ord = ord($string{$i});
+ switch (true) {
+ case $ord == 0x08:
+ $return .= '\b';
+ break;
+ case $ord == 0x09:
+ $return .= '\t';
+ break;
+ case $ord == 0x0A:
+ $return .= '\n';
+ break;
+ case $ord == 0x0C:
+ $return .= '\f';
+ break;
+ case $ord == 0x0D:
+ $return .= '\r';
+ break;
+ case $ord == 0x22:
+ case $ord == 0x2F:
+ case $ord == 0x5C:
+ $return .= '\\' . $string{$i};
+ break;
+ case (($ord >= 0x20) && ($ord <= 0x7F)):
+ $return .= $string{$i};
+ break;
+ case (($ord & 0xE0) == 0xC0):
+ if ($i + 1 >= $length) {
+ $i += 1;
+ $return .= '?';
+ break;
+ }
+ $charbits = $string{$i} . $string{$i + 1};
+ $char = Multibyte::utf8($charbits);
+ $return .= sprintf('\u%04s', dechex($char[0]));
+ $i += 1;
+ break;
+ case (($ord & 0xF0) == 0xE0):
+ if ($i + 2 >= $length) {
+ $i += 2;
+ $return .= '?';
+ break;
+ }
+ $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2};
+ $char = Multibyte::utf8($charbits);
+ $return .= sprintf('\u%04s', dechex($char[0]));
+ $i += 2;
+ break;
+ case (($ord & 0xF8) == 0xF0):
+ if ($i + 3 >= $length) {
+ $i += 3;
+ $return .= '?';
+ break;
+ }
+ $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3};
+ $char = Multibyte::utf8($charbits);
+ $return .= sprintf('\u%04s', dechex($char[0]));
+ $i += 3;
+ break;
+ case (($ord & 0xFC) == 0xF8):
+ if ($i + 4 >= $length) {
+ $i += 4;
+ $return .= '?';
+ break;
+ }
+ $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4};
+ $char = Multibyte::utf8($charbits);
+ $return .= sprintf('\u%04s', dechex($char[0]));
+ $i += 4;
+ break;
+ case (($ord & 0xFE) == 0xFC):
+ if ($i + 5 >= $length) {
+ $i += 5;
+ $return .= '?';
+ break;
+ }
+ $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4} . $string{$i + 5};
+ $char = Multibyte::utf8($charbits);
+ $return .= sprintf('\u%04s', dechex($char[0]));
+ $i += 5;
+ break;
+ }
+ }
+ return $return;
+ }
+
+/**
+ * Create javascript selector for a CSS rule
+ *
+ * @param string $selector The selector that is targeted
+ * @return object instance of $this. Allows chained methods.
+ */
+ abstract public function get($selector);
+
+/**
+ * Add an event to the script cache. Operates on the currently selected elements.
+ *
+ * ### Options
+ *
+ * - `wrap` - Whether you want the callback wrapped in an anonymous function. (defaults to true)
+ * - `stop` - Whether you want the event to stopped. (defaults to true)
+ *
+ * @param string $type Type of event to bind to the current dom id
+ * @param string $callback The Javascript function you wish to trigger or the function literal
+ * @param array $options Options for the event.
+ * @return string completed event handler
+ */
+ abstract public function event($type, $callback, $options = array());
+
+/**
+ * Create a domReady event. This is a special event in many libraries
+ *
+ * @param string $functionBody The code to run on domReady
+ * @return string completed domReady method
+ */
+ abstract public function domReady($functionBody);
+
+/**
+ * Create an iteration over the current selection result.
+ *
+ * @param string $callback The function body you wish to apply during the iteration.
+ * @return string completed iteration
+ */
+ abstract public function each($callback);
+
+/**
+ * Trigger an Effect.
+ *
+ * ### Supported Effects
+ *
+ * The following effects are supported by all core JsEngines
+ *
+ * - `show` - reveal an element.
+ * - `hide` - hide an element.
+ * - `fadeIn` - Fade in an element.
+ * - `fadeOut` - Fade out an element.
+ * - `slideIn` - Slide an element in.
+ * - `slideOut` - Slide an element out.
+ *
+ * ### Options
+ *
+ * - `speed` - Speed at which the animation should occur. Accepted values are 'slow', 'fast'. Not all effects use
+ * the speed option.
+ *
+ * @param string $name The name of the effect to trigger.
+ * @param array $options Array of options for the effect.
+ * @return string completed string with effect.
+ */
+ abstract public function effect($name, $options = array());
+
+/**
+ * Make an XHR request
+ *
+ * ### Event Options
+ *
+ * - `complete` - Callback to fire on complete.
+ * - `success` - Callback to fire on success.
+ * - `before` - Callback to fire on request initialization.
+ * - `error` - Callback to fire on request failure.
+ *
+ * ### Options
+ *
+ * - `method` - The method to make the request with defaults to GET in more libraries
+ * - `async` - Whether or not you want an asynchronous request.
+ * - `data` - Additional data to send.
+ * - `update` - Dom id to update with the content of the request.
+ * - `type` - Data type for response. 'json' and 'html' are supported. Default is html for most libraries.
+ * - `evalScripts` - Whether or not '
);
+/**
+ * Minimized attributes
+ *
+ * @var array
+ */
+ protected $_minimizedAttributes = array(
+ 'compact', 'checked', 'declare', 'readonly', 'disabled', 'selected',
+ 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize'
+ );
+
+/**
+ * Format to attribute
+ *
+ * @var string
+ */
+ protected $_attributeFormat = '%s="%s"';
+
+/**
+ * Format to attribute
+ *
+ * @var string
+ */
+ protected $_minimizedAttributeFormat = '%s="%s"';
+
/**
* Breadcrumbs.
*
@@ -881,4 +905,93 @@ class HtmlHelper extends AppHelper {
}
return $out;
}
+
+/**
+ * Returns a space-delimited string with items of the $options array. If a
+ * key of $options array happens to be one of:
+ *
+ * - 'compact'
+ * - 'checked'
+ * - 'declare'
+ * - 'readonly'
+ * - 'disabled'
+ * - 'selected'
+ * - 'defer'
+ * - 'ismap'
+ * - 'nohref'
+ * - 'noshade'
+ * - 'nowrap'
+ * - 'multiple'
+ * - 'noresize'
+ *
+ * And its value is one of:
+ *
+ * - '1' (string)
+ * - 1 (integer)
+ * - true (boolean)
+ * - 'true' (string)
+ *
+ * Then the value will be reset to be identical with key's name.
+ * If the value is not one of these 3, the parameter is not output.
+ *
+ * 'escape' is a special option in that it controls the conversion of
+ * attributes to their html-entity encoded equivalents. Set to false to disable html-encoding.
+ *
+ * If value for any option key is set to `null` or `false`, that option will be excluded from output.
+ *
+ * @param array $options Array of options.
+ * @param array $exclude Array of options to be excluded, the options here will not be part of the return.
+ * @param string $insertBefore String to be inserted before options.
+ * @param string $insertAfter String to be inserted after options.
+ * @return string Composed attributes.
+ */
+ public function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
+ if (is_array($options)) {
+ $options = array_merge(array('escape' => true), $options);
+
+ if (!is_array($exclude)) {
+ $exclude = array();
+ }
+ $filtered = array_diff_key($options, array_merge(array_flip($exclude), array('escape' => true)));
+ $escape = $options['escape'];
+ $attributes = array();
+
+ foreach ($filtered as $key => $value) {
+ if ($value !== false && $value !== null) {
+ $attributes[] = $this->_formatAttribute($key, $value, $escape);
+ }
+ }
+ $out = implode(' ', $attributes);
+ } else {
+ $out = $options;
+ }
+ return $out ? $insertBefore . $out . $insertAfter : '';
+ }
+
+/**
+ * Formats an individual attribute, and returns the string value of the composed attribute.
+ * Works with minimized attributes that have the same value as their name such as 'disabled' and 'checked'
+ *
+ * @param string $key The name of the attribute to create
+ * @param string $value The value of the attribute to create.
+ * @return string The composed attribute.
+ */
+ protected function _formatAttribute($key, $value, $escape = true) {
+ $attribute = '';
+ if (is_array($value)) {
+ $value = '';
+ }
+
+ if (is_numeric($key)) {
+ $attribute = sprintf($this->_minimizedAttributeFormat, $value, $value);
+ } elseif (in_array($key, $this->_minimizedAttributes)) {
+ if ($value === 1 || $value === true || $value === 'true' || $value === '1' || $value == $key) {
+ $attribute = sprintf($this->_minimizedAttributeFormat, $key, $key);
+ }
+ } else {
+ $attribute = sprintf($this->_attributeFormat, $key, ($escape ? h($value) : $value));
+ }
+ return $attribute;
+ }
+
}
diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php
index 44b38f903..125e00ac1 100644
--- a/cake/tests/cases/libs/view/helper.test.php
+++ b/cake/tests/cases/libs/view/helper.test.php
@@ -179,35 +179,6 @@ class TestHelper extends Helper {
}
}
-/**
- * Html5TestHelper class
- *
- * @package cake.tests.cases.libs.view
- */
-class Html5TestHelper extends TestHelper {
-
-/**
- * Minimized
- *
- * @var array
- */
- protected $_minimizedAttributes = array('require', 'checked');
-
-/**
- * Allow compact use in HTML
- *
- * @var string
- */
- protected $_minimizedAttributeFormat = '%s';
-
-/**
- * Test to attribute format
- *
- * @var string
- */
- protected $_attributeFormat = 'data-%s="%s"';
-}
-
/**
* HelperTest class
*
@@ -815,32 +786,6 @@ class HelperTest extends CakeTestCase {
Configure::write('App.www_root', $webRoot);
}
-/**
- * test parsing attributes.
- *
- * @return void
- */
- function testParseAttributeCompact() {
- $helper = new TestHelper($this->View);
- $compact = array('compact', 'checked', 'declare', 'readonly', 'disabled',
- 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize');
-
- foreach ($compact as $attribute) {
- foreach (array('true', true, 1, '1', $attribute) as $value) {
- $attrs = array($attribute => $value);
- $expected = ' ' . $attribute . '="' . $attribute . '"';
- $this->assertEqual($helper->parseAttributes($attrs), $expected, '%s Failed on ' . $value);
- }
- }
- $this->assertEqual($helper->parseAttributes(array('compact')), ' compact="compact"');
-
- $helper = new Html5TestHelper($this->View);
- $expected = ' require';
- $this->assertEqual($helper->parseAttributes(array('require')), $expected);
- $this->assertEqual($helper->parseAttributes(array('require' => true)), $expected);
- $this->assertEqual($helper->parseAttributes(array('require' => false)), '');
- }
-
/**
* test lazy loading helpers is seamless
*
diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php
index 41d0aed9b..c3e73790e 100644
--- a/cake/tests/cases/libs/view/helpers/html.test.php
+++ b/cake/tests/cases/libs/view/helpers/html.test.php
@@ -47,6 +47,50 @@ class TheHtmlTestController extends Controller {
public $uses = null;
}
+class TestHtmlHelper extends HtmlHelper {
+/**
+ * expose a method as public
+ *
+ * @param string $options
+ * @param string $exclude
+ * @param string $insertBefore
+ * @param string $insertAfter
+ * @return void
+ */
+ function parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
+ return $this->_parseAttributes($options, $exclude, $insertBefore, $insertAfter);
+ }
+}
+
+/**
+ * Html5TestHelper class
+ *
+ * @package cake.tests.cases.libs.view.helpers
+ */
+class Html5TestHelper extends TestHtmlHelper {
+
+/**
+ * Minimized
+ *
+ * @var array
+ */
+ protected $_minimizedAttributes = array('require', 'checked');
+
+/**
+ * Allow compact use in HTML
+ *
+ * @var string
+ */
+ protected $_minimizedAttributeFormat = '%s';
+
+/**
+ * Test to attribute format
+ *
+ * @var string
+ */
+ protected $_attributeFormat = 'data-%s="%s"';
+}
+
/**
* HtmlHelperTest class
*
@@ -1312,4 +1356,31 @@ class HtmlHelperTest extends CakeTestCase {
)
);
}
+
+/**
+ * test parsing attributes.
+ *
+ * @return void
+ */
+ function testParseAttributeCompact() {
+ $helper = new TestHtmlHelper($this->View);
+ $compact = array('compact', 'checked', 'declare', 'readonly', 'disabled',
+ 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize');
+
+ foreach ($compact as $attribute) {
+ foreach (array('true', true, 1, '1', $attribute) as $value) {
+ $attrs = array($attribute => $value);
+ $expected = ' ' . $attribute . '="' . $attribute . '"';
+ $this->assertEqual($helper->parseAttributes($attrs), $expected, '%s Failed on ' . $value);
+ }
+ }
+ $this->assertEqual($helper->parseAttributes(array('compact')), ' compact="compact"');
+
+ $helper = new Html5TestHelper($this->View);
+ $expected = ' require';
+ $this->assertEqual($helper->parseAttributes(array('require')), $expected);
+ $this->assertEqual($helper->parseAttributes(array('require' => true)), $expected);
+ $this->assertEqual($helper->parseAttributes(array('require' => false)), '');
+ }
+
}
From b1f4c6a0c9bd932e25bf1090cf0287594653f321 Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 12:38:36 -0200
Subject: [PATCH 186/668] Changed tags attributes to protected.
---
cake/libs/view/helpers/html.php | 47 ++++++++++++++++-----------------
1 file changed, 23 insertions(+), 24 deletions(-)
diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index d4af24612..21746f60a 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -29,9 +29,8 @@ class HtmlHelper extends AppHelper {
* html tags used by this helper.
*
* @var array
- * @access public
*/
- public $tags = array(
+ protected $_tags = array(
'meta' => '',
'metalink' => '',
'link' => '%s',
@@ -246,14 +245,14 @@ class HtmlHelper extends AppHelper {
if (isset($options['link'])) {
if (isset($options['rel']) && $options['rel'] === 'icon') {
- $out = sprintf($this->tags['metalink'], $options['link'], $this->_parseAttributes($options, array('link'), ' ', ' '));
+ $out = sprintf($this->_tags['metalink'], $options['link'], $this->_parseAttributes($options, array('link'), ' ', ' '));
$options['rel'] = 'shortcut icon';
} else {
$options['link'] = $this->url($options['link'], true);
}
- $out .= sprintf($this->tags['metalink'], $options['link'], $this->_parseAttributes($options, array('link'), ' ', ' '));
+ $out .= sprintf($this->_tags['metalink'], $options['link'], $this->_parseAttributes($options, array('link'), ' ', ' '));
} else {
- $out = sprintf($this->tags['meta'], $this->_parseAttributes($options, array('type'), ' ', ' '));
+ $out = sprintf($this->_tags['meta'], $this->_parseAttributes($options, array('type'), ' ', ' '));
}
if ($inline) {
@@ -276,7 +275,7 @@ class HtmlHelper extends AppHelper {
if (empty($charset)) {
$charset = strtolower(Configure::read('App.encoding'));
}
- return sprintf($this->tags['charset'], (!empty($charset) ? $charset : 'utf-8'));
+ return sprintf($this->_tags['charset'], (!empty($charset) ? $charset : 'utf-8'));
}
/**
@@ -336,7 +335,7 @@ class HtmlHelper extends AppHelper {
}
unset($options['default']);
}
- return sprintf($this->tags['link'], $url, $this->_parseAttributes($options), $title);
+ return sprintf($this->_tags['link'], $url, $this->_parseAttributes($options), $title);
}
/**
@@ -391,12 +390,12 @@ class HtmlHelper extends AppHelper {
}
if ($rel == 'import') {
- $out = sprintf($this->tags['style'], $this->_parseAttributes($options, array('inline'), '', ' '), '@import url(' . $url . ');');
+ $out = sprintf($this->_tags['style'], $this->_parseAttributes($options, array('inline'), '', ' '), '@import url(' . $url . ');');
} else {
if ($rel == null) {
$rel = 'stylesheet';
}
- $out = sprintf($this->tags['css'], $rel, $url, $this->_parseAttributes($options, array('inline'), '', ' '));
+ $out = sprintf($this->_tags['css'], $rel, $url, $this->_parseAttributes($options, array('inline'), '', ' '));
}
if ($options['inline']) {
@@ -462,7 +461,7 @@ class HtmlHelper extends AppHelper {
}
}
$attributes = $this->_parseAttributes($options, array('inline', 'once'), ' ');
- $out = sprintf($this->tags['javascriptlink'], $url, $attributes);
+ $out = sprintf($this->_tags['javascriptlink'], $url, $attributes);
if ($options['inline']) {
return $out;
@@ -494,9 +493,9 @@ class HtmlHelper extends AppHelper {
unset($options['inline'], $options['safe']);
$attributes = $this->_parseAttributes($options, ' ', ' ');
if ($inline) {
- return sprintf($this->tags['javascriptblock'], $attributes, $script);
+ return sprintf($this->_tags['javascriptblock'], $attributes, $script);
} else {
- $this->_View->addScript(sprintf($this->tags['javascriptblock'], $attributes, $script));
+ $this->_View->addScript(sprintf($this->_tags['javascriptblock'], $attributes, $script));
return null;
}
}
@@ -675,10 +674,10 @@ class HtmlHelper extends AppHelper {
unset($options['url']);
}
- $image = sprintf($this->tags['image'], $path, $this->_parseAttributes($options, null, '', ' '));
+ $image = sprintf($this->_tags['image'], $path, $this->_parseAttributes($options, null, '', ' '));
if ($url) {
- return sprintf($this->tags['link'], $this->url($url), null, $image);
+ return sprintf($this->_tags['link'], $this->url($url), null, $image);
}
return $image;
}
@@ -696,9 +695,9 @@ class HtmlHelper extends AppHelper {
public function tableHeaders($names, $trOptions = null, $thOptions = null) {
$out = array();
foreach ($names as $arg) {
- $out[] = sprintf($this->tags['tableheader'], $this->_parseAttributes($thOptions), $arg);
+ $out[] = sprintf($this->_tags['tableheader'], $this->_parseAttributes($thOptions), $arg);
}
- return sprintf($this->tags['tablerow'], $this->_parseAttributes($trOptions), join(' ', $out));
+ return sprintf($this->_tags['tablerow'], $this->_parseAttributes($trOptions), join(' ', $out));
}
/**
@@ -748,10 +747,10 @@ class HtmlHelper extends AppHelper {
} elseif ($useCount) {
$cellOptions['class'] = 'column-' . ++$i;
}
- $cellsOut[] = sprintf($this->tags['tablecell'], $this->_parseAttributes($cellOptions), $cell);
+ $cellsOut[] = sprintf($this->_tags['tablecell'], $this->_parseAttributes($cellOptions), $cell);
}
$options = $this->_parseAttributes($count % 2 ? $oddTrOptions : $evenTrOptions);
- $out[] = sprintf($this->tags['tablerow'], $options, implode(' ', $cellsOut));
+ $out[] = sprintf($this->_tags['tablerow'], $options, implode(' ', $cellsOut));
}
return implode("\n", $out);
}
@@ -784,7 +783,7 @@ class HtmlHelper extends AppHelper {
} else {
$tag = 'tag';
}
- return sprintf($this->tags[$tag], $name, $this->_parseAttributes($options, null, ' ', ''), $text, $name);
+ return sprintf($this->_tags[$tag], $name, $this->_parseAttributes($options, null, ' ', ''), $text, $name);
}
/**
@@ -794,7 +793,7 @@ class HtmlHelper extends AppHelper {
* @return string Formatted block
*/
public function useTag($tag) {
- if (!isset($this->tags[$tag])) {
+ if (!isset($this->_tags[$tag])) {
return '';
}
$args = func_get_args();
@@ -804,7 +803,7 @@ class HtmlHelper extends AppHelper {
$arg = $this->_parseAttributes($arg, null, ' ', '');
}
}
- return vsprintf($this->tags[$tag], $args);
+ return vsprintf($this->_tags[$tag], $args);
}
/**
@@ -855,7 +854,7 @@ class HtmlHelper extends AppHelper {
} else {
$tag = 'para';
}
- return sprintf($this->tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $text);
+ return sprintf($this->_tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $text);
}
/**
@@ -873,7 +872,7 @@ class HtmlHelper extends AppHelper {
$options = array();
}
$items = $this->__nestedListItem($list, $options, $itemOptions, $tag);
- return sprintf($this->tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $items);
+ return sprintf($this->_tags[$tag], $this->_parseAttributes($options, null, ' ', ''), $items);
}
/**
@@ -900,7 +899,7 @@ class HtmlHelper extends AppHelper {
} else if (isset($itemOptions['odd']) && $index % 2 != 0) {
$itemOptions['class'] = $itemOptions['odd'];
}
- $out .= sprintf($this->tags['li'], $this->_parseAttributes($itemOptions, array('even', 'odd'), ' ', ''), $item);
+ $out .= sprintf($this->_tags['li'], $this->_parseAttributes($itemOptions, array('even', 'odd'), ' ', ''), $item);
$index++;
}
return $out;
From 7df97820207fd600bffa2fd484b8be667fe46a4d Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 16:21:17 -0200
Subject: [PATCH 187/668] Moving loadConfig to Html helper.
---
cake/libs/view/helper.php | 16 ----------------
cake/libs/view/helpers/html.php | 16 ++++++++++++++++
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php
index 88588f808..0337b5088 100644
--- a/cake/libs/view/helper.php
+++ b/cake/libs/view/helper.php
@@ -174,22 +174,6 @@ class Helper extends Object {
return $this->{$name} = $value;
}
-/**
- * Parses tag templates into $this->tags.
- *
- * @param $name file name inside app/config to load.
- * @return array merged tags from config/$name.php
- */
- public function loadConfig($name = 'tags') {
- if (file_exists(CONFIGS . $name .'.php')) {
- require(CONFIGS . $name .'.php');
- if (isset($tags)) {
- $this->tags = array_merge($this->tags, $tags);
- }
- }
- return $this->tags;
- }
-
/**
* Finds URL for specified action.
*
diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index 21746f60a..d784c6f66 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -905,6 +905,22 @@ class HtmlHelper extends AppHelper {
return $out;
}
+/**
+ * Parses tag templates into $this->tags.
+ *
+ * @param $name file name inside app/config to load.
+ * @return array merged tags from config/$name.php
+ */
+ public function loadConfig($name = 'tags') {
+ if (file_exists(CONFIGS . $name .'.php')) {
+ require(CONFIGS . $name .'.php');
+ if (isset($tags)) {
+ $this->_tags = array_merge($this->_tags, $tags);
+ }
+ }
+ return $this->_tags;
+ }
+
/**
* Returns a space-delimited string with items of the $options array. If a
* key of $options array happens to be one of:
From 1a90bf7292930af87859c2b7d4e7a7322c07bdd6 Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 19:26:13 -0200
Subject: [PATCH 188/668] Support to read ini files without section in
IniReader.
---
cake/libs/config/ini_reader.php | 7 ++++++-
cake/tests/cases/libs/config/ini_reader.test.php | 16 ++++++++++++++++
cake/tests/test_app/config/no_section.ini | 2 ++
3 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 cake/tests/test_app/config/no_section.ini
diff --git a/cake/libs/config/ini_reader.php b/cake/libs/config/ini_reader.php
index 915bf9498..e20f8dcfb 100644
--- a/cake/libs/config/ini_reader.php
+++ b/cake/libs/config/ini_reader.php
@@ -77,7 +77,12 @@ class IniReader implements ConfigReaderInterface {
} else {
$values = array();
foreach ($contents as $section => $attribs) {
- $values[$section] = $this->_parseNestedValues($attribs);
+ if (is_array($attribs)) {
+ $values[$section] = $this->_parseNestedValues($attribs);
+ } else {
+ $parse = $this->_parseNestedValues(array($attribs));
+ $values[$section] = array_shift($parse);
+ }
}
}
return $values;
diff --git a/cake/tests/cases/libs/config/ini_reader.test.php b/cake/tests/cases/libs/config/ini_reader.test.php
index 2fb8eb2dd..3db8bb942 100644
--- a/cake/tests/cases/libs/config/ini_reader.test.php
+++ b/cake/tests/cases/libs/config/ini_reader.test.php
@@ -64,6 +64,22 @@ class IniReaderTest extends CakeTestCase {
$this->assertEquals('administrators', $config['groups']);
}
+/**
+ * test without section
+ *
+ * @return void
+ */
+ public function testReadingWithoutSection() {
+ $reader = new IniReader($this->path);
+ $config = $reader->read('no_section.ini');
+
+ $expected = array(
+ 'some_key' => 'some_value',
+ 'bool_key' => true
+ );
+ $this->assertEquals($config, $expected);
+ }
+
/**
* test that names with .'s get exploded into arrays.
*
diff --git a/cake/tests/test_app/config/no_section.ini b/cake/tests/test_app/config/no_section.ini
new file mode 100644
index 000000000..6e6fbb7a0
--- /dev/null
+++ b/cake/tests/test_app/config/no_section.ini
@@ -0,0 +1,2 @@
+some_key = some_value
+bool_key = 1
From 175e00830830328e104a7669dffba36c5b6d89d8 Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 19:27:50 -0200
Subject: [PATCH 189/668] Reading configuration using reader classes. You can
pass the key configFile in Html settings to load in constructor.
---
cake/libs/view/helpers/html.php | 66 ++++++++++++++++---
.../cases/libs/view/helpers/html.test.php | 54 ++++++++++++++-
.../test_app/config/htmlhelper_minimized.ini | 2 +
.../tests/test_app/config/htmlhelper_tags.php | 8 +++
4 files changed, 120 insertions(+), 10 deletions(-)
create mode 100644 cake/tests/test_app/config/htmlhelper_minimized.ini
create mode 100644 cake/tests/test_app/config/htmlhelper_tags.php
diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index d784c6f66..21543f311 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -152,6 +152,19 @@ class HtmlHelper extends AppHelper {
'xhtml11' => ''
);
+/**
+ * Default Constructor
+ *
+ * @param View $View The View this helper is being attached to.
+ * @param array $settings Configuration settings for the helper.
+ */
+ public function __construct(View $View, $settings = array()) {
+ parent::__construct($View, $settings);
+ if (!empty($settings['configFile'])) {
+ $this->loadConfig($settings['configFile']);
+ }
+ }
+
/**
* Adds a link to the breadcrumbs array.
*
@@ -906,19 +919,54 @@ class HtmlHelper extends AppHelper {
}
/**
- * Parses tag templates into $this->tags.
+ * Load Html configs
*
- * @param $name file name inside app/config to load.
- * @return array merged tags from config/$name.php
+ * @param mixed $configFile String with the config file (load using PhpReader) or an array with file and reader name
+ * @param string $path Path with config file
+ * @return mixed False to error or loaded configs
*/
- public function loadConfig($name = 'tags') {
- if (file_exists(CONFIGS . $name .'.php')) {
- require(CONFIGS . $name .'.php');
- if (isset($tags)) {
- $this->_tags = array_merge($this->_tags, $tags);
+ public function loadConfig($configFile, $path = CONFIGS) {
+ $file = null;
+ $reader = 'php';
+
+ if (!is_array($configFile)) {
+ $file = $configFile;
+ } elseif (isset($configFile[0])) {
+ $file = $configFile[0];
+ if (isset($configFile[1])) {
+ $reader = $configFile[1];
}
+ } else {
+ return trigger_error(__('Cannot load the configuration file. Wrong "configFile" configuration.'), E_USER_NOTICE);
}
- return $this->_tags;
+
+ $readerClass = Inflector::camelize($reader) . 'Reader';
+ if (!App::import('Lib', 'config/' . $readerClass)) {
+ return trigger_error(__('Cannot load the configuration file. Unknown reader.'), E_USER_NOTICE);
+ }
+
+ try {
+ $readerObj = new $readerClass($path);
+ $configs = $readerObj->read($file);
+ if (isset($configs['tags']) && is_array($configs['tags'])) {
+ $this->_tags = array_merge($this->_tags, $configs['tags']);
+ }
+ if (isset($configs['minimizedAttributes']) && is_array($configs['minimizedAttributes'])) {
+ $this->_minimizedAttributes = array_merge($this->_minimizedAttributes, $configs['minimizedAttributes']);
+ }
+ if (isset($configs['docTypes']) && is_array($configs['docTypes'])) {
+ $this->__docTypes = array_merge($this->__docTypes, $configs['docTypes']);
+ }
+ if (isset($configs['attributeFormat'])) {
+ $this->_attributeFormat = $configs['attributeFormat'];
+ }
+ if (isset($configs['minimizedAttributeFormat'])) {
+ $this->_minimizedAttributeFormat = $configs['minimizedAttributeFormat'];
+ }
+ } catch (Exception $e) {
+ return trigger_error(__('Cannot load the configuration file. Failed to load the file.'), E_USER_NOTICE);
+ }
+ return $configs;
}
/**
diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php
index c3e73790e..a7a4cfbec 100644
--- a/cake/tests/cases/libs/view/helpers/html.test.php
+++ b/cake/tests/cases/libs/view/helpers/html.test.php
@@ -60,6 +60,20 @@ class TestHtmlHelper extends HtmlHelper {
function parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
return $this->_parseAttributes($options, $exclude, $insertBefore, $insertAfter);
}
+
+/**
+ * Get a protected attribute value
+ *
+ * @param string $attribute
+ * @return mixed
+ */
+ public function getAttribute($attribute) {
+ if (!isset($this->{$attribute})) {
+ return null;
+ }
+ return $this->{$attribute};
+ }
+
}
/**
@@ -128,7 +142,7 @@ class HtmlHelperTest extends CakeTestCase {
function setUp() {
parent::setUp();
$this->View = $this->getMock('View', array('addScript'), array(new TheHtmlTestController()));
- $this->Html = new HtmlHelper($this->View);
+ $this->Html = new TestHtmlHelper($this->View);
$this->Html->request = new CakeRequest(null, false);
$this->Html->request->webroot = '';
@@ -1357,6 +1371,44 @@ class HtmlHelperTest extends CakeTestCase {
);
}
+/**
+ * testLoadConfig method
+ *
+ * @return void
+ */
+
+ public function testLoadConfig() {
+ $path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
+
+ $result = $this->Html->loadConfig('htmlhelper_tags', $path);
+ $expected = array(
+ 'tags' => array(
+ 'form' => 'start form',
+ 'formend' => 'finish form'
+ )
+ );
+ $this->assertEqual($result, $expected);
+ $tags = $this->Html->getAttribute('_tags');
+ $this->assertEqual($tags['form'], 'start form');
+ $this->assertEqual($tags['formend'], 'finish form');
+ $this->assertEqual($tags['selectend'], '');
+
+ $result = $this->Html->loadConfig(array('htmlhelper_minimized.ini', 'ini'), $path);
+ $expected = array(
+ 'minimizedAttributeFormat' => 'format'
+ );
+ $this->assertEqual($result, $expected);
+ $this->assertEqual($this->Html->getAttribute('_minimizedAttributeFormat'), 'format');
+
+ $this->expectError();
+ $result = $this->Html->loadConfig('wrong_file');
+ $this->assertFalse($result);
+
+ $this->expectError();
+ $result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
+ $this->assertFalse($result);
+ }
+
/**
* test parsing attributes.
*
diff --git a/cake/tests/test_app/config/htmlhelper_minimized.ini b/cake/tests/test_app/config/htmlhelper_minimized.ini
new file mode 100644
index 000000000..e6a722d67
--- /dev/null
+++ b/cake/tests/test_app/config/htmlhelper_minimized.ini
@@ -0,0 +1,2 @@
+minimizedAttributeFormat = "format"
+
diff --git a/cake/tests/test_app/config/htmlhelper_tags.php b/cake/tests/test_app/config/htmlhelper_tags.php
new file mode 100644
index 000000000..abff9cdf5
--- /dev/null
+++ b/cake/tests/test_app/config/htmlhelper_tags.php
@@ -0,0 +1,8 @@
+ array(
+ 'form' => 'start form',
+ 'formend' => 'finish form'
+ )
+);
\ No newline at end of file
From 55c557d5a154e1880a0191c1a8305697fe51713e Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 19:26:13 -0200
Subject: [PATCH 190/668] Support to read ini files without section in
IniReader.
---
cake/libs/config/ini_reader.php | 7 ++++++-
cake/tests/cases/libs/config/ini_reader.test.php | 16 ++++++++++++++++
cake/tests/test_app/config/no_section.ini | 2 ++
3 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 cake/tests/test_app/config/no_section.ini
diff --git a/cake/libs/config/ini_reader.php b/cake/libs/config/ini_reader.php
index 915bf9498..e20f8dcfb 100644
--- a/cake/libs/config/ini_reader.php
+++ b/cake/libs/config/ini_reader.php
@@ -77,7 +77,12 @@ class IniReader implements ConfigReaderInterface {
} else {
$values = array();
foreach ($contents as $section => $attribs) {
- $values[$section] = $this->_parseNestedValues($attribs);
+ if (is_array($attribs)) {
+ $values[$section] = $this->_parseNestedValues($attribs);
+ } else {
+ $parse = $this->_parseNestedValues(array($attribs));
+ $values[$section] = array_shift($parse);
+ }
}
}
return $values;
diff --git a/cake/tests/cases/libs/config/ini_reader.test.php b/cake/tests/cases/libs/config/ini_reader.test.php
index 2fb8eb2dd..3db8bb942 100644
--- a/cake/tests/cases/libs/config/ini_reader.test.php
+++ b/cake/tests/cases/libs/config/ini_reader.test.php
@@ -64,6 +64,22 @@ class IniReaderTest extends CakeTestCase {
$this->assertEquals('administrators', $config['groups']);
}
+/**
+ * test without section
+ *
+ * @return void
+ */
+ public function testReadingWithoutSection() {
+ $reader = new IniReader($this->path);
+ $config = $reader->read('no_section.ini');
+
+ $expected = array(
+ 'some_key' => 'some_value',
+ 'bool_key' => true
+ );
+ $this->assertEquals($config, $expected);
+ }
+
/**
* test that names with .'s get exploded into arrays.
*
diff --git a/cake/tests/test_app/config/no_section.ini b/cake/tests/test_app/config/no_section.ini
new file mode 100644
index 000000000..6e6fbb7a0
--- /dev/null
+++ b/cake/tests/test_app/config/no_section.ini
@@ -0,0 +1,2 @@
+some_key = some_value
+bool_key = 1
From 5b8f680d43874e98ac3be2ba40045c61777b05b2 Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 20:00:06 -0200
Subject: [PATCH 191/668] Throwing exception instead notice in loadConfig.
---
cake/libs/view/helpers/html.php | 40 +++++++++----------
.../cases/libs/view/helpers/html.test.php | 4 +-
2 files changed, 20 insertions(+), 24 deletions(-)
diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index 21543f311..436941a81 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -937,34 +937,30 @@ class HtmlHelper extends AppHelper {
$reader = $configFile[1];
}
} else {
- return trigger_error(__('Cannot load the configuration file. Wrong "configFile" configuration.'), E_USER_NOTICE);
+ throw new ConfigureException(__('Cannot load the configuration file. Wrong "configFile" configuration.'));
}
$readerClass = Inflector::camelize($reader) . 'Reader';
if (!App::import('Lib', 'config/' . $readerClass)) {
- return trigger_error(__('Cannot load the configuration file. Unknown reader.'), E_USER_NOTICE);
+ throw new ConfigureException(__('Cannot load the configuration file. Unknown reader.'));
}
- try {
- $readerObj = new $readerClass($path);
- $configs = $readerObj->read($file);
- if (isset($configs['tags']) && is_array($configs['tags'])) {
- $this->_tags = array_merge($this->_tags, $configs['tags']);
- }
- if (isset($configs['minimizedAttributes']) && is_array($configs['minimizedAttributes'])) {
- $this->_minimizedAttributes = array_merge($this->_minimizedAttributes, $configs['minimizedAttributes']);
- }
- if (isset($configs['docTypes']) && is_array($configs['docTypes'])) {
- $this->__docTypes = array_merge($this->__docTypes, $configs['docTypes']);
- }
- if (isset($configs['attributeFormat'])) {
- $this->_attributeFormat = $configs['attributeFormat'];
- }
- if (isset($configs['minimizedAttributeFormat'])) {
- $this->_minimizedAttributeFormat = $configs['minimizedAttributeFormat'];
- }
- } catch (Exception $e) {
- return trigger_error(__('Cannot load the configuration file. Failed to load the file.'), E_USER_NOTICE);
+ $readerObj = new $readerClass($path);
+ $configs = $readerObj->read($file);
+ if (isset($configs['tags']) && is_array($configs['tags'])) {
+ $this->_tags = array_merge($this->_tags, $configs['tags']);
+ }
+ if (isset($configs['minimizedAttributes']) && is_array($configs['minimizedAttributes'])) {
+ $this->_minimizedAttributes = array_merge($this->_minimizedAttributes, $configs['minimizedAttributes']);
+ }
+ if (isset($configs['docTypes']) && is_array($configs['docTypes'])) {
+ $this->__docTypes = array_merge($this->__docTypes, $configs['docTypes']);
+ }
+ if (isset($configs['attributeFormat'])) {
+ $this->_attributeFormat = $configs['attributeFormat'];
+ }
+ if (isset($configs['minimizedAttributeFormat'])) {
+ $this->_minimizedAttributeFormat = $configs['minimizedAttributeFormat'];
}
return $configs;
}
diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php
index a7a4cfbec..c2226acac 100644
--- a/cake/tests/cases/libs/view/helpers/html.test.php
+++ b/cake/tests/cases/libs/view/helpers/html.test.php
@@ -1400,11 +1400,11 @@ class HtmlHelperTest extends CakeTestCase {
$this->assertEqual($result, $expected);
$this->assertEqual($this->Html->getAttribute('_minimizedAttributeFormat'), 'format');
- $this->expectError();
+ $this->expectException('ConfigureException');
$result = $this->Html->loadConfig('wrong_file');
$this->assertFalse($result);
- $this->expectError();
+ $this->expectException('ConfigureException');
$result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
$this->assertFalse($result);
}
From 703272965106532764817b661ef08791d29464ac Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 23 Jan 2011 17:08:09 -0500
Subject: [PATCH 192/668] Fixing how webroot is calculated for installs not
using url rewriting. Also fixes using the top level index.php file. Test
cases added for using both index.php files. Cleaned up existing tests for
environment detection. Fixes #1261, Fixes #1432
---
cake/dispatcher.php | 8 ++-
cake/tests/cases/dispatcher.test.php | 94 ++++++++++++++++++++++++++--
2 files changed, 95 insertions(+), 7 deletions(-)
diff --git a/cake/dispatcher.php b/cake/dispatcher.php
index cddd302cd..729bb7a44 100644
--- a/cake/dispatcher.php
+++ b/cake/dispatcher.php
@@ -357,9 +357,13 @@ class Dispatcher extends Object {
if ($base === DS || $base === '.') {
$base = '';
}
- $this->webroot = $base .'/';
+ $this->webroot = $base . '/';
- if (!empty($base)) {
+ $docRoot = env('DOCUMENT_ROOT');
+ $script = realpath(env('SCRIPT_FILENAME'));
+ $docRootContainsWebroot = strpos($docRoot, $dir . '/' . $webroot);
+
+ if (!empty($base) || !$docRootContainsWebroot) {
if (strpos($this->webroot, $dir) === false) {
$this->webroot .= $dir . '/' ;
}
diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php
index 58f25da5c..0255829b5 100644
--- a/cake/tests/cases/dispatcher.test.php
+++ b/cake/tests/cases/dispatcher.test.php
@@ -1207,6 +1207,42 @@ class DispatcherTest extends CakeTestCase {
$this->assertEqual($expectedWebroot, $Dispatcher->webroot);
}
+/**
+ * test baseUrl with no rewrite and using the top level index.php.
+ *
+ * @return void
+ */
+ function testBaseUrlNoRewriteTopLevelIndex() {
+ $Dispatcher =& new Dispatcher();
+
+ Configure::write('App.baseUrl', '/index.php');
+ $_SERVER['DOCUMENT_ROOT'] = '/Users/markstory/Sites/cake_dev';
+ $_SERVER['SCRIPT_FILENAME'] = '/Users/markstory/Sites/cake_dev/index.php';
+
+ $result = $Dispatcher->baseUrl();
+ $this->assertEqual('/index.php', $result);
+ $this->assertEqual('/app/webroot/', $Dispatcher->webroot);
+ $this->assertEqual('', $Dispatcher->base);
+ }
+
+/**
+ * test baseUrl with no rewrite, and using the app/webroot/index.php file as is normal with virtual hosts.
+ *
+ * @return void
+ */
+ function testBaseUrlNoRewriteWebrootIndex() {
+ $Dispatcher =& new Dispatcher();
+
+ Configure::write('App.baseUrl', '/index.php');
+ $_SERVER['DOCUMENT_ROOT'] = '/Users/markstory/Sites/cake_dev/app/webroot';
+ $_SERVER['SCRIPT_FILENAME'] = '/Users/markstory/Sites/cake_dev/app/webroot/index.php';
+
+ $result = $Dispatcher->baseUrl();
+ $this->assertEqual('/index.php', $result);
+ $this->assertEqual('/', $Dispatcher->webroot);
+ $this->assertEqual('', $Dispatcher->base);
+ }
+
/**
* testBaseUrlAndWebrootWithBase method
*
@@ -2304,7 +2340,7 @@ class DispatcherTest extends CakeTestCase {
'IIS' => array(
'No rewrite base path' => array(
'App' => array('base' => false, 'baseUrl' => '/index.php?', 'server' => 'IIS'),
- 'SERVER' => array('HTTPS' => 'off', 'SCRIPT_NAME' => '/index.php', 'PATH_TRANSLATED' => 'C:\\Inetpub\\wwwroot', 'QUERY_STRING' => '', 'REMOTE_ADDR' => '127.0.0.1', 'REMOTE_HOST' => '127.0.0.1', 'REQUEST_METHOD' => 'GET', 'SERVER_NAME' => 'localhost', 'SERVER_PORT' => '80', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SOFTWARE' => 'Microsoft-IIS/5.1', 'APPL_PHYSICAL_PATH' => 'C:\\Inetpub\\wwwroot\\', 'REQUEST_URI' => '/index.php', 'URL' => '/index.php', 'SCRIPT_FILENAME' => 'C:\\Inetpub\\wwwroot\\index.php', 'ORIG_PATH_INFO' => '/index.php', 'PATH_INFO' => '', 'ORIG_PATH_TRANSLATED' => 'C:\\Inetpub\\wwwroot\\index.php', 'DOCUMENT_ROOT' => 'C:\\Inetpub\\wwwroot', 'PHP_SELF' => '/index.php', 'HTTP_ACCEPT' => '*/*', 'HTTP_ACCEPT_LANGUAGE' => 'en-us', 'HTTP_CONNECTION' => 'Keep-Alive', 'HTTP_HOST' => 'localhost', 'HTTP_USER_AGENT' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', 'argv' => array(), 'argc' => 0),
+ 'SERVER' => array('HTTPS' => 'off', 'SCRIPT_NAME' => '/index.php', 'PATH_TRANSLATED' => 'C:\\Inetpub\\wwwroot', 'QUERY_STRING' => '', 'REMOTE_ADDR' => '127.0.0.1', 'REMOTE_HOST' => '127.0.0.1', 'REQUEST_METHOD' => 'GET', 'SERVER_NAME' => 'localhost', 'SERVER_PORT' => '80', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'APPL_PHYSICAL_PATH' => 'C:\\Inetpub\\wwwroot\\', 'REQUEST_URI' => '/index.php', 'URL' => '/index.php', 'SCRIPT_FILENAME' => 'C:\\Inetpub\\wwwroot\\index.php', 'ORIG_PATH_INFO' => '/index.php', 'PATH_INFO' => '', 'ORIG_PATH_TRANSLATED' => 'C:\\Inetpub\\wwwroot\\index.php', 'DOCUMENT_ROOT' => 'C:\\Inetpub\\wwwroot', 'PHP_SELF' => '/index.php', 'HTTP_HOST' => 'localhost', 'argv' => array(), 'argc' => 0),
'reload' => true,
'path' => ''
),
@@ -2343,18 +2379,54 @@ class DispatcherTest extends CakeTestCase {
'Apache' => array(
'No rewrite base path' => array(
'App' => array('base' => false, 'baseUrl' => '/index.php', 'dir' => 'app', 'webroot' => 'webroot'),
- 'SERVER' => array('SERVER_NAME' => 'localhost', 'SERVER_ADDR' => '::1', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '::1', 'DOCUMENT_ROOT' => '/Library/WebServer/Documents/officespace/app/webroot', 'SCRIPT_FILENAME' => '/Library/WebServer/Documents/site/app/webroot/index.php', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'argv' => array(), 'argc' => 0),
+ 'SERVER' => array(
+ 'SERVER_NAME' => 'localhost',
+ 'SERVER_ADDR' => '::1',
+ 'SERVER_PORT' => '80',
+ 'REMOTE_ADDR' => '::1',
+ 'DOCUMENT_ROOT' => '/Library/WebServer/Documents/officespace/app/webroot',
+ 'SCRIPT_FILENAME' => '/Library/WebServer/Documents/site/app/webroot/index.php',
+ 'QUERY_STRING' => '',
+ 'REQUEST_URI' => '/',
+ 'SCRIPT_NAME' => '/index.php',
+ 'PHP_SELF' => '/index.php',
+ 'argv' => array(),
+ 'argc' => 0
+ ),
'reload' => true,
'path' => ''
),
'No rewrite with path' => array(
- 'SERVER' => array('UNIQUE_ID' => 'VardGqn@17IAAAu7LY8AAAAK', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/523.10.5 (KHTML, like Gecko) Version/3.0.4 Safari/523.10.6', 'HTTP_ACCEPT' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_LANGUAGE' => 'en-us', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', 'HTTP_CONNECTION' => 'keep-alive', 'HTTP_HOST' => 'localhost', 'DOCUMENT_ROOT' => '/Library/WebServer/Documents/officespace/app/webroot', 'SCRIPT_FILENAME' => '/Library/WebServer/Documents/officespace/app/webroot/index.php', 'QUERY_STRING' => '', 'REQUEST_URI' => '/index.php/posts/add', 'SCRIPT_NAME' => '/index.php', 'PATH_INFO' => '/posts/add', 'PHP_SELF' => '/index.php/posts/add', 'argv' => array(), 'argc' => 0),
+ 'SERVER' => array(
+ 'HTTP_HOST' => 'localhost',
+ 'DOCUMENT_ROOT' => '/Library/WebServer/Documents/officespace/app/webroot',
+ 'SCRIPT_FILENAME' => '/Library/WebServer/Documents/officespace/app/webroot/index.php',
+ 'QUERY_STRING' => '',
+ 'REQUEST_URI' => '/index.php/posts/add',
+ 'SCRIPT_NAME' => '/index.php',
+ 'PATH_INFO' => '/posts/add',
+ 'PHP_SELF' => '/index.php/posts/add',
+ 'argv' => array(),
+ 'argc' => 0),
'reload' => false,
'path' => '/posts/add'
),
'GET Request at base domain' => array(
'App' => array('base' => false, 'baseUrl' => null, 'dir' => 'app', 'webroot' => 'webroot'),
- 'SERVER' => array('UNIQUE_ID' => '2A-v8sCoAQ8AAAc-2xUAAAAB', 'HTTP_ACCEPT_LANGUAGE' => 'en-us', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', 'HTTP_COOKIE' => 'CAKEPHP=jcbv51apn84kd9ucv5aj2ln3t3', 'HTTP_CONNECTION' => 'keep-alive', 'HTTP_HOST' => 'cake.1.2', 'SERVER_NAME' => 'cake.1.2', 'SERVER_ADDR' => '127.0.0.1', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '127.0.0.1', 'DOCUMENT_ROOT' => '/Volumes/Home/htdocs/cake/repo/branches/1.2.x.x/app/webroot', 'SERVER_ADMIN' => 'you@example.com', 'SCRIPT_FILENAME' => '/Volumes/Home/htdocs/cake/repo/branches/1.2.x.x/app/webroot/index.php', 'REMOTE_PORT' => '53550', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => 'a=b', 'REQUEST_URI' => '/?a=b', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php'),
+ 'SERVER' => array(
+ 'HTTP_HOST' => 'cake.1.2',
+ 'SERVER_NAME' => 'cake.1.2',
+ 'SERVER_ADDR' => '127.0.0.1',
+ 'SERVER_PORT' => '80',
+ 'REMOTE_ADDR' => '127.0.0.1',
+ 'DOCUMENT_ROOT' => '/Volumes/Home/htdocs/cake/repo/branches/1.2.x.x/app/webroot',
+ 'SCRIPT_FILENAME' => '/Volumes/Home/htdocs/cake/repo/branches/1.2.x.x/app/webroot/index.php',
+ 'REMOTE_PORT' => '53550',
+ 'QUERY_STRING' => 'a=b',
+ 'REQUEST_URI' => '/?a=b',
+ 'SCRIPT_NAME' => '/index.php',
+ 'PHP_SELF' => '/index.php'
+ ),
'GET' => array('a' => 'b'),
'POST' => array(),
'reload' => true,
@@ -2364,7 +2436,19 @@ class DispatcherTest extends CakeTestCase {
),
'New CGI no mod_rewrite' => array(
'App' => array('base' => false, 'baseUrl' => '/limesurvey20/index.php', 'dir' => 'app', 'webroot' => 'webroot'),
- 'SERVER' => array('DOCUMENT_ROOT' => '/home/.sites/110/site313/web', 'PATH_INFO' => '/installations', 'PATH_TRANSLATED' => '/home/.sites/110/site313/web/limesurvey20/index.php', 'PHPRC' => '/home/.sites/110/site313', 'QUERY_STRING' => '', 'REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/limesurvey20/index.php/installations', 'SCRIPT_FILENAME' => '/home/.sites/110/site313/web/limesurvey20/index.php', 'SCRIPT_NAME' => '/limesurvey20/index.php', 'SCRIPT_URI' => 'http://www.gisdat-umfragen.at/limesurvey20/index.php/installations', 'PHP_SELF' => '/limesurvey20/index.php/installations', 'CGI_MODE' => true),
+ 'SERVER' => array(
+ 'DOCUMENT_ROOT' => '/home/.sites/110/site313/web',
+ 'PATH_INFO' => '/installations',
+ 'PATH_TRANSLATED' => '/home/.sites/110/site313/web/limesurvey20/index.php',
+ 'PHPRC' => '/home/.sites/110/site313',
+ 'QUERY_STRING' => '',
+ 'REQUEST_URI' => '/limesurvey20/index.php/installations',
+ 'SCRIPT_FILENAME' => '/home/.sites/110/site313/web/limesurvey20/index.php',
+ 'SCRIPT_NAME' => '/limesurvey20/index.php',
+ 'SCRIPT_URI' => 'http://www.gisdat-umfragen.at/limesurvey20/index.php/installations',
+ 'PHP_SELF' => '/limesurvey20/index.php/installations',
+ 'CGI_MODE' => true
+ ),
'GET' => array(),
'POST' => array(),
'reload' => true,
From be98491413a217518b9741cb70d644b328276081 Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 20:27:46 -0200
Subject: [PATCH 193/668] Ini/Php readers now read files with/without
extension.
---
cake/libs/config/ini_reader.php | 6 ++++++
cake/libs/config/php_reader.php | 12 +++++++++---
cake/tests/cases/libs/config/ini_reader.test.php | 11 +++++++++++
cake/tests/cases/libs/config/php_reader.test.php | 5 +++++
4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/cake/libs/config/ini_reader.php b/cake/libs/config/ini_reader.php
index e20f8dcfb..7ab9694ce 100644
--- a/cake/libs/config/ini_reader.php
+++ b/cake/libs/config/ini_reader.php
@@ -71,6 +71,12 @@ class IniReader implements ConfigReaderInterface {
*/
public function read($file) {
$filename = $this->_path . $file;
+ if (!file_exists($filename)) {
+ $filename .= '.ini';
+ if (!file_exists($filename)) {
+ throw new ConfigureException(__('Could not load configuration files: %s or %s', substr($filename, 0, -4), $filename));
+ }
+ }
$contents = parse_ini_file($filename, true);
if (!empty($this->_section) && isset($contents[$this->_section])) {
$values = $this->_parseNestedValues($contents[$this->_section]);
diff --git a/cake/libs/config/php_reader.php b/cake/libs/config/php_reader.php
index c122f0808..acd0f94df 100644
--- a/cake/libs/config/php_reader.php
+++ b/cake/libs/config/php_reader.php
@@ -57,15 +57,21 @@ class PhpReader implements ConfigReaderInterface {
if (strpos($key, '..') !== false) {
throw new ConfigureException(__('Cannot load configuration files with ../ in them.'));
}
+ if (substr($key, -4) === '.php') {
+ $key = substr($key, 0, -4);
+ }
list($plugin, $key) = pluginSplit($key);
if ($plugin) {
- $file = App::pluginPath($plugin) . 'config' . DS . $key . '.php';
+ $file = App::pluginPath($plugin) . 'config' . DS . $key;
} else {
- $file = $this->_path . $key . '.php';
+ $file = $this->_path . $key;
}
if (!file_exists($file)) {
- throw new ConfigureException(__('Could not load configuration file: ') . $file);
+ $file .= '.php';
+ if (!file_exists($file)) {
+ throw new ConfigureException(__('Could not load configuration files: %s or %s', substr($file, 0, -4), $file));
+ }
}
include $file;
if (!isset($config)) {
diff --git a/cake/tests/cases/libs/config/ini_reader.test.php b/cake/tests/cases/libs/config/ini_reader.test.php
index 3db8bb942..4f077873a 100644
--- a/cake/tests/cases/libs/config/ini_reader.test.php
+++ b/cake/tests/cases/libs/config/ini_reader.test.php
@@ -114,4 +114,15 @@ class IniReaderTest extends CakeTestCase {
$this->assertFalse($config['bools']['test_null']);
}
+
+/**
+ * test read file without extension
+ *
+ * @return void
+ */
+ public function testReadingWithoutExtension() {
+ $reader = new IniReader($this->path);
+ $config = $reader->read('nested');
+ $this->assertTrue($config['bools']['test_on']);
+ }
}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/config/php_reader.test.php b/cake/tests/cases/libs/config/php_reader.test.php
index 63957ea62..a1d3034fc 100644
--- a/cake/tests/cases/libs/config/php_reader.test.php
+++ b/cake/tests/cases/libs/config/php_reader.test.php
@@ -38,6 +38,9 @@ class PhpReaderTest extends CakeTestCase {
$values = $reader->read('var_test');
$this->assertEquals('value', $values['Read']);
$this->assertEquals('buried', $values['Deep']['Deeper']['Deepest']);
+
+ $values = $reader->read('var_test.php');
+ $this->assertEquals('value', $values['Read']);
}
/**
@@ -84,7 +87,9 @@ class PhpReaderTest extends CakeTestCase {
), true);
$reader = new PhpReader($this->path);
$result = $reader->read('TestPlugin.load');
+ $this->assertTrue(isset($result['plugin_load']));
+ $result = $reader->read('TestPlugin.load.php');
$this->assertTrue(isset($result['plugin_load']));
}
}
From d933d6bd73bf650c8cccf8bbc4ac2f3e532b537b Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Sun, 23 Jan 2011 20:51:56 -0200
Subject: [PATCH 194/668] Assigning the helper object in view class, avoiding
to use __get magic for each call.
---
cake/libs/view/view.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php
index 7ff7ed9fa..35a886fbc 100644
--- a/cake/libs/view/view.php
+++ b/cake/libs/view/view.php
@@ -624,7 +624,8 @@ class View extends Object {
public function loadHelpers() {
$helpers = HelperCollection::normalizeObjectArray($this->helpers);
foreach ($helpers as $name => $properties) {
- $this->Helpers->load($properties['class'], $properties['settings']);
+ list($plugin, $class) = pluginSplit($properties['class']);
+ $this->{$class} = $this->Helpers->load($properties['class'], $properties['settings']);
}
$this->_helpersLoaded = true;
}
From 32f0b20a336074b8d09d912e8e1a2b07aa8d7f0e Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 24 Jan 2011 22:05:16 -0500
Subject: [PATCH 195/668] Removing wonky and most likely incorrect manipulation
of socket and port setting mangling in DboMysqli. Fixes #1478
---
cake/libs/model/datasources/dbo/dbo_mysqli.php | 7 -------
1 file changed, 7 deletions(-)
diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php
index daf47f557..8b0543d6d 100644
--- a/cake/libs/model/datasources/dbo/dbo_mysqli.php
+++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -59,13 +59,6 @@ class DboMysqli extends DboMysqlBase {
$config = $this->config;
$this->connected = false;
- if (is_numeric($config['port'])) {
- $config['socket'] = null;
- } else {
- $config['socket'] = $config['port'];
- $config['port'] = null;
- }
-
$this->connection = mysqli_connect($config['host'], $config['login'], $config['password'], $config['database'], $config['port'], $config['socket']);
if ($this->connection !== false) {
From 95713fbf3b082d094bd7a87c371b3d0029d14eb7 Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Tue, 25 Jan 2011 01:18:39 -0200
Subject: [PATCH 196/668] Separated the tests for HtmlHelper::loadConfig() with
exception in different methods.
---
.../cases/libs/view/helpers/html.test.php | 21 +++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php
index c2226acac..4da61890d 100644
--- a/cake/tests/cases/libs/view/helpers/html.test.php
+++ b/cake/tests/cases/libs/view/helpers/html.test.php
@@ -1399,14 +1399,27 @@ class HtmlHelperTest extends CakeTestCase {
);
$this->assertEqual($result, $expected);
$this->assertEqual($this->Html->getAttribute('_minimizedAttributeFormat'), 'format');
+ }
- $this->expectException('ConfigureException');
+/**
+ * testLoadConfigWrongFile method
+ *
+ * @return void
+ * @expectedException ConfigureException
+ */
+ public function testLoadConfigWrongFile() {
$result = $this->Html->loadConfig('wrong_file');
- $this->assertFalse($result);
+ }
- $this->expectException('ConfigureException');
+/**
+ * testLoadConfigWrongReader method
+ *
+ * @return void
+ * @expectedException ConfigureException
+ */
+ public function testLoadConfigWrongReader() {
+ $path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'config'. DS;
$result = $this->Html->loadConfig(array('htmlhelper_tags', 'wrong_reader'), $path);
- $this->assertFalse($result);
}
/**
From 161d3ea5fb64a24d50cdf9d0843a364be35c0450 Mon Sep 17 00:00:00 2001
From: ADmad
Date: Wed, 26 Jan 2011 19:33:06 +0530
Subject: [PATCH 197/668] Removed from comments references to DBOs which are no
longer available. Closes #1479
---
app/config/database.php.default | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/app/config/database.php.default b/app/config/database.php.default
index 2078240ea..9fb8e9e98 100644
--- a/app/config/database.php.default
+++ b/app/config/database.php.default
@@ -29,7 +29,6 @@
*
* driver => The name of a supported driver; valid options are as follows:
* mysql - MySQL 4 & 5,
- * mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
* sqlite - SQLite (PHP5 only),
* postgres - PostgreSQL 7 and higher,
* mssql - Microsoft SQL Server 2000 and higher,
@@ -43,19 +42,18 @@
* Determines whether or not the database should use a persistent connection
*
* host =>
- * the host you connect to the database. To add a socket or port number, use 'port' => #
+ * the host you connect to the database. To add a socket or port number, use 'port' => #
*
* prefix =>
* Uses the given prefix for all the tables in this database. This setting can be overridden
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
- * For Postgresspecifies which schema you would like to use the tables in. Postgres defaults to
- * 'public', DB2 defaults to empty.
+ * For Postgres specifies which schema you would like to use the tables in. Postgres defaults to 'public'.
*
* encoding =>
- * For MySQL, MySQLi, Postgres specifies the character encoding to use when connecting to the
- * database. Uses database default.
+ * For MySQL, Postgres specifies the character encoding to use when connecting to the
+ * database. Uses database default not specified.
*
*/
class DATABASE_CONFIG {
From d192ed32f05b0b17fbc46580b1e30fb3819c6fda Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 26 Jan 2011 20:54:14 -0500
Subject: [PATCH 198/668] Adding a socket key to DboMysqli::$baseConfig. Fixes
notice errors when socket is undefined. Fixes #1482
---
cake/libs/model/datasources/dbo/dbo_mysqli.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php
index 8b0543d6d..844554cdd 100644
--- a/cake/libs/model/datasources/dbo/dbo_mysqli.php
+++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -47,7 +47,8 @@ class DboMysqli extends DboMysqlBase {
'login' => 'root',
'password' => '',
'database' => 'cake',
- 'port' => '3306'
+ 'port' => '3306',
+ 'socket' => null
);
/**
From 71d8e744f160c918e4a1b86dc32f9d3447145e12 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 26 Jan 2011 20:58:16 -0500
Subject: [PATCH 199/668] Fixing case-sensitivity of AS in fields. Tests added.
Fixes #1474
---
cake/libs/model/datasources/dbo_source.php | 2 +-
cake/tests/cases/libs/model/datasources/dbo_source.test.php | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php
index 42d7db354..b610ee121 100755
--- a/cake/libs/model/datasources/dbo_source.php
+++ b/cake/libs/model/datasources/dbo_source.php
@@ -562,7 +562,7 @@ class DboSource extends DataSource {
);
}
if (
- preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/', $data, $matches
+ preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/i', $data, $matches
)) {
return $this->cacheMethod(
__FUNCTION__, $cacheKey,
diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php
index d60898dab..924e7256d 100644
--- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php
+++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php
@@ -4077,10 +4077,14 @@ class DboSourceTest extends CakeTestCase {
$result = $this->testDb->name(array('my-name', 'Foo-Model.*'));
$expected = array('`my-name`', '`Foo-Model`.*');
$this->assertEqual($result, $expected);
-
+
$result = $this->testDb->name(array('Team.P%', 'Team.G/G'));
$expected = array('`Team`.`P%`', '`Team`.`G/G`');
$this->assertEqual($result, $expected);
+
+ $result = $this->testDb->name('Model.name as y');
+ $expected = '`Model`.`name` AS `y`';
+ $this->assertEqual($result, $expected);
}
/**
From 38e286e978b13a9480a9a862705468025d49460f Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 27 Jan 2011 19:30:21 -0500
Subject: [PATCH 200/668] Fixing order of paths so core paths are last in the
search array. Fixes #1488
---
cake/console/libs/tasks/template.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php
index 15b1721fd..aac544abc 100644
--- a/cake/console/libs/tasks/template.php
+++ b/cake/console/libs/tasks/template.php
@@ -56,7 +56,7 @@ class TemplateTask extends Shell {
$core = array_pop($paths);
$separator = DS === '/' ? '/' : '\\\\';
$core = preg_replace('#libs' . $separator . '$#', '', $core);
- $paths[] = $core;
+
$Folder =& new Folder($core . 'templates' . DS . 'default');
$contents = $Folder->read();
$themeFolders = $contents[0];
@@ -65,6 +65,7 @@ class TemplateTask extends Shell {
foreach ($plugins as $plugin) {
$paths[] = $this->_pluginPath($plugin) . 'vendors' . DS . 'shells' . DS;
}
+ $paths[] = $core;
// TEMPORARY TODO remove when all paths are DS terminated
foreach ($paths as $i => $path) {
From 5464ed845594047b47285abd1afdc6506c3e0bc2 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 27 Jan 2011 21:05:30 -0500
Subject: [PATCH 201/668] Fixing blackholes caused by using custom name
attributes with inputs. Fixes #1489
---
cake/libs/view/helpers/form.php | 11 ++++++++++-
cake/tests/cases/libs/view/helpers/form.test.php | 15 +++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php
index 5c4435f97..7026d5afb 100644
--- a/cake/libs/view/helpers/form.php
+++ b/cake/libs/view/helpers/form.php
@@ -2190,10 +2190,19 @@ class FormHelper extends AppHelper {
} else {
$secure = (isset($this->params['_Token']) && !empty($this->params['_Token']));
}
+
+ $fieldName = null;
+ if ($secure && !empty($options['name'])) {
+ preg_match_all('/\[(.*?)\]/', $options['name'], $matches);
+ if (isset($matches[1])) {
+ $fieldName = $matches[1];
+ }
+ }
+
$result = parent::_initInputField($field, $options);
if ($secure) {
- $this->__secure();
+ $this->__secure($fieldName);
}
return $result;
}
diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php
index 103a33d02..27815a8b0 100644
--- a/cake/tests/cases/libs/view/helpers/form.test.php
+++ b/cake/tests/cases/libs/view/helpers/form.test.php
@@ -1083,6 +1083,21 @@ class FormHelperTest extends CakeTestCase {
$this->assertTags($result, $expected);
}
+/**
+ * test securing inputs with custom name attributes.
+ *
+ * @return void
+ */
+ function testFormSecureWithCustomNameAttribute() {
+ $this->Form->params['_Token']['key'] = 'testKey';
+
+ $this->Form->text('UserForm.published', array('name' => 'data[User][custom]'));
+ $this->assertEqual('User.custom', $this->Form->fields[0]);
+
+ $this->Form->text('UserForm.published', array('name' => 'data[User][custom][another][value]'));
+ $this->assertEqual('User.custom.another.value', $this->Form->fields[1]);
+ }
+
/**
* testFormSecuredInput method
*
From bbf6aedd9cb520ada416b9eeedc090e461ce32bc Mon Sep 17 00:00:00 2001
From: Juan Basso
Date: Fri, 28 Jan 2011 00:18:44 -0200
Subject: [PATCH 202/668] Fixed wrong viewVars store when have objects in view
caching. Fixes #1486.
---
cake/libs/view/helpers/cache.php | 10 +++++-----
cake/tests/cases/libs/view/helpers/cache.test.php | 1 -
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php
index e2e911b8c..65ed53ca2 100644
--- a/cake/libs/view/helpers/cache.php
+++ b/cake/libs/view/helpers/cache.php
@@ -225,15 +225,15 @@ class CacheHelper extends AppHelper {
$file .= '$controller =& new ' . $this->controllerName . 'Controller();
$controller->plugin = $this->plugin = \''.$this->plugin.'\';
- $controller->helpers = $this->helpers = ' . var_export($this->helpers, true) . ';
+ $controller->helpers = $this->helpers = unserialize(\'' . serialize($this->helpers) . '\');
$controller->base = $this->base = \'' . $this->base . '\';
$controller->layout = $this->layout = \'' . $this->layout. '\';
$controller->webroot = $this->webroot = \'' . $this->webroot . '\';
$controller->here = $this->here = \'' . $this->here . '\';
- $controller->params = $this->params = ' . var_export($this->params, true) . ';
- $controller->action = $this->action = ' . var_export($this->action, true) . ';
- $controller->data = $this->data = ' . var_export($this->data, true) . ';
- $controller->viewVars = $this->viewVars = ' . var_export($this->viewVars, true) . ';
+ $controller->params = $this->params = unserialize(stripslashes(\'' . addslashes(serialize($this->params)) . '\'));
+ $controller->action = $this->action = unserialize(\'' . serialize($this->action) . '\');
+ $controller->data = $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->data)) . '\'));
+ $controller->viewVars = $this->viewVars = unserialize(base64_decode(\'' . base64_encode(serialize($this->viewVars)) . '\'));
$controller->theme = $this->theme = \'' . $this->theme . '\';
Router::setRequestInfo(array($this->params, array(\'base\' => $this->base, \'webroot\' => $this->webroot)));';
diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php
index 45edea332..01a8c0bcc 100644
--- a/cake/tests/cases/libs/view/helpers/cache.test.php
+++ b/cake/tests/cases/libs/view/helpers/cache.test.php
@@ -339,7 +339,6 @@ class CacheHelperTest extends CakeTestCase {
$this->assertPattern('/\$this\-\>viewVars/', $contents);
$this->assertPattern('/extract\(\$this\-\>viewVars, EXTR_SKIP\);/', $contents);
$this->assertPattern('/php echo \$variable/', $contents);
- $this->assertPattern('/variableValue/', $contents);
@unlink($filename);
}
From e99f090ee0fb7ec531c40848bcfe43a6a1b1a1f5 Mon Sep 17 00:00:00 2001
From: Jeremy Harris
Date: Thu, 27 Jan 2011 18:32:51 -0800
Subject: [PATCH 203/668] Fixed issue where ClassRegistry alias was incorrectly
set
---
.../cases/libs/controller_test_case.test.php | 32 ++++++++++++++++++-
cake/tests/lib/controller_test_case.php | 4 +--
2 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/cake/tests/cases/libs/controller_test_case.test.php b/cake/tests/cases/libs/controller_test_case.test.php
index 6d4812937..1ffb518c6 100644
--- a/cake/tests/cases/libs/controller_test_case.test.php
+++ b/cake/tests/cases/libs/controller_test_case.test.php
@@ -76,6 +76,20 @@ if (!class_exists('PostsController')) {
}
}
+/**
+ * ControllerTestCaseTest controller
+ */
+class ControllerTestCaseTestController extends AppController {
+
+/**
+ * Uses array
+ *
+ * @param array
+ */
+ public $uses = array('TestPlugin.TestPluginComment');
+
+}
+
/**
* ControllerTestCaseTest
@@ -90,7 +104,7 @@ class ControllerTestCaseTest extends CakeTestCase {
* @var array
* @access public
*/
- public $fixtures = array('core.post', 'core.author');
+ public $fixtures = array('core.post', 'core.author', 'core.test_plugin_comment');
/**
* reset environment.
@@ -201,6 +215,22 @@ class ControllerTestCaseTest extends CakeTestCase {
$result = ClassRegistry::init('TestPlugin.TestPluginComment');
$this->assertInstanceOf('TestPluginComment', $result);
+
+ $Tests = $this->Case->generate('ControllerTestCaseTest', array(
+ 'models' => array(
+ 'TestPlugin.TestPluginComment' => array('save')
+ )
+ ));
+ $this->assertInstanceOf('TestPluginComment', $Tests->TestPluginComment);
+ $Tests->TestPluginComment->expects($this->at(0))
+ ->method('save')
+ ->will($this->returnValue(true));
+ $Tests->TestPluginComment->expects($this->at(1))
+ ->method('save')
+ ->will($this->returnValue(false));
+ $this->assertTrue($Tests->TestPluginComment->save(array()));
+ $this->assertFalse($Tests->TestPluginComment->save(array()));
+
}
/**
diff --git a/cake/tests/lib/controller_test_case.php b/cake/tests/lib/controller_test_case.php
index 217463ecf..150bf12a5 100644
--- a/cake/tests/lib/controller_test_case.php
+++ b/cake/tests/lib/controller_test_case.php
@@ -280,8 +280,8 @@ class ControllerTestCase extends CakeTestCase {
list($plugin, $name) = pluginSplit($model);
$config = array_merge((array)$config, array('name' => $model));
$_model = $this->getMock($name, $methods, array($config));
- ClassRegistry::removeObject($model);
- ClassRegistry::addObject($model, $_model);
+ ClassRegistry::removeObject($name);
+ ClassRegistry::addObject($name, $_model);
}
foreach ($mocks['components'] as $component => $methods) {
From 61e7cafe32589182e9f52b8f2486073fe4055685 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 01:33:08 -0430
Subject: [PATCH 204/668] Fixing HelperCollection tests after merging 2.0
branch in
---
lib/Cake/Core/App.php | 3 ++-
lib/Cake/View/HelperCollection.php | 2 +-
lib/Cake/tests/cases/libs/view/helper_collection.test.php | 4 ++--
.../views/helpers/{other_helper.php => OtherHelperHelper.php} | 0
4 files changed, 5 insertions(+), 4 deletions(-)
rename lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/{other_helper.php => OtherHelperHelper.php} (100%)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index fdccbeef4..ff27bc6aa 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -515,7 +515,8 @@ class App {
return include $file;
}
- list($plugin, $package) = pluginSplit(self::$__classMap[$className]);
+ $parts = explode('.', self::$__classMap[$className], 2);
+ list($plugin, $package) = count($parts) > 1 ? $parts : array(null, current($parts));
$paths = self::path($package, $plugin);
if (empty($plugin)) {
diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php
index 534e6bbd8..8b10180a4 100644
--- a/lib/Cake/View/HelperCollection.php
+++ b/lib/Cake/View/HelperCollection.php
@@ -61,7 +61,7 @@ class HelperCollection extends ObjectCollection {
$alias = $helper;
$helper = $settings['className'];
}
- list($plugin, $name) = pluginSplit($helper);
+ list($plugin, $name) = pluginSplit($helper, true);
if (!isset($alias)) {
$alias = $name;
}
diff --git a/lib/Cake/tests/cases/libs/view/helper_collection.test.php b/lib/Cake/tests/cases/libs/view/helper_collection.test.php
index e23390136..ede4c5cab 100644
--- a/lib/Cake/tests/cases/libs/view/helper_collection.test.php
+++ b/lib/Cake/tests/cases/libs/view/helper_collection.test.php
@@ -18,12 +18,12 @@
*/
App::uses('HelperCollection', 'View/Helper');
+App::uses('HtmlHelper', 'View/Helper');
App::uses('View', 'View');
/**
* Extended HtmlHelper
*/
-App::import('Helper', 'Html');
class HtmlAliasHelper extends HtmlHelper {
}
@@ -81,7 +81,7 @@ class HelperCollectionTest extends CakeTestCase {
$result = $this->Helpers->load('Html');
$this->assertInstanceOf('HtmlAliasHelper', $result);
- App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
+ App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
$result = $this->Helpers->load('SomeOther', array('className' => 'TestPlugin.OtherHelper'));
$this->assertInstanceOf('OtherHelperHelper', $result);
$this->assertInstanceOf('OtherHelperHelper', $this->Helpers->SomeOther);
diff --git a/lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php b/lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/OtherHelperHelper.php
similarity index 100%
rename from lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/views/helpers/OtherHelperHelper.php
From 0bde6d35f500d0c75ebbd1a07148dbfc72905aaa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 01:44:04 -0430
Subject: [PATCH 205/668] Fixing Acl classes loading for the AclBehavior tests
---
lib/Cake/Model/AclNode.php | 132 ------------------
.../cases/libs/model/behaviors/acl.test.php | 5 +
2 files changed, 5 insertions(+), 132 deletions(-)
diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php
index 2e725ef41..e8107fbf3 100644
--- a/lib/Cake/Model/AclNode.php
+++ b/lib/Cake/Model/AclNode.php
@@ -184,135 +184,3 @@ class AclNode extends AppModel {
return $result;
}
}
-
-/**
- * Access Control Object
- *
- * @package cake.libs.model
- */
-class Aco extends AclNode {
-
-/**
- * Model name
- *
- * @var string
- * @access public
- */
- public $name = 'Aco';
-
-/**
- * Binds to ARO nodes through permissions settings
- *
- * @var array
- * @access public
- */
- public $hasAndBelongsToMany = array('Aro' => array('with' => 'Permission'));
-}
-
-/**
- * Action for Access Control Object
- *
- * @package cake.libs.model
- */
-class AcoAction extends AppModel {
-
-/**
- * Model name
- *
- * @var string
- * @access public
- */
- public $name = 'AcoAction';
-
-/**
- * ACO Actions belong to ACOs
- *
- * @var array
- * @access public
- */
- public $belongsTo = array('Aco');
-}
-
-/**
- * Access Request Object
- *
- * @package cake.libs.model
- */
-class Aro extends AclNode {
-
-/**
- * Model name
- *
- * @var string
- * @access public
- */
- public $name = 'Aro';
-
-/**
- * AROs are linked to ACOs by means of Permission
- *
- * @var array
- * @access public
- */
- public $hasAndBelongsToMany = array('Aco' => array('with' => 'Permission'));
-}
-
-/**
- * Permissions linking AROs with ACOs
- *
- * @package cake.libs.model
- */
-class Permission extends AppModel {
-
-/**
- * Model name
- *
- * @var string
- * @access public
- */
- public $name = 'Permission';
-
-/**
- * Explicitly disable in-memory query caching
- *
- * @var boolean
- * @access public
- */
- public $cacheQueries = false;
-
-/**
- * Override default table name
- *
- * @var string
- * @access public
- */
- public $useTable = 'aros_acos';
-
-/**
- * Permissions link AROs with ACOs
- *
- * @var array
- * @access public
- */
- public $belongsTo = array('Aro', 'Aco');
-
-/**
- * No behaviors for this model
- *
- * @var array
- * @access public
- */
- public $actsAs = null;
-
-/**
- * Constructor, used to tell this model to use the
- * database configured for ACL
- */
- function __construct() {
- $config = Configure::read('Acl.database');
- if (!empty($config)) {
- $this->useDbConfig = $config;
- }
- parent::__construct();
- }
-}
diff --git a/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php b/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
index fc97b74c1..8d1ea6ce3 100644
--- a/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
+++ b/lib/Cake/tests/cases/libs/model/behaviors/acl.test.php
@@ -18,9 +18,14 @@
* @since CakePHP v 1.2.0.4487
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
App::uses('AclBehavior', 'Model/Behavior');
+App::uses('Aco', 'Model');
+App::uses('Aro', 'Model');
+App::uses('AclNode', 'Model');
App::uses('DbAcl', 'Model');
+
/**
* Test Person class - self joined model
*
From e81ff384c7b21e13f2df4150909c13202b734cfe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 01:48:15 -0430
Subject: [PATCH 206/668] Fixing BehaviorCollection test regarding how classes
are loaded. with the introduction of App::uses() it is not possible to
determine if a file is missing or just the class in the file, so removing the
throwing of MissingBehaviorFileException seems the only choice
---
lib/Cake/Model/BehaviorCollection.php | 6 +++---
.../tests/cases/libs/model/behavior_collection.test.php | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php
index 7cb353224..a75b6deec 100644
--- a/lib/Cake/Model/BehaviorCollection.php
+++ b/lib/Cake/Model/BehaviorCollection.php
@@ -96,21 +96,21 @@ class BehaviorCollection extends ObjectCollection {
* @param string $behavior CamelCased name of the behavior to load
* @param array $config Behavior configuration parameters
* @return boolean True on success, false on failure
- * @throws MissingBehaviorFileException or MissingBehaviorClassException when a behavior could not be found.
+ * @throws MissingBehaviorClassException when a behavior could not be found.
*/
public function load($behavior, $config = array()) {
if (is_array($config) && isset($config['className'])) {
$alias = $behavior;
$behavior = $config['className'];
}
- list($plugin, $name) = pluginSplit($behavior);
+ list($plugin, $name) = pluginSplit($behavior, true);
if (!isset($alias)) {
$alias = $name;
}
$class = $name . 'Behavior';
- App::uses($class, 'Model/Behavior');
+ App::uses($class, $plugin . 'Model/Behavior');
if (!class_exists($class)) {
throw new MissingBehaviorClassException(array(
'file' => Inflector::underscore($behavior) . '.php',
diff --git a/lib/Cake/tests/cases/libs/model/behavior_collection.test.php b/lib/Cake/tests/cases/libs/model/behavior_collection.test.php
index 1f38ae97c..6724c2784 100644
--- a/lib/Cake/tests/cases/libs/model/behavior_collection.test.php
+++ b/lib/Cake/tests/cases/libs/model/behavior_collection.test.php
@@ -453,7 +453,7 @@ class BehaviorCollectionTest extends CakeTestCase {
$this->assertEquals($Apple->testMethod(true), 'working');
$this->assertEquals($Apple->Behaviors->dispatchMethod($Apple, 'testMethod'), 'working');
- App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
+ App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
$this->assertTrue($Apple->Behaviors->load('SomeOther', array('className' => 'TestPlugin.TestPluginPersisterOne')));
$this->assertInstanceOf('TestPluginPersisterOneBehavior', $Apple->Behaviors->SomeOther);
@@ -553,7 +553,7 @@ class BehaviorCollectionTest extends CakeTestCase {
/**
* test that attaching a non existant Behavior triggers a cake error.
*
- * @expectedException MissingBehaviorFileException
+ * @expectedException MissingBehaviorClassException
* @return void
*/
function testInvalidBehaviorCausingCakeError() {
From 1ada281e14a303e7ccfef98bab524a723037a7f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 01:52:54 -0430
Subject: [PATCH 207/668] Extracting CakeLogInterface to its own file, this
fixes the FileLog test case
---
lib/Cake/Log/CakeLog.php | 16 ----------------
lib/Cake/Log/CakeLogInterface.php | 18 ++++++++++++++++++
lib/Cake/Log/Engine/FileLog.php | 3 +++
3 files changed, 21 insertions(+), 16 deletions(-)
create mode 100644 lib/Cake/Log/CakeLogInterface.php
diff --git a/lib/Cake/Log/CakeLog.php b/lib/Cake/Log/CakeLog.php
index 041779a96..0a1875a23 100644
--- a/lib/Cake/Log/CakeLog.php
+++ b/lib/Cake/Log/CakeLog.php
@@ -36,22 +36,6 @@
define('LOG_INFO', 6);
}
-/**
- * CakeLogStreamInterface is the interface that should be implemented
- * by all classes that are going to be used as Log streams.
- *
- * @package cake.libs
- */
-interface CakeLogInterface {
-/**
- * Write method to handle writes being made to the Logger
- *
- * @param string $type
- * @param string $message
- * @return void
- */
- public function write($type, $message);
-}
/**
* Logs messages to configured Log adapters. One or more adapters can be configured
diff --git a/lib/Cake/Log/CakeLogInterface.php b/lib/Cake/Log/CakeLogInterface.php
new file mode 100644
index 000000000..0b2cd1a3c
--- /dev/null
+++ b/lib/Cake/Log/CakeLogInterface.php
@@ -0,0 +1,18 @@
+
Date: Fri, 28 Jan 2011 01:55:07 -0430
Subject: [PATCH 208/668] Fixing ExceptionRenderer tests
---
lib/Cake/tests/cases/libs/error/exception_renderer.test.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/Cake/tests/cases/libs/error/exception_renderer.test.php b/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
index 7e949c801..7851d89fe 100644
--- a/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
+++ b/lib/Cake/tests/cases/libs/error/exception_renderer.test.php
@@ -19,7 +19,9 @@
App::uses('ExceptionRenderer', 'Error');
App::uses('Controller', 'Controller');
+App::uses('AppController', 'Controller');
App::uses('Component', 'Controller');
+App::uses('Router', 'Routing');
/**
* Short description for class.
From 024bff21269c9a8f4b820e8fda1fa7a91e77185a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 01:56:00 -0430
Subject: [PATCH 209/668] Adding missing class usage declaration in
ExceptionHandler test case
---
lib/Cake/Error/ErrorHandler.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php
index f996b4bee..6787e23f7 100644
--- a/lib/Cake/Error/ErrorHandler.php
+++ b/lib/Cake/Error/ErrorHandler.php
@@ -22,6 +22,7 @@
App::uses('Debugger', 'Utility');
App::uses('CakeLog', 'Log');
App::uses('ExceptionRenderer', 'Error');
+App::uses('AppController', 'Controller');
/**
*
From 4a55ef47cfb96819d43c0da077091218bd9e4381 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 02:00:20 -0430
Subject: [PATCH 210/668] Fixing SessionComponent tests
---
lib/Cake/Controller/AppController.php | 2 ++
lib/Cake/Controller/Component/SessionComponent.php | 1 +
lib/Cake/Core/Object.php | 4 +---
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/Cake/Controller/AppController.php b/lib/Cake/Controller/AppController.php
index 07c117dff..383cca2be 100644
--- a/lib/Cake/Controller/AppController.php
+++ b/lib/Cake/Controller/AppController.php
@@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Controller', 'Controller');
+
/**
* This is a placeholder class.
* Create the same file in app/app_controller.php
diff --git a/lib/Cake/Controller/Component/SessionComponent.php b/lib/Cake/Controller/Component/SessionComponent.php
index 6ebb59884..71ba5c477 100644
--- a/lib/Cake/Controller/Component/SessionComponent.php
+++ b/lib/Cake/Controller/Component/SessionComponent.php
@@ -17,6 +17,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Component', 'Controller');
App::uses('CakeSession', 'Model/Datasource');
/**
diff --git a/lib/Cake/Core/Object.php b/lib/Cake/Core/Object.php
index cf1e369b6..28a3d0d29 100644
--- a/lib/Cake/Core/Object.php
+++ b/lib/Cake/Core/Object.php
@@ -66,9 +66,7 @@ class Object {
if (empty($url)) {
return false;
}
- if (!class_exists('dispatcher')) {
- require LIBS . 'dispatcher.php';
- }
+ App::uses('Dispatcher', 'Routing');
if (in_array('return', $extra, true)) {
$extra = array_merge($extra, array('return' => 0, 'autoRender' => 1));
}
From 32e0d8697628f148ef515f0319dbdaeb6080764a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 02:02:33 -0430
Subject: [PATCH 211/668] Fixing sSecurity component tests
---
lib/Cake/Controller/Component/SecurityComponent.php | 2 ++
.../tests/cases/libs/controller/components/security.test.php | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php
index 7286e8419..721d9f57f 100644
--- a/lib/Cake/Controller/Component/SecurityComponent.php
+++ b/lib/Cake/Controller/Component/SecurityComponent.php
@@ -16,6 +16,8 @@
* @since CakePHP(tm) v 0.10.8.2156
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('Component', 'Controller');
App::uses('String', 'Utility');
App::uses('Security', 'Utility');
diff --git a/lib/Cake/tests/cases/libs/controller/components/security.test.php b/lib/Cake/tests/cases/libs/controller/components/security.test.php
index d40372c3d..bda666f66 100644
--- a/lib/Cake/tests/cases/libs/controller/components/security.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/security.test.php
@@ -16,8 +16,9 @@
* @since CakePHP(tm) v 1.2.0.5435
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('SecurityComponent', 'Controller/Component');
App::uses('Controller', 'Controller');
-App::uses('SecurityComponent', 'Component');
/**
* TestSecurityComponent
From 06fb51f19d1c47d397fd86213d54e8f6ef0c8f4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 02:06:30 -0430
Subject: [PATCH 212/668] Added some missing App::uses() calls
---
lib/Cake/Controller/Component/AclComponent.php | 4 +---
lib/Cake/Controller/Component/AuthComponent.php | 1 +
lib/Cake/Controller/Component/CookieComponent.php | 4 +---
lib/Cake/Controller/Component/EmailComponent.php | 2 ++
.../cases/libs/controller/components/request_handler.test.php | 1 +
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/Cake/Controller/Component/AclComponent.php b/lib/Cake/Controller/Component/AclComponent.php
index 66c274a30..e8809f864 100644
--- a/lib/Cake/Controller/Component/AclComponent.php
+++ b/lib/Cake/Controller/Component/AclComponent.php
@@ -264,9 +264,7 @@ class DbAcl extends Object implements AclInterface {
*/
function __construct() {
parent::__construct();
- if (!class_exists('AclNode')) {
- require LIBS . 'model' . DS . 'db_acl.php';
- }
+ App::uses('AclNode', 'Model');
$this->Aro = ClassRegistry::init(array('class' => 'Aro', 'alias' => 'Aro'));
$this->Aco = ClassRegistry::init(array('class' => 'Aco', 'alias' => 'Aco'));
}
diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php
index 251a0e1fe..7f1cf6a94 100644
--- a/lib/Cake/Controller/Component/AuthComponent.php
+++ b/lib/Cake/Controller/Component/AuthComponent.php
@@ -19,6 +19,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Component', 'Controller');
App::uses('Router', 'Routing');
App::uses('Security', 'Utility');
App::uses('Debugger', 'Utility');
diff --git a/lib/Cake/Controller/Component/CookieComponent.php b/lib/Cake/Controller/Component/CookieComponent.php
index dfe360f2c..9fefdb540 100644
--- a/lib/Cake/Controller/Component/CookieComponent.php
+++ b/lib/Cake/Controller/Component/CookieComponent.php
@@ -17,9 +17,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-/**
- * Load Security class
- */
+App::uses('Component', 'Controller');
App::uses('Security', 'Utility');
/**
diff --git a/lib/Cake/Controller/Component/EmailComponent.php b/lib/Cake/Controller/Component/EmailComponent.php
index d52a82e77..0c5d95358 100755
--- a/lib/Cake/Controller/Component/EmailComponent.php
+++ b/lib/Cake/Controller/Component/EmailComponent.php
@@ -16,6 +16,8 @@
* @since CakePHP(tm) v 1.2.0.3467
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('Component', 'Controller');
App::uses('Multibyte', 'I18n');
/**
diff --git a/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php b/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
index 91a39da37..3d0ea9c9b 100644
--- a/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
+++ b/lib/Cake/tests/cases/libs/controller/components/request_handler.test.php
@@ -20,6 +20,7 @@ App::uses('Controller', 'Controller');
App::uses('RequestHandlerComponent', 'Controller/Component');
App::uses('CakeRequest', 'Network');
App::uses('CakeResponse', 'Network');
+App::uses('Router', 'Routing');
/**
* RequestHandlerTestController class
From 4f01fc79c15346a2310ecda7ec5d7ac24e2bff67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Fri, 28 Jan 2011 10:49:53 -0430
Subject: [PATCH 213/668] Fixing ComponentCollecction components loading, as
with Behaviors and Helpers, thee MissingFileException can not be thrown
---
lib/Cake/Controller/ComponentCollection.php | 4 ++--
.../tests/cases/libs/controller/component_collection.test.php | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/Cake/Controller/ComponentCollection.php b/lib/Cake/Controller/ComponentCollection.php
index 7c7c0c63a..52540af64 100644
--- a/lib/Cake/Controller/ComponentCollection.php
+++ b/lib/Cake/Controller/ComponentCollection.php
@@ -79,7 +79,7 @@ class ComponentCollection extends ObjectCollection {
$alias = $component;
$component = $settings['className'];
}
- list($plugin, $name) = pluginSplit($component);
+ list($plugin, $name) = pluginSplit($component, true);
if (!isset($alias)) {
$alias = $name;
}
@@ -87,7 +87,7 @@ class ComponentCollection extends ObjectCollection {
return $this->_loaded[$alias];
}
$componentClass = $name . 'Component';
- App::uses($componentClass, 'Controller/Component');
+ App::uses($componentClass, $plugin . 'Controller/Component');
if (!class_exists($componentClass)) {
throw new MissingComponentClassException(array(
'file' => Inflector::underscore($componentClass) . '.php',
diff --git a/lib/Cake/tests/cases/libs/controller/component_collection.test.php b/lib/Cake/tests/cases/libs/controller/component_collection.test.php
index 8bba76fde..a6b779073 100644
--- a/lib/Cake/tests/cases/libs/controller/component_collection.test.php
+++ b/lib/Cake/tests/cases/libs/controller/component_collection.test.php
@@ -84,7 +84,7 @@ class ComponentCollectionTest extends CakeTestCase {
$result = $this->Components->load('Cookie');
$this->assertInstanceOf('CookieAliasComponent', $result);
- App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
+ App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)));
$result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.OtherComponent'));
$this->assertInstanceOf('OtherComponentComponent', $result);
$this->assertInstanceOf('OtherComponentComponent', $this->Components->SomeOther);
@@ -109,7 +109,7 @@ class ComponentCollectionTest extends CakeTestCase {
/**
* test missingcomponent exception
*
- * @expectedException MissingComponentFileException
+ * @expectedException MissingComponentClassException
* @return void
*/
function testLoadMissingComponentFile() {
From b30f40582e3338ebe931ff47c308126bf81ca06c Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 29 Jan 2011 09:24:28 -0500
Subject: [PATCH 214/668] Making SchemaShell disable the cache when reading
table information for schema generation. Fixes #1490
---
cake/console/libs/schema.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php
index 889f85453..840e3c61a 100644
--- a/cake/console/libs/schema.php
+++ b/cake/console/libs/schema.php
@@ -153,8 +153,13 @@ class SchemaShell extends Shell {
}
}
+ $cacheDisable = Configure::read('Cache.disable');
+ Configure::write('Cache.disable', true);
+
$content = $this->Schema->read($options);
$content['file'] = $this->params['file'];
+
+ Configure::write('Cache.disable', $cacheDisable);
if ($snapshot === true) {
$Folder =& new Folder($this->Schema->path);
From 01801a7777a75392eae358c2e32f046effad0fe9 Mon Sep 17 00:00:00 2001
From: Maggion Emmanuel
Date: Tue, 25 Jan 2011 18:16:47 +0100
Subject: [PATCH 215/668] Reducing code related to CakeSchema. Fixes #1477
---
app/config/schema/db_acl.php | 9 ---------
app/config/schema/i18n.php | 9 ---------
app/config/schema/sessions.php | 9 ---------
cake/libs/model/cake_schema.php | 10 ----------
4 files changed, 37 deletions(-)
diff --git a/app/config/schema/db_acl.php b/app/config/schema/db_acl.php
index 25b6ee6df..25ed49204 100644
--- a/app/config/schema/db_acl.php
+++ b/app/config/schema/db_acl.php
@@ -27,15 +27,6 @@
*/
class DbAclSchema extends CakeSchema {
- public $name = 'DbAcl';
-
- function before($event = array()) {
- return true;
- }
-
- function after($event = array()) {
- }
-
public $acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
diff --git a/app/config/schema/i18n.php b/app/config/schema/i18n.php
index f57bbce7f..7776dbcd0 100644
--- a/app/config/schema/i18n.php
+++ b/app/config/schema/i18n.php
@@ -27,15 +27,6 @@
*/
class i18nSchema extends CakeSchema {
- public $name = 'i18n';
-
- function before($event = array()) {
- return true;
- }
-
- function after($event = array()) {
- }
-
public $i18n = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
diff --git a/app/config/schema/sessions.php b/app/config/schema/sessions.php
index e5ae37dc1..6304317f9 100644
--- a/app/config/schema/sessions.php
+++ b/app/config/schema/sessions.php
@@ -27,15 +27,6 @@
*/
class SessionsSchema extends CakeSchema {
- public $name = 'Sessions';
-
- function before($event = array()) {
- return true;
- }
-
- function after($event = array()) {
- }
-
public $cake_sessions = array(
'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'),
'data' => array('type'=>'text', 'null' => true, 'default' => NULL),
diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php
index fb3a77c13..eb577c7d8 100644
--- a/cake/libs/model/cake_schema.php
+++ b/cake/libs/model/cake_schema.php
@@ -26,14 +26,6 @@ App::import('Core', 'ConnectionManager');
*/
class CakeSchema extends Object {
-/**
- * Name of the App Schema
- *
- * @var string
- * @access public
- */
- public $name = null;
-
/**
* Path to write location
*
@@ -337,8 +329,6 @@ class CakeSchema extends Object {
$out = "class {$name}Schema extends CakeSchema {\n";
- $out .= "\tvar \$name = '{$name}';\n\n";
-
if ($path !== $this->path) {
$out .= "\tvar \$path = '{$path}';\n\n";
}
From 88d5db76fddf16a5467818d8c9ab37e23273e4ad Mon Sep 17 00:00:00 2001
From: ADmad
Date: Sun, 30 Jan 2011 04:13:01 +0530
Subject: [PATCH 216/668] Removed overriding of recursive to 0 in
Model::_findNeighbors() if 'recusive' option is not specified in find
options. Closes #860
---
cake/libs/model/model.php | 9 ++++-----
cake/tests/cases/libs/model/model_read.test.php | 15 ++++++++++-----
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php
index 396da7d4e..a375dc2eb 100644
--- a/cake/libs/model/model.php
+++ b/cake/libs/model/model.php
@@ -331,9 +331,9 @@ class Model extends Object {
public $__backAssociation = array();
public $__backInnerAssociation = array();
-
+
public $__backOriginalAssociation = array();
-
+
public $__backContainableAssociation = array();
/**
@@ -1067,7 +1067,7 @@ class Model extends Object {
}
/**
- * Check that a method is callable on a model. This will check both the model's own methods, its
+ * Check that a method is callable on a model. This will check both the model's own methods, its
* inherited methods and methods that could be callable through behaviors.
*
* @param string $method The method to be called.
@@ -2156,7 +2156,7 @@ class Model extends Object {
if ($query['callbacks'] === true || $query['callbacks'] === 'before') {
$return = $this->Behaviors->trigger(
- 'beforeFind',
+ 'beforeFind',
array(&$this, $query),
array('break' => true, 'breakOn' => array(false, null), 'modParams' => 1)
);
@@ -2321,7 +2321,6 @@ class Model extends Object {
*/
protected function _findNeighbors($state, $query, $results = array()) {
if ($state == 'before') {
- $query = array_merge(array('recursive' => 0), $query);
extract($query);
$conditions = (array)$conditions;
if (isset($field) && isset($value)) {
diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php
index 29ef9e929..8788b04af 100755
--- a/cake/tests/cases/libs/model/model_read.test.php
+++ b/cake/tests/cases/libs/model/model_read.test.php
@@ -3504,11 +3504,14 @@ class ModelReadTest extends BaseModelTest {
$expected = array(
'prev' => null,
'next' => array(
- 'Article' => array('id' => 2)
+ 'Article' => array('id' => 2),
+ 'Comment' => array(),
+ 'Tag' => array()
));
$this->assertEqual($result, $expected);
$TestModel->id = 2;
+ $TestModel->recursive = 0;
$result = $TestModel->find('neighbors', array(
'fields' => array('id')
));
@@ -3525,12 +3528,14 @@ class ModelReadTest extends BaseModelTest {
$this->assertEqual($result, $expected);
$TestModel->id = 3;
+ $TestModel->recursive = 1;
$result = $TestModel->find('neighbors', array('fields' => array('id')));
$expected = array(
'prev' => array(
- 'Article' => array(
- 'id' => 2
- )),
+ 'Article' => array('id' => 2),
+ 'Comment' => array(),
+ 'Tag' => array()
+ ),
'next' => null
);
$this->assertEqual($result, $expected);
@@ -4793,7 +4798,7 @@ class ModelReadTest extends BaseModelTest {
}
/**
- * test that calling unbindModel() with reset == true multiple times
+ * test that calling unbindModel() with reset == true multiple times
* leaves associations in the correct state.
*
* @return void
From 5b8499c8c74e58e5b77915ff086ba13112affa10 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 29 Jan 2011 20:53:50 -0500
Subject: [PATCH 217/668] Adding $name back in as it causes numerous notice
errors in fixtures when it is missing.
---
cake/libs/model/cake_schema.php | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php
index eb577c7d8..c083c7356 100644
--- a/cake/libs/model/cake_schema.php
+++ b/cake/libs/model/cake_schema.php
@@ -26,6 +26,14 @@ App::import('Core', 'ConnectionManager');
*/
class CakeSchema extends Object {
+/**
+ * Name of the schema
+ *
+ * @var string
+ * @access public
+ */
+ public $name = null;
+
/**
* Path to write location
*
From 6db8515e60ae0031af4ea0e9d50099c6f1bb2f1e Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 30 Jan 2011 12:25:40 -0500
Subject: [PATCH 218/668] Fixing incorrectly nested sprintf + __ call. Refs
#1305
---
cake/libs/controller/scaffold.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php
index ea5e9031f..27b7632c8 100644
--- a/cake/libs/controller/scaffold.php
+++ b/cake/libs/controller/scaffold.php
@@ -223,7 +223,7 @@ class Scaffold extends Object {
function __scaffoldView($params) {
if ($this->controller->_beforeScaffold('view')) {
- $message = __(sprintf("No id set for %s::view()", Inflector::humanize($this->modelKey)), true);
+ $message = sprintf(__("No id set for %s::view()", true), Inflector::humanize($this->modelKey));
if (isset($params['pass'][0])) {
$this->ScaffoldModel->id = $params['pass'][0];
} elseif ($this->_validSession) {
From 9402f0ab79307946c0eabee63d0c19a46d6dbf60 Mon Sep 17 00:00:00 2001
From: Phally
Date: Mon, 31 Jan 2011 00:06:11 +0100
Subject: [PATCH 219/668] Added missing skipIf when no SMTP server is running.
---
cake/tests/cases/libs/controller/components/email.test.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php
index de1be084e..541ed4f2a 100755
--- a/cake/tests/cases/libs/controller/components/email.test.php
+++ b/cake/tests/cases/libs/controller/components/email.test.php
@@ -437,6 +437,9 @@ TEMPDOC;
* @return void
*/
function testSmtpSendMultipleTo() {
+ if ($this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) {
+ return;
+ }
$this->Controller->EmailTest->reset();
$this->Controller->EmailTest->to = array('postmaster@localhost', 'root@localhost');
$this->Controller->EmailTest->from = 'noreply@example.com';
From f3812342c226ec1d3355b84f60edfc54146095b7 Mon Sep 17 00:00:00 2001
From: Phally
Date: Mon, 31 Jan 2011 00:15:12 +0100
Subject: [PATCH 220/668] Minor optimization for email linefeeds.
---
cake/libs/controller/components/email.php | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php
index 78698b056..fd4ed3479 100755
--- a/cake/libs/controller/components/email.php
+++ b/cake/libs/controller/components/email.php
@@ -159,7 +159,7 @@ class EmailComponent extends Object{
/**
* Line feed character(s) to be used when sending using mail() function
- * If null PHP_EOL is used.
+ * By default PHP_EOL is used.
* RFC2822 requires it to be CRLF but some Unix
* mail transfer agents replace LF by CRLF automatically
* (which leads to doubling CR if CRLF is used).
@@ -167,7 +167,7 @@ class EmailComponent extends Object{
* @var string
* @access public
*/
- var $lineFeed = null;
+ var $lineFeed = PHP_EOL;
/**
* @deprecated see lineLength
@@ -819,13 +819,8 @@ class EmailComponent extends Object{
* @access private
*/
function _mail() {
- if ($this->lineFeed === null) {
- $lineFeed = PHP_EOL;
- } else {
- $lineFeed = $this->lineFeed;
- }
- $header = implode($lineFeed, $this->__header);
- $message = implode($lineFeed, $this->__message);
+ $header = implode($this->lineFeed, $this->__header);
+ $message = implode($this->lineFeed, $this->__message);
if (is_array($this->to)) {
$to = implode(', ', array_map(array($this, '_formatAddress'), $this->to));
} else {
From 33cbdefd8c3c48dd7a764fe64b5870636de88f46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 30 Jan 2011 23:39:07 -0430
Subject: [PATCH 221/668] Moving config tests assets and adding missing view
path in View tests case
---
{cake => lib/Cake}/tests/test_app/config/htmlhelper_minimized.ini | 0
{cake => lib/Cake}/tests/test_app/config/htmlhelper_tags.php | 0
{cake => lib/Cake}/tests/test_app/config/no_section.ini | 0
3 files changed, 0 insertions(+), 0 deletions(-)
rename {cake => lib/Cake}/tests/test_app/config/htmlhelper_minimized.ini (100%)
rename {cake => lib/Cake}/tests/test_app/config/htmlhelper_tags.php (100%)
rename {cake => lib/Cake}/tests/test_app/config/no_section.ini (100%)
diff --git a/cake/tests/test_app/config/htmlhelper_minimized.ini b/lib/Cake/tests/test_app/config/htmlhelper_minimized.ini
similarity index 100%
rename from cake/tests/test_app/config/htmlhelper_minimized.ini
rename to lib/Cake/tests/test_app/config/htmlhelper_minimized.ini
diff --git a/cake/tests/test_app/config/htmlhelper_tags.php b/lib/Cake/tests/test_app/config/htmlhelper_tags.php
similarity index 100%
rename from cake/tests/test_app/config/htmlhelper_tags.php
rename to lib/Cake/tests/test_app/config/htmlhelper_tags.php
diff --git a/cake/tests/test_app/config/no_section.ini b/lib/Cake/tests/test_app/config/no_section.ini
similarity index 100%
rename from cake/tests/test_app/config/no_section.ini
rename to lib/Cake/tests/test_app/config/no_section.ini
From a1fd27741d1e80d604d53fe2817953cc7ac19278 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Sun, 30 Jan 2011 23:41:59 -0430
Subject: [PATCH 222/668] Fixing CakeTestFixture test case
---
lib/Cake/tests/cases/libs/cake_test_fixture.test.php | 1 +
lib/Cake/tests/cases/libs/view/view.test.php | 1 +
2 files changed, 2 insertions(+)
diff --git a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
index fc0dad82c..ee7edbd2d 100644
--- a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
+++ b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php
@@ -18,6 +18,7 @@
*/
App::uses('DboSource', 'Model/Datasource');
App::uses('Model', 'Model');
+App::uses('CakeTestFixture', 'TestSuite/Fixture');
/**
* CakeTestFixtureTestFixture class
diff --git a/lib/Cake/tests/cases/libs/view/view.test.php b/lib/Cake/tests/cases/libs/view/view.test.php
index 7b32888f3..d14a8a24d 100644
--- a/lib/Cake/tests/cases/libs/view/view.test.php
+++ b/lib/Cake/tests/cases/libs/view/view.test.php
@@ -261,6 +261,7 @@ class ViewTest extends CakeTestCase {
$expected = array(
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
+ LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'libs' . DS . 'View' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS,
LIBS . 'View' . DS
);
From bff634397984b601cd961fc356c68c3fa59002f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 31 Jan 2011 00:02:17 -0430
Subject: [PATCH 223/668] Adding the session datasources apth to App::build(),
in the future look into registering only the top level packages Fixing
CakeSession tests
---
lib/Cake/Core/App.php | 3 ++-
lib/Cake/tests/cases/libs/cake_session.test.php | 3 +--
.../datasources/Session/TestAppLibSession.php} | 0
.../datasources/Session/TestPluginSession.php} | 0
4 files changed, 3 insertions(+), 3 deletions(-)
rename lib/Cake/tests/test_app/{libs/session/test_app_lib_session.php => models/datasources/Session/TestAppLibSession.php} (100%)
rename lib/Cake/tests/test_app/plugins/test_plugin/{libs/session/test_plugin_session.php => models/datasources/Session/TestPluginSession.php} (100%)
diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php
index ff27bc6aa..ac324e265 100644
--- a/lib/Cake/Core/App.php
+++ b/lib/Cake/Core/App.php
@@ -291,7 +291,8 @@ class App {
'Model' => array('%s' . 'models' . DS),
'Model/Behavior' => array('%s' . 'models' . DS . 'behaviors' . DS),
'Model/Datasource' => array('%s' . 'models' . DS . 'datasources' . DS),
- 'Model/Datasource/Database' => array('%s' . 'models' . DS . 'datasources' . DS . 'database' . DS),
+ 'Model/Datasource/Database' => array('%s' . 'models' . DS . 'datasources' . DS . 'Database' . DS),
+ 'Model/Datasource/Session' => array('%s' . 'models' . DS . 'datasources' . DS . 'Session' . DS),
'Controller' => array('%s' . 'controllers' . DS),
'Controller/Component' => array('%s' . 'controllers' . DS . 'components' . DS),
'View' => array('%s' . 'views' . DS),
diff --git a/lib/Cake/tests/cases/libs/cake_session.test.php b/lib/Cake/tests/cases/libs/cake_session.test.php
index 2da0f25a0..510cdc068 100644
--- a/lib/Cake/tests/cases/libs/cake_session.test.php
+++ b/lib/Cake/tests/cases/libs/cake_session.test.php
@@ -527,7 +527,7 @@ class CakeSessionTest extends CakeTestCase {
*/
function testUsingAppLibsHandler() {
App::build(array(
- 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
+ 'Model/Datasource/Session' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS . 'Session' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
Configure::write('Session', array(
@@ -549,7 +549,6 @@ class CakeSessionTest extends CakeTestCase {
*/
function testUsingPluginHandler() {
App::build(array(
- 'libs' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
diff --git a/lib/Cake/tests/test_app/libs/session/test_app_lib_session.php b/lib/Cake/tests/test_app/models/datasources/Session/TestAppLibSession.php
similarity index 100%
rename from lib/Cake/tests/test_app/libs/session/test_app_lib_session.php
rename to lib/Cake/tests/test_app/models/datasources/Session/TestAppLibSession.php
diff --git a/lib/Cake/tests/test_app/plugins/test_plugin/libs/session/test_plugin_session.php b/lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/Session/TestPluginSession.php
similarity index 100%
rename from lib/Cake/tests/test_app/plugins/test_plugin/libs/session/test_plugin_session.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/models/datasources/Session/TestPluginSession.php
From ff5a809b2989fa21f8e42c94ec7102d8c7dc1a56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 31 Jan 2011 00:14:20 -0430
Subject: [PATCH 224/668] Fixing log engines loading
---
.../libs/{log/test_app_log.php => Log/Engine/TestAppLog.php} | 3 +++
.../{log/test_plugin_log.php => Log/Engine/TestPluginLog.php} | 0
2 files changed, 3 insertions(+)
rename lib/Cake/tests/test_app/libs/{log/test_app_log.php => Log/Engine/TestAppLog.php} (94%)
rename lib/Cake/tests/test_app/plugins/test_plugin/libs/{log/test_plugin_log.php => Log/Engine/TestPluginLog.php} (100%)
diff --git a/lib/Cake/tests/test_app/libs/log/test_app_log.php b/lib/Cake/tests/test_app/libs/Log/Engine/TestAppLog.php
similarity index 94%
rename from lib/Cake/tests/test_app/libs/log/test_app_log.php
rename to lib/Cake/tests/test_app/libs/Log/Engine/TestAppLog.php
index 129e1b65d..736be6cb6 100644
--- a/lib/Cake/tests/test_app/libs/log/test_app_log.php
+++ b/lib/Cake/tests/test_app/libs/Log/Engine/TestAppLog.php
@@ -16,6 +16,9 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('CakeLogInterface', 'Log');
+
class TestAppLog implements CakeLogInterface {
function write($type, $message) {
diff --git a/lib/Cake/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php b/lib/Cake/tests/test_app/plugins/test_plugin/libs/Log/Engine/TestPluginLog.php
similarity index 100%
rename from lib/Cake/tests/test_app/plugins/test_plugin/libs/log/test_plugin_log.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/libs/Log/Engine/TestPluginLog.php
From 72c6e0cd58dcb5ba2d1f04c47633bbc8bd3037d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?=
Date: Mon, 31 Jan 2011 00:47:30 -0430
Subject: [PATCH 225/668] Fixing Cache tests
---
lib/Cake/Cache/Cache.php | 4 ++--
lib/Cake/tests/cases/libs/cache.test.php | 20 ++++++-------------
.../Engine/TestAppCacheEngine.php} | 0
.../Engine/TestPluginCacheEngine.php} | 0
4 files changed, 8 insertions(+), 16 deletions(-)
rename lib/Cake/tests/test_app/libs/{cache/test_app_cache.php => Cache/Engine/TestAppCacheEngine.php} (100%)
rename lib/Cake/tests/test_app/plugins/test_plugin/libs/{cache/test_plugin_cache.php => Cache/Engine/TestPluginCacheEngine.php} (100%)
diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php
index 9f84ac997..59b62fd7a 100644
--- a/lib/Cake/Cache/Cache.php
+++ b/lib/Cake/Cache/Cache.php
@@ -125,9 +125,9 @@ class Cache {
protected static function _buildEngine($name) {
$config = self::$_config[$name];
- list($plugin, $class) = pluginSplit($config['engine']);
+ list($plugin, $class) = pluginSplit($config['engine'], true);
$cacheClass = $class . 'Engine';
- App::uses($cacheClass, 'Cache/Engine');
+ App::uses($cacheClass, $plugin . 'Cache/Engine');
if (!class_exists($cacheClass)) {
return false;
}
diff --git a/lib/Cake/tests/cases/libs/cache.test.php b/lib/Cake/tests/cases/libs/cache.test.php
index 82c8a7c10..b0bf9e33d 100644
--- a/lib/Cake/tests/cases/libs/cache.test.php
+++ b/lib/Cake/tests/cases/libs/cache.test.php
@@ -16,9 +16,8 @@
* @since CakePHP(tm) v 1.2.0.5432
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-if (!class_exists('Cache')) {
- require LIBS . 'cache.php';
-}
+
+App::uses('Cache', 'Cache');
/**
* CacheTest class
@@ -234,19 +233,12 @@ class CacheTest extends CakeTestCase {
* @return void
*/
function testInitSettings() {
- Cache::config('default', array('engine' => 'File', 'path' => TMP . 'tests'));
+ $initial = Cache::settings();
+ $override = array('engine' => 'File', 'path' => TMP . 'tests');
+ Cache::config('default', $override);
$settings = Cache::settings();
- $expecting = array(
- 'engine' => 'File',
- 'duration'=> 3600,
- 'probability' => 100,
- 'path'=> TMP . 'tests',
- 'prefix'=> 'cake_',
- 'lock' => false,
- 'serialize'=> true,
- 'isWindows' => DIRECTORY_SEPARATOR == '\\'
- );
+ $expecting = $override + $initial;
$this->assertEqual($settings, $expecting);
}
diff --git a/lib/Cake/tests/test_app/libs/cache/test_app_cache.php b/lib/Cake/tests/test_app/libs/Cache/Engine/TestAppCacheEngine.php
similarity index 100%
rename from lib/Cake/tests/test_app/libs/cache/test_app_cache.php
rename to lib/Cake/tests/test_app/libs/Cache/Engine/TestAppCacheEngine.php
diff --git a/lib/Cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php b/lib/Cake/tests/test_app/plugins/test_plugin/libs/Cache/Engine/TestPluginCacheEngine.php
similarity index 100%
rename from lib/Cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php
rename to lib/Cake/tests/test_app/plugins/test_plugin/libs/Cache/Engine/TestPluginCacheEngine.php
From 63308fdbd8308440c6c0f5aefbf41ae36f9351c6 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 2 Feb 2011 21:52:41 -0500
Subject: [PATCH 226/668] Fixing issue where a false id would be appended to
the route url. Test added. Fixes #1501
---
cake/libs/view/helpers/form.php | 2 +-
.../cases/libs/view/helpers/form.test.php | 26 ++++++++++++++++---
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php
index 1eb2b315f..92e87fb3e 100644
--- a/cake/libs/view/helpers/form.php
+++ b/cake/libs/view/helpers/form.php
@@ -260,7 +260,7 @@ class FormHelper extends AppHelper {
$options['id'] = $this->domId($options['action'] . 'Form');
}
$options['action'] = array_merge($actionDefaults, (array)$options['url']);
- if (empty($options['action'][0])) {
+ if (empty($options['action'][0]) && !empty($id)) {
$options['action'][0] = $id;
}
} elseif (is_string($options['url'])) {
diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php
index bb389396a..ed3af90d1 100644
--- a/cake/tests/cases/libs/view/helpers/form.test.php
+++ b/cake/tests/cases/libs/view/helpers/form.test.php
@@ -661,8 +661,6 @@ class FormHelperTest extends CakeTestCase {
*/
function setUp() {
parent::setUp();
- Router::reload();
-
$this->Controller = new ContactTestController();
$this->View = new View($this->Controller);
@@ -703,7 +701,7 @@ class FormHelperTest extends CakeTestCase {
* @return void
*/
function tearDown() {
- ClassRegistry::flush();
+ parent::tearDown();
unset($this->Form->Html, $this->Form, $this->Controller, $this->View);
Configure::write('Security.salt', $this->oldSalt);
}
@@ -5640,6 +5638,28 @@ class FormHelperTest extends CakeTestCase {
$this->assertTags($result, $expected);
}
+/**
+ * test create() with a custom route
+ *
+ * @return void
+ */
+ function testCreateCustomRoute() {
+ Router::connect('/login', array('controller' => 'users', 'action' => 'login'));
+ $encoding = strtolower(Configure::read('App.encoding'));
+
+ $result = $this->Form->create('User', array('action' => 'login'));
+ $expected = array(
+ 'form' => array(
+ 'id' => 'UserLoginForm', 'method' => 'post', 'action' => '/login',
+ 'accept-charset' => $encoding
+ ),
+ 'div' => array('style' => 'display:none;'),
+ 'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
+ '/div'
+ );
+ $this->assertTags($result, $expected);
+ }
+
/**
* test that inputDefaults are stored and used.
*
From 68da3fab8f8aba726db74156e35f20bb966c752f Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 2 Jan 2011 00:57:23 -0500
Subject: [PATCH 227/668] Starting to extract authentication objects out of
AuthComponent. Started off with extracting FormAuthenticate as its what
currently exists in AuthComponent. Test case added.
---
.../components/auth/form_authenticate.php | 70 +++++++++
.../auth/form_authenticate.test.php | 133 ++++++++++++++++++
2 files changed, 203 insertions(+)
create mode 100644 cake/libs/controller/components/auth/form_authenticate.php
create mode 100644 cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
new file mode 100644
index 000000000..324bff557
--- /dev/null
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -0,0 +1,70 @@
+ 1).`
+ *
+ * @var array
+ */
+ public $settings = array(
+ 'fields' => array(
+ 'username' => 'username',
+ 'password' => 'password'
+ ),
+ 'userModel' => 'User',
+ 'scope' => array()
+ );
+
+/**
+ * Constructor
+ *
+ * @param array $settings Array of settings to use.
+ */
+ public function __construct($settings) {
+ $this->settings = Set::merge($this->settings, $settings);
+ }
+
+/**
+ * Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields`
+ * to find POST data that is used to find a matching record in the `settings.userModel`. Will return false if
+ * there is no post data, either username or password is missing, of if the scope conditions have not been met.
+ *
+ * @param CakeRequest $request The request that contains login information.
+ * @return mixed. False on login failure. An array of User data on success.
+ */
+ public function authenticate(CakeRequest $request) {
+ $userModel = $this->settings['userModel'];
+ $fields = $this->settings['fields'];
+ if (empty($request->data[$userModel])) {
+ return false;
+ }
+ if (
+ empty($request->data[$userModel][$fields['username']]) ||
+ empty($request->data[$userModel][$fields['password']])
+ ) {
+ return false;
+ }
+ $conditions = array(
+ $userModel . '.' . $fields['username'] => $request->data[$userModel][$fields['username']],
+ $userModel . '.' . $fields['password'] => $request->data[$userModel][$fields['password']],
+ );
+ if (!empty($this->settings['scope'])) {
+ $conditions = array_merge($conditions, $this->settings['scope']);
+ }
+ $result = ClassRegistry::init($userModel)->find('first', array(
+ 'conditions' => $conditions,
+ 'recursive' => 0
+ ));
+ if (empty($result) || empty($result[$userModel])) {
+ return false;
+ }
+ unset($result[$userModel][$fields['password']]);
+ return $result[$userModel];
+ }
+}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
new file mode 100644
index 000000000..940c973e0
--- /dev/null
+++ b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
@@ -0,0 +1,133 @@
+auth = new FormAuthenticate(array(
+ 'fields' => array('username' => 'user', 'password' => 'password'),
+ 'userModel' => 'User'
+ ));
+ $this->password = Security::hash('password', null, true);
+ ClassRegistry::init('User')->updateAll(array('password' => '"' . $this->password . '"'));
+ }
+
+/**
+ * test applying settings in the constructor
+ *
+ * @return void
+ */
+ function testConstructor() {
+ $object = new FormAuthenticate(array(
+ 'userModel' => 'AuthUser',
+ 'fields' => array('username' => 'user', 'password' => 'password')
+ ));
+ $this->assertEquals('AuthUser', $object->settings['userModel']);
+ $this->assertEquals(array('username' => 'user', 'password' => 'password'), $object->settings['fields']);
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoData() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array();
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoUsername() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array('password' => 'foobar'));
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoPassword() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array('user' => 'mariano'));
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateInjection() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array(
+ 'User' => array(
+ 'user' => '> 1',
+ 'password' => "' OR 1 = 1"
+ ));
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test authenticate sucesss
+ *
+ * @return void
+ */
+ function testAuthenticateSuccess() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array(
+ 'user' => 'mariano',
+ 'password' => $this->password
+ ));
+ $result = $this->auth->authenticate($request);
+ $expected = array(
+ 'id' => 1,
+ 'user' => 'mariano',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => '2007-03-17 01:18:31'
+ );
+ $this->assertEquals($expected, $result);
+ }
+
+/**
+ * test scope failure.
+ *
+ * @return void
+ */
+ function testAuthenticateScopeFail() {
+ $this->auth->settings['scope'] = array('user' => 'nate');
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array(
+ 'user' => 'mariano',
+ 'password' => $this->password
+ ));
+
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+}
\ No newline at end of file
From 1c827573ceb9f376c3b2acdeaf2e5605328c2ea1 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 2 Jan 2011 12:31:48 -0500
Subject: [PATCH 228/668] Adding doc blocks for FormAuthenticate.
---
.../components/auth/form_authenticate.php | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index 324bff557..e337b9715 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -1,5 +1,36 @@
Auth->authenticate = array(
+ * 'Form' => array(
+ * 'scope' => array('User.active' => 1)
+ * )
+ * )
+ * }}}
+ *
+ * When configuring FormAuthenticate you can pass in settings to which fields, model and additional conditions
+ * are used. See FormAuthenticate::$settings for more information.
+ *
+ * @package cake.libs.controller.components.auth
+ * @since 2.0
+ */
class FormAuthenticate {
/**
From 693360bc9e27ff08eb5341c82b9f13aae0b88911 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 2 Jan 2011 13:21:21 -0500
Subject: [PATCH 229/668] Removing isAuthorized() as there is no need for it
once AuthComponent is updated.
---
.../components/auth/form_authenticate.php | 1 +
cake/libs/controller/controller.php | 14 --------------
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index e337b9715..e4ffb2dc6 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -30,6 +30,7 @@
*
* @package cake.libs.controller.components.auth
* @since 2.0
+ * @see AuthComponent::$authenticate
*/
class FormAuthenticate {
diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php
index 3929d7ed9..521b47503 100644
--- a/cake/libs/controller/controller.php
+++ b/cake/libs/controller/controller.php
@@ -756,20 +756,6 @@ class Controller extends Object {
return call_user_func_array(array(&$this, $action), $args);
}
-/**
- * Controller callback to tie into Auth component.
- * Only called when AuthComponent::$authorize is set to 'controller'.
- *
- * @return bool true if authorized, false otherwise
- * @link http://book.cakephp.org/view/1275/authorize
- */
- public function isAuthorized() {
- trigger_error(sprintf(
- __('%sController::isAuthorized() is not defined.'), $this->name
- ), E_USER_WARNING);
- return false;
- }
-
/**
* Returns number of errors in a submitted FORM.
*
From 16b3beec5ef4e0fcf47b5a87857d2bea01a9e301 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 2 Jan 2011 13:35:43 -0500
Subject: [PATCH 230/668] Starting ControllerAuthorize adding it and the test
cases.
---
.../components/auth/controller_authorize.php | 52 ++++++++++++++++
.../auth/controller_authorize.test.php | 62 +++++++++++++++++++
2 files changed, 114 insertions(+)
create mode 100644 cake/libs/controller/components/auth/controller_authorize.php
create mode 100644 cake/tests/cases/libs/controller/components/auth/controller_authorize.test.php
diff --git a/cake/libs/controller/components/auth/controller_authorize.php b/cake/libs/controller/components/auth/controller_authorize.php
new file mode 100644
index 000000000..ed78ac5bd
--- /dev/null
+++ b/cake/libs/controller/components/auth/controller_authorize.php
@@ -0,0 +1,52 @@
+controller($controller);
+ }
+
+/**
+ * Checks user authorization using a controller callback.
+ *
+ * @param array $user Active user data
+ * @param CakeRequest $request
+ * @return boolean
+ */
+ public function authorize($user, CakeRequest $request) {
+ return (bool) $this->_controller->isAuthorized($user);
+ }
+
+/**
+ * Accessor to the controller object.
+ *
+ * @param mixed $controller null to get, a controller to set.
+ * @return mixed.
+ */
+ public function controller($controller = null) {
+ if ($controller) {
+ if (!$controller instanceof Controller) {
+ throw new CakeException(__('$controller needs to be an instance of Controller'));
+ }
+ if (!method_exists($controller, 'isAuthorized')) {
+ throw new CakeException(__('$controller does not implement an isAuthorized() method.'));
+ }
+ $this->_controller = $controller;
+ return true;
+ }
+ return $this->_controller;
+ }
+}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth/controller_authorize.test.php b/cake/tests/cases/libs/controller/components/auth/controller_authorize.test.php
new file mode 100644
index 000000000..9863d23de
--- /dev/null
+++ b/cake/tests/cases/libs/controller/components/auth/controller_authorize.test.php
@@ -0,0 +1,62 @@
+controller = $this->getMock('Controller', array('isAuthorized'), array(), '', false);
+ $this->auth = new ControllerAuthorize($this->controller);
+ }
+
+/**
+ *
+ * @expectedException CakeException
+ */
+ function testControllerTypeError() {
+ $this->auth->controller(new StdClass());
+ }
+
+/**
+ * @expectedException CakeException
+ */
+ function testControllerErrorOnMissingMethod() {
+ $this->auth->controller(new Controller());
+ }
+
+/**
+ * test failure
+ *
+ * @return void
+ */
+ function testAuthorizeFailure() {
+ $user = array();
+ $request = new CakeRequest('/posts/index', false);
+ $this->assertFalse($this->auth->authorize($user, $request));
+ }
+
+/**
+ * test isAuthorized working.
+ *
+ * @return void
+ */
+ function testAuthorizeSuccess() {
+ $user = array('User' => array('username' => 'mark'));
+ $request = new CakeRequest('/posts/index', false);
+
+ $this->controller->expects($this->once())
+ ->method('isAuthorized')
+ ->with($user)
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($this->auth->authorize($user, $request));
+ }
+}
From 67c9acbc94c5399f27cdf801d2492a7fe71af6b0 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 2 Jan 2011 13:39:48 -0500
Subject: [PATCH 231/668] Adding a doc block.
---
.../components/auth/controller_authorize.php | 34 ++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth/controller_authorize.php b/cake/libs/controller/components/auth/controller_authorize.php
index ed78ac5bd..eea082111 100644
--- a/cake/libs/controller/components/auth/controller_authorize.php
+++ b/cake/libs/controller/components/auth/controller_authorize.php
@@ -1,6 +1,38 @@
request->params['admin'])) {
+ * return $user['role'] == 'admin';
+ * }
+ * return !empty($user);
+ * }
+ * }}}
+ *
+ * the above is simple implementation that would only authorize users of the 'admin' role to access
+ * admin routing.
+ *
+ * @package cake.libs.controller.components.auth
+ * @since 2.0
+ * @see AuthComponent::$authenticate
+ */
class ControllerAuthorize {
/**
* Controller for the request.
From 4058e7f48c54c8d4040cae097c483b76e5f6ee29 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 2 Jan 2011 14:23:43 -0500
Subject: [PATCH 232/668] Extracting a base class, as it will be needed. Moving
AuthComponent::action() into the authorize object base as that's where its
used.
---
.../components/auth/base_authorize.php | 90 +++++++++++++++++++
.../components/auth/controller_authorize.php | 43 +++------
2 files changed, 102 insertions(+), 31 deletions(-)
create mode 100644 cake/libs/controller/components/auth/base_authorize.php
diff --git a/cake/libs/controller/components/auth/base_authorize.php b/cake/libs/controller/components/auth/base_authorize.php
new file mode 100644
index 000000000..a7828eae5
--- /dev/null
+++ b/cake/libs/controller/components/auth/base_authorize.php
@@ -0,0 +1,90 @@
+action();
+ *
+ * @var string
+ */
+ public $actionPath = null;
+
+/**
+ * Constructor
+ *
+ * @param Controller $controller The controller for this request.
+ * @param string $settings An array of settings. This class does not use any settings.
+ */
+ public function __construct(Controller $controller, $settings = array()) {
+ $this->controller($controller);
+ }
+
+/**
+ * Checks user authorization.
+ *
+ * @param array $user Active user data
+ * @param CakeRequest $request
+ * @return boolean
+ */
+ abstract public function authorize($user, CakeRequest $request);
+
+/**
+ * Accessor to the controller object.
+ *
+ * @param mixed $controller null to get, a controller to set.
+ * @return mixed.
+ */
+ public function controller($controller = null) {
+ if ($controller) {
+ if (!$controller instanceof Controller) {
+ throw new CakeException(__('$controller needs to be an instance of Controller'));
+ }
+ $this->_controller = $controller;
+ return true;
+ }
+ return $this->_controller;
+ }
+
+/**
+ * Get the action path for a given request. Primarily used by authorize objects
+ * that need to get information about the plugin, controller, and action being invoked.
+ *
+ * @param CakeRequest $request The request a path is needed for.
+ * @return string the action path for the given request.
+ */
+ public function action($request, $path = '/:plugin/:controller/:action') {
+ $plugin = empty($request['plugin']) ? null : Inflector::camelize($request['plugin']) . '/';
+ return str_replace(
+ array(':controller', ':action', ':plugin/'),
+ array(Inflector::camelize($request['controller']), $request['action'], $plugin),
+ $this->actionPath . $path
+ );
+ }
+}
\ No newline at end of file
diff --git a/cake/libs/controller/components/auth/controller_authorize.php b/cake/libs/controller/components/auth/controller_authorize.php
index eea082111..720242e0b 100644
--- a/cake/libs/controller/components/auth/controller_authorize.php
+++ b/cake/libs/controller/components/auth/controller_authorize.php
@@ -12,6 +12,7 @@
* @link http://cakephp.org CakePHP(tm) Project
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::import('Component', 'auth/base_authorize');
/**
* An authorization adapter for AuthComponent. Provides the ability to authorize using a controller callback.
@@ -33,22 +34,21 @@
* @since 2.0
* @see AuthComponent::$authenticate
*/
-class ControllerAuthorize {
-/**
- * Controller for the request.
- *
- * @var Controller
- */
- protected $_controller = null;
+class ControllerAuthorize extends BaseAuthorize {
/**
- * Constructor
+ * Get/set the controller this authorize object will be working with. Also checks that isAuthorized is implemented.
*
- * @param Controller $controller The controller for this request.
- * @param string $settings An array of settings. This class does not use any settings.
+ * @param mixed $controller null to get, a controller to set.
+ * @return mixed.
*/
- public function __construct(Controller $controller, $settings = array()) {
- $this->controller($controller);
+ public function controller($controller = null) {
+ if ($controller) {
+ if (!method_exists($controller, 'isAuthorized')) {
+ throw new CakeException(__('$controller does not implement an isAuthorized() method.'));
+ }
+ }
+ return parent::controller($controller);
}
/**
@@ -62,23 +62,4 @@ class ControllerAuthorize {
return (bool) $this->_controller->isAuthorized($user);
}
-/**
- * Accessor to the controller object.
- *
- * @param mixed $controller null to get, a controller to set.
- * @return mixed.
- */
- public function controller($controller = null) {
- if ($controller) {
- if (!$controller instanceof Controller) {
- throw new CakeException(__('$controller needs to be an instance of Controller'));
- }
- if (!method_exists($controller, 'isAuthorized')) {
- throw new CakeException(__('$controller does not implement an isAuthorized() method.'));
- }
- $this->_controller = $controller;
- return true;
- }
- return $this->_controller;
- }
}
\ No newline at end of file
From 7207dccc7cebd641913796ff0270ff451818cfa5 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 2 Jan 2011 14:24:25 -0500
Subject: [PATCH 233/668] Adding ActionsAuthorize. It implements using Acl as
the authorization object.
---
.../components/auth/actions_authorize.php | 39 ++++++
.../auth/actions_authorize.test.php | 130 ++++++++++++++++++
2 files changed, 169 insertions(+)
create mode 100644 cake/libs/controller/components/auth/actions_authorize.php
create mode 100644 cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
diff --git a/cake/libs/controller/components/auth/actions_authorize.php b/cake/libs/controller/components/auth/actions_authorize.php
new file mode 100644
index 000000000..7f4f722d7
--- /dev/null
+++ b/cake/libs/controller/components/auth/actions_authorize.php
@@ -0,0 +1,39 @@
+_controller->Components->load('Acl');
+ return $Acl->check($user, $this->action($request));
+ }
+}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php b/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
new file mode 100644
index 000000000..5aedbda04
--- /dev/null
+++ b/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
@@ -0,0 +1,130 @@
+controller = $this->getMock('Controller', array(), array(), '', false);
+ $this->Acl = $this->getMock('AclComponent', array(), array(), '', false);
+ $this->controller->Components = $this->getMock('ComponentCollection');
+
+ $this->auth = new ActionsAuthorize($this->controller);
+ $this->auth->actionPath = '/controllers';
+ }
+
+/**
+ * setup the mock acl.
+ *
+ * @return void
+ */
+ protected function _mockAcl() {
+ $this->controller->Components->expects($this->any())
+ ->method('load')
+ ->with('Acl')
+ ->will($this->returnValue($this->Acl));
+ }
+
+/**
+ * test failure
+ *
+ * @return void
+ */
+ function testAuthorizeFailure() {
+ $user = array(
+ 'User' => array(
+ 'id' => 1,
+ 'user' => 'mariano'
+ )
+ );
+ $request = new CakeRequest('/posts/index', false);
+ $request->addParams(array(
+ 'plugin' => null,
+ 'controller' => 'posts',
+ 'action' => 'index'
+ ));
+
+ $this->_mockAcl();
+
+ $this->Acl->expects($this->once())
+ ->method('check')
+ ->with($user, '/controllers/Posts/index')
+ ->will($this->returnValue(false));
+
+ $this->assertFalse($this->auth->authorize($user, $request));
+ }
+
+/**
+ * test isAuthorized working.
+ *
+ * @return void
+ */
+ function testAuthorizeSuccess() {
+ $user = array(
+ 'User' => array(
+ 'id' => 1,
+ 'user' => 'mariano'
+ )
+ );
+ $request = new CakeRequest('/posts/index', false);
+ $request->addParams(array(
+ 'plugin' => null,
+ 'controller' => 'posts',
+ 'action' => 'index'
+ ));
+
+ $this->_mockAcl();
+
+ $this->Acl->expects($this->once())
+ ->method('check')
+ ->with($user, '/controllers/Posts/index')
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($this->auth->authorize($user, $request));
+ }
+
+/**
+ * test action()
+ *
+ * @return void
+ */
+ function testActionMethod() {
+ $request = new CakeRequest('/posts/index', false);
+ $request->addParams(array(
+ 'plugin' => null,
+ 'controller' => 'posts',
+ 'action' => 'index'
+ ));
+
+ $result = $this->auth->action($request);
+
+ $this->assertEquals('/controllers/Posts/index', $result);
+ }
+
+/**
+ * test action() and plugins
+ *
+ * @return void
+ */
+ function testActionWithPlugin() {
+ $request = new CakeRequest('/debug_kit/posts/index', false);
+ $request->addParams(array(
+ 'plugin' => 'debug_kit',
+ 'controller' => 'posts',
+ 'action' => 'index'
+ ));
+
+ $result = $this->auth->action($request);
+ $this->assertEquals('/controllers/DebugKit/Posts/index', $result);
+ }
+}
From 2e9d9479a6b4361745919b1f1c7692c95bc90f1d Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 3 Jan 2011 01:49:06 -0500
Subject: [PATCH 234/668] Moving another part of AuthComponent's authorize
strategies into BaseAuthorize. Implementing CrudAuthorize and adding tests
for it.
---
.../components/auth/base_authorize.php | 37 +++++
.../components/auth/crud_authorize.php | 59 +++++++
.../components/auth/crud_authorize.test.php | 149 ++++++++++++++++++
3 files changed, 245 insertions(+)
create mode 100644 cake/libs/controller/components/auth/crud_authorize.php
create mode 100644 cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
diff --git a/cake/libs/controller/components/auth/base_authorize.php b/cake/libs/controller/components/auth/base_authorize.php
index a7828eae5..cc19acb26 100644
--- a/cake/libs/controller/components/auth/base_authorize.php
+++ b/cake/libs/controller/components/auth/base_authorize.php
@@ -36,6 +36,21 @@ abstract class BaseAuthorize {
*/
public $actionPath = null;
+/**
+ * Action -> crud mappings. Used by authorization objects that want to map actions to CRUD roles.
+ *
+ * @var array
+ * @see CrudAuthorize
+ */
+ protected $_actionMap = array(
+ 'index' => 'read',
+ 'add' => 'create',
+ 'edit' => 'update',
+ 'view' => 'read',
+ 'delete' => 'delete',
+ 'remove' => 'delete'
+ );
+
/**
* Constructor
*
@@ -87,4 +102,26 @@ abstract class BaseAuthorize {
$this->actionPath . $path
);
}
+
+/**
+ * Maps crud actions to actual controller names. Used to modify or get the current mapped actions.
+ *
+ * @param mixed $map Either an array of mappings, or undefined to get current values.
+ * @return mixed Either the current mappings or null when setting.
+ */
+ public function mapActions($map = array()) {
+ if (empty($map)) {
+ return $this->_actionMap;
+ }
+ $crud = array('create', 'read', 'update', 'delete');
+ foreach ($map as $action => $type) {
+ if (in_array($action, $crud) && is_array($type)) {
+ foreach ($type as $typedAction) {
+ $this->_actionMap[$typedAction] = $action;
+ }
+ } else {
+ $this->_actionMap[$action] = $type;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/cake/libs/controller/components/auth/crud_authorize.php b/cake/libs/controller/components/auth/crud_authorize.php
new file mode 100644
index 000000000..5e6c9c85c
--- /dev/null
+++ b/cake/libs/controller/components/auth/crud_authorize.php
@@ -0,0 +1,59 @@
+_actionMap[$request->params['action']])) {
+ trigger_error(__(
+ 'CrudAuthorize::authorize() - Attempted access of un-mapped action "%1$s" in controller "%2$s"',
+ $request->action,
+ $request->controller
+ ),
+ E_USER_WARNING
+ );
+ return false;
+ }
+ $Acl = $this->_controller->Components->load('Acl');
+ return $Acl->check(
+ $user,
+ $this->action($request, ':controller'),
+ $this->_actionMap[$request->params['action']]
+ );
+ }
+}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php b/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
new file mode 100644
index 000000000..684fc4b97
--- /dev/null
+++ b/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
@@ -0,0 +1,149 @@
+controller = $this->getMock('Controller', array(), array(), '', false);
+ $this->Acl = $this->getMock('AclComponent', array(), array(), '', false);
+ $this->controller->Components = $this->getMock('ComponentCollection');
+
+ $this->auth = new CrudAuthorize($this->controller);
+ }
+
+/**
+ * setup the mock acl.
+ *
+ * @return void
+ */
+ protected function _mockAcl() {
+ $this->controller->Components->expects($this->any())
+ ->method('load')
+ ->with('Acl')
+ ->will($this->returnValue($this->Acl));
+ }
+
+/**
+ * test authorize() without a mapped action, ensure an error is generated.
+ *
+ * @expectedException Exception
+ * @return void
+ */
+ function testAuthorizeNoMappedAction() {
+ $request = new CakeRequest('/posts/foobar', false);
+ $request->addParams(array(
+ 'controller' => 'posts',
+ 'action' => 'foobar'
+ ));
+ $user = array('User' => array('user' => 'mark'));
+
+ $this->auth->authorize($user, $request);
+ }
+
+/**
+ * test check() passing
+ *
+ * @return void
+ */
+ function testAuthorizeCheckSuccess() {
+ $request = new CakeRequest('posts/index', false);
+ $request->addParams(array(
+ 'controller' => 'posts',
+ 'action' => 'index'
+ ));
+ $user = array('User' => array('user' => 'mark'));
+
+ $this->_mockAcl();
+ $this->Acl->expects($this->once())
+ ->method('check')
+ ->with($user, 'Posts', 'read')
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($this->auth->authorize($user, $request));
+ }
+
+/**
+ * test check() failing
+ *
+ * @return void
+ */
+ function testAuthorizeCheckFailure() {
+ $request = new CakeRequest('posts/index', false);
+ $request->addParams(array(
+ 'controller' => 'posts',
+ 'action' => 'index'
+ ));
+ $user = array('User' => array('user' => 'mark'));
+
+ $this->_mockAcl();
+ $this->Acl->expects($this->once())
+ ->method('check')
+ ->with($user, 'Posts', 'read')
+ ->will($this->returnValue(false));
+
+ $this->assertFalse($this->auth->authorize($user, $request));
+ }
+
+
+/**
+ * test getting actionMap
+ *
+ * @return void
+ */
+ function testMapActionsGet() {
+ $result = $this->auth->mapActions();
+ $expected = array(
+ 'index' => 'read',
+ 'add' => 'create',
+ 'edit' => 'update',
+ 'view' => 'read',
+ 'delete' => 'delete',
+ 'remove' => 'delete'
+ );
+ $this->assertEquals($expected, $result);
+ }
+
+/**
+ * test adding into mapActions
+ *
+ * @return void
+ */
+ function testMapActionsSet() {
+ $map = array(
+ 'create' => array('generate'),
+ 'read' => array('listing', 'show'),
+ 'update' => array('update'),
+ 'random' => 'custom'
+ );
+ $result = $this->auth->mapActions($map);
+ $this->assertNull($result);
+
+ $result = $this->auth->mapActions();
+ $expected = array(
+ 'index' => 'read',
+ 'add' => 'create',
+ 'edit' => 'update',
+ 'view' => 'read',
+ 'delete' => 'delete',
+ 'remove' => 'delete',
+ 'generate' => 'create',
+ 'listing' => 'read',
+ 'show' => 'read',
+ 'update' => 'update',
+ 'random' => 'custom'
+ );
+ $this->assertEquals($expected, $result);
+ }
+
+}
From 5ae194ec905d28d52a21a6b96a9ed00254caa7bb Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 3 Jan 2011 12:58:49 -0500
Subject: [PATCH 235/668] Updating group test case, and fixing test case
classname.
---
cake/tests/cases/libs/all_components.test.php | 1 +
.../libs/controller/components/auth/crud_authorize.test.php | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/cake/tests/cases/libs/all_components.test.php b/cake/tests/cases/libs/all_components.test.php
index 28e59aadf..480c93219 100644
--- a/cake/tests/cases/libs/all_components.test.php
+++ b/cake/tests/cases/libs/all_components.test.php
@@ -37,6 +37,7 @@ class AllComponentsTest extends PHPUnit_Framework_TestSuite {
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component.test.php');
$suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component_collection.test.php');
$suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components');
+ $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components' . DS . 'auth');
return $suite;
}
}
diff --git a/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php b/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
index 684fc4b97..6382bed4f 100644
--- a/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
@@ -6,7 +6,7 @@ App::import('Component', 'Acl');
App::import('Core', 'CakeRequest');
App::import('Core', 'Controller');
-class ActionsAuthorizeTest extends CakeTestCase {
+class CrudAuthorizeTest extends CakeTestCase {
/**
* setup
From ca9aabdfec3da8c0cd2b10ffa31f3e7f1d5a0636 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 3 Jan 2011 13:00:06 -0500
Subject: [PATCH 236/668] Adding file headers.
---
.../components/auth/actions_authorize.test.php | 15 ++++++++++++++-
.../components/auth/controller_authorize.test.php | 15 ++++++++++++++-
.../components/auth/crud_authorize.test.php | 15 ++++++++++++++-
.../components/auth/form_authenticate.test.php | 14 ++++++++++++++
4 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php b/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
index 5aedbda04..7af508c9c 100644
--- a/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
@@ -1,5 +1,18 @@
Date: Mon, 3 Jan 2011 16:48:16 -0500
Subject: [PATCH 237/668] Starting to integrate Authorization objects into
AuthComponent. Tests updated and duplicate tests skipped, they will
eventually be removed when duplication is confirmed.
---
cake/libs/controller/components/auth.php | 153 +++++-------------
.../libs/controller/components/auth.test.php | 58 ++++++-
2 files changed, 99 insertions(+), 112 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 063960f91..c6429a419 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -21,6 +21,7 @@
App::import('Core', 'Router', false);
App::import('Core', 'Security', false);
+App::import('Component', 'auth/base_authorize');
/**
* Authentication control component class
@@ -67,6 +68,13 @@ class AuthComponent extends Component {
*/
public $authorize = false;
+/**
+ * Objects that will be used for authorization checks.
+ *
+ * @var array
+ */
+ protected $_authorizeObjects = array();
+
/**
* The name of an optional view element to render when an Ajax request is made
* with an invalid or expired session
@@ -400,42 +408,8 @@ class AuthComponent extends Component {
if (!$this->authorize) {
return true;
}
-
- extract($this->__authType());
- switch ($type) {
- case 'controller':
- $this->object = $controller;
- break;
- case 'crud':
- case 'actions':
- if (isset($controller->Acl)) {
- $this->Acl = $controller->Acl;
- } else {
- trigger_error(__('Could not find AclComponent. Please include Acl in Controller::$components.'), E_USER_WARNING);
- }
- break;
- case 'model':
- if (!isset($object)) {
- $hasModel = (
- isset($controller->{$controller->modelClass}) &&
- is_object($controller->{$controller->modelClass})
- );
- $isUses = (
- !empty($controller->uses) && isset($controller->{$controller->uses[0]}) &&
- is_object($controller->{$controller->uses[0]})
- );
-
- if ($hasModel) {
- $object = $controller->modelClass;
- } elseif ($isUses) {
- $object = $controller->uses[0];
- }
- }
- $type = array('model' => $object);
- break;
- }
-
- if ($this->isAuthorized($type)) {
+
+ if ($this->isAuthorized()) {
return true;
}
@@ -478,91 +452,48 @@ class AuthComponent extends Component {
}
/**
- * Determines whether the given user is authorized to perform an action. The type of
- * authorization used is based on the value of AuthComponent::$authorize or the
- * passed $type param.
+ * Uses the configured Authorization adapters to check whether or not a user is authorized.
+ * Each adapter will be checked in sequence, if any of them return true, then the user will
+ * be authorized for the request.
*
- * Types:
- * 'controller' will validate against Controller::isAuthorized() if controller instance is
- * passed in $object
- * 'actions' will validate Controller::action against an AclComponent::check()
- * 'crud' will validate mapActions against an AclComponent::check()
- * array('model'=> 'name'); will validate mapActions against model
- * $name::isAuthorized(user, controller, mapAction)
- * 'object' will validate Controller::action against
- * object::isAuthorized(user, controller, action)
- *
- * @param string $type Type of authorization
- * @param mixed $object object, model object, or model name
- * @param mixed $user The user to check the authorization of
+ * @param mixed $user The user to check the authorization of, if empty the user in the session will be used.
* @return boolean True if $user is authorized, otherwise false
*/
- public function isAuthorized($type = null, $object = null, $user = null) {
+ public function isAuthorized($user = null) {
if (empty($user) && !$this->user()) {
return false;
} elseif (empty($user)) {
$user = $this->user();
}
-
- extract($this->__authType($type));
-
- if (!$object) {
- $object = $this->object;
- }
-
- $valid = false;
- switch ($type) {
- case 'controller':
- $valid = $object->isAuthorized();
- break;
- case 'actions':
- $valid = $this->Acl->check($user, $this->action());
- break;
- case 'crud':
- if (!isset($this->actionMap[$this->request['action']])) {
- trigger_error(
- __('Auth::startup() - Attempted access of un-mapped action "%1$s" in controller "%2$s"', $this->request['action'], $this->request['controller']),
- E_USER_WARNING
- );
- } else {
- $valid = $this->Acl->check(
- $user,
- $this->action(':controller'),
- $this->actionMap[$this->request['action']]
- );
- }
- break;
- case 'model':
- $action = $this->request['action'];
- if (isset($this->actionMap[$action])) {
- $action = $this->actionMap[$action];
- }
- if (is_string($object)) {
- $object = $this->getModel($object);
- }
- case 'object':
- if (!isset($action)) {
- $action = $this->action(':action');
- }
- if (empty($object)) {
- trigger_error(__('Could not find %s. Set AuthComponent::$object in beforeFilter() or pass a valid object', get_class($object)), E_USER_WARNING);
- return;
- }
- if (method_exists($object, 'isAuthorized')) {
- $valid = $object->isAuthorized($user, $this->action(':controller'), $action);
- } elseif ($object) {
- trigger_error(__('%s::isAuthorized() is not defined.', get_class($object)), E_USER_WARNING);
- }
- break;
- case null:
- case false:
+ $this->loadAuthorizeObjects();
+ foreach ($this->_authorizeObjects as $authorizer) {
+ if ($authorizer->authorize($user, $this->request) === true) {
return true;
- break;
- default:
- trigger_error(__('Auth::isAuthorized() - $authorize is set to an incorrect value. Allowed settings are: "actions", "crud", "model" or null.'), E_USER_WARNING);
- break;
+ }
}
- return $valid;
+ return false;
+ }
+
+/**
+ * Loads the authorization objects configured.
+ *
+ * @return mixed Either null when authorize is empty, or the loaded authorization objects.
+ */
+ public function loadAuthorizeObjects() {
+ if (empty($this->authorize)) {
+ return;
+ }
+ foreach (Set::normalize($this->authorize) as $class => $settings) {
+ $className = $class . 'Authorize';
+ if (!class_exists($className) && !App::import('Component', 'auth/' . $class . '_authorize')) {
+ throw new CakeException(__('Authorization adapter "%s" was not found.', $class));
+ }
+ if (!method_exists($className, 'authorize')) {
+ throw new CakeException(__('Authorization objects must implement an authorize method.'));
+ }
+ $this->_authorizeObjects[] = new $className($this->_Collection->getController(), $settings);
+ }
+ return $this->_authorizeObjects;
}
/**
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 371edd2ed..54689c841 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -54,6 +54,7 @@ class TestAuthComponent extends AuthComponent {
function _stop($status = 0) {
$this->testStop = true;
}
+
}
/**
@@ -684,6 +685,8 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeController() {
+ $this->markTestSkipped('This is already tested in ControllerAuthorizeTest');
+
$this->AuthUser = new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
@@ -708,6 +711,8 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeModel() {
+ $this->markTestSkipped('This is not implemented');
+
$this->AuthUser = new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
@@ -734,6 +739,8 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeCrud() {
+ $this->markTestSkipped('This is already tested in CrudAuthorizeTest');
+
$this->AuthUser = new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
@@ -795,6 +802,8 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeActions() {
+ $this->markTestSkipped('This is already tested in ActionsAuthorizeTest');
+
$this->AuthUser = new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
@@ -816,6 +825,49 @@ class AuthTest extends CakeTestCase {
$this->assertTrue($this->Controller->Auth->isAuthorized());
}
+/**
+ * @expectedException CakeException
+ * @return void
+ */
+ function testIsAuthorizedMissingFile() {
+ $this->Controller->Auth->authorize = 'Missing';
+ $this->Controller->Auth->isAuthorized(array('User' => array('id' => 1)));
+ }
+
+/**
+ * test that isAuthroized calls methods correctly
+ *
+ * @return void
+ */
+ function testIsAuthorizedDelegation() {
+ $this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockOneAuthorize', false);
+ $this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockTwoAuthorize', false);
+ $this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockThreeAuthorize', false);
+
+ $this->Controller->Auth->authorize = array(
+ 'AuthMockOne',
+ 'AuthMockTwo',
+ 'AuthMockThree'
+ );
+ $mocks = $this->Controller->Auth->loadAuthorizeObjects();
+
+ $this->assertEquals(3, count($mocks));
+ $mocks[0]->expects($this->once())
+ ->method('authorize')
+ ->with(array('User'))
+ ->will($this->returnValue(false));
+
+ $mocks[1]->expects($this->once())
+ ->method('authorize')
+ ->with(array('User'))
+ ->will($this->returnValue(true));
+
+ $mocks[2]->expects($this->never())
+ ->method('authorize');
+
+ $this->assertTrue($this->Controller->Auth->isAuthorized(array('User')));
+ }
+
/**
* Tests that deny always takes precedence over allow
*
@@ -1136,6 +1188,8 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testEmptyUsernameOrPassword() {
+ $this->markTestSkipped('This is already tested in FormAuthenticateTest');
+
$this->AuthUser = new AuthUser();
$user['id'] = 1;
$user['username'] = 'mariano';
@@ -1168,6 +1222,8 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testInjection() {
+ $this->markTestSkipped('This is already tested in FormAuthenticateTest');
+
$this->AuthUser = new AuthUser();
$this->AuthUser->id = 2;
$this->AuthUser->saveField('password', Security::hash(Configure::read('Security.salt') . 'cake'));
@@ -1326,6 +1382,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testCustomField() {
+ $this->markTestSkipped('This is already tested in FormAuthenticateTest');
Router::reload();
$this->AuthUserCustomField = new AuthUserCustomField();
@@ -1544,7 +1601,6 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testComponentSettings() {
-
$request = new CakeRequest(null, false);
$this->Controller = new AuthTestController($request);
From ced832ba62012e1fe40bde834bbf4a8872234d1f Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 3 Jan 2011 18:17:27 -0500
Subject: [PATCH 238/668] Fixing issues with FormAuthenticate and plugin
models.
---
.../components/auth/form_authenticate.php | 18 +++++----
.../auth/form_authenticate.test.php | 39 ++++++++++++++++++-
2 files changed, 48 insertions(+), 9 deletions(-)
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index e4ffb2dc6..d536499b5 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -72,19 +72,21 @@ class FormAuthenticate {
*/
public function authenticate(CakeRequest $request) {
$userModel = $this->settings['userModel'];
+ list($plugin, $model) = pluginSplit($userModel);
+
$fields = $this->settings['fields'];
- if (empty($request->data[$userModel])) {
+ if (empty($request->data[$model])) {
return false;
}
if (
- empty($request->data[$userModel][$fields['username']]) ||
- empty($request->data[$userModel][$fields['password']])
+ empty($request->data[$model][$fields['username']]) ||
+ empty($request->data[$model][$fields['password']])
) {
return false;
}
$conditions = array(
- $userModel . '.' . $fields['username'] => $request->data[$userModel][$fields['username']],
- $userModel . '.' . $fields['password'] => $request->data[$userModel][$fields['password']],
+ $model . '.' . $fields['username'] => $request->data[$model][$fields['username']],
+ $model . '.' . $fields['password'] => $request->data[$model][$fields['password']],
);
if (!empty($this->settings['scope'])) {
$conditions = array_merge($conditions, $this->settings['scope']);
@@ -93,10 +95,10 @@ class FormAuthenticate {
'conditions' => $conditions,
'recursive' => 0
));
- if (empty($result) || empty($result[$userModel])) {
+ if (empty($result) || empty($result[$model])) {
return false;
}
- unset($result[$userModel][$fields['password']]);
- return $result[$userModel];
+ unset($result[$model][$fields['password']]);
+ return $result[$model];
}
}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
index fe6547251..0c5e36a18 100644
--- a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
@@ -28,7 +28,7 @@ require_once CAKE_TESTS . 'cases' . DS . 'libs' . DS . 'model' . DS . 'models.p
*/
class FormAuthenticateTest extends CakeTestCase {
- public $fixtures = array('core.user');
+ public $fixtures = array('core.user', 'core.auth_user');
/**
* setup
@@ -144,4 +144,41 @@ class FormAuthenticateTest extends CakeTestCase {
$this->assertFalse($this->auth->authenticate($request));
}
+/**
+ * test a model in a plugin.
+ *
+ * @return void
+ */
+ function testPluginModel() {
+ Cache::delete('object_map', '_cake_core_');
+ App::build(array(
+ 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
+ ), true);
+ App::objects('plugin', null, false);
+
+ $PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser');
+ $user['id'] = 1;
+ $user['username'] = 'gwoo';
+ $user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
+ $PluginModel->save($user, false);
+
+ $this->auth->settings['userModel'] = 'TestPlugin.TestPluginAuthUser';
+ $this->auth->settings['fields']['username'] = 'username';
+
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('TestPluginAuthUser' => array(
+ 'username' => 'gwoo',
+ 'password' => Security::hash('cake', null, true)
+ ));
+
+ $result = $this->auth->authenticate($request);
+ $expected = array(
+ 'id' => 1,
+ 'username' => 'gwoo',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => date('Y-m-d H:i:s')
+ );
+ $this->assertEquals($expected, $result);
+ }
+
}
\ No newline at end of file
From 3f9c83c43d2d2b8b9086cec83d7f3ce19d9e4b36 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 3 Jan 2011 18:18:42 -0500
Subject: [PATCH 239/668] Authentication and Authorization objects are
integrated with AuthComponent. Minimal App changes are needed as legacy
settings are forwarded.
---
cake/libs/controller/components/auth.php | 167 ++++++++----------
.../libs/controller/components/auth.test.php | 103 ++++++++---
2 files changed, 158 insertions(+), 112 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index c6429a419..a7993c249 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -48,20 +48,36 @@ class AuthComponent extends Component {
public $components = array('Session', 'RequestHandler');
/**
- * A reference to the object used for authentication
+ * An array of authentication objects to use for authenticating users. You can configure
+ * multiple adapters and they will be checked sequentially when users are identified.
*
* @var object
* @link http://book.cakephp.org/view/1278/authenticate
*/
- public $authenticate = null;
+ public $authenticate = array('Form');
/**
- * The name of the component to use for Authorization or set this to
- * 'controller' will validate against Controller::isAuthorized()
- * 'actions' will validate Controller::action against an AclComponent::check()
- * 'crud' will validate mapActions against an AclComponent::check()
- * array('model'=> 'name'); will validate mapActions against model $name::isAuthorized(user, controller, mapAction)
- * 'object' will validate Controller::action against object::isAuthorized(user, controller, action)
+ * Objects that will be used for authentication checks.
+ *
+ * @var array
+ */
+ protected $_authenticateObjects = array();
+
+/**
+ * A hash mapping legacy properties => to settings passed into Authenticate objects.
+ *
+ * @var string
+ * @deprecated Will be removed in 2.1+
+ */
+ protected $_authenticateLegacyMap = array(
+ 'userModel' => 'userModel',
+ 'userScope' => 'scope',
+ 'fields' => 'fields'
+ );
+
+/**
+ * An array of authorization objects to use for authorizing users. You can configure
+ * multiple adapters and they will be checked sequentially when authorization checks are done.
*
* @var mixed
* @link http://book.cakephp.org/view/1275/authorize
@@ -363,15 +379,7 @@ class AuthComponent extends Component {
!empty($request->data[$model->alias][$this->fields['password']]);
if ($isValid) {
- $username = $request->data[$model->alias][$this->fields['username']];
- $password = $request->data[$model->alias][$this->fields['password']];
-
- $data = array(
- $model->alias . '.' . $this->fields['username'] => $username,
- $model->alias . '.' . $this->fields['password'] => $password
- );
-
- if ($this->login($data)) {
+ if ($this->login()) {
if ($this->autoRedirect) {
$controller->redirect($this->redirect(), null, true);
}
@@ -456,18 +464,24 @@ class AuthComponent extends Component {
* Each adapter will be checked in sequence, if any of them return true, then the user will
* be authorized for the request.
*
- * @param mixed $user The user to check the authorization of, if empty the user in the session will be used.
+ * @param mixed $user The user to check the authorization of. If empty the user in the session will be used.
+ * @param CakeRequest $request The request to authenticate for. If empty, the current request will be used.
* @return boolean True if $user is authorized, otherwise false
*/
- public function isAuthorized($user = null) {
+ public function isAuthorized($user = null, $request = null) {
if (empty($user) && !$this->user()) {
return false;
} elseif (empty($user)) {
$user = $this->user();
}
- $this->loadAuthorizeObjects();
+ if (empty($request)) {
+ $request = $this->request;
+ }
+ if (empty($this->_authorizeObjects)) {
+ $this->loadAuthorizeObjects();
+ }
foreach ($this->_authorizeObjects as $authorizer) {
- if ($authorizer->authorize($user, $this->request) === true) {
+ if ($authorizer->authorize($user, $request) === true) {
return true;
}
}
@@ -483,6 +497,7 @@ class AuthComponent extends Component {
if (empty($this->authorize)) {
return;
}
+ $this->_authorizeObjects = array();
foreach (Set::normalize($this->authorize) as $class => $settings) {
$className = $class . 'Authorize';
if (!class_exists($className) && !App::import('Component', 'auth/' . $class . '_authorize')) {
@@ -596,15 +611,14 @@ class AuthComponent extends Component {
* @return boolean True on login success, false on failure
* @link http://book.cakephp.org/view/1261/login
*/
- public function login($data = null) {
+ public function login($request = null) {
$this->__setDefaults();
$this->_loggedIn = false;
- if (empty($data)) {
- $data = $this->data;
+ if (empty($request)) {
+ $request = $this->request;
}
-
- if ($user = $this->identify($data)) {
+ if ($user = $this->identify($request)) {
$this->Session->write($this->sessionKey, $user);
$this->_loggedIn = true;
}
@@ -739,80 +753,51 @@ class AuthComponent extends Component {
}
/**
- * Identifies a user based on specific criteria.
+ * Use the configured authentication adapters, and attempt to identify the user
+ * by credentials contained in $request.
*
- * @param mixed $user Optional. The identity of the user to be validated.
- * Uses the current user session if none specified.
- * @param array $conditions Optional. Additional conditions to a find.
- * @return array User record data, or null, if the user could not be identified.
+ * @param CakeRequest $request The request that contains authentication data.
+ * @return array User record data, or false, if the user could not be identified.
*/
- public function identify($user = null, $conditions = null) {
- if ($conditions === false) {
- $conditions = null;
- } elseif (is_array($conditions)) {
- $conditions = array_merge((array)$this->userScope, $conditions);
- } else {
- $conditions = $this->userScope;
+ public function identify(CakeRequest $request) {
+ if (empty($this->_authenticateObjects)) {
+ $this->loadAuthenticateObjects();
}
- $model = $this->getModel();
- if (empty($user)) {
- $user = $this->user();
- if (empty($user)) {
- return null;
+ foreach ($this->_authenticateObjects as $auth) {
+ $result = $auth->authenticate($request);
+ if (!empty($result) && is_array($result)) {
+ return $result;
}
- } elseif (is_object($user) && is_a($user, 'Model')) {
- if (!$user->exists()) {
- return null;
- }
- $user = $user->read();
- $user = $user[$model->alias];
- } elseif (is_array($user) && isset($user[$model->alias])) {
- $user = $user[$model->alias];
}
+ return false;
+ }
- if (is_array($user) && (isset($user[$this->fields['username']]) || isset($user[$model->alias . '.' . $this->fields['username']]))) {
- if (isset($user[$this->fields['username']]) && !empty($user[$this->fields['username']]) && !empty($user[$this->fields['password']])) {
- if (trim($user[$this->fields['username']]) == '=' || trim($user[$this->fields['password']]) == '=') {
- return false;
- }
- $find = array(
- $model->alias.'.'.$this->fields['username'] => $user[$this->fields['username']],
- $model->alias.'.'.$this->fields['password'] => $user[$this->fields['password']]
- );
- } elseif (isset($user[$model->alias . '.' . $this->fields['username']]) && !empty($user[$model->alias . '.' . $this->fields['username']])) {
- if (trim($user[$model->alias . '.' . $this->fields['username']]) == '=' || trim($user[$model->alias . '.' . $this->fields['password']]) == '=') {
- return false;
- }
- $find = array(
- $model->alias.'.'.$this->fields['username'] => $user[$model->alias . '.' . $this->fields['username']],
- $model->alias.'.'.$this->fields['password'] => $user[$model->alias . '.' . $this->fields['password']]
- );
- } else {
- return false;
- }
- $data = $model->find('first', array(
- 'conditions' => array_merge($find, $conditions),
- 'recursive' => 0
- ));
- if (empty($data) || empty($data[$model->alias])) {
- return null;
- }
- } elseif (!empty($user) && is_string($user)) {
- $data = $model->find('first', array(
- 'conditions' => array_merge(array($model->escapeField() => $user), $conditions),
- ));
- if (empty($data) || empty($data[$model->alias])) {
- return null;
- }
+/**
+ * loads the configured authentication objects.
+ *
+ * @return mixed either null on empty authenticate value, or an array of loaded objects.
+ */
+ public function loadAuthenticateObjects() {
+ if (empty($this->authenticate)) {
+ return;
}
-
- if (!empty($data)) {
- if (!empty($data[$model->alias][$this->fields['password']])) {
- unset($data[$model->alias][$this->fields['password']]);
+ $this->_authenticateObjects = array();
+ foreach (Set::normalize($this->authenticate) as $class => $settings) {
+ $className = $class . 'Authenticate';
+ if (!class_exists($className) && !App::import('Component', 'auth/' . $class . '_authenticate')) {
+ throw new CakeException(__('Authentication adapter "%s" was not found.', $class));
}
- return $data[$model->alias];
+ if (!method_exists($className, 'authenticate')) {
+ throw new CakeException(__('Authentication objects must implement an authenticate method.'));
+ }
+ foreach ($this->_authenticateLegacyMap as $old => $new) {
+ if (empty($settings[$new]) && !empty($this->{$old})) {
+ $settings[$new] = $this->{$old};
+ }
+ }
+ $this->_authenticateObjects[] = new $className($settings);
}
- return null;
+ return $this->_authenticateObjects;
}
/**
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 54689c841..27f9b6c10 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -582,13 +582,17 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->startup($this->Controller);
$user = $this->Controller->Auth->user();
$expected = array('AuthUser' => array(
- 'id' => 1, 'username' => 'mariano', 'created' => '2007-03-17 01:16:23', 'updated' => date('Y-m-d H:i:s')
+ 'id' => 1,
+ 'username' => 'mariano',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => date('Y-m-d H:i:s')
));
$this->assertEqual($user, $expected);
$this->Controller->Session->delete('Auth');
$this->Controller->request->data['AuthUser'] = array(
- 'username' => 'blah', 'password' => ''
+ 'username' => 'blah',
+ 'password' => ''
);
$this->Controller->Auth->startup($this->Controller);
@@ -598,7 +602,8 @@ class AuthTest extends CakeTestCase {
$this->Controller->Session->delete('Auth');
$this->Controller->request->data['AuthUser'] = array(
- 'username' => 'now() or 1=1 --', 'password' => ''
+ 'username' => 'now() or 1=1 --',
+ 'password' => ''
);
$this->Controller->Auth->startup($this->Controller);
@@ -608,7 +613,8 @@ class AuthTest extends CakeTestCase {
$this->Controller->Session->delete('Auth');
$this->Controller->request->data['AuthUser'] = array(
- 'username' => 'now() or 1=1 #something', 'password' => ''
+ 'username' => 'now() or 1=1 #something',
+ 'password' => ''
);
$this->Controller->Auth->startup($this->Controller);
@@ -617,14 +623,6 @@ class AuthTest extends CakeTestCase {
$this->assertNull($user);
$this->Controller->Session->delete('Auth');
- $this->Controller->Auth->userModel = 'UuidUser';
- $this->Controller->Auth->login('47c36f9c-bc00-4d17-9626-4e183ca6822b');
-
- $user = $this->Controller->Auth->user();
- $expected = array('UuidUser' => array(
- 'id' => '47c36f9c-bc00-4d17-9626-4e183ca6822b', 'title' => 'Unique record 1', 'count' => 2, 'created' => '2008-03-13 01:16:23', 'updated' => '2008-03-13 01:18:31'
- ));
- $this->assertEqual($user, $expected);
$this->Controller->Session->delete('Auth');
}
@@ -850,22 +848,80 @@ class AuthTest extends CakeTestCase {
'AuthMockThree'
);
$mocks = $this->Controller->Auth->loadAuthorizeObjects();
+ $request = $this->Controller->request;
$this->assertEquals(3, count($mocks));
$mocks[0]->expects($this->once())
->method('authorize')
- ->with(array('User'))
+ ->with(array('User'), $request)
->will($this->returnValue(false));
-
+
$mocks[1]->expects($this->once())
->method('authorize')
- ->with(array('User'))
+ ->with(array('User'), $request)
->will($this->returnValue(true));
-
+
$mocks[2]->expects($this->never())
->method('authorize');
-
- $this->assertTrue($this->Controller->Auth->isAuthorized(array('User')));
+
+ $this->assertTrue($this->Controller->Auth->isAuthorized(array('User'), $request));
+ }
+
+/**
+ * test that loadAuthorize resets the loaded objects each time.
+ *
+ * @return void
+ */
+ function testLoadAuthorizeResets() {
+ $this->Controller->Auth->authorize = array(
+ 'Controller'
+ );
+ $result = $this->Controller->Auth->loadAuthorizeObjects();
+ $this->assertEquals(1, count($result));
+
+ $result = $this->Controller->Auth->loadAuthorizeObjects();
+ $this->assertEquals(1, count($result));
+ }
+
+/**
+ * @expectedException CakeException
+ * @return void
+ */
+ function testLoadAuthenticateNoFile() {
+ $this->Controller->Auth->authenticate = 'Missing';
+ $this->Controller->Auth->identify($this->Controller->request);
+ }
+
+/**
+ * test that loadAuthorize resets the loaded objects each time.
+ *
+ * @return void
+ */
+ function testLoadAuthenticateResets() {
+ $this->Controller->Auth->authenticate = array(
+ 'Form'
+ );
+ $result = $this->Controller->Auth->loadAuthenticateObjects();
+ $this->assertEquals(1, count($result));
+
+ $result = $this->Controller->Auth->loadAuthenticateObjects();
+ $this->assertEquals(1, count($result));
+ }
+
+/**
+ * test that loadAuthenticate merges in legacy authentication settings.
+ *
+ * @return void
+ */
+ function testLoadAuthenticateSettingsPass() {
+ $this->Controller->Auth->userModel = 'AuthUser';
+ $this->Controller->Auth->userScope = array('AuthUser.active' => 1);
+ $this->Controller->Auth->fields = array('username' => 'user', 'password' => 'passwd');
+
+ $this->Controller->Auth->authenticate = array('Form');
+ $objects = $this->Controller->Auth->loadAuthenticateObjects();
+ $result = $objects[0];
+ $this->assertEquals($result->settings['userModel'], 'AuthUser');
}
/**
@@ -1463,7 +1519,8 @@ class AuthTest extends CakeTestCase {
$authUser = $PluginModel->find();
$this->Controller->request->data['TestPluginAuthUser'] = array(
- 'username' => $authUser['TestPluginAuthUser']['username'], 'password' => 'cake'
+ 'username' => $authUser['TestPluginAuthUser']['username'],
+ 'password' => 'cake'
);
$this->Controller->request->addParams(Router::parse('auth_test/login'));
@@ -1476,8 +1533,12 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->startup($this->Controller);
$user = $this->Controller->Auth->user();
- $expected = array('TestPluginAuthUser' => array(
- 'id' => 1, 'username' => 'gwoo', 'created' => '2007-03-17 01:16:23', 'updated' => date('Y-m-d H:i:s')
+ $expected = array(
+ 'TestPluginAuthUser' => array(
+ 'id' => 1,
+ 'username' => 'gwoo',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => date('Y-m-d H:i:s')
));
$this->assertEqual($user, $expected);
$sessionKey = $this->Controller->Auth->sessionKey;
From e96b20b93ea8004f0ec15d448d2d0156d29bcc43 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Tue, 4 Jan 2011 22:44:38 -0500
Subject: [PATCH 240/668] Removing skipped tests that cover features in other
classes and tests.
---
.../libs/controller/components/auth.test.php | 257 ------------------
1 file changed, 257 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 27f9b6c10..13a92c91f 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -676,31 +676,6 @@ class AuthTest extends CakeTestCase {
$this->assertFalse($result);
}
-/**
- * testAuthorizeController method
- *
- * @access public
- * @return void
- */
- function testAuthorizeController() {
- $this->markTestSkipped('This is already tested in ControllerAuthorizeTest');
-
- $this->AuthUser = new AuthUser();
- $user = $this->AuthUser->find();
- $this->Controller->Session->write('Auth', $user);
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->authorize = 'controller';
- $this->Controller->request->addParams(Router::parse('auth_test/add'));
- $result = $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue($result);
-
- $this->Controller->request['testControllerAuth'] = 1;
- $result = $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue($this->Controller->Session->check('Message.auth'));
- $this->assertFalse($result);
-
- $this->Controller->Session->delete('Auth');
- }
/**
* testAuthorizeModel method
@@ -730,99 +705,6 @@ class AuthTest extends CakeTestCase {
$this->assertFalse($result);
}
-/**
- * testAuthorizeCrud method
- *
- * @access public
- * @return void
- */
- function testAuthorizeCrud() {
- $this->markTestSkipped('This is already tested in CrudAuthorizeTest');
-
- $this->AuthUser = new AuthUser();
- $user = $this->AuthUser->find();
- $this->Controller->Session->write('Auth', $user);
-
- $this->Controller->request['controller'] = 'auth_test';
- $this->Controller->request['action'] = 'add';
-
- $this->Controller->Acl->name = 'DbAclTest';
-
- $this->Controller->Acl->Aro->id = null;
- $this->Controller->Acl->Aro->create(array('alias' => 'Roles'));
- $result = $this->Controller->Acl->Aro->save();
- $this->assertFalse(empty($result));
-
- $parent = $this->Controller->Acl->Aro->id;
-
- $this->Controller->Acl->Aro->create(array('parent_id' => $parent, 'alias' => 'Admin'));
- $result = $this->Controller->Acl->Aro->save();
- $this->assertFalse(empty($result));
-
- $parent = $this->Controller->Acl->Aro->id;
-
- $this->Controller->Acl->Aro->create(array(
- 'model' => 'AuthUser', 'parent_id' => $parent, 'foreign_key' => 1, 'alias'=> 'mariano'
- ));
- $result = $this->Controller->Acl->Aro->save();
- $this->assertFalse(empty($result));
-
- $this->Controller->Acl->Aco->create(array('alias' => 'Root'));
- $result = $this->Controller->Acl->Aco->save();
- $this->assertFalse(empty($result));
-
- $parent = $this->Controller->Acl->Aco->id;
-
- $this->Controller->Acl->Aco->create(array('parent_id' => $parent, 'alias' => 'AuthTest'));
- $result = $this->Controller->Acl->Aco->save();
- $this->assertFalse(empty($result));
-
- $this->Controller->Acl->allow('Roles/Admin', 'Root');
- $this->Controller->Acl->allow('Roles/Admin', 'Root/AuthTest');
-
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->authorize = 'crud';
- $this->Controller->Auth->actionPath = 'Root/';
-
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue($this->Controller->Auth->isAuthorized());
-
- $this->Controller->Session->delete('Auth');
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue($this->Controller->Session->check('Message.auth'));
- }
-
-/**
- * test authorize = 'actions' setting.
- *
- * @return void
- */
- function testAuthorizeActions() {
- $this->markTestSkipped('This is already tested in ActionsAuthorizeTest');
-
- $this->AuthUser = new AuthUser();
- $user = $this->AuthUser->find();
- $this->Controller->Session->write('Auth', $user);
- $this->Controller->request['controller'] = 'auth_test';
- $this->Controller->request['action'] = 'add';
-
- $this->Controller->Acl = $this->getMock('AclComponent', array(), array(), '', false);
- $this->Controller->Acl->expects($this->atLeastOnce())->method('check')->will($this->returnValue(true));
-
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->authorize = 'actions';
- $this->Controller->Auth->actionPath = 'Root/';
-
- $this->Controller->Acl->expects($this->at(0))->method('check')->with($user, 'Root/AuthTest/add');
-
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue($this->Controller->Auth->isAuthorized());
- }
-
/**
* @expectedException CakeException
* @return void
@@ -1237,110 +1119,6 @@ class AuthTest extends CakeTestCase {
$this->assertTrue($result, 'Auth redirected a missing action %s');
}
-/**
- * testEmptyUsernameOrPassword method
- *
- * @access public
- * @return void
- */
- function testEmptyUsernameOrPassword() {
- $this->markTestSkipped('This is already tested in FormAuthenticateTest');
-
- $this->AuthUser = new AuthUser();
- $user['id'] = 1;
- $user['username'] = 'mariano';
- $user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
- $this->AuthUser->save($user, false);
-
- $authUser = $this->AuthUser->find();
-
- $this->Controller->request->data['AuthUser'] = array(
- 'username' => '', 'password' => ''
- );
-
- $this->Controller->request->addParams(Router::parse('auth_test/login'));
- $this->Controller->request->query['url'] = 'auth_test/login';
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = 'auth_test/login';
- $this->Controller->Auth->userModel = 'AuthUser';
-
- $this->Controller->Auth->startup($this->Controller);
- $user = $this->Controller->Auth->user();
- $this->assertTrue($this->Controller->Session->check('Message.auth'));
- $this->assertEqual($user, false);
- $this->Controller->Session->delete('Auth');
- }
-
-/**
- * testInjection method
- *
- * @access public
- * @return void
- */
- function testInjection() {
- $this->markTestSkipped('This is already tested in FormAuthenticateTest');
-
- $this->AuthUser = new AuthUser();
- $this->AuthUser->id = 2;
- $this->AuthUser->saveField('password', Security::hash(Configure::read('Security.salt') . 'cake'));
-
- $this->Controller->request->data['AuthUser'] = array(
- 'username' => 'nate', 'password' => 'cake'
- );
-
- $this->Controller->request->addParams(Router::parse('auth_test/login'));
- $this->Controller->request->query['url'] = 'auth_test/login';
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->loginAction = 'auth_test/login';
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue(is_array($this->Controller->Auth->user()));
-
- $this->Controller->Session->delete($this->Controller->Auth->sessionKey);
-
- $this->Controller->request->data = array(
- 'AuthUser' => array(
- 'username' => 'nate',
- 'password' => 'cake1'
- )
- );
- $this->Controller->request->query['url'] = 'auth_test/login';
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->loginAction = 'auth_test/login';
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue(is_null($this->Controller->Auth->user()));
-
- $this->Controller->Session->delete($this->Controller->Auth->sessionKey);
-
- $this->Controller->request->data = array(
- 'AuthUser' => array(
- 'username' => '> n',
- 'password' => 'cake'
- )
- );
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue(is_null($this->Controller->Auth->user()));
-
- unset($this->Controller->request->data['AuthUser']['password']);
- $this->Controller->request->data['AuthUser']['username'] = "1'1";
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue(is_null($this->Controller->Auth->user()));
-
- unset($this->Controller->request->data['AuthUser']['username']);
- $this->Controller->request->data['AuthUser']['password'] = "1'1";
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue(is_null($this->Controller->Auth->user()));
- }
-
/**
* test Hashing of passwords
*
@@ -1431,41 +1209,6 @@ class AuthTest extends CakeTestCase {
$this->assertTrue(!!$user);
}
-/**
- * testCustomField method
- *
- * @access public
- * @return void
- */
- function testCustomField() {
- $this->markTestSkipped('This is already tested in FormAuthenticateTest');
- Router::reload();
-
- $this->AuthUserCustomField = new AuthUserCustomField();
- $user = array(
- 'id' => 1, 'email' => 'harking@example.com',
- 'password' => Security::hash(Configure::read('Security.salt') . 'cake'
- ));
- $user = $this->AuthUserCustomField->save($user, false);
-
- Router::connect('/', array('controller' => 'people', 'action' => 'login'));
- $url = '/';
- $this->Controller->request->addParams(Router::parse($url));
- Router::setRequestInfo($this->Controller->request);
- $this->Controller->request->data['AuthUserCustomField'] = array(
- 'email' => 'harking@example.com', 'password' => 'cake'
- );
- $this->Controller->request->query['url'] = substr($url, 1);
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->fields = array('username' => 'email', 'password' => 'password');
- $this->Controller->Auth->loginAction = array('controller' => 'people', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUserCustomField';
-
- $this->Controller->Auth->startup($this->Controller);
- $user = $this->Controller->Auth->user();
- $this->assertTrue(!!$user);
- }
-
/**
* testAdminRoute method
*
From f21970c533ee64d7448be7f9cc05c1b636c80a6a Mon Sep 17 00:00:00 2001
From: mark_story
Date: Tue, 4 Jan 2011 23:12:37 -0500
Subject: [PATCH 241/668] Making AuthComponent::mapActions() delegate to the
authorize objects. Adding tests.
---
cake/libs/controller/components/auth.php | 40 ++++---------------
.../libs/controller/components/auth.test.php | 16 ++++++++
2 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index a7993c249..244035d48 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -511,28 +511,6 @@ class AuthComponent extends Component {
return $this->_authorizeObjects;
}
-/**
- * Get authorization type
- *
- * @param string $auth Type of authorization
- * @return array Associative array with: type, object
- * @access private
- */
- function __authType($auth = null) {
- if ($auth == null) {
- $auth = $this->authorize;
- }
- $object = null;
- if (is_array($auth)) {
- $type = key($auth);
- $object = $auth[$type];
- } else {
- $type = $auth;
- return compact('type');
- }
- return compact('type', 'object');
- }
-
/**
* Takes a list of actions in the current controller for which authentication is not required, or
* no parameters to allow all actions.
@@ -580,22 +558,20 @@ class AuthComponent extends Component {
}
/**
- * Maps action names to CRUD operations. Used for controller-based authentication.
+ * Maps action names to CRUD operations. Used for controller-based authentication. Make sure
+ * to configure the authorize property before calling this method. As it delegates $map to all the
+ * attached authorize objects.
*
* @param array $map Actions to map
* @return void
* @link http://book.cakephp.org/view/1260/mapActions
*/
public function mapActions($map = array()) {
- $crud = array('create', 'read', 'update', 'delete');
- foreach ($map as $action => $type) {
- if (in_array($action, $crud) && is_array($type)) {
- foreach ($type as $typedAction) {
- $this->actionMap[$typedAction] = $action;
- }
- } else {
- $this->actionMap[$action] = $type;
- }
+ if (empty($this->_authorizeObjects)) {
+ $this->loadAuthorizeObjects();
+ }
+ foreach ($this->_authorizeObjects as $auth) {
+ $auth->mapActions($map);
}
}
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 13a92c91f..4381c3a2d 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1470,4 +1470,20 @@ class AuthTest extends CakeTestCase {
$this->assertNull($this->Controller->Session->read('Auth.AuthUser'));
$this->assertNull($this->Controller->Session->read('Auth.redirect'));
}
+
+/**
+ * test mapActions loading and delegating to authorize objects.
+ *
+ * @return void
+ */
+ function testMapActionsDelegation() {
+ $this->getMock('BaseAuthorize', array('authorize'), array(), 'MapActionMockAuthorize', false);
+ $this->Controller->Auth->authorize = array('MapActionMock');
+ $mock = $this->Controller->Auth->loadAuthorizeObjects();
+ $mock[0]->expects($this->once())
+ ->method('mapActions')
+ ->with(array('create' => array('my_action')));
+
+ $this->Controller->Auth->mapActions(array('create' => array('my_action')));
+ }
}
From 7ea914938fc0715a0cef6c5f878336d4998bd57f Mon Sep 17 00:00:00 2001
From: mark_story
Date: Tue, 4 Jan 2011 23:27:16 -0500
Subject: [PATCH 242/668] Changing AuthComponent::login() so you can provide an
array of user data to manually login a user. Leaving $user blank will
attempt to identify the user using the request.
---
cake/libs/controller/components/auth.php | 26 ++++++-------------
.../libs/controller/components/auth.test.php | 19 ++++++++++++++
2 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 244035d48..2ce617878 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -264,13 +264,6 @@ class AuthComponent extends Component {
*/
public $params = array();
-/**
- * AclComponent instance if using Acl + Auth
- *
- * @var AclComponent
- */
- public $Acl;
-
/**
* Method list for bound controller
*
@@ -576,25 +569,22 @@ class AuthComponent extends Component {
}
/**
- * Manually log-in a user with the given parameter data. The $data provided can be any data
- * structure used to identify a user in AuthComponent::identify(). If $data is empty or not
- * specified, POST data from Controller::$data will be used automatically.
+ * Log a user in. If a $user is provided that data will be stored as the logged in user. If `$user` is empty or not
+ * specified, POST data from the current request will be used to identify a user. If the login was successful,
+ * the user record is written to the session key specified in AuthComponent::$sessionKey.
*
- * After (if) login is successful, the user record is written to the session key specified in
- * AuthComponent::$sessionKey.
- *
- * @param mixed $data User object
+ * @param mixed $user Either an array of user data, or null to identify a user using the current request.
* @return boolean True on login success, false on failure
* @link http://book.cakephp.org/view/1261/login
*/
- public function login($request = null) {
+ public function login($user = null) {
$this->__setDefaults();
$this->_loggedIn = false;
- if (empty($request)) {
- $request = $this->request;
+ if (empty($user)) {
+ $user = $this->identify($this->request);
}
- if ($user = $this->identify($request)) {
+ if ($user) {
$this->Session->write($this->sessionKey, $user);
$this->_loggedIn = true;
}
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 4381c3a2d..97115e5b6 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1486,4 +1486,23 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->mapActions(array('create' => array('my_action')));
}
+
+/**
+ * test login() with user data
+ *
+ * @return void
+ */
+ function testLoginWithUserData() {
+ $this->assertFalse($this->Controller->Auth->loggedIn());
+
+ $user = array(
+ 'username' => 'mariano',
+ 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => '2007-03-17 01:18:31'
+ );
+ $this->assertTrue($this->Controller->Auth->login($user));
+ $this->assertTrue($this->Controller->Auth->loggedIn());
+ $this->assertEquals($user['username'], $this->Controller->Auth->user('username'));
+ }
}
From e34fdde91858ed9ed0fc0c02c71fa83f060bb875 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Tue, 4 Jan 2011 23:33:09 -0500
Subject: [PATCH 243/668] Adding a test for logging users in using request
data.
---
.../libs/controller/components/auth.test.php | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 97115e5b6..d22b1ea92 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -18,6 +18,7 @@
*/
App::import('Core', 'Controller');
App::import('Component', array('Auth', 'Acl'));
+App::import('Component', 'auth/form_authenticate');
App::import('Model', 'DbAcl');
App::import('Core', 'Xml');
@@ -1487,6 +1488,28 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->mapActions(array('create' => array('my_action')));
}
+/**
+ * test logging in with a request.
+ *
+ * @return void
+ */
+ function testLoginWithRequestData() {
+ $this->getMock('FormAuthenticate', array(), array(), 'RequestLoginMockAuthenticate', false);
+ $request = new CakeRequest('users/login', false);
+ $user = array('username' => 'mark', 'role' => 'admin');
+
+ $this->Controller->Auth->request = $request;
+ $this->Controller->Auth->authenticate = array('RequestLoginMock');
+ $mock = $this->Controller->Auth->loadAuthenticateObjects();
+ $mock[0]->expects($this->once())
+ ->method('authenticate')
+ ->with($request)
+ ->will($this->returnValue($user));
+
+ $this->assertTrue($this->Controller->Auth->login());
+ $this->assertEquals($user['username'], $this->Controller->Auth->user('username'));
+ }
+
/**
* test login() with user data
*
From 0c7f9149ca1674cee50c95bc6ff533ad46fbc446 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 5 Jan 2011 00:01:40 -0500
Subject: [PATCH 244/668] Refactoring authorization objects to also use
settings, it makes them consistent with authenticate objects. Making
actionPath automatically pass into authentication objects. Adding tests.
---
cake/libs/controller/components/auth.php | 15 +++++++
.../components/auth/base_authorize.php | 39 +++++++++----------
.../libs/controller/components/auth.test.php | 14 +++++++
3 files changed, 48 insertions(+), 20 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 2ce617878..40695b2aa 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -91,6 +91,16 @@ class AuthComponent extends Component {
*/
protected $_authorizeObjects = array();
+/**
+ * A hash mapping legacy properties => to settings passed into Authorize objects.
+ *
+ * @var string
+ * @deprecated Will be removed in 2.1+
+ */
+ protected $_authorizeLegacyMap = array(
+ 'actionPath' => 'actionPath',
+ );
+
/**
* The name of an optional view element to render when an Ajax request is made
* with an invalid or expired session
@@ -499,6 +509,11 @@ class AuthComponent extends Component {
if (!method_exists($className, 'authorize')) {
throw new CakeException(__('Authorization objects must implement an authorize method.'));
}
+ foreach ($this->_authorizeLegacyMap as $old => $new) {
+ if (empty($settings[$new]) && !empty($this->{$old})) {
+ $settings[$new] = $this->{$old};
+ }
+ }
$this->_authorizeObjects[] = new $className($this->_Collection->getController(), $settings);
}
return $this->_authorizeObjects;
diff --git a/cake/libs/controller/components/auth/base_authorize.php b/cake/libs/controller/components/auth/base_authorize.php
index cc19acb26..cf9a2892f 100644
--- a/cake/libs/controller/components/auth/base_authorize.php
+++ b/cake/libs/controller/components/auth/base_authorize.php
@@ -29,26 +29,24 @@ abstract class BaseAuthorize {
protected $_controller = null;
/**
- * The path to ACO nodes that contains the nodes for controllers. Used as a prefix
- * when calling $this->action();
+ * Settings for authorize objects.
*
- * @var string
- */
- public $actionPath = null;
-
-/**
- * Action -> crud mappings. Used by authorization objects that want to map actions to CRUD roles.
+ * - `actionPath` - The path to ACO nodes that contains the nodes for controllers. Used as a prefix
+ * when calling $this->action();
+ * - `actionMap` - Action -> crud mappings. Used by authorization objects that want to map actions to CRUD roles.
*
* @var array
- * @see CrudAuthorize
*/
- protected $_actionMap = array(
- 'index' => 'read',
- 'add' => 'create',
- 'edit' => 'update',
- 'view' => 'read',
- 'delete' => 'delete',
- 'remove' => 'delete'
+ public $settings = array(
+ 'actionPath' => null,
+ 'actionMap' => array(
+ 'index' => 'read',
+ 'add' => 'create',
+ 'edit' => 'update',
+ 'view' => 'read',
+ 'delete' => 'delete',
+ 'remove' => 'delete'
+ )
);
/**
@@ -59,6 +57,7 @@ abstract class BaseAuthorize {
*/
public function __construct(Controller $controller, $settings = array()) {
$this->controller($controller);
+ $this->settings = Set::merge($this->settings, $settings);
}
/**
@@ -99,7 +98,7 @@ abstract class BaseAuthorize {
return str_replace(
array(':controller', ':action', ':plugin/'),
array(Inflector::camelize($request['controller']), $request['action'], $plugin),
- $this->actionPath . $path
+ $this->settings['actionPath'] . $path
);
}
@@ -111,16 +110,16 @@ abstract class BaseAuthorize {
*/
public function mapActions($map = array()) {
if (empty($map)) {
- return $this->_actionMap;
+ return $this->settings['actionMap'];
}
$crud = array('create', 'read', 'update', 'delete');
foreach ($map as $action => $type) {
if (in_array($action, $crud) && is_array($type)) {
foreach ($type as $typedAction) {
- $this->_actionMap[$typedAction] = $action;
+ $this->settings['actionMap'][$typedAction] = $action;
}
} else {
- $this->_actionMap[$action] = $type;
+ $this->settings['actionMap'][$action] = $type;
}
}
}
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index d22b1ea92..c4dc81e0c 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -775,6 +775,20 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->identify($this->Controller->request);
}
+/**
+ * test that loadAuthorize merges in legacy authorize settings.
+ *
+ * @return void
+ */
+ function testLoadAuthorizeSettingsPass() {
+ $this->Controller->Auth->actionPath = 'controllers/';
+
+ $this->Controller->Auth->authorize = array('Actions');
+ $objects = $this->Controller->Auth->loadAuthorizeObjects();
+ $result = $objects[0];
+ $this->assertEquals($result->settings['actionPath'], 'controllers/');
+ }
+
/**
* test that loadAuthorize resets the loaded objects each time.
*
From e11917ae9401aa1b7c2f05e6caf112ca3aaaf63a Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 5 Jan 2011 00:03:07 -0500
Subject: [PATCH 245/668] Removing public properties that aren't used anymore.
---
cake/libs/controller/components/auth.php | 16 ----------------
.../components/auth/base_authorize.php | 2 +-
2 files changed, 1 insertion(+), 17 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 40695b2aa..c18bea649 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -258,22 +258,6 @@ class AuthComponent extends Component {
*/
public $request;
-/**
- * Form data from Controller::$data
- *
- * @deprecated Use $this->request->data instead
- * @var array
- */
- public $data = array();
-
-/**
- * Parameter data from Controller::$params
- *
- * @deprecated Use $this->request instead
- * @var array
- */
- public $params = array();
-
/**
* Method list for bound controller
*
diff --git a/cake/libs/controller/components/auth/base_authorize.php b/cake/libs/controller/components/auth/base_authorize.php
index cf9a2892f..e04f4e2de 100644
--- a/cake/libs/controller/components/auth/base_authorize.php
+++ b/cake/libs/controller/components/auth/base_authorize.php
@@ -32,7 +32,7 @@ abstract class BaseAuthorize {
* Settings for authorize objects.
*
* - `actionPath` - The path to ACO nodes that contains the nodes for controllers. Used as a prefix
- * when calling $this->action();
+ * when calling $this->action();
* - `actionMap` - Action -> crud mappings. Used by authorization objects that want to map actions to CRUD roles.
*
* @var array
From 1696df720135338910c0343a18da9d5dc8aa8638 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 5 Jan 2011 23:18:07 -0500
Subject: [PATCH 246/668] Removing the last of actionMap from AuthComponent.
Its been moved into the authorization objects. Updating and adding tests for
crud_authorize.
---
cake/libs/controller/components/auth.php | 32 --------------
.../components/auth/crud_authorize.php | 43 ++++++++++++++++++-
.../libs/controller/components/auth.test.php | 20 ---------
.../components/auth/crud_authorize.test.php | 23 +++++++++-
4 files changed, 62 insertions(+), 56 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index c18bea649..6feac21ec 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -237,20 +237,6 @@ class AuthComponent extends Component {
*/
public $allowedActions = array();
-/**
- * Maps actions to CRUD operations. Used for controller-based validation ($validate = 'controller').
- *
- * @var array
- * @see AuthComponent::mapActions()
- */
- public $actionMap = array(
- 'index' => 'read',
- 'add' => 'create',
- 'edit' => 'update',
- 'view' => 'read',
- 'remove' => 'delete'
- );
-
/**
* Request object
*
@@ -275,26 +261,8 @@ class AuthComponent extends Component {
$this->request = $controller->request;
$this->params = $this->request;
- $crud = array('create', 'read', 'update', 'delete');
- $this->actionMap = array_merge($this->actionMap, array_combine($crud, $crud));
$this->_methods = $controller->methods;
- $prefixes = Router::prefixes();
- if (!empty($prefixes)) {
- foreach ($prefixes as $prefix) {
- $this->actionMap = array_merge($this->actionMap, array(
- $prefix . '_index' => 'read',
- $prefix . '_add' => 'create',
- $prefix . '_edit' => 'update',
- $prefix . '_view' => 'read',
- $prefix . '_remove' => 'delete',
- $prefix . '_create' => 'create',
- $prefix . '_read' => 'read',
- $prefix . '_update' => 'update',
- $prefix . '_delete' => 'delete'
- ));
- }
- }
if (Configure::read('debug') > 0) {
App::import('Debugger');
Debugger::checkSecurityKeys();
diff --git a/cake/libs/controller/components/auth/crud_authorize.php b/cake/libs/controller/components/auth/crud_authorize.php
index 5e6c9c85c..40844f4b1 100644
--- a/cake/libs/controller/components/auth/crud_authorize.php
+++ b/cake/libs/controller/components/auth/crud_authorize.php
@@ -31,6 +31,45 @@ App::import('Component', 'auth/base_authorize');
*/
class CrudAuthorize extends BaseAuthorize {
+/**
+ * Sets up additional actionMap values that match the configured `Routing.prefixes`.
+ *
+ * @param Controller $controller The controller for this request.
+ * @param string $settings An array of settings. This class does not use any settings.
+ */
+ public function __construct(Controller $controller, $settings = array()) {
+ parent::__construct($controller, $settings);
+ $this->_setPrefixMappings();
+ }
+
+/**
+ * sets the crud mappings for prefix routes.
+ *
+ * @return void
+ */
+ protected function _setPrefixMappings() {
+ $crud = array('create', 'read', 'update', 'delete');
+ $map = array_combine($crud, $crud);
+
+ $prefixes = Router::prefixes();
+ if (!empty($prefixes)) {
+ foreach ($prefixes as $prefix) {
+ $map = array_merge($map, array(
+ $prefix . '_index' => 'read',
+ $prefix . '_add' => 'create',
+ $prefix . '_edit' => 'update',
+ $prefix . '_view' => 'read',
+ $prefix . '_remove' => 'delete',
+ $prefix . '_create' => 'create',
+ $prefix . '_read' => 'read',
+ $prefix . '_update' => 'update',
+ $prefix . '_delete' => 'delete'
+ ));
+ }
+ }
+ $this->mapActions($map);
+ }
+
/**
* Authorize a user using the mapped actions and the AclComponent.
*
@@ -39,7 +78,7 @@ class CrudAuthorize extends BaseAuthorize {
* @return boolean
*/
public function authorize($user, CakeRequest $request) {
- if (!isset($this->_actionMap[$request->params['action']])) {
+ if (!isset($this->settings['actionMap'][$request->params['action']])) {
trigger_error(__(
'CrudAuthorize::authorize() - Attempted access of un-mapped action "%1$s" in controller "%2$s"',
$request->action,
@@ -53,7 +92,7 @@ class CrudAuthorize extends BaseAuthorize {
return $Acl->check(
$user,
$this->action($request, ':controller'),
- $this->_actionMap[$request->params['action']]
+ $this->settings['actionMap'][$request->params['action']]
);
}
}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index c4dc81e0c..9db1ac1ca 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1393,26 +1393,6 @@ class AuthTest extends CakeTestCase {
$this->assertNull($this->Controller->Session->read('Auth.redirect'));
}
-/**
- * test the initialize callback and its interactions with Router::prefixes()
- *
- * @return void
- */
- function testInitializeAndRoutingPrefixes() {
- $restore = Configure::read('Routing');
- Configure::write('Routing.prefixes', array('admin', 'super_user'));
- Router::reload();
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->assertTrue(isset($this->Controller->Auth->actionMap['delete']));
- $this->assertTrue(isset($this->Controller->Auth->actionMap['view']));
- $this->assertTrue(isset($this->Controller->Auth->actionMap['add']));
- $this->assertTrue(isset($this->Controller->Auth->actionMap['admin_view']));
- $this->assertTrue(isset($this->Controller->Auth->actionMap['super_user_delete']));
-
- Configure::write('Routing', $restore);
- }
-
/**
* test $settings in Controller::$components
*
diff --git a/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php b/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
index fbad73a77..beee53fb9 100644
--- a/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/crud_authorize.test.php
@@ -117,11 +117,14 @@ class CrudAuthorizeTest extends CakeTestCase {
function testMapActionsGet() {
$result = $this->auth->mapActions();
$expected = array(
+ 'create' => 'create',
+ 'read' => 'read',
+ 'update' => 'update',
+ 'delete' => 'delete',
'index' => 'read',
'add' => 'create',
'edit' => 'update',
'view' => 'read',
- 'delete' => 'delete',
'remove' => 'delete'
);
$this->assertEquals($expected, $result);
@@ -144,6 +147,9 @@ class CrudAuthorizeTest extends CakeTestCase {
$result = $this->auth->mapActions();
$expected = array(
+ 'add' => 'create',
+ 'create' => 'create',
+ 'read' => 'read',
'index' => 'read',
'add' => 'create',
'edit' => 'update',
@@ -154,9 +160,22 @@ class CrudAuthorizeTest extends CakeTestCase {
'listing' => 'read',
'show' => 'read',
'update' => 'update',
- 'random' => 'custom'
+ 'random' => 'custom',
);
$this->assertEquals($expected, $result);
}
+/**
+ * test prefix routes getting auto mapped.
+ *
+ * @return void
+ */
+ function testAutoPrefixMapActions() {
+ Configure::write('Routing.prefixes', array('admin', 'manager'));
+ Router::reload();
+
+ $auth = new CrudAuthorize($this->controller);
+ $this->assertTrue(isset($auth->settings['actionMap']['admin_index']));
+ }
+
}
From ff889c2c8ec1a22ee40efa6f22810fdc04c7dc05 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 9 Jan 2011 00:33:06 -0500
Subject: [PATCH 247/668] Renaming method names, no need to include Objects,
its implied.
---
cake/libs/controller/components/auth.php | 10 +++++-----
.../libs/controller/components/auth.test.php | 18 +++++++++---------
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 6feac21ec..4aed7f015 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -433,7 +433,7 @@ class AuthComponent extends Component {
$request = $this->request;
}
if (empty($this->_authorizeObjects)) {
- $this->loadAuthorizeObjects();
+ $this->constructAuthorize();
}
foreach ($this->_authorizeObjects as $authorizer) {
if ($authorizer->authorize($user, $request) === true) {
@@ -448,7 +448,7 @@ class AuthComponent extends Component {
*
* @return mixed Either null when authorize is empty, or the loaded authorization objects.
*/
- public function loadAuthorizeObjects() {
+ public function constructAuthorize() {
if (empty($this->authorize)) {
return;
}
@@ -528,7 +528,7 @@ class AuthComponent extends Component {
*/
public function mapActions($map = array()) {
if (empty($this->_authorizeObjects)) {
- $this->loadAuthorizeObjects();
+ $this->constructAuthorize();
}
foreach ($this->_authorizeObjects as $auth) {
$auth->mapActions($map);
@@ -694,7 +694,7 @@ class AuthComponent extends Component {
*/
public function identify(CakeRequest $request) {
if (empty($this->_authenticateObjects)) {
- $this->loadAuthenticateObjects();
+ $this->constructAuthenticate();
}
foreach ($this->_authenticateObjects as $auth) {
$result = $auth->authenticate($request);
@@ -710,7 +710,7 @@ class AuthComponent extends Component {
*
* @return mixed either null on empty authenticate value, or an array of loaded objects.
*/
- public function loadAuthenticateObjects() {
+ public function constructAuthenticate() {
if (empty($this->authenticate)) {
return;
}
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 9db1ac1ca..600b08e20 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -730,7 +730,7 @@ class AuthTest extends CakeTestCase {
'AuthMockTwo',
'AuthMockThree'
);
- $mocks = $this->Controller->Auth->loadAuthorizeObjects();
+ $mocks = $this->Controller->Auth->constructAuthorize();
$request = $this->Controller->request;
$this->assertEquals(3, count($mocks));
@@ -759,10 +759,10 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->authorize = array(
'Controller'
);
- $result = $this->Controller->Auth->loadAuthorizeObjects();
+ $result = $this->Controller->Auth->constructAuthorize();
$this->assertEquals(1, count($result));
- $result = $this->Controller->Auth->loadAuthorizeObjects();
+ $result = $this->Controller->Auth->constructAuthorize();
$this->assertEquals(1, count($result));
}
@@ -784,7 +784,7 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->actionPath = 'controllers/';
$this->Controller->Auth->authorize = array('Actions');
- $objects = $this->Controller->Auth->loadAuthorizeObjects();
+ $objects = $this->Controller->Auth->constructAuthorize();
$result = $objects[0];
$this->assertEquals($result->settings['actionPath'], 'controllers/');
}
@@ -798,10 +798,10 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->authenticate = array(
'Form'
);
- $result = $this->Controller->Auth->loadAuthenticateObjects();
+ $result = $this->Controller->Auth->constructAuthenticate();
$this->assertEquals(1, count($result));
- $result = $this->Controller->Auth->loadAuthenticateObjects();
+ $result = $this->Controller->Auth->constructAuthenticate();
$this->assertEquals(1, count($result));
}
@@ -816,7 +816,7 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->fields = array('username' => 'user', 'password' => 'passwd');
$this->Controller->Auth->authenticate = array('Form');
- $objects = $this->Controller->Auth->loadAuthenticateObjects();
+ $objects = $this->Controller->Auth->constructAuthenticate();
$result = $objects[0];
$this->assertEquals($result->settings['userModel'], 'AuthUser');
}
@@ -1474,7 +1474,7 @@ class AuthTest extends CakeTestCase {
function testMapActionsDelegation() {
$this->getMock('BaseAuthorize', array('authorize'), array(), 'MapActionMockAuthorize', false);
$this->Controller->Auth->authorize = array('MapActionMock');
- $mock = $this->Controller->Auth->loadAuthorizeObjects();
+ $mock = $this->Controller->Auth->constructAuthorize();
$mock[0]->expects($this->once())
->method('mapActions')
->with(array('create' => array('my_action')));
@@ -1494,7 +1494,7 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->request = $request;
$this->Controller->Auth->authenticate = array('RequestLoginMock');
- $mock = $this->Controller->Auth->loadAuthenticateObjects();
+ $mock = $this->Controller->Auth->constructAuthenticate();
$mock[0]->expects($this->once())
->method('authenticate')
->with($request)
From b59d0e8bb15e6f9cd6b6b48a320cef73e2857005 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 19 Jan 2011 16:17:17 -0500
Subject: [PATCH 248/668] Replacing Authcomponent::$flashElement with
Authcomponent::$flash, which gives access to all the flash parameters. Also
adding a wrapper method for more terse code and ability to extend
functionality.
---
cake/libs/controller/components/auth.php | 31 +++++++++++++++----
.../libs/controller/components/auth.test.php | 19 ++++++++++++
2 files changed, 44 insertions(+), 6 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 4aed7f015..afe98c888 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -111,11 +111,20 @@ class AuthComponent extends Component {
public $ajaxLogin = null;
/**
- * The name of the element used for SessionComponent::setFlash
+ * Settings to use when Auth needs to do a flash message with SessionComponent::setFlash().
+ * Available keys are:
*
- * @var string
+ * - `element` - The element to use, defaults to 'default'.
+ * - `key` - The key to use, defaults to 'auth'
+ * - `params` - The array of additional params to use, defaults to array()
+ *
+ * @var array
*/
- public $flashElement = 'default';
+ public $flash = array(
+ 'element' => 'default',
+ 'key' => 'auth',
+ 'params' => array()
+ );
/**
* The name of the model that represents users which will be authenticated. Defaults to 'User'.
@@ -342,13 +351,13 @@ class AuthComponent extends Component {
}
}
- $this->Session->setFlash($this->loginError, $this->flashElement, array(), 'auth');
+ $this->flash($this->loginError);
$request->data[$model->alias][$this->fields['password']] = null;
return false;
} else {
if (!$this->user()) {
if (!$request->is('ajax')) {
- $this->Session->setFlash($this->authError, $this->flashElement, array(), 'auth');
+ $this->flash($this->authError);
if (!empty($request->query) && count($request->query) >= 2) {
$query = $request->query;
unset($query['url'], $query['ext']);
@@ -376,7 +385,7 @@ class AuthComponent extends Component {
return true;
}
- $this->Session->setFlash($this->authError, $this->flashElement, array(), 'auth');
+ $this->flash($this->authError);
$controller->redirect($controller->referer(), null, true);
return false;
}
@@ -792,4 +801,14 @@ class AuthComponent extends Component {
}
return $this->_loggedIn;
}
+
+/**
+ * Set a flash message. Uses the Session component, and values from AuthComponent::$flash.
+ *
+ * @param string $message The message to set.
+ * @return void
+ */
+ public function flash($message) {
+ $this->Session->setFlash($message, $this->flash['element'], $this->flash['params'], $this->flash['key']);
+ }
}
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 600b08e20..baac8287d 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1522,4 +1522,23 @@ class AuthTest extends CakeTestCase {
$this->assertTrue($this->Controller->Auth->loggedIn());
$this->assertEquals($user['username'], $this->Controller->Auth->user('username'));
}
+
+/**
+ * test flash settings.
+ *
+ * @return void
+ */
+ function testFlashSettings() {
+ $this->Controller->Auth->Session = $this->getMock('SessionComponent', array(), array(), '', zfalse);
+ $this->Controller->Auth->Session->expects($this->once())
+ ->method('setFlash')
+ ->with('Auth failure', 'custom', array(1), 'auth-key');
+
+ $this->Controller->Auth->flash = array(
+ 'element' => 'custom',
+ 'params' => array(1),
+ 'key' => 'auth-key'
+ );
+ $this->Controller->Auth->flash('Auth failure');
+ }
}
From d8f2cf9395ddfd46009d2942dc635e706915874f Mon Sep 17 00:00:00 2001
From: mark_story
Date: Wed, 19 Jan 2011 16:53:58 -0500
Subject: [PATCH 249/668] Starting to remove magic around userModel, and
deprecating/removing userModel from AuthComponent.
---
cake/libs/controller/components/auth.php | 28 +++++-----------
.../libs/controller/components/auth.test.php | 33 +++++++------------
2 files changed, 20 insertions(+), 41 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index afe98c888..fafce8af8 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -154,12 +154,12 @@ class AuthComponent extends Component {
/**
* The session key name where the record of the current user is stored. If
- * unspecified, it will be "Auth.{$userModel name}".
+ * unspecified, it will be "Auth.User".
*
* @var string
* @link http://book.cakephp.org/view/1276/sessionKey
*/
- public $sessionKey = null;
+ public $sessionKey = 'Auth.User';
/**
* If using action-based access control, this defines how the paths to action
@@ -174,12 +174,16 @@ class AuthComponent extends Component {
/**
* A URL (defined as a string or array) to the controller action that handles
- * logins.
+ * logins. Defaults to `/users/login`
*
* @var mixed
* @link http://book.cakephp.org/view/1269/loginAction
*/
- public $loginAction = null;
+ public $loginAction = array(
+ 'controller' => 'users',
+ 'action' => 'login',
+ 'plugin' => null
+ );
/**
* Normally, if a user is redirected to the $loginAction page, the location they
@@ -268,8 +272,6 @@ class AuthComponent extends Component {
*/
public function initialize($controller) {
$this->request = $controller->request;
- $this->params = $this->request;
-
$this->_methods = $controller->methods;
if (Configure::read('debug') > 0) {
@@ -399,18 +401,7 @@ class AuthComponent extends Component {
* @access private
*/
function __setDefaults() {
- if (empty($this->userModel)) {
- trigger_error(__("Could not find \$userModel. Please set AuthComponent::\$userModel in beforeFilter()."), E_USER_WARNING);
- return false;
- }
- list($plugin, $model) = pluginSplit($this->userModel);
$defaults = array(
- 'loginAction' => array(
- 'controller' => Inflector::underscore(Inflector::pluralize($model)),
- 'action' => 'login',
- 'plugin' => Inflector::underscore($plugin),
- ),
- 'sessionKey' => 'Auth.' . $model,
'logoutRedirect' => $this->loginAction,
'loginError' => __('Login failed. Invalid username or password.'),
'authError' => __('You are not authorized to access that location.')
@@ -597,8 +588,7 @@ class AuthComponent extends Component {
}
if ($key == null) {
- $model = $this->getModel();
- return array($model->alias => $this->Session->read($this->sessionKey));
+ return $this->Session->read($this->sessionKey);
} else {
$user = $this->Session->read($this->sessionKey);
if (isset($user[$key])) {
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index baac8287d..df63a5019 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -582,12 +582,12 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->startup($this->Controller);
$user = $this->Controller->Auth->user();
- $expected = array('AuthUser' => array(
+ $expected = array(
'id' => 1,
'username' => 'mariano',
'created' => '2007-03-17 01:16:23',
'updated' => date('Y-m-d H:i:s')
- ));
+ );
$this->assertEqual($user, $expected);
$this->Controller->Session->delete('Auth');
@@ -660,7 +660,7 @@ class AuthTest extends CakeTestCase {
function testAuthorizeFalse() {
$this->AuthUser = new AuthUser();
$user = $this->AuthUser->find();
- $this->Controller->Session->write('Auth', $user);
+ $this->Controller->Session->write('Auth.User', $user['AuthUser']);
$this->Controller->Auth->userModel = 'AuthUser';
$this->Controller->Auth->authorize = false;
$this->Controller->request->addParams(Router::parse('auth_test/add'));
@@ -1008,7 +1008,7 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->Auth->userModel = 'AuthUser';
$this->Controller->Auth->startup($this->Controller);
- $expected = Router::normalize('/');
+ $expected = Router::normalize('/AuthTest/login');
$this->assertEqual($expected, $this->Controller->testUrl);
$this->Controller->Session->delete('Auth');
@@ -1292,25 +1292,14 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->startup($this->Controller);
$user = $this->Controller->Auth->user();
$expected = array(
- 'TestPluginAuthUser' => array(
- 'id' => 1,
- 'username' => 'gwoo',
- 'created' => '2007-03-17 01:16:23',
- 'updated' => date('Y-m-d H:i:s')
- ));
+ 'id' => 1,
+ 'username' => 'gwoo',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => date('Y-m-d H:i:s')
+ );
$this->assertEqual($user, $expected);
$sessionKey = $this->Controller->Auth->sessionKey;
- $this->assertEqual('Auth.TestPluginAuthUser', $sessionKey);
-
- $this->Controller->Auth->loginAction = null;
- $this->Controller->Auth->__setDefaults();
- $loginAction = $this->Controller->Auth->loginAction;
- $expected = array(
- 'controller' => 'test_plugin_auth_users',
- 'action' => 'login',
- 'plugin' => 'test_plugin'
- );
- $this->assertEqual($loginAction, $expected);
+ $this->assertEqual('Auth.User', $sessionKey);
// Reverting changes
Cache::delete('object_map', '_cake_core_');
@@ -1529,7 +1518,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testFlashSettings() {
- $this->Controller->Auth->Session = $this->getMock('SessionComponent', array(), array(), '', zfalse);
+ $this->Controller->Auth->Session = $this->getMock('SessionComponent', array(), array(), '', false);
$this->Controller->Auth->Session->expects($this->once())
->method('setFlash')
->with('Auth failure', 'custom', array(1), 'auth-key');
From dc8c99308efc6754feda5beea7fdebd6d2647c78 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 20 Jan 2011 17:50:18 -0500
Subject: [PATCH 250/668] Starting to remove magical login process. Updating
tests to actually test the methods they are named after.
---
cake/libs/controller/components/auth.php | 20 +----
.../libs/controller/components/auth.test.php | 84 ++++++-------------
2 files changed, 27 insertions(+), 77 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index fafce8af8..1361a8797 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -333,29 +333,11 @@ class AuthComponent extends Component {
}
if ($loginAction == $url) {
- $model = $this->getModel();
- if (empty($request->data) || !isset($request->data[$model->alias])) {
+ if (empty($request->data)) {
if (!$this->Session->check('Auth.redirect') && !$this->loginRedirect && env('HTTP_REFERER')) {
$this->Session->write('Auth.redirect', $controller->referer(null, true));
}
- return false;
}
-
- $isValid = !empty($request->data[$model->alias][$this->fields['username']]) &&
- !empty($request->data[$model->alias][$this->fields['password']]);
-
- if ($isValid) {
- if ($this->login()) {
- if ($this->autoRedirect) {
- $controller->redirect($this->redirect(), null, true);
- }
- return true;
- }
- }
-
- $this->flash($this->loginError);
- $request->data[$model->alias][$this->fields['password']] = null;
- return false;
} else {
if (!$this->user()) {
if (!$request->is('ajax')) {
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index df63a5019..923aa7e70 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -505,6 +505,8 @@ class AuthTest extends CakeTestCase {
$this->initialized = true;
Router::reload();
+
+ ClassRegistry::init('AuthUser')->updateAll(array('password' => '"' . Security::hash('cake', null, true) . '"'));
}
/**
@@ -560,71 +562,37 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testLogin() {
- $this->AuthUser = new AuthUser();
- $user['id'] = 1;
- $user['username'] = 'mariano';
- $user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
- $this->AuthUser->save($user, false);
+ $this->getMock('FormAuthenticate', array(), array(), 'AuthLoginFormAuthenticate', false);
+ $this->Controller->Auth->authenticate = array(
+ 'AuthLoginForm' => array(
+ 'userModel' => 'AuthUser'
+ )
+ );
+ $mocks = $this->Controller->Auth->constructAuthenticate();
+ $this->mockObjects[] = $mocks[0];
- $authUser = $this->AuthUser->find();
-
- $this->Controller->request->data['AuthUser'] = array(
- 'username' => $authUser['AuthUser']['username'], 'password' => 'cake'
+ $this->Controller->Auth->request->data = array(
+ 'AuthUser' => array(
+ 'username' => 'mark',
+ 'password' => Security::hash('cake', null, true)
+ )
);
- $this->Controller->request->addParams(Router::parse('auth_test/login'));
- $this->Controller->request->query['url'] = 'auth_test/login';
-
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->loginAction = 'auth_test/login';
- $this->Controller->Auth->userModel = 'AuthUser';
-
- $this->Controller->Auth->startup($this->Controller);
- $user = $this->Controller->Auth->user();
- $expected = array(
- 'id' => 1,
- 'username' => 'mariano',
- 'created' => '2007-03-17 01:16:23',
- 'updated' => date('Y-m-d H:i:s')
- );
- $this->assertEqual($user, $expected);
- $this->Controller->Session->delete('Auth');
-
- $this->Controller->request->data['AuthUser'] = array(
- 'username' => 'blah',
- 'password' => ''
+ $user = array(
+ 'id' => 1,
+ 'username' => 'mark'
);
- $this->Controller->Auth->startup($this->Controller);
+ $mocks[0]->expects($this->once())
+ ->method('authenticate')
+ ->with($this->Controller->Auth->request)
+ ->will($this->returnValue($user));
- $user = $this->Controller->Auth->user();
- $this->assertNull($user);
- $this->Controller->Session->delete('Auth');
+ $result = $this->Controller->Auth->login();
+ $this->assertTrue($result);
- $this->Controller->request->data['AuthUser'] = array(
- 'username' => 'now() or 1=1 --',
- 'password' => ''
- );
-
- $this->Controller->Auth->startup($this->Controller);
-
- $user = $this->Controller->Auth->user();
- $this->assertNull($user);
- $this->Controller->Session->delete('Auth');
-
- $this->Controller->request->data['AuthUser'] = array(
- 'username' => 'now() or 1=1 #something',
- 'password' => ''
- );
-
- $this->Controller->Auth->startup($this->Controller);
-
- $user = $this->Controller->Auth->user();
- $this->assertNull($user);
- $this->Controller->Session->delete('Auth');
-
- $this->Controller->Session->delete('Auth');
+ $this->assertTrue($this->Controller->Auth->loggedIn());
+ $this->assertEquals($user, $this->Controller->Auth->user());
}
/**
From 6eb31dfc94f83cda055f6dba3a679611cc7b7d86 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 20 Jan 2011 20:01:18 -0500
Subject: [PATCH 251/668] Removing test cases that were doing integration
testing with router, and plugin models. Plugin model tests are in
FormAuthenticate. And there is no more automatic login.
---
.../libs/controller/components/auth.test.php | 109 +-----------------
1 file changed, 1 insertion(+), 108 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 923aa7e70..12ba3e878 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1137,60 +1137,6 @@ class AuthTest extends CakeTestCase {
$this->assertEqual($return, $expected);
}
-/**
- * testCustomRoute method
- *
- * @access public
- * @return void
- */
- function testCustomRoute() {
- Router::reload();
- Router::connect(
- '/:lang/:controller/:action/*',
- array('lang' => null),
- array('lang' => '[a-z]{2,3}')
- );
-
- $url = '/en/users/login';
- $this->Controller->request->addParams(Router::parse($url));
- Router::setRequestInfo($this->Controller->request);
-
- $this->AuthUser = new AuthUser();
- $user = array(
- 'id' => 1, 'username' => 'felix',
- 'password' => Security::hash(Configure::read('Security.salt') . 'cake'
- ));
- $user = $this->AuthUser->save($user, false);
-
- $this->Controller->request->data['AuthUser'] = array('username' => 'felix', 'password' => 'cake');
- $this->Controller->request->query['url'] = substr($url, 1);
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('lang' => 'en', 'controller' => 'users', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
-
- $this->Controller->Auth->startup($this->Controller);
- $user = $this->Controller->Auth->user();
- $this->assertTrue(!!$user);
-
- $this->Controller->Session->delete('Auth');
- Router::reload();
- Router::connect('/', array('controller' => 'people', 'action' => 'login'));
- $url = '/';
- $this->Controller->request->addParams(Router::parse($url));
- Router::setRequestInfo(array($this->Controller->passedArgs, array(
- 'base' => null, 'here' => $url, 'webroot' => '/', 'passedArgs' => array(),
- 'argSeparator' => ':', 'namedArgs' => array()
- )));
- $this->Controller->request->data['AuthUser'] = array('username' => 'felix', 'password' => 'cake');
- $this->Controller->request->query['url'] = substr($url, 1);
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('controller' => 'people', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
-
- $this->Controller->Auth->startup($this->Controller);
- $user = $this->Controller->Auth->user();
- $this->assertTrue(!!$user);
- }
/**
* testAdminRoute method
@@ -1221,60 +1167,6 @@ class AuthTest extends CakeTestCase {
Configure::write('Routing.prefixes', $prefixes);
}
-/**
- * testPluginModel method
- *
- * @access public
- * @return void
- */
- function testPluginModel() {
- // Adding plugins
- Cache::delete('object_map', '_cake_core_');
- App::build(array(
- 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
- 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)
- ), true);
- App::objects('plugin', null, false);
-
- $PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser');
- $user['id'] = 1;
- $user['username'] = 'gwoo';
- $user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
- $PluginModel->save($user, false);
-
- $authUser = $PluginModel->find();
-
- $this->Controller->request->data['TestPluginAuthUser'] = array(
- 'username' => $authUser['TestPluginAuthUser']['username'],
- 'password' => 'cake'
- );
-
- $this->Controller->request->addParams(Router::parse('auth_test/login'));
- $this->Controller->request->query['url'] = 'auth_test/login';
-
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->loginAction = 'auth_test/login';
- $this->Controller->Auth->userModel = 'TestPlugin.TestPluginAuthUser';
-
- $this->Controller->Auth->startup($this->Controller);
- $user = $this->Controller->Auth->user();
- $expected = array(
- 'id' => 1,
- 'username' => 'gwoo',
- 'created' => '2007-03-17 01:16:23',
- 'updated' => date('Y-m-d H:i:s')
- );
- $this->assertEqual($user, $expected);
- $sessionKey = $this->Controller->Auth->sessionKey;
- $this->assertEqual('Auth.User', $sessionKey);
-
- // Reverting changes
- Cache::delete('object_map', '_cake_core_');
- App::build();
- App::objects('plugin', null, false);
- }
-
/**
* testAjaxLogin method
*
@@ -1389,6 +1281,7 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->request->query['url'] = substr($url, 1);
$this->Controller->Auth->startup($this->Controller);
+ $this->Controller->Auth->login();
$user = $this->Controller->Auth->user();
$this->assertTrue(!!$user);
From f2bba3d36e58347e7c444272c51007615550e8d4 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 20 Jan 2011 20:10:46 -0500
Subject: [PATCH 252/668] Adding tests for AuthComponent::redirect() previously
there weren't any.
---
.../libs/controller/components/auth.test.php | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 12ba3e878..685c48740 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1391,4 +1391,46 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->Auth->flash('Auth failure');
}
+
+/**
+ * test the various states of Auth::redirect()
+ *
+ * @return void
+ */
+ function testRedirectSet() {
+ $value = array('controller' => 'users', 'action' => 'home');
+ $result = $this->Controller->Auth->redirect($value);
+ $this->assertEquals('/users/home', $result);
+ $this->assertEquals($value, $this->Controller->Session->read('Auth.redirect'));
+ }
+
+/**
+ * test redirect using Auth.redirect from the session.
+ *
+ * @return void
+ */
+ function testRedirectSessionRead() {
+ $this->Controller->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
+ $this->Controller->Session->write('Auth.redirect', '/users/home');
+
+ $result = $this->Controller->Auth->redirect();
+ $this->assertEquals('/users/home', $result);
+ $this->assertFalse($this->Controller->Session->check('Auth.redirect'));
+ }
+
+/**
+ * test that redirect does not return loginAction if that is what's stored in Auth.redirect.
+ * instead loginRedirect should be used.
+ *
+ * @return void
+ */
+ function testRedirectSessionReadEqualToLoginAction() {
+ $this->Controller->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
+ $this->Controller->Auth->loginRedirect = array('controller' => 'users', 'action' => 'home');
+ $this->Controller->Session->write('Auth.redirect', array('controller' => 'users', 'action' => 'login'));
+
+ $result = $this->Controller->Auth->redirect();
+ $this->assertEquals('/users/home', $result);
+ $this->assertFalse($this->Controller->Session->check('Auth.redirect'));
+ }
}
From ed122c70f46a6e591727e6c8743a009f4ac7bf5e Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 20 Jan 2011 21:22:54 -0500
Subject: [PATCH 253/668] Removing custom request reversal code, and using
Router::reverse() Removing dead tests that are covered by Router tests.
Removing check for TestsController, it hasn't existed in forever.
---
cake/libs/controller/components/auth.php | 21 ++++---------------
.../libs/controller/components/auth.test.php | 15 +------------
2 files changed, 5 insertions(+), 31 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 1361a8797..d398392de 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -288,11 +288,7 @@ class AuthComponent extends Component {
* @return boolean
*/
public function startup($controller) {
- $isErrorOrTests = (
- strtolower($controller->name) == 'cakeerror' ||
- (strtolower($controller->name) == 'tests' && Configure::read('debug') > 0)
- );
- if ($isErrorOrTests) {
+ if ($controller->name == 'CakeError') {
return true;
}
@@ -342,12 +338,7 @@ class AuthComponent extends Component {
if (!$this->user()) {
if (!$request->is('ajax')) {
$this->flash($this->authError);
- if (!empty($request->query) && count($request->query) >= 2) {
- $query = $request->query;
- unset($query['url'], $query['ext']);
- $url .= Router::queryString($query, array());
- }
- $this->Session->write('Auth.redirect', $url);
+ $this->Session->write('Auth.redirect', Router::reverse($request));
$controller->redirect($loginAction);
return false;
} elseif (!empty($this->ajaxLogin)) {
@@ -361,11 +352,7 @@ class AuthComponent extends Component {
}
}
- if (!$this->authorize) {
- return true;
- }
-
- if ($this->isAuthorized()) {
+ if (empty($this->authorize) || $this->isAuthorized()) {
return true;
}
@@ -519,7 +506,7 @@ class AuthComponent extends Component {
/**
* Log a user in. If a $user is provided that data will be stored as the logged in user. If `$user` is empty or not
- * specified, POST data from the current request will be used to identify a user. If the login was successful,
+ * specified, the request will be used to identify a user. If the identification was successful,
* the user record is written to the session key specified in AuthComponent::$sessionKey.
*
* @param mixed $user Either an array of user data, or null to identify a user using the current request.
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 685c48740..7783c5d29 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -943,17 +943,6 @@ class AuthTest extends CakeTestCase {
$this->Controller->Session->delete('Auth');
- $this->Controller->request->query['url'] = 'admin/';
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->loginRedirect = null;
- $this->Controller->Auth->startup($this->Controller);
- $expected = Router::normalize('admin/');
- $this->assertTrue($this->Controller->Session->check('Message.auth'));
- $this->assertEqual($expected, $this->Controller->Auth->redirect());
-
- $this->Controller->Session->delete('Auth');
-
//empty referer no session
$_SERVER['HTTP_REFERER'] = false;
$_ENV['HTTP_REFERER'] = false;
@@ -969,7 +958,6 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->initialize($this->Controller);
$this->Controller->Auth->authorize = 'controller';
- $this->Controller->request['testControllerAuth'] = true;
$this->Controller->Auth->loginAction = array(
'controller' => 'AuthTest', 'action' => 'login'
@@ -1041,8 +1029,7 @@ class AuthTest extends CakeTestCase {
$_GET = array(
'url' => '/posts/index/29',
'print' => 'true',
- 'refer' => 'menu',
- 'ext' => 'html'
+ 'refer' => 'menu'
);
$this->Controller->Session->delete('Auth');
$url = '/posts/index/29';
From e155e6acbaa35a16339ce93d6a4ca52c9d769743 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 20 Jan 2011 21:34:39 -0500
Subject: [PATCH 254/668] Adding doc block usage information.
---
cake/libs/controller/components/auth.php | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index d398392de..ad2ab464b 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -444,6 +444,15 @@ class AuthComponent extends Component {
* Takes a list of actions in the current controller for which authentication is not required, or
* no parameters to allow all actions.
*
+ * You can use allow with either an array, or var args.
+ *
+ * `$this->Auth->allow(array('edit', 'add'));`
+ * `$this->Auth->allow('edit', 'add');`
+ *
+ * allow() also supports '*' as a wildcard to mean all actions.
+ *
+ * `$this->Auth->allow('*');`
+ *
* @param mixed $action Controller action name or array of actions
* @param string $action Controller action name
* @param string ... etc.
@@ -463,7 +472,12 @@ class AuthComponent extends Component {
}
/**
- * Removes items from the list of allowed actions.
+ * Removes items from the list of allowed/no authentication required actions.
+ *
+ * You can use deny with either an array, or var args.
+ *
+ * `$this->Auth->deny(array('edit', 'add'));`
+ * `$this->Auth->deny('edit', 'add');`
*
* @param mixed $action Controller action name or array of actions
* @param string $action Controller action name
From 23db2f086efcacaeb982eac134ae7163807ea59a Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 20 Jan 2011 21:39:59 -0500
Subject: [PATCH 255/668] Adding more documentation.
---
cake/libs/controller/components/auth.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index ad2ab464b..5a477cae4 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -582,7 +582,9 @@ class AuthComponent extends Component {
}
/**
- * If no parameter is passed, gets the authentication redirect URL.
+ * If no parameter is passed, gets the authentication redirect URL. Pass a url in to
+ * set the destination a user should be redirected to upon logging in. Will fallback to
+ * AuthComponent::$loginRedirect if there is no stored redirect value.
*
* @param mixed $url Optional URL to write as the login redirect URL.
* @return string Redirect URL
From fd8fb1225d3da750c465f972758c98a9741607b5 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 16:22:29 -0500
Subject: [PATCH 256/668] Removing automatic password hashing from
AuthComponent. Its a frustrating feature that often befuddles new users, and
can be plain annoying sometimes. Moving hashing into FormAuthenticate.
Updating tests.
---
cake/libs/controller/components/auth.php | 27 +-------------
.../components/auth/form_authenticate.php | 12 ++++++-
.../libs/controller/components/auth.test.php | 36 -------------------
.../auth/form_authenticate.test.php | 10 +++---
4 files changed, 17 insertions(+), 68 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 5a477cae4..fb878472f 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -308,8 +308,7 @@ class AuthComponent extends Component {
return false;
}
$request = $controller->request;
-
- $this->request->data = $controller->request->data = $this->hashPasswords($request->data);
+
$url = '';
if (isset($request->query['url'])) {
@@ -717,30 +716,6 @@ class AuthComponent extends Component {
return $this->_authenticateObjects;
}
-/**
- * Hash any passwords found in $data using $userModel and $fields['password']
- *
- * @param array $data Set of data to look for passwords
- * @return array Data with passwords hashed
- * @link http://book.cakephp.org/view/1259/hashPasswords
- */
- public function hashPasswords($data) {
- if (is_object($this->authenticate) && method_exists($this->authenticate, 'hashPasswords')) {
- return $this->authenticate->hashPasswords($data);
- }
-
- if (is_array($data)) {
- $model = $this->getModel();
-
- if(isset($data[$model->alias])) {
- if (isset($data[$model->alias][$this->fields['username']]) && isset($data[$model->alias][$this->fields['password']])) {
- $data[$model->alias][$this->fields['password']] = $this->password($data[$model->alias][$this->fields['password']]);
- }
- }
- }
- return $data;
- }
-
/**
* Hash a password with the application's salt value (as defined with Configure::write('Security.salt');
*
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index d536499b5..f0d9f862c 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -86,7 +86,7 @@ class FormAuthenticate {
}
$conditions = array(
$model . '.' . $fields['username'] => $request->data[$model][$fields['username']],
- $model . '.' . $fields['password'] => $request->data[$model][$fields['password']],
+ $model . '.' . $fields['password'] => $this->hash($request->data[$model][$fields['password']]),
);
if (!empty($this->settings['scope'])) {
$conditions = array_merge($conditions, $this->settings['scope']);
@@ -101,4 +101,14 @@ class FormAuthenticate {
unset($result[$model][$fields['password']]);
return $result[$model];
}
+
+/**
+ * Hash the supplied password using the configured hashing method.
+ *
+ * @param string $password The password to hash.
+ * @return string Hashed string
+ */
+ public function hash($password) {
+ return Security::hash($password, null, true);
+ }
}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 7783c5d29..4180256f9 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1089,42 +1089,6 @@ class AuthTest extends CakeTestCase {
$this->assertTrue($result, 'Auth redirected a missing action %s');
}
-/**
- * test Hashing of passwords
- *
- * @return void
- */
- function testHashPasswords() {
- $this->Controller->Auth->userModel = 'AuthUser';
-
- $data['AuthUser']['password'] = 'superSecret';
- $data['AuthUser']['username'] = 'superman@dailyplanet.com';
- $return = $this->Controller->Auth->hashPasswords($data);
- $expected = $data;
- $expected['AuthUser']['password'] = Security::hash($expected['AuthUser']['password'], null, true);
- $this->assertEqual($return, $expected);
-
- $data['Wrong']['password'] = 'superSecret';
- $data['Wrong']['username'] = 'superman@dailyplanet.com';
- $data['AuthUser']['password'] = 'IcantTellYou';
- $return = $this->Controller->Auth->hashPasswords($data);
- $expected = $data;
- $expected['AuthUser']['password'] = Security::hash($expected['AuthUser']['password'], null, true);
- $this->assertEqual($return, $expected);
-
- $xml = array(
- 'User' => array(
- 'username' => 'batman@batcave.com',
- 'password' => 'bruceWayne',
- )
- );
- $data = new Xml($xml);
- $return = $this->Controller->Auth->hashPasswords($data);
- $expected = $data;
- $this->assertEqual($return, $expected);
- }
-
-
/**
* testAdminRoute method
*
diff --git a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
index 0c5e36a18..de4600e6d 100644
--- a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
@@ -41,8 +41,8 @@ class FormAuthenticateTest extends CakeTestCase {
'fields' => array('username' => 'user', 'password' => 'password'),
'userModel' => 'User'
));
- $this->password = Security::hash('password', null, true);
- ClassRegistry::init('User')->updateAll(array('password' => '"' . $this->password . '"'));
+ $password = Security::hash('password', null, true);
+ ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"'));
}
/**
@@ -116,7 +116,7 @@ class FormAuthenticateTest extends CakeTestCase {
$request = new CakeRequest('posts/index', false);
$request->data = array('User' => array(
'user' => 'mariano',
- 'password' => $this->password
+ 'password' => 'password'
));
$result = $this->auth->authenticate($request);
$expected = array(
@@ -138,7 +138,7 @@ class FormAuthenticateTest extends CakeTestCase {
$request = new CakeRequest('posts/index', false);
$request->data = array('User' => array(
'user' => 'mariano',
- 'password' => $this->password
+ 'password' => 'password'
));
$this->assertFalse($this->auth->authenticate($request));
@@ -168,7 +168,7 @@ class FormAuthenticateTest extends CakeTestCase {
$request = new CakeRequest('posts/index', false);
$request->data = array('TestPluginAuthUser' => array(
'username' => 'gwoo',
- 'password' => Security::hash('cake', null, true)
+ 'password' => 'cake'
));
$result = $this->auth->authenticate($request);
From dc03e4f26cef743ef216189134b9e8b2531cf317 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 16:24:43 -0500
Subject: [PATCH 257/668] Moving an import.
---
cake/libs/controller/components/auth/form_authenticate.php | 1 +
.../libs/controller/components/auth/form_authenticate.test.php | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index f0d9f862c..ce4a6e7c9 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -12,6 +12,7 @@
* @link http://cakephp.org CakePHP(tm) Project
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::import('Core', 'Security');
/**
* An authentication adapter for AuthComponent. Provides the ability to authenticate using POST
diff --git a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
index de4600e6d..b2218a75b 100644
--- a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
@@ -17,7 +17,6 @@
App::import('Component', 'auth/form_authenticate');
App::import('Model', 'AppModel');
App::import('Core', 'CakeRequest');
-App::import('Core', 'Security');
require_once CAKE_TESTS . 'cases' . DS . 'libs' . DS . 'model' . DS . 'models.php';
From 28ad51c92b205ebef2447acd5b9ab3d8094a7883 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 16:25:04 -0500
Subject: [PATCH 258/668] Removing action() from AuthComponent, its in the
authorization objects now. Updating tests.
---
cake/libs/controller/components/auth.php | 18 ------------
.../libs/controller/components/auth.test.php | 29 -------------------
2 files changed, 47 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index fb878472f..ea7b6e69c 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -627,24 +627,6 @@ class AuthComponent extends Component {
return $this->Acl->check($user, $object, $action);
}
-/**
- * Returns the path to the ACO node bound to a controller/action.
- *
- * @param string $action Optional. The controller/action path to validate the
- * user against. The current request action is used if
- * none is specified.
- * @return boolean ACO node path
- * @link http://book.cakephp.org/view/1256/action
- */
- public function action($action = ':plugin/:controller/:action') {
- $plugin = empty($this->request['plugin']) ? null : Inflector::camelize($this->request['plugin']) . '/';
- return str_replace(
- array(':controller', ':action', ':plugin/'),
- array(Inflector::camelize($this->request['controller']), $this->request['action'], $plugin),
- $this->actionPath . $action
- );
- }
-
/**
* Returns a reference to the model object specified, and attempts
* to load it if it is not found.
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 4180256f9..94f3b8d7b 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -817,35 +817,6 @@ class AuthTest extends CakeTestCase {
$this->assertFalse($this->Controller->Auth->startup($this->Controller));
}
-/**
- * test the action() method
- *
- * @return void
- */
- function testActionMethod() {
- $this->Controller->request['controller'] = 'auth_test';
- $this->Controller->request['action'] = 'add';
-
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->actionPath = 'ROOT/';
-
- $result = $this->Controller->Auth->action();
- $this->assertEqual($result, 'ROOT/AuthTest/add');
-
- $result = $this->Controller->Auth->action(':controller');
- $this->assertEqual($result, 'ROOT/AuthTest');
-
- $result = $this->Controller->Auth->action(':controller');
- $this->assertEqual($result, 'ROOT/AuthTest');
-
- $this->Controller->request['plugin'] = 'test_plugin';
- $this->Controller->request['controller'] = 'auth_test';
- $this->Controller->request['action'] = 'add';
- $this->Controller->Auth->initialize($this->Controller);
- $result = $this->Controller->Auth->action();
- $this->assertEqual($result, 'ROOT/TestPlugin/AuthTest/add');
- }
-
/**
* test that deny() converts camel case inputs to lowercase.
*
From 66f5ae07ed4a9a376b6340a604b6573670b0c100 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 16:27:52 -0500
Subject: [PATCH 259/668] Removing AuthComponent::validate() there are no tests
and no documentation on this method. It also uses components that may or may
not exist even in the old implementation.
---
cake/libs/controller/components/auth.php | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index ea7b6e69c..c6b1e412a 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -605,28 +605,6 @@ class AuthComponent extends Component {
return Router::normalize($redir);
}
-/**
- * Validates a user against an abstract object.
- *
- * @param mixed $object The object to validate the user against.
- * @param mixed $user Optional. The identity of the user to be validated.
- * Uses the current user session if none specified. For
- * valid forms of identifying users, see
- * AuthComponent::identify().
- * @param string $action Optional. The action to validate against.
- * @see AuthComponent::identify()
- * @return boolean True if the user validates, false otherwise.
- */
- public function validate($object, $user = null, $action = null) {
- if (empty($user)) {
- $user = $this->user();
- }
- if (empty($user)) {
- return false;
- }
- return $this->Acl->check($user, $object, $action);
- }
-
/**
* Returns a reference to the model object specified, and attempts
* to load it if it is not found.
From 35864c2a02c5bb54731a7eba41878e4524b85830 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 16:28:59 -0500
Subject: [PATCH 260/668] Removing AuthComponent::getModel(). Auth no longer
directly interacts with models.
---
cake/libs/controller/components/auth.php | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index c6b1e412a..6e02e13d3 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -605,29 +605,6 @@ class AuthComponent extends Component {
return Router::normalize($redir);
}
-/**
- * Returns a reference to the model object specified, and attempts
- * to load it if it is not found.
- *
- * @param string $name Model name (defaults to AuthComponent::$userModel)
- * @return object A reference to a model object
- */
- public function &getModel($name = null) {
- $model = null;
- if (!$name) {
- $name = $this->userModel;
- }
-
- $model = ClassRegistry::init($name);
-
- if (empty($model)) {
- trigger_error(__('Auth::getModel() - Model is not set or could not be found'), E_USER_WARNING);
- return null;
- }
-
- return $model;
- }
-
/**
* Use the configured authentication adapters, and attempt to identify the user
* by credentials contained in $request.
From b207ee8cbe2716f241137ba000e2c91132b740f2 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 16:55:02 -0500
Subject: [PATCH 261/668] Making AuthComponent::user static, so user data can
be fetched from anywhere.
---
cake/libs/controller/components/auth.php | 20 +++++++++----------
.../libs/controller/components/auth.test.php | 7 ++-----
2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 6e02e13d3..7dd94840e 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -21,6 +21,7 @@
App::import('Core', 'Router', false);
App::import('Core', 'Security', false);
+App::import('Core', 'CakeSession', false);
App::import('Component', 'auth/base_authorize');
/**
@@ -159,7 +160,7 @@ class AuthComponent extends Component {
* @var string
* @link http://book.cakephp.org/view/1276/sessionKey
*/
- public $sessionKey = 'Auth.User';
+ public static $sessionKey = 'Auth.User';
/**
* If using action-based access control, this defines how the paths to action
@@ -445,7 +446,7 @@ class AuthComponent extends Component {
*
* You can use allow with either an array, or var args.
*
- * `$this->Auth->allow(array('edit', 'add'));`
+ * `$this->Auth->allow(array('edit', 'add'));` or
* `$this->Auth->allow('edit', 'add');`
*
* allow() also supports '*' as a wildcard to mean all actions.
@@ -475,7 +476,7 @@ class AuthComponent extends Component {
*
* You can use deny with either an array, or var args.
*
- * `$this->Auth->deny(array('edit', 'add'));`
+ * `$this->Auth->deny(array('edit', 'add'));` or
* `$this->Auth->deny('edit', 'add');`
*
* @param mixed $action Controller action name or array of actions
@@ -534,7 +535,7 @@ class AuthComponent extends Component {
$user = $this->identify($this->request);
}
if ($user) {
- $this->Session->write($this->sessionKey, $user);
+ $this->Session->write(self::$sessionKey, $user);
$this->_loggedIn = true;
}
return $this->_loggedIn;
@@ -550,7 +551,7 @@ class AuthComponent extends Component {
*/
public function logout() {
$this->__setDefaults();
- $this->Session->delete($this->sessionKey);
+ $this->Session->delete(self::$sessionKey);
$this->Session->delete('Auth.redirect');
$this->_loggedIn = false;
return Router::normalize($this->logoutRedirect);
@@ -563,16 +564,15 @@ class AuthComponent extends Component {
* @return mixed User record. or null if no user is logged in.
* @link http://book.cakephp.org/view/1264/user
*/
- public function user($key = null) {
- $this->__setDefaults();
- if (!$this->Session->check($this->sessionKey)) {
+ public static function user($key = null) {
+ if (!CakeSession::check(self::$sessionKey)) {
return null;
}
if ($key == null) {
- return $this->Session->read($this->sessionKey);
+ return CakeSession::read(self::$sessionKey);
} else {
- $user = $this->Session->read($this->sessionKey);
+ $user = CakeSession::read(self::$sessionKey);
if (isset($user[$key])) {
return $user[$key];
}
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 94f3b8d7b..1f3a2a49b 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -1178,8 +1178,7 @@ class AuthTest extends CakeTestCase {
'Auth' => array(
'fields' => array('username' => 'email', 'password' => 'password'),
'loginAction' => array('controller' => 'people', 'action' => 'login'),
- 'userModel' => 'AuthUserCustomField',
- 'sessionKey' => 'AltAuth.AuthUserCustomField'
+ 'userModel' => 'AuthUserCustomField'
),
'Session'
);
@@ -1212,14 +1211,12 @@ class AuthTest extends CakeTestCase {
'fields' => array('username' => 'email', 'password' => 'password'),
'loginAction' => array('controller' => 'people', 'action' => 'login'),
'logoutRedirect' => array('controller' => 'people', 'action' => 'login'),
- 'userModel' => 'AuthUserCustomField',
- 'sessionKey' => 'AltAuth.AuthUserCustomField'
+ 'userModel' => 'AuthUserCustomField'
);
$this->assertEqual($expected['fields'], $this->Controller->Auth->fields);
$this->assertEqual($expected['loginAction'], $this->Controller->Auth->loginAction);
$this->assertEqual($expected['logoutRedirect'], $this->Controller->Auth->logoutRedirect);
$this->assertEqual($expected['userModel'], $this->Controller->Auth->userModel);
- $this->assertEqual($expected['sessionKey'], $this->Controller->Auth->sessionKey);
}
/**
From 41819975e869beeb9b42ffe10c68612f7baf5d62 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 17:04:10 -0500
Subject: [PATCH 262/668] Removing a dead property.
---
cake/libs/controller/components/auth.php | 6 ------
1 file changed, 6 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 7dd94840e..7b41e499f 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -209,12 +209,6 @@ class AuthComponent extends Component {
*/
public $logoutRedirect = null;
-/**
- * The name of model or model object, or any other object has an isAuthorized method.
- *
- * @var string
- */
- public $object = null;
/**
* Error to display when user login fails. For security purposes, only one error is used for all
From ee804c6f8cef2c4f0b99f678847cc7a126086222 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 17:55:04 -0500
Subject: [PATCH 263/668] Removing properties from AuthComponent that have been
moved to authentication and authorization objects. Adding the '*' key to
allow code to stay DRY, also adding a constant for ALL, so there aren't as
many magic strings around. Updating tests.
---
cake/libs/controller/components/auth.php | 145 ++++++++----------
.../libs/controller/components/auth.test.php | 24 +--
2 files changed, 76 insertions(+), 93 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 7b41e499f..5f4631ab8 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -34,6 +34,8 @@ App::import('Component', 'auth/base_authorize');
*/
class AuthComponent extends Component {
+ const ALL = '*';
+
/**
* Maintains current user login state.
*
@@ -52,7 +54,30 @@ class AuthComponent extends Component {
* An array of authentication objects to use for authenticating users. You can configure
* multiple adapters and they will be checked sequentially when users are identified.
*
- * @var object
+ * {{{
+ * $this->Auth->authenticate = array(
+ * 'Form' => array(
+ * 'userModel' => 'Users.User'
+ * )
+ * );
+ * }}}
+ *
+ * Using the class name without 'Authenticate' as the key, you can pass in an array of settings for each
+ * authentication object. Additionally you can define settings that should be set to all authentications objects
+ * using the '*' key:
+ *
+ * {{{
+ * $this->Auth->authenticate = array(
+ * '*' => array(
+ * 'userModel' => 'Users.User',
+ * 'scope' => array('User.active' => 1)
+ * ),
+ * 'Form',
+ * 'Basic'
+ * );
+ * }}}
+ *
+ * @var array
* @link http://book.cakephp.org/view/1278/authenticate
*/
public $authenticate = array('Form');
@@ -64,22 +89,32 @@ class AuthComponent extends Component {
*/
protected $_authenticateObjects = array();
-/**
- * A hash mapping legacy properties => to settings passed into Authenticate objects.
- *
- * @var string
- * @deprecated Will be removed in 2.1+
- */
- protected $_authenticateLegacyMap = array(
- 'userModel' => 'userModel',
- 'userScope' => 'scope',
- 'fields' => 'fields'
- );
-
/**
* An array of authorization objects to use for authorizing users. You can configure
* multiple adapters and they will be checked sequentially when authorization checks are done.
*
+ * {{{
+ * $this->Auth->authorize = array(
+ * 'Crud' => array(
+ * 'actionPath' => 'controllers/'
+ * )
+ * );
+ * }}}
+ *
+ * Using the class name without 'Authorize' as the key, you can pass in an array of settings for each
+ * authorization object. Additionally you can define settings that should be set to all authorization objects
+ * using the '*' key:
+ *
+ * {{{
+ * $this->Auth->authorize = array(
+ * '*' => array(
+ * 'actionPath' => 'controllers/'
+ * ),
+ * 'Crud',
+ * 'CustomAuth'
+ * );
+ * }}}
+ *
* @var mixed
* @link http://book.cakephp.org/view/1275/authorize
*/
@@ -92,16 +127,6 @@ class AuthComponent extends Component {
*/
protected $_authorizeObjects = array();
-/**
- * A hash mapping legacy properties => to settings passed into Authorize objects.
- *
- * @var string
- * @deprecated Will be removed in 2.1+
- */
- protected $_authorizeLegacyMap = array(
- 'actionPath' => 'actionPath',
- );
-
/**
* The name of an optional view element to render when an Ajax request is made
* with an invalid or expired session
@@ -127,32 +152,6 @@ class AuthComponent extends Component {
'params' => array()
);
-/**
- * The name of the model that represents users which will be authenticated. Defaults to 'User'.
- *
- * @var string
- * @link http://book.cakephp.org/view/1266/userModel
- */
- public $userModel = 'User';
-
-/**
- * Additional query conditions to use when looking up and authenticating users,
- * i.e. array('User.is_active' => 1).
- *
- * @var array
- * @link http://book.cakephp.org/view/1268/userScope
- */
- public $userScope = array();
-
-/**
- * Allows you to specify non-default login name and password fields used in
- * $userModel, i.e. array('username' => 'login_name', 'password' => 'passwd').
- *
- * @var array
- * @link http://book.cakephp.org/view/1267/fields
- */
- public $fields = array('username' => 'username', 'password' => 'password');
-
/**
* The session key name where the record of the current user is stored. If
* unspecified, it will be "Auth.User".
@@ -162,17 +161,6 @@ class AuthComponent extends Component {
*/
public static $sessionKey = 'Auth.User';
-/**
- * If using action-based access control, this defines how the paths to action
- * ACO nodes is computed. If, for example, all controller nodes are nested
- * under an ACO node named 'Controllers', $actionPath should be set to
- * "Controllers/".
- *
- * @var string
- * @link http://book.cakephp.org/view/1279/actionPath
- */
- public $actionPath = null;
-
/**
* A URL (defined as a string or array) to the controller action that handles
* logins. Defaults to `/users/login`
@@ -209,7 +197,6 @@ class AuthComponent extends Component {
*/
public $logoutRedirect = null;
-
/**
* Error to display when user login fails. For security purposes, only one error is used for all
* login failures, so as not to expose information on why the login failed.
@@ -228,14 +215,6 @@ class AuthComponent extends Component {
*/
public $authError = null;
-/**
- * Determines whether AuthComponent will automatically redirect and exit if login is successful.
- *
- * @var boolean
- * @link http://book.cakephp.org/view/1274/autoRedirect
- */
- public $autoRedirect = true;
-
/**
* Controller actions for which user validation is not required.
*
@@ -416,7 +395,13 @@ class AuthComponent extends Component {
return;
}
$this->_authorizeObjects = array();
- foreach (Set::normalize($this->authorize) as $class => $settings) {
+ $config = Set::normalize($this->authorize);
+ $global = array();
+ if (isset($config[AuthComponent::ALL])) {
+ $global = $config[AuthComponent::ALL];
+ unset($config[AuthComponent::ALL]);
+ }
+ foreach ($config as $class => $settings) {
$className = $class . 'Authorize';
if (!class_exists($className) && !App::import('Component', 'auth/' . $class . '_authorize')) {
throw new CakeException(__('Authorization adapter "%s" was not found.', $class));
@@ -424,11 +409,7 @@ class AuthComponent extends Component {
if (!method_exists($className, 'authorize')) {
throw new CakeException(__('Authorization objects must implement an authorize method.'));
}
- foreach ($this->_authorizeLegacyMap as $old => $new) {
- if (empty($settings[$new]) && !empty($this->{$old})) {
- $settings[$new] = $this->{$old};
- }
- }
+ $settings = array_merge($global, (array)$settings);
$this->_authorizeObjects[] = new $className($this->_Collection->getController(), $settings);
}
return $this->_authorizeObjects;
@@ -629,7 +610,13 @@ class AuthComponent extends Component {
return;
}
$this->_authenticateObjects = array();
- foreach (Set::normalize($this->authenticate) as $class => $settings) {
+ $config = Set::normalize($this->authenticate);
+ $global = array();
+ if (isset($config[AuthComponent::ALL])) {
+ $global = $config[AuthComponent::ALL];
+ unset($config[AuthComponent::ALL]);
+ }
+ foreach ($config as $class => $settings) {
$className = $class . 'Authenticate';
if (!class_exists($className) && !App::import('Component', 'auth/' . $class . '_authenticate')) {
throw new CakeException(__('Authentication adapter "%s" was not found.', $class));
@@ -637,11 +624,7 @@ class AuthComponent extends Component {
if (!method_exists($className, 'authenticate')) {
throw new CakeException(__('Authentication objects must implement an authenticate method.'));
}
- foreach ($this->_authenticateLegacyMap as $old => $new) {
- if (empty($settings[$new]) && !empty($this->{$old})) {
- $settings[$new] = $this->{$old};
- }
- }
+ $settings = array_merge((array)$settings, $global);
$this->_authenticateObjects[] = new $className($settings);
}
return $this->_authenticateObjects;
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 1f3a2a49b..bb5d5e29b 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -744,14 +744,15 @@ class AuthTest extends CakeTestCase {
}
/**
- * test that loadAuthorize merges in legacy authorize settings.
+ * test the * key with authenticate
*
* @return void
*/
- function testLoadAuthorizeSettingsPass() {
- $this->Controller->Auth->actionPath = 'controllers/';
-
- $this->Controller->Auth->authorize = array('Actions');
+ function testAllConfigWithAuthorize() {
+ $this->Controller->Auth->authorize = array(
+ AuthComponent::ALL => array('actionPath' => 'controllers/'),
+ 'Actions'
+ );
$objects = $this->Controller->Auth->constructAuthorize();
$result = $objects[0];
$this->assertEquals($result->settings['actionPath'], 'controllers/');
@@ -774,16 +775,15 @@ class AuthTest extends CakeTestCase {
}
/**
- * test that loadAuthenticate merges in legacy authentication settings.
+ * test the * key with authenticate
*
* @return void
*/
- function testLoadAuthenticateSettingsPass() {
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->userScope = array('AuthUser.active' => 1);
- $this->Controller->Auth->fields = array('username' => 'user', 'password' => 'passwd');
-
- $this->Controller->Auth->authenticate = array('Form');
+ function testAllConfigWithAuthenticate() {
+ $this->Controller->Auth->authenticate = array(
+ AuthComponent::ALL => array('userModel' => 'AuthUser'),
+ 'Form'
+ );
$objects = $this->Controller->Auth->constructAuthenticate();
$result = $objects[0];
$this->assertEquals($result->settings['userModel'], 'AuthUser');
From 041e0a65aca39e77f960e127228953b3947d003a Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 18:09:41 -0500
Subject: [PATCH 264/668] Extracting a base class.
---
.../components/auth/base_authenticate.php | 69 +++++++++++++++++++
.../components/auth/form_authenticate.php | 41 +----------
2 files changed, 71 insertions(+), 39 deletions(-)
create mode 100644 cake/libs/controller/components/auth/base_authenticate.php
diff --git a/cake/libs/controller/components/auth/base_authenticate.php b/cake/libs/controller/components/auth/base_authenticate.php
new file mode 100644
index 000000000..2bc8ad725
--- /dev/null
+++ b/cake/libs/controller/components/auth/base_authenticate.php
@@ -0,0 +1,69 @@
+ 1).`
+ *
+ * @var array
+ */
+ public $settings = array(
+ 'fields' => array(
+ 'username' => 'username',
+ 'password' => 'password'
+ ),
+ 'userModel' => 'User',
+ 'scope' => array()
+ );
+
+/**
+ * Constructor
+ *
+ * @param array $settings Array of settings to use.
+ */
+ public function __construct($settings) {
+ $this->settings = Set::merge($this->settings, $settings);
+ }
+
+/**
+ * Hash the supplied password using the configured hashing method.
+ *
+ * @param string $password The password to hash.
+ * @return string Hashed string
+ */
+ public function hash($password) {
+ return Security::hash($password, null, true);
+ }
+
+/**
+ * Authenticate a user based on the request information.
+ *
+ * @param CakeRequest $request Request to get authentication information from.
+ * @return mixed Either false on failure, or an array of user data on success.
+ */
+ abstract public function authenticate(CakeRequest $request);
+}
\ No newline at end of file
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index ce4a6e7c9..3f284eaf2 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -12,7 +12,7 @@
* @link http://cakephp.org CakePHP(tm) Project
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Security');
+App::import('Component', 'auth/base_authenticate');
/**
* An authentication adapter for AuthComponent. Provides the ability to authenticate using POST
@@ -33,35 +33,7 @@ App::import('Core', 'Security');
* @since 2.0
* @see AuthComponent::$authenticate
*/
-class FormAuthenticate {
-
-/**
- * Settings for this object.
- *
- * - `fields` The fields to use to identify a user by.
- * - `userModel` The model name of the User, defaults to User.
- * - `scope` Additional conditions to use when looking up and authenticating users,
- * i.e. `array('User.is_active' => 1).`
- *
- * @var array
- */
- public $settings = array(
- 'fields' => array(
- 'username' => 'username',
- 'password' => 'password'
- ),
- 'userModel' => 'User',
- 'scope' => array()
- );
-
-/**
- * Constructor
- *
- * @param array $settings Array of settings to use.
- */
- public function __construct($settings) {
- $this->settings = Set::merge($this->settings, $settings);
- }
+class FormAuthenticate extends BaseAuthenticate {
/**
* Authenticates the identity contained in a request. Will use the `settings.userModel`, and `settings.fields`
@@ -103,13 +75,4 @@ class FormAuthenticate {
return $result[$model];
}
-/**
- * Hash the supplied password using the configured hashing method.
- *
- * @param string $password The password to hash.
- * @return string Hashed string
- */
- public function hash($password) {
- return Security::hash($password, null, true);
- }
}
\ No newline at end of file
From 332b6cfc223fb10c7860486a0c03f6f06edc6345 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 18:10:45 -0500
Subject: [PATCH 265/668] Adding basic authentication skeleton.
---
.../components/auth/basic_authenticate.php | 27 ++++
.../auth/basic_authenticate.test.php | 146 ++++++++++++++++++
2 files changed, 173 insertions(+)
create mode 100644 cake/libs/controller/components/auth/basic_authenticate.php
create mode 100644 cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php
diff --git a/cake/libs/controller/components/auth/basic_authenticate.php b/cake/libs/controller/components/auth/basic_authenticate.php
new file mode 100644
index 000000000..af1361bd1
--- /dev/null
+++ b/cake/libs/controller/components/auth/basic_authenticate.php
@@ -0,0 +1,27 @@
+auth = new BasicAuthenticate(array(
+ 'fields' => array('username' => 'user', 'password' => 'password'),
+ 'userModel' => 'User'
+ ));
+ $password = Security::hash('password', null, true);
+ ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"'));
+ }
+
+/**
+ * test applying settings in the constructor
+ *
+ * @return void
+ */
+ function testConstructor() {
+ $object = new BasicAuthenticate(array(
+ 'userModel' => 'AuthUser',
+ 'fields' => array('username' => 'user', 'password' => 'password')
+ ));
+ $this->assertEquals('AuthUser', $object->settings['userModel']);
+ $this->assertEquals(array('username' => 'user', 'password' => 'password'), $object->settings['fields']);
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoData() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array();
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoUsername() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array('password' => 'foobar'));
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoPassword() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array('user' => 'mariano'));
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateInjection() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array(
+ 'User' => array(
+ 'user' => '> 1',
+ 'password' => "' OR 1 = 1"
+ ));
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+/**
+ * test authenticate sucesss
+ *
+ * @return void
+ */
+ function testAuthenticateSuccess() {
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array(
+ 'user' => 'mariano',
+ 'password' => 'password'
+ ));
+ $result = $this->auth->authenticate($request);
+ $expected = array(
+ 'id' => 1,
+ 'user' => 'mariano',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => '2007-03-17 01:18:31'
+ );
+ $this->assertEquals($expected, $result);
+ }
+
+/**
+ * test scope failure.
+ *
+ * @return void
+ */
+ function testAuthenticateScopeFail() {
+ $this->auth->settings['scope'] = array('user' => 'nate');
+ $request = new CakeRequest('posts/index', false);
+ $request->data = array('User' => array(
+ 'user' => 'mariano',
+ 'password' => 'password'
+ ));
+
+ $this->assertFalse($this->auth->authenticate($request));
+ }
+
+}
\ No newline at end of file
From ba02483ae8b641c64cec5122dffa4d3df4060a5c Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 19:56:23 -0500
Subject: [PATCH 266/668] Adding a response parameter to authenticate() both
basic and digest auth need to set response headers.
---
cake/libs/controller/components/auth.php | 16 ++++++++++++----
.../components/auth/base_authenticate.php | 3 ++-
.../components/auth/form_authenticate.php | 3 ++-
.../components/auth/form_authenticate.test.php | 16 +++++++++-------
4 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 5f4631ab8..7f12d9842 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -34,7 +34,7 @@ App::import('Component', 'auth/base_authorize');
*/
class AuthComponent extends Component {
- const ALL = '*';
+ const ALL = 'all';
/**
* Maintains current user login state.
@@ -231,6 +231,13 @@ class AuthComponent extends Component {
*/
public $request;
+/**
+ * Response object
+ *
+ * @var CakeResponse
+ */
+ public $response;
+
/**
* Method list for bound controller
*
@@ -246,6 +253,7 @@ class AuthComponent extends Component {
*/
public function initialize($controller) {
$this->request = $controller->request;
+ $this->response = $controller->response;
$this->_methods = $controller->methods;
if (Configure::read('debug') > 0) {
@@ -507,7 +515,7 @@ class AuthComponent extends Component {
$this->_loggedIn = false;
if (empty($user)) {
- $user = $this->identify($this->request);
+ $user = $this->identify($this->request, $this->response);
}
if ($user) {
$this->Session->write(self::$sessionKey, $user);
@@ -587,12 +595,12 @@ class AuthComponent extends Component {
* @param CakeRequest $request The request that contains authentication data.
* @return array User record data, or false, if the user could not be identified.
*/
- public function identify(CakeRequest $request) {
+ public function identify(CakeRequest $request, CakeResponse $response) {
if (empty($this->_authenticateObjects)) {
$this->constructAuthenticate();
}
foreach ($this->_authenticateObjects as $auth) {
- $result = $auth->authenticate($request);
+ $result = $auth->authenticate($request, $response);
if (!empty($result) && is_array($result)) {
return $result;
}
diff --git a/cake/libs/controller/components/auth/base_authenticate.php b/cake/libs/controller/components/auth/base_authenticate.php
index 2bc8ad725..8c9fb145d 100644
--- a/cake/libs/controller/components/auth/base_authenticate.php
+++ b/cake/libs/controller/components/auth/base_authenticate.php
@@ -63,7 +63,8 @@ abstract class BaseAuthenticate {
* Authenticate a user based on the request information.
*
* @param CakeRequest $request Request to get authentication information from.
+ * @param CakeResponse $response A response object that can have headers added.
* @return mixed Either false on failure, or an array of user data on success.
*/
- abstract public function authenticate(CakeRequest $request);
+ abstract public function authenticate(CakeRequest $request, CakeResponse $response);
}
\ No newline at end of file
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index 3f284eaf2..24b472376 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -41,9 +41,10 @@ class FormAuthenticate extends BaseAuthenticate {
* there is no post data, either username or password is missing, of if the scope conditions have not been met.
*
* @param CakeRequest $request The request that contains login information.
+ * @param CakeResponse $response Unused response object.
* @return mixed. False on login failure. An array of User data on success.
*/
- public function authenticate(CakeRequest $request) {
+ public function authenticate(CakeRequest $request, CakeResponse $response) {
$userModel = $this->settings['userModel'];
list($plugin, $model) = pluginSplit($userModel);
diff --git a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
index b2218a75b..e6b5a4aa7 100644
--- a/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/form_authenticate.test.php
@@ -17,6 +17,7 @@
App::import('Component', 'auth/form_authenticate');
App::import('Model', 'AppModel');
App::import('Core', 'CakeRequest');
+App::import('Core', 'CakeResponse');
require_once CAKE_TESTS . 'cases' . DS . 'libs' . DS . 'model' . DS . 'models.php';
@@ -42,6 +43,7 @@ class FormAuthenticateTest extends CakeTestCase {
));
$password = Security::hash('password', null, true);
ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"'));
+ $this->response = $this->getMock('CakeResponse');
}
/**
@@ -66,7 +68,7 @@ class FormAuthenticateTest extends CakeTestCase {
function testAuthenticateNoData() {
$request = new CakeRequest('posts/index', false);
$request->data = array();
- $this->assertFalse($this->auth->authenticate($request));
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -77,7 +79,7 @@ class FormAuthenticateTest extends CakeTestCase {
function testAuthenticateNoUsername() {
$request = new CakeRequest('posts/index', false);
$request->data = array('User' => array('password' => 'foobar'));
- $this->assertFalse($this->auth->authenticate($request));
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -88,7 +90,7 @@ class FormAuthenticateTest extends CakeTestCase {
function testAuthenticateNoPassword() {
$request = new CakeRequest('posts/index', false);
$request->data = array('User' => array('user' => 'mariano'));
- $this->assertFalse($this->auth->authenticate($request));
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -103,7 +105,7 @@ class FormAuthenticateTest extends CakeTestCase {
'user' => '> 1',
'password' => "' OR 1 = 1"
));
- $this->assertFalse($this->auth->authenticate($request));
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -117,7 +119,7 @@ class FormAuthenticateTest extends CakeTestCase {
'user' => 'mariano',
'password' => 'password'
));
- $result = $this->auth->authenticate($request);
+ $result = $this->auth->authenticate($request, $this->response);
$expected = array(
'id' => 1,
'user' => 'mariano',
@@ -140,7 +142,7 @@ class FormAuthenticateTest extends CakeTestCase {
'password' => 'password'
));
- $this->assertFalse($this->auth->authenticate($request));
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -170,7 +172,7 @@ class FormAuthenticateTest extends CakeTestCase {
'password' => 'cake'
));
- $result = $this->auth->authenticate($request);
+ $result = $this->auth->authenticate($request, $this->response);
$expected = array(
'id' => 1,
'username' => 'gwoo',
From 67c4c9a693b4f2a0ad3f56577d57a1c6f278ed71 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 20:28:03 -0500
Subject: [PATCH 267/668] Fix failing test and removing tests for settings that
no longer exist.
---
.../libs/controller/components/auth.test.php | 29 +------------------
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index bb5d5e29b..502c5dfe5 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -740,7 +740,7 @@ class AuthTest extends CakeTestCase {
*/
function testLoadAuthenticateNoFile() {
$this->Controller->Auth->authenticate = 'Missing';
- $this->Controller->Auth->identify($this->Controller->request);
+ $this->Controller->Auth->identify($this->Controller->request, $this->Controller->response);
}
/**
@@ -1176,9 +1176,7 @@ class AuthTest extends CakeTestCase {
$this->Controller->components = array(
'Auth' => array(
- 'fields' => array('username' => 'email', 'password' => 'password'),
'loginAction' => array('controller' => 'people', 'action' => 'login'),
- 'userModel' => 'AuthUserCustomField'
),
'Session'
);
@@ -1186,37 +1184,12 @@ class AuthTest extends CakeTestCase {
$this->Controller->Components->trigger('initialize', array(&$this->Controller));
Router::reload();
- $this->AuthUserCustomField = new AuthUserCustomField();
- $user = array(
- 'id' => 1, 'email' => 'harking@example.com',
- 'password' => Security::hash(Configure::read('Security.salt') . 'cake'
- ));
- $user = $this->AuthUserCustomField->save($user, false);
-
- Router::connect('/', array('controller' => 'people', 'action' => 'login'));
- $url = '/';
- $this->Controller->request->addParams(Router::parse($url));
- Router::setRequestInfo($this->Controller->request);
- $this->Controller->request->data['AuthUserCustomField'] = array(
- 'email' => 'harking@example.com', 'password' => 'cake'
- );
- $this->Controller->request->query['url'] = substr($url, 1);
- $this->Controller->Auth->startup($this->Controller);
- $this->Controller->Auth->login();
-
- $user = $this->Controller->Auth->user();
- $this->assertTrue(!!$user);
-
$expected = array(
- 'fields' => array('username' => 'email', 'password' => 'password'),
'loginAction' => array('controller' => 'people', 'action' => 'login'),
'logoutRedirect' => array('controller' => 'people', 'action' => 'login'),
- 'userModel' => 'AuthUserCustomField'
);
- $this->assertEqual($expected['fields'], $this->Controller->Auth->fields);
$this->assertEqual($expected['loginAction'], $this->Controller->Auth->loginAction);
$this->assertEqual($expected['logoutRedirect'], $this->Controller->Auth->logoutRedirect);
- $this->assertEqual($expected['userModel'], $this->Controller->Auth->userModel);
}
/**
From e8bf6ed176136b6923486d88eefa104755e7f6c4 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 20:28:24 -0500
Subject: [PATCH 268/668] Basic tests for BasicAuthenticate are passing.
---
.../components/auth/basic_authenticate.php | 77 +++++++++++-
.../auth/basic_authenticate.test.php | 111 ++++++++++++++----
2 files changed, 162 insertions(+), 26 deletions(-)
diff --git a/cake/libs/controller/components/auth/basic_authenticate.php b/cake/libs/controller/components/auth/basic_authenticate.php
index af1361bd1..085b0770c 100644
--- a/cake/libs/controller/components/auth/basic_authenticate.php
+++ b/cake/libs/controller/components/auth/basic_authenticate.php
@@ -13,15 +13,88 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Component', 'auth/base_authenticate');
+App::import('Core', 'String');
+
class BasicAuthenticate extends BaseAuthenticate {
+/**
+ * Settings for this object.
+ *
+ * - `fields` The fields to use to identify a user by.
+ * - `userModel` The model name of the User, defaults to User.
+ * - `scope` Additional conditions to use when looking up and authenticating users,
+ * i.e. `array('User.is_active' => 1).`
+ *
+ * @var array
+ */
+ public $settings = array(
+ 'fields' => array(
+ 'username' => 'username',
+ 'password' => 'password'
+ ),
+ 'userModel' => 'User',
+ 'scope' => array(),
+ 'realm' => '',
+ );
+
+/**
+ * Constructor, completes configuration for basic authentication.
+ *
+ * @return void
+ */
+ public function __construct($settings) {
+ parent::__construct($settings);
+ if (empty($this->settings['realm'])) {
+ $this->settings['realm'] = env('SERVER_NAME');
+ }
+ }
/**
* Authenticate a user using basic HTTP auth. Will use the configured User model and attempt a
* login using basic HTTP auth.
*
+ * @param CakeRequest $request The request to authenticate with.
+ * @param CakeResponse $response The response to add headers to.
* @return mixed Either false on failure, or an array of user data on success.
*/
- public function authenticate(CakeRequest $request) {
-
+ public function authenticate(CakeRequest $request, CakeResponse $response) {
+ $username = env('PHP_AUTH_USER');
+ $pass = env('PHP_AUTH_PW');
+ if (empty($username) || empty($pass)) {
+ $response->header($this->loginHeaders());
+ return false;
+ }
+ $userModel = $this->settings['userModel'];
+ list($plugin, $model) = pluginSplit($userModel);
+ $fields = $this->settings['fields'];
+
+ $conditions = array(
+ $model . '.' . $fields['username'] => $username,
+ $model . '.' . $fields['password'] => $this->hash($pass),
+ );
+ if (!empty($this->settings['scope'])) {
+ $conditions = array_merge($conditions, $this->settings['scope']);
+ }
+ $result = ClassRegistry::init($userModel)->find('first', array(
+ 'conditions' => $conditions,
+ 'recursive' => 0
+ ));
+ if (empty($result) || empty($result[$model])) {
+ $response->header($this->loginHeaders());
+ $response->header('Location', Router::reverse($request));
+ $response->statusCode(401);
+ $response->send();
+ return false;
+ }
+ unset($result[$model][$fields['password']]);
+ return $result[$model];
+ }
+
+/**
+ * Generate the login headers
+ *
+ * @return string Headers for logging in.
+ */
+ public function loginHeaders() {
+ return sprintf('WWW-Authenticate: Basic realm="%s"', $this->settings['realm']);
}
}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php
index 7da7e692b..867b50c11 100644
--- a/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php
@@ -17,6 +17,8 @@
App::import('Component', 'auth/basic_authenticate');
App::import('Model', 'AppModel');
App::import('Core', 'CakeRequest');
+App::import('Core', 'CakeResponse');
+
require_once CAKE_TESTS . 'cases' . DS . 'libs' . DS . 'model' . DS . 'models.php';
@@ -38,10 +40,24 @@ class BasicAuthenticateTest extends CakeTestCase {
parent::setUp();
$this->auth = new BasicAuthenticate(array(
'fields' => array('username' => 'user', 'password' => 'password'),
- 'userModel' => 'User'
+ 'userModel' => 'User',
+ 'realm' => 'localhost',
));
+
$password = Security::hash('password', null, true);
ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"'));
+ $this->server = $_SERVER;
+ $this->response = $this->getMock('CakeResponse');
+ }
+
+/**
+ * teardown
+ *
+ * @return void
+ */
+ function tearDown() {
+ parent::tearDown();
+ $_SERVER = $this->server;
}
/**
@@ -56,6 +72,7 @@ class BasicAuthenticateTest extends CakeTestCase {
));
$this->assertEquals('AuthUser', $object->settings['userModel']);
$this->assertEquals(array('username' => 'user', 'password' => 'password'), $object->settings['fields']);
+ $this->assertEquals(env('SERVER_NAME'), $object->settings['realm']);
}
/**
@@ -65,8 +82,12 @@ class BasicAuthenticateTest extends CakeTestCase {
*/
function testAuthenticateNoData() {
$request = new CakeRequest('posts/index', false);
- $request->data = array();
- $this->assertFalse($this->auth->authenticate($request));
+
+ $this->response->expects($this->once())
+ ->method('header')
+ ->with('WWW-Authenticate: Basic realm="localhost"');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -76,8 +97,13 @@ class BasicAuthenticateTest extends CakeTestCase {
*/
function testAuthenticateNoUsername() {
$request = new CakeRequest('posts/index', false);
- $request->data = array('User' => array('password' => 'foobar'));
- $this->assertFalse($this->auth->authenticate($request));
+ $_SERVER['PHP_AUTH_PW'] = 'foobar';
+
+ $this->response->expects($this->once())
+ ->method('header')
+ ->with('WWW-Authenticate: Basic realm="localhost"');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -87,8 +113,13 @@ class BasicAuthenticateTest extends CakeTestCase {
*/
function testAuthenticateNoPassword() {
$request = new CakeRequest('posts/index', false);
- $request->data = array('User' => array('user' => 'mariano'));
- $this->assertFalse($this->auth->authenticate($request));
+ $_SERVER['PHP_AUTH_USER'] = 'mariano';
+
+ $this->response->expects($this->once())
+ ->method('header')
+ ->with('WWW-Authenticate: Basic realm="localhost"');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
@@ -98,14 +129,30 @@ class BasicAuthenticateTest extends CakeTestCase {
*/
function testAuthenticateInjection() {
$request = new CakeRequest('posts/index', false);
- $request->data = array(
- 'User' => array(
- 'user' => '> 1',
- 'password' => "' OR 1 = 1"
- ));
- $this->assertFalse($this->auth->authenticate($request));
+ $request->addParams(array('pass' => array(), 'named' => array()));
+
+ $_SERVER['PHP_AUTH_USER'] = '> 1';
+ $_SERVER['PHP_AUTH_PW'] = "' OR 1 = 1";
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
+/**
+ * test that challenge headers are sent when no credentials are found.
+ *
+ * @return void
+ */
+ function testAuthenticateChallenge() {
+ $request = new CakeRequest('posts/index', false);
+ $request->addParams(array('pass' => array(), 'named' => array()));
+
+ $this->response->expects($this->once())
+ ->method('header')
+ ->with('WWW-Authenticate: Basic realm="localhost"');
+
+ $result = $this->auth->authenticate($request, $this->response);
+ $this->assertFalse($result);
+ }
/**
* test authenticate sucesss
*
@@ -113,11 +160,12 @@ class BasicAuthenticateTest extends CakeTestCase {
*/
function testAuthenticateSuccess() {
$request = new CakeRequest('posts/index', false);
- $request->data = array('User' => array(
- 'user' => 'mariano',
- 'password' => 'password'
- ));
- $result = $this->auth->authenticate($request);
+ $request->addParams(array('pass' => array(), 'named' => array()));
+
+ $_SERVER['PHP_AUTH_USER'] = 'mariano';
+ $_SERVER['PHP_AUTH_PW'] = 'password';
+
+ $result = $this->auth->authenticate($request, $this->response);
$expected = array(
'id' => 1,
'user' => 'mariano',
@@ -132,15 +180,30 @@ class BasicAuthenticateTest extends CakeTestCase {
*
* @return void
*/
- function testAuthenticateScopeFail() {
+ function testAuthenticateFailReChallenge() {
$this->auth->settings['scope'] = array('user' => 'nate');
$request = new CakeRequest('posts/index', false);
- $request->data = array('User' => array(
- 'user' => 'mariano',
- 'password' => 'password'
- ));
+ $request->addParams(array('pass' => array(), 'named' => array()));
- $this->assertFalse($this->auth->authenticate($request));
+ $_SERVER['PHP_AUTH_USER'] = 'mariano';
+ $_SERVER['PHP_AUTH_PW'] = 'password';
+
+ $this->response->expects($this->at(0))
+ ->method('header')
+ ->with('WWW-Authenticate: Basic realm="localhost"');
+
+ $this->response->expects($this->at(1))
+ ->method('header')
+ ->with('Location', Router::reverse($request));
+
+ $this->response->expects($this->at(2))
+ ->method('statusCode')
+ ->with(401);
+
+ $this->response->expects($this->at(3))
+ ->method('send');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
}
}
\ No newline at end of file
From 4610a0bf3cda634cf66c07bd411e1553d0caf14e Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 20:41:02 -0500
Subject: [PATCH 269/668] Adding some more tests for basic auth challenge
headers.
---
cake/libs/controller/components/auth/basic_authenticate.php | 3 +++
.../controller/components/auth/basic_authenticate.test.php | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth/basic_authenticate.php b/cake/libs/controller/components/auth/basic_authenticate.php
index 085b0770c..0ce840ca5 100644
--- a/cake/libs/controller/components/auth/basic_authenticate.php
+++ b/cake/libs/controller/components/auth/basic_authenticate.php
@@ -59,10 +59,13 @@ class BasicAuthenticate extends BaseAuthenticate {
public function authenticate(CakeRequest $request, CakeResponse $response) {
$username = env('PHP_AUTH_USER');
$pass = env('PHP_AUTH_PW');
+
if (empty($username) || empty($pass)) {
$response->header($this->loginHeaders());
+ $response->send();
return false;
}
+
$userModel = $this->settings['userModel'];
list($plugin, $model) = pluginSplit($userModel);
$fields = $this->settings['fields'];
diff --git a/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php
index 867b50c11..656ca0fbb 100644
--- a/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/basic_authenticate.test.php
@@ -146,10 +146,13 @@ class BasicAuthenticateTest extends CakeTestCase {
$request = new CakeRequest('posts/index', false);
$request->addParams(array('pass' => array(), 'named' => array()));
- $this->response->expects($this->once())
+ $this->response->expects($this->at(0))
->method('header')
->with('WWW-Authenticate: Basic realm="localhost"');
+ $this->response->expects($this->at(1))
+ ->method('send');
+
$result = $this->auth->authenticate($request, $this->response);
$this->assertFalse($result);
}
From bcd8dcd0f7f997ed1094e6391ff6ce5e879d6fd0 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 21 Jan 2011 20:52:38 -0500
Subject: [PATCH 270/668] Extracting common logic into the base class.
---
.../components/auth/base_authenticate.php | 30 +++++++++++++++++++
.../components/auth/basic_authenticate.php | 20 ++-----------
.../components/auth/form_authenticate.php | 18 ++---------
3 files changed, 36 insertions(+), 32 deletions(-)
diff --git a/cake/libs/controller/components/auth/base_authenticate.php b/cake/libs/controller/components/auth/base_authenticate.php
index 8c9fb145d..0753640f8 100644
--- a/cake/libs/controller/components/auth/base_authenticate.php
+++ b/cake/libs/controller/components/auth/base_authenticate.php
@@ -59,6 +59,36 @@ abstract class BaseAuthenticate {
return Security::hash($password, null, true);
}
+/**
+ * Find a user record using the standard options.
+ *
+ * @param string $username The username/identifier.
+ * @param string $password The unhashed password.
+ * @return Mixed Either false on failure, or an array of user data.
+ */
+ protected function _findUser($username, $password) {
+ $userModel = $this->settings['userModel'];
+ list($plugin, $model) = pluginSplit($userModel);
+ $fields = $this->settings['fields'];
+
+ $conditions = array(
+ $model . '.' . $fields['username'] => $username,
+ $model . '.' . $fields['password'] => $this->hash($password),
+ );
+ if (!empty($this->settings['scope'])) {
+ $conditions = array_merge($conditions, $this->settings['scope']);
+ }
+ $result = ClassRegistry::init($userModel)->find('first', array(
+ 'conditions' => $conditions,
+ 'recursive' => 0
+ ));
+ if (empty($result) || empty($result[$model])) {
+ return false;
+ }
+ unset($result[$model][$fields['password']]);
+ return $result[$model];
+ }
+
/**
* Authenticate a user based on the request information.
*
diff --git a/cake/libs/controller/components/auth/basic_authenticate.php b/cake/libs/controller/components/auth/basic_authenticate.php
index 0ce840ca5..3d6cbc845 100644
--- a/cake/libs/controller/components/auth/basic_authenticate.php
+++ b/cake/libs/controller/components/auth/basic_authenticate.php
@@ -66,30 +66,16 @@ class BasicAuthenticate extends BaseAuthenticate {
return false;
}
- $userModel = $this->settings['userModel'];
- list($plugin, $model) = pluginSplit($userModel);
- $fields = $this->settings['fields'];
+ $result = $this->_findUser($username, $pass);
- $conditions = array(
- $model . '.' . $fields['username'] => $username,
- $model . '.' . $fields['password'] => $this->hash($pass),
- );
- if (!empty($this->settings['scope'])) {
- $conditions = array_merge($conditions, $this->settings['scope']);
- }
- $result = ClassRegistry::init($userModel)->find('first', array(
- 'conditions' => $conditions,
- 'recursive' => 0
- ));
- if (empty($result) || empty($result[$model])) {
+ if (empty($result)) {
$response->header($this->loginHeaders());
$response->header('Location', Router::reverse($request));
$response->statusCode(401);
$response->send();
return false;
}
- unset($result[$model][$fields['password']]);
- return $result[$model];
+ return $result;
}
/**
diff --git a/cake/libs/controller/components/auth/form_authenticate.php b/cake/libs/controller/components/auth/form_authenticate.php
index 24b472376..d24d9acf2 100644
--- a/cake/libs/controller/components/auth/form_authenticate.php
+++ b/cake/libs/controller/components/auth/form_authenticate.php
@@ -58,22 +58,10 @@ class FormAuthenticate extends BaseAuthenticate {
) {
return false;
}
- $conditions = array(
- $model . '.' . $fields['username'] => $request->data[$model][$fields['username']],
- $model . '.' . $fields['password'] => $this->hash($request->data[$model][$fields['password']]),
+ return $this->_findUser(
+ $request->data[$model][$fields['username']],
+ $request->data[$model][$fields['password']]
);
- if (!empty($this->settings['scope'])) {
- $conditions = array_merge($conditions, $this->settings['scope']);
- }
- $result = ClassRegistry::init($userModel)->find('first', array(
- 'conditions' => $conditions,
- 'recursive' => 0
- ));
- if (empty($result) || empty($result[$model])) {
- return false;
- }
- unset($result[$model][$fields['password']]);
- return $result[$model];
}
}
\ No newline at end of file
From 945e49ad09816c79892fdddbf9fe313317316fd9 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 22 Jan 2011 13:29:56 -0500
Subject: [PATCH 271/668] Starting Digest auth, using Basic auth as a starting
base.
---
.../components/auth/digest_authenticate.php | 108 +++++++++
.../auth/digest_authenticate.test.php | 216 ++++++++++++++++++
2 files changed, 324 insertions(+)
create mode 100644 cake/libs/controller/components/auth/digest_authenticate.php
create mode 100644 cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
diff --git a/cake/libs/controller/components/auth/digest_authenticate.php b/cake/libs/controller/components/auth/digest_authenticate.php
new file mode 100644
index 000000000..f58623315
--- /dev/null
+++ b/cake/libs/controller/components/auth/digest_authenticate.php
@@ -0,0 +1,108 @@
+ 1).`
+ *
+ * @var array
+ */
+ public $settings = array(
+ 'fields' => array(
+ 'username' => 'username',
+ 'password' => 'password'
+ ),
+ 'userModel' => 'User',
+ 'scope' => array(),
+ 'realm' => '',
+ 'qop' => 'auth',
+ 'nonce' => '',
+ 'opaque' => ''
+ );
+
+/**
+ * Constructor, completes configuration for digest authentication.
+ *
+ * @return void
+ */
+ public function __construct($settings) {
+ parent::__construct($settings);
+ if (empty($this->settings['realm'])) {
+ $this->settings['realm'] = env('SERVER_NAME');
+ }
+ if (empty($this->settings['nonce'])) {
+ $this->settings['realm'] = uniqid('');
+ }
+ if (empty($this->settings['opaque'])) {
+ $this->settings['opaque'] = md5($this->settings['realm']);
+ }
+ }
+/**
+ * Authenticate a user using Digest HTTP auth. Will use the configured User model and attempt a
+ * login using Digest HTTP auth.
+ *
+ * @param CakeRequest $request The request to authenticate with.
+ * @param CakeResponse $response The response to add headers to.
+ * @return mixed Either false on failure, or an array of user data on success.
+ */
+ public function authenticate(CakeRequest $request, CakeResponse $response) {
+ $username = env('PHP_AUTH_USER');
+ $pass = env('PHP_AUTH_PW');
+
+ if (empty($username) || empty($pass)) {
+ $response->header($this->loginHeaders());
+ $response->send();
+ return false;
+ }
+
+ $result = $this->_findUser($username, $pass);
+
+ if (empty($result)) {
+ $response->header($this->loginHeaders());
+ $response->header('Location', Router::reverse($request));
+ $response->statusCode(401);
+ $response->send();
+ return false;
+ }
+ return $result;
+ }
+
+/**
+ * Generate the login headers
+ *
+ * @return string Headers for logging in.
+ */
+ public function loginHeaders() {
+ $options = array(
+ 'realm' => $this->settings['realm'],
+ 'qop' => $this->settings['qop'],
+ 'nonce' => $this->settings['nonce'],
+ 'opaque' => $this->settings['opaque']
+ );
+ $opts = array();
+ foreach ($options as $k => $v) {
+ $opts[] = sprintf('%s="%s"', $k, $v);
+ }
+ return 'WWW-Authenticate: Digest ' . implode(',', $opts);
+ }
+}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
new file mode 100644
index 000000000..40a5a6b71
--- /dev/null
+++ b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
@@ -0,0 +1,216 @@
+auth = new DigestAuthenticate(array(
+ 'fields' => array('username' => 'user', 'password' => 'password'),
+ 'userModel' => 'User',
+ 'realm' => 'localhost',
+ 'nonce' => 123,
+ 'opaque' => '123abc'
+ ));
+
+ $password = Security::hash('password', null, true);
+ ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"'));
+ $this->server = $_SERVER;
+ $this->response = $this->getMock('CakeResponse');
+ }
+
+/**
+ * teardown
+ *
+ * @return void
+ */
+ function tearDown() {
+ parent::tearDown();
+ $_SERVER = $this->server;
+ }
+
+/**
+ * test applying settings in the constructor
+ *
+ * @return void
+ */
+ function testConstructor() {
+ $object = new DigestAuthenticate(array(
+ 'userModel' => 'AuthUser',
+ 'fields' => array('username' => 'user', 'password' => 'password'),
+ 'nonce' => 123456
+ ));
+ $this->assertEquals('AuthUser', $object->settings['userModel']);
+ $this->assertEquals(array('username' => 'user', 'password' => 'password'), $object->settings['fields']);
+ $this->assertEquals(123456, $object->settings['nonce']);
+ $this->assertEquals(env('SERVER_NAME'), $object->settings['realm']);
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoData() {
+ $request = new CakeRequest('posts/index', false);
+
+ $this->response->expects($this->once())
+ ->method('header')
+ ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoUsername() {
+ $request = new CakeRequest('posts/index', false);
+ $_SERVER['PHP_AUTH_PW'] = 'foobar';
+
+ $this->response->expects($this->once())
+ ->method('header')
+ ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateNoPassword() {
+ $request = new CakeRequest('posts/index', false);
+ $_SERVER['PHP_AUTH_USER'] = 'mariano';
+
+ $this->response->expects($this->once())
+ ->method('header')
+ ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
+ }
+
+/**
+ * test the authenticate method
+ *
+ * @return void
+ */
+ function testAuthenticateInjection() {
+ $request = new CakeRequest('posts/index', false);
+ $request->addParams(array('pass' => array(), 'named' => array()));
+
+ $_SERVER['PHP_AUTH_USER'] = '> 1';
+ $_SERVER['PHP_AUTH_PW'] = "' OR 1 = 1";
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
+ }
+
+/**
+ * test that challenge headers are sent when no credentials are found.
+ *
+ * @return void
+ */
+ function testAuthenticateChallenge() {
+ $request = new CakeRequest('posts/index', false);
+ $request->addParams(array('pass' => array(), 'named' => array()));
+
+ $this->response->expects($this->at(0))
+ ->method('header')
+ ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
+
+ $this->response->expects($this->at(1))
+ ->method('send');
+
+ $result = $this->auth->authenticate($request, $this->response);
+ $this->assertFalse($result);
+ }
+/**
+ * test authenticate sucesss
+ *
+ * @return void
+ */
+ function testAuthenticateSuccess() {
+ $request = new CakeRequest('posts/index', false);
+ $request->addParams(array('pass' => array(), 'named' => array()));
+
+ $_SERVER['PHP_AUTH_USER'] = 'mariano';
+ $_SERVER['PHP_AUTH_PW'] = 'password';
+
+ $result = $this->auth->authenticate($request, $this->response);
+ $expected = array(
+ 'id' => 1,
+ 'user' => 'mariano',
+ 'created' => '2007-03-17 01:16:23',
+ 'updated' => '2007-03-17 01:18:31'
+ );
+ $this->assertEquals($expected, $result);
+ }
+
+/**
+ * test scope failure.
+ *
+ * @return void
+ */
+ function testAuthenticateFailReChallenge() {
+ $this->auth->settings['scope'] = array('user' => 'nate');
+ $request = new CakeRequest('posts/index', false);
+ $request->addParams(array('pass' => array(), 'named' => array()));
+
+ $_SERVER['PHP_AUTH_USER'] = 'mariano';
+ $_SERVER['PHP_AUTH_PW'] = 'password';
+
+ $this->response->expects($this->at(0))
+ ->method('header')
+ ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
+
+ $this->response->expects($this->at(1))
+ ->method('header')
+ ->with('Location', Router::reverse($request));
+
+ $this->response->expects($this->at(2))
+ ->method('statusCode')
+ ->with(401);
+
+ $this->response->expects($this->at(3))
+ ->method('send');
+
+ $this->assertFalse($this->auth->authenticate($request, $this->response));
+ }
+
+}
\ No newline at end of file
From 705b3288e1dccd80eb0fc32422a546add7a879f9 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 22 Jan 2011 14:48:12 -0500
Subject: [PATCH 272/668] Basics of DigestAuth are working.
---
.../components/auth/digest_authenticate.php | 108 +++++++++++-
.../auth/digest_authenticate.test.php | 159 +++++++++++++-----
2 files changed, 222 insertions(+), 45 deletions(-)
diff --git a/cake/libs/controller/components/auth/digest_authenticate.php b/cake/libs/controller/components/auth/digest_authenticate.php
index f58623315..10212f1a0 100644
--- a/cake/libs/controller/components/auth/digest_authenticate.php
+++ b/cake/libs/controller/components/auth/digest_authenticate.php
@@ -66,18 +66,19 @@ class DigestAuthenticate extends BaseAuthenticate {
* @return mixed Either false on failure, or an array of user data on success.
*/
public function authenticate(CakeRequest $request, CakeResponse $response) {
- $username = env('PHP_AUTH_USER');
- $pass = env('PHP_AUTH_PW');
+ $digest = $this->_getDigest();
- if (empty($username) || empty($pass)) {
+ if (empty($digest)) {
$response->header($this->loginHeaders());
$response->send();
return false;
}
- $result = $this->_findUser($username, $pass);
+ $result = $this->_findUser($digest['username'], null);
+ $password = $result[$this->settings['fields']['password']];
+ unset($result[$this->settings['fields']['password']]);
- if (empty($result)) {
+ if (empty($result) || $digest['response'] !== $this->generateResponseHash($digest, $password)) {
$response->header($this->loginHeaders());
$response->header('Location', Router::reverse($request));
$response->statusCode(401);
@@ -87,6 +88,103 @@ class DigestAuthenticate extends BaseAuthenticate {
return $result;
}
+/**
+ * Find a user record using the standard options.
+ *
+ * @param string $username The username/identifier.
+ * @param string $password Unused password, digest doesn't require passwords.
+ * @return Mixed Either false on failure, or an array of user data.
+ */
+ protected function _findUser($username, $password) {
+ $userModel = $this->settings['userModel'];
+ list($plugin, $model) = pluginSplit($userModel);
+ $fields = $this->settings['fields'];
+
+ $conditions = array(
+ $model . '.' . $fields['username'] => $username,
+ );
+ if (!empty($this->settings['scope'])) {
+ $conditions = array_merge($conditions, $this->settings['scope']);
+ }
+ $result = ClassRegistry::init($userModel)->find('first', array(
+ 'conditions' => $conditions,
+ 'recursive' => 0
+ ));
+ if (empty($result) || empty($result[$model])) {
+ return false;
+ }
+ return $result[$model];
+ }
+
+/**
+ * Gets the digest headers from the request/environment.
+ *
+ * @return array Array of digest information.
+ */
+ protected function _getDigest() {
+ $digest = env('PHP_AUTH_DIGEST');
+ if (empty($digest) && function_exists('apache_request_headers')) {
+ $headers = apache_request_headers();
+ if (!empty($headers['Authorization']) && substr($headers['Authorization'], 0, 7) == 'Digest ') {
+ $digest = substr($headers['Authorization'], 7);
+ }
+ }
+ if (empty($digest)) {
+ return false;
+ }
+ return $this->parseAuthData($digest);
+ }
+
+/**
+ * Parse the digest authentication headers and split them up.
+ *
+ * @param string $digest The raw digest authentication headers.
+ * @return array An array of digest authentication headers
+ */
+ public function parseAuthData($digest) {
+ if (substr($digest, 0, 7) == 'Digest ') {
+ $digest = substr($digest, 7);
+ }
+ $keys = $match = array();
+ $req = array('nonce' => 1, 'nc' => 1, 'cnonce' => 1, 'qop' => 1, 'username' => 1, 'uri' => 1, 'response' => 1);
+ preg_match_all('/(\w+)=([\'"]?)([a-zA-Z0-9@=.\/_-]+)\2/', $digest, $match, PREG_SET_ORDER);
+
+ foreach ($match as $i) {
+ $keys[$i[1]] = $i[3];
+ unset($req[$i[1]]);
+ }
+
+ if (empty($req)) {
+ return $keys;
+ }
+ return null;
+ }
+
+/**
+ * Generate the response hash for a given digest array.
+ *
+ * @param array $digest Digest information containing data from DigestAuthenticate::parseAuthData().
+ * @param string $password The digest hash password generated with DigestAuthenticate::password()
+ * @return string Response hash
+ */
+ public function generateResponseHash($digest, $password) {
+ return md5(
+ $password .
+ ':' . $digest['nonce'] . ':' . $digest['nc'] . ':' . $digest['cnonce'] . ':' . $digest['qop'] . ':' .
+ md5(env('REQUEST_METHOD') . ':' . $digest['uri'])
+ );
+ }
+
+/**
+ * Creates an auth digest password hash to store
+ *
+ * @param string $password The unhashed password to make a digest hash for.
+ * @return string the hashed password that can later be used with Digest authentication.
+ */
+ public static function password($username, $realm, $password) {
+ return md5($username . ':' . $realm . ':' . $password);
+ }
+
/**
* Generate the login headers
*
diff --git a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
index 40a5a6b71..4709890be 100644
--- a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
@@ -46,7 +46,7 @@ class DigestAuthenticateTest extends CakeTestCase {
'opaque' => '123abc'
));
- $password = Security::hash('password', null, true);
+ $password = DigestAuthenticate::password('mariano', 'localhost', 'cake');
ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"'));
$this->server = $_SERVER;
$this->response = $this->getMock('CakeResponse');
@@ -99,44 +99,36 @@ class DigestAuthenticateTest extends CakeTestCase {
*
* @return void
*/
- function testAuthenticateNoUsername() {
- $request = new CakeRequest('posts/index', false);
- $_SERVER['PHP_AUTH_PW'] = 'foobar';
-
- $this->response->expects($this->once())
- ->method('header')
- ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
-
- $this->assertFalse($this->auth->authenticate($request, $this->response));
- }
-
-/**
- * test the authenticate method
- *
- * @return void
- */
- function testAuthenticateNoPassword() {
- $request = new CakeRequest('posts/index', false);
- $_SERVER['PHP_AUTH_USER'] = 'mariano';
-
- $this->response->expects($this->once())
- ->method('header')
- ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
-
- $this->assertFalse($this->auth->authenticate($request, $this->response));
- }
-
-/**
- * test the authenticate method
- *
- * @return void
- */
- function testAuthenticateInjection() {
+ function testAuthenticateWrongUsername() {
$request = new CakeRequest('posts/index', false);
$request->addParams(array('pass' => array(), 'named' => array()));
- $_SERVER['PHP_AUTH_USER'] = '> 1';
- $_SERVER['PHP_AUTH_PW'] = "' OR 1 = 1";
+ $_SERVER['PHP_AUTH_DIGEST'] = <<response->expects($this->at(0))
+ ->method('header')
+ ->with('WWW-Authenticate: Digest realm="localhost",qop="auth",nonce="123",opaque="123abc"');
+
+ $this->response->expects($this->at(1))
+ ->method('header')
+ ->with('Location', Router::reverse($request));
+
+ $this->response->expects($this->at(2))
+ ->method('statusCode')
+ ->with(401);
+
+ $this->response->expects($this->at(3))
+ ->method('send');
$this->assertFalse($this->auth->authenticate($request, $this->response));
}
@@ -160,6 +152,7 @@ class DigestAuthenticateTest extends CakeTestCase {
$result = $this->auth->authenticate($request, $this->response);
$this->assertFalse($result);
}
+
/**
* test authenticate sucesss
*
@@ -169,8 +162,17 @@ class DigestAuthenticateTest extends CakeTestCase {
$request = new CakeRequest('posts/index', false);
$request->addParams(array('pass' => array(), 'named' => array()));
- $_SERVER['PHP_AUTH_USER'] = 'mariano';
- $_SERVER['PHP_AUTH_PW'] = 'password';
+ $_SERVER['PHP_AUTH_DIGEST'] = <<auth->authenticate($request, $this->response);
$expected = array(
@@ -192,8 +194,17 @@ class DigestAuthenticateTest extends CakeTestCase {
$request = new CakeRequest('posts/index', false);
$request->addParams(array('pass' => array(), 'named' => array()));
- $_SERVER['PHP_AUTH_USER'] = 'mariano';
- $_SERVER['PHP_AUTH_PW'] = 'password';
+ $_SERVER['PHP_AUTH_DIGEST'] = <<response->expects($this->at(0))
->method('header')
@@ -213,4 +224,72 @@ class DigestAuthenticateTest extends CakeTestCase {
$this->assertFalse($this->auth->authenticate($request, $this->response));
}
+/**
+ * testParseDigestAuthData method
+ *
+ * @access public
+ * @return void
+ */
+ function testParseAuthData() {
+ $digest = << 'Mufasa',
+ 'realm' => 'testrealm@host.com',
+ 'nonce' => 'dcd98b7102dd2f0e8b11d0f600bfb0c093',
+ 'uri' => '/dir/index.html',
+ 'qop' => 'auth',
+ 'nc' => '00000001',
+ 'cnonce' => '0a4f113b',
+ 'response' => '6629fae49393a05397450978507c4ef1',
+ 'opaque' => '5ccc069c403ebaf9f0171e9517f40e41'
+ );
+ $result = $this->auth->parseAuthData($digest);
+ $this->assertSame($expected, $result);
+
+ $result = $this->auth->parseAuthData('');
+ $this->assertNull($result);
+ }
+
+/**
+ * test parsing digest information with email addresses
+ *
+ * @return void
+ */
+ function testParseAuthEmailAddress() {
+ $digest = << 'mark@example.com',
+ 'realm' => 'testrealm@host.com',
+ 'nonce' => 'dcd98b7102dd2f0e8b11d0f600bfb0c093',
+ 'uri' => '/dir/index.html',
+ 'qop' => 'auth',
+ 'nc' => '00000001',
+ 'cnonce' => '0a4f113b',
+ 'response' => '6629fae49393a05397450978507c4ef1',
+ 'opaque' => '5ccc069c403ebaf9f0171e9517f40e41'
+ );
+ $result = $this->auth->parseAuthData($digest);
+ $this->assertIdentical($expected, $result);
+ }
+
}
\ No newline at end of file
From d5f5ae3271e3915abe4c5f4d2c4d67bb4e22d2d4 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 22 Jan 2011 15:46:21 -0500
Subject: [PATCH 273/668] Fixing typo where realm would be wrong if not
specified.
---
.../controller/components/auth/digest_authenticate.php | 2 +-
.../components/auth/digest_authenticate.test.php | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth/digest_authenticate.php b/cake/libs/controller/components/auth/digest_authenticate.php
index 10212f1a0..9e425f87a 100644
--- a/cake/libs/controller/components/auth/digest_authenticate.php
+++ b/cake/libs/controller/components/auth/digest_authenticate.php
@@ -51,7 +51,7 @@ class DigestAuthenticate extends BaseAuthenticate {
$this->settings['realm'] = env('SERVER_NAME');
}
if (empty($this->settings['nonce'])) {
- $this->settings['realm'] = uniqid('');
+ $this->settings['nonce'] = uniqid('');
}
if (empty($this->settings['opaque'])) {
$this->settings['opaque'] = md5($this->settings['realm']);
diff --git a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
index 4709890be..08cba463b 100644
--- a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
@@ -292,4 +292,14 @@ DIGEST;
$this->assertIdentical($expected, $result);
}
+/**
+ * test password hashing
+ *
+ * @return void
+ */
+ function testPassword() {
+ $result = DigestAuthenticate::password('mark', 'localhost', 'password');
+ $expected = md5('mark:localhost:password');
+ $this->assertEquals($expected, $result);
+ }
}
\ No newline at end of file
From 669672a1a01782620b5ab6227724f21968e9f42c Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 22 Jan 2011 16:27:07 -0500
Subject: [PATCH 274/668] Adding doc blocks.
---
.../components/auth/basic_authenticate.php | 30 ++++++++++++-
.../components/auth/digest_authenticate.php | 45 ++++++++++++++++++-
2 files changed, 72 insertions(+), 3 deletions(-)
diff --git a/cake/libs/controller/components/auth/basic_authenticate.php b/cake/libs/controller/components/auth/basic_authenticate.php
index 3d6cbc845..08a358463 100644
--- a/cake/libs/controller/components/auth/basic_authenticate.php
+++ b/cake/libs/controller/components/auth/basic_authenticate.php
@@ -13,9 +13,32 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Component', 'auth/base_authenticate');
-App::import('Core', 'String');
-
+/**
+ * Basic Authentication adapter for AuthComponent.
+ *
+ * Provides Basic HTTP authentication support for AuthComponent. Basic Auth will authenticate users
+ * against the configured userModel and verify the username and passwords match. Clients using Basic Authentication
+ * must support cookies. Since AuthComponent identifies users based on Session contents, clients using Basic
+ * Auth must support cookies.
+ *
+ * ### Using Basic auth
+ *
+ * In your controller's components array, add auth + the required settings.
+ * {{{
+ * var $components = array(
+ * 'Auth' => array(
+ * 'authenticate' => array('Basic')
+ * )
+ * );
+ * }}}
+ *
+ * In your login function just call `$this->Auth->login()` without any checks for POST data. This
+ * will send the authentication headers, and trigger the login dialog in the browser/client.
+ *
+ * @package cake.libs.controller.components.auth
+ * @since 2.0
+ */
class BasicAuthenticate extends BaseAuthenticate {
/**
* Settings for this object.
@@ -24,6 +47,7 @@ class BasicAuthenticate extends BaseAuthenticate {
* - `userModel` The model name of the User, defaults to User.
* - `scope` Additional conditions to use when looking up and authenticating users,
* i.e. `array('User.is_active' => 1).`
+ * - `realm` The realm authentication is for. Defaults the server name.
*
* @var array
*/
@@ -40,6 +64,7 @@ class BasicAuthenticate extends BaseAuthenticate {
/**
* Constructor, completes configuration for basic authentication.
*
+ * @param array $settings An array of settings.
* @return void
*/
public function __construct($settings) {
@@ -48,6 +73,7 @@ class BasicAuthenticate extends BaseAuthenticate {
$this->settings['realm'] = env('SERVER_NAME');
}
}
+
/**
* Authenticate a user using basic HTTP auth. Will use the configured User model and attempt a
* login using basic HTTP auth.
diff --git a/cake/libs/controller/components/auth/digest_authenticate.php b/cake/libs/controller/components/auth/digest_authenticate.php
index 9e425f87a..899701182 100644
--- a/cake/libs/controller/components/auth/digest_authenticate.php
+++ b/cake/libs/controller/components/auth/digest_authenticate.php
@@ -15,7 +15,45 @@
App::import('Component', 'auth/base_authenticate');
App::import('Core', 'String');
-
+/**
+ * Digest Authentication adapter for AuthComponent.
+ *
+ * Provides Digest HTTP authentication support for AuthComponent. Unlike most AuthComponent adapters,
+ * DigestAuthenticate requires a special password hash that conforms to RFC2617. You can create this
+ * password using `DigestAuthenticate::password()`. If you wish to use digest authentication alongside other
+ * authentication methods, its recommended that you store the digest authentication separately.
+ *
+ * Clients using Digest Authentication must support cookies. Since AuthComponent identifies users based
+ * on Session contents, clients without support for cookies will not function properly.
+ *
+ * ### Using Digest auth
+ *
+ * In your controller's components array, add auth + the required settings.
+ * {{{
+ * var $components = array(
+ * 'Auth' => array(
+ * 'authenticate' => array('Digest')
+ * )
+ * );
+ * }}}
+ *
+ * In your login function just call `$this->Auth->login()` without any checks for POST data. This
+ * will send the authentication headers, and trigger the login dialog in the browser/client.
+ *
+ * ### Generating passwords compatible with Digest authentication.
+ *
+ * Due to the Digest authentication specification, digest auth requires a special password value. You
+ * can generate this password using `DigestAuthenticate::password()`
+ *
+ * `$digestPass = DigestAuthenticate::password($username, env('SERVER_NAME'), $password);`
+ *
+ * Its recommended that you store this digest auth only password separate from password hashes used for other
+ * login methods. For example `User.digest_pass` could be used for a digest password, while `User.password` would
+ * store the password hash for use with other methods like Basic or Form.
+ *
+ * @package cake.libs.controller.components.auth
+ * @since 2.0
+ */
class DigestAuthenticate extends BaseAuthenticate {
/**
* Settings for this object.
@@ -24,6 +62,10 @@ class DigestAuthenticate extends BaseAuthenticate {
* - `userModel` The model name of the User, defaults to User.
* - `scope` Additional conditions to use when looking up and authenticating users,
* i.e. `array('User.is_active' => 1).`
+ * - `realm` The realm authentication is for, Defaults to the servername.
+ * - `nonce` A nonce used for authentication. Defaults to `uniqid()`.
+ * - `qop` Defaults to auth, no other values are supported at this time.
+ * - `opaque` A string that must be returned unchanged by clients. Defaults to `md5($settings['realm'])`
*
* @var array
*/
@@ -43,6 +85,7 @@ class DigestAuthenticate extends BaseAuthenticate {
/**
* Constructor, completes configuration for digest authentication.
*
+ * @param array $settings An array of settings.
* @return void
*/
public function __construct($settings) {
From 0e7f49048987f77baf493cc5cc156987643adc80 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 22 Jan 2011 16:29:07 -0500
Subject: [PATCH 275/668] Fixing failing test.
---
.../libs/controller/components/auth/actions_authorize.test.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php b/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
index 7af508c9c..69d0feb9f 100644
--- a/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/actions_authorize.test.php
@@ -33,7 +33,7 @@ class ActionsAuthorizeTest extends CakeTestCase {
$this->controller->Components = $this->getMock('ComponentCollection');
$this->auth = new ActionsAuthorize($this->controller);
- $this->auth->actionPath = '/controllers';
+ $this->auth->settings['actionPath'] = '/controllers';
}
/**
From 91a3fc4aeecb427b70ce0ebdbf619c40fd3b3e38 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 22 Jan 2011 17:15:55 -0500
Subject: [PATCH 276/668] Fixing tests so they run in the webrunner.
---
.../controller/components/auth/digest_authenticate.test.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
index 08cba463b..40b8ef4c1 100644
--- a/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
+++ b/cake/tests/cases/libs/controller/components/auth/digest_authenticate.test.php
@@ -38,6 +38,7 @@ class DigestAuthenticateTest extends CakeTestCase {
*/
function setUp() {
parent::setUp();
+ $this->server = $_SERVER;
$this->auth = new DigestAuthenticate(array(
'fields' => array('username' => 'user', 'password' => 'password'),
'userModel' => 'User',
@@ -48,7 +49,8 @@ class DigestAuthenticateTest extends CakeTestCase {
$password = DigestAuthenticate::password('mariano', 'localhost', 'cake');
ClassRegistry::init('User')->updateAll(array('password' => '"' . $password . '"'));
- $this->server = $_SERVER;
+
+ $_SERVER['REQUEST_METHOD'] = 'GET';
$this->response = $this->getMock('CakeResponse');
}
@@ -170,7 +172,7 @@ uri="/dir/index.html",
qop=auth,
nc=1,
cnonce="123",
-response="5e064cc2f3b20894a806b2de3edf9536",
+response="06b257a54befa2ddfb9bfa134224aa29",
opaque="123abc"
DIGEST;
From 82851895ef16e0cb4058f6d88611a89b647ce888 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 23 Jan 2011 11:09:01 -0500
Subject: [PATCH 277/668] Shifting includes around.
---
cake/libs/controller/components/auth.php | 1 +
cake/libs/controller/components/auth/digest_authenticate.php | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 7f12d9842..fb2e0e48e 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -23,6 +23,7 @@ App::import('Core', 'Router', false);
App::import('Core', 'Security', false);
App::import('Core', 'CakeSession', false);
App::import('Component', 'auth/base_authorize');
+App::import('Component', 'auth/base_authenticate');
/**
* Authentication control component class
diff --git a/cake/libs/controller/components/auth/digest_authenticate.php b/cake/libs/controller/components/auth/digest_authenticate.php
index 899701182..91d8ed270 100644
--- a/cake/libs/controller/components/auth/digest_authenticate.php
+++ b/cake/libs/controller/components/auth/digest_authenticate.php
@@ -13,7 +13,6 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Component', 'auth/base_authenticate');
-App::import('Core', 'String');
/**
* Digest Authentication adapter for AuthComponent.
From 2f917674d12e59e2a1cef320c9656f3a9d326819 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Mon, 24 Jan 2011 22:13:39 -0500
Subject: [PATCH 278/668] Fixing docblock to reflect change from '*' to 'all'.
Adding note about constant.
---
cake/libs/controller/components/auth.php | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index fb2e0e48e..543012c91 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -65,11 +65,11 @@ class AuthComponent extends Component {
*
* Using the class name without 'Authenticate' as the key, you can pass in an array of settings for each
* authentication object. Additionally you can define settings that should be set to all authentications objects
- * using the '*' key:
+ * using the 'all' key:
*
* {{{
* $this->Auth->authenticate = array(
- * '*' => array(
+ * 'all' => array(
* 'userModel' => 'Users.User',
* 'scope' => array('User.active' => 1)
* ),
@@ -78,6 +78,8 @@ class AuthComponent extends Component {
* );
* }}}
*
+ * You can also use AuthComponent::ALL instead of the string 'all'.
+ *
* @var array
* @link http://book.cakephp.org/view/1278/authenticate
*/
@@ -104,11 +106,11 @@ class AuthComponent extends Component {
*
* Using the class name without 'Authorize' as the key, you can pass in an array of settings for each
* authorization object. Additionally you can define settings that should be set to all authorization objects
- * using the '*' key:
+ * using the 'all' key:
*
* {{{
* $this->Auth->authorize = array(
- * '*' => array(
+ * 'all' => array(
* 'actionPath' => 'controllers/'
* ),
* 'Crud',
@@ -116,6 +118,8 @@ class AuthComponent extends Component {
* );
* }}}
*
+ * You can also use AuthComponent::ALL instead of the string 'all'
+ *
* @var mixed
* @link http://book.cakephp.org/view/1275/authorize
*/
From ffb6c29e7900bd1fde49050d222cf14158c60f86 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Tue, 25 Jan 2011 21:55:29 -0500
Subject: [PATCH 279/668] Removing dead fixtures, dead properties and dead
models.
---
.../libs/controller/components/auth.test.php | 135 +-----------------
1 file changed, 3 insertions(+), 132 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 502c5dfe5..a34d7a070 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -20,7 +20,6 @@ App::import('Core', 'Controller');
App::import('Component', array('Auth', 'Acl'));
App::import('Component', 'auth/form_authenticate');
App::import('Model', 'DbAcl');
-App::import('Core', 'Xml');
/**
* TestAuthComponent class
@@ -38,14 +37,6 @@ class TestAuthComponent extends AuthComponent {
*/
public $testStop = false;
-/**
- * Sets default login state
- *
- * @var bool true
- * @access protected
- */
- protected $_loggedIn = true;
-
/**
* stop method
*
@@ -120,92 +111,6 @@ class AuthUser extends CakeTestModel {
}
}
-/**
- * AuthUserCustomField class
- *
- * @package cake.tests.cases.libs.controller.components
- */
-class AuthUserCustomField extends AuthUser {
-
-/**
- * name property
- *
- * @var string 'AuthUser'
- * @access public
- */
- public $name = 'AuthUserCustomField';
-}
-
-/**
-* UuidUser class
-*
-* @package cake
-* @package cake.tests.cases.libs.controller.components
-*/
-class UuidUser extends CakeTestModel {
-
-/**
- * name property
- *
- * @var string 'AuthUser'
- * @access public
- */
- public $name = 'UuidUser';
-
-/**
- * useDbConfig property
- *
- * @var string 'test'
- * @access public
- */
- public $useDbConfig = 'test';
-
-/**
- * useTable property
- *
- * @var string 'uuid'
- * @access public
- */
- public $useTable = 'uuids';
-
-/**
- * parentNode method
- *
- * @access public
- * @return void
- */
- function parentNode() {
- return true;
- }
-
-/**
- * bindNode method
- *
- * @param mixed $object
- * @access public
- * @return void
- */
- function bindNode($object) {
- return 'Roles/Admin';
- }
-
-/**
- * isAuthorized method
- *
- * @param mixed $user
- * @param mixed $controller
- * @param mixed $action
- * @access public
- * @return void
- */
- function isAuthorized($user, $controller = null, $action = null) {
- if (!empty($user)) {
- return true;
- }
- return false;
- }
-}
-
/**
* AuthTestController class
*
@@ -295,7 +200,7 @@ class AuthTestController extends Controller {
* @return void
*/
function logout() {
- // $this->redirect($this->Auth->logout());
+
}
/**
@@ -461,7 +366,7 @@ class AuthTest extends CakeTestCase {
* @var array
* @access public
*/
- public $fixtures = array('core.uuid', 'core.auth_user', 'core.auth_user_custom_field', 'core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action');
+ public $fixtures = array('core.auth_user');
/**
* initialized property
@@ -485,9 +390,6 @@ class AuthTest extends CakeTestCase {
Configure::write('Security.salt', 'YJfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi');
Configure::write('Security.cipherSeed', 770011223369876);
- Configure::write('Acl.database', 'test');
- Configure::write('Acl.classname', 'DbAcl');
-
$request = new CakeRequest(null, false);
$this->Controller = new AuthTestController($request);
@@ -497,9 +399,6 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->beforeFilter();
- $view = new View($this->Controller);
- ClassRegistry::addObject('view', $view);
-
$this->Controller->Session->delete('Auth');
$this->Controller->Session->delete('Message.auth');
@@ -645,35 +544,6 @@ class AuthTest extends CakeTestCase {
$this->assertFalse($result);
}
-
-/**
- * testAuthorizeModel method
- *
- * @access public
- * @return void
- */
- function testAuthorizeModel() {
- $this->markTestSkipped('This is not implemented');
-
- $this->AuthUser = new AuthUser();
- $user = $this->AuthUser->find();
- $this->Controller->Session->write('Auth', $user);
-
- $this->Controller->request['controller'] = 'auth_test';
- $this->Controller->request['action'] = 'add';
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->authorize = array('model'=>'AuthUser');
- $result = $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue($result);
-
- $this->Controller->Session->delete('Auth');
- $this->Controller->Auth->startup($this->Controller);
- $this->assertTrue($this->Controller->Session->check('Message.auth'));
- $result = $this->Controller->Auth->isAuthorized();
- $this->assertFalse($result);
- }
-
/**
* @expectedException CakeException
* @return void
@@ -1177,6 +1047,7 @@ class AuthTest extends CakeTestCase {
$this->Controller->components = array(
'Auth' => array(
'loginAction' => array('controller' => 'people', 'action' => 'login'),
+ 'logoutRedirect' => array('controller' => 'people', 'action' => 'login'),
),
'Session'
);
From af934e3443dc33b61380b97f60e91089f51ce200 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 27 Jan 2011 21:10:57 -0500
Subject: [PATCH 280/668] Removing more dead code in the Auth test.
---
.../libs/controller/components/auth.test.php | 55 +------------------
1 file changed, 1 insertion(+), 54 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index a34d7a070..e1f9e4edd 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -73,42 +73,6 @@ class AuthUser extends CakeTestModel {
*/
public $useDbConfig = 'test';
-/**
- * parentNode method
- *
- * @access public
- * @return void
- */
- function parentNode() {
- return true;
- }
-
-/**
- * bindNode method
- *
- * @param mixed $object
- * @access public
- * @return void
- */
- function bindNode($object) {
- return 'Roles/Admin';
- }
-
-/**
- * isAuthorized method
- *
- * @param mixed $user
- * @param mixed $controller
- * @param mixed $action
- * @access public
- * @return void
- */
- function isAuthorized($user, $controller = null, $action = null) {
- if (!empty($user)) {
- return true;
- }
- return false;
- }
}
/**
@@ -244,26 +208,9 @@ class AuthTestController extends Controller {
* @return void
*/
function isAuthorized() {
- if (isset($this->request['testControllerAuth'])) {
- return false;
- }
- return true;
+
}
-/**
- * Mock delete method
- *
- * @param mixed $url
- * @param mixed $status
- * @param mixed $exit
- * @access public
- * @return void
- */
- function delete($id = null) {
- if ($this->TestAuth->testStop !== true && $id !== null) {
- echo 'Deleted Record: ' . var_export($id, true);
- }
- }
}
/**
From dc7565ad4771dd3bc28fc84e0a61c3c29dd3da1d Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 27 Jan 2011 21:55:28 -0500
Subject: [PATCH 281/668] Removing crufty methods Removing additiona
->Controller all over the place
---
.../libs/controller/components/auth.test.php | 247 ++++++++----------
1 file changed, 112 insertions(+), 135 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index e1f9e4edd..f2fed0110 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -105,7 +105,7 @@ class AuthTestController extends Controller {
* @var array
* @access public
*/
- public $components = array('Session', 'Auth', 'Acl');
+ public $components = array('Session', 'Auth');
/**
* testUrl property
@@ -129,16 +129,6 @@ class AuthTestController extends Controller {
parent::__construct($request);
}
-/**
- * beforeFilter method
- *
- * @access public
- * @return void
- */
- function beforeFilter() {
- $this->Auth->userModel = 'AuthUser';
- }
-
/**
* login method
*
@@ -340,14 +330,14 @@ class AuthTest extends CakeTestCase {
$request = new CakeRequest(null, false);
$this->Controller = new AuthTestController($request);
- $this->Controller->Components->init($this->Controller);
- $this->Controller->Components->trigger(
- 'initialize', array(&$this->Controller), array('triggerDisabled' => true)
- );
- $this->Controller->beforeFilter();
- $this->Controller->Session->delete('Auth');
- $this->Controller->Session->delete('Message.auth');
+ $collection = new ComponentCollection();
+ $collection->init($this->Controller);
+ $this->Auth = new TestAuthComponent($collection);
+ $this->Auth->request = $request;
+ $this->Auth->response = $this->getMock('CakeResponse');
+
+ $this->Controller->Components->init($this->Controller);
$this->initialized = true;
Router::reload();
@@ -367,7 +357,7 @@ class AuthTest extends CakeTestCase {
$this->Controller->Session->delete('Auth');
$this->Controller->Session->delete('Message.auth');
- unset($this->Controller, $this->AuthUser);
+ unset($this->Controller, $this->Auth);
}
/**
@@ -377,7 +367,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testNoAuth() {
- $this->assertFalse($this->Controller->Auth->isAuthorized());
+ $this->assertFalse($this->Auth->isAuthorized());
}
/**
@@ -409,15 +399,15 @@ class AuthTest extends CakeTestCase {
*/
function testLogin() {
$this->getMock('FormAuthenticate', array(), array(), 'AuthLoginFormAuthenticate', false);
- $this->Controller->Auth->authenticate = array(
+ $this->Auth->authenticate = array(
'AuthLoginForm' => array(
'userModel' => 'AuthUser'
)
);
- $mocks = $this->Controller->Auth->constructAuthenticate();
+ $mocks = $this->Auth->constructAuthenticate();
$this->mockObjects[] = $mocks[0];
- $this->Controller->Auth->request->data = array(
+ $this->Auth->request->data = array(
'AuthUser' => array(
'username' => 'mark',
'password' => Security::hash('cake', null, true)
@@ -431,14 +421,14 @@ class AuthTest extends CakeTestCase {
$mocks[0]->expects($this->once())
->method('authenticate')
- ->with($this->Controller->Auth->request)
+ ->with($this->Auth->request)
->will($this->returnValue($user));
- $result = $this->Controller->Auth->login();
+ $result = $this->Auth->login();
$this->assertTrue($result);
- $this->assertTrue($this->Controller->Auth->loggedIn());
- $this->assertEquals($user, $this->Controller->Auth->user());
+ $this->assertTrue($this->Auth->loggedIn());
+ $this->assertEquals($user, $this->Auth->user());
}
/**
@@ -456,11 +446,11 @@ class AuthTest extends CakeTestCase {
$this->Controller->request->query['url'] = 'auth_test/login';
$this->Controller->Session->delete('Auth');
- $this->Controller->Auth->loginRedirect = '/users/dashboard';
- $this->Controller->Auth->loginAction = 'auth_test/login';
- $this->Controller->Auth->userModel = 'AuthUser';
+ $this->Auth->loginRedirect = '/users/dashboard';
+ $this->Auth->loginAction = 'auth_test/login';
+ $this->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->startup($this->Controller);
$redirect = $this->Controller->Session->read('Auth.redirect');
$this->assertNull($redirect);
}
@@ -717,17 +707,16 @@ class AuthTest extends CakeTestCase {
'AuthUser' => array('id' => '1', 'username' => 'nate')
));
- $this->Controller->request->addParams(Router::parse('users/login'));
- $this->Controller->request->query['url'] = 'users/login';
- $this->Controller->Auth->initialize($this->Controller);
+ $this->Auth->request->addParams(Router::parse('users/login'));
+ $this->Auth->request->query['url'] = 'users/login';
+ $this->Auth->initialize($this->Controller);
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->loginRedirect = array(
+ $this->Auth->loginRedirect = array(
'controller' => 'pages', 'action' => 'display', 'welcome'
);
- $this->Controller->Auth->startup($this->Controller);
- $expected = Router::normalize($this->Controller->Auth->loginRedirect);
- $this->assertEqual($expected, $this->Controller->Auth->redirect());
+ $this->Auth->startup($this->Controller);
+ $expected = Router::normalize($this->Auth->loginRedirect);
+ $this->assertEqual($expected, $this->Auth->redirect());
$this->Controller->Session->delete('Auth');
@@ -741,17 +730,16 @@ class AuthTest extends CakeTestCase {
'AuthUser' => array('id' => '1', 'username' => 'nate'))
);
$this->Controller->testUrl = null;
- $this->Controller->request->addParams(Router::parse($url));
+ $this->Auth->request->addParams(Router::parse($url));
array_push($this->Controller->methods, 'view', 'edit', 'index');
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->authorize = 'controller';
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->authorize = 'controller';
- $this->Controller->Auth->loginAction = array(
+ $this->Auth->loginAction = array(
'controller' => 'AuthTest', 'action' => 'login'
);
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('/AuthTest/login');
$this->assertEqual($expected, $this->Controller->testUrl);
@@ -760,38 +748,35 @@ class AuthTest extends CakeTestCase {
$this->Controller->Session->write('Auth', array(
'AuthUser' => array('id'=>'1', 'username' => 'nate')
));
- $this->Controller->request->params['action'] = 'login';
- $this->Controller->request->query['url'] = 'auth_test/login';
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = 'auth_test/login';
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->loginRedirect = false;
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->request->params['action'] = 'login';
+ $this->Auth->request->query['url'] = 'auth_test/login';
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = 'auth_test/login';
+ $this->Auth->loginRedirect = false;
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('/admin');
- $this->assertEqual($expected, $this->Controller->Auth->redirect());
+ $this->assertEqual($expected, $this->Auth->redirect());
//Ticket #4750
//named params
$this->Controller->Session->delete('Auth');
$url = '/posts/index/year:2008/month:feb';
- $this->Controller->request->addParams(Router::parse($url));
- $this->Controller->request->query['url'] = Router::normalize($url);
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->request->addParams(Router::parse($url));
+ $this->Auth->request->query['url'] = Router::normalize($url);
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/year:2008/month:feb');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
//passed args
$this->Controller->Session->delete('Auth');
$url = '/posts/view/1';
- $this->Controller->request->addParams(Router::parse($url));
- $this->Controller->request->query['url'] = Router::normalize($url);
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->request->addParams(Router::parse($url));
+ $this->Auth->request->query['url'] = Router::normalize($url);
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/view/1');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
@@ -804,13 +789,12 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->Session->delete('Auth');
$url = '/posts/index/29';
- $this->Controller->request = new CakeRequest($url);
- $this->Controller->request->addParams(Router::parse($url));
+ $this->Auth->request = $this->Controller->request = new CakeRequest($url);
+ $this->Auth->request->addParams(Router::parse($url));
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/29?print=true&refer=menu');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
@@ -821,13 +805,12 @@ class AuthTest extends CakeTestCase {
);
$this->Controller->Session->delete('Auth');
$url = '/posts/index/29';
- $this->Controller->request = new CakeRequest($url);
- $this->Controller->request->addParams(Router::parse($url));
+ $this->Auth->request = $this->Controller->request = new CakeRequest($url);
+ $this->Auth->request->addParams(Router::parse($url));
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/29?print=true&refer=menu');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
$_GET = $_back;
@@ -836,13 +819,12 @@ class AuthTest extends CakeTestCase {
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
$this->Controller->Session->delete('Auth');
$url = '/posts/edit/1';
- $this->Controller->request = new CakeRequest($url);
- $this->Controller->request->addParams(Router::parse($url));
- $this->Controller->request->query = array('url' => Router::normalize($url));
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->request = $this->Controller->request = new CakeRequest($url);
+ $this->Auth->request->addParams(Router::parse($url));
+ $this->Auth->request->query = array('url' => Router::normalize($url));
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('/posts/edit/1');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
@@ -850,13 +832,12 @@ class AuthTest extends CakeTestCase {
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
$this->Controller->Session->delete('Auth');
$url = '/AuthTest/login';
- $this->Controller->request = new CakeRequest($url);
- $this->Controller->request->addParams(Router::parse($url));
- $this->Controller->request->query['url'] = Router::normalize($url);
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->request = $this->Controller->request = new CakeRequest($url);
+ $this->Auth->request->addParams(Router::parse($url));
+ $this->Auth->request->query['url'] = Router::normalize($url);
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
+ $this->Auth->startup($this->Controller);
$expected = Router::normalize('/');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
@@ -871,9 +852,9 @@ class AuthTest extends CakeTestCase {
*/
function testNoRedirectOn404() {
$this->Controller->Session->delete('Auth');
- $this->Controller->Auth->initialize($this->Controller);
- $this->Controller->request->addParams(Router::parse('auth_test/something_totally_wrong'));
- $result = $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->request->addParams(Router::parse('auth_test/something_totally_wrong'));
+ $result = $this->Auth->startup($this->Controller);
$this->assertTrue($result, 'Auth redirected a missing action %s');
}
@@ -889,18 +870,17 @@ class AuthTest extends CakeTestCase {
Router::reload();
$url = '/admin/auth_test/add';
- $this->Controller->request->addParams(Router::parse($url));
- $this->Controller->request->query['url'] = ltrim($url, '/');
- $this->Controller->request->base = '';
- Router::setRequestInfo($this->Controller->request);
- $this->Controller->Auth->initialize($this->Controller);
+ $this->Auth->request->addParams(Router::parse($url));
+ $this->Auth->request->query['url'] = ltrim($url, '/');
+ $this->Auth->request->base = '';
+ Router::setRequestInfo($this->Auth->request);
+ $this->Auth->initialize($this->Controller);
- $this->Controller->Auth->loginAction = array(
+ $this->Auth->loginAction = array(
'admin' => true, 'controller' => 'auth_test', 'action' => 'login'
);
- $this->Controller->Auth->userModel = 'AuthUser';
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->startup($this->Controller);
$this->assertEqual($this->Controller->testUrl, '/admin/auth_test/login');
Configure::write('Routing.prefixes', $prefixes);
@@ -941,12 +921,12 @@ class AuthTest extends CakeTestCase {
Router::reload();
$url = '/admin/auth_test/login';
- $this->Controller->request->addParams(Router::parse($url));
- $this->Controller->request->query['url'] = ltrim($url, '/');
+ $this->Auth->request->addParams(Router::parse($url));
+ $this->Auth->request->query['url'] = ltrim($url, '/');
Router::setRequestInfo(array(
array(
'pass' => array(), 'action' => 'admin_login', 'plugin' => null, 'controller' => 'auth_test',
- 'admin' => true, 'url' => array('url' => $this->Controller->request->query['url']),
+ 'admin' => true, 'url' => array('url' => $this->Auth->request->query['url']),
),
array(
'base' => null, 'here' => $url,
@@ -954,12 +934,9 @@ class AuthTest extends CakeTestCase {
)
));
- $this->Controller->Auth->initialize($this->Controller);
-
- $this->Controller->Auth->loginAction = array('admin' => true, 'controller' => 'auth_test', 'action' => 'login');
- $this->Controller->Auth->userModel = 'AuthUser';
-
- $this->Controller->Auth->startup($this->Controller);
+ $this->Auth->initialize($this->Controller);
+ $this->Auth->loginAction = array('admin' => true, 'controller' => 'auth_test', 'action' => 'login');
+ $this->Auth->startup($this->Controller);
$this->assertNull($this->Controller->testUrl);
@@ -1018,8 +995,8 @@ class AuthTest extends CakeTestCase {
function testLogout() {
$this->Controller->Session->write('Auth.User.id', '1');
$this->Controller->Session->write('Auth.redirect', '/users/login');
- $this->Controller->Auth->logoutRedirect = '/';
- $result = $this->Controller->Auth->logout();
+ $this->Auth->logoutRedirect = '/';
+ $result = $this->Auth->logout();
$this->assertEqual($result, '/');
$this->assertNull($this->Controller->Session->read('Auth.AuthUser'));
@@ -1033,13 +1010,13 @@ class AuthTest extends CakeTestCase {
*/
function testMapActionsDelegation() {
$this->getMock('BaseAuthorize', array('authorize'), array(), 'MapActionMockAuthorize', false);
- $this->Controller->Auth->authorize = array('MapActionMock');
- $mock = $this->Controller->Auth->constructAuthorize();
+ $this->Auth->authorize = array('MapActionMock');
+ $mock = $this->Auth->constructAuthorize();
$mock[0]->expects($this->once())
->method('mapActions')
->with(array('create' => array('my_action')));
- $this->Controller->Auth->mapActions(array('create' => array('my_action')));
+ $this->Auth->mapActions(array('create' => array('my_action')));
}
/**
@@ -1052,16 +1029,16 @@ class AuthTest extends CakeTestCase {
$request = new CakeRequest('users/login', false);
$user = array('username' => 'mark', 'role' => 'admin');
- $this->Controller->Auth->request = $request;
- $this->Controller->Auth->authenticate = array('RequestLoginMock');
- $mock = $this->Controller->Auth->constructAuthenticate();
+ $this->Auth->request = $request;
+ $this->Auth->authenticate = array('RequestLoginMock');
+ $mock = $this->Auth->constructAuthenticate();
$mock[0]->expects($this->once())
->method('authenticate')
->with($request)
->will($this->returnValue($user));
- $this->assertTrue($this->Controller->Auth->login());
- $this->assertEquals($user['username'], $this->Controller->Auth->user('username'));
+ $this->assertTrue($this->Auth->login());
+ $this->assertEquals($user['username'], $this->Auth->user('username'));
}
/**
@@ -1070,7 +1047,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testLoginWithUserData() {
- $this->assertFalse($this->Controller->Auth->loggedIn());
+ $this->assertFalse($this->Auth->loggedIn());
$user = array(
'username' => 'mariano',
@@ -1078,9 +1055,9 @@ class AuthTest extends CakeTestCase {
'created' => '2007-03-17 01:16:23',
'updated' => '2007-03-17 01:18:31'
);
- $this->assertTrue($this->Controller->Auth->login($user));
- $this->assertTrue($this->Controller->Auth->loggedIn());
- $this->assertEquals($user['username'], $this->Controller->Auth->user('username'));
+ $this->assertTrue($this->Auth->login($user));
+ $this->assertTrue($this->Auth->loggedIn());
+ $this->assertEquals($user['username'], $this->Auth->user('username'));
}
/**
@@ -1089,17 +1066,17 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testFlashSettings() {
- $this->Controller->Auth->Session = $this->getMock('SessionComponent', array(), array(), '', false);
- $this->Controller->Auth->Session->expects($this->once())
+ $this->Auth->Session = $this->getMock('SessionComponent', array(), array(), '', false);
+ $this->Auth->Session->expects($this->once())
->method('setFlash')
->with('Auth failure', 'custom', array(1), 'auth-key');
- $this->Controller->Auth->flash = array(
+ $this->Auth->flash = array(
'element' => 'custom',
'params' => array(1),
'key' => 'auth-key'
);
- $this->Controller->Auth->flash('Auth failure');
+ $this->Auth->flash('Auth failure');
}
/**
@@ -1109,7 +1086,7 @@ class AuthTest extends CakeTestCase {
*/
function testRedirectSet() {
$value = array('controller' => 'users', 'action' => 'home');
- $result = $this->Controller->Auth->redirect($value);
+ $result = $this->Auth->redirect($value);
$this->assertEquals('/users/home', $result);
$this->assertEquals($value, $this->Controller->Session->read('Auth.redirect'));
}
@@ -1120,10 +1097,10 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testRedirectSessionRead() {
- $this->Controller->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
+ $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Controller->Session->write('Auth.redirect', '/users/home');
- $result = $this->Controller->Auth->redirect();
+ $result = $this->Auth->redirect();
$this->assertEquals('/users/home', $result);
$this->assertFalse($this->Controller->Session->check('Auth.redirect'));
}
@@ -1135,11 +1112,11 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testRedirectSessionReadEqualToLoginAction() {
- $this->Controller->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
- $this->Controller->Auth->loginRedirect = array('controller' => 'users', 'action' => 'home');
+ $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
+ $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'home');
$this->Controller->Session->write('Auth.redirect', array('controller' => 'users', 'action' => 'login'));
- $result = $this->Controller->Auth->redirect();
+ $result = $this->Auth->redirect();
$this->assertEquals('/users/home', $result);
$this->assertFalse($this->Controller->Session->check('Auth.redirect'));
}
From 060360c787875015d46735fbf797f6c5598d457e Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 29 Jan 2011 20:55:48 -0500
Subject: [PATCH 282/668] Switching Controller->Session => Auth->Session.
---
.../libs/controller/components/auth.test.php | 74 +++++++++----------
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index f2fed0110..fc5788ebc 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -355,8 +355,8 @@ class AuthTest extends CakeTestCase {
$_SERVER = $this->_server;
$_ENV = $this->_env;
- $this->Controller->Session->delete('Auth');
- $this->Controller->Session->delete('Message.auth');
+ $this->Auth->Session->delete('Auth');
+ $this->Auth->Session->delete('Message.auth');
unset($this->Controller, $this->Auth);
}
@@ -444,14 +444,14 @@ class AuthTest extends CakeTestCase {
$this->Controller->data = array();
$this->Controller->request->addParams(Router::parse('auth_test/login'));
$this->Controller->request->query['url'] = 'auth_test/login';
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$this->Auth->loginRedirect = '/users/dashboard';
$this->Auth->loginAction = 'auth_test/login';
$this->Auth->userModel = 'AuthUser';
$this->Auth->startup($this->Controller);
- $redirect = $this->Controller->Session->read('Auth.redirect');
+ $redirect = $this->Auth->Session->read('Auth.redirect');
$this->assertNull($redirect);
}
@@ -464,17 +464,17 @@ class AuthTest extends CakeTestCase {
function testAuthorizeFalse() {
$this->AuthUser = new AuthUser();
$user = $this->AuthUser->find();
- $this->Controller->Session->write('Auth.User', $user['AuthUser']);
+ $this->Auth->Session->write('Auth.User', $user['AuthUser']);
$this->Controller->Auth->userModel = 'AuthUser';
$this->Controller->Auth->authorize = false;
$this->Controller->request->addParams(Router::parse('auth_test/add'));
$result = $this->Controller->Auth->startup($this->Controller);
$this->assertTrue($result);
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$result = $this->Controller->Auth->startup($this->Controller);
$this->assertFalse($result);
- $this->assertTrue($this->Controller->Session->check('Message.auth'));
+ $this->assertTrue($this->Auth->Session->check('Message.auth'));
$this->Controller->request->addParams(Router::parse('auth_test/camelCase'));
$result = $this->Controller->Auth->startup($this->Controller);
@@ -703,7 +703,7 @@ class AuthTest extends CakeTestCase {
$_ENV['HTTP_REFERER'] = false;
putenv('HTTP_REFERER=');
- $this->Controller->Session->write('Auth', array(
+ $this->Auth->Session->write('Auth', array(
'AuthUser' => array('id' => '1', 'username' => 'nate')
));
@@ -718,7 +718,7 @@ class AuthTest extends CakeTestCase {
$expected = Router::normalize($this->Auth->loginRedirect);
$this->assertEqual($expected, $this->Auth->redirect());
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
//empty referer no session
$_SERVER['HTTP_REFERER'] = false;
@@ -726,7 +726,7 @@ class AuthTest extends CakeTestCase {
putenv('HTTP_REFERER=');
$url = '/posts/view/1';
- $this->Controller->Session->write('Auth', array(
+ $this->Auth->Session->write('Auth', array(
'AuthUser' => array('id' => '1', 'username' => 'nate'))
);
$this->Controller->testUrl = null;
@@ -743,9 +743,9 @@ class AuthTest extends CakeTestCase {
$expected = Router::normalize('/AuthTest/login');
$this->assertEqual($expected, $this->Controller->testUrl);
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$_SERVER['HTTP_REFERER'] = $_ENV['HTTP_REFERER'] = Router::url('/admin', true);
- $this->Controller->Session->write('Auth', array(
+ $this->Auth->Session->write('Auth', array(
'AuthUser' => array('id'=>'1', 'username' => 'nate')
));
$this->Auth->request->params['action'] = 'login';
@@ -759,7 +759,7 @@ class AuthTest extends CakeTestCase {
//Ticket #4750
//named params
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$url = '/posts/index/year:2008/month:feb';
$this->Auth->request->addParams(Router::parse($url));
$this->Auth->request->query['url'] = Router::normalize($url);
@@ -767,10 +767,10 @@ class AuthTest extends CakeTestCase {
$this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/year:2008/month:feb');
- $this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
+ $this->assertEqual($expected, $this->Auth->Session->read('Auth.redirect'));
//passed args
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$url = '/posts/view/1';
$this->Auth->request->addParams(Router::parse($url));
$this->Auth->request->query['url'] = Router::normalize($url);
@@ -778,7 +778,7 @@ class AuthTest extends CakeTestCase {
$this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/view/1');
- $this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
+ $this->assertEqual($expected, $this->Auth->Session->read('Auth.redirect'));
// QueryString parameters
$_back = $_GET;
@@ -787,7 +787,7 @@ class AuthTest extends CakeTestCase {
'print' => 'true',
'refer' => 'menu'
);
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$url = '/posts/index/29';
$this->Auth->request = $this->Controller->request = new CakeRequest($url);
$this->Auth->request->addParams(Router::parse($url));
@@ -796,14 +796,14 @@ class AuthTest extends CakeTestCase {
$this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/29?print=true&refer=menu');
- $this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
+ $this->assertEqual($expected, $this->Auth->Session->read('Auth.redirect'));
$_GET = array(
'url' => '/posts/index/29',
'print' => 'true',
'refer' => 'menu'
);
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$url = '/posts/index/29';
$this->Auth->request = $this->Controller->request = new CakeRequest($url);
$this->Auth->request->addParams(Router::parse($url));
@@ -812,12 +812,12 @@ class AuthTest extends CakeTestCase {
$this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/29?print=true&refer=menu');
- $this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
+ $this->assertEqual($expected, $this->Auth->Session->read('Auth.redirect'));
$_GET = $_back;
//external authed action
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$url = '/posts/edit/1';
$this->Auth->request = $this->Controller->request = new CakeRequest($url);
$this->Auth->request->addParams(Router::parse($url));
@@ -826,11 +826,11 @@ class AuthTest extends CakeTestCase {
$this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Auth->startup($this->Controller);
$expected = Router::normalize('/posts/edit/1');
- $this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
+ $this->assertEqual($expected, $this->Auth->Session->read('Auth.redirect'));
//external direct login link
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$url = '/AuthTest/login';
$this->Auth->request = $this->Controller->request = new CakeRequest($url);
$this->Auth->request->addParams(Router::parse($url));
@@ -839,9 +839,9 @@ class AuthTest extends CakeTestCase {
$this->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Auth->startup($this->Controller);
$expected = Router::normalize('/');
- $this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
+ $this->assertEqual($expected, $this->Auth->Session->read('Auth.redirect'));
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
}
/**
@@ -851,7 +851,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testNoRedirectOn404() {
- $this->Controller->Session->delete('Auth');
+ $this->Auth->Session->delete('Auth');
$this->Auth->initialize($this->Controller);
$this->Auth->request->addParams(Router::parse('auth_test/something_totally_wrong'));
$result = $this->Auth->startup($this->Controller);
@@ -951,11 +951,11 @@ class AuthTest extends CakeTestCase {
*/
function testShutDown() {
$this->Controller->Auth->initialize($this->Controller, array('_loggedIn' => true));
- $this->Controller->Session->write('Auth.redirect', 'foo');
+ $this->Auth->Session->write('Auth.redirect', 'foo');
$this->Controller->Auth->loggedIn(true);
$this->Controller->Auth->shutdown($this->Controller);
- $this->assertNull($this->Controller->Session->read('Auth.redirect'));
+ $this->assertNull($this->Auth->Session->read('Auth.redirect'));
}
/**
@@ -993,14 +993,14 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testLogout() {
- $this->Controller->Session->write('Auth.User.id', '1');
- $this->Controller->Session->write('Auth.redirect', '/users/login');
+ $this->Auth->Session->write('Auth.User.id', '1');
+ $this->Auth->Session->write('Auth.redirect', '/users/login');
$this->Auth->logoutRedirect = '/';
$result = $this->Auth->logout();
$this->assertEqual($result, '/');
- $this->assertNull($this->Controller->Session->read('Auth.AuthUser'));
- $this->assertNull($this->Controller->Session->read('Auth.redirect'));
+ $this->assertNull($this->Auth->Session->read('Auth.AuthUser'));
+ $this->assertNull($this->Auth->Session->read('Auth.redirect'));
}
/**
@@ -1088,7 +1088,7 @@ class AuthTest extends CakeTestCase {
$value = array('controller' => 'users', 'action' => 'home');
$result = $this->Auth->redirect($value);
$this->assertEquals('/users/home', $result);
- $this->assertEquals($value, $this->Controller->Session->read('Auth.redirect'));
+ $this->assertEquals($value, $this->Auth->Session->read('Auth.redirect'));
}
/**
@@ -1098,11 +1098,11 @@ class AuthTest extends CakeTestCase {
*/
function testRedirectSessionRead() {
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
- $this->Controller->Session->write('Auth.redirect', '/users/home');
+ $this->Auth->Session->write('Auth.redirect', '/users/home');
$result = $this->Auth->redirect();
$this->assertEquals('/users/home', $result);
- $this->assertFalse($this->Controller->Session->check('Auth.redirect'));
+ $this->assertFalse($this->Auth->Session->check('Auth.redirect'));
}
/**
@@ -1114,10 +1114,10 @@ class AuthTest extends CakeTestCase {
function testRedirectSessionReadEqualToLoginAction() {
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'home');
- $this->Controller->Session->write('Auth.redirect', array('controller' => 'users', 'action' => 'login'));
+ $this->Auth->Session->write('Auth.redirect', array('controller' => 'users', 'action' => 'login'));
$result = $this->Auth->redirect();
$this->assertEquals('/users/home', $result);
- $this->assertFalse($this->Controller->Session->check('Auth.redirect'));
+ $this->assertFalse($this->Auth->Session->check('Auth.redirect'));
}
}
From 59dac2255ec2d4c310e28fddc71d04f85bc6e1d9 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 29 Jan 2011 21:02:51 -0500
Subject: [PATCH 283/668] Expanding test coverage.
---
.../libs/controller/components/auth.test.php | 42 +++++++++++++++++--
1 file changed, 38 insertions(+), 4 deletions(-)
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index fc5788ebc..e7c689ae0 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -500,13 +500,13 @@ class AuthTest extends CakeTestCase {
$this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockTwoAuthorize', false);
$this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockThreeAuthorize', false);
- $this->Controller->Auth->authorize = array(
+ $this->Auth->authorize = array(
'AuthMockOne',
'AuthMockTwo',
'AuthMockThree'
);
- $mocks = $this->Controller->Auth->constructAuthorize();
- $request = $this->Controller->request;
+ $mocks = $this->Auth->constructAuthorize();
+ $request = $this->Auth->request;
$this->assertEquals(3, count($mocks));
$mocks[0]->expects($this->once())
@@ -522,7 +522,29 @@ class AuthTest extends CakeTestCase {
$mocks[2]->expects($this->never())
->method('authorize');
- $this->assertTrue($this->Controller->Auth->isAuthorized(array('User'), $request));
+ $this->assertTrue($this->Auth->isAuthorized(array('User'), $request));
+ }
+
+/**
+ * test that isAuthorized will use the session user if none is given.
+ *
+ * @return void
+ */
+ function testIsAuthorizedUsingUserInSession() {
+ $this->getMock('BaseAuthorize', array('authorize'), array(), 'AuthMockFourAuthorize', false);
+ $this->Auth->authorize = array('AuthMockFour');
+
+ $user = array('user' => 'mark');
+ $this->Auth->Session->write('Auth.User', $user);
+ $mocks = $this->Auth->constructAuthorize();
+ $request = $this->Controller->request;
+
+ $mocks[0]->expects($this->once())
+ ->method('authorize')
+ ->with($user, $request)
+ ->will($this->returnValue(true));
+
+ $this->assertTrue($this->Auth->isAuthorized(null, $request));
}
/**
@@ -1120,4 +1142,16 @@ class AuthTest extends CakeTestCase {
$this->assertEquals('/users/home', $result);
$this->assertFalse($this->Auth->Session->check('Auth.redirect'));
}
+
+/**
+ * test password hashing
+ *
+ * @return void
+ */
+ function testPassword() {
+ $result = $this->Auth->password('password');
+ $expected = Security::hash('password', null, true);
+ $this->assertEquals($expected, $result);
+
+ }
}
From a5d9a64e1a741b7acb9e622e2d01e070de3fa319 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 30 Jan 2011 15:58:37 -0500
Subject: [PATCH 284/668] Removing loginError, its not used anymore.
---
cake/libs/controller/components/auth.php | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 543012c91..123f7697c 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -202,15 +202,6 @@ class AuthComponent extends Component {
*/
public $logoutRedirect = null;
-/**
- * Error to display when user login fails. For security purposes, only one error is used for all
- * login failures, so as not to expose information on why the login failed.
- *
- * @var string
- * @link http://book.cakephp.org/view/1272/loginError
- */
- public $loginError = null;
-
/**
* Error to display when user attempts to access an object or action to which they do not have
* acccess.
@@ -358,7 +349,6 @@ class AuthComponent extends Component {
function __setDefaults() {
$defaults = array(
'logoutRedirect' => $this->loginAction,
- 'loginError' => __('Login failed. Invalid username or password.'),
'authError' => __('You are not authorized to access that location.')
);
foreach ($defaults as $key => $value) {
From 5834225cc3f0c06e2cbc82bd3c17c5f2de34fb64 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 30 Jan 2011 16:06:01 -0500
Subject: [PATCH 285/668] Making AuthComponent::password() static, as it might
be needed in places where an instance of AuthComponent is not handy.
---
cake/libs/controller/components/auth.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 123f7697c..e07f89e94 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -640,7 +640,7 @@ class AuthComponent extends Component {
* @return string Hashed password
* @link http://book.cakephp.org/view/1263/password
*/
- public function password($password) {
+ public static function password($password) {
return Security::hash($password, null, true);
}
From 9854947d0fd839e7e1bfced48e043583c2379b0c Mon Sep 17 00:00:00 2001
From: mark_story
Date: Tue, 1 Feb 2011 21:24:46 -0500
Subject: [PATCH 286/668] Fixing reversed args.
---
cake/libs/controller/components/auth.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index e07f89e94..001bdeef1 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -627,7 +627,7 @@ class AuthComponent extends Component {
if (!method_exists($className, 'authenticate')) {
throw new CakeException(__('Authentication objects must implement an authenticate method.'));
}
- $settings = array_merge((array)$settings, $global);
+ $settings = array_merge($global, (array)$settings);
$this->_authenticateObjects[] = new $className($settings);
}
return $this->_authenticateObjects;
From 3875d0ef548fc0c0ee5e5cac8da072f0b17ebe9b Mon Sep 17 00:00:00 2001
From: mark_story
Date: Thu, 3 Feb 2011 23:00:41 -0500
Subject: [PATCH 287/668] Removing a method that is duplicated in
AuthComponent.
---
.../controller/components/auth/base_authenticate.php | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/cake/libs/controller/components/auth/base_authenticate.php b/cake/libs/controller/components/auth/base_authenticate.php
index 0753640f8..d34789729 100644
--- a/cake/libs/controller/components/auth/base_authenticate.php
+++ b/cake/libs/controller/components/auth/base_authenticate.php
@@ -49,16 +49,6 @@ abstract class BaseAuthenticate {
$this->settings = Set::merge($this->settings, $settings);
}
-/**
- * Hash the supplied password using the configured hashing method.
- *
- * @param string $password The password to hash.
- * @return string Hashed string
- */
- public function hash($password) {
- return Security::hash($password, null, true);
- }
-
/**
* Find a user record using the standard options.
*
@@ -73,7 +63,7 @@ abstract class BaseAuthenticate {
$conditions = array(
$model . '.' . $fields['username'] => $username,
- $model . '.' . $fields['password'] => $this->hash($password),
+ $model . '.' . $fields['password'] => AuthComponent::password($password),
);
if (!empty($this->settings['scope'])) {
$conditions = array_merge($conditions, $this->settings['scope']);
From 7b34d879dcbcc3dc9338855724803ef91fa07e81 Mon Sep 17 00:00:00 2001
From: Mark Story
Date: Fri, 4 Feb 2011 17:11:49 -0500
Subject: [PATCH 288/668] Making exception class names visible in the WebTest
runner. Fixes #1506
---
cake/tests/lib/reporter/cake_html_reporter.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php
index 63153ba9c..73d6eb8f1 100755
--- a/cake/tests/lib/reporter/cake_html_reporter.php
+++ b/cake/tests/lib/reporter/cake_html_reporter.php
@@ -271,7 +271,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
$testName = get_class($test) . '(' . $test->getName() . ')';
echo "\n";
- echo "Exception";
+ echo "" . get_class($message) . "";
echo "" . $this->_htmlEntities($message->getMessage()) . "
\n";
echo "" . __('Test case: %s', $testName) . "
\n";
From 8e267f7be25b1ad657d3530b9e5520667606ca97 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Fri, 4 Feb 2011 21:56:24 -0500
Subject: [PATCH 289/668] Fixing bake's unit test detection so it checks for
PHPUnit properly. Fixes #1505
---
cake/console/shells/shell.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cake/console/shells/shell.php b/cake/console/shells/shell.php
index dd59dbb2c..a143ba4e9 100644
--- a/cake/console/shells/shell.php
+++ b/cake/console/shells/shell.php
@@ -628,7 +628,10 @@ class Shell extends Object {
* @return boolean Success
*/
protected function _checkUnitTest() {
- if (App::import('vendor', 'simpletest' . DS . 'simpletest')) {
+ if (App::import('Vendor', 'phpunit', array('file' => 'PHPUnit' . DS . 'Autoload.php'))) {
+ return true;
+ }
+ if (@include 'PHPUnit' . DS . 'Autoload.php') {
return true;
}
$prompt = 'PHPUnit is not installed. Do you want to bake unit test files anyway?';
From 304f12d0edde3347bce6b79c26dabcf415f26b29 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 5 Feb 2011 01:28:41 -0500
Subject: [PATCH 290/668] Removing a pointless import in CakeRequest. Moving
inclusion of ObjectCollection to bootstrap. This avoids repetitive calls to
import()
---
cake/bootstrap.php | 1 +
cake/console/libs/task_collection.php | 2 --
cake/libs/cake_request.php | 1 -
cake/libs/controller/component_collection.php | 2 --
cake/libs/model/behavior_collection.php | 2 --
cake/libs/view/helper_collection.php | 2 --
6 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/cake/bootstrap.php b/cake/bootstrap.php
index 65931eb39..aa30770fc 100644
--- a/cake/bootstrap.php
+++ b/cake/bootstrap.php
@@ -27,6 +27,7 @@ require CORE_PATH . 'cake' . DS . 'basics.php';
require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
require LIBS . 'error' . DS . 'exceptions.php';
require LIBS . 'object.php';
+require LIBS . 'object_collection.php';
require LIBS . 'inflector.php';
require LIBS . 'app.php';
require LIBS . 'configure.php';
diff --git a/cake/console/libs/task_collection.php b/cake/console/libs/task_collection.php
index df29d3d26..da476f220 100644
--- a/cake/console/libs/task_collection.php
+++ b/cake/console/libs/task_collection.php
@@ -15,8 +15,6 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
-
class TaskCollection extends ObjectCollection {
/**
* Shell to use to set params to tasks.
diff --git a/cake/libs/cake_request.php b/cake/libs/cake_request.php
index b7a10058e..90ffa8cbf 100644
--- a/cake/libs/cake_request.php
+++ b/cake/libs/cake_request.php
@@ -15,7 +15,6 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Set');
/**
* A class that helps wrap Request information and particulars about a single request.
diff --git a/cake/libs/controller/component_collection.php b/cake/libs/controller/component_collection.php
index 2a483cc21..07a2a6eef 100644
--- a/cake/libs/controller/component_collection.php
+++ b/cake/libs/controller/component_collection.php
@@ -15,8 +15,6 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
-
class ComponentCollection extends ObjectCollection {
/**
diff --git a/cake/libs/model/behavior_collection.php b/cake/libs/model/behavior_collection.php
index 30c9c1469..8bd92198f 100644
--- a/cake/libs/model/behavior_collection.php
+++ b/cake/libs/model/behavior_collection.php
@@ -18,8 +18,6 @@
* @since CakePHP(tm) v 1.2.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
-
/**
* Model behavior collection class.
*
diff --git a/cake/libs/view/helper_collection.php b/cake/libs/view/helper_collection.php
index d90289e21..c967ec676 100644
--- a/cake/libs/view/helper_collection.php
+++ b/cake/libs/view/helper_collection.php
@@ -15,8 +15,6 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'ObjectCollection');
-
class HelperCollection extends ObjectCollection {
/**
From 8d7df1721c93d954d88c1163d0d9503dc6a7fd8b Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 5 Feb 2011 01:29:35 -0500
Subject: [PATCH 291/668] Removing duplicate import.
---
cake/libs/cake_session.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php
index a08fd49c3..ec7a86b27 100644
--- a/cake/libs/cake_session.php
+++ b/cake/libs/cake_session.php
@@ -135,7 +135,6 @@ class CakeSession {
* @param boolean $start Should session be started right now
*/
public static function init($base = null, $start = true) {
- App::import('Core', 'Security');
self::$time = time();
$checkAgent = Configure::read('Session.checkAgent');
From f5383a2243da4898f2310e96a292c498fc3083b2 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 5 Feb 2011 01:40:14 -0500
Subject: [PATCH 292/668] Fixing some failing tests.
---
cake/tests/cases/console/shells/api.test.php | 43 ++++++++++---------
.../cases/console/shells/tasks/test.test.php | 8 ++--
2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/cake/tests/cases/console/shells/api.test.php b/cake/tests/cases/console/shells/api.test.php
index e43c55d33..79deea551 100644
--- a/cake/tests/cases/console/shells/api.test.php
+++ b/cake/tests/cases/console/shells/api.test.php
@@ -58,27 +58,28 @@ class ApiShellTest extends CakeTestCase {
$expected = array(
'1. afterFilter()',
'2. beforeFilter()',
- '3. beforeRender()',
- '4. constructClasses()',
- '5. disableCache()',
- '6. flash($message, $url, $pause = 1, $layout = \'flash\')',
- '7. getResponse()',
- '8. header($status)',
- '9. httpCodes($code = NULL)',
- '10. isAuthorized()',
- '11. loadModel($modelClass = NULL, $id = NULL)',
- '12. paginate($object = NULL, $scope = array (), $whitelist = array ())',
- '13. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)',
- '14. redirect($url, $status = NULL, $exit = true)',
- '15. referer($default = NULL, $local = false)',
- '16. render($action = NULL, $layout = NULL, $file = NULL)',
- '17. set($one, $two = NULL)',
- '18. setAction($action)',
- '19. setRequest($request)',
- '20. shutdownProcess()',
- '21. startupProcess()',
- '22. validate()',
- '23. validateErrors()'
+ '3. beforeRedirect($url, $status = NULL, $exit = true)',
+ '4. beforeRender()',
+ '5. constructClasses()',
+ '6. disableCache()',
+ '7. flash($message, $url, $pause = 1, $layout = \'flash\')',
+ '8. getResponse()',
+ '9. header($status)',
+ '10. httpCodes($code = NULL)',
+ '11. isAuthorized()',
+ '12. loadModel($modelClass = NULL, $id = NULL)',
+ '13. paginate($object = NULL, $scope = array (), $whitelist = array ())',
+ '14. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)',
+ '15. redirect($url, $status = NULL, $exit = true)',
+ '16. referer($default = NULL, $local = false)',
+ '17. render($action = NULL, $layout = NULL, $file = NULL)',
+ '18. set($one, $two = NULL)',
+ '19. setAction($action)',
+ '20. setRequest($request)',
+ '21. shutdownProcess()',
+ '22. startupProcess()',
+ '23. validate()',
+ '24. validateErrors()'
);
$this->Shell->expects($this->at(2))->method('out')->with($expected);
diff --git a/cake/tests/cases/console/shells/tasks/test.test.php b/cake/tests/cases/console/shells/tasks/test.test.php
index b57ec9d2f..5b25fb0b0 100644
--- a/cake/tests/cases/console/shells/tasks/test.test.php
+++ b/cake/tests/cases/console/shells/tasks/test.test.php
@@ -441,10 +441,10 @@ class TestTaskTest extends CakeTestCase {
$this->assertContains("App::import('Model', 'TestTaskArticle')", $result);
$this->assertContains('class TestTaskArticleTestCase extends CakeTestCase', $result);
- $this->assertContains('function startTest()', $result);
+ $this->assertContains('function setUp()', $result);
$this->assertContains("\$this->TestTaskArticle = ClassRegistry::init('TestTaskArticle')", $result);
- $this->assertContains('function endTest()', $result);
+ $this->assertContains('function tearDown()', $result);
$this->assertContains('unset($this->TestTaskArticle)', $result);
$this->assertContains('function testDoSomething()', $result);
@@ -476,11 +476,11 @@ class TestTaskTest extends CakeTestCase {
$this->assertContains('public $autoRender = false', $result);
$this->assertContains('function redirect($url, $status = null, $exit = true)', $result);
- $this->assertContains('function startTest()', $result);
+ $this->assertContains('function setUp()', $result);
$this->assertContains("\$this->TestTaskComments = new TestTestTaskCommentsController()", $result);
$this->assertContains("\$this->TestTaskComments->constructClasses()", $result);
- $this->assertContains('function endTest()', $result);
+ $this->assertContains('function tearDown()', $result);
$this->assertContains('unset($this->TestTaskComments)', $result);
$this->assertContains("'app.test_task_article'", $result);
From 8f66fe6ed424797e3d2ae7e7122da142690dd0e0 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 5 Feb 2011 01:48:52 -0500
Subject: [PATCH 293/668] Removing additional spaces in tags.
---
cake/libs/view/helpers/html.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index 436941a81..52458329c 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -35,11 +35,11 @@ class HtmlHelper extends AppHelper {
'metalink' => '',
'link' => '%s',
'mailto' => '%s',
- 'form' => '',
- 'input' => '',
- 'textarea' => '',
- 'hidden' => '',
+ 'input' => '',
+ 'textarea' => '',
+ 'hidden' => '',
'checkbox' => '',
'checkboxmultiple' => '',
'radio' => '%s',
From f58f3763ebab43cfdfe640d274aa0f02afe20736 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sat, 5 Feb 2011 05:52:18 -0500
Subject: [PATCH 294/668] Updating tests to account for attribute whitespace
change.
---
cake/tests/cases/libs/view/helpers/form.test.php | 4 ++--
cake/tests/cases/libs/view/helpers/html.test.php | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php
index ed3af90d1..949857f1b 100644
--- a/cake/tests/cases/libs/view/helpers/form.test.php
+++ b/cake/tests/cases/libs/view/helpers/form.test.php
@@ -5251,7 +5251,7 @@ class FormHelperTest extends CakeTestCase {
));
$result = $this->Form->postButton('Send', '/', array('data' => array('extra' => 'value')));
- $this->assertTrue(strpos($result, '') !== false);
+ $this->assertTrue(strpos($result, '') !== false);
}
/**
@@ -5291,7 +5291,7 @@ class FormHelperTest extends CakeTestCase {
));
$result = $this->Form->postLink('Delete', '/posts/delete', array('data' => array('id' => 1)));
- $this->assertTrue(strpos($result, '') !== false);
+ $this->assertTrue(strpos($result, '') !== false);
}
/**
diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php
index 4da61890d..fc9c21936 100644
--- a/cake/tests/cases/libs/view/helpers/html.test.php
+++ b/cake/tests/cases/libs/view/helpers/html.test.php
@@ -1298,7 +1298,7 @@ class HtmlHelperTest extends CakeTestCase {
$result = $this->Html->useTag('formend');
$this->assertTags($result, '/form');
- $result = $this->Html->useTag('form', 'test');
+ $result = $this->Html->useTag('form', ' test');
$this->assertEqual($result, '