Permalink
Browse files

MERGE 2.0 into 2.0-dev

  • Loading branch information...
1 parent a2abcd4 commit 0584b39c9fa90f99136571a3b0a1fc9635dd3002 @skie skie committed Jul 23, 2012
Showing with 890 additions and 123 deletions.
  1. +3 −3 Controller/Component/ArchiveComponent.php
  2. +10 −10 Controller/Component/FormPreserverComponent.php
  3. +5 −5 Controller/Component/RefererComponent.php
  4. +2 −2 Model/Behavior/InheritableBehavior.php
  5. +2 −0 Model/Behavior/LookupableBehavior.php
  6. +1 −0 Model/Behavior/PingbackableBehavior.php
  7. +484 −0 Model/Behavior/RegisterException.php
  8. +29 −13 Model/Behavior/SerializableBehavior.php
  9. +6 −2 Model/Behavior/SoftDeleteBehavior.php
  10. +7 −8 Test/Case/{Component/ArchiveTest.php → Controller/Component/ArchiveComponentTest.php}
  11. +24 −15 Test/Case/{Component/FormPreserver.test.php → Controller/Component/FormPreserverComponentTest.php}
  12. +79 −0 Test/Case/Controller/Component/PrgComponentTest.php
  13. +116 −0 Test/Case/Controller/Component/RefererComponentTest.php
  14. 0 Test/Case/{Component/RefererTest.php → Controller/Component/RefererComponentTest.php-}
  15. +6 −6 Test/Case/{ → Model}/Behavior/BtreeTest.php
  16. +7 −3 Test/Case/{ → Model}/Behavior/CsvImportTest.php
  17. 0 Test/Case/{ → Model}/Behavior/InheritableTest.php
  18. 0 Test/Case/{ → Model}/Behavior/ListTest.php
  19. 0 Test/Case/{ → Model}/Behavior/LookupableTest.php
  20. +4 −3 Test/Case/{ → Model}/Behavior/SerializableTest.php
  21. 0 Test/Case/{ → Model}/Behavior/SluggableTest.php
  22. 0 Test/Case/{ → Model}/Behavior/SoftDeleteTest.php
  23. 0 Test/Case/{ → Model}/Behavior/TinySluggableTest.php
  24. +5 −2 Test/Case/{ → Model}/Behavior/ToggleableTest.php
  25. +51 −28 Test/Case/View/Helper/{CleanerTest.php → CleanerHelperTest.php}
  26. +6 −8 Test/Case/View/Helper/{GravatarTest.php → GravatarHelperTest.php}
  27. +1 −1 Test/Fixture/ContentFixture.php
  28. +21 −0 Test/Fixture/ProductFixture.php
  29. +1 −0 View/Helper/CleanerHelper.php
  30. +17 −12 View/Helper/GravatarHelper.php
  31. +3 −2 View/Helper/TreeHelper.php
@@ -57,16 +57,16 @@ class ArchiveComponent extends Object {
*
* @param object
*/
- public function startup(&$controller) {
+ public function startup(Controller $controller) {
$this->controller =& $controller;
if (empty($this->modelName)) {
$this->modelName = $controller->modelClass;
}
$parsedParams = array();
foreach ($this->_parameters as $param) {
- if (isset($controller->params[$param]) && is_numeric($controller->params[$param])) {
- $parsedParams[$param] = $controller->params[$param];
+ if (isset($controller->request->params[$param]) && is_numeric($controller->request->params[$param])) {
+ $parsedParams[$param] = $controller->request->params[$param];
}
}
if (empty($parsedParams)) {
@@ -82,7 +82,7 @@ public function __construct() {
*
* @param object Controller object
*/
- public function initialize(&$Controller) {
+ public function initialize(Controller $Controller) {
$this->Controller = $Controller;
$this->sessionPath = $this->sessionKey . '.' . $Controller->name . '.' . $Controller->action;
}
@@ -94,15 +94,15 @@ public function initialize(&$Controller) {
* @return void
*/
- public function startUp(&$Controller) {
+ public function startUp(Controller $Controller) {
if (in_array($Controller->action, $this->actions)) {
- if (empty($Controller->data) && $Controller->Session->check($this->sessionPath)) {
+ if (empty($Controller->request->data) && $Controller->Session->check($this->sessionPath)) {
if ($this->directPost == true) {
- $Controller->data = $Controller->Session->read($this->sessionPath);
+ $Controller->request->data = $Controller->Session->read($this->sessionPath);
$Controller->Session->delete($this->sessionPath);
}
- } elseif (!empty($Controller->data) && !$Controller->Auth->user()) {
- $this->preserve($Controller->data);
+ } elseif (!empty($Controller->request->data) && !$Controller->Auth->user()) {
+ $this->preserve($Controller->request->data);
if (empty($this->loginAction) && !empty($Controller->Auth->loginAction)) {
$this->loginAction = $Controller->Auth->loginAction;
if (!empty($this->redirectMessage)) {
@@ -153,11 +153,11 @@ public function preserve($data = null, $sessionPath = null) {
*/
public function restore($sessionPath = null) {
$this->_overridPath($sessionPath);
- if (empty($this->Controller->data) && $this->Controller->Session->check($this->sessionPath)) {
- if (!empty($this->Controller->data)) {
- $this->Controller->data = array_merge($this->Controller->Session->read($this->sessionPath), $this->Controller->data);
+ if (empty($this->Controller->request->data) && $this->Controller->Session->check($this->sessionPath)) {
+ if (!empty($this->Controller->request->data)) {
+ $this->Controller->request->data = array_merge($this->Controller->Session->read($this->sessionPath), $this->Controller->request->data);
} else {
- $this->Controller->data = $this->Controller->Session->read($this->sessionPath);
+ $this->Controller->request->data = $this->Controller->Session->read($this->sessionPath);
}
$this->Controller->Session->delete($this->sessionPath);
}
@@ -17,7 +17,7 @@
* @package utils
* @subpackage utils.controllers.components
*/
-class RefererComponent extends Object {
+class RefererComponent extends Component {
/**
* Controller object instance
@@ -31,7 +31,7 @@ class RefererComponent extends Object {
*
* @param object Controller object
*/
- public function initialize(&$controller) {
+ public function initialize($controller) {
$this->Controller = $controller;
}
@@ -40,7 +40,7 @@ public function initialize(&$controller) {
*
* @param object Controller object
*/
- public function startup(&$controller) {
+ public function startup($controller) {
$this->setReferer();
}
@@ -51,7 +51,7 @@ public function startup(&$controller) {
*/
public function setReferer($default = null) {
if (empty($this->Controller->request->data['Data']['referer'])) {
- $referer = $this->Controller->request->referer();
+ $referer = $this->Controller->referer();
if ($referer == '/' && !empty($default)) {
$referer = $default;
@@ -78,7 +78,7 @@ public function redirect($url, $status = null, $exit = true) {
if (isset($this->Controller->data['Data']['referer'])) {
$referer = $this->Controller->request->data['Data']['referer'];
} else {
- $referer = $this->Controller->request->referer();
+ $referer = $this->Controller->referer();
}
if (strlen($referer) == 0 || $referer == '/') {
@@ -194,8 +194,8 @@ public function beforeValidate(Model $Model) {
*/
protected function _singleTableBeforeFind(Model $Model, $query) {
extract($this->settings[$Model->alias]);
-
- if (isset($Model->_schema[$inheritanceField]) && $Model->alias != $Model->parent->alias) {
+ $_schema = $Model->schema();
+ if (isset($_schema[$inheritanceField]) && $Model->alias != $Model->parent->alias) {
$field = $Model->alias. '.' . $inheritanceField;
if (!isset($query['conditions'])) {
@@ -17,6 +17,8 @@
* @package utils
* @subpackage utils.models.behaviors
*/
+ App::uses('ModelBehavior', 'Model');
+
class LookupableBehavior extends ModelBehavior {
/**
@@ -12,6 +12,7 @@
App::uses('HttpSocket', 'Network/Http');
App::uses('Xml', 'Utility');
+App::uses('ModelBehavior', 'Model');
App::import('Lib', 'Xmlrpc.Xmlrpc');
Oops, something went wrong.

0 comments on commit 0584b39

Please sign in to comment.