";?>
@@ -93,10 +93,10 @@ if(!empty($associations['hasOne'])) :
$params['plugin'],
'action'=> $params['controller'],
@@ -688,7 +688,7 @@ class Dispatcher extends Object {
readfile($assetFile);
}
- if(Configure::read('Asset.compress')) {
+ if (Configure::read('Asset.compress')) {
ob_end_flush();
}
return true;
diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php
index 469e69dde..d1909a97a 100644
--- a/cake/libs/cache/file.php
+++ b/cake/libs/cache/file.php
@@ -84,7 +84,7 @@ class FileEngine extends CacheEngine {
),
$settings
));
- if(!isset($this->__File)) {
+ if (!isset($this->__File)) {
if (!class_exists('File')) {
require LIBS . 'file.php';
}
@@ -96,7 +96,7 @@ class FileEngine extends CacheEngine {
}
$this->settings['path'] = $this->__File->Folder->cd($this->settings['path']);
- if(empty($this->settings['path'])) {
+ if (empty($this->settings['path'])) {
return false;
}
return $this->__active();
@@ -124,7 +124,7 @@ class FileEngine extends CacheEngine {
return false;
}
- if($this->__setKey($key) === false) {
+ if ($this->__setKey($key) === false) {
return false;
}
@@ -159,7 +159,7 @@ class FileEngine extends CacheEngine {
* @access public
*/
function read($key) {
- if($this->__setKey($key) === false || !$this->__init || !$this->__File->exists()) {
+ if ($this->__setKey($key) === false || !$this->__init || !$this->__File->exists()) {
return false;
}
if ($this->settings['lock']) {
@@ -192,7 +192,7 @@ class FileEngine extends CacheEngine {
* @access public
*/
function delete($key) {
- if($this->__setKey($key) === false || !$this->__init) {
+ if ($this->__setKey($key) === false || !$this->__init) {
return false;
}
return $this->__File->delete();
@@ -214,7 +214,7 @@ class FileEngine extends CacheEngine {
$threshold = $now - $this->settings['duration'];
}
while (($entry = $dir->read()) !== false) {
- if($this->__setKey($entry) === false) {
+ if ($this->__setKey($entry) === false) {
continue;
}
if ($check) {
diff --git a/cake/libs/configure.php b/cake/libs/configure.php
index ef34d1633..3c71bf761 100644
--- a/cake/libs/configure.php
+++ b/cake/libs/configure.php
@@ -232,7 +232,7 @@ class Configure extends Object {
if (!$suffix) {
return $contents[0];
} else {
- foreach($contents[1] as $item) {
+ foreach ($contents[1] as $item) {
if (substr($item, - strlen($suffix)) === $suffix) {
if ($extension) {
$items[] = $item;
diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php
index 86f9326b6..4cd54130a 100644
--- a/cake/libs/controller/components/acl.php
+++ b/cake/libs/controller/components/acl.php
@@ -292,7 +292,7 @@ class DbAcl extends AclBase {
return true;
}
} else {
- switch($perm['_' . $action]) {
+ switch ($perm['_' . $action]) {
case -1:
return false;
case 0:
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 68a685830..321cb11b1 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -283,7 +283,7 @@ class AuthComponent extends Object {
$keys = array('pass', 'named', 'controller', 'action', 'plugin');
$url = array();
- foreach($keys as $key) {
+ foreach ($keys as $key) {
if (!empty($params[$key])) {
if (is_array($params[$key])) {
foreach ($params[$key] as $name => $value) {
@@ -491,7 +491,7 @@ class AuthComponent extends Object {
case 'model':
$this->mapActions();
$action = $this->params['action'];
- if(isset($this->actionMap[$action])) {
+ if (isset($this->actionMap[$action])) {
$action = $this->actionMap[$action];
}
if (is_string($object)) {
@@ -507,7 +507,7 @@ class AuthComponent extends Object {
}
if (method_exists($object, 'isAuthorized')) {
$valid = $object->isAuthorized($user, $this->action(':controller'), $action);
- } elseif ($object){
+ } elseif ($object) {
trigger_error(sprintf(__('%s::isAuthorized() is not defined.', true), get_class($object)), E_USER_WARNING);
}
break;
diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php
index bd1babf95..2b8f8da22 100644
--- a/cake/libs/controller/components/cookie.php
+++ b/cake/libs/controller/components/cookie.php
@@ -247,7 +247,7 @@ class CookieComponent extends Object {
if (count($name) > 1) {
if (isset($this->__values[$name[0]])) {
- if(isset($this->__values[$name[0]][$name[1]])) {
+ if (isset($this->__values[$name[0]][$name[1]])) {
return $this->__values[$name[0]][$name[1]];
}
}
diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php
index 8c25e1e5d..d16638da2 100644
--- a/cake/libs/controller/components/email.php
+++ b/cake/libs/controller/components/email.php
@@ -574,7 +574,7 @@ class EmailComponent extends Object{
}
foreach ($lines as $line) {
- if(substr($line, 0, 1) == '.') {
+ if (substr($line, 0, 1) == '.') {
$line = '.' . $line;
}
$formatted = array_merge($formatted, explode("\n", wordwrap($line, $this->lineLength, "\n", true)));
diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php
index 0d6dd77de..478776fee 100644
--- a/cake/libs/controller/components/request_handler.php
+++ b/cake/libs/controller/components/request_handler.php
@@ -389,13 +389,13 @@ class RequestHandlerComponent extends Object {
*/
function getReferrer() {
if (env('HTTP_HOST') != null) {
- $sess_host = env('HTTP_HOST');
+ $sessHost = env('HTTP_HOST');
}
if (env('HTTP_X_FORWARDED_HOST') != null) {
- $sess_host = env('HTTP_X_FORWARDED_HOST');
+ $sessHost = env('HTTP_X_FORWARDED_HOST');
}
- return trim(preg_replace('/(?:\:.*)/', '', $sess_host));
+ return trim(preg_replace('/(?:\:.*)/', '', $sessHost));
}
/**
* Gets remote client IP
diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php
index 670b07c4c..e0414eec2 100644
--- a/cake/libs/controller/scaffold.php
+++ b/cake/libs/controller/scaffold.php
@@ -260,11 +260,11 @@ class Scaffold extends Object {
if ($this->controller->_beforeScaffold($action)) {
if ($action == 'edit') {
- if(isset($params['pass'][0])) {
+ if (isset($params['pass'][0])) {
$this->ScaffoldModel->id = $params['pass'][0];
}
- if(!$this->ScaffoldModel->exists()) {
+ if (!$this->ScaffoldModel->exists()) {
if (isset($this->controller->Session) && $this->controller->Session->valid() != false) {
$this->controller->Session->setFlash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey)));
$this->controller->redirect($this->redirect);
@@ -394,7 +394,7 @@ class Scaffold extends Object {
if (!empty($admin)) {
$params['action'] = str_replace($admin . '_', '', $params['action']);
}
- switch($params['action']) {
+ switch ($params['action']) {
case 'index':
$this->__scaffoldIndex($params);
break;
@@ -440,7 +440,7 @@ class Scaffold extends Object {
$keys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
$associations = array();
- foreach ($keys as $key => $type){
+ foreach ($keys as $key => $type) {
foreach ($this->ScaffoldModel->{$type} as $assocKey => $assocData) {
$associations[$type][$assocKey]['primaryKey'] = $this->ScaffoldModel->{$assocKey}->primaryKey;
$associations[$type][$assocKey]['displayField'] = $this->ScaffoldModel->{$assocKey}->displayField;
diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php
index 237be523b..2cd2d6edc 100644
--- a/cake/libs/debugger.php
+++ b/cake/libs/debugger.php
@@ -367,7 +367,7 @@ class Debugger extends Object {
*/
function exportVar($var, $recursion = 0) {
$_this = Debugger::getInstance();
- switch(strtolower(gettype($var))) {
+ switch (strtolower(gettype($var))) {
case 'boolean':
return ($var) ? 'true' : 'false';
break;
@@ -420,12 +420,12 @@ class Debugger extends Object {
function __object($var) {
$out = array();
- if(is_object($var)) {
+ if (is_object($var)) {
$className = get_class($var);
$objectVars = get_object_vars($var);
- foreach($objectVars as $key => $value) {
- if(is_object($value)) {
+ foreach ($objectVars as $key => $value) {
+ if (is_object($value)) {
$value = get_class($value) . ' object';
} elseif (is_array($value)) {
$value = 'array';
diff --git a/cake/libs/error.php b/cake/libs/error.php
index 91bf6b800..719a330f0 100644
--- a/cake/libs/error.php
+++ b/cake/libs/error.php
@@ -110,9 +110,9 @@ class ErrorHandler extends Object {
}
if ($method !== 'error') {
- if (Configure::read() == 0){
+ if (Configure::read() == 0) {
$method = 'error404';
- if(isset($code) && $code == 500) {
+ if (isset($code) && $code == 500) {
$method = 'error500';
}
}
diff --git a/cake/libs/file.php b/cake/libs/file.php
index ff71eb7b8..d23d738d1 100644
--- a/cake/libs/file.php
+++ b/cake/libs/file.php
@@ -234,8 +234,8 @@ class File extends Object {
function write($data, $mode = 'w', $force = false) {
$success = false;
if ($this->open($mode, $force) === true) {
- if($this->lock !== null) {
- if(flock($this->handle, LOCK_EX) === false) {
+ if ($this->lock !== null) {
+ if (flock($this->handle, LOCK_EX) === false) {
return false;
}
}
diff --git a/cake/libs/folder.php b/cake/libs/folder.php
index fda62d9af..022653cce 100644
--- a/cake/libs/folder.php
+++ b/cake/libs/folder.php
@@ -125,9 +125,9 @@ class Folder extends Object {
return $this->path;
}
/**
- * Change directory to $desired_path.
+ * Change directory to $path.
*
- * @param string $desired_path Path to the directory to change to
+ * @param string $path Path to the directory to change to
* @return string The new path. Returns false on failure
* @access public
*/
@@ -189,12 +189,12 @@ class Folder extends Object {
* @return array Files that match given pattern
* @access public
*/
- function find($regexp_pattern = '.*', $sort = false) {
+ function find($regexpPattern = '.*', $sort = false) {
list($dirs, $files) = $this->read($sort);
$found = array();
foreach ($files as $file) {
- if (preg_match("/^{$regexp_pattern}$/i", $file)) {
+ if (preg_match("/^{$regexpPattern}$/i", $file)) {
$found[] = $file;
}
}
@@ -536,9 +536,9 @@ class Folder extends Object {
$path = $this->slashTerm($path);
if (is_dir($path) === true) {
$files = glob($path . "*", GLOB_NOSORT);
- $normal_files = glob($path . "*");
- $hidden_files = glob($path . "\.?*");
- $files = array_merge($normal_files, $hidden_files);
+ $normalFiles = glob($path . "*");
+ $hiddenFiles = glob($path . "\.?*");
+ $files = array_merge($normalFiles, $hiddenFiles);
if (is_array($files)) {
foreach ($files as $file) {
if (preg_match("/(\.|\.\.)$/", $file)) {
diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php
index 500a2dc40..89d4be2b2 100644
--- a/cake/libs/inflector.php
+++ b/cake/libs/inflector.php
@@ -417,10 +417,10 @@ class Inflector extends Object {
return $replace;
}
/**
- * Returns an underscore-syntaxed ($like_this_dear_reader) version of the $camel_cased_word.
+ * Returns an underscore-syntaxed (like_this_dear_reader) version of the $camel_cased_word.
*
- * @param string $camel_cased_word Camel-cased word to be "underscorized"
- * @return string Underscore-syntaxed version of the $camel_cased_word
+ * @param string $camelCasedWord Camel-cased word to be "underscorized"
+ * @return string Underscore-syntaxed version of the $camelCasedWord
* @access public
* @static
*/
@@ -442,9 +442,9 @@ class Inflector extends Object {
return $replace;
}
/**
- * Returns corresponding table name for given $class_name. ("posts" for the model class "Post").
+ * Returns corresponding table name for given $className. ("posts" for the model class "Post").
*
- * @param string $class_name Name of class to get database table name for
+ * @param string $className Name of class to get database table name for
* @return string Name of the database table for given class
* @access public
* @static
diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php
index 698c17299..4f54df93c 100644
--- a/cake/libs/magic_db.php
+++ b/cake/libs/magic_db.php
@@ -245,7 +245,7 @@ class MagicFileResource extends Object{
* @access public
*/
function read($length = null) {
- if (!is_object($this->resource)){
+ if (!is_object($this->resource)) {
return substr($this->resource, $this->offset, $length);
}
return $this->resource->read($length);
diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php
index 63f4039d3..56e27f1e8 100644
--- a/cake/libs/model/behaviors/containable.php
+++ b/cake/libs/model/behaviors/containable.php
@@ -129,7 +129,7 @@ class ContainableBehavior extends ModelBehavior {
}
if ($contain) {
$backupBindings = array();
- foreach($this->types as $relation) {
+ foreach ($this->types as $relation) {
$backupBindings[$relation] = $instance->{$relation};
}
foreach ($this->types as $type) {
@@ -180,16 +180,16 @@ class ContainableBehavior extends ModelBehavior {
$query['fields'] = (array)$query['fields'];
if (!empty($Model->belongsTo)) {
- foreach($Model->belongsTo as $assoc => $data) {
+ foreach ($Model->belongsTo as $assoc => $data) {
if (!empty($data['fields'])) {
- foreach((array) $data['fields'] as $field) {
+ foreach ((array) $data['fields'] as $field) {
$query['fields'][] = (strpos($field, '.') === false ? $assoc . '.' : '') . $field;
}
}
}
}
if (!empty($mandatory[$Model->alias])) {
- foreach($mandatory[$Model->alias] as $field) {
+ foreach ($mandatory[$Model->alias] as $field) {
if ($field == '--primaryKey--') {
$field = $Model->primaryKey;
} else if (preg_match('/^.+\.\-\-[^-]+\-\-$/', $field)) {
@@ -213,7 +213,7 @@ class ContainableBehavior extends ModelBehavior {
*/
function afterFind(&$Model, $results, $primary) {
if (!empty($Model->__backContainableAssociation)) {
- foreach($Model->__backContainableAssociation as $relation => $bindings) {
+ foreach ($Model->__backContainableAssociation as $relation => $bindings) {
$Model->{$relation} = $bindings;
unset($Model->__backContainableAssociation);
}
@@ -250,7 +250,7 @@ class ContainableBehavior extends ModelBehavior {
if (!empty($Model->__backInnerAssociation)) {
$assocs = $Model->__backInnerAssociation;
unset($Model->__backInnerAssociation);
- foreach($assocs as $currentModel) {
+ foreach ($assocs as $currentModel) {
$this->resetBindings($Model->$currentModel);
}
}
@@ -370,9 +370,9 @@ class ContainableBehavior extends ModelBehavior {
*/
function fieldDependencies(&$Model, $map, $fields = array()) {
if ($fields === false) {
- foreach($map as $parent => $children) {
- foreach($children as $type => $bindings) {
- foreach($bindings as $dependency) {
+ foreach ($map as $parent => $children) {
+ foreach ($children as $type => $bindings) {
+ foreach ($bindings as $dependency) {
if ($type == 'hasAndBelongsToMany') {
$fields[$parent][] = '--primaryKey--';
} else if ($type == 'belongsTo') {
@@ -386,10 +386,10 @@ class ContainableBehavior extends ModelBehavior {
if (empty($map[$Model->alias])) {
return $fields;
}
- foreach($map[$Model->alias] as $type => $bindings) {
- foreach($bindings as $dependency) {
+ foreach ($map[$Model->alias] as $type => $bindings) {
+ foreach ($bindings as $dependency) {
$innerFields = array();
- switch($type) {
+ switch ($type) {
case 'belongsTo':
$fields[] = $Model->{$type}[$dependency]['foreignKey'];
break;
diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php
index d7caab232..c651f5ae0 100644
--- a/cake/libs/model/behaviors/tree.php
+++ b/cake/libs/model/behaviors/tree.php
@@ -754,7 +754,7 @@ class TreeBehavior extends ModelBehavior {
if (is_null($instance[$model->alias][$left]) || is_null($instance[$model->alias][$right])) {
$errors[] = array('node', $instance[$model->alias][$model->primaryKey],
'has invalid left or right values');
- } elseif ($instance[$model->alias][$left] == $instance[$model->alias][$right]){
+ } elseif ($instance[$model->alias][$left] == $instance[$model->alias][$right]) {
$errors[] = array('node', $instance[$model->alias][$model->primaryKey],
'left and right values identical');
} elseif ($instance[$model->alias][$parent]) {
diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php
index 2b61965a3..f9809935f 100644
--- a/cake/libs/model/datasources/datasource.php
+++ b/cake/libs/model/datasources/datasource.php
@@ -411,7 +411,7 @@ class DataSource extends Object {
$val = null;
if (strpos($query, $key) !== false) {
- switch($key) {
+ switch ($key) {
case '{$__cakeID__$}':
if (isset($data[$model->alias]) || isset($data[$association])) {
if (isset($data[$model->alias][$model->primaryKey])) {
diff --git a/cake/libs/model/datasources/dbo/dbo_db2.php b/cake/libs/model/datasources/dbo/dbo_db2.php
index 53c365c25..94cef4c85 100644
--- a/cake/libs/model/datasources/dbo/dbo_db2.php
+++ b/cake/libs/model/datasources/dbo/dbo_db2.php
@@ -118,7 +118,7 @@ class DboDb2 extends DboSource {
if ($config['cataloged']) {
$this->connection = $connect($config['database'], $config['login'], $config['password']);
} else {
- $conn_string = sprintf(
+ $connString = sprintf(
"DRIVER={IBM DB2 ODBC DRIVER};DATABASE=%s;HOSTNAME=%s;PORT=%d;PROTOCOL=TCPIP;UID=%s;PWD=%s;",
$config['database'],
$config['hostname'],
@@ -126,7 +126,7 @@ class DboDb2 extends DboSource {
$config['login'],
$config['password']
);
- $this->connection = db2_connect($conn_string, '', '');
+ $this->connection = db2_connect($connString, '', '');
}
if ($this->connection) {
@@ -161,15 +161,15 @@ class DboDb2 extends DboSource {
// get result from db
$result = db2_exec($this->connection, $sql);
- if(!is_bool($result)){
+ if (!is_bool($result)) {
// build table/column map for this result
$map = array();
- $num_fields = db2_num_fields($result);
+ $numFields = db2_num_fields($result);
$index = 0;
$j = 0;
$offset = 0;
- while ($j < $num_fields) {
+ while ($j < $numFields) {
$columnName = strtolower(db2_field_name($result, $j));
$tmp = strpos($sql, '.' . $columnName, $offset);
$tableName = substr($sql, $offset, ($tmp-$offset));
diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php
index 8acc0b433..36005de30 100644
--- a/cake/libs/model/datasources/dbo/dbo_mssql.php
+++ b/cake/libs/model/datasources/dbo/dbo_mssql.php
@@ -265,7 +265,7 @@ class DboMssql extends DboSource {
return "''";
}
- switch($column) {
+ switch ($column) {
case 'boolean':
$data = $this->boolean((bool)$data);
break;
@@ -500,11 +500,11 @@ class DboMssql extends DboSource {
function resultSet(&$results) {
$this->results =& $results;
$this->map = array();
- $num_fields = mssql_num_fields($results);
+ $numFields = mssql_num_fields($results);
$index = 0;
$j = 0;
- while ($j < $num_fields) {
+ while ($j < $numFields) {
$column = mssql_field_name($results, $j);
if (strpos($column, '__')) {
diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php
index db9acc608..93a80aa24 100644
--- a/cake/libs/model/datasources/dbo/dbo_mysql.php
+++ b/cake/libs/model/datasources/dbo/dbo_mysql.php
@@ -203,7 +203,7 @@ class DboMysql extends DboSource {
'default' => $column[0]['Default'],
'length' => $this->length($column[0]['Type']),
);
- if(!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) {
+ if (!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) {
$fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']];
}
}
@@ -436,11 +436,11 @@ class DboMysql extends DboSource {
}
$this->results =& $results;
$this->map = array();
- $num_fields = mysql_num_fields($results);
+ $numFields = mysql_num_fields($results);
$index = 0;
$j = 0;
- while ($j < $num_fields) {
+ while ($j < $numFields) {
$column = mysql_fetch_field($results,$j);
if (!empty($column->table)) {
@@ -510,15 +510,15 @@ class DboMysql extends DboSource {
function index($model) {
$index = array();
$table = $this->fullTableName($model);
- if($table) {
+ if ($table) {
$indexes = $this->query('SHOW INDEX FROM ' . $table);
$keys = Set::extract($indexes, '{n}.STATISTICS');
foreach ($keys as $i => $key) {
- if(!isset($index[$key['Key_name']])) {
+ if (!isset($index[$key['Key_name']])) {
$index[$key['Key_name']]['column'] = $key['Column_name'];
$index[$key['Key_name']]['unique'] = intval($key['Non_unique'] == 0);
} else {
- if(!is_array($index[$key['Key_name']]['column'])) {
+ if (!is_array($index[$key['Key_name']]['column'])) {
$col[] = $index[$key['Key_name']]['column'];
}
$col[] = $key['Column_name'];
@@ -535,35 +535,35 @@ class DboMysql extends DboSource {
* @return unknown
*/
function alterSchema($compare, $table = null) {
- if(!is_array($compare)) {
+ if (!is_array($compare)) {
return false;
}
$out = '';
$colList = array();
- foreach($compare as $curTable => $types) {
+ foreach ($compare as $curTable => $types) {
if (!$table || $table == $curTable) {
$out .= 'ALTER TABLE ' . $this->fullTableName($curTable) . " \n";
- foreach($types as $type => $column) {
- switch($type) {
+ foreach ($types as $type => $column) {
+ switch ($type) {
case 'add':
- foreach($column as $field => $col) {
+ foreach ($column as $field => $col) {
$col['name'] = $field;
$alter = 'ADD '.$this->buildColumn($col);
- if(isset($col['after'])) {
+ if (isset($col['after'])) {
$alter .= ' AFTER '. $this->name($col['after']);
}
$colList[] = $alter;
}
break;
case 'drop':
- foreach($column as $field => $col) {
+ foreach ($column as $field => $col) {
$col['name'] = $field;
$colList[] = 'DROP '.$this->name($field);
}
break;
case 'change':
- foreach($column as $field => $col) {
- if(!isset($col['name'])) {
+ foreach ($column as $field => $col) {
+ if (!isset($col['name'])) {
$col['name'] = $field;
}
$colList[] = 'CHANGE '. $this->name($field).' '.$this->buildColumn($col);
diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php
index a6c011a97..d1222e4ba 100644
--- a/cake/libs/model/datasources/dbo/dbo_mysqli.php
+++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -159,7 +159,7 @@ class DboMysqli extends DboSource {
$firstResult = mysqli_store_result($this->connection);
if (mysqli_more_results($this->connection)) {
- while($lastResult = mysqli_next_result($this->connection));
+ while ($lastResult = mysqli_next_result($this->connection));
}
return $firstResult;
}
@@ -215,7 +215,7 @@ class DboMysqli extends DboSource {
'default' => $column[0]['Default'],
'length' => $this->length($column[0]['Type'])
);
- if(!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) {
+ if (!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) {
$fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']];
}
}
@@ -412,10 +412,10 @@ class DboMysqli extends DboSource {
}
$this->results =& $results;
$this->map = array();
- $num_fields = mysqli_num_fields($results);
+ $numFields = mysqli_num_fields($results);
$index = 0;
$j = 0;
- while ($j < $num_fields) {
+ while ($j < $numFields) {
$column = mysqli_fetch_field_direct($results, $j);
if (!empty($column->table)) {
$this->map[$index++] = array($column->table, $column->name);
diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php
index ff402c8c5..3bf605f82 100644
--- a/cake/libs/model/datasources/dbo/dbo_sqlite.php
+++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php
@@ -199,7 +199,7 @@ class DboSqlite extends DboSource {
'default' => $column[0]['dflt_value'],
'length' => $this->length($column[0]['type'])
);
- if($column[0]['pk'] == 1) {
+ if ($column[0]['pk'] == 1) {
$fields[$column[0]['name']] = array(
'type' => $fields[$column[0]['name']]['type'],
'null' => false,
diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php
index 1727bb162..aae008b59 100644
--- a/cake/libs/model/datasources/dbo_source.php
+++ b/cake/libs/model/datasources/dbo_source.php
@@ -345,7 +345,7 @@ class DboSource extends DataSource {
$out = array();
$first = $this->fetchRow();
- if ($first != null){
+ if ($first != null) {
$out[] = $first;
}
while ($this->hasResult() && $item = $this->fetchResult()) {
@@ -397,7 +397,7 @@ class DboSource extends DataSource {
$data = (array)$data;
$count = count($data);
- for($i = 0; $i < $count; $i++) {
+ for ($i = 0; $i < $count; $i++) {
if ($data[$i] == '*') {
continue;
}
@@ -841,7 +841,7 @@ class DboSource extends DataSource {
if ($type == 'hasAndBelongsToMany') {
$uniqueIds = $merge = array();
- foreach($fetch as $j => $data) {
+ foreach ($fetch as $j => $data) {
if (
(isset($data[$with]) && $data[$with][$foreignKey] === $row[$model->alias][$model->primaryKey]) &&
(!in_array($data[$with][$joinKeys[1]], $uniqueIds))
@@ -1074,7 +1074,7 @@ class DboSource extends DataSource {
}
$assocData['limit'] = $this->limit($assocData['limit'], $assocData['offset']);
- switch($type) {
+ switch ($type) {
case 'hasOne':
case 'belongsTo':
$conditions = $this->__mergeConditions(
diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php
index 5ab4c9168..eb8fba876 100644
--- a/cake/libs/model/db_acl.php
+++ b/cake/libs/model/db_acl.php
@@ -63,7 +63,7 @@ class AclNode extends AppModel {
*/
function __construct() {
$config = Configure::read('Acl.database');
- if(isset($config)) {
+ if (isset($config)) {
$this->useDbConfig = $config;
}
parent::__construct();
diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php
index 5f443335e..6d4773de5 100644
--- a/cake/libs/model/model.php
+++ b/cake/libs/model/model.php
@@ -593,7 +593,7 @@ class Model extends Overloadable {
* @access private
*/
function __constructLinkedModel($assoc, $className = null) {
- if(empty($className)) {
+ if (empty($className)) {
$className = $assoc;
}
@@ -626,7 +626,7 @@ class Model extends Overloadable {
if (!isset($this->{$type}[$assocKey][$key]) || $this->{$type}[$assocKey][$key] === null) {
$data = '';
- switch($key) {
+ switch ($key) {
case 'fields':
$data = '';
break;
diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php
index 8f143fda1..fd8044005 100644
--- a/cake/libs/model/schema.php
+++ b/cake/libs/model/schema.php
@@ -221,7 +221,7 @@ class CakeSchema extends Object {
unset($currentTables[$key]);
}
if (!empty($Object->hasAndBelongsToMany)) {
- foreach($Object->hasAndBelongsToMany as $Assoc => $assocData) {
+ foreach ($Object->hasAndBelongsToMany as $Assoc => $assocData) {
if (isset($assocData['with'])) {
$class = $assocData['with'];
} elseif ($assocData['_with']) {
@@ -243,7 +243,7 @@ class CakeSchema extends Object {
}
}
if (!empty($currentTables)) {
- foreach($currentTables as $table) {
+ foreach ($currentTables as $table) {
if ($prefix) {
if (strpos($table, $prefix) !== 0) {
continue;
diff --git a/cake/libs/multibyte.php b/cake/libs/multibyte.php
index dc02f033f..ec290dccc 100644
--- a/cake/libs/multibyte.php
+++ b/cake/libs/multibyte.php
@@ -1077,7 +1077,7 @@ class Multibyte extends Object {
function __find($char, $type = 'lower') {
$value = false;
$found = array();
- if(!isset($this->__codeRange[$char])) {
+ if (!isset($this->__codeRange[$char])) {
$range = $this->__codepoint($char);
if ($range === false) {
return null;
@@ -1093,7 +1093,7 @@ class Multibyte extends Object {
$this->__table = $this->__codeRange[$char];
$count = count($this->__caseFold[$this->__table]);
- for($i = 0; $i < $count; $i++) {
+ for ($i = 0; $i < $count; $i++) {
if ($type === 'lower' && $this->__caseFold[$this->__table][$i][$type][0] === $char) {
$found[] = $this->__caseFold[$this->__table][$i];
} elseif ($type === 'upper' && $this->__caseFold[$this->__table][$i][$type] === $char) {
diff --git a/cake/libs/object.php b/cake/libs/object.php
index f587f03f4..e1bf8a28c 100644
--- a/cake/libs/object.php
+++ b/cake/libs/object.php
@@ -265,7 +265,7 @@ class Object {
$file = CACHE . 'persistent' . DS . strtolower($name) . '.php';
include($file);
- switch($type) {
+ switch ($type) {
case 'registry':
$vars = unserialize(${$name});
foreach ($vars['0'] as $key => $value) {
diff --git a/cake/libs/router.php b/cake/libs/router.php
index 81ec36fcc..f4fc83711 100644
--- a/cake/libs/router.php
+++ b/cake/libs/router.php
@@ -870,7 +870,7 @@ class Router extends Object {
array_unshift($urlOut, $url['plugin']);
}
- if($_this->__admin && isset($url[$_this->__admin])) {
+ if ($_this->__admin && isset($url[$_this->__admin])) {
array_unshift($urlOut, $_this->__admin);
}
$output = join('/', $urlOut) . '/';
@@ -1036,7 +1036,7 @@ class Router extends Object {
* @access private
*/
function __mapRoute($route, $params = array()) {
- if(isset($params['plugin']) && isset($params['controller']) && $params['plugin'] === $params['controller']) {
+ if (isset($params['plugin']) && isset($params['controller']) && $params['plugin'] === $params['controller']) {
unset($params['controller']);
}
diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php
index 6586dea75..7e7815fbc 100644
--- a/cake/libs/sanitize.php
+++ b/cake/libs/sanitize.php
@@ -267,7 +267,7 @@ class Sanitize {
if (isset($colData['formatter']) || isset($colData['format'])) {
- switch(strtolower($colData['formatter'])) {
+ switch (strtolower($colData['formatter'])) {
case 'date':
$data = date($colData['format'], strtotime($data));
break;
@@ -284,7 +284,7 @@ class Sanitize {
}
$model->data[$name][$column]=$data;
/*
- switch($colType) {
+ switch ($colType) {
case 'integer':
case 'int':
return $data;
diff --git a/cake/libs/security.php b/cake/libs/security.php
index f5dca86ef..e5a11b2f7 100644
--- a/cake/libs/security.php
+++ b/cake/libs/security.php
@@ -66,7 +66,7 @@ class Security extends Object {
*/
function inactiveMins() {
$_this =& Security::getInstance();
- switch(Configure::read('Security.level')) {
+ switch (Configure::read('Security.level')) {
case 'high':
return 10;
break;
@@ -87,7 +87,7 @@ class Security extends Object {
* @static
*/
function generateAuthKey() {
- if(!class_exists('String')) {
+ if (!class_exists('String')) {
App::import('Core', 'String');
}
return Security::hash(String::uuid());
diff --git a/cake/libs/session.php b/cake/libs/session.php
index 2f654a4a9..bac058bb4 100644
--- a/cake/libs/session.php
+++ b/cake/libs/session.php
@@ -247,7 +247,7 @@ class CakeSession extends Object {
* @access private
*/
function __overwrite(&$old, $new) {
- if(!empty($old)) {
+ if (!empty($old)) {
foreach ($old as $key => $var) {
if (!isset($new[$key])) {
unset($old[$key]);
@@ -422,22 +422,22 @@ class CakeSession extends Object {
* @access private
*/
function __initSession() {
- $ini_set = function_exists('ini_set');
+ $iniSet = function_exists('ini_set');
- if ($ini_set && env('HTTPS')) {
+ if ($iniSet && env('HTTPS')) {
ini_set('session.cookie_secure', 1);
}
- switch($this->security) {
+ switch ($this->security) {
case 'high':
$this->cookieLifeTime = 0;
- if ($ini_set) {
+ if ($iniSet) {
ini_set('session.referer_check', $this->host);
}
break;
case 'medium':
$this->cookieLifeTime = 7 * 86400;
- if ($ini_set) {
+ if ($iniSet) {
ini_set('session.referer_check', $this->host);
}
break;
@@ -447,10 +447,10 @@ class CakeSession extends Object {
break;
}
- switch(Configure::read('Session.save')) {
+ switch (Configure::read('Session.save')) {
case 'cake':
if (!isset($_SESSION)) {
- if ($ini_set) {
+ if ($iniSet) {
ini_set('session.use_trans_sid', 0);
ini_set('url_rewriter.tags', '');
ini_set('session.serialize_handler', 'php');
@@ -471,7 +471,7 @@ class CakeSession extends Object {
} elseif (Configure::read('Session.database') === null) {
Configure::write('Session.database', 'default');
}
- if ($ini_set) {
+ if ($iniSet) {
ini_set('session.use_trans_sid', 0);
ini_set('url_rewriter.tags', '');
ini_set('session.save_handler', 'user');
@@ -492,7 +492,7 @@ class CakeSession extends Object {
break;
case 'php':
if (!isset($_SESSION)) {
- if ($ini_set) {
+ if ($iniSet) {
ini_set('session.use_trans_sid', 0);
ini_set('session.name', Configure::read('Session.cookie'));
ini_set('session.cookie_lifetime', $this->cookieLifeTime);
@@ -505,7 +505,7 @@ class CakeSession extends Object {
if (!class_exists('Cache')) {
uses('Cache');
}
- if ($ini_set) {
+ if ($iniSet) {
ini_set('session.use_trans_sid', 0);
ini_set('url_rewriter.tags', '');
ini_set('session.save_handler', 'user');
@@ -683,7 +683,7 @@ class CakeSession extends Object {
function __close() {
$probability = mt_rand(1, 150);
if ($probability <= 3) {
- switch(Configure::read('Session.save')) {
+ switch (Configure::read('Session.save')) {
case 'cache':
Cache::gc();
break;
@@ -728,7 +728,7 @@ class CakeSession extends Object {
$db =& ConnectionManager::getDataSource(Configure::read('Session.database'));
$table = $db->fullTableName(Configure::read('Session.table'));
- switch(Configure::read('Security.level')) {
+ switch (Configure::read('Security.level')) {
case 'high':
$factor = 10;
break;
diff --git a/cake/libs/set.php b/cake/libs/set.php
index 8cfff8c97..0e0bfcddd 100644
--- a/cake/libs/set.php
+++ b/cake/libs/set.php
@@ -191,25 +191,25 @@ class Set extends Object {
$out[$key] = Set::__map($value, $class);
if (is_object($out[$key])) {
if ($primary !== true && is_array($value) && Set::countDim($value, true) === 2) {
- if(!isset($out[$key]->_name_)) {
+ if (!isset($out[$key]->_name_)) {
$out[$key]->_name_ = $primary;
}
}
}
} elseif (is_array($value)) {
if ($primary === true) {
- if(!isset($out->_name_)) {
+ if (!isset($out->_name_)) {
$out->_name_ = $key;
}
$primary = false;
- foreach($value as $key2 => $value2) {
+ foreach ($value as $key2 => $value2) {
$out->{$key2} = Set::__map($value2, true);
}
} else {
if (!is_numeric($key)) {
$out->{$key} = Set::__map($value, true, $key);
if (is_object($out->{$key}) && !is_numeric($key)) {
- if(!isset($out->{$key}->_name_)) {
+ if (!isset($out->{$key}->_name_)) {
$out->{$key}->_name_ = $key;
}
}
diff --git a/cake/libs/string.php b/cake/libs/string.php
index 47565dfd6..1b7aa9507 100644
--- a/cake/libs/string.php
+++ b/cake/libs/string.php
@@ -129,7 +129,7 @@ class String extends Object {
* @static
*/
function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') {
- if(empty($data) || is_array($data)) {
+ if (empty($data) || is_array($data)) {
return $data;
}
diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index 305a2b212..ec443c37c 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -313,7 +313,7 @@ class Validation extends Object {
}
$operator = str_replace(array(" ", "\t", "\n", "\r", "\0", "\x0B"), "", strtolower($operator));
- switch($operator) {
+ switch ($operator) {
case 'isgreater':
case '>':
if ($check1 > $check2) {
diff --git a/cake/libs/view/elements/email/html/default.ctp b/cake/libs/view/elements/email/html/default.ctp
index 30ca306d4..cf97359a2 100644
--- a/cake/libs/view/elements/email/html/default.ctp
+++ b/cake/libs/view/elements/email/html/default.ctp
@@ -27,7 +27,7 @@
' . $line . '';
endforeach;
?>
\ No newline at end of file
diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php
index c11778342..b7b229c63 100644
--- a/cake/libs/view/helper.php
+++ b/cake/libs/view/helper.php
@@ -371,11 +371,11 @@ class Helper extends Overloadable {
switch (count($parts)) {
case 1:
- if($view->modelScope === false) {
+ if ($view->modelScope === false) {
$view->model = $parts[0];
} else {
$view->field = $parts[0];
- if($sameScope === false) {
+ if ($sameScope === false) {
$view->association = $parts[0];
}
}
@@ -585,7 +585,7 @@ class Helper extends Overloadable {
if (is_array($result)) {
$view =& ClassRegistry::getObject('view');
- if(isset($result[$view->fieldSuffix])) {
+ if (isset($result[$view->fieldSuffix])) {
$result = $result[$view->fieldSuffix];
}
}
diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php
index d785367c8..31ce3a911 100644
--- a/cake/libs/view/helpers/ajax.php
+++ b/cake/libs/view/helpers/ajax.php
@@ -559,7 +559,7 @@ class AjaxHelper extends AppHelper {
$options = $this->_optionsToString($options, array('axis', 'handleImage', 'handleDisabled'));
$callbacks = array('change', 'slide');
- foreach($callbacks as $callback) {
+ foreach ($callbacks as $callback) {
if (isset($options[$callback])) {
$options['on' . ucfirst($callback)] = 'function(value) {' . $options[$callback] . '}';
unset($options[$callback]);
@@ -680,7 +680,7 @@ class AjaxHelper extends AppHelper {
$jsOptions = array_merge($jsOptions, array_intersect_key($options, array_flip(array('contentType', 'encoding', 'method', 'postBody'))));
foreach ($options as $key => $value) {
- switch($key) {
+ switch ($key) {
case 'type':
$jsOptions['asynchronous'] = ($value == 'synchronous') ? 'false' : 'true';
break;
@@ -787,7 +787,7 @@ class AjaxHelper extends AppHelper {
if (isset($options[$callback])) {
$name = 'on' . ucfirst($callback);
$code = $options[$callback];
- switch($name) {
+ switch ($name) {
case 'onComplete':
$callbacks[$name] = "function(request, json) {" . $code . "}";
break;
diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php
index 876f5b04f..8f4c40563 100644
--- a/cake/libs/view/helpers/form.php
+++ b/cake/libs/view/helpers/form.php
@@ -1567,7 +1567,7 @@ class FormHelper extends AppHelper {
$opt = implode($separator, $selects);
}
- switch($timeFormat) {
+ switch ($timeFormat) {
case '24':
$selectMinuteAttr['interval'] = $interval;
$opt .= $this->hour($fieldName, true, $hour, $selectHourAttr, $showEmpty) . ':' .
diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index 86c6dcdb5..d0f22c50a 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -624,7 +624,7 @@ class HtmlHelper extends AppHelper {
$out = '';
$index = 1;
- foreach($items as $key => $item) {
+ foreach ($items as $key => $item) {
if (is_array($item)) {
$item = $key . $this->nestedList($item, $attributes, $itemAttributes, $tag);
}
diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php
index 89dc5b0cb..c96144f87 100644
--- a/cake/libs/view/helpers/js.php
+++ b/cake/libs/view/helpers/js.php
@@ -81,7 +81,7 @@ class JsHelper extends Overloadable2 {
return 'alert("' . $this->escape($message) . '");';
}
- function if_($if, $then, $else = null, $elseif = array()) {
+ function if_($if, $then, $else = null, $elseIf = array()) {
$len = strlen($if) - 1;
if ($if{$len} == ';') {
$if{$len} = null;
@@ -89,7 +89,7 @@ class JsHelper extends Overloadable2 {
$out = 'if (' . $if . ') { ' . $then . ' }';
- foreach ($elseif as $cond => $exec) {
+ foreach ($elseIf as $cond => $exec) {
//$out .=
}
diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php
index cebc06fea..81e770005 100644
--- a/cake/libs/view/helpers/number.php
+++ b/cake/libs/view/helpers/number.php
@@ -57,7 +57,7 @@ class NumberHelper extends AppHelper {
* @static
*/
function toReadableSize($size) {
- switch($size) {
+ switch ($size) {
case 0:
return '0 Bytes';
case 1:
@@ -185,7 +185,7 @@ class NumberHelper extends AppHelper {
$result = $this->format($abs, $options);
if ($number < 0 ) {
- if($options['negative'] == '()') {
+ if ($options['negative'] == '()') {
$result = '(' . $result .')';
} else {
$result = $options['negative'] . $result;
diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php
index 1e866def1..c606afec3 100644
--- a/cake/libs/view/helpers/session.php
+++ b/cake/libs/view/helpers/session.php
@@ -195,7 +195,7 @@ class SessionHelper extends CakeSession {
* @access public
*/
function __start() {
- if(!parent::started()) {
+ if (!parent::started()) {
parent::start();
}
return true;
diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php
index f94194c17..8b662b966 100644
--- a/cake/libs/view/helpers/time.php
+++ b/cake/libs/view/helpers/time.php
@@ -38,8 +38,8 @@ class TimeHelper extends AppHelper {
/**
* Converts given time (in server's time zone) to user's local time, given his/her offset from GMT.
*
- * @param string $server_time UNIX timestamp
- * @param int $user_offset User's offset from GMT (in hours)
+ * @param string $serverTime UNIX timestamp
+ * @param int $userOffset User's offset from GMT (in hours)
* @return string UNIX timestamp
*/
function convert($serverTime, $userOffset) {
@@ -317,8 +317,8 @@ class TimeHelper extends AppHelper {
if (!is_null($userOffset)) {
$now = $this->convert(time(), $userOffset);
}
- $in_seconds = $this->fromString($dateTime, $userOffset);
- $backwards = ($in_seconds > $now);
+ $inSeconds = $this->fromString($dateTime, $userOffset);
+ $backwards = ($inSeconds > $now);
$format = 'j/n/y';
$end = '+1 month';
@@ -337,22 +337,22 @@ class TimeHelper extends AppHelper {
}
if ($backwards) {
- $future_time = $in_seconds;
- $past_time = $now;
+ $futureTime = $inSeconds;
+ $pastTime = $now;
} else {
- $future_time = $now;
- $past_time = $in_seconds;
+ $futureTime = $now;
+ $pastTime = $inSeconds;
}
- $diff = $future_time - $past_time;
+ $diff = $futureTime - $pastTime;
// If more than a week, then take into account the length of months
if ($diff >= 604800) {
$current = array();
$date = array();
- list($future['H'], $future['i'], $future['s'], $future['d'], $future['m'], $future['Y']) = explode('/', date('H/i/s/d/m/Y', $future_time));
+ list($future['H'], $future['i'], $future['s'], $future['d'], $future['m'], $future['Y']) = explode('/', date('H/i/s/d/m/Y', $futureTime));
- list($past['H'], $past['i'], $past['s'], $past['d'], $past['m'], $past['Y']) = explode('/', date('H/i/s/d/m/Y', $past_time));
+ list($past['H'], $past['i'], $past['s'], $past['d'], $past['m'], $past['Y']) = explode('/', date('H/i/s/d/m/Y', $pastTime));
$years = $months = $weeks = $days = $hours = $minutes = $seconds = 0;
if ($future['Y'] == $past['Y'] && $future['m'] == $past['m']) {
@@ -379,13 +379,13 @@ class TimeHelper extends AppHelper {
if ($future['d'] >= $past['d']) {
$days = $future['d'] - $past['d'];
} else {
- $days_in_past_month = date('t', $past_time);
- $days_in_future_month = date('t', mktime(0, 0, 0, $future['m'] - 1, 1, $future['Y']));
+ $daysInPastMonth = date('t', $pastTime);
+ $daysInFutureMonth = date('t', mktime(0, 0, 0, $future['m'] - 1, 1, $future['Y']));
if (!$backwards) {
- $days = ($days_in_past_month - $past['d']) + $future['d'];
+ $days = ($daysInPastMonth - $past['d']) + $future['d'];
} else {
- $days = ($days_in_future_month - $past['d']) + $future['d'];
+ $days = ($daysInFutureMonth - $past['d']) + $future['d'];
}
if ($future['m'] != $past['m']) {
@@ -393,7 +393,7 @@ class TimeHelper extends AppHelper {
}
}
- if ($months == 0 && $years >= 1 && $diff < ($years * 31536000)){
+ if ($months == 0 && $years >= 1 && $diff < ($years * 31536000)) {
$months = 11;
$years --;
}
@@ -420,48 +420,48 @@ class TimeHelper extends AppHelper {
$diff = $diff - ($minutes * 60);
$seconds = $diff;
}
- $relative_date = '';
- $diff = $future_time - $past_time;
+ $relativeDate = '';
+ $diff = $futureTime - $pastTime;
if ($diff > abs($now - $this->fromString($end))) {
- $relative_date = sprintf(__('on %s',true), date($format, $in_seconds));
+ $relativeDate = sprintf(__('on %s',true), date($format, $inSeconds));
} else {
if ($years > 0) {
// years and months and days
- $relative_date .= ($relative_date ? ', ' : '') . $years . ' ' . __n('year', 'years', $years, true);
- $relative_date .= $months > 0 ? ($relative_date ? ', ' : '') . $months . ' ' . __n('month', 'months', $months, true) : '';
- $relative_date .= $weeks > 0 ? ($relative_date ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true) : '';
- $relative_date .= $days > 0 ? ($relative_date ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : '';
+ $relativeDate .= ($relativeDate ? ', ' : '') . $years . ' ' . __n('year', 'years', $years, true);
+ $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months, true) : '';
+ $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true) : '';
+ $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : '';
} elseif (abs($months) > 0) {
// months, weeks and days
- $relative_date .= ($relative_date ? ', ' : '') . $months . ' ' . __n('month', 'months', $months, true);
- $relative_date .= $weeks > 0 ? ($relative_date ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true) : '';
- $relative_date .= $days > 0 ? ($relative_date ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : '';
+ $relativeDate .= ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months, true);
+ $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true) : '';
+ $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : '';
} elseif (abs($weeks) > 0) {
// weeks and days
- $relative_date .= ($relative_date ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true);
- $relative_date .= $days > 0 ? ($relative_date ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : '';
+ $relativeDate .= ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true);
+ $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : '';
} elseif (abs($days) > 0) {
// days and hours
- $relative_date .= ($relative_date ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true);
- $relative_date .= $hours > 0 ? ($relative_date ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours, true) : '';
+ $relativeDate .= ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true);
+ $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours, true) : '';
} elseif (abs($hours) > 0) {
// hours and minutes
- $relative_date .= ($relative_date ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours, true);
- $relative_date .= $minutes > 0 ? ($relative_date ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes, true) : '';
+ $relativeDate .= ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours, true);
+ $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes, true) : '';
} elseif (abs($minutes) > 0) {
// minutes only
- $relative_date .= ($relative_date ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes, true);
+ $relativeDate .= ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes, true);
} else {
// seconds only
- $relative_date .= ($relative_date ? ', ' : '') . $seconds . ' ' . __n('second', 'seconds', $seconds, true);
+ $relativeDate .= ($relativeDate ? ', ' : '') . $seconds . ' ' . __n('second', 'seconds', $seconds, true);
}
if (!$backwards) {
- $relative_date = sprintf(__('%s ago', true), $relative_date);
+ $relativeDate = sprintf(__('%s ago', true), $relativeDate);
}
}
- return $this->output($relative_date);
+ return $this->output($relativeDate);
}
/**
* Alias for timeAgoInWords
diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp
index deb85cc96..53d45ae78 100644
--- a/cake/libs/view/pages/home.ctp
+++ b/cake/libs/view/pages/home.ctp
@@ -27,7 +27,7 @@
0):
+if (Configure::read() > 0):
Debugger::checkSessionKey();
endif;
?>
diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp
index 8d547f0a9..eacf379d2 100644
--- a/cake/libs/view/scaffolds/edit.ctp
+++ b/cake/libs/view/scaffolds/edit.ctp
@@ -40,7 +40,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
".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller'=> $_details['controller'], 'action'=>'index'))."\n";
echo "\t\t
".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller'=> $_details['controller'], 'action'=>'add'))."\n";
diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp
index dfcd03f4a..4910d683b 100644
--- a/cake/libs/view/scaffolds/index.ctp
+++ b/cake/libs/view/scaffolds/index.ctp
@@ -49,16 +49,16 @@ echo "\n";
echo "\t
\n";
foreach ($scaffoldFields 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\t" . $html->link(${$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" . ${$singularVar}[$modelClass][$_field] . " \n\t\t | \n";
}
}
@@ -86,7 +86,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".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller'=> $_details['controller'], 'action'=>'index'))."\n";
echo "\t\t".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller'=> $_details['controller'], 'action'=>'add'))."\n";
diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp
index a97af37ab..13653099b 100644
--- a/cake/libs/view/scaffolds/view.ctp
+++ b/cake/libs/view/scaffolds/view.ctp
@@ -35,9 +35,9 @@ foreach ($scaffoldFields as $_field) {
$class = ' class="altrow"';
}
$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".Inflector::humanize($_alias)."\n";
echo "\t\t\n\t\t\t" . $html->link(${$singularVar}[$_alias][$_details['displayField']], array('controller'=> $_details['controller'], 'action'=>'view', ${$singularVar}[$_alias][$_details['primaryKey']])) . "\n\t\t \n";
@@ -45,7 +45,7 @@ foreach ($scaffoldFields as $_field) {
}
}
}
- if($isKey !== true) {
+ if ($isKey !== true) {
echo "\t\t".Inflector::humanize($_field)."\n";
echo "\t\t\n\t\t\t{${$singularVar}[$modelClass][$_field]}\n \t\t\n";
}
@@ -63,7 +63,7 @@ foreach ($scaffoldFields 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".$html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller'=> $_details['controller'], 'action'=>'index'))."\n";
echo "\t\t".$html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller'=> $_details['controller'], 'action'=>'add'))."\n";
@@ -75,7 +75,7 @@ foreach ($scaffoldFields as $_field) {
$_details): ?>
@@ -105,10 +105,10 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
endforeach;
endif;
-if(empty($associations['hasMany'])) {
+if (empty($associations['hasMany'])) {
$associations['hasMany'] = array();
}
-if(empty($associations['hasAndBelongsToMany'])) {
+if (empty($associations['hasAndBelongsToMany'])) {
$associations['hasAndBelongsToMany'] = array();
}
$relations = array_merge($associations['hasMany'], $associations['hasAndBelongsToMany']);
diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php
index 7e2bae514..bf4563cb4 100644
--- a/cake/libs/view/theme.php
+++ b/cake/libs/view/theme.php
@@ -89,7 +89,7 @@ class ThemeView extends View {
$paths = array_merge($themePaths, $paths);
}
- if(empty($this->__paths)) {
+ if (empty($this->__paths)) {
$this->__paths = $paths;
}
diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php
index ff0271119..678e26564 100644
--- a/cake/libs/view/view.php
+++ b/cake/libs/view/view.php
@@ -406,7 +406,7 @@ class View extends Object {
* @return mixed Rendered output, or false on error
*/
function renderLayout($content_for_layout, $layout = null) {
- $layout_fn = $this->_getLayoutFileName($layout);
+ $layoutFileName = $this->_getLayoutFileName($layout);
$debug = '';
if (isset($this->viewVars['cakeDebug']) && Configure::read() > 2) {
@@ -447,15 +447,15 @@ class View extends Object {
}
}
- if (substr($layout_fn, -3) === 'ctp' || substr($layout_fn, -5) === 'thtml') {
- $this->output = View::_render($layout_fn, $data_for_layout, $loadHelpers, true);
+ if (substr($layoutFileName, -3) === 'ctp' || substr($layoutFileName, -5) === 'thtml') {
+ $this->output = View::_render($layoutFileName, $data_for_layout, $loadHelpers, true);
} else {
- $this->output = $this->_render($layout_fn, $data_for_layout, $loadHelpers);
+ $this->output = $this->_render($layoutFileName, $data_for_layout, $loadHelpers);
}
if ($this->output === false) {
- $this->output = $this->_render($layout_fn, $data_for_layout);
- trigger_error(sprintf(__("Error in layout %s, got:
%s
", true), $layout_fn, $this->output), E_USER_ERROR);
+ $this->output = $this->_render($layoutFileName, $data_for_layout);
+ trigger_error(sprintf(__("Error in layout %s, got:
%s
", true), $layoutFileName, $this->output), E_USER_ERROR);
return false;
}
diff --git a/cake/libs/xml.php b/cake/libs/xml.php
index 3903bb3b6..3bac2a1bf 100644
--- a/cake/libs/xml.php
+++ b/cake/libs/xml.php
@@ -110,7 +110,7 @@ class XmlNode extends Object {
if (is_array($value) || is_object($value)) {
$this->normalize($value);
- } elseif(!empty($value) || $value === 0 || $value === '0') {
+ } elseif (!empty($value) || $value === 0 || $value === '0') {
$this->createTextNode($value);
}
}
@@ -876,7 +876,7 @@ class Xml extends XmlNode {
for ($i = 0; $i < $count; $i++) {
$data = $vals[$i];
$data = array_merge(array('tag' => null, 'value' => null, 'attributes' => array()), $data);
- switch($data['type']) {
+ switch ($data['type']) {
case "open" :
$xml =& $xml->createElement($data['tag'], $data['value'], $data['attributes']);
break;