diff --git a/.travis.yml b/.travis.yml
index 48b3383e2..834007621 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -111,7 +111,7 @@ before_script:
}" > app/Config/database.php
script:
- - sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; else phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi"
+ - sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; elif [ '$DB' = 'mysql' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; else ./lib/Cake/Console/cake test core AllDbRelated --stderr; fi"
notifications:
email: false
diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php
index 9433dad4f..f3d84989d 100644
--- a/lib/Cake/Cache/Engine/FileEngine.php
+++ b/lib/Cake/Cache/Engine/FileEngine.php
@@ -223,6 +223,8 @@ class FileEngine extends CacheEngine {
if (!$this->_init) {
return false;
}
+ $this->_File = null;
+
$threshold = $now = false;
if ($check) {
$now = time();
@@ -233,11 +235,17 @@ class FileEngine extends CacheEngine {
$directory = new RecursiveDirectoryIterator($this->settings['path']);
$contents = new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
+ $cleared = array();
foreach ($contents as $path) {
if ($path->isFile()) {
continue;
}
- $this->_clearDirectory($path->getRealPath() . DS, $now, $threshold);
+
+ $path = $path->getRealPath() . DS;
+ if (!in_array($path, $cleared)) {
+ $this->_clearDirectory($path, $now, $threshold);
+ $cleared[] = $path;
+ }
}
return true;
}
@@ -263,7 +271,7 @@ class FileEngine extends CacheEngine {
continue;
}
$filePath = $path . $entry;
- if (is_dir($filePath)) {
+ if (!file_exists($filePath) || is_dir($filePath)) {
continue;
}
$file = new SplFileObject($path . $entry, 'r');
@@ -281,7 +289,9 @@ class FileEngine extends CacheEngine {
}
}
if ($file->isFile()) {
- unlink($file->getRealPath());
+ $_path = $file->getRealPath();
+ $file = null;
+ unlink($_path);
}
}
}
@@ -394,6 +404,7 @@ class FileEngine extends CacheEngine {
* @return boolean success
*/
public function clearGroup($group) {
+ $this->_File = null;
$directoryIterator = new RecursiveDirectoryIterator($this->settings['path']);
$contents = new RecursiveIteratorIterator($directoryIterator, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($contents as $object) {
@@ -403,7 +414,6 @@ class FileEngine extends CacheEngine {
unlink($object->getPathName());
}
}
- $this->_File = null;
return true;
}
}
diff --git a/lib/Cake/Console/Command/BakeShell.php b/lib/Cake/Console/Command/BakeShell.php
index f8bafb1dd..4c06c74f4 100644
--- a/lib/Cake/Console/Command/BakeShell.php
+++ b/lib/Cake/Console/Command/BakeShell.php
@@ -66,6 +66,9 @@ class BakeShell extends AppShell {
$this->{$task}->connection = $this->params['connection'];
}
}
+ if (isset($this->params['connection'])) {
+ $this->connection = $this->params['connection'];
+ }
}
/**
diff --git a/lib/Cake/Console/Command/ServerShell.php b/lib/Cake/Console/Command/ServerShell.php
index b850a6d31..492b7d48b 100644
--- a/lib/Cake/Console/Command/ServerShell.php
+++ b/lib/Cake/Console/Command/ServerShell.php
@@ -129,8 +129,8 @@ class ServerShell extends AppShell {
$command = sprintf("php -S %s:%d -t %s %s",
$this->_host,
$this->_port,
- $this->_documentRoot,
- $this->_documentRoot . '/index.php'
+ escapeshellarg($this->_documentRoot),
+ escapeshellarg($this->_documentRoot . '/index.php')
);
$port = ($this->_port == self::DEFAULT_PORT) ? '' : ':' . $this->_port;
diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php
index 2d50cd46d..4b99c5e6f 100644
--- a/lib/Cake/Console/ShellDispatcher.php
+++ b/lib/Cake/Console/ShellDispatcher.php
@@ -122,8 +122,10 @@ class ShellDispatcher {
define('ROOT', $this->params['root']);
define('APP_DIR', $this->params['app']);
define('APP', $this->params['working'] . DS);
- define('WWW_ROOT', APP . $this->params['webroot'] . DS);
- if (!is_dir(ROOT . DS . APP_DIR . DS . 'tmp') && !defined('TMP')) {
+ if (!defined('WWW_ROOT')) {
+ define('WWW_ROOT', APP . $this->params['webroot'] . DS);
+ }
+ if (!defined('TMP') && !is_dir(APP . 'tmp')) {
define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS);
}
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'Config' . DS . 'bootstrap.php');
diff --git a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp
index e6990b3a3..673bb4c49 100644
--- a/lib/Cake/Console/Templates/skel/View/Pages/home.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Pages/home.ctp
@@ -198,7 +198,7 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
-
- -
+
- CakePHP
-
diff --git a/lib/Cake/Controller/Component/CookieComponent.php b/lib/Cake/Controller/Component/CookieComponent.php
index afe48b787..7ae79afeb 100644
--- a/lib/Cake/Controller/Component/CookieComponent.php
+++ b/lib/Cake/Controller/Component/CookieComponent.php
@@ -421,7 +421,7 @@ class CookieComponent extends Component {
'httpOnly' => $this->httpOnly
));
- if (!is_null($this->_reset)) {
+ if (!empty($this->_reset)) {
$this->_expires = $this->_reset;
$this->_reset = null;
}
diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php
index 6f3adc990..453b6f794 100644
--- a/lib/Cake/Model/AclNode.php
+++ b/lib/Cake/Model/AclNode.php
@@ -85,7 +85,7 @@ class AclNode extends Model {
'joins' => array(array(
'table' => $table,
'alias' => "{$type}0",
- 'type' => 'LEFT',
+ 'type' => 'INNER',
'conditions' => array("{$type}0.alias" => $start)
)),
'order' => $db->name("{$type}.lft") . ' DESC'
@@ -97,7 +97,7 @@ class AclNode extends Model {
$queryData['joins'][] = array(
'table' => $table,
'alias' => "{$type}{$i}",
- 'type' => 'LEFT',
+ 'type' => 'INNER',
'conditions' => array(
$db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft"),
$db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght"),
diff --git a/lib/Cake/Test/Case/AllDbRelatedTest.php b/lib/Cake/Test/Case/AllDbRelatedTest.php
new file mode 100644
index 000000000..75ac442fb
--- /dev/null
+++ b/lib/Cake/Test/Case/AllDbRelatedTest.php
@@ -0,0 +1,51 @@
+addTestFile($path . 'AllBehaviorsTest.php');
+ $suite->addTestFile($path . 'Controller' . DS . 'Component' . DS . 'PaginatorComponentTest.php');
+ $suite->addTestFile($path . 'AllDatabaseTest.php');
+ $suite->addTestFile($path . 'Model' . DS . 'ModelTest.php');
+ $suite->addTestFile($path . 'View' . DS . 'ViewTest.php');
+ $suite->addTestFile($path . 'View' . DS . 'ScaffoldViewTest.php');
+ $suite->addTestFile($path . 'View' . DS . 'HelperTest.php');
+ $suite->addTestFile($path . 'View' . DS . 'Helper' . DS . 'FormHelperTest.php');
+ $suite->addTestFile($path . 'View' . DS . 'Helper' . DS . 'PaginatorHelperTest.php');
+ return $suite;
+ }
+}
diff --git a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
index 6feda4b58..9fc03ef64 100644
--- a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
+++ b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
@@ -400,7 +400,7 @@ class FileEngineTest extends CakeTestCase {
Cache::config('mask_test', array('engine' => 'File', 'path' => TMP . 'tests'));
$data = 'This is some test content';
$write = Cache::write('masking_test', $data, 'mask_test');
- $result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
+ $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
$expected = '0664';
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
@@ -408,7 +408,7 @@ class FileEngineTest extends CakeTestCase {
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0666, 'path' => TMP . 'tests'));
$write = Cache::write('masking_test', $data, 'mask_test');
- $result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
+ $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
$expected = '0666';
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
@@ -416,7 +416,7 @@ class FileEngineTest extends CakeTestCase {
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0644, 'path' => TMP . 'tests'));
$write = Cache::write('masking_test', $data, 'mask_test');
- $result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
+ $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
$expected = '0644';
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
@@ -424,7 +424,7 @@ class FileEngineTest extends CakeTestCase {
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0640, 'path' => TMP . 'tests'));
$write = Cache::write('masking_test', $data, 'mask_test');
- $result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
+ $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
$expected = '0640';
$this->assertEquals($expected, $result);
Cache::delete('masking_test', 'mask_test');
diff --git a/lib/Cake/Test/Case/Console/Command/ApiShellTest.php b/lib/Cake/Test/Case/Console/Command/ApiShellTest.php
index 902e3e40f..f333b8528 100644
--- a/lib/Cake/Test/Case/Console/Command/ApiShellTest.php
+++ b/lib/Cake/Test/Case/Console/Command/ApiShellTest.php
@@ -44,7 +44,7 @@ class ApiShellTest extends CakeTestCase {
$this->Shell = $this->getMock(
'ApiShell',
array('in', 'out', 'createFile', 'hr', '_stop'),
- array( $out, $out, $in)
+ array($out, $out, $in)
);
}
diff --git a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
index ad8ddb112..12371d83e 100644
--- a/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
+++ b/lib/Cake/Test/Case/Controller/Component/CookieComponentTest.php
@@ -203,6 +203,24 @@ class CookieComponentTest extends CakeTestCase {
$this->assertEquals('value', $result);
}
+/**
+ * test that two write() calls use the expiry.
+ *
+ * @return void
+ */
+ public function testWriteMultipleShareExpiry() {
+ $this->Cookie->write('key1', 'value1', false);
+ $this->Cookie->write('key2', 'value2', false);
+
+ $name = $this->Cookie->name . '[key1]';
+ $result = $this->Controller->response->cookie($name);
+ $this->assertWithinMargin(time() + 10, $result['expire'], 2, 'Expiry time is wrong');
+
+ $name = $this->Cookie->name . '[key2]';
+ $result = $this->Controller->response->cookie($name);
+ $this->assertWithinMargin(time() + 10, $result['expire'], 2, 'Expiry time is wrong');
+ }
+
/**
* test write with distant future cookies
*
diff --git a/lib/Cake/Test/Case/Core/ObjectTest.php b/lib/Cake/Test/Case/Core/ObjectTest.php
index d445f1a8a..10b0cc7d7 100644
--- a/lib/Cake/Test/Case/Core/ObjectTest.php
+++ b/lib/Cake/Test/Case/Core/ObjectTest.php
@@ -600,7 +600,7 @@ class ObjectTest extends CakeTestCase {
$this->assertEquals(null, $result['plugin']);
$result = $this->object->requestAction('/request_action/params_pass/sort:desc/limit:5');
- $expected = array('sort' => 'desc', 'limit' => 5,);
+ $expected = array('sort' => 'desc', 'limit' => 5);
$this->assertEquals($expected, $result['named']);
$result = $this->object->requestAction(
diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
index 86b88740b..40c357053 100644
--- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
+++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
@@ -528,7 +528,7 @@ class ExceptionRendererTest extends CakeTestCase {
404
),
array(
- new PrivateActionException(array('controller' => 'PostsController' , 'action' => '_secretSauce')),
+ new PrivateActionException(array('controller' => 'PostsController', 'action' => '_secretSauce')),
array(
'/Private Method in PostsController<\/h2>/',
'/PostsController::<\/em>_secretSauce\(\)<\/em>/'
diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
index 16313f616..d34b80d78 100644
--- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
+++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
@@ -2407,7 +2407,7 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array(
- 'NOT' => array('Course.id' => null, 'Course.vet' => 'N', 'level_of_education_id' => array(912,999)),
+ 'NOT' => array('Course.id' => null, 'Course.vet' => 'N', 'level_of_education_id' => array(912, 999)),
'Enrollment.yearcompleted >' => '0')
);
$this->assertRegExp('/^\s*WHERE\s+\(NOT\s+\(`Course`\.`id` IS NULL\)\s+AND NOT\s+\(`Course`\.`vet`\s+=\s+\'N\'\)\s+AND NOT\s+\(`level_of_education_id` IN \(912, 999\)\)\)\s+AND\s+`Enrollment`\.`yearcompleted`\s+>\s+\'0\'\s*$/', $result);
@@ -3267,7 +3267,7 @@ class MysqlTest extends CakeTestCase {
$expected = '(1 + 1) = 2';
$this->assertEquals($expected, $result);
- $conditions = array('this_moment BETWEEN ? AND ?' => array(1,2));
+ $conditions = array('this_moment BETWEEN ? AND ?' => array(1, 2));
$expected = 'NOW() BETWEEN 1 AND 2';
$result = $this->Dbo->conditions($conditions, true, false, $Article);
$this->assertEquals($expected, $result);
diff --git a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php
index de05b5193..1ab298c04 100644
--- a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php
+++ b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php
@@ -836,16 +836,16 @@ class ModelIntegrationTest extends BaseModelTest {
$this->assertEquals('test_database_three', $Player->ArmorsPlayer->useDbConfig);
$players = $Player->find('all');
- $this->assertEquals(4 , count($players));
+ $this->assertEquals(4, count($players));
$playersGuilds = Hash::extract($players, '{n}.Guild.{n}.GuildsPlayer');
- $this->assertEquals(3 , count($playersGuilds));
+ $this->assertEquals(3, count($playersGuilds));
$playersArmors = Hash::extract($players, '{n}.Armor.{n}.ArmorsPlayer');
- $this->assertEquals(3 , count($playersArmors));
+ $this->assertEquals(3, count($playersArmors));
unset($players);
$larry = $Player->findByName('larry');
$larrysArmor = Hash::extract($larry, 'Armor.{n}.ArmorsPlayer');
- $this->assertEquals(1 , count($larrysArmor));
+ $this->assertEquals(1, count($larrysArmor));
$larry['Guild']['Guild'] = array(1, 3); // larry joins another guild
$larry['Armor']['Armor'] = array(2, 3); // purchases chainmail
@@ -854,9 +854,9 @@ class ModelIntegrationTest extends BaseModelTest {
$larry = $Player->findByName('larry');
$larrysGuild = Hash::extract($larry, 'Guild.{n}.GuildsPlayer');
- $this->assertEquals(2 , count($larrysGuild));
+ $this->assertEquals(2, count($larrysGuild));
$larrysArmor = Hash::extract($larry, 'Armor.{n}.ArmorsPlayer');
- $this->assertEquals(2 , count($larrysArmor));
+ $this->assertEquals(2, count($larrysArmor));
$Player->ArmorsPlayer->id = 3;
$Player->ArmorsPlayer->saveField('broken', true); // larry's cloak broke
diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php
index cf9b23a73..2239ddf2d 100644
--- a/lib/Cake/Test/Case/Model/ModelWriteTest.php
+++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php
@@ -4963,7 +4963,7 @@ class ModelWriteTest extends BaseModelTest {
$expected = array(
'Comment' => array(
array(
- 'comment' => array( 'This field cannot be left blank' )
+ 'comment' => array('This field cannot be left blank')
)
)
);
diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
index 59f27bcab..c1cbf199f 100644
--- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
+++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
@@ -1800,7 +1800,7 @@ class CakeEmailTest extends CakeTestCase {
$email->to('someone@example.com')->from('someone@example.com');
$result = $email->send('ってテーブルを作ってやってたらう');
$this->assertContains('Content-Type: text/plain; charset=ISO-2022-JP', $result['headers']);
- $this->assertContains(mb_convert_encoding('ってテーブルを作ってやってたらう','ISO-2022-JP'), $result['message']);
+ $this->assertContains(mb_convert_encoding('ってテーブルを作ってやってたらう', 'ISO-2022-JP'), $result['message']);
}
/**
@@ -1824,7 +1824,7 @@ class CakeEmailTest extends CakeTestCase {
$result = $email->send('①㈱');
$this->assertTextContains("Content-Type: text/plain; charset=ISO-2022-JP", $result['headers']);
$this->assertTextNotContains("Content-Type: text/plain; charset=ISO-2022-JP-MS", $result['headers']); // not charset=iso-2022-jp-ms
- $this->assertTextNotContains(mb_convert_encoding('①㈱','ISO-2022-JP-MS'), $result['message']);
+ $this->assertTextNotContains(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']);
}
/**
@@ -1848,7 +1848,7 @@ class CakeEmailTest extends CakeTestCase {
$result = $email->send('①㈱');
$this->assertTextContains("Content-Type: text/plain; charset=ISO-2022-JP", $result['headers']);
$this->assertTextNotContains("Content-Type: text/plain; charset=iso-2022-jp-ms", $result['headers']); // not charset=iso-2022-jp-ms
- $this->assertContains(mb_convert_encoding('①㈱','ISO-2022-JP-MS'), $result['message']);
+ $this->assertContains(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']);
}
protected function _checkContentTransferEncoding($message, $charset) {
diff --git a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
index 2ddecac72..a910bcd14 100644
--- a/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
+++ b/lib/Cake/Test/Case/Network/Http/HttpSocketTest.php
@@ -1547,8 +1547,8 @@ class HttpSocketTest extends CakeTestCase {
'name' => 'jim',
'items' => array(
'personal' => array(
- 'book'
- , 'pen'
+ 'book',
+ 'pen'
),
'ball'
)
@@ -1635,10 +1635,10 @@ class HttpSocketTest extends CakeTestCase {
$this->Socket->reset();
$expected = array(
- '\x22','\x28','\x29','\x3c','\x3e','\x40','\x2c','\x3b','\x3a','\x5c','\x2f','\x5b','\x5d','\x3f','\x3d','\x7b',
- '\x7d','\x20','\x00','\x01','\x02','\x03','\x04','\x05','\x06','\x07','\x08','\x09','\x0a','\x0b','\x0c','\x0d',
- '\x0e','\x0f','\x10','\x11','\x12','\x13','\x14','\x15','\x16','\x17','\x18','\x19','\x1a','\x1b','\x1c','\x1d',
- '\x1e','\x1f','\x7f'
+ '\x22', '\x28', '\x29', '\x3c', '\x3e', '\x40', '\x2c', '\x3b', '\x3a', '\x5c', '\x2f', '\x5b', '\x5d', '\x3f', '\x3d', '\x7b',
+ '\x7d', '\x20', '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d',
+ '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d',
+ '\x1e', '\x1f', '\x7f'
);
$r = $this->Socket->tokenEscapeChars();
$this->assertEquals($expected, $r);
diff --git a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
index d0d3c1742..298d648c8 100644
--- a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
+++ b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
@@ -923,7 +923,7 @@ class CakeRouteTest extends CakeTestCase {
public function testUTF8PatternOnSection() {
$route = new CakeRoute(
'/:section',
- array('plugin' => 'blogs', 'controller' => 'posts' , 'action' => 'index' ),
+ array('plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index'),
array(
'persist' => array('section'),
'section' => 'آموزش|weblog'
diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php
index abd30e42b..57e480978 100644
--- a/lib/Cake/Test/Case/Routing/RouterTest.php
+++ b/lib/Cake/Test/Case/Routing/RouterTest.php
@@ -957,7 +957,7 @@ class RouterTest extends CakeTestCase {
public function testUrlParsing() {
extract(Router::getNamedExpressions());
- Router::connect('/posts/:value/:somevalue/:othervalue/*', array('controller' => 'posts', 'action' => 'view'), array('value','somevalue', 'othervalue'));
+ Router::connect('/posts/:value/:somevalue/:othervalue/*', array('controller' => 'posts', 'action' => 'view'), array('value', 'somevalue', 'othervalue'));
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
$expected = array('value' => '2007', 'somevalue' => '08', 'othervalue' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' => '', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
$this->assertEquals($expected, $result);
diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php
index 43e9f1d23..a1b5fcb54 100644
--- a/lib/Cake/Test/Case/Utility/DebuggerTest.php
+++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php
@@ -408,6 +408,11 @@ TEXT;
false
TEXT;
$this->assertTextEquals($expected, $result);
+
+ $file = fopen('php://output', 'w');
+ fclose($file);
+ $result = Debugger::exportVar($file);
+ $this->assertTextEquals('unknown', $result);
}
/**
diff --git a/lib/Cake/Test/Case/Utility/SetTest.php b/lib/Cake/Test/Case/Utility/SetTest.php
index e4ecca3bc..ad5e76040 100644
--- a/lib/Cake/Test/Case/Utility/SetTest.php
+++ b/lib/Cake/Test/Case/Utility/SetTest.php
@@ -256,7 +256,7 @@ class SetTest extends CakeTestCase {
$a = array(
0 => array('Person' => array('name' => 'Jeff'), 'Friend' => array(array('name' => 'Nate'))),
- 1 => array('Person' => array('name' => 'Tracy'),'Friend' => array(array('name' => 'Lindsay'))),
+ 1 => array('Person' => array('name' => 'Tracy'), 'Friend' => array(array('name' => 'Lindsay'))),
2 => array('Person' => array('name' => 'Adam'), 'Friend' => array(array('name' => 'Bob')))
);
$b = array(
@@ -268,15 +268,15 @@ class SetTest extends CakeTestCase {
$this->assertEquals($a, $b);
$a = array(
- array(7,6,4),
- array(3,4,5),
- array(3,2,1),
+ array(7, 6, 4),
+ array(3, 4, 5),
+ array(3, 2, 1),
);
$b = array(
- array(3,2,1),
- array(3,4,5),
- array(7,6,4),
+ array(3, 2, 1),
+ array(3, 4, 5),
+ array(7, 6, 4),
);
$a = Set::sort($a, '{n}.{n}', 'asc');
@@ -884,7 +884,7 @@ class SetTest extends CakeTestCase {
$r = Set::extract('/file/.[type=application/x-zip-compressed]', $f);
$this->assertEquals($expected, $r);
- $expected = array(array('name' => 'zipfile.zip', 'type' => 'application/zip','tmp_name' => '/tmp/php178.tmp', 'error' => 0, 'size' => '564647'));
+ $expected = array(array('name' => 'zipfile.zip', 'type' => 'application/zip', 'tmp_name' => '/tmp/php178.tmp', 'error' => 0, 'size' => '564647'));
$r = Set::extract('/file/.[type=application/zip]', $f);
$this->assertEquals($expected, $r);
@@ -922,8 +922,8 @@ class SetTest extends CakeTestCase {
$this->assertEquals($expected, $r);
$expected = array(
- array('name' => 'zipfile.zip','type' => 'application/zip', 'tmp_name' => '/tmp/php178.tmp', 'error' => 0, 'size' => '564647'),
- array('name' => 'zipfile2.zip','type' => 'application/x zip compressed', 'tmp_name' => '/tmp/php179.tmp', 'error' => 0, 'size' => '354784')
+ array('name' => 'zipfile.zip', 'type' => 'application/zip', 'tmp_name' => '/tmp/php178.tmp', 'error' => 0, 'size' => '564647'),
+ array('name' => 'zipfile2.zip', 'type' => 'application/x zip compressed', 'tmp_name' => '/tmp/php179.tmp', 'error' => 0, 'size' => '354784')
);
$r = Set::extract('/file/.[tmp_name=/tmp\/php17/]', $f);
$this->assertEquals($expected, $r);
@@ -1110,7 +1110,7 @@ class SetTest extends CakeTestCase {
)
);
- $expected = array(7,2,1);
+ $expected = array(7, 2, 1);
$r = Set::extract('/CallType[name=Internal Voice]/../x/hour', $multiple);
$this->assertEquals($expected, $r);
@@ -1856,7 +1856,7 @@ class SetTest extends CakeTestCase {
$a = array(
array('User' => array('id' => 2, 'group_id' => 1,
- 'Data' => array('user' => 'mariano.iglesias','name' => 'Mariano Iglesias'))),
+ 'Data' => array('user' => 'mariano.iglesias', 'name' => 'Mariano Iglesias'))),
array('User' => array('id' => 14, 'group_id' => 2,
'Data' => array('user' => 'phpnut', 'name' => 'Larry E. Masters'))),
array('User' => array('id' => 25, 'group_id' => 1,
@@ -2470,8 +2470,8 @@ class SetTest extends CakeTestCase {
array(
'Post' => array('id' => '1', 'author_id' => '1', 'title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'),
'Author' => array('id' => '1', 'user' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31', 'test' => 'working'),
- )
- , array(
+ ),
+ array(
'Post' => array('id' => '2', 'author_id' => '3', 'title' => 'Second Post', 'body' => 'Second Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'),
'Author' => array('id' => '3', 'user' => 'larry', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31', 'test' => 'working'),
)
diff --git a/lib/Cake/Test/Case/Utility/StringTest.php b/lib/Cake/Test/Case/Utility/StringTest.php
index 9d0ba7aa2..efe89f033 100644
--- a/lib/Cake/Test/Case/Utility/StringTest.php
+++ b/lib/Cake/Test/Case/Utility/StringTest.php
@@ -180,7 +180,7 @@ class StringTest extends CakeTestCase {
$expected = "this is a long string with a few? params you know";
$this->assertEquals($expected, $result);
- $result = String::insert('update saved_urls set url = :url where id = :id', array('url' => 'http://www.testurl.com/param1:url/param2:id','id' => 1));
+ $result = String::insert('update saved_urls set url = :url where id = :id', array('url' => 'http://www.testurl.com/param1:url/param2:id', 'id' => 1));
$expected = "update saved_urls set url = http://www.testurl.com/param1:url/param2:id where id = 1";
$this->assertEquals($expected, $result);
@@ -330,14 +330,12 @@ TEXT;
$this->assertTextEquals($expected, $result, 'Text not wrapped.');
$result = String::wrap($text, array('width' => 20, 'wordWrap' => false));
- $expected = <<assertTextEquals($expected, $result, 'Text not wrapped.');
}
diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
index 517daf0fc..ba7792f73 100644
--- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -1388,7 +1388,7 @@ class FormHelperTest extends CakeTestCase {
$this->Form->input('Addresses.first_name', array('secure' => false));
$this->Form->input('Addresses.city', array('type' => 'textarea', 'secure' => false));
$this->Form->input('Addresses.zip', array(
- 'type' => 'select', 'options' => array(1,2), 'secure' => false
+ 'type' => 'select', 'options' => array(1, 2), 'secure' => false
));
$result = $this->Form->fields;
@@ -1719,7 +1719,7 @@ class FormHelperTest extends CakeTestCase {
$result = $this->Form->create('ValidateUser', array('type' => 'post', 'action' => 'add'));
$encoding = strtolower(Configure::read('App.encoding'));
$expected = array(
- 'form' => array('method' => 'post', 'action' => '/validate_users/add', 'id','accept-charset' => $encoding),
+ 'form' => array('method' => 'post', 'action' => '/validate_users/add', 'id', 'accept-charset' => $encoding),
'div' => array('style' => 'display:none;'),
'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'),
'/div'
@@ -2267,8 +2267,8 @@ class FormHelperTest extends CakeTestCase {
$this->assertRegExp('##', $result[1]);
$result = $this->Form->input('prueba', array(
- 'type' => 'time', 'timeFormat' => 24 , 'dateFormat' => 'DMY' , 'minYear' => 2008,
- 'maxYear' => date('Y') + 1 , 'interval' => 15
+ 'type' => 'time', 'timeFormat' => 24, 'dateFormat' => 'DMY', 'minYear' => 2008,
+ 'maxYear' => date('Y') + 1, 'interval' => 15
));
$result = explode(':', $result);
$this->assertNotRegExp('##', $result[1]);
diff --git a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php
index 1214330fd..9171db832 100644
--- a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php
@@ -873,7 +873,7 @@ class JsBaseEngineTest extends CakeTestCase {
$object = new JsEncodingObject();
$object->title = 'New thing';
- $object->indexes = array(5,6,7,8);
+ $object->indexes = array(5, 6, 7, 8);
$result = $this->JsEngine->object($object);
$this->assertEquals($expected, $result);
diff --git a/lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php b/lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php
index 34c6165f6..543665a11 100644
--- a/lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/MootoolsEngineHelperTest.php
@@ -266,7 +266,7 @@ class MootoolsEngineHelperTest extends CakeTestCase {
'start' => 'onStart',
'drag' => 'onDrag',
'stop' => 'onStop',
- 'snapGrid' => array(10,10),
+ 'snapGrid' => array(10, 10),
'wrapCallbacks' => false
));
$expected = '$("drag-me").makeDraggable({onComplete:onStop, onDrag:onDrag, onStart:onStart, snap:[10,10]});';
diff --git a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
index 9b82ddcdd..294c81367 100644
--- a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
@@ -290,7 +290,7 @@ class PaginatorHelperTest extends CakeTestCase {
Router::setRequestInfo(array(
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(),
'url' => array('url' => 'accounts/', 'mod_rewrite' => 'true')),
- array('base' => '/', 'here' => '/accounts/', 'webroot' => '/',)
+ array('base' => '/', 'here' => '/accounts/', 'webroot' => '/')
));
$this->Paginator->options(array('url' => array('param')));
diff --git a/lib/Cake/Test/Fixture/AcoTwoFixture.php b/lib/Cake/Test/Fixture/AcoTwoFixture.php
index 376a5c0fa..02d5485d7 100644
--- a/lib/Cake/Test/Fixture/AcoTwoFixture.php
+++ b/lib/Cake/Test/Fixture/AcoTwoFixture.php
@@ -47,13 +47,13 @@ class AcoTwoFixture extends CakeTestFixture {
*/
public $records = array(
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20),
- array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports','lft' => 2, 'rght' => 9),
+ array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports', 'lft' => 2, 'rght' => 9),
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6),
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'current', 'lft' => 4, 'rght' => 5),
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'update', 'lft' => 7, 'rght' => 8),
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'printers', 'lft' => 10, 'rght' => 19),
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'print', 'lft' => 11, 'rght' => 14),
- array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'lettersize','lft' => 12, 'rght' => 13),
+ array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'lettersize', 'lft' => 12, 'rght' => 13),
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'refill', 'lft' => 15, 'rght' => 16),
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'smash', 'lft' => 17, 'rght' => 18),
);
diff --git a/lib/Cake/Test/Fixture/AroTwoFixture.php b/lib/Cake/Test/Fixture/AroTwoFixture.php
index 576b07bda..33ce93efd 100644
--- a/lib/Cake/Test/Fixture/AroTwoFixture.php
+++ b/lib/Cake/Test/Fixture/AroTwoFixture.php
@@ -51,8 +51,8 @@ class AroTwoFixture extends CakeTestFixture {
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '2', 'alias' => 'managers', 'lft' => '6', 'rght' => '9'),
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '3', 'alias' => 'users', 'lft' => '10', 'rght' => '19'),
array('parent_id' => 2, 'model' => 'User', 'foreign_key' => '1', 'alias' => 'Bobs', 'lft' => '3', 'rght' => '4'),
- array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7' , 'rght' => '8'),
- array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11' , 'rght' => '12'),
+ array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7', 'rght' => '8'),
+ array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11', 'rght' => '12'),
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '4', 'alias' => 'Micheal', 'lft' => '13', 'rght' => '14'),
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '5', 'alias' => 'Peter', 'lft' => '15', 'rght' => '16'),
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '6', 'alias' => 'Milton', 'lft' => '17', 'rght' => '18'),
diff --git a/lib/Cake/Test/Fixture/FlagTreeFixture.php b/lib/Cake/Test/Fixture/FlagTreeFixture.php
index 8d3268e30..d4f4735d4 100644
--- a/lib/Cake/Test/Fixture/FlagTreeFixture.php
+++ b/lib/Cake/Test/Fixture/FlagTreeFixture.php
@@ -35,11 +35,11 @@ class FlagTreeFixture extends CakeTestFixture {
* @var array
*/
public $fields = array(
- 'id' => array('type' => 'integer','key' => 'primary'),
- 'name' => array('type' => 'string','null' => false),
+ 'id' => array('type' => 'integer', 'key' => 'primary'),
+ 'name' => array('type' => 'string', 'null' => false),
'parent_id' => 'integer',
- 'lft' => array('type' => 'integer','null' => false),
- 'rght' => array('type' => 'integer','null' => false),
- 'flag' => array('type' => 'integer','null' => false, 'length' => 1, 'default' => 0)
+ 'lft' => array('type' => 'integer', 'null' => false),
+ 'rght' => array('type' => 'integer', 'null' => false),
+ 'flag' => array('type' => 'integer', 'null' => false, 'length' => 1, 'default' => 0)
);
}
diff --git a/lib/Cake/Test/Fixture/NumberTreeFixture.php b/lib/Cake/Test/Fixture/NumberTreeFixture.php
index 6c3b37c82..251da0533 100644
--- a/lib/Cake/Test/Fixture/NumberTreeFixture.php
+++ b/lib/Cake/Test/Fixture/NumberTreeFixture.php
@@ -35,10 +35,10 @@ class NumberTreeFixture extends CakeTestFixture {
* @var array
*/
public $fields = array(
- 'id' => array('type' => 'integer','key' => 'primary'),
- 'name' => array('type' => 'string','null' => false),
+ 'id' => array('type' => 'integer', 'key' => 'primary'),
+ 'name' => array('type' => 'string', 'null' => false),
'parent_id' => 'integer',
- 'lft' => array('type' => 'integer','null' => false),
- 'rght' => array('type' => 'integer','null' => false)
+ 'lft' => array('type' => 'integer', 'null' => false),
+ 'rght' => array('type' => 'integer', 'null' => false)
);
}
diff --git a/lib/Cake/Test/Fixture/NumberTreeTwoFixture.php b/lib/Cake/Test/Fixture/NumberTreeTwoFixture.php
index 8a14ab158..04d28887e 100644
--- a/lib/Cake/Test/Fixture/NumberTreeTwoFixture.php
+++ b/lib/Cake/Test/Fixture/NumberTreeTwoFixture.php
@@ -35,11 +35,11 @@ class NumberTreeTwoFixture extends CakeTestFixture {
* @var array
*/
public $fields = array(
- 'id' => array('type' => 'integer','key' => 'primary'),
- 'name' => array('type' => 'string','null' => false),
+ 'id' => array('type' => 'integer', 'key' => 'primary'),
+ 'name' => array('type' => 'string', 'null' => false),
'number_tree_id' => array('type' => 'integer', 'null' => false),
'parent_id' => 'integer',
- 'lft' => array('type' => 'integer','null' => false),
- 'rght' => array('type' => 'integer','null' => false)
+ 'lft' => array('type' => 'integer', 'null' => false),
+ 'rght' => array('type' => 'integer', 'null' => false)
);
}
diff --git a/lib/Cake/Test/Fixture/UnconventionalTreeFixture.php b/lib/Cake/Test/Fixture/UnconventionalTreeFixture.php
index f260ba6e5..dfe7c760f 100644
--- a/lib/Cake/Test/Fixture/UnconventionalTreeFixture.php
+++ b/lib/Cake/Test/Fixture/UnconventionalTreeFixture.php
@@ -34,10 +34,10 @@ class UnconventionalTreeFixture extends CakeTestFixture {
* @var array
*/
public $fields = array(
- 'id' => array('type' => 'integer','key' => 'primary'),
- 'name' => array('type' => 'string','null' => false),
+ 'id' => array('type' => 'integer', 'key' => 'primary'),
+ 'name' => array('type' => 'string', 'null' => false),
'join' => 'integer',
- 'left' => array('type' => 'integer','null' => false),
- 'right' => array('type' => 'integer','null' => false),
+ 'left' => array('type' => 'integer', 'null' => false),
+ 'right' => array('type' => 'integer', 'null' => false),
);
}
diff --git a/lib/Cake/Utility/CakeNumber.php b/lib/Cake/Utility/CakeNumber.php
index bc65a47b0..266326dae 100644
--- a/lib/Cake/Utility/CakeNumber.php
+++ b/lib/Cake/Utility/CakeNumber.php
@@ -76,7 +76,7 @@ class CakeNumber {
*/
protected static $_currencyDefaults = array(
'wholeSymbol' => '', 'wholePosition' => 'before', 'fractionSymbol' => '', 'fractionPosition' => 'after',
- 'zero' => '0', 'places' => 2, 'thousands' => ',', 'decimals' => '.','negative' => '()', 'escape' => true,
+ 'zero' => '0', 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()', 'escape' => true,
'fractionExponent' => 2
);
@@ -348,7 +348,7 @@ class CakeNumber {
$symbolKey = 'whole';
$value = (float)$value;
if (!$value) {
- if ($options['zero'] !== 0 ) {
+ if ($options['zero'] !== 0) {
return $options['zero'];
}
} elseif ($value < 1 && $value > -1) {
diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php
index e1b5c2aec..c004bdbd1 100644
--- a/lib/Cake/Utility/Debugger.php
+++ b/lib/Cake/Utility/Debugger.php
@@ -500,6 +500,8 @@ class Debugger {
return strtolower(gettype($var));
case 'null':
return 'null';
+ case 'unknown':
+ return 'unknown';
default:
return self::_object($var, $depth - 1, $indent + 1);
}
@@ -591,24 +593,20 @@ class Debugger {
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
$ref = new ReflectionObject($var);
- $reflectionProperties = $ref->getProperties(ReflectionProperty::IS_PROTECTED);
- foreach ($reflectionProperties as $reflectionProperty) {
- $reflectionProperty->setAccessible(true);
- $property = $reflectionProperty->getValue($var);
+ $filters = array(
+ ReflectionProperty::IS_PROTECTED => 'protected',
+ ReflectionProperty::IS_PRIVATE => 'private',
+ );
+ foreach ($filters as $filter => $visibility) {
+ $reflectionProperties = $ref->getProperties($filter);
+ foreach ($reflectionProperties as $reflectionProperty) {
+ $reflectionProperty->setAccessible(true);
+ $property = $reflectionProperty->getValue($var);
- $value = self::_export($property, $depth - 1, $indent);
- $key = $reflectionProperty->name;
- $props[] = "[protected] $key => " . $value;
- }
-
- $reflectionProperties = $ref->getProperties(ReflectionProperty::IS_PRIVATE);
- foreach ($reflectionProperties as $reflectionProperty) {
- $reflectionProperty->setAccessible(true);
- $property = $reflectionProperty->getValue($var);
-
- $value = self::_export($property, $depth - 1, $indent);
- $key = $reflectionProperty->name;
- $props[] = "[private] $key => " . $value;
+ $value = self::_export($property, $depth - 1, $indent);
+ $key = $reflectionProperty->name;
+ $props[] = sprintf('[%s] %s => %s', $visibility, $key, $value);
+ }
}
}
diff --git a/lib/Cake/Utility/String.php b/lib/Cake/Utility/String.php
index b3457cecb..e8313aead 100644
--- a/lib/Cake/Utility/String.php
+++ b/lib/Cake/Utility/String.php
@@ -524,7 +524,7 @@ class String {
}
}
- $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);
+ $truncate .= mb_substr($tag[3], 0, $left + $entitiesLength);
break;
} else {
$truncate .= $tag[3];
diff --git a/lib/Cake/View/Elements/sql_dump.ctp b/lib/Cake/View/Elements/sql_dump.ctp
index ed9917fb0..fe2897cfe 100644
--- a/lib/Cake/View/Elements/sql_dump.ctp
+++ b/lib/Cake/View/Elements/sql_dump.ctp
@@ -58,19 +58,27 @@ if ($noLogs || isset($_forced_from_dbo_)):
}
foreach ($i['params'] as $bindKey => $bindVal) {
if ($bindType === true) {
- $bindParam .= h($bindKey) ." => " . h($bindVal) . ", ";
+ $bindParam .= h($bindKey) . " => " . h($bindVal) . ", ";
} else {
$bindParam .= h($bindVal) . ", ";
}
}
$i['query'] .= " , params[ " . rtrim($bindParam, ', ') . " ]";
}
- echo "" . ($k + 1) . " | " . h($i['query']) . " | {$i['error']} | {$i['affected']} | {$i['numRows']} | {$i['took']} |
\n";
+ printf('%d | %s | %s | %d | %d | %d |
%s',
+ $k + 1,
+ h($i['query']),
+ $i['error'],
+ $i['affected'],
+ $i['numRows'],
+ $i['took'],
+ "\n"
+ );
endforeach;
?>
Encountered unexpected $sqlLogs cannot generate SQL log';
+ printf('%s
', __d('cake_dev', 'Encountered unexpected %s. Cannot generate SQL log.', '$sqlLogs'));
endif;
diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php
index 2916f020b..109a29aa7 100644
--- a/lib/Cake/View/Helper.php
+++ b/lib/Cake/View/Helper.php
@@ -483,7 +483,7 @@ class Helper extends Object {
*/
protected function _formatAttribute($key, $value, $escape = true) {
if (is_array($value)) {
- $value = implode(' ' , $value);
+ $value = implode(' ', $value);
}
if (is_numeric($key)) {
return sprintf($this->_minimizedAttributeFormat, $value, $value);