From eb5b4fa3012d52b58dbaae3b7bf0aa6bb89f46a0 Mon Sep 17 00:00:00 2001 From: Jason Pirkey Date: Tue, 18 Oct 2011 01:10:10 -0400 Subject: [PATCH 01/24] Fixing a phpdoc-type for Controller->Components property --- lib/Cake/Controller/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index 38e044361..e6069e9ef 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -171,7 +171,7 @@ class Controller extends Object { /** * Instance of ComponentCollection used to handle callbacks. * - * @var string + * @var ComponentCollection */ public $Components = null; From 7f0f224c56fc1d3d1daba24a8fe5d15f10d52785 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 18 Oct 2011 12:19:19 -0400 Subject: [PATCH 02/24] Fix missing preg_quote around highlight searches. Highlight strings should be literal values not regexp fragments. Fixes #2111 Conflicts: cake/libs/view/helpers/text.php cake/tests/cases/libs/view/helpers/text.test.php --- lib/Cake/Test/Case/View/Helper/TextHelperTest.php | 5 +++++ lib/Cake/View/Helper/TextHelper.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php index 9307cd356..8de2c3d91 100644 --- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php @@ -104,6 +104,11 @@ class TextHelperTest extends CakeTestCase { $result = $this->Text->highlight($text, $phrases, array('format' => '\1')); $this->assertEqual($result, $text); + $text = 'This is a (test) text'; + $phrases = '(test'; + $result = $this->Text->highlight($text, $phrases, array('format' => '\1')); + $this->assertEqual('This is a (test) text', $result); + $text = 'Ich saß in einem Café am Übergang'; $expected = 'Ich saß in einem Café am Übergang'; $phrases = array('saß', 'café', 'übergang'); diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php index 7e34c77f0..7d08114ed 100644 --- a/lib/Cake/View/Helper/TextHelper.php +++ b/lib/Cake/View/Helper/TextHelper.php @@ -77,7 +77,7 @@ class TextHelper extends AppHelper { $with = array(); foreach ($phrase as $key => $segment) { - $segment = "($segment)"; + $segment = '(' . preg_quote($segment, '|') . ')'; if ($html) { $segment = "(?![^<]+>)$segment(?![^<]+>)"; } @@ -88,7 +88,7 @@ class TextHelper extends AppHelper { return preg_replace($replace, $with, $text); } else { - $phrase = "($phrase)"; + $phrase = '(' . preg_quote($phrase, '|') . ')'; if ($html) { $phrase = "(?![^<]+>)$phrase(?![^<]+>)"; } From fc5a465189dab0c6ebc357004fab764382c1c056 Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 19 Oct 2011 02:32:38 +0530 Subject: [PATCH 03/24] Cleaning up code left over from 1.3. If no black-hole callback is specified Security::blackHole() now throws an exception. Closes #1532 --- lib/Cake/Controller/Component/SecurityComponent.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php index b0f66efb1..df4a7899f 100644 --- a/lib/Cake/Controller/Component/SecurityComponent.php +++ b/lib/Cake/Controller/Component/SecurityComponent.php @@ -274,7 +274,7 @@ class SecurityComponent extends Component { } /** - * Black-hole an invalid request with a 404 error or custom callback. If SecurityComponent::$blackHoleCallback + * Black-hole an invalid request with a 400 error or custom callback. If SecurityComponent::$blackHoleCallback * is specified, it will use this callback by executing the method indicated in $error * * @param Controller $controller Instantiating controller @@ -282,15 +282,11 @@ class SecurityComponent extends Component { * @return mixed If specified, controller blackHoleCallback's response, or no return otherwise * @see SecurityComponent::$blackHoleCallback * @link http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html#handling-blackhole-callbacks + * @throws BadRequestException */ public function blackHole($controller, $error = '') { if ($this->blackHoleCallback == null) { - $code = 404; - if ($error == 'login') { - $code = 401; - $controller->header($this->loginRequest()); - } - return $controller->redirect(null, $code, true); + throw new BadRequestException(__d('cake_dev', 'The request has been black-holed')); } else { return $this->_callback($controller, $this->blackHoleCallback, array($error)); } From 0a9033ba1ea6e8180e540bf9ea8a1cd696ba0f5b Mon Sep 17 00:00:00 2001 From: Majna Date: Wed, 19 Oct 2011 00:41:19 +0200 Subject: [PATCH 04/24] Fixing failing i18n ExtractTask tests on Windows. --- .../Case/Console/Command/Task/ExtractTaskTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php index ac2539689..f17465d5c 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php @@ -284,10 +284,10 @@ class ExtractTaskTest extends CakeTestCase { $this->Task->execute(); $result = file_get_contents($this->path . DS . 'default.pot'); - $pattern = '#Model/PersisterOne.php:validation for field title#'; + $pattern = preg_quote('#Model' . DS . 'PersisterOne.php:validation for field title#', '\\'); $this->assertPattern($pattern, $result); - $pattern = '#Model/PersisterOne.php:validation for field body#'; + $pattern = preg_quote('#Model' . DS . 'PersisterOne.php:validation for field body#', '\\'); $this->assertPattern($pattern, $result); $pattern = '#msgid "Post title is required"#'; @@ -329,10 +329,10 @@ class ExtractTaskTest extends CakeTestCase { $this->Task->execute(); $result = file_get_contents($this->path . DS . 'test_plugin.pot'); - $pattern = '#Plugin/TestPlugin/Model/TestPluginPost.php:validation for field title#'; + $pattern = preg_quote('#Plugin' . DS. 'TestPlugin' . DS. 'Model' . DS. 'TestPluginPost.php:validation for field title#', '\\'); $this->assertPattern($pattern, $result); - $pattern = '#Plugin/TestPlugin/Model/TestPluginPost.php:validation for field body#'; + $pattern = preg_quote('#Plugin' . DS. 'TestPlugin' . DS. 'Model' . DS. 'TestPluginPost.php:validation for field body#', '\\'); $this->assertPattern($pattern, $result); $pattern = '#msgid "Post title is required"#'; @@ -369,10 +369,10 @@ class ExtractTaskTest extends CakeTestCase { $this->Task->execute(); $result = file_get_contents($this->path . DS . 'test_plugin.pot'); - $pattern = '#Model/TestPluginPost.php:validation for field title#'; + $pattern = preg_quote('#Model' . DS. 'TestPluginPost.php:validation for field title#', '\\'); $this->assertPattern($pattern, $result); - $pattern = '#Model/TestPluginPost.php:validation for field body#'; + $pattern = preg_quote('#Model' . DS. 'TestPluginPost.php:validation for field body#', '\\'); $this->assertPattern($pattern, $result); $pattern = '#msgid "Post title is required"#'; From d7155d374b9a10af08ec93955d03aa664093026a Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 18 Oct 2011 20:48:58 -0400 Subject: [PATCH 05/24] Making apc feature test rely on apc_dec. ZCS comes with a busted apc, and we need apc_dec to properly use the ApcEngine anyways. Fixes #2105 --- app/Config/core.php | 2 +- lib/Cake/Cache/Engine/ApcEngine.php | 2 +- lib/Cake/Console/Templates/skel/Config/core.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Config/core.php b/app/Config/core.php index 2b03097dc..552349006 100644 --- a/app/Config/core.php +++ b/app/Config/core.php @@ -297,7 +297,7 @@ * */ $engine = 'File'; -if (extension_loaded('apc') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { +if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { $engine = 'Apc'; } diff --git a/lib/Cake/Cache/Engine/ApcEngine.php b/lib/Cake/Cache/Engine/ApcEngine.php index 37cfde201..a6ca486fd 100644 --- a/lib/Cake/Cache/Engine/ApcEngine.php +++ b/lib/Cake/Cache/Engine/ApcEngine.php @@ -37,7 +37,7 @@ class ApcEngine extends CacheEngine { */ public function init($settings = array()) { parent::init(array_merge(array('engine' => 'Apc', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings)); - return function_exists('apc_cache_info'); + return function_exists('apc_dec'); } /** diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index 2b03097dc..552349006 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -297,7 +297,7 @@ * */ $engine = 'File'; -if (extension_loaded('apc') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { +if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { $engine = 'Apc'; } From 95737d7adf33dfcba5c0a41708fb080aadbe7b98 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 18 Oct 2011 21:21:05 -0400 Subject: [PATCH 06/24] Fix issue writing to file cache Reading/writing to the same file cache key multiple times in a row during a single request would result in failed reads. Fixes #2114 --- lib/Cake/Cache/Engine/FileEngine.php | 1 + .../Test/Case/Cache/Engine/FileEngineTest.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index eb25b02c9..c53c5ad33 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -128,6 +128,7 @@ class FileEngine extends CacheEngine { $this->_File->flock(LOCK_EX); } + $this->_File->rewind(); $success = $this->_File->ftruncate(0) && $this->_File->fwrite($contents) && $this->_File->fflush(); if ($this->settings['lock']) { diff --git a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php index 9ddc660de..ecc995dd3 100644 --- a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php @@ -97,6 +97,23 @@ class FileEngineTest extends CakeTestCase { Cache::delete('test', 'file_test'); } +/** + * Test read/write on the same cache key. Ensures file handles are re-wound. + * + * @return void + */ + public function testConsecutiveReadWrite() { + Cache::write('rw', 'first write', 'file_test'); + $result = Cache::read('rw', 'file_test'); + + Cache::write('rw', 'second write', 'file_test'); + $result2 = Cache::read('rw', 'file_test'); + + Cache::delete('rw', 'file_test'); + $this->assertEquals('first write', $result); + $this->assertEquals('second write', $result2); + } + /** * testExpiry method * From 2bb93761cc124f7f4db506d033230fe4669f67fd Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Wed, 19 Oct 2011 00:06:29 +0700 Subject: [PATCH 07/24] fixing typos --- app/webroot/css/cake.generic.css | 2 +- app/webroot/index.php | 2 +- index.php | 2 +- lib/Cake/Cache/Cache.php | 2 +- lib/Cake/Console/Templates/skel/webroot/index.php | 2 +- lib/Cake/Controller/Component.php | 2 +- lib/Cake/Controller/Component/AuthComponent.php | 2 +- lib/Cake/Controller/Scaffold.php | 2 +- lib/Cake/Core/CakePlugin.php | 2 +- lib/Cake/Model/BehaviorCollection.php | 2 +- lib/Cake/Model/Model.php | 4 ++-- lib/Cake/Model/ModelBehavior.php | 2 +- lib/Cake/Routing/Dispatcher.php | 2 +- lib/Cake/Routing/Router.php | 2 +- lib/Cake/TestSuite/CakeTestSuite.php | 2 +- lib/Cake/Utility/Debugger.php | 2 +- lib/Cake/Utility/String.php | 2 +- lib/Cake/Utility/Validation.php | 6 +++--- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index dfc30cab6..d6f3d25c2 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -611,7 +611,7 @@ pre { overflow: auto; position: relative; -moz-border-radius: 4px; - -wekbkit-border-radius: 4px; + -webkit-border-radius: 4px; border-radius: 4px; } .cake-stack-trace a { diff --git a/app/webroot/index.php b/app/webroot/index.php index b5b1d6392..755c9c2a9 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -49,7 +49,7 @@ * The absolute path to the "cake" directory, WITHOUT a trailing DS. * * Un-comment this line to specify a fixed path to CakePHP. - * This should point at the directory containg `Cake`. + * This should point at the directory containing `Cake`. * * For ease of development CakePHP uses PHP's include_path. If you * cannot modify your include_path set this value. diff --git a/index.php b/index.php index 10231902a..7563177e4 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Requests collector. * * This file collects requests if: - * - no mod_rewrite is avilable or .htaccess files are not supported + * - no mod_rewrite is available or .htaccess files are not supported * - requires App.baseUrl to be uncommented in app/Config/core.php * - app/webroot is not set as a document root. * diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index f8c2d4d65..e80ca5b02 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -96,7 +96,7 @@ class Cache { * * - `duration` Specify how long items in this cache configuration last. * - `prefix` Prefix appended to all entries. Good for when you need to share a keyspace - * with either another cache config or annother application. + * with either another cache config or another application. * - `probability` Probability of hitting a cache gc cleanup. Setting to 0 will disable * cache::gc from ever being called automatically. * - `servers' Used by memcache. Give the address of the memcached servers to use. diff --git a/lib/Cake/Console/Templates/skel/webroot/index.php b/lib/Cake/Console/Templates/skel/webroot/index.php index fcbc32edf..4e83f44bd 100644 --- a/lib/Cake/Console/Templates/skel/webroot/index.php +++ b/lib/Cake/Console/Templates/skel/webroot/index.php @@ -49,7 +49,7 @@ * The absolute path to the "cake" directory, WITHOUT a trailing DS. * * Un-comment this line to specify a fixed path to CakePHP. - * This should point at the directory containg `Cake`. + * This should point at the directory containing `Cake`. * * For ease of development CakePHP uses PHP's include_path. If you * cannot modify your include_path set this value. diff --git a/lib/Cake/Controller/Component.php b/lib/Cake/Controller/Component.php index 1277e998a..e6dd15d67 100644 --- a/lib/Cake/Controller/Component.php +++ b/lib/Cake/Controller/Component.php @@ -18,7 +18,7 @@ App::uses('ComponentCollection', 'Controller'); /** - * Base class for an individual Component. Components provide resuable bits of + * Base class for an individual Component. Components provide reusable bits of * controller logic that can be composed into a controller. Components also * provide request life-cycle callbacks for injecting logic at specific points. * diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 39dd01f45..4bc95111a 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -536,7 +536,7 @@ class AuthComponent extends Component { /** * Get the current user from the session. * - * @param string $key field to retrive. Leave null to get entire User record + * @param string $key field to retrieve. Leave null to get entire User record * @return mixed User record. or null if no user is logged in. * @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#accessing-the-logged-in-user */ diff --git a/lib/Cake/Controller/Scaffold.php b/lib/Cake/Controller/Scaffold.php index d032ce34e..14a1f20c9 100644 --- a/lib/Cake/Controller/Scaffold.php +++ b/lib/Cake/Controller/Scaffold.php @@ -212,7 +212,7 @@ class Scaffold { * Saves or updates the scaffolded model. * * @param CakeRequest $request Request Object for scaffolding - * @param string $action add or edt + * @param string $action add or edit * @return mixed Success on save/update, add/edit form if data is empty or error if save or update fails * @throws NotFoundException */ diff --git a/lib/Cake/Core/CakePlugin.php b/lib/Cake/Core/CakePlugin.php index 526efb99e..70e2e23b4 100644 --- a/lib/Cake/Core/CakePlugin.php +++ b/lib/Cake/Core/CakePlugin.php @@ -194,7 +194,7 @@ class CakePlugin { } /** - * Retruns true if the plugin $plugin is already loaded + * Returns true if the plugin $plugin is already loaded * If plugin is null, it will return a list of all loaded plugins * * @param string $plugin diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php index b76c6cae0..993c6a3d4 100644 --- a/lib/Cake/Model/BehaviorCollection.php +++ b/lib/Cake/Model/BehaviorCollection.php @@ -2,7 +2,7 @@ /** * BehaviorCollection * - * Provides managment and interface for interacting with collections of behaviors. + * Provides management and interface for interacting with collections of behaviors. * * PHP 5 * diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 3d5966de7..35dc9bdc6 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -722,7 +722,7 @@ class Model extends Object { } /** - * Handles the lazy loading of model associations by lookin in the association arrays for the requested variable + * Handles the lazy loading of model associations by looking in the association arrays for the requested variable * * @param string $name variable tested for existance in class * @return boolean true if the variable exists (if is a not loaded model association it will be created), false otherwise @@ -3032,7 +3032,7 @@ class Model extends Object { * Runs validation for hasAndBelongsToMany associations that have 'with' keys * set. And data in the set() data set. * - * @param array $options Array of options to use on Valdation of with models + * @param array $options Array of options to use on Validation of with models * @return boolean Failure of validation on with models. * @see Model::validates() */ diff --git a/lib/Cake/Model/ModelBehavior.php b/lib/Cake/Model/ModelBehavior.php index ffe52a33a..ba1aa121b 100644 --- a/lib/Cake/Model/ModelBehavior.php +++ b/lib/Cake/Model/ModelBehavior.php @@ -23,7 +23,7 @@ * Model behavior base class. * * Defines the Behavior interface, and contains common model interaction functionality. Behaviors - * allow you to simulate mixins, and create resuable blocks of application logic, that can be reused across + * allow you to simulate mixins, and create reusable blocks of application logic, that can be reused across * several models. Behaviors also provide a way to hook into model callbacks and augment their behavior. * * ### Mixin methods diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php index 5875406ec..26fc2f322 100644 --- a/lib/Cake/Routing/Dispatcher.php +++ b/lib/Cake/Routing/Dispatcher.php @@ -1,6 +1,6 @@ provide a list of choices that selections must be made from - * - max => maximun number of non-zero choices that can be made + * - max => maximum number of non-zero choices that can be made * - min => minimum number of non-zero choices that can be made * * @param mixed $check Value to check @@ -556,7 +556,7 @@ class Validation { * Checks if a value is numeric. * * @param string $check Value to check - * @return boolean Succcess + * @return boolean Success */ public static function numeric($check) { return is_numeric($check); @@ -715,7 +715,7 @@ class Validation { * * @param string $check Value to check * @param array $list List to check against - * @return boolean Succcess + * @return boolean Success */ public static function inList($check, $list) { return in_array($check, $list); From a60d71d19b621222213edc7d94bc80d64f69d656 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Wed, 19 Oct 2011 11:06:36 +0700 Subject: [PATCH 08/24] removing 'empty' files from nonempty directories --- app/Console/Command/empty | 0 app/Test/Case/Controller/empty | 0 app/Test/Case/Model/empty | 0 lib/Cake/Console/Templates/skel/Test/Case/Controller/empty | 0 lib/Cake/Console/Templates/skel/Test/Case/Model/empty | 0 lib/Cake/Console/Templates/skel/View/Helper/empty | 0 lib/Cake/Test/test_app/Model/Behavior/empty | 0 .../Test/test_app/Plugin/TestPlugin/Console/Command/Task/empty | 0 lib/Cake/Test/test_app/View/Elements/empty | 0 lib/Cake/Test/test_app/View/Helper/empty | 0 lib/Cake/Test/test_app/View/Pages/empty | 0 11 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/Console/Command/empty delete mode 100644 app/Test/Case/Controller/empty delete mode 100644 app/Test/Case/Model/empty delete mode 100644 lib/Cake/Console/Templates/skel/Test/Case/Controller/empty delete mode 100644 lib/Cake/Console/Templates/skel/Test/Case/Model/empty delete mode 100644 lib/Cake/Console/Templates/skel/View/Helper/empty delete mode 100644 lib/Cake/Test/test_app/Model/Behavior/empty delete mode 100644 lib/Cake/Test/test_app/Plugin/TestPlugin/Console/Command/Task/empty delete mode 100644 lib/Cake/Test/test_app/View/Elements/empty delete mode 100644 lib/Cake/Test/test_app/View/Helper/empty delete mode 100644 lib/Cake/Test/test_app/View/Pages/empty diff --git a/app/Console/Command/empty b/app/Console/Command/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/Test/Case/Controller/empty b/app/Test/Case/Controller/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/Test/Case/Model/empty b/app/Test/Case/Model/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Console/Templates/skel/Test/Case/Controller/empty b/lib/Cake/Console/Templates/skel/Test/Case/Controller/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Console/Templates/skel/Test/Case/Model/empty b/lib/Cake/Console/Templates/skel/Test/Case/Model/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Console/Templates/skel/View/Helper/empty b/lib/Cake/Console/Templates/skel/View/Helper/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Test/test_app/Model/Behavior/empty b/lib/Cake/Test/test_app/Model/Behavior/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Test/test_app/Plugin/TestPlugin/Console/Command/Task/empty b/lib/Cake/Test/test_app/Plugin/TestPlugin/Console/Command/Task/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Test/test_app/View/Elements/empty b/lib/Cake/Test/test_app/View/Elements/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Test/test_app/View/Helper/empty b/lib/Cake/Test/test_app/View/Helper/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/Cake/Test/test_app/View/Pages/empty b/lib/Cake/Test/test_app/View/Pages/empty deleted file mode 100644 index e69de29bb..000000000 From 646b8f1aa04819d3c3cc2ba61fc15ee6b34c922f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?= Date: Wed, 19 Oct 2011 15:36:00 +0200 Subject: [PATCH 09/24] Fixed issue when using multiple extensions in Router::parseExtensions() could result in undefined index notice by RequestHandlerComponent. --- .../Component/RequestHandlerComponent.php | 2 +- .../Component/RequestHandlerComponentTest.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index ee57e2cb4..e262d7f78 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -140,7 +140,7 @@ class RequestHandlerComponent extends Component { $preferredTypes = $this->mapType($preferred); $similarTypes = array_intersect($extensions, $preferredTypes); if (count($similarTypes) === 1 && !in_array('html', $preferredTypes)) { - $this->ext = $similarTypes[0]; + $this->ext = array_shift($similarTypes); } } diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index bf27661c9..865f66c19 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -193,6 +193,21 @@ class RequestHandlerComponentTest extends CakeTestCase { $this->assertEquals('json', $this->RequestHandler->ext); } +/** + * Test that RequestHandler sets $this->ext when jQuery sends its wonky-ish headers + * and the application is configured to handle multiplate extensions + * + * @return void + */ + public function testInitializeContentTypeWithjQueryAcceptAndMultiplesExtensions() { + $_SERVER['HTTP_ACCEPT'] = 'application/json, text/javascript, */*; q=0.01'; + $this->assertNull($this->RequestHandler->ext); + Router::parseExtensions('rss', 'json'); + + $this->RequestHandler->initialize($this->Controller); + $this->assertEquals('json', $this->RequestHandler->ext); + } + /** * Test that RequestHandler does not set $this->ext when multple accepts are sent. * From d1be66f2e1d240e07816fa8552f9d378c112c731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?= Date: Wed, 19 Oct 2011 15:57:46 +0200 Subject: [PATCH 10/24] Fixing failing test introduced in fb4a003522c2dd9b05305fc3d39316b7fc53f1cb. --- lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php index baec53707..1bac65a2b 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php @@ -181,7 +181,7 @@ class ProjectTaskTest extends CakeTestCase { ); foreach ($empty as $dir) { - $this->assertTrue(is_file($path . DS . $dir . DS . 'empty'), 'Missing empty file in ' . $dir); + $this->assertTrue(is_dir($path . DS . $dir), 'Missing directory ' . $dir); } } From fe9762d05347542c4942f6c0d8bd9c38526d22b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?= Date: Wed, 19 Oct 2011 16:48:03 +0200 Subject: [PATCH 11/24] Making the test assert what it is intended to assert. --- .../Console/Command/Task/ProjectTaskTest.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php index 1bac65a2b..17230b310 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php @@ -167,21 +167,21 @@ class ProjectTaskTest extends CakeTestCase { $path = $this->Task->path . 'bake_test_app'; $empty = array( - 'Console' . DS . 'Command' . DS . 'Task', - 'Controller' . DS . 'Component', - 'Model' . DS . 'Behavior', - 'View' . DS . 'Helper', - 'View' . DS . 'Errors', - 'View' . DS . 'Scaffolds', - 'Test' . DS . 'Case' . DS . 'Model', - 'Test' . DS . 'Case' . DS . 'Controller', - 'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper', - 'Test' . DS . 'Fixture', - 'webroot' . DS . 'js' + 'Console' . DS . 'Command' . DS . 'Task' => 'empty', + 'Controller' . DS . 'Component' => 'empty', + 'Model' . DS . 'Behavior' => 'empty', + 'View' . DS . 'Helper' => 'AppHelper.php', + 'View' . DS . 'Errors' => 'empty', + 'View' . DS . 'Scaffolds' => 'empty', + 'Test' . DS . 'Case' . DS . 'Model' . DS . 'Behavior' => 'empty', + 'Test' . DS . 'Case' . DS . 'Controller' . DS . 'Component' => 'empty', + 'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper' => 'empty', + 'Test' . DS . 'Fixture' => 'empty', + 'webroot' . DS . 'js' => 'empty' ); - foreach ($empty as $dir) { - $this->assertTrue(is_dir($path . DS . $dir), 'Missing directory ' . $dir); + foreach ($empty as $dir => $file) { + $this->assertTrue(is_file($path . DS . $dir . DS . $file), sprintf('Missing %s file in %s', $file, $dir)); } } From f361509f1079ca277e8a77d2f41972068695a942 Mon Sep 17 00:00:00 2001 From: Majna Date: Wed, 19 Oct 2011 20:34:02 +0200 Subject: [PATCH 12/24] Fixed failing smtp tests when testing on host other then hardcoded 'localhost'. --- .../Test/Case/Network/Email/SmtpTransportTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index bff8932e4..5a32b011d 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -100,7 +100,7 @@ class SmtpTransportTest extends CakeTestCase { $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n"); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(4))->method('read')->will($this->returnValue("250 Accepted\r\n")); $this->SmtpTransport->connect(); @@ -115,10 +115,10 @@ class SmtpTransportTest extends CakeTestCase { $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n"); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); - $this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n"); + $this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n"); $this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(7))->method('read')->will($this->returnValue("250 Accepted\r\n")); $this->SmtpTransport->connect(); @@ -134,10 +134,10 @@ class SmtpTransportTest extends CakeTestCase { $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); + $this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n"); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); - $this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n"); + $this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n"); $this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(7))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); $this->SmtpTransport->connect(); @@ -259,4 +259,4 @@ class SmtpTransportTest extends CakeTestCase { $this->SmtpTransport->disconnect(); } -} \ No newline at end of file +} From 6d51ce54fe81817152c868759d6d0d4a680fab1b Mon Sep 17 00:00:00 2001 From: ADmad Date: Thu, 20 Oct 2011 00:49:43 +0530 Subject: [PATCH 13/24] Revert "Fixed failing smtp tests when testing on host other then hardcoded 'localhost'." This change you cause the tests to fail when run through CLI This reverts commit f361509f1079ca277e8a77d2f41972068695a942. --- .../Test/Case/Network/Email/SmtpTransportTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index 5a32b011d..bff8932e4 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -100,7 +100,7 @@ class SmtpTransportTest extends CakeTestCase { $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n"); + $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(4))->method('read')->will($this->returnValue("250 Accepted\r\n")); $this->SmtpTransport->connect(); @@ -115,10 +115,10 @@ class SmtpTransportTest extends CakeTestCase { $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n"); + $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); - $this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n"); + $this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n"); $this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(7))->method('read')->will($this->returnValue("250 Accepted\r\n")); $this->SmtpTransport->connect(); @@ -134,10 +134,10 @@ class SmtpTransportTest extends CakeTestCase { $this->socket->expects($this->any())->method('connect')->will($this->returnValue(true)); $this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n")); - $this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n"); + $this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n"); $this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); - $this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n"); + $this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n"); $this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false)); $this->socket->expects($this->at(7))->method('read')->will($this->returnValue("200 Not Accepted\r\n")); $this->SmtpTransport->connect(); @@ -259,4 +259,4 @@ class SmtpTransportTest extends CakeTestCase { $this->SmtpTransport->disconnect(); } -} +} \ No newline at end of file From d666d6175a73f21192571f44ee747bd635fdcf3e Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Wed, 19 Oct 2011 16:46:55 -0430 Subject: [PATCH 14/24] Improving the upgrade shell by adding more renaming rules and making it more robust in case insensitive systems --- lib/Cake/Console/Command/UpgradeShell.php | 38 ++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index 0573b8448..b4cc4fe09 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -141,12 +141,15 @@ class UpgradeShell extends Shell { $this->_files = array(); chdir($cwd); } - - $this->_moveViewFiles(); - $moves = array( + 'config' => 'Config', + 'Config' . DS . 'schema' => 'Config' . DS . 'Schema', 'libs' => 'Lib', 'tests' => 'Test', + 'views' => 'View', + 'models' => 'Model', + 'Model' . DS . 'behaviors' => 'Model' . DS . 'Behavior', + 'Model' . DS . 'datasources' => 'Model' . DS . 'Datasource', 'Test' . DS . 'cases' => 'Test' . DS . 'Case', 'Test' . DS . 'fixtures' => 'Test' . DS . 'Fixture', 'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'Templates', @@ -156,7 +159,8 @@ class UpgradeShell extends Shell { $this->out(__d('cake_console', 'Moving %s to %s', $old, $new)); if (!$this->params['dry-run']) { if ($this->params['git']) { - exec('git mv -f ' . escapeshellarg($old) . ' ' . escapeshellarg($new)); + exec('git mv -f ' . escapeshellarg($old) . ' ' . escapeshellarg($old . '__')); + exec('git mv -f ' . escapeshellarg($old . '__') . ' ' . escapeshellarg($new)); } else { $Folder = new Folder($old); $Folder->move($new); @@ -164,18 +168,19 @@ class UpgradeShell extends Shell { } } } + $this->_moveViewFiles(); $sourceDirs = array( '.' => array('recursive' => false), 'Console', - 'Controller', 'controllers', + 'Controller', 'Lib' => array('checkFolder' => false), - 'Model', 'models', - 'Test' => array('regex' => '@class (\S*Test) extends CakeTestCase@'), + 'Model', 'tests', - 'View', + 'Test' => array('regex' => '@class (\S*Test) extends CakeTestCase@'), 'views', + 'View', 'vendors/shells', ); @@ -515,23 +520,27 @@ class UpgradeShell extends Shell { * @return void */ protected function _moveViewFiles() { - if (!is_dir('views')) { + if (!is_dir('View')) { return; } - $dirs = scandir('views'); + $dirs = scandir('View'); foreach ($dirs as $old) { - if (!is_dir('views' . DS . $old) || $old === '.' || $old === '..') { + if (!is_dir('View' . DS . $old) || $old === '.' || $old === '..') { continue; } $new = 'View' . DS . Inflector::camelize($old); - $old = 'views' . DS . $old; + $old = 'View' . DS . $old; + if ($new == $old) { + continue; + } $this->out(__d('cake_console', 'Moving %s to %s', $old, $new)); if (!$this->params['dry-run']) { if ($this->params['git']) { - exec('git mv -f ' . escapeshellarg($old) . ' ' . escapeshellarg($new)); + exec('git mv -f ' . escapeshellarg($old) . ' ' . escapeshellarg($old . '__')); + exec('git mv -f ' . escapeshellarg($old . '__') . ' ' . escapeshellarg($new)); } else { $Folder = new Folder($old); $Folder->move($new); @@ -620,7 +629,8 @@ class UpgradeShell extends Shell { $this->out(__d('cake_console', 'Moving %s to %s', $file, $new), 1, Shell::VERBOSE); if (!$this->params['dry-run']) { if ($this->params['git']) { - exec('git mv -f ' . escapeshellarg($file) . ' ' . escapeshellarg($new)); + exec('git mv -f ' . escapeshellarg($file) . ' ' . escapeshellarg($file . '__')); + exec('git mv -f ' . escapeshellarg($file. '__') . ' ' . escapeshellarg($new)); } else { rename($file, $new); } From a02fd82db2a25b67c6a65d16ce3c8dbcf7ac8e95 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Wed, 19 Oct 2011 15:17:10 +0700 Subject: [PATCH 15/24] display offending model and column --- lib/Cake/Model/CakeSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index 46e4fccef..5b8292f36 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -590,7 +590,7 @@ class CakeSchema extends Object { $value['key'] = 'primary'; } if (!isset($db->columns[$value['type']])) { - trigger_error(__d('cake_dev', 'Schema generation error: invalid column type %s does not exist in DBO', $value['type']), E_USER_NOTICE); + trigger_error(__d('cake_dev', 'Schema generation error: invalid column type %s for %s.%s does not exist in DBO', $value['type'], $Obj->name, $name), E_USER_NOTICE); continue; } else { $defaultCol = $db->columns[$value['type']]; From bad819773eac1dd47ac5d3708dc64f185270b15b Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 19 Oct 2011 21:26:04 -0400 Subject: [PATCH 16/24] Update CommandListShell to give better help. plugins require plugin prefixes now. Update the help to suggest how to run plugin shells. Fixes #2121 --- lib/Cake/Console/Command/CommandListShell.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php index ff73c96b2..4bf5b9356 100644 --- a/lib/Cake/Console/Command/CommandListShell.php +++ b/lib/Cake/Console/Command/CommandListShell.php @@ -144,7 +144,8 @@ class CommandListShell extends Shell { $this->out(" " . $row); } $this->out(); - $this->out(__d('cake_console', "To run a command, type cake shell_name [args]")); + $this->out(__d('cake_console', "To run an app or core command, type cake shell_name [args]")); + $this->out(__d('cake_console', "To run a plugin command, type cake Plugin.shell_name [args]")); $this->out(__d('cake_console', "To get help on a specific command, type cake shell_name --help"), 2); } From 7a4aa401d1a0de4a63ba8f9694327ba730c816ca Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 19 Oct 2011 21:33:03 -0400 Subject: [PATCH 17/24] Adding backwards compatible plugin syntax. Thie got lost during 2.0, and it inflecting only the shell name is kind of bad. --- lib/Cake/Console/ShellDispatcher.php | 1 + lib/Cake/Test/Case/Console/ShellDispatcherTest.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 9b32568a3..f40aa7350 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -206,6 +206,7 @@ class ShellDispatcher { protected function _getShell($shell) { list($plugin, $shell) = pluginSplit($shell, true); + $plugin = Inflector::camelize($plugin); $class = Inflector::camelize($shell) . 'Shell'; App::uses('Shell', 'Console'); diff --git a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php index 5f0ec8a08..2e2991974 100644 --- a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php +++ b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php @@ -129,6 +129,7 @@ class ShellDispatcherTest extends CakeTestCase { * @return void */ public function tearDown() { + parent::tearDown(); CakePlugin::unload(); } @@ -399,6 +400,10 @@ class ShellDispatcherTest extends CakeTestCase { $result = $Dispatcher->getShell('sample'); $this->assertInstanceOf('SampleShell', $result); + $Dispatcher = new TestShellDispatcher(); + $result = $Dispatcher->getShell('test_plugin.example'); + $this->assertInstanceOf('ExampleShell', $result); + $Dispatcher = new TestShellDispatcher(); $result = $Dispatcher->getShell('TestPlugin.example'); $this->assertInstanceOf('ExampleShell', $result); From 30504ef32b0b3a101f860a02b2bed4ed8eef5b10 Mon Sep 17 00:00:00 2001 From: Johannes N Date: Mon, 17 Oct 2011 18:05:06 +0300 Subject: [PATCH 18/24] Enable Asset timestamp for image submit buttons. Conflicts: lib/Cake/View/Helper/FormHelper.php --- lib/Cake/View/Helper/FormHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 0bfbec88b..7e1bd8524 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -1638,6 +1638,7 @@ class FormHelper extends AppHelper { } else { $url = $this->webroot(trim($caption, '/')); } + $url = $this->assetTimestamp($url); $tag = $this->Html->useTag('submitimage', $url, $options); } else { $options['value'] = $caption; From edfb0884c89f69b77fae045983251f5ea1c92192 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 19 Oct 2011 21:47:55 -0400 Subject: [PATCH 19/24] Adding test for form->submit() and timestamps. Conflicts: lib/Cake/Test/Case/View/Helper/FormHelperTest.php --- .../Test/Case/View/Helper/FormHelperTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 42618aafc..66b7b2be0 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -6009,6 +6009,23 @@ class FormHelperTest extends CakeTestCase { $this->assertEquals(array('save'), $result, 'Only submits with name attributes should be unlocked.'); } +/** + * Test submit image with timestamps. + * + * @return void + */ + function testSubmitImageTimestamp() { + Configure::write('Asset.timestamp', 'force'); + + $result = $this->Form->submit('cake.power.gif'); + $expected = array( + 'div' => array('class' => 'submit'), + 'input' => array('type' => 'image', 'src' => 'preg:/img\/cake\.power\.gif\?\d*/'), + '/div' + ); + $this->assertTags($result, $expected); + } + /** * test the create() method * From 7c70b371bf5e1c67099cbbc00fdec3ae60cebcb2 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 19 Oct 2011 22:55:50 -0400 Subject: [PATCH 20/24] Removing the rest of the 'cake' domain. These string should all be part of the app POT files. Fixes #2103 --- lib/Cake/View/Helper/NumberHelper.php | 2 +- lib/Cake/View/Helper/TimeHelper.php | 48 +++++++++++++-------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php index e35a7593f..0e63ecf1e 100644 --- a/lib/Cake/View/Helper/NumberHelper.php +++ b/lib/Cake/View/Helper/NumberHelper.php @@ -84,7 +84,7 @@ class NumberHelper extends AppHelper { public function toReadableSize($size) { switch (true) { case $size < 1024: - return __dn('cake', '%d Byte', '%d Bytes', $size, $size); + return __dn('%d Byte', '%d Bytes', $size, $size); case round($size / 1024) < 1024: return __('%d KB', $this->precision($size / 1024, 0)); case round($size / 1024 / 1024, 2) < 1024: diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php index 7e1620d8e..a16001dfe 100644 --- a/lib/Cake/View/Helper/TimeHelper.php +++ b/lib/Cake/View/Helper/TimeHelper.php @@ -80,19 +80,19 @@ class TimeHelper extends AppHelper { protected function _translateSpecifier($specifier) { switch ($specifier[1]) { case 'a': - $abday = __dc('cake', 'abday', 5); + $abday = __dc('abday', 5); if (is_array($abday)) { return $abday[date('w', $this->__time)]; } break; case 'A': - $day = __dc('cake', 'day', 5); + $day = __dc('day', 5); if (is_array($day)) { return $day[date('w', $this->__time)]; } break; case 'c': - $format = __dc('cake', 'd_t_fmt', 5); + $format = __dc('d_t_fmt', 5); if ($format != 'd_t_fmt') { return $this->convertSpecifiers($format, $this->__time); } @@ -114,13 +114,13 @@ class TimeHelper extends AppHelper { return date('jS', $this->__time); case 'b': case 'h': - $months = __dc('cake', 'abmon', 5); + $months = __dc('abmon', 5); if (is_array($months)) { return $months[date('n', $this->__time) -1]; } return '%b'; case 'B': - $months = __dc('cake', 'mon', 5); + $months = __dc('mon', 5); if (is_array($months)) { return $months[date('n', $this->__time) -1]; } @@ -131,14 +131,14 @@ class TimeHelper extends AppHelper { case 'P': $default = array('am' => 0, 'pm' => 1); $meridiem = $default[date('a',$this->__time)]; - $format = __dc('cake', 'am_pm', 5); + $format = __dc('am_pm', 5); if (is_array($format)) { $meridiem = $format[$meridiem]; return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem); } break; case 'r': - $complete = __dc('cake', 't_fmt_ampm', 5); + $complete = __dc('t_fmt_ampm', 5); if ($complete != 't_fmt_ampm') { return str_replace('%p',$this->_translateSpecifier(array('%p', 'p')),$complete); } @@ -152,13 +152,13 @@ class TimeHelper extends AppHelper { case 'u': return ($weekDay = date('w', $this->__time)) ? $weekDay : 7; case 'x': - $format = __dc('cake', 'd_fmt', 5); + $format = __dc('d_fmt', 5); if ($format != 'd_fmt') { return $this->convertSpecifiers($format, $this->__time); } break; case 'X': - $format = __dc('cake', 't_fmt', 5); + $format = __dc('t_fmt', 5); if ($format != 't_fmt') { return $this->convertSpecifiers($format, $this->__time); } @@ -613,33 +613,33 @@ class TimeHelper extends AppHelper { } else { if ($years > 0) { // years and months and days - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d year', '%d years', $years, $years); - $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d month', '%d months', $months, $months) : ''; - $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d week', '%d weeks', $weeks, $weeks) : ''; - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d year', '%d years', $years, $years); + $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . __dn('%d month', '%d months', $months, $months) : ''; + $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('%d week', '%d weeks', $weeks, $weeks) : ''; + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days) : ''; } elseif (abs($months) > 0) { // months, weeks and days - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d month', '%d months', $months, $months); - $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d week', '%d weeks', $weeks, $weeks) : ''; - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d month', '%d months', $months, $months); + $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('%d week', '%d weeks', $weeks, $weeks) : ''; + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days) : ''; } elseif (abs($weeks) > 0) { // weeks and days - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d week', '%d weeks', $weeks, $weeks); - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d week', '%d weeks', $weeks, $weeks); + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days) : ''; } elseif (abs($days) > 0) { // days and hours - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days); - $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d hour', '%d hours', $hours, $hours) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days); + $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . __dn('%d hour', '%d hours', $hours, $hours) : ''; } elseif (abs($hours) > 0) { // hours and minutes - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d hour', '%d hours', $hours, $hours); - $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d minute', '%d minutes', $minutes, $minutes) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d hour', '%d hours', $hours, $hours); + $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . __dn('%d minute', '%d minutes', $minutes, $minutes) : ''; } elseif (abs($minutes) > 0) { // minutes only - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d minute', '%d minutes', $minutes, $minutes); + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d minute', '%d minutes', $minutes, $minutes); } else { // seconds only - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d second', '%d seconds', $seconds, $seconds); + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d second', '%d seconds', $seconds, $seconds); } if (!$backwards) { From 25e9aaf6c89a577e685dadb087af89631565bc18 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 19 Oct 2011 23:09:21 -0400 Subject: [PATCH 21/24] Removing the remaining cake domain translations. 3rd time is a charm. Fixes #2103 --- .../test_app/View/Posts/test_nocache_tags.ctp | 102 +++++++++--------- lib/Cake/View/Errors/error400.ctp | 4 +- lib/Cake/View/Errors/error500.ctp | 4 +- lib/Cake/View/Helper/NumberHelper.php | 2 +- lib/Cake/View/Helper/TimeHelper.php | 48 ++++----- lib/Cake/View/Scaffolds/form.ctp | 16 +-- lib/Cake/View/Scaffolds/index.ctp | 24 ++--- lib/Cake/View/Scaffolds/view.ctp | 30 +++--- 8 files changed, 115 insertions(+), 115 deletions(-) diff --git a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp index f4b3df987..95d651579 100644 --- a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp +++ b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp @@ -20,11 +20,11 @@ @@ -33,12 +33,12 @@

' . $settings['engine']; - echo __d('cake', ' is being used to cache, to change this edit config/core.php '); + echo __(' is being used to cache, to change this edit config/core.php '); echo '

'; echo 'Settings:
    '; @@ -48,10 +48,10 @@ echo '
'; else: - echo __d('cake', 'NOT working.'); + echo __('NOT working.'); echo '
'; if (is_writable(TMP)): - echo __d('cake', 'Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly'); + echo __('Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly'); endif; endif; ?> @@ -60,15 +60,15 @@

'; - echo __d('cake', 'Rename config/database.php.default to config/database.php'); + echo __('Rename config/database.php.default to config/database.php'); endif; ?> @@ -82,60 +82,60 @@ if (!empty($filePresent)): ?>

- isConnected()): - __d('cake', ' is able to '); + __(' is able to '); else: - __d('cake', ' is NOT able to '); + __(' is NOT able to '); endif; - __d('cake', 'connect to the database.'); + __('connect to the database.'); ?>

-

- -

+

+ +

-
-
-
- +
+
+
+

-

+

-
-
- +
+
+

-

+

- +

- +

diff --git a/lib/Cake/View/Errors/error400.ctp b/lib/Cake/View/Errors/error400.ctp index 09d590170..d8c42ae84 100644 --- a/lib/Cake/View/Errors/error400.ctp +++ b/lib/Cake/View/Errors/error400.ctp @@ -18,9 +18,9 @@ ?>

- : + : '{$url}'" ); ?>

diff --git a/lib/Cake/View/Errors/error500.ctp b/lib/Cake/View/Errors/error500.ctp index 6c500aa73..4a46db7d4 100644 --- a/lib/Cake/View/Errors/error500.ctp +++ b/lib/Cake/View/Errors/error500.ctp @@ -18,8 +18,8 @@ ?>

- : - + : +

0 ): diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php index 0e63ecf1e..60270b732 100644 --- a/lib/Cake/View/Helper/NumberHelper.php +++ b/lib/Cake/View/Helper/NumberHelper.php @@ -84,7 +84,7 @@ class NumberHelper extends AppHelper { public function toReadableSize($size) { switch (true) { case $size < 1024: - return __dn('%d Byte', '%d Bytes', $size, $size); + return __n('%d Byte', '%d Bytes', $size, $size); case round($size / 1024) < 1024: return __('%d KB', $this->precision($size / 1024, 0)); case round($size / 1024 / 1024, 2) < 1024: diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php index a16001dfe..cf2e66ee5 100644 --- a/lib/Cake/View/Helper/TimeHelper.php +++ b/lib/Cake/View/Helper/TimeHelper.php @@ -80,19 +80,19 @@ class TimeHelper extends AppHelper { protected function _translateSpecifier($specifier) { switch ($specifier[1]) { case 'a': - $abday = __dc('abday', 5); + $abday = __c('abday', 5); if (is_array($abday)) { return $abday[date('w', $this->__time)]; } break; case 'A': - $day = __dc('day', 5); + $day = __c('day', 5); if (is_array($day)) { return $day[date('w', $this->__time)]; } break; case 'c': - $format = __dc('d_t_fmt', 5); + $format = __c('d_t_fmt', 5); if ($format != 'd_t_fmt') { return $this->convertSpecifiers($format, $this->__time); } @@ -114,13 +114,13 @@ class TimeHelper extends AppHelper { return date('jS', $this->__time); case 'b': case 'h': - $months = __dc('abmon', 5); + $months = __c('abmon', 5); if (is_array($months)) { return $months[date('n', $this->__time) -1]; } return '%b'; case 'B': - $months = __dc('mon', 5); + $months = __c('mon', 5); if (is_array($months)) { return $months[date('n', $this->__time) -1]; } @@ -131,14 +131,14 @@ class TimeHelper extends AppHelper { case 'P': $default = array('am' => 0, 'pm' => 1); $meridiem = $default[date('a',$this->__time)]; - $format = __dc('am_pm', 5); + $format = __c('am_pm', 5); if (is_array($format)) { $meridiem = $format[$meridiem]; return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem); } break; case 'r': - $complete = __dc('t_fmt_ampm', 5); + $complete = __c('t_fmt_ampm', 5); if ($complete != 't_fmt_ampm') { return str_replace('%p',$this->_translateSpecifier(array('%p', 'p')),$complete); } @@ -152,13 +152,13 @@ class TimeHelper extends AppHelper { case 'u': return ($weekDay = date('w', $this->__time)) ? $weekDay : 7; case 'x': - $format = __dc('d_fmt', 5); + $format = __c('d_fmt', 5); if ($format != 'd_fmt') { return $this->convertSpecifiers($format, $this->__time); } break; case 'X': - $format = __dc('t_fmt', 5); + $format = __c('t_fmt', 5); if ($format != 't_fmt') { return $this->convertSpecifiers($format, $this->__time); } @@ -613,33 +613,33 @@ class TimeHelper extends AppHelper { } else { if ($years > 0) { // years and months and days - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d year', '%d years', $years, $years); - $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . __dn('%d month', '%d months', $months, $months) : ''; - $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('%d week', '%d weeks', $weeks, $weeks) : ''; - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d year', '%d years', $years, $years); + $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . __n('%d month', '%d months', $months, $months) : ''; + $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __n('%d week', '%d weeks', $weeks, $weeks) : ''; + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days) : ''; } elseif (abs($months) > 0) { // months, weeks and days - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d month', '%d months', $months, $months); - $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('%d week', '%d weeks', $weeks, $weeks) : ''; - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d month', '%d months', $months, $months); + $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __n('%d week', '%d weeks', $weeks, $weeks) : ''; + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days) : ''; } elseif (abs($weeks) > 0) { // weeks and days - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d week', '%d weeks', $weeks, $weeks); - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d week', '%d weeks', $weeks, $weeks); + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days) : ''; } elseif (abs($days) > 0) { // days and hours - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d day', '%d days', $days, $days); - $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . __dn('%d hour', '%d hours', $hours, $hours) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days); + $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . __n('%d hour', '%d hours', $hours, $hours) : ''; } elseif (abs($hours) > 0) { // hours and minutes - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d hour', '%d hours', $hours, $hours); - $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . __dn('%d minute', '%d minutes', $minutes, $minutes) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d hour', '%d hours', $hours, $hours); + $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . __n('%d minute', '%d minutes', $minutes, $minutes) : ''; } elseif (abs($minutes) > 0) { // minutes only - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d minute', '%d minutes', $minutes, $minutes); + $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d minute', '%d minutes', $minutes, $minutes); } else { // seconds only - $relativeDate .= ($relativeDate ? ', ' : '') . __dn('%d second', '%d seconds', $seconds, $seconds); + $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d second', '%d seconds', $seconds, $seconds); } if (!$backwards) { diff --git a/lib/Cake/View/Scaffolds/form.ctp b/lib/Cake/View/Scaffolds/form.ctp index 379ff6f19..4749b2314 100644 --- a/lib/Cake/View/Scaffolds/form.ctp +++ b/lib/Cake/View/Scaffolds/form.ctp @@ -20,32 +20,32 @@ Form->create(); echo $this->Form->inputs($scaffoldFields, array('created', 'modified', 'updated')); - echo $this->Form->end(__d('cake', 'Submit')); + echo $this->Form->end(__('Submit')); ?>
-

+

    request->action != 'add'): ?>
  • Form->postLink( - __d('cake', 'Delete'), + __('Delete'), array('action' => 'delete', $this->Form->value($modelClass . '.' . $primaryKey)), null, - __d('cake', 'Are you sure you want to delete # %s?', $this->Form->value($modelClass . '.' . $primaryKey))); + __('Are you sure you want to delete # %s?', $this->Form->value($modelClass . '.' . $primaryKey))); ?>
  • -
  • Html->link(__d('cake', 'List') . ' ' . $pluralHumanName, array('action' => 'index'));?>
  • +
  • Html->link(__('List') . ' ' . $pluralHumanName, array('action' => 'index'));?>
  • $_data) { foreach ($_data as $_alias => $_details) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { - echo "\t\t
  • " . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "
  • \n"; - echo "\t\t
  • " . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "
  • \n"; + echo "\t\t
  • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "
  • \n"; + echo "\t\t
  • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "
  • \n"; $done[] = $_details['controller']; } } } ?>
-
\ No newline at end of file + diff --git a/lib/Cake/View/Scaffolds/index.ctp b/lib/Cake/View/Scaffolds/index.ctp index 0b5434004..e33a68c78 100644 --- a/lib/Cake/View/Scaffolds/index.ctp +++ b/lib/Cake/View/Scaffolds/index.ctp @@ -23,7 +23,7 @@ Paginator->sort($_field);?> - + '; - echo $this->Html->link(__d('cake', 'View'), array('action' => 'view', ${$singularVar}[$modelClass][$primaryKey])); - echo $this->Html->link(__d('cake', 'Edit'), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])); + echo $this->Html->link(__('View'), array('action' => 'view', ${$singularVar}[$modelClass][$primaryKey])); + echo $this->Html->link(__('Edit'), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])); echo $this->Form->postLink( - __d('cake', 'Delete'), + __('Delete'), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, - __d('cake', 'Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] + __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] ); echo ''; echo ''; @@ -63,28 +63,28 @@ endforeach;

Paginator->counter(array( - 'format' => __d('cake', 'Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') )); ?>

Paginator->prev('< ' . __d('cake', 'previous'), array(), null, array('class' => 'prev disabled')); + echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled')); echo $this->Paginator->numbers(array('separator' => '')); - echo $this->Paginator->next(__d('cake', 'next') .' >', array(), null, array('class' => 'next disabled')); + echo $this->Paginator->next(__('next') .' >', array(), null, array('class' => 'next disabled')); ?>
-

+

    -
  • Html->link(__d('cake', 'New %s', $singularHumanName), array('action' => 'add')); ?>
  • +
  • Html->link(__('New %s', $singularHumanName), array('action' => 'add')); ?>
  • $_data) { foreach ($_data as $_alias => $_details) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { - echo "
  • " . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
  • "; - echo "
  • " . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
  • "; + echo "
  • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
  • "; + echo "
  • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
  • "; $done[] = $_details['controller']; } } diff --git a/lib/Cake/View/Scaffolds/view.ctp b/lib/Cake/View/Scaffolds/view.ctp index 9e36fffd4..b3f876806 100644 --- a/lib/Cake/View/Scaffolds/view.ctp +++ b/lib/Cake/View/Scaffolds/view.ctp @@ -17,7 +17,7 @@ */ ?>
    -

    +

    -

    +

      " .$this->Html->link(__d('cake', 'Edit %s', $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " \n"; - echo "\t\t
    • " .$this->Html->link(__d('cake', 'Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __d('cake', 'Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). "
    • \n"; - echo "\t\t
    • " .$this->Html->link(__d('cake', 'List %s', $pluralHumanName), array('action' => 'index')). "
    • \n"; - echo "\t\t
    • " .$this->Html->link(__d('cake', 'New %s', $singularHumanName), array('action' => 'add')). "
    • \n"; + echo "\t\t
    • " .$this->Html->link(__('Edit %s', $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). "
    • \n"; + echo "\t\t
    • " .$this->Html->link(__('Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). "
    • \n"; + echo "\t\t
    • " .$this->Html->link(__('List %s', $pluralHumanName), array('action' => 'index')). "
    • \n"; + echo "\t\t
    • " .$this->Html->link(__('New %s', $singularHumanName), array('action' => 'add')). "
    • \n"; $done = array(); foreach ($associations as $_type => $_data) { foreach ($_data as $_alias => $_details) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { - echo "\t\t
    • " . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
    • \n"; - echo "\t\t
    • " . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
    • \n"; + echo "\t\t
    • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
    • \n"; + echo "\t\t
    • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
    • \n"; $done[] = $_details['controller']; } } @@ -67,7 +67,7 @@ foreach ($scaffoldFields as $_field) { if (!empty($associations['hasOne'])) : foreach ($associations['hasOne'] as $_alias => $_details): ?> @@ -102,7 +102,7 @@ foreach ($relations as $_alias => $_details): $otherSingularVar = Inflector::variable($_alias); ?>