From 87a3937def5298b7431ddb4ab936b39e1d3822e3 Mon Sep 17 00:00:00 2001 From: Majna Date: Wed, 30 Nov 2011 20:06:07 +0100 Subject: [PATCH 1/5] Add visibility keyword for 'helpers' property in controller template. --- lib/Cake/Console/Templates/default/classes/controller.ctp | 2 +- .../Test/Case/Console/Command/Task/ControllerTaskTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp index eec49119cfc..f5bc7d660de 100644 --- a/lib/Cake/Console/Templates/default/classes/controller.ctp +++ b/lib/Cake/Console/Templates/default/classes/controller.ctp @@ -50,7 +50,7 @@ class Controller extends App assertContains(' * @property AclComponent $Acl', $result); $this->assertContains(' * @property AuthComponent $Auth', $result); $this->assertContains('class ArticlesController extends AppController', $result); - $this->assertContains("\$components = array('Acl', 'Auth')", $result); - $this->assertContains("\$helpers = array('Ajax', 'Time')", $result); + $this->assertContains("public \$components = array('Acl', 'Auth')", $result); + $this->assertContains("public \$helpers = array('Ajax', 'Time')", $result); $this->assertContains("--actions--", $result); $result = $this->Task->bake('Articles', 'scaffold', $helpers, $components); From 4b292b139ed70968554f49dac6dfbb1ab4cc8e78 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 30 Nov 2011 21:00:07 -0500 Subject: [PATCH 2/5] Fix build, I'm a dork. --- lib/Cake/Cache/Cache.php | 2 +- lib/Cake/Test/Case/Cache/CacheTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index 3b933ebacce..a5676c7811d 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -387,7 +387,7 @@ public static function decrement($key, $offset = 1, $config = 'default') { $settings = self::settings($config); if (empty($settings)) { - return null; + return false; } if (!self::isInitialized($config)) { return false; diff --git a/lib/Cake/Test/Case/Cache/CacheTest.php b/lib/Cake/Test/Case/Cache/CacheTest.php index f526a2cfbd8..7c8369f1269 100644 --- a/lib/Cake/Test/Case/Cache/CacheTest.php +++ b/lib/Cake/Test/Case/Cache/CacheTest.php @@ -135,8 +135,8 @@ public function testInvalidConfig() { public function testReadNonExistingConfig() { $this->assertFalse(Cache::read('key', 'totally fake')); $this->assertFalse(Cache::write('key', 'value', 'totally fake')); - $this->assertFalse(Cache::increment('key', 'value', 'totally fake')); - $this->assertFalse(Cache::decrement('key', 'value', 'totally fake')); + $this->assertFalse(Cache::increment('key', 1, 'totally fake')); + $this->assertFalse(Cache::decrement('key', 1, 'totally fake')); } /** From 65b87af6c0488d67076f75a72fb50d64bd4ecd33 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 30 Nov 2011 21:14:39 -0500 Subject: [PATCH 3/5] Adding set to autoloader. Fixes #2319 --- lib/Cake/Model/Model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index e3ac175ad6a..1d0ec60f023 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -25,6 +25,7 @@ App::uses('ClassRegistry', 'Utility'); App::uses('Validation', 'Utility'); App::uses('String', 'Utility'); +App::uses('Set', 'Utility'); App::uses('BehaviorCollection', 'Model'); App::uses('ModelBehavior', 'Model'); App::uses('ConnectionManager', 'Model'); From 49708ec837d6e9936124f11aa95ac1501f1d02e6 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 30 Nov 2011 21:49:18 -0500 Subject: [PATCH 4/5] Fix cachefiles being generated with " Cache files with SQLite should not contain " Fixes #2323 --- lib/Cake/Model/Datasource/Database/Sqlite.php | 2 +- .../Test/Case/Model/Datasource/Database/SqliteTest.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index 6a4cdec6ee3..c529ff796f6 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -165,7 +165,7 @@ public function describe($model) { if ($cache != null) { return $cache; } - $table = $this->fullTableName($model); + $table = $this->fullTableName($model, false); $fields = array(); $result = $this->_execute('PRAGMA table_info(' . $table . ')'); diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php index 95fc709bdf5..fac0bb2ac1a 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php @@ -262,6 +262,10 @@ public function testBuildColumn() { public function testDescribe() { $this->loadFixtures('User'); $Model = new Model(array('name' => 'User', 'ds' => 'test', 'table' => 'users')); + + $this->Dbo->cacheSources = true; + Configure::write('Cache.disable', false); + $result = $this->Dbo->describe($Model); $expected = array( 'id' => array( @@ -300,6 +304,9 @@ public function testDescribe() { $result = $this->Dbo->describe($Model->useTable); $this->assertEquals($expected, $result); + + $result = Cache::read('test_users', '_cake_model_'); + $this->assertEquals($expected, $result); } /** From 94e119fe67720d535bae697902cdf2bf1e706e67 Mon Sep 17 00:00:00 2001 From: Kyle Robinson Young Date: Wed, 30 Nov 2011 23:21:31 -0800 Subject: [PATCH 5/5] Adhere to code formatting standard --- lib/Cake/Cache/Cache.php | 2 +- lib/Cake/Cache/Engine/FileEngine.php | 4 +- lib/Cake/Cache/Engine/MemcacheEngine.php | 4 +- lib/Cake/Console/Command/ConsoleShell.php | 2 +- .../Console/Command/Task/DbConfigTask.php | 16 +-- lib/Cake/Console/Command/Task/ModelTask.php | 16 +-- lib/Cake/Console/Command/Task/ProjectTask.php | 2 +- lib/Cake/Console/Command/Task/TestTask.php | 2 +- lib/Cake/Console/Command/Task/ViewTask.php | 8 +- lib/Cake/Console/Command/UpgradeShell.php | 2 +- lib/Cake/Console/Shell.php | 4 +- .../default/actions/controller_actions.ctp | 2 +- .../Templates/skel/Config/Schema/db_acl.php | 42 +++--- .../Templates/skel/Config/Schema/i18n.php | 12 +- .../Templates/skel/Config/Schema/sessions.php | 6 +- .../Console/Templates/skel/Config/core.php | 20 +-- .../Templates/skel/View/Layouts/default.ctp | 2 +- .../skel/webroot/css/cake.generic.css | 134 +++++++++--------- lib/Cake/I18n/I18n.php | 2 +- .../Model/Behavior/ContainableBehavior.php | 2 +- lib/Cake/Model/Behavior/TranslateBehavior.php | 2 +- lib/Cake/Model/CakeSchema.php | 2 +- lib/Cake/Model/Datasource/Database/Sqlite.php | 2 +- lib/Cake/Model/Datasource/DboSource.php | 4 +- lib/Cake/Model/Model.php | 2 +- lib/Cake/Test/Case/BasicsTest.php | 2 +- lib/Cake/Test/Case/Cache/CacheTest.php | 8 +- .../Test/Case/Cache/Engine/FileEngineTest.php | 6 +- .../Case/Cache/Engine/MemcacheEngineTest.php | 6 +- .../Case/Cache/Engine/XcacheEngineTest.php | 2 +- .../Component/AuthComponentTest.php | 2 +- .../Component/CookieComponentTest.php | 36 ++--- .../Test/Case/Controller/ControllerTest.php | 2 +- .../Test/Case/Controller/ScaffoldTest.php | 10 +- .../Behavior/ContainableBehaviorTest.php | 2 +- .../Model/Behavior/TreeBehaviorNumberTest.php | 4 +- .../Model/Behavior/TreeBehaviorScopedTest.php | 2 +- .../Case/Model/BehaviorCollectionTest.php | 8 +- .../Model/Datasource/Database/MysqlTest.php | 10 +- .../Datasource/Database/PostgresTest.php | 24 ++-- .../Test/Case/Model/ModelIntegrationTest.php | 54 +++---- lib/Cake/Test/Case/Model/ModelReadTest.php | 44 +++--- lib/Cake/Test/Case/Model/ModelWriteTest.php | 30 ++-- lib/Cake/Test/Case/Model/models.php | 34 ++--- .../Test/Case/Network/Http/HttpSocketTest.php | 2 +- lib/Cake/Test/Case/Routing/DispatcherTest.php | 24 ++-- lib/Cake/Test/Case/Routing/RouterTest.php | 36 ++--- lib/Cake/Test/Case/Utility/FileTest.php | 2 +- lib/Cake/Test/Case/Utility/SetTest.php | 68 ++++----- lib/Cake/Test/Case/Utility/XmlTest.php | 2 +- .../Test/Case/View/Helper/FormHelperTest.php | 10 +- .../Test/Case/View/Helper/HtmlHelperTest.php | 8 +- .../Case/View/Helper/NumberHelperTest.php | 20 +-- .../Case/View/Helper/PaginatorHelperTest.php | 12 +- .../Test/Case/View/Helper/RssHelperTest.php | 6 +- .../Test/Case/View/Helper/TextHelperTest.php | 12 +- .../Test/Case/View/Helper/TimeHelperTest.php | 8 +- lib/Cake/Test/Case/View/HelperTest.php | 2 +- lib/Cake/Test/Case/View/ScaffoldViewTest.php | 10 +- lib/Cake/Test/Fixture/AcoFixture.php | 2 +- lib/Cake/Test/Fixture/AcoTwoFixture.php | 2 +- lib/Cake/Test/Fixture/AroTwoFixture.php | 20 +-- .../Fixture/ArticleFeaturedsTagsFixture.php | 2 +- lib/Cake/Test/Fixture/ArticlesTagFixture.php | 2 +- .../Fixture/BakeArticlesBakeTagFixture.php | 2 +- lib/Cake/Test/Fixture/BakeCommentFixture.php | 4 +- lib/Cake/Test/Fixture/CommentFixture.php | 4 +- ...rCacheUserNonstandardPrimaryKeyFixture.php | 4 +- lib/Cake/Test/Fixture/DatatypeFixture.php | 2 +- .../Test/Fixture/GroupUpdateAllFixture.php | 6 +- .../Test/Fixture/ProductUpdateAllFixture.php | 40 +++--- lib/Cake/Test/Fixture/StoriesTagFixture.php | 2 +- .../Test/Fixture/TestPluginCommentFixture.php | 4 +- .../TestPlugin/Config/Schema/schema.php | 14 +- .../Test/test_app/View/Layouts/default.ctp | 2 +- lib/Cake/Utility/Folder.php | 2 +- lib/Cake/Utility/Inflector.php | 2 +- lib/Cake/Utility/Set.php | 2 +- lib/Cake/View/Helper.php | 4 +- lib/Cake/View/Helper/HtmlHelper.php | 2 +- lib/Cake/View/Helper/NumberHelper.php | 8 +- lib/Cake/View/Helper/PaginatorHelper.php | 6 +- lib/Cake/View/Layouts/default.ctp | 2 +- lib/Cake/View/Scaffolds/form.ctp | 4 +- 84 files changed, 474 insertions(+), 474 deletions(-) diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index a5676c7811d..67500e2bf63 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -505,7 +505,7 @@ abstract class CacheEngine { */ public function init($settings = array()) { $this->settings = array_merge( - array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100), + array('prefix' => 'cake_', 'duration' => 3600, 'probability' => 100), $this->settings, $settings ); diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index c53c5ad33f7..2e3736aeac8 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -66,8 +66,8 @@ class FileEngine extends CacheEngine { public function init($settings = array()) { parent::init(array_merge( array( - 'engine' => 'File', 'path' => CACHE, 'prefix'=> 'cake_', 'lock'=> true, - 'serialize'=> true, 'isWindows' => false, 'mask' => 0664 + 'engine' => 'File', 'path' => CACHE, 'prefix' => 'cake_', 'lock' => true, + 'serialize' => true, 'isWindows' => false, 'mask' => 0664 ), $settings )); diff --git a/lib/Cake/Cache/Engine/MemcacheEngine.php b/lib/Cake/Cache/Engine/MemcacheEngine.php index 7013a5f4b62..db798e4b05c 100644 --- a/lib/Cake/Cache/Engine/MemcacheEngine.php +++ b/lib/Cake/Cache/Engine/MemcacheEngine.php @@ -59,10 +59,10 @@ public function init($settings = array()) { return false; } parent::init(array_merge(array( - 'engine'=> 'Memcache', + 'engine' => 'Memcache', 'prefix' => Inflector::slug(APP_DIR) . '_', 'servers' => array('127.0.0.1'), - 'compress'=> false, + 'compress' => false, 'persistent' => true ), $settings) ); diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index dfd65eacb91..473fd64ff37 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -117,7 +117,7 @@ public function help() { $out .= "\n"; $out .= "will return something like the following:"; $out .= "\n"; - $out .= "\tarray ("; + $out .= "\tarray("; $out .= "\t [...]"; $out .= "\t 'controller' => 'posts',"; $out .= "\t 'action' => 'view',"; diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index 74ce2f6ce2b..a47762c1932 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -39,14 +39,14 @@ class DbConfigTask extends AppShell { */ protected $_defaultConfig = array( 'name' => 'default', - 'datasource'=> 'Database/Mysql', - 'persistent'=> 'false', - 'host'=> 'localhost', - 'login'=> 'root', - 'password'=> 'password', - 'database'=> 'project_name', - 'schema'=> null, - 'prefix'=> null, + 'datasource' => 'Database/Mysql', + 'persistent' => 'false', + 'host' => 'localhost', + 'login' => 'root', + 'password' => 'password', + 'database' => 'project_name', + 'schema' => null, + 'prefix' => null, 'encoding' => null, 'port' => null ); diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index a01e78413b6..fd8e92e854c 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -220,13 +220,13 @@ protected function _interactive() { } $prompt = __d('cake_console', "Would you like to supply validation criteria \nfor the fields in your model?"); - $wannaDoValidation = $this->in($prompt, array('y','n'), 'y'); + $wannaDoValidation = $this->in($prompt, array('y', 'n'), 'y'); if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') { $validate = $this->doValidation($tempModel); } $prompt = __d('cake_console', "Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?"); - $wannaDoAssoc = $this->in($prompt, array('y','n'), 'y'); + $wannaDoAssoc = $this->in($prompt, array('y', 'n'), 'y'); if (strtolower($wannaDoAssoc) == 'y') { $associations = $this->doAssociations($tempModel); } @@ -258,7 +258,7 @@ protected function _interactive() { } $this->hr(); - $looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y','n'), 'y'); + $looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y'); if (strtolower($looksGood) == 'y') { $vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField'); @@ -486,7 +486,7 @@ public function doAssociations($model) { } $associations = array( - 'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array() + 'belongsTo' => array(), 'hasMany' => array(), 'hasOne' => array(), 'hasAndBelongsToMany' => array() ); $associations = $this->findBelongsTo($model, $associations); @@ -635,7 +635,7 @@ public function confirmAssociations($model, $associations) { if (!empty($associations[$type])) { foreach ($associations[$type] as $i => $assoc) { $prompt = "{$model->name} {$type} {$assoc['alias']}?"; - $response = $this->in($prompt, array('y','n'), 'y'); + $response = $this->in($prompt, array('y', 'n'), 'y'); if ('n' == strtolower($response)) { unset($associations[$type][$i]); @@ -658,7 +658,7 @@ public function confirmAssociations($model, $associations) { */ public function doMoreAssociations($model, $associations) { $prompt = __d('cake_console', 'Would you like to define some additional model associations?'); - $wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n'); + $wannaDoMoreAssoc = $this->in($prompt, array('y', 'n'), 'n'); $possibleKeys = $this->_generatePossibleKeys(); while (strtolower($wannaDoMoreAssoc) == 'y') { $assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); @@ -710,7 +710,7 @@ public function doMoreAssociations($model, $associations) { $associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey; $associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable; } - $wannaDoMoreAssoc = $this->in(__d('cake_console', 'Define another association?'), array('y','n'), 'y'); + $wannaDoMoreAssoc = $this->in(__d('cake_console', 'Define another association?'), array('y', 'n'), 'y'); } return $associations; } @@ -832,7 +832,7 @@ public function getTable($modelName, $useDbConfig = null) { if (array_search($useTable, $this->_tables) === false) { $this->out(); $this->out(__d('cake_console', "Given your model named '%s',\nCake would expect a database table named '%s'", $modelName, $fullTableName)); - $tableIsGood = $this->in(__d('cake_console', 'Do you want to use this table?'), array('y','n'), 'y'); + $tableIsGood = $this->in(__d('cake_console', 'Do you want to use this table?'), array('y', 'n'), 'y'); } if (strtolower($tableIsGood) == 'n') { $useTable = $this->in(__d('cake_console', 'What is the name of the table?')); diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index e9e919cfb30..b4ea713d7f5 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -62,7 +62,7 @@ public function execute() { $response = false; while ($response == false && is_dir($project) === true && file_exists($project . 'Config' . 'core.php')) { $prompt = __d('cake_console', 'A project already exists in this location: %s Overwrite?', $project); - $response = $this->in($prompt, array('y','n'), 'n'); + $response = $this->in($prompt, array('y', 'n'), 'n'); if (strtolower($response) === 'n') { $response = $project = false; } diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index d46a407d7e2..503ddd77f3f 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -402,7 +402,7 @@ protected function _addFixture($name) { * @return array Array of fixtures the user wants to add. */ public function getUserFixtures() { - $proceed = $this->in(__d('cake_console', 'Bake could not detect fixtures, would you like to add some?'), array('y','n'), 'n'); + $proceed = $this->in(__d('cake_console', 'Bake could not detect fixtures, would you like to add some?'), array('y', 'n'), 'n'); $fixtures = array(); if (strtolower($proceed) == 'y') { $fixtureList = $this->in(__d('cake_console', "Please provide a comma separated list of the fixtures names you'd like to use.\nExample: 'app.comment, app.post, plugin.forums.post'")); diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 8efc8334578..b125d0791af 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -215,9 +215,9 @@ protected function _interactive() { } $prompt = __d('cake_console', "Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models)."); - $wannaDoScaffold = $this->in($prompt, array('y','n'), 'y'); + $wannaDoScaffold = $this->in($prompt, array('y', 'n'), 'y'); - $wannaDoAdmin = $this->in(__d('cake_console', "Would you like to create the views for admin routing?"), array('y','n'), 'n'); + $wannaDoAdmin = $this->in(__d('cake_console', "Would you like to create the views for admin routing?"), array('y', 'n'), 'n'); if (strtolower($wannaDoScaffold) == 'y' || strtolower($wannaDoAdmin) == 'y') { $vars = $this->_loadController(); @@ -292,7 +292,7 @@ protected function _loadController() { $pluralHumanName = $this->_pluralHumanName($this->controllerName); return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', - 'singularHumanName', 'pluralHumanName', 'fields','associations'); + 'singularHumanName', 'pluralHumanName', 'fields', 'associations'); } /** @@ -330,7 +330,7 @@ public function customAction() { $this->out(__d('cake_console', 'Action Name: %s', $action)); $this->out(__d('cake_console', 'Path: %s', $this->getPath() . $this->controllerName . DS . Inflector::underscore($action) . ".ctp")); $this->hr(); - $looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y','n'), 'y'); + $looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y'); if (strtolower($looksGood) == 'y') { $this->bake($action, ' '); $this->_stop(); diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index c9d52e0bc13..05505835afb 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -764,7 +764,7 @@ public function getOptionParser() { 'help' => __d('cake_console', 'Use git command for moving files around.'), 'boolean' => true ), - 'dry-run'=> array( + 'dry-run' => array( 'short' => 'd', 'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'), 'boolean' => true diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php index f3e5d4eaa33..c748b8226a1 100644 --- a/lib/Cake/Console/Shell.php +++ b/lib/Cake/Console/Shell.php @@ -366,7 +366,7 @@ public function runCommand($command, $argv) { return $this->_displayHelp($command); } - if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) { + if (($isTask || $isMethod || $isMain) && $command !== 'execute') { $this->startup(); } @@ -672,7 +672,7 @@ protected function _checkUnitTest() { return true; } $prompt = __d('cake_console', 'PHPUnit is not installed. Do you want to bake unit test files anyway?'); - $unitTest = $this->in($prompt, array('y','n'), 'y'); + $unitTest = $this->in($prompt, array('y', 'n'), 'y'); $result = strtolower($unitTest) == 'y' || strtolower($unitTest) == 'yes'; if ($result) { diff --git a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp index e61424fdbe1..ab7037f1f2c 100644 --- a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp +++ b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp @@ -143,7 +143,7 @@ if ($this->->delete()) { $this->Session->setFlash(__(' deleted')); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); $this->flash(__(' deleted'), array('action' => 'index')); diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php index 7133acb197a..176999dfebe 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php @@ -39,35 +39,35 @@ public function after($event = array()) { } public $acos = array( - 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'model' => array('type'=>'string', 'null' => true), - 'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'alias' => array('type'=>'string', 'null' => true), - 'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'model' => array('type' => 'string', 'null' => true), + 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'alias' => array('type' => 'string', 'null' => true), + 'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); public $aros = array( - 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'model' => array('type'=>'string', 'null' => true), - 'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'alias' => array('type'=>'string', 'null' => true), - 'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), - 'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'parent_id' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'model' => array('type' => 'string', 'null' => true), + 'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'alias' => array('type' => 'string', 'null' => true), + 'lft' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), + 'rght' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); public $aros_acos = array( - 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), - 'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10), - '_create' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), - '_read' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), - '_update' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), - '_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'), + 'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10), + '_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), + '_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), + '_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), + '_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1)) ); diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php index 377645796a0..d5b542a9cb4 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/i18n.php @@ -39,12 +39,12 @@ public function after($event = array()) { } public $i18n = array( - 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), - 'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'), - 'model' => array('type'=>'string', 'null' => false, 'key' => 'index'), - 'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), - 'field' => array('type'=>'string', 'null' => false, 'key' => 'index'), - 'content' => array('type'=>'text', 'null' => true, 'default' => NULL), + 'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), + 'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'), + 'model' => array('type' => 'string', 'null' => false, 'key' => 'index'), + 'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'), + 'field' => array('type' => 'string', 'null' => false, 'key' => 'index'), + 'content' => array('type' => 'text', 'null' => true, 'default' => NULL), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0)) ); diff --git a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php index 4e2ba5f55af..bd54edcfccb 100644 --- a/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php +++ b/lib/Cake/Console/Templates/skel/Config/Schema/sessions.php @@ -39,9 +39,9 @@ public function after($event = array()) { } public $cake_sessions = array( - 'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'), - 'data' => array('type'=>'text', 'null' => true, 'default' => NULL), - 'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL), + 'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'), + 'data' => array('type' => 'text', 'null' => true, 'default' => NULL), + 'expires' => array('type' => 'integer', 'null' => true, 'default' => NULL), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index 97d26629d10..cf69e312ba8 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -239,8 +239,8 @@ * * Cache::config('default', array( * 'engine' => 'File', //[required] - * 'duration'=> 3600, //[optional] - * 'probability'=> 100, //[optional] + * 'duration' => 3600, //[optional] + * 'probability' => 100, //[optional] * 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path * 'prefix' => 'cake_', //[optional] prefix every cache file with this string * 'lock' => false, //[optional] use file locking @@ -251,8 +251,8 @@ * * Cache::config('default', array( * 'engine' => 'Apc', //[required] - * 'duration'=> 3600, //[optional] - * 'probability'=> 100, //[optional] + * 'duration' => 3600, //[optional] + * 'probability' => 100, //[optional] * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * )); * @@ -260,8 +260,8 @@ * * Cache::config('default', array( * 'engine' => 'Xcache', //[required] - * 'duration'=> 3600, //[optional] - * 'probability'=> 100, //[optional] + * 'duration' => 3600, //[optional] + * 'probability' => 100, //[optional] * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * 'user' => 'user', //user from xcache.admin.user settings * 'password' => 'password', //plaintext password (xcache.admin.pass) @@ -271,8 +271,8 @@ * * Cache::config('default', array( * 'engine' => 'Memcache', //[required] - * 'duration'=> 3600, //[optional] - * 'probability'=> 100, //[optional] + * 'duration' => 3600, //[optional] + * 'probability' => 100, //[optional] * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * 'servers' => array( * '127.0.0.1:11211' // localhost, default port 11211 @@ -285,8 +285,8 @@ * * Cache::config('default', array( * 'engine' => 'Wincache', //[required] - * 'duration'=> 3600, //[optional] - * 'probability'=> 100, //[optional] + * 'duration' => 3600, //[optional] + * 'probability' => 100, //[optional] * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * )); */ diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/default.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/default.ctp index 97010d1d870..c20d170e854 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/default.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/default.ctp @@ -46,7 +46,7 @@