Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CakeEmail fixes for Japanese encoding #268

Merged
merged 31 commits into from
@predominant
Owner

CakeEmail fixes for Japanese encoding

rchavik and others added some commits
@rchavik rchavik fixing typos 2bb9376
@rchavik rchavik removing 'empty' files from nonempty directories a60d71d
@lorenzo lorenzo Merge pull request #257 from rchavik/etc
Fixing typos and removing 'empty' files from non-empty dirs
fb4a003
@suzuki suzuki fixed: change test property CakeEmail::charset to CakeEmail::headerCh…
…arset
33c21b3
@renan renan Fixed issue when using multiple extensions in Router::parseExtensions…
…() could result in undefined index notice by RequestHandlerComponent.
646b8f1
@renan renan Fixing failing test introduced in fb4a003522c2dd9b05305fc3d39316b7fc5…
…3f1cb.
d1be66f
@renan renan Making the test assert what it is intended to assert. fe9762d
@majna majna Fixed failing smtp tests when testing on host other then hardcoded 'l…
…ocalhost'.
f361509
@ADmad ADmad Merge pull request #264 from majna/2.0-smtp-test
Fixed failing smtp tests when testing on host other then hardcoded 'localhost'.
6177203
@ADmad ADmad Revert "Fixed failing smtp tests when testing on host other then hard…
…coded 'localhost'."

This change you cause the tests to fail when run through CLI

This reverts commit f361509f1079ca277e8a77d2f41972068695a942.
6d51ce5
@lorenzo lorenzo Improving the upgrade shell by adding more renaming rules and making …
…it more robust in case insensitive systems
d666d61
@lorenzo lorenzo Merge branch '2.0' of github.com:cakephp/cakephp into 2.0 3735c7d
@rchavik rchavik display offending model and column a02fd82
@markstory markstory Merge pull request #261 from rchavik/misc
display model and field that is causing schema generate to fail
714e281
@markstory markstory Update CommandListShell to give better help.
plugins require plugin prefixes now.  Update the help
to suggest how to run plugin shells.

Fixes #2121
bad8197
@markstory markstory Adding backwards compatible plugin syntax.
Thie got lost during 2.0, and it inflecting only the shell name
is kind of bad.
7a4aa40
@johannesnagl johannesnagl Enable Asset timestamp for image submit buttons.
Conflicts:

	lib/Cake/View/Helper/FormHelper.php
30504ef
@markstory markstory Adding test for form->submit() and timestamps.
Conflicts:

	lib/Cake/Test/Case/View/Helper/FormHelperTest.php
edfb088
@markstory markstory Removing the rest of the 'cake' domain.
These string should all be part of the app POT files.
Fixes #2103
7c70b37
@markstory markstory Removing the remaining cake domain translations.
3rd time is a charm.
Fixes #2103
25e9aaf
@markstory
Owner

Yeah I'm an idiot. It broke a pile of tests, and I forgot a pile of view files too :(

lib/Cake/Network/Email/CakeEmail.php
@@ -1376,4 +1389,16 @@ class CakeEmail {
return array_merge($msg, $content);
}
+/**
+ * Return the Content-Transfer Encoding value based on the set charset
+ *
+ * @return void
+ */
+ private function getContentTransferEncoding() {
@jrbasso Collaborator
jrbasso added a note

As defined in cake core team, cake should avoid private methods (use protected) and use undercore before the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@predominant predominant merged commit 7ed6e04 into cakephp:2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 19, 2011
  1. @rchavik

    fixing typos

    rchavik authored
  2. @rchavik
  3. @lorenzo

    Merge pull request #257 from rchavik/etc

    lorenzo authored
    Fixing typos and removing 'empty' files from non-empty dirs
  4. @suzuki
  5. @renan

    Fixed issue when using multiple extensions in Router::parseExtensions…

    renan authored
    …() could result in undefined index notice by RequestHandlerComponent.
  6. @renan
  7. @renan
  8. @majna
  9. @ADmad

    Merge pull request #264 from majna/2.0-smtp-test

    ADmad authored
    Fixed failing smtp tests when testing on host other then hardcoded 'localhost'.
  10. @ADmad

    Revert "Fixed failing smtp tests when testing on host other then hard…

    ADmad authored
    …coded 'localhost'."
    
    This change you cause the tests to fail when run through CLI
    
    This reverts commit f361509f1079ca277e8a77d2f41972068695a942.
  11. @lorenzo

    Improving the upgrade shell by adding more renaming rules and making …

    lorenzo authored
    …it more robust in case insensitive systems
  12. @lorenzo
Commits on Oct 20, 2011
  1. @rchavik
  2. @markstory

    Merge pull request #261 from rchavik/misc

    markstory authored
    display model and field that is causing schema generate to fail
  3. @markstory

    Update CommandListShell to give better help.

    markstory authored
    plugins require plugin prefixes now.  Update the help
    to suggest how to run plugin shells.
    
    Fixes #2121
  4. @markstory

    Adding backwards compatible plugin syntax.

    markstory authored
    Thie got lost during 2.0, and it inflecting only the shell name
    is kind of bad.
  5. @johannesnagl @markstory

    Enable Asset timestamp for image submit buttons.

    johannesnagl authored markstory committed
    Conflicts:
    
    	lib/Cake/View/Helper/FormHelper.php
  6. @markstory

    Adding test for form->submit() and timestamps.

    markstory authored
    Conflicts:
    
    	lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  7. @markstory

    Removing the rest of the 'cake' domain.

    markstory authored
    These string should all be part of the app POT files.
    Fixes #2103
  8. @markstory

    Removing the remaining cake domain translations.

    markstory authored
    3rd time is a charm.
    Fixes #2103
  9. @markstory
  10. @markstory
  11. @markstory
Commits on Oct 21, 2011
  1. @markstory

    Remove unused parameter.

    markstory authored
  2. @renan

    Parsing every parameter until there is no more. Good to have alias bu…

    renan authored
    …t with the ability to override the arguments.
  3. @ceeram
Commits on Oct 22, 2011
  1. @markstory

    Make App::_loadVendor() static.

    markstory authored
    Fixes strict warnings.
    Fixes #2137
  2. @markstory

    Fix issue with postgres and virtualFields

    markstory authored
    If a virtualField was set to a literal value it would be quoted.
    Test added.
    
    Fixes #2085
  3. @predominant

    Merge remote-tracking branch 'predominant/2.0' into 2.0

    predominant authored
    Conflicts:
    	lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
  4. @predominant
  5. @predominant
This page is out of date. Refresh to see the latest.
Showing with 273 additions and 183 deletions.
  1. 0  app/Console/Command/empty
  2. 0  app/Test/Case/Controller/empty
  3. 0  app/Test/Case/Model/empty
  4. +1 −1  app/webroot/css/cake.generic.css
  5. +1 −1  app/webroot/index.php
  6. +1 −1  index.php
  7. +1 −1  lib/Cake/Cache/Cache.php
  8. +2 −1  lib/Cake/Console/Command/CommandListShell.php
  9. +24 −14 lib/Cake/Console/Command/UpgradeShell.php
  10. +2 −2 lib/Cake/Console/ShellDispatcher.php
  11. 0  lib/Cake/Console/Templates/skel/Test/Case/Controller/empty
  12. 0  lib/Cake/Console/Templates/skel/Test/Case/Model/empty
  13. 0  lib/Cake/Console/Templates/skel/View/Helper/empty
  14. +1 −1  lib/Cake/Console/Templates/skel/webroot/index.php
  15. +1 −1  lib/Cake/Controller/Component.php
  16. +1 −1  lib/Cake/Controller/Component/AuthComponent.php
  17. +1 −1  lib/Cake/Controller/Component/RequestHandlerComponent.php
  18. +1 −1  lib/Cake/Controller/Scaffold.php
  19. +1 −1  lib/Cake/Core/App.php
  20. +1 −1  lib/Cake/Core/CakePlugin.php
  21. +1 −1  lib/Cake/Model/BehaviorCollection.php
  22. +1 −1  lib/Cake/Model/CakeSchema.php
  23. +5 −2 lib/Cake/Model/Datasource/Database/Postgres.php
  24. +2 −2 lib/Cake/Model/Model.php
  25. +1 −1  lib/Cake/Model/ModelBehavior.php
  26. +7 −7 lib/Cake/Network/Email/CakeEmail.php
  27. +1 −1  lib/Cake/Routing/Dispatcher.php
  28. +1 −1  lib/Cake/Routing/Router.php
  29. +13 −13 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
  30. +24 −0 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
  31. +15 −0 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
  32. +19 −0 lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
  33. +1 −1  lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php
  34. +3 −3 lib/Cake/Test/Case/Utility/SetTest.php
  35. +17 −0 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  36. 0  lib/Cake/Test/test_app/Model/Behavior/empty
  37. 0  lib/Cake/Test/test_app/Plugin/TestPlugin/Console/Command/Task/empty
  38. 0  lib/Cake/Test/test_app/View/Elements/empty
  39. 0  lib/Cake/Test/test_app/View/Helper/empty
  40. 0  lib/Cake/Test/test_app/View/Pages/empty
  41. +51 −51 lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp
  42. +1 −1  lib/Cake/TestSuite/CakeTestSuite.php
  43. +1 −1  lib/Cake/Utility/Debugger.php
  44. +1 −1  lib/Cake/Utility/String.php
  45. +4 −4 lib/Cake/Utility/Validation.php
  46. +2 −2 lib/Cake/View/Errors/error400.ctp
  47. +2 −2 lib/Cake/View/Errors/error500.ctp
  48. +1 −0  lib/Cake/View/Helper/FormHelper.php
  49. +1 −1  lib/Cake/View/Helper/NumberHelper.php
  50. +24 −24 lib/Cake/View/Helper/TimeHelper.php
  51. +8 −8 lib/Cake/View/Scaffolds/form.ctp
  52. +12 −12 lib/Cake/View/Scaffolds/index.ctp
  53. +15 −15 lib/Cake/View/Scaffolds/view.ctp
View
0  app/Console/Command/empty
No changes.
View
0  app/Test/Case/Controller/empty
No changes.
View
0  app/Test/Case/Model/empty
No changes.
View
2  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 {
View
2  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.
View
2  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.
*
View
2  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.
View
3  lib/Cake/Console/Command/CommandListShell.php
@@ -144,7 +144,8 @@ protected function _asText($shellList) {
$this->out(" " . $row);
}
$this->out();
- $this->out(__d('cake_console', "To run a command, type <info>cake shell_name [args]</info>"));
+ $this->out(__d('cake_console', "To run an app or core command, type <info>cake shell_name [args]</info>"));
+ $this->out(__d('cake_console', "To run a plugin command, type <info>cake Plugin.shell_name [args]</info>"));
$this->out(__d('cake_console', "To get help on a specific command, type <info>cake shell_name --help</info>"), 2);
}
View
38 lib/Cake/Console/Command/UpgradeShell.php
@@ -141,12 +141,15 @@ public function locations() {
$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 @@ public function locations() {
$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 @@ public function locations() {
}
}
}
+ $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 @@ public function components() {
* @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 @@ protected function _movePhpFiles($path, $options) {
$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);
}
View
4 lib/Cake/Console/ShellDispatcher.php
@@ -206,6 +206,7 @@ public function dispatch() {
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell, true);
+ $plugin = Inflector::camelize($plugin);
$class = Inflector::camelize($shell) . 'Shell';
App::uses('Shell', 'Console');
@@ -287,8 +288,7 @@ protected function _parsePaths($args) {
$parsed = array();
$keys = array('-working', '--working', '-app', '--app', '-root', '--root');
foreach ($keys as $key) {
- $index = array_search($key, $args);
- if ($index !== false) {
+ while (($index = array_search($key, $args)) !== false) {
$keyname = str_replace('-', '', $key);
$valueIndex = $index + 1;
$parsed[$keyname] = $args[$valueIndex];
View
0  lib/Cake/Console/Templates/skel/Test/Case/Controller/empty
No changes.
View
0  lib/Cake/Console/Templates/skel/Test/Case/Model/empty
No changes.
View
0  lib/Cake/Console/Templates/skel/View/Helper/empty
No changes.
View
2  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.
View
2  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.
*
View
2  lib/Cake/Controller/Component/AuthComponent.php
@@ -536,7 +536,7 @@ public function logout() {
/**
* 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
*/
View
2  lib/Cake/Controller/Component/RequestHandlerComponent.php
@@ -140,7 +140,7 @@ protected function _setExtension() {
$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);
}
}
View
2  lib/Cake/Controller/Scaffold.php
@@ -212,7 +212,7 @@ protected function _scaffoldForm($action = 'edit') {
* 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
*/
View
2  lib/Cake/Core/App.php
@@ -703,7 +703,7 @@ protected function _loadFile($name, $plugin, $search, $file, $return) {
* @param string $ext file extension if known
* @return boolean true if the file was loaded successfully, false otherwise
*/
- protected function _loadVendor($name, $plugin, $file, $ext) {
+ protected static function _loadVendor($name, $plugin, $file, $ext) {
if ($mapped = self::_mapped($name, $plugin)) {
return (bool) include_once($mapped);
}
View
2  lib/Cake/Core/CakePlugin.php
@@ -194,7 +194,7 @@ public static function routes($plugin = null) {
}
/**
- * 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
View
2  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
*
View
2  lib/Cake/Model/CakeSchema.php
@@ -590,7 +590,7 @@ protected function _columns(&$Obj) {
$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']];
View
7 lib/Cake/Model/Datasource/Database/Postgres.php
@@ -394,6 +394,7 @@ public function fields($model, $alias = null, $fields = array(), $quote = true)
/**
* Auxiliary function to quote matched `(Model.fields)` from a preg_replace_callback call
+ * Quotes the fields in a function call.
*
* @param string $match matched string
* @return string quoted strig
@@ -404,9 +405,11 @@ protected function _quoteFunctionField($match) {
$prepend = 'DISTINCT ';
$match[1] = trim(str_replace('DISTINCT', '', $match[1]));
}
- if (strpos($match[1], '.') === false) {
+ $constant = preg_match('/^\d+|NULL|FALSE|TRUE$/i', $match[1]);
+
+ if (!$constant && strpos($match[1], '.') === false) {
$match[1] = $this->name($match[1]);
- } else {
+ } elseif (!$constant){
$parts = explode('.', $match[1]);
if (!Set::numeric($parts)) {
$match[1] = $this->name($match[1]);
View
4 lib/Cake/Model/Model.php
@@ -722,7 +722,7 @@ public function __call($method, $params) {
}
/**
- * 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 @@ public function invalidFields($options = array()) {
* 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()
*/
View
2  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
View
14 lib/Cake/Network/Email/CakeEmail.php
@@ -670,7 +670,7 @@ public function getHeaders($include = array()) {
} elseif ($this->_emailFormat === 'both') {
$headers['Content-Type'] = 'multipart/alternative; boundary="alt-' . $this->_boundary . '"';
}
- $headers['Content-Transfer-Encoding'] = $this->getContentTransferEncoding();
+ $headers['Content-Transfer-Encoding'] = $this->_getContentTransferEncoding();
return $headers;
}
@@ -1278,7 +1278,7 @@ protected function _formatMessage($message) {
} elseif ($this->_emailFormat === 'both') {
$prefix[] = 'Content-Type: multipart/alternative; boundary="alt-' . $this->_boundary . '"';
}
- $prefix[] = 'Content-Transfer-Encoding: ' . $this->getContentTransferEncoding();
+ $prefix[] = 'Content-Transfer-Encoding: ' . $this->_getContentTransferEncoding();
$prefix[] = '';
$message = array_merge($prefix, $message);
}
@@ -1331,7 +1331,7 @@ protected function _render($content) {
}
$msg[] = '--alt-' . $this->_boundary;
$msg[] = 'Content-Type: text/plain; charset=' . $this->charset;
- $msg[] = 'Content-Transfer-Encoding: ' . $this->getContentTransferEncoding();
+ $msg[] = 'Content-Transfer-Encoding: ' . $this->_getContentTransferEncoding();
$msg[] = '';
$View->viewPath = $View->layoutPath = 'Emails' . DS . 'text';
@@ -1343,7 +1343,7 @@ protected function _render($content) {
$msg[] = '';
$msg[] = '--alt-' . $this->_boundary;
$msg[] = 'Content-Type: text/html; charset=' . $this->charset;
- $msg[] = 'Content-Transfer-Encoding: ' . $this->getContentTransferEncoding();
+ $msg[] = 'Content-Transfer-Encoding: ' . $this->_getContentTransferEncoding();
$msg[] = '';
$View->viewPath = $View->layoutPath = 'Emails' . DS . 'html';
@@ -1365,12 +1365,12 @@ protected function _render($content) {
$msg[] = '';
$msg[] = '--' . $this->_boundary;
$msg[] = 'Content-Type: text/html; charset=' . $this->charset;
- $msg[] = 'Content-Transfer-Encoding: ' . $this->getContentTransferEncoding();
+ $msg[] = 'Content-Transfer-Encoding: ' . $this->_getContentTransferEncoding();
$msg[] = '';
} else {
$msg[] = '--' . $this->_boundary;
$msg[] = 'Content-Type: text/plain; charset=' . $this->charset;
- $msg[] = 'Content-Transfer-Encoding: ' . $this->getContentTransferEncoding();
+ $msg[] = 'Content-Transfer-Encoding: ' . $this->_getContentTransferEncoding();
$msg[] = '';
}
}
@@ -1394,7 +1394,7 @@ protected function _render($content) {
*
* @return void
*/
- private function getContentTransferEncoding() {
+ protected function _getContentTransferEncoding() {
$charset = strtoupper($this->charset);
if (in_array($charset, $this->_charset8bit)) {
return '8bit';
View
2  lib/Cake/Routing/Dispatcher.php
@@ -1,6 +1,6 @@
<?php
/**
- * Dispatcher takes the URL information, parses it for paramters and
+ * Dispatcher takes the URL information, parses it for parameters and
* tells the involved controllers what to do.
*
* This is the heart of Cake's operation.
View
2  lib/Cake/Routing/Router.php
@@ -144,7 +144,7 @@ class Router {
protected static $_requests = array();
/**
- * Initial state is popualated the first time reload() is called which is at the bottom
+ * Initial state is populated the first time reload() is called which is at the bottom
* of this file. This is a cheat as get_class_vars() returns the value of static vars even if they
* have changed.
*
View
26 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
@@ -167,21 +167,21 @@ public function testBakeEmptyFlag() {
$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_file($path . DS . $dir . DS . 'empty'), 'Missing empty file in ' . $dir);
+ foreach ($empty as $dir => $file) {
+ $this->assertTrue(is_file($path . DS . $dir . DS . $file), sprintf('Missing %s file in %s', $file, $dir));
}
}
View
24 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
@@ -129,6 +129,7 @@ public function setUp() {
* @return void
*/
public function tearDown() {
+ parent::tearDown();
CakePlugin::unload();
}
@@ -364,6 +365,25 @@ public function testParseParams() {
$Dispatcher->parseParams($params);
$this->assertEqual($expected, $Dispatcher->params);
+ $params = array(
+ '/cake/1.2.x.x/cake/console/cake.php',
+ 'bake',
+ '-app',
+ 'new',
+ '-app',
+ 'old',
+ '-working',
+ '/var/www/htdocs'
+ );
+ $expected = array(
+ 'app' => 'old',
+ 'webroot' => 'webroot',
+ 'working' => str_replace('/', DS, '/var/www/htdocs/old'),
+ 'root' => str_replace('/', DS,'/var/www/htdocs')
+ );
+ $Dispatcher->parseParams($params);
+ $this->assertEqual($expected, $Dispatcher->params);
+
if (DS === '\\') {
$params = array(
'cake.php',
@@ -400,6 +420,10 @@ public function testGetShell() {
$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);
}
View
15 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
@@ -194,6 +194,21 @@ public function testInitializeContentTypeWithjQueryAccept() {
}
/**
+ * 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.
*
* @return void
View
19 lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
@@ -752,6 +752,25 @@ public function testVirtualFields() {
}
/**
+ * Test that virtual fields work with SQL constants
+ *
+ * @return void
+ */
+ function testVirtualFieldAsAConstant() {
+ $this->loadFixtures('Article', 'Comment');
+ $Article =& ClassRegistry::init('Article');
+ $Article->virtualFields = array(
+ 'empty' => "NULL",
+ 'number' => 43,
+ 'truth' => 'TRUE'
+ );
+ $result = $Article->find('first');
+ $this->assertNull($result['Article']['empty']);
+ $this->assertTrue($result['Article']['truth']);
+ $this->assertEquals(43, $result['Article']['number']);
+ }
+
+/**
* Tests additional order options for postgres
*
* @return void
View
2  lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php
@@ -88,7 +88,7 @@ public function setUp() {
$this->SmtpTransport = new SmtpTestTransport();
$this->SmtpTransport->setSocket($this->socket);
- $this->SmtpTransport->config();
+ $this->SmtpTransport->config(array('client' => 'localhost'));
}
/**
View
6 lib/Cake/Test/Case/Utility/SetTest.php
@@ -1683,7 +1683,7 @@ public function testRemove() {
'files' => array('name' => 'files')
);
- $result = Set::remove($a, 'files', array('name' => 'files'));
+ $result = Set::remove($a, 'files');
$expected = array(
'pages' => array('name' => 'page')
);
@@ -1696,7 +1696,7 @@ public function testRemove() {
)
);
- $result = Set::remove($a, 'pages.1.vars', array('title' => 'page title'));
+ $result = Set::remove($a, 'pages.1.vars');
$expected = array(
'pages' => array(
0 => array('name' => 'main'),
@@ -1705,7 +1705,7 @@ public function testRemove() {
);
$this->assertEquals($expected, $result);
- $result = Set::remove($a, 'pages.2.vars', array('title' => 'page title'));
+ $result = Set::remove($a, 'pages.2.vars');
$expected = $a;
$this->assertEquals($expected, $result);
}
View
17 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -6010,6 +6010,23 @@ public function testSubmitUnlockedByDefault() {
}
/**
+ * 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
*
* @return void
View
0  lib/Cake/Test/test_app/Model/Behavior/empty
No changes.
View
0  lib/Cake/Test/test_app/Plugin/TestPlugin/Console/Command/Task/empty
No changes.
View
0  lib/Cake/Test/test_app/View/Elements/empty
No changes.
View
0  lib/Cake/Test/test_app/View/Helper/empty
No changes.
View
0  lib/Cake/Test/test_app/View/Pages/empty
No changes.
View
102 lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp
@@ -20,11 +20,11 @@
<!--nocache-->
<span class="notice">
<?php
- echo __d('cake', 'Your tmp directory is ');
+ echo __('Your tmp directory is ');
if (is_writable(TMP)):
- echo __d('cake', 'writable.');
+ echo __('writable.');
else:
- echo __d('cake', 'NOT writable.');
+ echo __('NOT writable.');
endif;
?>
</span>
@@ -33,12 +33,12 @@
<p>
<span class="notice">
<?php
- echo __d('cake', 'Your cache is ');
+ echo __('Your cache is ');
if (Cache::isInitialized('default')):
- echo __d('cake', 'set up and initialized properly.');
+ echo __('set up and initialized properly.');
$settings = Cache::settings();
echo '<p>' . $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 '</p>';
echo 'Settings: <ul>';
@@ -48,10 +48,10 @@
echo '</ul>';
else:
- echo __d('cake', 'NOT working.');
+ echo __('NOT working.');
echo '<br />';
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 @@
<p>
<span class="notice">
<?php
- echo __d('cake', 'Your database configuration file is ');
+ echo __('Your database configuration file is ');
$filePresent = null;
if (file_exists(APP . 'Config'.'database.php')):
- echo __d('cake', 'present.');
+ echo __('present.');
$filePresent = true;
else:
- echo __d('cake', 'NOT present.');
+ echo __('NOT present.');
echo '<br/>';
- echo __d('cake', 'Rename config/database.php.default to config/database.php');
+ echo __('Rename config/database.php.default to config/database.php');
endif;
?>
</span>
@@ -82,60 +82,60 @@ if (!empty($filePresent)):
?>
<p>
<span class="notice">
- <?php echo __d('cake', 'Cake');
+ <?php echo __('Cake');
if ($connected->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.');
?>
</span>
</p>
<?php endif; ?>
-<h2><?php echo __d('cake', 'Release Notes for CakePHP %s.', Configure::version()); ?></h2>
-<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php echo __d('cake', 'Read the release notes and get the latest version'); ?> </a>
-<h2><?php echo __d('cake', 'Editing this Page'); ?></h2>
+<h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
+<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php echo __('Read the release notes and get the latest version'); ?> </a>
+<h2><?php echo __('Editing this Page'); ?></h2>
<p>
-<?php echo __d('cake', 'To change the content of this page, create: /app/View/Pages/home.ctp.'); ?><br />
-<?php echo __d('cake', 'To change its layout, create: /app/View/Layouts/default.ctp.'); ?><br />
-<a href="http://manual.cakephp.org/"><?php echo __d('cake', 'See the views section of the manual for more info.'); ?> </a><br />
-<?php echo __d('cake', 'You can also add some CSS styles for your pages at: app/webroot/css/.'); ?>
+<?php echo __('To change the content of this page, create: /app/View/Pages/home.ctp.'); ?><br />
+<?php echo __('To change its layout, create: /app/View/Layouts/default.ctp.'); ?><br />
+<a href="http://manual.cakephp.org/"><?php echo __('See the views section of the manual for more info.'); ?> </a><br />
+<?php echo __('You can also add some CSS styles for your pages at: app/webroot/css/.'); ?>
</p>
-<h2><?php echo __d('cake', 'Getting Started'); ?></h2>
+<h2><?php echo __('Getting Started'); ?></h2>
<p>
-<a href="http://manual.cakephp.org/appendix/blog_tutorial"><?php echo __d('cake', 'The 15 min Blog Tutorial'); ?></a><br />
-<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html"><?php echo __d('cake', 'Cook up Web sites fast with CakePHP'); ?></a><br />
-<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-wiki1.html"><?php echo __d('cake', 'Create an interactive production wiki using PHP'); ?></a>
+<a href="http://manual.cakephp.org/appendix/blog_tutorial"><?php echo __('The 15 min Blog Tutorial'); ?></a><br />
+<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html"><?php echo __('Cook up Web sites fast with CakePHP'); ?></a><br />
+<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-wiki1.html"><?php echo __('Create an interactive production wiki using PHP'); ?></a>
</p>
-<h2><?php echo __d('cake', 'More about Cake'); ?></h2>
+<h2><?php echo __('More about Cake'); ?></h2>
<p>
-<?php echo __d('cake', 'CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
+<?php echo __('CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
</p>
<p>
-<?php echo __d('cake', 'Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?>
+<?php echo __('Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?>
</p>
<ul>
- <li><a href="http://cakefoundation.org/"><?php echo __d('cake', 'Cake Software Foundation'); ?> </a>
- <ul><li><?php echo __d('cake', 'Promoting development related to CakePHP'); ?></li></ul></li>
- <li><a href="http://bakery.cakephp.org"><?php echo __d('cake', 'The Bakery'); ?> </a>
- <ul><li><?php echo __d('cake', 'Everything CakePHP'); ?></li></ul></li>
- <li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php echo __d('cake', 'Book Store'); ?> </a>
- <ul><li><?php echo __d('cake', 'Recommended Software Books'); ?></li></ul></li>
- <li><a href="http://www.cafepress.com/cakefoundation"><?php echo __d('cake', 'CakeSchwag'); ?> </a>
- <ul><li><?php echo __d('cake', 'Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
- <li><a href="http://www.cakephp.org"><?php echo __d('cake', 'CakePHP'); ?> </a>
- <ul><li><?php echo __d('cake', 'The Rapid Development Framework'); ?></li></ul></li>
- <li><a href="http://manual.cakephp.org"><?php echo __d('cake', 'CakePHP Manual'); ?> </a>
- <ul><li><?php echo __d('cake', 'Your Rapid Development Cookbook'); ?></li></ul></li>
- <li><a href="http://api.cakephp.org"><?php echo __d('cake', 'CakePHP API'); ?> </a>
- <ul><li><?php echo __d('cake', 'Docblock Your Best Friend'); ?></li></ul></li>
- <li><a href="http://www.cakeforge.org"><?php echo __d('cake', 'CakeForge'); ?> </a>
- <ul><li><?php echo __d('cake', 'Open Development for CakePHP'); ?></li></ul></li>
- <li><a href="https://trac.cakephp.org/"><?php echo __d('cake', 'CakePHP Trac'); ?> </a>
- <ul><li><?php echo __d('cake', 'For the Development of CakePHP (Tickets, SVN browser, Roadmap, Changelogs)'); ?></li></ul></li>
- <li><a href="http://groups-beta.google.com/group/cake-php"><?php echo __d('cake', 'CakePHP Google Group'); ?> </a>
- <ul><li><?php echo __d('cake', 'Community mailing list'); ?></li></ul></li>
+ <li><a href="http://cakefoundation.org/"><?php echo __('Cake Software Foundation'); ?> </a>
+ <ul><li><?php echo __('Promoting development related to CakePHP'); ?></li></ul></li>
+ <li><a href="http://bakery.cakephp.org"><?php echo __('The Bakery'); ?> </a>
+ <ul><li><?php echo __('Everything CakePHP'); ?></li></ul></li>
+ <li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php echo __('Book Store'); ?> </a>
+ <ul><li><?php echo __('Recommended Software Books'); ?></li></ul></li>
+ <li><a href="http://www.cafepress.com/cakefoundation"><?php echo __('CakeSchwag'); ?> </a>
+ <ul><li><?php echo __('Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
+ <li><a href="http://www.cakephp.org"><?php echo __('CakePHP'); ?> </a>
+ <ul><li><?php echo __('The Rapid Development Framework'); ?></li></ul></li>
+ <li><a href="http://manual.cakephp.org"><?php echo __('CakePHP Manual'); ?> </a>
+ <ul><li><?php echo __('Your Rapid Development Cookbook'); ?></li></ul></li>
+ <li><a href="http://api.cakephp.org"><?php echo __('CakePHP API'); ?> </a>
+ <ul><li><?php echo __('Docblock Your Best Friend'); ?></li></ul></li>
+ <li><a href="http://www.cakeforge.org"><?php echo __('CakeForge'); ?> </a>
+ <ul><li><?php echo __('Open Development for CakePHP'); ?></li></ul></li>
+ <li><a href="https://trac.cakephp.org/"><?php echo __('CakePHP Trac'); ?> </a>
+ <ul><li><?php echo __('For the Development of CakePHP (Tickets, SVN browser, Roadmap, Changelogs)'); ?></li></ul></li>
+ <li><a href="http://groups-beta.google.com/group/cake-php"><?php echo __('CakePHP Google Group'); ?> </a>
+ <ul><li><?php echo __('Community mailing list'); ?></li></ul></li>
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
- <ul><li><?php echo __d('cake', 'Live chat about CakePHP'); ?></li></ul></li>
+ <ul><li><?php echo __('Live chat about CakePHP'); ?></li></ul></li>
</ul>
View
2  lib/Cake/TestSuite/CakeTestSuite.php
@@ -1,6 +1,6 @@
<?php
/**
- * A class to contain test cases and run them with shered fixtures
+ * A class to contain test cases and run them with shared fixtures
*
* PHP 5
*
View
2  lib/Cake/Utility/Debugger.php
@@ -204,7 +204,7 @@ public static function log($var, $level = LOG_DEBUG) {
* @param integer $line Line that triggered the error
* @param array $context Context
* @return boolean true if error was handled
- * @deprecated This function is supersceeded by Debugger::outputError()
+ * @deprecated This function is superseded by Debugger::outputError()
*/
public static function showError($code, $description, $file = null, $line = null, $context = null) {
$_this = Debugger::getInstance();
View
2  lib/Cake/Utility/String.php
@@ -255,7 +255,7 @@ public static function insert($str, $data, $options = array()) {
/**
* Cleans up a String::insert() formated string with given $options depending on the 'clean' key in
* $options. The default method used is text but html is also available. The goal of this function
- * is to replace all whitespace and uneeded markup around placeholders that did not get replaced
+ * is to replace all whitespace and unneeded markup around placeholders that did not get replaced
* by String::insert().
*
* @param string $str
View
8 lib/Cake/Utility/Validation.php
@@ -336,7 +336,7 @@ public static function date($check, $format = 'ymd', $regex = null) {
* @see Validation::date
* @see Validation::time
*/
- public function datetime($check, $dateFormat = 'ymd', $regex = null) {
+ public static function datetime($check, $dateFormat = 'ymd', $regex = null) {
$valid = false;
$parts = explode(' ', $check);
if (!empty($parts) && count($parts) > 1) {
@@ -522,7 +522,7 @@ public static function money($check, $symbolPosition = 'left') {
* Valid Options
*
* - in => 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 @@ public static function multiple($check, $options = array()) {
* 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 @@ public static function url($check, $strict = false) {
*
* @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);
View
4 lib/Cake/View/Errors/error400.ctp
@@ -18,9 +18,9 @@
?>
<h2><?php echo $name; ?></h2>
<p class="error">
- <strong><?php echo __d('cake', 'Error'); ?>: </strong>
+ <strong><?php echo __('Error'); ?>: </strong>
<?php printf(
- __d('cake', 'The requested address %s was not found on this server.'),
+ __('The requested address %s was not found on this server.'),
"<strong>'{$url}'</strong>"
); ?>
</p>
View
4 lib/Cake/View/Errors/error500.ctp
@@ -18,8 +18,8 @@
?>
<h2><?php echo $name; ?></h2>
<p class="error">
- <strong><?php echo __d('cake', 'Error'); ?>: </strong>
- <?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>
+ <strong><?php echo __('Error'); ?>: </strong>
+ <?php echo __('An Internal Error Has Occurred.'); ?>
</p>
<?php
if (Configure::read('debug') > 0 ):
View
1  lib/Cake/View/Helper/FormHelper.php
@@ -1638,6 +1638,7 @@ public function submit($caption = null, $options = array()) {
} else {
$url = $this->webroot(trim($caption, '/'));
}
+ $url = $this->assetTimestamp($url);
$tag = $this->Html->useTag('submitimage', $url, $options);
} else {
$options['value'] = $caption;
View
2  lib/Cake/View/Helper/NumberHelper.php
@@ -84,7 +84,7 @@ public function precision($number, $precision = 3) {
public function toReadableSize($size) {
switch (true) {
case $size < 1024:
- return __dn('cake', '%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:
View
48 lib/Cake/View/Helper/TimeHelper.php
@@ -80,19 +80,19 @@ public function convertSpecifiers($format, $time = null) {
protected function _translateSpecifier($specifier) {
switch ($specifier[1]) {
case 'a':
- $abday = __dc('cake', 'abday', 5);
+ $abday = __c('abday', 5);
if (is_array($abday)) {
return $abday[date('w', $this->__time)];
}
break;
case 'A':
- $day = __dc('cake', 'day', 5);
+ $day = __c('day', 5);
if (is_array($day)) {
return $day[date('w', $this->__time)];
}
break;
case 'c':
- $format = __dc('cake', '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 @@ protected function _translateSpecifier($specifier) {
return date('jS', $this->__time);
case 'b':
case 'h':
- $months = __dc('cake', 'abmon', 5);
+ $months = __c('abmon', 5);
if (is_array($months)) {
return $months[date('n', $this->__time) -1];
}
return '%b';
case 'B':
- $months = __dc('cake', 'mon', 5);
+ $months = __c('mon', 5);
if (is_array($months)) {
return $months[date('n', $this->__time) -1];
}
@@ -131,14 +131,14 @@ protected function _translateSpecifier($specifier) {
case 'P':
$default = array('am' => 0, 'pm' => 1);
$meridiem = $default[date('a',$this->__time)];
- $format = __dc('cake', '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('cake', '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 @@ protected function _translateSpecifier($specifier) {
case 'u':
return ($weekDay = date('w', $this->__time)) ? $weekDay : 7;
case 'x':
- $format = __dc('cake', 'd_fmt', 5);
+ $format = __c('d_fmt', 5);
if ($format != 'd_fmt') {
return $this->convertSpecifiers($format, $this->__time);
}
break;
case 'X':
- $format = __dc('cake', 't_fmt', 5);
+ $format = __c('t_fmt', 5);
if ($format != 't_fmt') {
return $this->convertSpecifiers($format, $this->__time);
}
@@ -613,33 +613,33 @@ public function timeAgoInWords($dateTime, $options = array()) {
} 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 ? ', ' : '') . __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('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 ? ', ' : '') . __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('cake', '%d week', '%d weeks', $weeks, $weeks);
- $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%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('cake', '%d day', '%d days', $days, $days);
- $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%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('cake', '%d hour', '%d hours', $hours, $hours);
- $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%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('cake', '%d minute', '%d minutes', $minutes, $minutes);
+ $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d minute', '%d minutes', $minutes, $minutes);
} else {
// seconds only
- $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d second', '%d seconds', $seconds, $seconds);
+ $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d second', '%d seconds', $seconds, $seconds);
}
if (!$backwards) {
View
16 lib/Cake/View/Scaffolds/form.ctp
@@ -20,32 +20,32 @@
<?php
echo $this->Form->create();
echo $this->Form->inputs($scaffoldFields, array('created', 'modified', 'updated'));
- echo $this->Form->end(__d('cake', 'Submit'));
+ echo $this->Form->end(__('Submit'));
?>
</div>
<div class="actions">
- <h3><?php echo __d('cake', 'Actions'); ?></h3>
+ <h3><?php echo __('Actions'); ?></h3>
<ul>
<?php if ($this->request->action != 'add'): ?>
<li><?php echo $this->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)));
?></li>
<?php endif;?>
- <li><?php echo $this->Html->link(__d('cake', 'List') . ' ' . $pluralHumanName, array('action' => 'index'));?></li>
+ <li><?php echo $this->Html->link(__('List') . ' ' . $pluralHumanName, array('action' => 'index'));?></li>
<?php
$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<li>" . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n";
- echo "\t\t<li>" . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
+ echo "\t\t<li>" . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n";
+ echo "\t\t<li>" . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
$done[] = $_details['controller'];
}
}
}
?>
</ul>
-</div>
+</div>
View
24 lib/Cake/View/Scaffolds/index.ctp
@@ -23,7 +23,7 @@
<?php foreach ($scaffoldFields as $_field):?>
<th><?php echo $this->Paginator->sort($_field);?></th>
<?php endforeach;?>
- <th><?php echo __d('cake', 'Actions');?></th>
+ <th><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
@@ -46,13 +46,13 @@ foreach (${$pluralVar} as ${$singularVar}):
}
echo '<td class="actions">';
- 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 '</td>';
echo '</tr>';
@@ -63,28 +63,28 @@ endforeach;
</table>
<p><?php
echo $this->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}')
));
?></p>
<div class="paging">
<?php
- echo $this->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'));
?>
</div>
</div>
<div class="actions">
- <h3><?php echo __d('cake', 'Actions'); ?></h3>
+ <h3><?php echo __('Actions'); ?></h3>
<ul>
- <li><?php echo $this->Html->link(__d('cake', 'New %s', $singularHumanName), array('action' => 'add')); ?></li>
+ <li><?php echo $this->Html->link(__('New %s', $singularHumanName), array('action' => 'add')); ?></li>
<?php
$done = array();
foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
- echo "<li>" . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>";
- echo "<li>" . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>";
+ echo "<li>" . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>";
+ echo "<li>" . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>";
$done[] = $_details['controller'];
}
}
View
30 lib/Cake/View/Scaffolds/view.ctp
@@ -17,7 +17,7 @@
*/
?>
<div class="<?php echo $pluralVar;?> view">
-<h2><?php echo __d('cake', 'View %s', $singularHumanName); ?></h2>
+<h2><?php echo __('View %s', $singularHumanName); ?></h2>
<dl>
<?php
$i = 0;
@@ -42,20 +42,20 @@ foreach ($scaffoldFields as $_field) {
</dl>
</div>
<div class="actions">
- <h3><?php echo __d('cake', 'Actions'); ?></h3>
+ <h3><?php echo __('Actions'); ?></h3>
<ul>
<?php
- echo "\t\t<li>" .$this->Html->link(__d('cake', 'Edit %s', $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " </li>\n";
- echo "\t\t<li>" .$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] . '?'). " </li>\n";
- echo "\t\t<li>" .$this->Html->link(__d('cake', 'List %s', $pluralHumanName), array('action' => 'index')). " </li>\n";
- echo "\t\t<li>" .$this->Html->link(__d('cake', 'New %s', $singularHumanName), array('action' => 'add')). " </li>\n";
+ echo "\t\t<li>" .$this->Html->link(__('Edit %s', $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " </li>\n";
+ echo "\t\t<li>" .$this->Html->link(__('Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). " </li>\n";
+ echo "\t\t<li>" .$this->Html->link(__('List %s', $pluralHumanName), array('action' => 'index')). " </li>\n";
+ echo "\t\t<li>" .$this->Html->link(__('New %s', $singularHumanName), array('action' => 'add')). " </li>\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<li>" . $this->Html->link(__d('cake', 'List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
- echo "\t\t<li>" . $this->Html->link(__d('cake', 'New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
+ echo "\t\t<li>" . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
+ echo "\t\t<li>" . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
$done[] = $_details['controller'];
}
}
@@ -67,7 +67,7 @@ foreach ($scaffoldFields as $_field) {
if (!empty($associations['hasOne'])) :
foreach ($associations['hasOne'] as $_alias => $_details): ?>
<div class="related">
- <h3><?php echo __d('cake', "Related %s", Inflector::humanize($_details['controller'])); ?></h3>
+ <h3><?php echo __("Related %s", Inflector::humanize($_details['controller'])); ?></h3>
<?php if (!empty(${$singularVar}[$_alias])):?>
<dl>
<?php
@@ -82,7 +82,7 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
<?php endif; ?>
<div class="actions">
<ul>
- <li><?php echo $this->Html->link(__d('cake', 'Edit %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'edit', ${$singularVar}[$_alias][$_details['primaryKey']]))."</li>\n";?>
+ <li><?php echo $this->Html->link(__('Edit %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'edit', ${$singularVar}[$_alias][$_details['primaryKey']]))."</li>\n";?>
</ul>
</div>
</div>
@@ -102,7 +102,7 @@ foreach ($relations as $_alias => $_details):
$otherSingularVar = Inflector::variable($_alias);
?>
<div class="related">
- <h3><?php echo __d('cake', "Related %s", Inflector::humanize($_details['controller'])); ?></h3>
+ <h3><?php echo __("Related %s", Inflector::humanize($_details['controller'])); ?></h3>
<?php if (!empty(${$singularVar}[$_alias])):?>
<table cellpadding="0" cellspacing="0">
<tr>
@@ -128,9 +128,9 @@ $otherSingularVar = Inflector::variable($_alias);
}
echo "\t\t\t<td class=\"actions\">\n";
- echo "\t\t\t\t" . $this->Html->link(__d('cake', 'View'), array('controller' => $_details['controller'], 'action' => 'view', ${$otherSingularVar}[$_details['primaryKey']])). "\n";
- echo "\t\t\t\t" . $this->Html->link(__d('cake', 'Edit'), array('controller' => $_details['controller'], 'action' => 'edit', ${$otherSingularVar}[$_details['primaryKey']])). "\n";
- echo "\t\t\t\t" . $this->Html->link(__d('cake', 'Delete'), array('controller' => $_details['controller'], 'action' => 'delete', ${$otherSingularVar}[$_details['primaryKey']]), null, __d('cake', 'Are you sure you want to delete', true).' #' . ${$otherSingularVar}[$_details['primaryKey']] . '?'). "\n";
+ echo "\t\t\t\t" . $this->Html->link(__('View'), array('controller' => $_details['controller'], 'action' => 'view', ${$otherSingularVar}[$_details['primaryKey