\n";
+ echo "\t\t | \n";
}
?>
";?> |
@@ -143,7 +143,7 @@ echo "\t\n";
\n\n";?>
- - link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?>
+ - link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add'));?>";?>
diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php
index 524453c96..56713f5c4 100644
--- a/cake/libs/controller/components/cookie.php
+++ b/cake/libs/controller/components/cookie.php
@@ -203,10 +203,10 @@ class CookieComponent extends Object {
if (count($name) > 1) {
$this->__values[$name[0]][$name[1]] = $value;
- $this->__write("[".$name[0]."][".$name[1]."]", $value);
+ $this->__write("[" . $name[0] . "][" . $name[1] . "]", $value);
} else {
$this->__values[$name[0]] = $value;
- $this->__write("[".$name[0]."]", $value);
+ $this->__write("[" . $name[0] . "]", $value);
}
} else {
foreach ($key as $names => $value) {
@@ -214,10 +214,10 @@ class CookieComponent extends Object {
if (count($name) > 1) {
$this->__values[$name[0]][$name[1]] = $value;
- $this->__write("[".$name[0]."][".$name[1]."]", $value);
+ $this->__write("[" . $name[0] . "][" . $name[1] . "]", $value);
} else {
$this->__values[$name[0]] = $value;
- $this->__write("[".$name[0]."]", $value);
+ $this->__write("[" . $name[0] . "]", $value);
}
}
}
@@ -278,17 +278,17 @@ class CookieComponent extends Object {
$name = $this->__cookieVarNames($key);
if (count($name) > 1) {
if (isset($this->__values[$name[0]])) {
- $this->__delete("[".$name[0]."][".$name[1]."]");
+ $this->__delete("[" . $name[0] . "][" . $name[1] . "]");
unset($this->__values[$name[0]][$name[1]]);
}
} else {
if (isset($this->__values[$name[0]])) {
if (is_array($this->__values[$name[0]])) {
foreach ($this->__values[$name[0]] as $key => $value) {
- $this->__delete("[".$name[0]."][".$key."]");
+ $this->__delete("[" . $name[0] . "][" . $key . "]");
}
}
- $this->__delete("[".$name[0]."]");
+ $this->__delete("[" . $name[0] . "]");
unset($this->__values[$name[0]]);
}
}
diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php
index 79a96cd32..544de704f 100644
--- a/cake/libs/http_socket.php
+++ b/cake/libs/http_socket.php
@@ -202,10 +202,10 @@ class HttpSocket extends CakeSocket {
}
if (isset($this->request['auth']['user']) && isset($this->request['auth']['pass'])) {
- $this->request['header']['Authorization'] = $this->request['auth']['method'] ." ". base64_encode($this->request['auth']['user'] .":".$this->request['auth']['pass']);
+ $this->request['header']['Authorization'] = $this->request['auth']['method'] . " " . base64_encode($this->request['auth']['user'] . ":" . $this->request['auth']['pass']);
}
if (isset($this->request['uri']['user']) && isset($this->request['uri']['pass'])) {
- $this->request['header']['Authorization'] = $this->request['auth']['method'] ." ". base64_encode($this->request['uri']['user'] .":".$this->request['uri']['pass']);
+ $this->request['header']['Authorization'] = $this->request['auth']['method'] . " " . base64_encode($this->request['uri']['user'] . ":" . $this->request['uri']['pass']);
}
if (is_array($this->request['body'])) {
@@ -812,7 +812,7 @@ class HttpSocket extends CakeSocket {
return false;
}
- preg_match_all("/(.+):(.+)(?:(?lineBreak."|\$)/Uis", $header, $matches, PREG_SET_ORDER);
+ preg_match_all("/(.+):(.+)(?:(?lineBreak . "|\$)/Uis", $header, $matches, PREG_SET_ORDER);
$header = array();
foreach ($matches as $match) {
diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php
index c0d238079..4663567ca 100644
--- a/cake/libs/model/datasources/dbo/dbo_mysqli.php
+++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -105,9 +105,8 @@ class DboMysqli extends DboMysqlBase {
function _execute($sql) {
if (preg_match('/^\s*call/i', $sql)) {
return $this->_executeProcedure($sql);
- } else {
- return mysqli_query($this->connection, $sql);
}
+ return mysqli_query($this->connection, $sql);
}
/**
* Executes given SQL statement (procedure call).
@@ -140,15 +139,15 @@ class DboMysqli extends DboMysqlBase {
if (!$result) {
return array();
- } else {
- $tables = array();
-
- while ($line = mysqli_fetch_array($result)) {
- $tables[] = $line[0];
- }
- parent::listSources($tables);
- return $tables;
}
+
+ $tables = array();
+
+ while ($line = mysqli_fetch_array($result)) {
+ $tables[] = $line[0];
+ }
+ parent::listSources($tables);
+ return $tables;
}
/**
* Returns an array of the fields in given table name.
@@ -201,14 +200,15 @@ class DboMysqli extends DboMysqlBase {
if ($parent != null) {
return $parent;
}
-
- if ($data === null) {
+ if ($data === null || (is_array($data) && empty($data))) {
return 'NULL';
}
-
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
return "''";
}
+ if (empty($column)) {
+ $column = $this->introspectType($data);
+ }
switch ($column) {
case 'boolean':
@@ -217,9 +217,6 @@ class DboMysqli extends DboMysqlBase {
case 'integer' :
case 'float' :
case null :
- if ($data === '') {
- return 'NULL';
- }
if ((is_int($data) || is_float($data) || $data === '0') || (
is_numeric($data) && strpos($data, ',') === false &&
$data[0] != '0' && strpos($data, 'e') === false)) {
@@ -278,7 +275,6 @@ class DboMysqli extends DboMysqlBase {
if ($id !== false && !empty($id) && !empty($id[0]) && isset($id[0]['insertID'])) {
return $id[0]['insertID'];
}
-
return null;
}
/**
@@ -337,11 +333,11 @@ class DboMysqli extends DboMysqlBase {
function length($real) {
$col = str_replace(array(')', 'unsigned'), '', $real);
$limit = null;
-
+
if (strpos($col, '(') !== false) {
list($col, $limit) = explode('(', $col);
}
-
+
if ($limit != null) {
return intval($limit);
}
@@ -389,9 +385,8 @@ class DboMysqli extends DboMysqlBase {
$i++;
}
return $resultRow;
- } else {
- return false;
}
+ return false;
}
/**
* Gets the database encoding
diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php
index d3e2811ab..23c2f4816 100644
--- a/cake/libs/model/schema.php
+++ b/cake/libs/model/schema.php
@@ -338,7 +338,7 @@ class CakeSchema extends Object {
$col = "\t\t'indexes' => array(";
$props = array();
foreach ((array)$value as $key => $index) {
- $props[] = "'{$key}' => array(".join(', ', $this->__values($index)).")";
+ $props[] = "'{$key}' => array(" . join(', ', $this->__values($index)) . ")";
}
$col .= join(', ', $props);
}
@@ -446,7 +446,7 @@ class CakeSchema extends Object {
if (is_array($values)) {
foreach ($values as $key => $val) {
if (is_array($val)) {
- $vals[] = "'{$key}' => array('".join("', '", $val)."')";
+ $vals[] = "'{$key}' => array('" . join("', '", $val) . "')";
} else if (!is_numeric($key)) {
$val = var_export($val, true);
$vals[] = "'{$key}' => {$val}";
diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp
index 857ac206c..0de1c6cc3 100644
--- a/cake/libs/view/errors/missing_action.ctp
+++ b/cake/libs/view/errors/missing_action.ctp
@@ -25,11 +25,11 @@
:
- ".$action."", "".$controller."");?>
+ " . $action . "", "" . $controller . "");?>
:
- ".$controller."::", "".$action."()", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?>
+ " . $controller . "::", "" . $action . "()", APP_DIR . DS . "controllers" . DS . Inflector::underscore($controller) . ".php");?>
<?php
@@ -47,5 +47,5 @@ class extends AppController {
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_component_class.ctp b/cake/libs/view/errors/missing_component_class.ctp
index 49af6e3a3..ec154de02 100644
--- a/cake/libs/view/errors/missing_component_class.ctp
+++ b/cake/libs/view/errors/missing_component_class.ctp
@@ -25,11 +25,11 @@
:
- ". $component ."Component", "". $controller ."Controller");?>
+ " . $component . "Component", "" . $controller . "Controller");?>
:
- ". $component ."Component", APP_DIR.DS."controllers".DS."components".DS.$file);?>
+ " . $component . "Component", APP_DIR . DS . "controllers" . DS . "components" . DS . $file);?>
<?php
@@ -40,5 +40,5 @@ class Component extends Object {
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_component_file.ctp b/cake/libs/view/errors/missing_component_file.ctp
index e4eb675b9..3b8b874fb 100644
--- a/cake/libs/view/errors/missing_component_file.ctp
+++ b/cake/libs/view/errors/missing_component_file.ctp
@@ -29,7 +29,7 @@
:
- ". $component ."Component", APP_DIR.DS."controllers".DS."components".DS.$file);?>
+ " . $component . "Component", APP_DIR . DS . "controllers" . DS . "components" . DS . $file);?>
<?php
@@ -40,5 +40,5 @@ class Component extends Object {
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp
index 829cc53ca..676747284 100644
--- a/cake/libs/view/errors/missing_controller.ctp
+++ b/cake/libs/view/errors/missing_controller.ctp
@@ -25,11 +25,11 @@
:
- ".$controller."");?>
+ " . $controller . "");?>
:
- ".$controller."", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?>
+ " . $controller . "", APP_DIR . DS . "controllers" . DS . Inflector::underscore($controller) . ".php");?>
<?php
@@ -41,5 +41,5 @@ class extends AppController {
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/cake/libs/view/errors/missing_helper_class.ctp
index d94d1ab1d..e1f464cdd 100644
--- a/cake/libs/view/errors/missing_helper_class.ctp
+++ b/cake/libs/view/errors/missing_helper_class.ctp
@@ -29,7 +29,7 @@
:
-
+
<?php
@@ -40,5 +40,5 @@ class extends AppHelper {
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/cake/libs/view/errors/missing_helper_file.ctp
index 7affb0fd4..34d6d5dc7 100644
--- a/cake/libs/view/errors/missing_helper_file.ctp
+++ b/cake/libs/view/errors/missing_helper_file.ctp
@@ -25,11 +25,11 @@
:
-
+
:
-
+
<?php
@@ -40,5 +40,5 @@ class extends AppHelper {
:
-
+
diff --git a/cake/libs/view/errors/missing_layout.ctp b/cake/libs/view/errors/missing_layout.ctp
index c41c59d45..cb8445a44 100644
--- a/cake/libs/view/errors/missing_layout.ctp
+++ b/cake/libs/view/errors/missing_layout.ctp
@@ -25,13 +25,13 @@
:
- ". $file ."");?>
+ " . $file . "");?>
:
- ". $file ."");?>
+ " . $file . "");?>
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_model.ctp b/cake/libs/view/errors/missing_model.ctp
index 49cf8f7a4..c2d64e95f 100644
--- a/cake/libs/view/errors/missing_model.ctp
+++ b/cake/libs/view/errors/missing_model.ctp
@@ -29,7 +29,7 @@
:
- ". $model . "", APP_DIR.DS."models".DS.Inflector::underscore($model).".php");?>
+ " . $model . "", APP_DIR . DS . "models" . DS . Inflector::underscore($model) . ".php");?>
<?php
@@ -42,5 +42,5 @@ class extends AppModel {
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_scaffolddb.ctp b/cake/libs/view/errors/missing_scaffolddb.ctp
index 2477d3207..443199224 100644
--- a/cake/libs/view/errors/missing_scaffolddb.ctp
+++ b/cake/libs/view/errors/missing_scaffolddb.ctp
@@ -29,9 +29,9 @@
:
-
+
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_table.ctp b/cake/libs/view/errors/missing_table.ctp
index 341897680..1bdc59f69 100644
--- a/cake/libs/view/errors/missing_table.ctp
+++ b/cake/libs/view/errors/missing_table.ctp
@@ -25,9 +25,9 @@
:
- ". $table ."", "". $model ."");?>
+ " . $table . "", "" . $model . "");?>
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/missing_view.ctp b/cake/libs/view/errors/missing_view.ctp
index 184573751..737da88c0 100644
--- a/cake/libs/view/errors/missing_view.ctp
+++ b/cake/libs/view/errors/missing_view.ctp
@@ -25,7 +25,7 @@
:
- ". $controller."Controller::", "". $action ."()");?>
+ " . $controller . "Controller::", "". $action . "()");?>
:
@@ -33,5 +33,5 @@
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/private_action.ctp b/cake/libs/view/errors/private_action.ctp
index f172c50aa..6d9e92c70 100644
--- a/cake/libs/view/errors/private_action.ctp
+++ b/cake/libs/view/errors/private_action.ctp
@@ -25,9 +25,9 @@
:
- ". $controller ."::", "". $action ."()");?>
+ " . $controller . "::", "" . $action . "()");?>
:
-
+
\ No newline at end of file
diff --git a/cake/libs/view/errors/scaffold_error.ctp b/cake/libs/view/errors/scaffold_error.ctp
index d20843cbd..9ce156af7 100644
--- a/cake/libs/view/errors/scaffold_error.ctp
+++ b/cake/libs/view/errors/scaffold_error.ctp
@@ -29,7 +29,7 @@
:
-
+
<?php
diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp
index fd537d239..6705b4bf4 100644
--- a/cake/libs/view/scaffolds/edit.ctp
+++ b/cake/libs/view/scaffolds/edit.ctp
@@ -40,8 +40,8 @@
foreach ($associations as $_type => $_data) {
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";
+ 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";
$done[] = $_details['controller'];
}
}
diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp
index 5d18fef54..c5b9e0e7f 100644
--- a/cake/libs/view/scaffolds/index.ctp
+++ b/cake/libs/view/scaffolds/index.ctp
@@ -86,8 +86,8 @@ echo "\n";
foreach ($associations as $_type => $_data) {
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";
+ 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";
$done[] = $_details['controller'];
}
}
diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp
index 0c5ef7420..a497ca673 100644
--- a/cake/libs/view/scaffolds/view.ctp
+++ b/cake/libs/view/scaffolds/view.ctp
@@ -37,14 +37,14 @@ foreach ($scaffoldFields as $_field) {
foreach ($associations['belongsTo'] as $_alias => $_details) {
if ($_field === $_details['foreignKey']) {
$isKey = true;
- echo "\t\t".Inflector::humanize($_alias)."\n";
+ 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";
break;
}
}
}
if ($isKey !== true) {
- echo "\t\t".Inflector::humanize($_field)."\n";
+ echo "\t\t" . Inflector::humanize($_field) . "\n";
echo "\t\t\n\t\t\t{${$singularVar}[$modelClass][$_field]}\n \t\t\n";
}
}
@@ -63,8 +63,8 @@ foreach ($scaffoldFields as $_field) {
foreach ($associations as $_type => $_data) {
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";
+ 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";
$done[] = $_details['controller'];
}
}
@@ -87,8 +87,8 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
- echo "\t\t".Inflector::humanize($_field)."\n";
- echo "\t\t\n\t" .${$singularVar}[$_alias][$_field] ."\n \n";
+ echo "\t\t" . Inflector::humanize($_field) . "\n";
+ echo "\t\t\n\t" . ${$singularVar}[$_alias][$_field] . "\n \n";
}
?>
@@ -122,7 +122,7 @@ $otherSingularVar = Inflector::variable($_alias);
".Inflector::humanize($_field)."\n";
+ echo "\t\t" . Inflector::humanize($_field) . " | \n";
}
?>
Actions |
@@ -137,7 +137,7 @@ $otherSingularVar = Inflector::variable($_alias);
echo "\t\t
\n";
foreach ($otherFields as $_field) {
- echo "\t\t\t".${$otherSingularVar}[$_field]." | \n";
+ echo "\t\t\t" . ${$otherSingularVar}[$_field] . " | \n";
}
echo "\t\t\t\n";
diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php
index cb6a79891..b3fa948b1 100644
--- a/cake/tests/cases/libs/http_socket.test.php
+++ b/cake/tests/cases/libs/http_socket.test.php
@@ -399,12 +399,12 @@ class HttpSocketTest extends CakeTestCase {
$this->Socket->setReturnValue('read', false);
$this->Socket->_mock->_call_counts['read'] = 0;
$number = mt_rand(0, 9999999);
- $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\nHello, your lucky number is ".$number."";
+ $serverResponse = "HTTP/1.x 200 OK\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\nHello, your lucky number is " . $number . "";
$this->Socket->setReturnValueAt(0, 'read', $serverResponse);
$this->Socket->expect('write', array("GET / HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\n\r\n"));
$this->Socket->expectCallCount('read', 2);
$response = $this->Socket->request($request);
- $this->assertIdentical($response, "Hello, your lucky number is ".$number."");
+ $this->assertIdentical($response, "Hello, your lucky number is " . $number . "");
$this->Socket->reset();
$serverResponse = "HTTP/1.x 200 OK\r\nSet-Cookie: foo=bar\r\nDate: Mon, 16 Apr 2007 04:14:16 GMT\r\nServer: CakeHttp Server\r\nContent-Type: text/html\r\n\r\nThis is a cookie test!";
diff --git a/cake/tests/cases/libs/sanitize.test.php b/cake/tests/cases/libs/sanitize.test.php
index e564f9a92..1899f16c7 100644
--- a/cake/tests/cases/libs/sanitize.test.php
+++ b/cake/tests/cases/libs/sanitize.test.php
@@ -298,8 +298,8 @@ class SanitizeTest extends CakeTestCase {
$result = Sanitize::stripScripts($string);
$this->assertEqual($result, $expected);
- $string = ''."\n".''."\n".''."\n".'';
- $expected = "\n".''."\n".''."\n".'';
+ $string = '' . "\n" . '' . "\n" . '' . "\n" . '';
+ $expected = "\n" . '' . "\n" . ''."\n".'';
$result = Sanitize::stripScripts($string);
$this->assertEqual($result, $expected);
|