Browse Source

Merge branch '2.x' of https://github.com/dereuromark/cakephp-tools into 2.5

bancer 9 years ago
parent
commit
c6b3a8b32e

+ 3 - 2
Lib/EmailLib.php

@@ -52,7 +52,7 @@ class EmailLib extends CakeEmail {
 
 
 	public function __construct($config = null) {
 	public function __construct($config = null) {
 		if ($config === null) {
 		if ($config === null) {
-			$config = 'default';
+			$config = Configure::read('Email.config') ?: 'default';
 		}
 		}
 		parent::__construct($config);
 		parent::__construct($config);
 
 
@@ -656,7 +656,7 @@ class EmailLib extends CakeEmail {
 	 */
 	 */
 	public function reset($config = null) {
 	public function reset($config = null) {
 		if ($config === null) {
 		if ($config === null) {
-			$config = 'default';
+			$config = Configure::read('Email.config') ?: 'default';
 		}
 		}
 		parent::reset();
 		parent::reset();
 
 
@@ -667,6 +667,7 @@ class EmailLib extends CakeEmail {
 		$this->_error = null;
 		$this->_error = null;
 		$this->_debug = null;
 		$this->_debug = null;
 
 
+		$this->_config = (array)Configure::read('Email');
 		$this->_applyConfig($config);
 		$this->_applyConfig($config);
 
 
 		if ($fromEmail = Configure::read('Config.systemEmail')) {
 		if ($fromEmail = Configure::read('Config.systemEmail')) {

+ 1 - 1
Lib/Error/MyErrorHandler.php

@@ -11,7 +11,7 @@ class MyErrorHandler extends ErrorHandler {
 	 * - 404s log to a different domain
 	 * - 404s log to a different domain
 	 * - IP, Referer and Browser-Infos are added for better error debugging/tracing
 	 * - IP, Referer and Browser-Infos are added for better error debugging/tracing
 	 */
 	 */
-	public static function handleException(Exception $exception) {
+	public static function handleException($exception) {
 		$config = Configure::read('Exception');
 		$config = Configure::read('Exception');
 		if (!empty($config['log'])) {
 		if (!empty($config['log'])) {
 			$message = sprintf("[%s] %s\n%s\n%s",
 			$message = sprintf("[%s] %s\n%s\n%s",

+ 2 - 22
Model/Behavior/RevisionBehavior.php

@@ -82,31 +82,11 @@ App::uses('Hash', 'Utility');
  * NB! In version 1.2 and up to current, Using HABTM revision requires that both models uses this
  * NB! In version 1.2 and up to current, Using HABTM revision requires that both models uses this
  * behavior (even if secondary model does not have a shadow table).
  * behavior (even if secondary model does not have a shadow table).
  *
  *
- * 1.1.1 => 1.1.2 changelog
- * - revisions() got new paramter: $includeCurrent
- * This now defaults to false, resulting in a change from 1.1.1. See tests
- *
- * 1.1.6 => 1.2
- * - includes HABTM revision control (one way)
- *
- * 1.2 => 1.2.1
- * - api change in revertToDate, added paramter for force delete if reverting to before earliest
- *
- * 1.2.6 => 1.2.7
- * 	 - api change: removed shadow(), changed revertToDate() to only recurse into related models that
- * are dependent when cascade is true
- *
- * 2.0.5 => CakePHP 2.x
- *
- * 2.0.6 => use alias to map shadow tables to a different alias as each alias is only allowed once
- * per ClassRegistry.
- *
+ * @deprecated Will be removed soon. Please move yourself to a new location/plugin
+ * 
  * @author Ronny Vindenes
  * @author Ronny Vindenes
  * @author Alexander 'alkemann' Morland
  * @author Alexander 'alkemann' Morland
  * @license http://opensource.org/licenses/mit-license.php MIT
  * @license http://opensource.org/licenses/mit-license.php MIT
- * @modifed 27. march 2009
- * @version 2.0.6
- * @modified 2012-07-28 Mark Scherer (2.x ready)
  */
  */
 class RevisionBehavior extends ModelBehavior {
 class RevisionBehavior extends ModelBehavior {
 
 

+ 3 - 5
README.md

@@ -10,7 +10,7 @@ This plugin requires PHP5.4+ (use the old 2.5 branch if you need PHP5.3 until yo
 
 
 Please note: New functionality has been tested against 2.x (current master branch) only.
 Please note: New functionality has been tested against 2.x (current master branch) only.
 Please upgrade your app to latest CakePHP 2.x if possible.
 Please upgrade your app to latest CakePHP 2.x if possible.
-User a different 2.x branch if you need temporary support for older versions.
+Use a different 2.x branch if you need temporary support for older versions.
 
 
 ## How to include
 ## How to include
 Installing the Plugin is pretty much as with every other CakePHP Plugin.
 Installing the Plugin is pretty much as with every other CakePHP Plugin.
@@ -22,11 +22,9 @@ You should use composer/packagist now @ https://packagist.org/packages/dereuroma
 
 
 ```
 ```
 "require": {
 "require": {
-	"dereuromark/cakephp-tools": "[version].*"
+	"dereuromark/cakephp-tools": "2.x-dev"
 }
 }
 ```
 ```
-With `0.9` as `[version]`, for example, it would be: `0.9.*`.
-The `*` asserts that you get all bugfix versions if existing.
 
 
 That's it. It should be up and running.
 That's it. It should be up and running.
 
 
@@ -60,7 +58,7 @@ MyController can be extended for DRY improvements and to fix some common bugs:
 ```php
 ```php
 App::uses('MyController', 'Tools.Controller');
 App::uses('MyController', 'Tools.Controller');
 
 
-class MyController extends MyController {
+class AppController extends MyController {
 }
 }
 ```
 ```
 
 

+ 1 - 0
Test/Case/Controller/Component/CommonComponentTest.php

@@ -5,6 +5,7 @@ App::uses('Component', 'Controller');
 App::uses('CakeSession', 'Model/Datasource');
 App::uses('CakeSession', 'Model/Datasource');
 App::uses('Controller', 'Controller');
 App::uses('Controller', 'Controller');
 App::uses('AppModel', 'Model');
 App::uses('AppModel', 'Model');
+App::uses('Object', 'Core');
 
 
 /**
 /**
  */
  */