Browse Source

Merge remote-tracking branch 'origin/2.6' into 3.0

Conflicts:
	VERSION.txt
	lib/Cake/Model/Datasource/Database/Sqlserver.php
	lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php
	src/Controller/Component/AclComponent.php
	src/Routing/Filter/AssetDispatcher.php
	src/Validation/Validation.php
mark_story 12 years ago
parent
commit
a417c98d79

+ 3 - 1
src/Console/ConsoleOutput.php

@@ -293,7 +293,9 @@ class ConsoleOutput {
  * Clean up and close handles
  */
 	public function __destruct() {
-		fclose($this->_output);
+		if (is_resource($this->_output)) {
+			fclose($this->_output);
+		}
 	}
 
 }

+ 3 - 1
src/Console/Templates/default/classes/controller.ctp

@@ -66,7 +66,9 @@ class <?= $name; ?>Controller extends AppController {
 		echo "];\n\n";
 	endif;
 
-	echo trim($actions);
+	if (!empty($actions)) {
+		echo trim($actions) . "\n";
+	}
 
 ?>
 }

+ 2 - 2
src/Controller/Component/AclComponent.php

@@ -28,8 +28,8 @@ use Cake\Utility\Inflector;
  * 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 App/Config/acl.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 App/Config/app.php. The adapter
+ * you specify must implement `AclInterface`
  *
  * @link http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html
  */

+ 1 - 8
src/Routing/Filter/AssetDispatcher.php

@@ -54,19 +54,12 @@ class AssetDispatcher extends DispatcherFilter {
 		}
 
 		$assetFile = $this->_getAssetFile($url);
-		if ($assetFile === null) {
+		if ($assetFile === null || !file_exists($assetFile)) {
 			return null;
 		}
-
 		$response = $event->data['response'];
 		$event->stopPropagation();
 
-		if (!file_exists($assetFile)) {
-			$response->statusCode(404);
-			$response->send();
-			return $response;
-		}
-
 		$response->modified(filemtime($assetFile));
 		if ($response->checkNotModified($request)) {
 			return $response;

+ 2 - 2
src/Validation/Validation.php

@@ -722,8 +722,8 @@ class Validation {
  * $check is a legal finite on this platform
  *
  * @param string $check Value to check
- * @param int $lower Lower limit
- * @param int $upper Upper limit
+ * @param int|float $lower Lower limit
+ * @param int|float $upper Upper limit
  * @return bool Success
  */
 	public static function range($check, $lower = null, $upper = null) {

+ 1 - 1
tests/TestCase/Controller/Component/AclComponentTest.php

@@ -79,7 +79,7 @@ class AclComponentTest extends TestCase {
 	}
 
 /**
- * test that adapter() whines when the class is not an AclBase
+ * test that adapter() whines when the class does not implement AclInterface
  *
  * @expectedException \Cake\Error\Exception
  * @return void