Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CakeEmail fixes for Japanese encoding #268

Merged
merged 31 commits into from Oct 22, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2bb9376
fixing typos
rchavik Oct 18, 2011
a60d71d
removing 'empty' files from nonempty directories
rchavik Oct 19, 2011
fb4a003
Merge pull request #257 from rchavik/etc
lorenzo Oct 19, 2011
33c21b3
fixed: change test property CakeEmail::charset to CakeEmail::headerCh…
suzuki Oct 19, 2011
646b8f1
Fixed issue when using multiple extensions in Router::parseExtensions…
renan Oct 19, 2011
d1be66f
Fixing failing test introduced in fb4a003522c2dd9b05305fc3d39316b7fc5…
renan Oct 19, 2011
fe9762d
Making the test assert what it is intended to assert.
renan Oct 19, 2011
f361509
Fixed failing smtp tests when testing on host other then hardcoded 'l…
majna Oct 19, 2011
6177203
Merge pull request #264 from majna/2.0-smtp-test
ADmad Oct 19, 2011
6d51ce5
Revert "Fixed failing smtp tests when testing on host other then hard…
ADmad Oct 19, 2011
d666d61
Improving the upgrade shell by adding more renaming rules and making …
lorenzo Oct 19, 2011
3735c7d
Merge branch '2.0' of github.com:cakephp/cakephp into 2.0
lorenzo Oct 19, 2011
a02fd82
display offending model and column
rchavik Oct 19, 2011
714e281
Merge pull request #261 from rchavik/misc
markstory Oct 20, 2011
bad8197
Update CommandListShell to give better help.
markstory Oct 20, 2011
7a4aa40
Adding backwards compatible plugin syntax.
markstory Oct 20, 2011
30504ef
Enable Asset timestamp for image submit buttons.
johannesnagl Oct 17, 2011
edfb088
Adding test for form->submit() and timestamps.
markstory Oct 20, 2011
7c70b37
Removing the rest of the 'cake' domain.
markstory Oct 20, 2011
25e9aaf
Removing the remaining cake domain translations.
markstory Oct 20, 2011
535b45b
Fix strict warnings on Validation class.
markstory Oct 20, 2011
71a55f5
Fixing incorrect translation usage.
markstory Oct 20, 2011
a7404e8
Remove more incorrect __d() calls.
markstory Oct 20, 2011
9f80004
Remove unused parameter.
markstory Oct 21, 2011
d9e8b3b
Parsing every parameter until there is no more. Good to have alias bu…
renan Oct 21, 2011
4d795a7
ensure SmtpTransportTest passes, always use localhost as hostname
ceeram Oct 21, 2011
7e89442
Make App::_loadVendor() static.
markstory Oct 22, 2011
fe9e595
Fix issue with postgres and virtualFields
markstory Oct 22, 2011
5765946
Merge remote-tracking branch 'predominant/2.0' into 2.0
predominant Oct 22, 2011
51dd024
Merge remote-tracking branch 'origin/2.0' into 2.0
predominant Oct 22, 2011
7ed6e04
Changed getContentTransferEncoding to protected
predominant Oct 22, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file removed app/Console/Command/empty
Empty file.
Empty file removed app/Test/Case/Controller/empty
Empty file.
Empty file removed app/Test/Case/Model/empty
Empty file.
2 changes: 1 addition & 1 deletion app/webroot/css/cake.generic.css
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion app/webroot/index.php
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Cache/Cache.php
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/Console/Command/CommandListShell.php
Expand Up @@ -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);
}

Expand Down
38 changes: 24 additions & 14 deletions lib/Cake/Console/Command/UpgradeShell.php
Expand Up @@ -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',
Expand All @@ -156,26 +159,28 @@ 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);
}
}
}
}
$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',
);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Console/ShellDispatcher.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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];
Expand Down
Empty file.
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion lib/Cake/Console/Templates/skel/webroot/index.php
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component.php
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/AuthComponent.php
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/RequestHandlerComponent.php
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Scaffold.php
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Core/App.php
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Core/CakePlugin.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/BehaviorCollection.php
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/CakeSchema.php
Expand Up @@ -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']];
Expand Down
7 changes: 5 additions & 2 deletions lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -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
Expand All @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Model/Model.php
Expand Up @@ -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
Expand Down Expand Up @@ -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()
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/ModelBehavior.php
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions lib/Cake/Network/Email/CakeEmail.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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[] = '';
}
}
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion 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.
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Routing/Router.php
Expand Up @@ -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.
*
Expand Down