Browse Source

Merge branch 'master' into 2.5

mark_story 12 years ago
parent
commit
f22c4cf90b

+ 2 - 2
lib/Cake/Console/Templates/skel/Config/bootstrap.php

@@ -89,12 +89,12 @@ Configure::write('Dispatcher.filters', array(
  */
 App::uses('CakeLog', 'Log');
 CakeLog::config('debug', array(
-	'engine' => 'File',
+	'engine' => 'FileLog',
 	'types' => array('notice', 'info', 'debug'),
 	'file' => 'debug',
 ));
 CakeLog::config('error', array(
-	'engine' => 'File',
+	'engine' => 'FileLog',
 	'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
 	'file' => 'error',
 ));

+ 3 - 1
lib/Cake/Test/Case/Utility/InflectorTest.php

@@ -118,7 +118,8 @@ class InflectorTest extends CakeTestCase {
 		$this->assertEquals(Inflector::singularize('geese'), 'goose');
 		$this->assertEquals(Inflector::singularize('feet'), 'foot');
 		$this->assertEquals(Inflector::singularize('objectives'), 'objective');
-
+		$this->assertEquals(Inflector::singularize('archives'), 'archive');
+		$this->assertEquals(Inflector::singularize('briefs'), 'brief');
 		$this->assertEquals(Inflector::singularize(''), '');
 	}
 
@@ -179,6 +180,7 @@ class InflectorTest extends CakeTestCase {
 		$this->assertEquals(Inflector::pluralize('goose'), 'geese');
 		$this->assertEquals(Inflector::pluralize('foot'), 'feet');
 		$this->assertEquals(Inflector::pluralize('objective'), 'objectives');
+		$this->assertEquals(Inflector::pluralize('brief'), 'briefs');
 		$this->assertEquals(Inflector::pluralize(''), '');
 	}
 

+ 1 - 1
lib/Cake/Test/test_app/Plugin/TestPlugin/webroot/css/test_plugin_asset.css

@@ -1 +1 @@
-this is the test plugin asset css file
+/* this is the test plugin asset css file */

+ 1 - 1
lib/Cake/Test/test_app/View/Themed/TestTheme/webroot/css/theme_webroot.css

@@ -1 +1 @@
-theme webroot css file
+/* theme webroot css file */

+ 26 - 27
lib/Cake/Utility/CakeTime.php

@@ -793,6 +793,14 @@ class CakeTime {
 		}
 		$diff = $futureTime - $pastTime;
 
+		if (!$diff) {
+			return __d('cake', 'just now', 'just now');
+		}
+
+		if ($diff > abs($now - self::fromString($end))) {
+			return sprintf($absoluteString, date($format, $inSeconds));
+		}
+
 		// If more than a week, then take into account the length of months
 		if ($diff >= 604800) {
 			list($future['H'], $future['i'], $future['s'], $future['d'], $future['m'], $future['Y']) = explode('/', date('H/i/s/d/m/Y', $futureTime));
@@ -855,15 +863,6 @@ class CakeTime {
 			$diff = $diff - ($minutes * 60);
 			$seconds = $diff;
 		}
-		$diff = $futureTime - $pastTime;
-
-		if (!$diff) {
-			return __d('cake', 'just now', 'just now');
-		}
-
-		if ($diff > abs($now - self::fromString($end))) {
-			return sprintf($absoluteString, date($format, $inSeconds));
-		}
 
 		$fWord = $accuracy['second'];
 		if ($years > 0) {
@@ -905,34 +904,34 @@ class CakeTime {
 			$relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d second', '%d seconds', $seconds, $seconds);
 		}
 
-		$aboutAgo = array(
-			'second' => __d('cake', 'about a second ago'),
-			'minute' => __d('cake', 'about a minute ago'),
-			'hour' => __d('cake', 'about an hour ago'),
-			'day' => __d('cake', 'about a day ago'),
-			'week' => __d('cake', 'about a week ago'),
-			'year' => __d('cake', 'about a year ago')
-		);
-
-		$aboutIn = array(
-			'second' => __d('cake', 'in about a second'),
-			'minute' => __d('cake', 'in about a minute'),
-			'hour' => __d('cake', 'in about an hour'),
-			'day' => __d('cake', 'in about a day'),
-			'week' => __d('cake', 'in about a week'),
-			'year' => __d('cake', 'in about a year')
-		);
-
 		// When time has passed
 		if (!$backwards && $relativeDate) {
 			return sprintf($relativeString, $relativeDate);
 		}
 		if (!$backwards) {
+			$aboutAgo = array(
+				'second' => __d('cake', 'about a second ago'),
+				'minute' => __d('cake', 'about a minute ago'),
+				'hour' => __d('cake', 'about an hour ago'),
+				'day' => __d('cake', 'about a day ago'),
+				'week' => __d('cake', 'about a week ago'),
+				'year' => __d('cake', 'about a year ago')
+			);
+
 			return $aboutAgo[$fWord];
 		}
 
 		// When time is to come
 		if (!$relativeDate) {
+			$aboutIn = array(
+				'second' => __d('cake', 'in about a second'),
+				'minute' => __d('cake', 'in about a minute'),
+				'hour' => __d('cake', 'in about an hour'),
+				'day' => __d('cake', 'in about a day'),
+				'week' => __d('cake', 'in about a week'),
+				'year' => __d('cake', 'in about a year')
+			);
+
 			return $aboutIn[$fWord];
 		}
 

+ 3 - 2
lib/Cake/Utility/Inflector.php

@@ -61,6 +61,7 @@ class Inflector {
 		'irregular' => array(
 			'atlas' => 'atlases',
 			'beef' => 'beefs',
+			'brief' => 'briefs',
 			'brother' => 'brothers',
 			'cafe' => 'cafes',
 			'child' => 'children',
@@ -126,10 +127,10 @@ class Inflector {
 			'/(s)eries$/i' => '\1\2eries',
 			'/([^aeiouy]|qu)ies$/i' => '\1y',
 			'/(tive)s$/i' => '\1',
-			'/([lre])ves$/i' => '\1f',
-			'/([^fo])ves$/i' => '\1fe',
 			'/(hive)s$/i' => '\1',
 			'/(drive)s$/i' => '\1',
+			'/([lre])ves$/i' => '\1f',
+			'/([^fo])ves$/i' => '\1fe',
 			'/(^analy)ses$/i' => '\1sis',
 			'/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
 			'/([ti])a$/i' => '\1um',

+ 2 - 1
lib/Cake/View/Helper/FormHelper.php

@@ -1520,8 +1520,9 @@ class FormHelper extends AppHelper {
 			);
 
 			if ($label) {
-				$optTitle = $this->Html->useTag('label', $tagName, '', $optTitle);
+				$optTitle = $this->label($tagName, $optTitle, is_array($label) ? $label : null);
 			}
+
 			if (is_array($between)) {
 				$optTitle .= array_shift($between);
 			}