diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php index 1b716fc7d..b1f3e284c 100644 --- a/lib/Cake/Console/Command/SchemaShell.php +++ b/lib/Cake/Console/Command/SchemaShell.php @@ -523,7 +523,7 @@ class SchemaShell extends AppShell { ))->addSubcommand('update', array( 'help' => __d('cake_console', 'Alter the tables based on the schema file.'), 'parser' => array( - 'options' => compact('plugin', 'path', 'file', 'name', 'connection', 'dry', 'snapshot'), + 'options' => compact('plugin', 'path', 'file', 'name', 'connection', 'dry', 'snapshot', 'force'), 'args' => array( 'name' => array( 'help' => __d('cake_console', 'Name of schema to use.') diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 3f085d5d5..ed30d4bd4 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -250,7 +250,7 @@ class CakeRequest implements ArrayAccess { } if (!$baseUrl) { - $base = dirname(env('SCRIPT_NAME')); + $base = dirname(env('PHP_SELF')); if ($webroot === 'webroot' && $webroot === basename($base)) { $base = dirname($base); diff --git a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php index 177d7788a..735672db5 100644 --- a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php @@ -356,6 +356,9 @@ class FileEngineTest extends CakeTestCase { * @return void */ public function testMaskSetting() { + if (DS === '\\') { + $this->markTestSkipped('File permission testing does not work on Windows.'); + } Cache::config('mask_test', array('engine' => 'File', 'path' => TMP . 'tests')); $data = 'This is some test content'; $write = Cache::write('masking_test', $data, 'mask_test'); diff --git a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php index 3e9218901..1c452a1db 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php @@ -178,6 +178,11 @@ class FixtureTaskTest extends CakeTestCase { * @return void */ function testImportRecordsNoEscaping() { + $db = ConnectionManager::getDataSource('test'); + if ($db instanceof Sqlserver) { + $this->markTestSkipped('This test does not run on SQLServer'); + } + $Article = ClassRegistry::init('Article'); $Article->updateAll(array('body' => "'Body \"value\"'")); diff --git a/lib/Cake/Test/Case/Network/CakeRequestTest.php b/lib/Cake/Test/Case/Network/CakeRequestTest.php index bb825c784..f2d399916 100644 --- a/lib/Cake/Test/Case/Network/CakeRequestTest.php +++ b/lib/Cake/Test/Case/Network/CakeRequestTest.php @@ -898,7 +898,7 @@ class CakeRequestTest extends CakeTestCase { Configure::write('App.baseUrl', false); $_SERVER['DOCUMENT_ROOT'] = '/cake/repo/branches'; - $_SERVER['SCRIPT_NAME'] = '/1.2.x.x/app/webroot/index.php'; + $_SERVER['PHP_SELF'] = '/1.2.x.x/app/webroot/index.php'; $_SERVER['PATH_INFO'] = '/posts/view/1'; $request = new CakeRequest(); @@ -908,7 +908,7 @@ class CakeRequestTest extends CakeTestCase { $_SERVER['DOCUMENT_ROOT'] = '/cake/repo/branches/1.2.x.x/app/webroot'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; + $_SERVER['PHP_SELF'] = '/index.php'; $_SERVER['PATH_INFO'] = '/posts/add'; $request = new CakeRequest(); @@ -917,7 +917,7 @@ class CakeRequestTest extends CakeTestCase { $this->assertEquals($request->url, 'posts/add'); $_SERVER['DOCUMENT_ROOT'] = '/cake/repo/branches/1.2.x.x/test/'; - $_SERVER['SCRIPT_NAME'] = '/webroot/index.php'; + $_SERVER['PHP_SELF'] = '/webroot/index.php'; $request = new CakeRequest(); $this->assertEquals('', $request->base); @@ -925,7 +925,7 @@ class CakeRequestTest extends CakeTestCase { $_SERVER['DOCUMENT_ROOT'] = '/some/apps/where'; - $_SERVER['SCRIPT_NAME'] = '/app/webroot/index.php'; + $_SERVER['PHP_SELF'] = '/app/webroot/index.php'; $request = new CakeRequest(); $this->assertEquals($request->base, ''); @@ -934,7 +934,7 @@ class CakeRequestTest extends CakeTestCase { Configure::write('App.dir', 'auth'); $_SERVER['DOCUMENT_ROOT'] = '/cake/repo/branches'; - $_SERVER['SCRIPT_NAME'] = '/demos/auth/webroot/index.php'; + $_SERVER['PHP_SELF'] = '/demos/auth/webroot/index.php'; $request = new CakeRequest(); @@ -944,7 +944,7 @@ class CakeRequestTest extends CakeTestCase { Configure::write('App.dir', 'code'); $_SERVER['DOCUMENT_ROOT'] = '/Library/WebServer/Documents'; - $_SERVER['SCRIPT_NAME'] = '/clients/PewterReport/code/webroot/index.php'; + $_SERVER['PHP_SELF'] = '/clients/PewterReport/code/webroot/index.php'; $request = new CakeRequest(); $this->assertEquals($request->base, '/clients/PewterReport/code'); @@ -958,7 +958,7 @@ class CakeRequestTest extends CakeTestCase { */ public function testBaseUrlwithModRewriteAlias() { $_SERVER['DOCUMENT_ROOT'] = '/home/aplusnur/public_html'; - $_SERVER['SCRIPT_NAME'] = '/control/index.php'; + $_SERVER['PHP_SELF'] = '/control/index.php'; Configure::write('App.base', '/control'); @@ -972,7 +972,7 @@ class CakeRequestTest extends CakeTestCase { Configure::write('App.webroot', 'newaffiliate'); $_SERVER['DOCUMENT_ROOT'] = '/var/www/abtravaff/html'; - $_SERVER['SCRIPT_NAME'] = '/newaffiliate/index.php'; + $_SERVER['PHP_SELF'] = '/newaffiliate/index.php'; $request = new CakeRequest(); $this->assertEquals($request->base, '/newaffiliate'); @@ -1113,7 +1113,7 @@ class CakeRequestTest extends CakeTestCase { */ public function testGetParamsWithDot() { $_GET['/posts/index/add_add'] = ''; - $_SERVER['SCRIPT_NAME'] = '/cake_dev/app/webroot/index.php'; + $_SERVER['PHP_SELF'] = '/cake_dev/app/webroot/index.php'; $_SERVER['REQUEST_URI'] = '/cake_dev/posts/index/add.add'; $request = new CakeRequest(); diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index c99221ee1..a587442bb 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -877,7 +877,7 @@ class DispatcherTest extends CakeTestCase { */ public function testAutomaticPluginDispatch() { $_POST = array(); - $_SERVER['SCRIPT_NAME'] = '/cake/repo/branches/1.2.x.x/index.php'; + $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; Router::reload(); $Dispatcher = new TestDispatcher(); diff --git a/lib/Cake/Test/Case/Utility/InflectorTest.php b/lib/Cake/Test/Case/Utility/InflectorTest.php index 32ab735db..0042e185f 100644 --- a/lib/Cake/Test/Case/Utility/InflectorTest.php +++ b/lib/Cake/Test/Case/Utility/InflectorTest.php @@ -108,6 +108,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::singularize('curves'), 'curve'); $this->assertEquals(Inflector::singularize('cafes'), 'cafe'); $this->assertEquals(Inflector::singularize('roofs'), 'roof'); + $this->assertEquals(Inflector::singularize('foes'), 'foe'); $this->assertEquals(Inflector::singularize(''), ''); } @@ -158,6 +159,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::pluralize('bureau'), 'bureaus'); $this->assertEquals(Inflector::pluralize('cafe'), 'cafes'); $this->assertEquals(Inflector::pluralize('roof'), 'roofs'); + $this->assertEquals(Inflector::pluralize('foe'), 'foes'); $this->assertEquals(Inflector::pluralize(''), ''); } diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 62e8d39d7..01e9801c7 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -144,6 +144,7 @@ class Inflector { '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss' ), 'irregular' => array( + 'foes' => 'foe', 'waves' => 'wave', 'curves' => 'curve' ) diff --git a/lib/Cake/Utility/Sanitize.php b/lib/Cake/Utility/Sanitize.php index 77774a4f5..41cab417a 100644 --- a/lib/Cake/Utility/Sanitize.php +++ b/lib/Cake/Utility/Sanitize.php @@ -69,7 +69,10 @@ class Sanitize { if (is_numeric($string) || $string === null || is_bool($string)) { return $string; } - $string = substr($db->value($string), 1); + $string = $db->value($string, 'string'); + if ($string[0] === 'N') { + $string = substr($string, 2); + } $string = substr($string, 0, -1); return $string; }