Browse Source

Merge branch '2.6' into 3.0

Conflicts:
	lib/Cake/I18n/I18n.php
	lib/Cake/Model/Datasource/CakeSession.php
	lib/Cake/Model/Datasource/Database/Mysql.php
	lib/Cake/Model/Datasource/DboSource.php
	lib/Cake/Model/Model.php
	lib/Cake/Network/Http/HttpSocket.php
	lib/Cake/Test/Case/BasicsTest.php
	lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
	lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
	lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
	lib/Cake/Test/Case/Model/ModelWriteTest.php
	lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
	lib/Cake/Test/Case/Routing/RouterTest.php
	lib/Cake/Test/Fixture/TagFixture.php
	src/Cache/Engine/FileEngine.php
	src/Network/Request.php
	src/View/Helper/SessionHelper.php
	tests/Fixture/ThingFixture.php
ADmad 11 years ago
parent
commit
f8b941b035

+ 4 - 3
src/Cache/Engine/FileEngine.php

@@ -285,11 +285,12 @@ class FileEngine extends CacheEngine {
 			if (substr($entry, 0, $prefixLength) !== $this->_config['prefix']) {
 				continue;
 			}
-			$filePath = $path . $entry;
-			if (!file_exists($filePath) || is_dir($filePath)) {
+
+			try {
+				$file = new \SplFileObject($path . $entry, 'r');
+			} catch (\Exception $e) {
 				continue;
 			}
-			$file = new \SplFileObject($path . $entry, 'r');
 
 			if ($threshold) {
 				$mtime = $file->getMTime();

+ 4 - 2
src/Utility/Inflector.php

@@ -31,7 +31,7 @@ class Inflector {
  */
 	protected static $_plural = array(
 		'rules' => array(
-			'/(s)tatus$/i' => '\1\2tatuses',
+			'/(s)tatus$/i' => '\1tatuses',
 			'/(quiz)$/i' => '\1zes',
 			'/^(ox)$/i' => '\1\2en',
 			'/([m|l])ouse$/i' => '\1ice',
@@ -56,6 +56,7 @@ class Inflector {
 		),
 		'uninflected' => array(
 			'.*[nrlm]ese',
+			'.*data',
 			'.*deer',
 			'.*fish',
 			'.*measles',
@@ -151,6 +152,7 @@ class Inflector {
 			'/s$/i' => ''
 		),
 		'uninflected' => array(
+			'.*data',
 			'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss', 'feedback'
 		),
 		'irregular' => array(
@@ -170,7 +172,7 @@ class Inflector {
 		'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti',
 		'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings',
 		'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', '.*?media',
-		'metadata', 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese',
+		'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese',
 		'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese',
 		'proceedings', 'rabies', 'research', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors',
 		'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'swine', 'testes',

+ 2 - 0
tests/TestCase/Utility/InflectorTest.php

@@ -173,6 +173,7 @@ class InflectorTest extends TestCase {
 		$this->assertEquals(Inflector::singularize('curves'), 'curve');
 		$this->assertEquals(Inflector::singularize('body_curves'), 'body_curve');
 		$this->assertEquals(Inflector::singularize('metadata'), 'metadata');
+		$this->assertEquals(Inflector::singularize('files_metadata'), 'files_metadata');
 		$this->assertEquals(Inflector::singularize(''), '');
 	}
 
@@ -238,6 +239,7 @@ class InflectorTest extends TestCase {
 		$this->assertEquals(Inflector::pluralize('curve'), 'curves');
 		$this->assertEquals(Inflector::pluralize('body_curve'), 'body_curves');
 		$this->assertEquals(Inflector::pluralize('metadata'), 'metadata');
+		$this->assertEquals(Inflector::pluralize('files_metadata'), 'files_metadata');
 		$this->assertEquals(Inflector::pluralize('stadia'), 'stadia');
 		$this->assertEquals(Inflector::pluralize(''), '');
 	}