From b55fa98a2d666a03776191f799812fe1c4a76d87 Mon Sep 17 00:00:00 2001 From: Stephen Young Date: Fri, 11 Apr 2014 15:10:56 -0400 Subject: [PATCH 1/6] Updated documentation * Removed references to nonexistent `AclBase` class * Added references to `AclInterface` requirements --- lib/Cake/Controller/Component/Acl/IniAcl.php | 2 +- lib/Cake/Controller/Component/AclComponent.php | 4 ++-- lib/Cake/Test/Case/Controller/Component/AclComponentTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Controller/Component/Acl/IniAcl.php b/lib/Cake/Controller/Component/Acl/IniAcl.php index f212938c4..0fa9fd334 100644 --- a/lib/Cake/Controller/Component/Acl/IniAcl.php +++ b/lib/Cake/Controller/Component/Acl/IniAcl.php @@ -43,7 +43,7 @@ class IniAcl extends Object implements AclInterface { /** * Initialize method * - * @param AclBase $component + * @param Component $component * @return void */ public function initialize(Component $component) { diff --git a/lib/Cake/Controller/Component/AclComponent.php b/lib/Cake/Controller/Component/AclComponent.php index 6d0f3b8b4..fc87b3c6e 100644 --- a/lib/Cake/Controller/Component/AclComponent.php +++ b/lib/Cake/Controller/Component/AclComponent.php @@ -21,8 +21,8 @@ App::uses('AclInterface', 'Controller/Component/Acl'); * Access Control List factory class. * * Uses a strategy pattern to allow custom ACL implementations to be used with the same component interface. - * You can define by changing `Configure::write('Acl.classname', 'DbAcl');` in your core.php. Concrete ACL - * implementations should extend `AclBase` and implement the methods it defines. + * You can define by changing `Configure::write('Acl.classname', 'DbAcl');` in your core.php. The adapter + * you specify must implement `AclInterface` * * @package Cake.Controller.Component * @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html diff --git a/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php b/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php index 375d03067..66d991c4b 100644 --- a/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/AclComponentTest.php @@ -78,7 +78,7 @@ class AclComponentTest extends CakeTestCase { } /** - * test that adapter() whines when the class is not an AclBase + * test that adapter() whines when the class does not implement AclInterface * * @expectedException CakeException * @return void From 9aeea2fcc3362076a946adcb9d072ccd8fb28bca Mon Sep 17 00:00:00 2001 From: Joseph Woodruff Date: Fri, 11 Apr 2014 15:25:07 -0600 Subject: [PATCH 2/6] Trim $sql before checking for SELECT --- lib/Cake/Model/Datasource/Database/Sqlserver.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index b6b0c4bf2..972c10809 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -756,6 +756,7 @@ class Sqlserver extends DboSource { */ protected function _execute($sql, $params = array(), $prepareOptions = array()) { $this->_lastAffected = false; + $sql = trim($sql); if (strncasecmp($sql, 'SELECT', 6) === 0 || preg_match('/^EXEC(?:UTE)?\s/mi', $sql) > 0) { $prepareOptions += array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL); return parent::_execute($sql, $params, $prepareOptions); From d4ae2b0b88200b1c144d9c56e2b762707a69f883 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 13 Apr 2014 06:16:24 -0400 Subject: [PATCH 3/6] Correct types for Validation::range(). Refs #3304 --- lib/Cake/Utility/Validation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index 03d05207b..911428e7b 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -711,8 +711,8 @@ class Validation { * $check is a legal finite on this platform * * @param string $check Value to check - * @param integer $lower Lower limit - * @param integer $upper Upper limit + * @param int|float $lower Lower limit + * @param int|float $upper Upper limit * @return boolean Success */ public static function range($check, $lower = null, $upper = null) { From f7cc0c1802e7b072d92e8b1e7b4478d2b7728bc1 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Sun, 13 Apr 2014 21:56:27 -0400 Subject: [PATCH 4/6] Add newline after actions in controller template --- lib/Cake/Console/Templates/default/classes/controller.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp index e290a8675..97544edea 100644 --- a/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -74,7 +74,7 @@ class Controller extends App echo ");\n\n"; endif; - echo trim($actions); + echo trim($actions) . "\n"; endif; ?> } From 1a73906a507768a6e627c1f5bb4c34ce5072ef69 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Sun, 13 Apr 2014 23:28:13 -0400 Subject: [PATCH 5/6] Fix failing NoActions comparison test --- lib/Cake/Console/Templates/default/classes/controller.ctp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp index 97544edea..3e5a3004e 100644 --- a/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -74,7 +74,9 @@ class Controller extends App echo ");\n\n"; endif; - echo trim($actions) . "\n"; + if (!empty($actions)) { + echo trim($actions) . "\n"; + } endif; ?> } From 5ac60288fd6844179feb0e0bcd137bab41b6b09b Mon Sep 17 00:00:00 2001 From: Carl Sutton Date: Mon, 14 Apr 2014 14:15:46 +0100 Subject: [PATCH 6/6] Fix closing non resource I get a load of these errors when running tests in the shell, this check stops the errors from happening Warning: 2 :: fclose() expects parameter 1 to be resource, integer given on line 298 of CORE\Cake\Console\ConsoleOutput.php Trace: fclose - [internal], line ?? ConsoleOutput::__destruct() - CORE\Cake\Console\ConsoleOutput.php, line 298 ToolbarComponent::_saveState() - APP\Plugin\DebugKit\Controller\Component\ToolbarComponent.php, line 307 ToolbarComponent::beforeRedirect() - APP\Plugin\DebugKit\Controller\Component\ToolbarComponent.php, line 307 ObjectCollection::trigger() - CORE\Cake\Utility\ObjectCollection.php, line 132 call_user_func - [internal], line ?? CakeEventManager::dispatch() - CORE\Cake\Event\CakeEventManager.php, line 247 Controller::redirect() - CORE\Cake\Controller\Controller.php, line 765 AuthComponent::_unauthenticated() - CORE\Cake\Controller\Component\AuthComponent.php, line 364 AuthComponent::startup() - CORE\Cake\Controller\Component\AuthComponent.php, line 304 ObjectCollection::trigger() - CORE\Cake\Utility\ObjectCollection.php, line 132 call_user_func - [internal], line ?? CakeEventManager::dispatch() - CORE\Cake\Event\CakeEventManager.php, line 247 Controller::startupProcess() - CORE\Cake\Controller\Controller.php, line 675 Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 182 Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 160 --- lib/Cake/Console/ConsoleOutput.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Console/ConsoleOutput.php b/lib/Cake/Console/ConsoleOutput.php index fa021b565..5e1ce9bec 100644 --- a/lib/Cake/Console/ConsoleOutput.php +++ b/lib/Cake/Console/ConsoleOutput.php @@ -295,7 +295,9 @@ class ConsoleOutput { * Clean up and close handles */ public function __destruct() { - fclose($this->_output); + if (is_resource($this->_output)) { + fclose($this->_output); + } } }