diff --git a/cake/basics.php b/cake/basics.php index 939529850..02e8250f7 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -387,7 +387,7 @@ if (!function_exists('array_combine')) { switch ($key) { case 'SCRIPT_FILENAME': - if (defined('SERVER_IIS') && SERVER_IIS === true){ + if (defined('SERVER_IIS') && SERVER_IIS === true) { return str_replace('\\\\', '\\', env('PATH_TRANSLATED')); } break; @@ -464,7 +464,7 @@ if (!function_exists('file_put_contents')) { $expires = strtotime($expires, $now); } - switch(low($target)) { + switch (low($target)) { case 'cache': $filename = CACHE . $path; break; diff --git a/cake/console/cake.php b/cake/console/cake.php index ee9520994..dd478bd31 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -383,19 +383,19 @@ class ShellDispatcher { */ function getInput($prompt, $options = null, $default = null) { if (!is_array($options)) { - $print_options = ''; + $printOptions = ''; } else { - $print_options = '(' . implode('/', $options) . ')'; + $printOptions = '(' . implode('/', $options) . ')'; } if ($default == null) { - $this->stdout($prompt . " $print_options \n" . '> ', false); + $this->stdout($prompt . " $printOptions \n" . '> ', false); } else { - $this->stdout($prompt . " $print_options \n" . "[$default] > ", false); + $this->stdout($prompt . " $printOptions \n" . "[$default] > ", false); } $result = fgets($this->stdin); - if ($result === false){ + if ($result === false) { exit; } $result = trim($result); @@ -454,7 +454,7 @@ class ShellDispatcher { } } - if($params['app'][0] == '/' || preg_match('/([a-z])(:)/i', $params['app'], $matches)) { + if ($params['app'][0] == '/' || preg_match('/([a-z])(:)/i', $params['app'], $matches)) { $params['root'] = dirname($params['app']); } elseif (strpos($params['app'], '/')) { $params['root'] .= '/' . dirname($params['app']); diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index 339410654..86666a360 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -199,7 +199,7 @@ class ApiShell extends Shell { $contents = $File->read(); if (preg_match_all('%(/\\*\\*[\\s\\S]*?\\*/)(\\s+function\\s+\\w+)(\\(.+\\))%', $contents, $result, PREG_PATTERN_ORDER)) { - foreach($result[2] as $key => $method) { + foreach ($result[2] as $key => $method) { $method = str_replace('function ', '', trim($method)); if (strpos($method, '__') === false && $method[0] != '_') { diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 51381c88b..8547fe59c 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -86,7 +86,7 @@ class BakeShell extends Shell { $this->out('[Q]uit'); $classToBake = strtoupper($this->in(__('What would you like to Bake?', true), array('D', 'M', 'V', 'C', 'P', 'Q'))); - switch($classToBake) { + switch ($classToBake) { case 'D': $this->DbConfig->execute(); break; diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 83c086805..ef1488809 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -95,7 +95,7 @@ class ConsoleShell extends Shell { $command = trim($this->in('')); } - switch($command) { + switch ($command) { case 'help': $this->out('Console help:'); $this->out('-------------'); diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php index 3597b66f0..00f498e22 100644 --- a/cake/console/libs/i18n.php +++ b/cake/console/libs/i18n.php @@ -80,7 +80,7 @@ class I18nShell extends Shell { $this->out(__('[Q]uit', true)); $choice = strtoupper($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q'))); - switch($choice) { + switch ($choice) { case 'E': $this->Extract->execute(); break; diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 402fa8970..6cc167f0c 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -264,7 +264,7 @@ class SchemaShell extends Shell { $table = $this->args[1]; } - switch($command) { + switch ($command) { case 'create': $this->__create($Schema, $table); break; @@ -372,7 +372,7 @@ class SchemaShell extends Shell { $db->fullDebug = true; $errors = array(); - foreach($contents as $table => $sql) { + foreach ($contents as $table => $sql) { if (empty($sql)) { $this->out(sprintf(__('%s is up to date.', true), $table)); } else { diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 596efb31e..4d4bc831d 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -143,7 +143,7 @@ class Shell extends Object { ClassRegistry::map($shellKey, $shellKey); if (!PHP5 && isset($this->args[0])) { - if(strpos($this->className, low(Inflector::camelize($this->args[0]))) !== false) { + if (strpos($this->className, low(Inflector::camelize($this->args[0]))) !== false) { $dispatch->shiftArgs(); } if (low($this->command) == low(Inflector::variable($this->args[0])) && method_exists($this, $this->command)) { @@ -348,7 +348,7 @@ class Shell extends Object { function out($string, $newline = true) { if (is_array($string)) { $str = ''; - foreach($string as $message) { + foreach ($string as $message) { $str .= $message ."\n"; } $string = $str; @@ -364,7 +364,7 @@ class Shell extends Object { function err($string) { if (is_array($string)) { $str = ''; - foreach($string as $message) { + foreach ($string as $message) { $str .= $message ."\n"; } $string = $str; diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index 090674e04..7969f4a00 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -280,7 +280,7 @@ class DbConfigTask extends Shell { $info['port'] = null; } - if($info['persistent'] === false) { + if ($info['persistent'] === false) { $info['persistent'] = 'false'; } else { $info['persistent'] = 'false'; diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index fcbf95745..05c458bca 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -411,7 +411,7 @@ class ModelTask extends Shell { if ($type === 'belongsTo') { $alias = 'Parent' . $associations[$type][$i]['alias']; } - if($type === 'hasOne' || $type === 'hasMany') { + if ($type === 'hasOne' || $type === 'hasMany') { $alias = 'Child' . $associations[$type][$i]['alias']; } diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index cc3050716..78c6aadc3 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -71,7 +71,7 @@ class PluginTask extends Shell { $plugin = null; - if(isset($this->args[0])) { + if (isset($this->args[0])) { $plugin = Inflector::camelize($this->args[0]); $pluginPath = Inflector::underscore($plugin) . DS; $this->Dispatch->shiftArgs(); @@ -87,7 +87,7 @@ class PluginTask extends Shell { } } - if(isset($this->args[0])) { + if (isset($this->args[0])) { $task = Inflector::classify($this->args[0]); $this->Dispatch->shiftArgs(); if (in_array($task, $this->tasks)) { diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index d3a81d38f..5642eb00a 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -77,7 +77,7 @@ class ProjectTask extends Shell { } } - if($this->bake($project)) { + if ($this->bake($project)) { $path = Folder::slashTerm($project); if ($this->createHome($path)) { $this->out(__('Welcome page created', true)); @@ -122,7 +122,7 @@ class ProjectTask extends Shell { * @access private */ function bake($path, $skel = null, $skip = array('empty')) { - if(!$skel) { + if (!$skel) { $skel = $this->params['skel']; } diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 5f1af2c5e..495957b93 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -375,7 +375,7 @@ class ViewTask extends Shell { $keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); $associations = array(); - foreach ($keys as $key => $type){ + foreach ($keys as $key => $type) { foreach ($model->{$type} as $assocKey => $assocData) { $associations[$type][$assocKey]['primaryKey'] = $model->{$assocKey}->primaryKey; $associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField; diff --git a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp index 30ca306d4..cf97359a2 100644 --- a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp +++ b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp @@ -27,7 +27,7 @@ ' . $line . '

'; endforeach; ?> \ No newline at end of file diff --git a/cake/console/libs/templates/views/form.ctp b/cake/console/libs/templates/views/form.ctp index 4400fac45..2812f3812 100644 --- a/cake/console/libs/templates/views/form.ctp +++ b/cake/console/libs/templates/views/form.ctp @@ -37,7 +37,7 @@ echo "\t\techo \$form->input('{$field}');\n"; } } - if(!empty($associations['hasAndBelongsToMany'])) { + if (!empty($associations['hasAndBelongsToMany'])) { foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) { echo "\t\techo \$form->input('{$assocName}');\n"; } @@ -58,7 +58,7 @@ $data) { - foreach($data as $alias => $details) { + foreach ($data as $alias => $details) { if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { echo "\t\t
  • link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?>
  • \n"; echo "\t\t
  • link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?>
  • \n"; diff --git a/cake/console/libs/templates/views/home.ctp b/cake/console/libs/templates/views/home.ctp index ecd1bc255..39020d488 100644 --- a/cake/console/libs/templates/views/home.ctp +++ b/cake/console/libs/templates/views/home.ctp @@ -2,7 +2,7 @@ $output = "

    Sweet, \"".Inflector::humanize($app)."\" got Baked by CakePHP!

    \n"; $output .=" 0): +if (Configure::read() > 0): Debugger::checkSessionKey(); endif; ?> diff --git a/cake/console/libs/templates/views/index.ctp b/cake/console/libs/templates/views/index.ctp index 135d56075..38739ede9 100644 --- a/cake/console/libs/templates/views/index.ctp +++ b/cake/console/libs/templates/views/index.ctp @@ -52,16 +52,16 @@ foreach (\${$pluralVar} as \${$singularVar}): echo "\t>\n"; foreach ($fields as $field) { $isKey = false; - if(!empty($associations['belongsTo'])) { + if (!empty($associations['belongsTo'])) { foreach ($associations['belongsTo'] as $alias => $details) { - if($field === $details['foreignKey']) { + if ($field === $details['foreignKey']) { $isKey = true; echo "\t\t\n\t\t\tlink(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller'=> '{$details['controller']}', 'action'=>'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\n"; break; } } } - if($isKey !== true) { + if ($isKey !== true) { echo "\t\t\n\t\t\t\n\t\t\n"; } } @@ -88,7 +88,7 @@ echo "\n"; $data) { - foreach($data as $alias => $details) { + foreach ($data as $alias => $details) { if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { echo "\t\t
  • link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?>
  • \n"; echo "\t\t
  • link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?>
  • \n"; diff --git a/cake/console/libs/templates/views/view.ctp b/cake/console/libs/templates/views/view.ctp index 9b0281f95..d361e019a 100644 --- a/cake/console/libs/templates/views/view.ctp +++ b/cake/console/libs/templates/views/view.ctp @@ -30,9 +30,9 @@ $details) { - if($field === $details['foreignKey']) { + if ($field === $details['foreignKey']) { $isKey = true; echo "\t\t>\n"; echo "\t\t>\n\t\t\tlink(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller'=> '{$details['controller']}', 'action'=>'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t \n\t\t\n"; @@ -40,7 +40,7 @@ foreach ($fields as $field) { } } } - if($isKey !== true) { + if ($isKey !== true) { echo "\t\t>\n"; echo "\t\t>\n\t\t\t\n\t\t\t \n\t\t\n"; } @@ -58,7 +58,7 @@ foreach ($fields as $field) { $done = array(); foreach ($associations as $type => $data) { - foreach($data as $alias => $details) { + foreach ($data as $alias => $details) { if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { echo "\t\t
  • link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?>
  • \n"; echo "\t\t
  • link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?>
  • \n"; @@ -70,7 +70,7 @@ foreach ($fields as $field) { $details): ?> $_details): ?>