diff --git a/app/View/Pages/home.ctp b/app/View/Pages/home.ctp
index 4184f1cd9..a8f69d524 100644
--- a/app/View/Pages/home.ctp
+++ b/app/View/Pages/home.ctp
@@ -24,7 +24,7 @@ App::uses('Debugger', 'Utility');
For updates and important announcements, visit http://cakefest.org
-
+
0):
Debugger::checkSecurityKeys();
diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php
index e80ca5b02..67500e2bf 100644
--- a/lib/Cake/Cache/Cache.php
+++ b/lib/Cake/Cache/Cache.php
@@ -285,7 +285,7 @@ class Cache {
$settings = self::settings($config);
if (empty($settings)) {
- return null;
+ return false;
}
if (!self::isInitialized($config)) {
return false;
@@ -335,7 +335,7 @@ class Cache {
$settings = self::settings($config);
if (empty($settings)) {
- return null;
+ return false;
}
if (!self::isInitialized($config)) {
return false;
@@ -360,7 +360,7 @@ class Cache {
$settings = self::settings($config);
if (empty($settings)) {
- return null;
+ return false;
}
if (!self::isInitialized($config)) {
return false;
@@ -387,7 +387,7 @@ class Cache {
$settings = self::settings($config);
if (empty($settings)) {
- return null;
+ return false;
}
if (!self::isInitialized($config)) {
return false;
@@ -422,7 +422,7 @@ class Cache {
$settings = self::settings($config);
if (empty($settings)) {
- return null;
+ return false;
}
if (!self::isInitialized($config)) {
return false;
@@ -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 c53c5ad33..5357324b5 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
));
@@ -84,7 +84,7 @@ class FileEngine extends CacheEngine {
/**
* Garbage collection. Permanently remove all expired and deleted data
*
- * @return boolean True if garbage collection was succesful, false on failure
+ * @return boolean True if garbage collection was successful, false on failure
*/
public function gc() {
return $this->clear(true);
@@ -273,7 +273,7 @@ class FileEngine extends CacheEngine {
/**
* Sets the current cache key this class is managing, and creates a writable SplFileObject
- * for the cache file the key is refering to.
+ * for the cache file the key is referring to.
*
* @param string $key The key
* @param boolean $createKey Whether the key should be created if it doesn't exists, or not
diff --git a/lib/Cake/Cache/Engine/MemcacheEngine.php b/lib/Cake/Cache/Engine/MemcacheEngine.php
index 7013a5f4b..db798e4b0 100644
--- a/lib/Cake/Cache/Engine/MemcacheEngine.php
+++ b/lib/Cake/Cache/Engine/MemcacheEngine.php
@@ -59,10 +59,10 @@ class MemcacheEngine extends CacheEngine {
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/AclShell.php b/lib/Cake/Console/Command/AclShell.php
index b2dec95d3..3e1ba5b8d 100644
--- a/lib/Cake/Console/Command/AclShell.php
+++ b/lib/Cake/Console/Command/AclShell.php
@@ -15,6 +15,8 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('AppShell', 'Console/Command');
App::uses('ComponentCollection', 'Controller');
App::uses('AclComponent', 'Controller/Component');
App::uses('DbAcl', 'Model');
@@ -25,7 +27,7 @@ App::uses('DbAcl', 'Model');
*
* @package Cake.Console.Command
*/
-class AclShell extends Shell {
+class AclShell extends AppShell {
/**
* Contains instance of AclComponent
diff --git a/lib/Cake/Console/Command/ApiShell.php b/lib/Cake/Console/Command/ApiShell.php
index 6b7c3b2d0..3c0e0f834 100644
--- a/lib/Cake/Console/Command/ApiShell.php
+++ b/lib/Cake/Console/Command/ApiShell.php
@@ -17,6 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('AppShell', 'Console/Command');
App::uses('File', 'Utility');
/**
@@ -24,7 +26,7 @@ App::uses('File', 'Utility');
*
* @package Cake.Console.Command
*/
-class ApiShell extends Shell {
+class ApiShell extends AppShell {
/**
* Map between short name for paths and real paths.
diff --git a/lib/Cake/Console/AppShell.php b/lib/Cake/Console/Command/AppShell.php
similarity index 96%
rename from lib/Cake/Console/AppShell.php
rename to lib/Cake/Console/Command/AppShell.php
index b3f565622..7cbf6e006 100644
--- a/lib/Cake/Console/AppShell.php
+++ b/lib/Cake/Console/Command/AppShell.php
@@ -16,6 +16,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Shell', 'Console');
+
/**
* This is a placeholder class.
* Create the same file in app/Console/Command/AppShell.php
diff --git a/lib/Cake/Console/Command/BakeShell.php b/lib/Cake/Console/Command/BakeShell.php
index 82e67b3e5..05e678e92 100644
--- a/lib/Cake/Console/Command/BakeShell.php
+++ b/lib/Cake/Console/Command/BakeShell.php
@@ -20,6 +20,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('Model', 'Model');
/**
@@ -28,7 +29,7 @@ App::uses('Model', 'Model');
* @package Cake.Console.Command
* @link http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html
*/
-class BakeShell extends Shell {
+class BakeShell extends AppShell {
/**
* Contains tasks to load and instantiate
@@ -184,7 +185,7 @@ class BakeShell extends Shell {
}
App::uses($controller . 'Controller', 'Controller');
if (class_exists($controller . 'Controller')) {
- $this->View->args = array($controller);
+ $this->View->args = array($name);
$this->View->execute();
}
$this->out('', 1, Shell::QUIET);
diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php
index 051436a7d..b69d9696a 100644
--- a/lib/Cake/Console/Command/CommandListShell.php
+++ b/lib/Cake/Console/Command/CommandListShell.php
@@ -17,6 +17,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('Inflector', 'Utility');
/**
@@ -24,7 +25,7 @@ App::uses('Inflector', 'Utility');
*
* @package Cake.Console.Command
*/
-class CommandListShell extends Shell {
+class CommandListShell extends AppShell {
/**
* startup
@@ -80,13 +81,15 @@ class CommandListShell extends Shell {
*/
protected function _getShellList() {
$shellList = array();
+ $skipFiles = array('AppShell');
$corePath = App::core('Console/Command');
$shells = App::objects('file', $corePath[0]);
+ $shells = array_diff($shells, $skipFiles);
$shellList = $this->_appendShells('CORE', $shells, $shellList);
$appShells = App::objects('Console/Command', null, false);
- $appShells = array_diff($appShells, $shells);
+ $appShells = array_diff($appShells, $shells, $skipFiles);
$shellList = $this->_appendShells('app', $appShells, $shellList);
$plugins = CakePlugin::loaded();
diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php
index 6f332bca9..328fbf5ea 100644
--- a/lib/Cake/Console/Command/ConsoleShell.php
+++ b/lib/Cake/Console/Command/ConsoleShell.php
@@ -16,12 +16,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
+
/**
* Provides a very basic 'interactive' console for CakePHP apps.
*
* @package Cake.Console.Command
*/
-class ConsoleShell extends Shell {
+class ConsoleShell extends AppShell {
/**
* Available binding types
@@ -86,7 +88,7 @@ class ConsoleShell extends Shell {
$out .= "\n";
$out .= 'To dynamically set associations, you can do the following:';
$out .= "\tModelA bind ModelB";
- $out .= "where the supported assocations are hasOne, hasMany, belongsTo, hasAndBelongsToMany";
+ $out .= "where the supported associations are hasOne, hasMany, belongsTo, hasAndBelongsToMany";
$out .= "\n";
$out .= 'To dynamically remove associations, you can do the following:';
$out .= "\t ModelA unbind ModelB";
@@ -115,7 +117,7 @@ class ConsoleShell extends Shell {
$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/I18nShell.php b/lib/Cake/Console/Command/I18nShell.php
index 3db544b38..0605a8283 100644
--- a/lib/Cake/Console/Command/I18nShell.php
+++ b/lib/Cake/Console/Command/I18nShell.php
@@ -16,12 +16,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
+
/**
* Shell for I18N management.
*
* @package Cake.Console.Command
*/
-class I18nShell extends Shell {
+class I18nShell extends AppShell {
/**
* Contains database source to use
diff --git a/lib/Cake/Console/Command/SchemaShell.php b/lib/Cake/Console/Command/SchemaShell.php
index e53708952..39b52328f 100644
--- a/lib/Cake/Console/Command/SchemaShell.php
+++ b/lib/Cake/Console/Command/SchemaShell.php
@@ -18,6 +18,8 @@
* @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('AppShell', 'Console/Command');
App::uses('File', 'Utility');
App::uses('Folder', 'Utility');
App::uses('CakeSchema', 'Model');
@@ -28,7 +30,7 @@ App::uses('CakeSchema', 'Model');
* @package Cake.Console.Command
* @link http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html
*/
-class SchemaShell extends Shell {
+class SchemaShell extends AppShell {
/**
* Schema class being used.
@@ -64,7 +66,7 @@ class SchemaShell extends Shell {
$name = $path = $connection = $plugin = null;
if (!empty($this->params['name'])) {
$name = $this->params['name'];
- } elseif (!empty($this->args[0])) {
+ } elseif (!empty($this->args[0]) && $this->args[0] !== 'snapshot') {
$name = $this->params['name'] = $this->args[0];
}
@@ -158,6 +160,7 @@ class SchemaShell extends Shell {
Configure::write('Cache.disable', $cacheDisable);
if ($snapshot === true) {
+ $fileName = rtrim($this->params['file'], '.php');
$Folder = new Folder($this->Schema->path);
$result = $Folder->read();
@@ -169,7 +172,7 @@ class SchemaShell extends Shell {
$count = 0;
if (!empty($result[1])) {
foreach ($result[1] as $file) {
- if (preg_match('/schema(?:[_\d]*)?\.php$/', $file)) {
+ if (preg_match('/'.preg_quote($fileName).'(?:[_\d]*)?\.php$/', $file)) {
$count++;
}
}
@@ -181,7 +184,6 @@ class SchemaShell extends Shell {
}
}
- $fileName = rtrim($this->params['file'], '.php');
$content['file'] = $fileName . '_' . $count . '.php';
}
diff --git a/lib/Cake/Console/Command/Task/BakeTask.php b/lib/Cake/Console/Command/Task/BakeTask.php
index ea3a8973e..9d77e7fd4 100644
--- a/lib/Cake/Console/Command/Task/BakeTask.php
+++ b/lib/Cake/Console/Command/Task/BakeTask.php
@@ -16,13 +16,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::uses('Shell', 'Console');
+App::uses('AppShell', 'Console/Command');
+
/**
* Base class for Bake Tasks.
*
* @package Cake.Console.Command.Task
*/
-class BakeTask extends Shell {
+class BakeTask extends AppShell {
/**
* Name of plugin
@@ -78,7 +79,7 @@ class BakeTask extends Shell {
* @return void
*/
public function execute() {
- foreach($this->args as $i => $arg) {
+ foreach ($this->args as $i => $arg) {
if (strpos($arg, '.')) {
list($this->params['plugin'], $this->args[$i]) = pluginSplit($arg);
break;
diff --git a/lib/Cake/Console/Command/Task/ControllerTask.php b/lib/Cake/Console/Command/Task/ControllerTask.php
index d7797024c..621b95cc8 100644
--- a/lib/Cake/Console/Command/Task/ControllerTask.php
+++ b/lib/Cake/Console/Command/Task/ControllerTask.php
@@ -16,6 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('BakeTask', 'Console/Command/Task');
App::uses('AppModel', 'Model');
diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php
index 3d61baaea..a47762c19 100644
--- a/lib/Cake/Console/Command/Task/DbConfigTask.php
+++ b/lib/Cake/Console/Command/Task/DbConfigTask.php
@@ -16,12 +16,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
+
/**
* Task class for creating and updating the database configuration file.
*
* @package Cake.Console.Command.Task
*/
-class DbConfigTask extends Shell {
+class DbConfigTask extends AppShell {
/**
* path to CONFIG directory
@@ -37,14 +39,14 @@ class DbConfigTask extends Shell {
*/
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/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php
index ab5ceaaf9..ed28c196b 100644
--- a/lib/Cake/Console/Command/Task/ExtractTask.php
+++ b/lib/Cake/Console/Command/Task/ExtractTask.php
@@ -15,6 +15,8 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+
+App::uses('AppShell', 'Console/Command');
App::uses('File', 'Utility');
App::uses('Folder', 'Utility');
@@ -23,7 +25,7 @@ App::uses('Folder', 'Utility');
*
* @package Cake.Console.Command.Task
*/
-class ExtractTask extends Shell {
+class ExtractTask extends AppShell {
/**
* Paths to use when looking for strings
@@ -162,7 +164,7 @@ class ExtractTask extends Shell {
} else {
$message = __d('cake_console', "What is the path you would like to output?\n[Q]uit", $this->_paths[0] . DS . 'Locale');
while (true) {
- $response = $this->in($message, null, $this->_paths[0] . DS . 'Locale');
+ $response = $this->in($message, null, rtrim($this->_paths[0], DS) . DS . 'Locale');
if (strtoupper($response) === 'Q') {
$this->out(__d('cake_console', 'Extract Aborted'));
$this->_stop();
@@ -187,6 +189,7 @@ class ExtractTask extends Shell {
if (empty($this->_files)) {
$this->_searchFiles();
}
+ $this->_output = rtrim($this->_output, DS) . DS;
$this->_extract();
}
diff --git a/lib/Cake/Console/Command/Task/FixtureTask.php b/lib/Cake/Console/Command/Task/FixtureTask.php
index 106f072a5..11b6e0331 100644
--- a/lib/Cake/Console/Command/Task/FixtureTask.php
+++ b/lib/Cake/Console/Command/Task/FixtureTask.php
@@ -16,6 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('BakeTask', 'Console/Command/Task');
App::uses('Model', 'Model');
@@ -90,7 +91,7 @@ class FixtureTask extends BakeTask {
/**
* Execution method always used for tasks
- * Handles dispatching to interactive, named, or all processeses.
+ * Handles dispatching to interactive, named, or all processes.
*
* @return void
*/
@@ -279,7 +280,7 @@ class FixtureTask extends BakeTask {
*/
protected function _generateSchema($tableInfo) {
$schema = $this->_Schema->generateTable('f', $tableInfo);
- return substr($schema, 10, -2);
+ return substr($schema, 13, -2);
}
/**
diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php
index 4a8b703ad..87ded6a5d 100644
--- a/lib/Cake/Console/Command/Task/ModelTask.php
+++ b/lib/Cake/Console/Command/Task/ModelTask.php
@@ -16,6 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('BakeTask', 'Console/Command/Task');
App::uses('ConnectionManager', 'Model');
App::uses('Model', 'Model');
@@ -56,6 +57,13 @@ class ModelTask extends BakeTask {
*/
protected $_tables = array();
+/**
+ * Holds the model names
+ *
+ * @var array
+ */
+ protected $_modelNames = array();
+
/**
* Holds validation method map.
*
@@ -117,9 +125,9 @@ class ModelTask extends BakeTask {
}
$modelClass = Inflector::classify($table);
$this->out(__d('cake_console', 'Baking %s', $modelClass));
- $object = $this->_getModelObject($modelClass);
+ $object = $this->_getModelObject($modelClass, $table);
if ($this->bake($object, false) && $unitTestExists) {
- $this->bakeFixture($modelClass);
+ $this->bakeFixture($modelClass, $table);
$this->bakeTest($modelClass);
}
}
@@ -132,11 +140,18 @@ class ModelTask extends BakeTask {
* @param string $table Table name
* @return Model Model instance
*/
- protected function &_getModelObject($className, $table = null) {
+ protected function _getModelObject($className, $table = null) {
if (!$table) {
$table = Inflector::tableize($className);
}
$object = new Model(array('name' => $className, 'table' => $table, 'ds' => $this->connection));
+ $fields = $object->schema(true);
+ foreach ($fields as $name => $field) {
+ if (isset($field['key']) && $field['key'] == 'primary') {
+ $object->primaryKey = $name;
+ break;
+ }
+ }
return $object;
}
@@ -254,7 +269,7 @@ class ModelTask extends BakeTask {
}
$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');
@@ -294,6 +309,7 @@ class ModelTask extends BakeTask {
* @return string Name of field that is a primary key.
*/
public function findPrimaryKey($fields) {
+ $name = 'id';
foreach ($fields as $name => $field) {
if (isset($field['key']) && $field['key'] == 'primary') {
break;
@@ -462,7 +478,7 @@ class ModelTask extends BakeTask {
* Handles associations
*
* @param Model $model
- * @return array $assocaitons
+ * @return array $associations
*/
public function doAssociations($model) {
if (!is_object($model)) {
@@ -474,7 +490,7 @@ class ModelTask extends BakeTask {
$fields = $model->schema(true);
if (empty($fields)) {
- return false;
+ return array();
}
if (empty($this->_tables)) {
@@ -482,7 +498,7 @@ class ModelTask extends BakeTask {
}
$associations = array(
- 'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()
+ 'belongsTo' => array(), 'hasMany' => array(), 'hasOne' => array(), 'hasAndBelongsToMany' => array()
);
$associations = $this->findBelongsTo($model, $associations);
@@ -511,7 +527,7 @@ class ModelTask extends BakeTask {
* Find belongsTo relations and add them to the associations list.
*
* @param Model $model Model instance of model being generated.
- * @param array $associations Array of inprogress associations
+ * @param array $associations Array of in progress associations
* @return array $associations with belongsTo added in.
*/
public function findBelongsTo($model, $associations) {
@@ -540,7 +556,7 @@ class ModelTask extends BakeTask {
* Find the hasOne and HasMany relations and add them to associations list
*
* @param Model $model Model instance being generated
- * @param array $associations Array of inprogress associations
+ * @param array $associations Array of in progress associations
* @return array $associations with hasOne and hasMany added in.
*/
public function findHasOneAndMany($model, $associations) {
@@ -631,7 +647,7 @@ class ModelTask extends BakeTask {
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]);
@@ -654,7 +670,7 @@ class ModelTask extends BakeTask {
*/
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');
@@ -715,7 +731,7 @@ class ModelTask extends BakeTask {
$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;
}
@@ -749,8 +765,8 @@ class ModelTask extends BakeTask {
public function bake($name, $data = array()) {
if (is_object($name)) {
if ($data == false) {
- $data = $associations = array();
- $data['associations'] = $this->doAssociations($name, $associations);
+ $data = array();
+ $data['associations'] = $this->doAssociations($name);
$data['validate'] = $this->doValidation($name);
}
$data['primaryKey'] = $name->primaryKey;
@@ -832,13 +848,17 @@ class ModelTask extends BakeTask {
$db = ConnectionManager::getDataSource($useDbConfig);
$useTable = Inflector::tableize($modelName);
+ if (in_array($modelName, $this->_modelNames)) {
+ $modelNames = array_flip($this->_modelNames);
+ $useTable = $this->_tables[$modelNames[$modelName]];
+ }
$fullTableName = $db->fullTableName($useTable, false);
$tableIsGood = false;
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/PluginTask.php b/lib/Cake/Console/Command/Task/PluginTask.php
index af231e234..36af64a9b 100644
--- a/lib/Cake/Console/Command/Task/PluginTask.php
+++ b/lib/Cake/Console/Command/Task/PluginTask.php
@@ -16,6 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('File', 'Utility');
App::uses('Folder', 'Utility');
@@ -24,7 +25,7 @@ App::uses('Folder', 'Utility');
*
* @package Cake.Console.Command.Task
*/
-class PluginTask extends Shell {
+class PluginTask extends AppShell {
/**
* path to plugins directory
@@ -74,7 +75,7 @@ class PluginTask extends Shell {
}
if (!$this->bake($plugin)) {
- $this->error(__d('cake_console', "An error occured trying to bake: %s in %s", $plugin, $this->path . $plugin));
+ $this->error(__d('cake_console', "An error occurred trying to bake: %s in %s", $plugin, $this->path . $plugin));
}
}
@@ -158,8 +159,8 @@ class PluginTask extends Shell {
*/
public function findPath($pathOptions) {
$valid = false;
- foreach ($pathOptions as $i =>$path) {
- if(!is_dir($path)) {
+ foreach ($pathOptions as $i => $path) {
+ if (!is_dir($path)) {
array_splice($pathOptions, $i, 1);
}
}
diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php
index 8784c4cde..b4ea713d7 100644
--- a/lib/Cake/Console/Command/Task/ProjectTask.php
+++ b/lib/Cake/Console/Command/Task/ProjectTask.php
@@ -17,6 +17,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('File', 'Utility');
App::uses('Folder', 'Utility');
App::uses('String', 'Utility');
@@ -27,7 +28,7 @@ App::uses('Security', 'Utility');
*
* @package Cake.Console.Command.Task
*/
-class ProjectTask extends Shell {
+class ProjectTask extends AppShell {
/**
* configs path (used in testing).
@@ -61,7 +62,7 @@ class ProjectTask extends Shell {
$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/TemplateTask.php b/lib/Cake/Console/Command/Task/TemplateTask.php
index ee517cc9d..6cfd1e7a0 100644
--- a/lib/Cake/Console/Command/Task/TemplateTask.php
+++ b/lib/Cake/Console/Command/Task/TemplateTask.php
@@ -16,14 +16,16 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('Folder', 'Utility');
+
/**
* Template Task can generate templated output Used in other Tasks.
* Acts like a simplified View class.
*
* @package Cake.Console.Command.Task
*/
-class TemplateTask extends Shell {
+class TemplateTask extends AppShell {
/**
* variables to add to template scope
@@ -57,7 +59,7 @@ class TemplateTask extends Shell {
* @return array Array of bake themes that are installed.
*/
protected function _findThemes() {
- $paths = App::path('Console');
+ $paths = array();
$core = current(App::core('Console'));
$separator = DS === '/' ? '/' : '\\\\';
$core = preg_replace('#shells' . $separator . '$#', '', $core);
@@ -68,10 +70,12 @@ class TemplateTask extends Shell {
$themeFolders = $contents[0];
$plugins = App::objects('plugin');
+ $paths[] = $core;
foreach ($plugins as $plugin) {
$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
}
- $paths[] = $core;
+
+ $paths = array_merge($paths, App::path('Console'));
// TEMPORARY TODO remove when all paths are DS terminated
foreach ($paths as $i => $path) {
diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php
index c654d3268..3295d6a48 100644
--- a/lib/Cake/Console/Command/Task/TestTask.php
+++ b/lib/Cake/Console/Command/Task/TestTask.php
@@ -16,6 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('BakeTask', 'Console/Command/Task');
App::uses('ClassRegistry', 'Utility');
@@ -405,7 +406,7 @@ class TestTask extends BakeTask {
* @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'"));
@@ -476,7 +477,7 @@ class TestTask extends BakeTask {
->addArgument('type', array(
'help' => __d('cake_console', 'Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'),
'choices' => array(
- 'Controller', 'controller',
+ 'Controller', 'controller',
'Model', 'model',
'Helper', 'helper',
'Component', 'component',
diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php
index fff2572e8..b125d0791 100644
--- a/lib/Cake/Console/Command/Task/ViewTask.php
+++ b/lib/Cake/Console/Command/Task/ViewTask.php
@@ -16,6 +16,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('Controller', 'Controller');
App::uses('BakeTask', 'Console/Command/Task');
@@ -214,9 +215,9 @@ class ViewTask extends BakeTask {
}
$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();
@@ -291,7 +292,7 @@ class ViewTask extends BakeTask {
$pluralHumanName = $this->_pluralHumanName($this->controllerName);
return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
- 'singularHumanName', 'pluralHumanName', 'fields','associations');
+ 'singularHumanName', 'pluralHumanName', 'fields', 'associations');
}
/**
@@ -329,7 +330,7 @@ class ViewTask extends BakeTask {
$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/TestsuiteShell.php b/lib/Cake/Console/Command/TestsuiteShell.php
index 6363c1a6a..660dfcb87 100644
--- a/lib/Cake/Console/Command/TestsuiteShell.php
+++ b/lib/Cake/Console/Command/TestsuiteShell.php
@@ -19,6 +19,10 @@
*/
App::uses('TestShell', 'Console/Command');
+App::uses('AppShell', 'Console/Command');
+App::uses('CakeTestSuiteDispatcher', 'TestSuite');
+App::uses('CakeTestSuiteCommand', 'TestSuite');
+App::uses('CakeTestLoader', 'TestSuite');
/**
* Provides a CakePHP wrapper around PHPUnit.
@@ -26,7 +30,18 @@ App::uses('TestShell', 'Console/Command');
*
* @package Cake.Console.Command
*/
+<<<<<<< HEAD
class TestsuiteShell extends TestShell {
+=======
+class TestsuiteShell extends AppShell {
+
+/**
+ * Dispatcher object for the run.
+ *
+ * @var CakeTestDispatcher
+ */
+ protected $_dispatcher = null;
+>>>>>>> 2.0
/**
* get the option parser for the test suite.
diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php
index 66d59be5b..05505835a 100644
--- a/lib/Cake/Console/Command/UpgradeShell.php
+++ b/lib/Cake/Console/Command/UpgradeShell.php
@@ -17,6 +17,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('AppShell', 'Console/Command');
App::uses('Folder', 'Utility');
/**
@@ -24,7 +25,7 @@ App::uses('Folder', 'Utility');
*
* @package Cake.Console.Command
*/
-class UpgradeShell extends Shell {
+class UpgradeShell extends AppShell {
/**
* Files
@@ -82,7 +83,7 @@ class UpgradeShell extends Shell {
* @return void
*/
public function all() {
- foreach($this->OptionParser->subcommands() as $command) {
+ foreach ($this->OptionParser->subcommands() as $command) {
$name = $command->name();
if ($name === 'all') {
continue;
@@ -134,7 +135,7 @@ class UpgradeShell extends Shell {
if (is_dir('plugins')) {
$Folder = new Folder('plugins');
list($plugins) = $Folder->read();
- foreach($plugins as $plugin) {
+ foreach ($plugins as $plugin) {
chdir($cwd . DS . 'plugins' . DS . $plugin);
$this->locations();
}
@@ -154,7 +155,7 @@ class UpgradeShell extends Shell {
'Test' . DS . 'fixtures' => 'Test' . DS . 'Fixture',
'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'Templates',
);
- foreach($moves as $old => $new) {
+ foreach ($moves as $old => $new) {
if (is_dir($old)) {
$this->out(__d('cake_console', 'Moving %s to %s', $old, $new));
if (!$this->params['dry-run']) {
@@ -189,7 +190,7 @@ class UpgradeShell extends Shell {
'checkFolder' => true,
'regex' => '@class (\S*) .*{@i'
);
- foreach($sourceDirs as $dir => $options) {
+ foreach ($sourceDirs as $dir => $options) {
if (is_numeric($dir)) {
$dir = $options;
$options = array();
@@ -613,7 +614,7 @@ class UpgradeShell extends Shell {
$this->_findFiles('php');
} else {
$this->_files = scandir($path);
- foreach($this->_files as $i => $file) {
+ foreach ($this->_files as $i => $file) {
if (strlen($file) < 5 || substr($file, -4) !== '.php') {
unset($this->_files[$i]);
}
@@ -763,7 +764,7 @@ class UpgradeShell extends Shell {
'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/HelpFormatter.php b/lib/Cake/Console/HelpFormatter.php
index 6e7e6f523..bfb9ee6a7 100644
--- a/lib/Cake/Console/HelpFormatter.php
+++ b/lib/Cake/Console/HelpFormatter.php
@@ -140,7 +140,7 @@ class HelpFormatter {
foreach ($this->_parser->options() as $option) {
$options[] = $option->usage();
}
- if (count($options) > $this->_maxOptions){
+ if (count($options) > $this->_maxOptions) {
$options = array('[options]');
}
$usage = array_merge($usage, $options);
diff --git a/lib/Cake/Console/Shell.php b/lib/Cake/Console/Shell.php
index 53e02c03f..c748b8226 100644
--- a/lib/Cake/Console/Shell.php
+++ b/lib/Cake/Console/Shell.php
@@ -83,6 +83,7 @@ class Shell extends Object {
* Contains tasks to load and instantiate
*
* @var array
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$tasks
*/
public $tasks = array();
@@ -97,6 +98,7 @@ class Shell extends Object {
* Contains models to load and instantiate
*
* @var array
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$uses
*/
public $uses = array();
@@ -141,6 +143,7 @@ class Shell extends Object {
* @param ConsoleOutput $stdout A ConsoleOutput object for stdout.
* @param ConsoleOutput $stderr A ConsoleOutput object for stderr.
* @param ConsoleInput $stdin A ConsoleInput object for stdin.
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell
*/
public function __construct($stdout = null, $stderr = null, $stdin = null) {
if ($this->name == null) {
@@ -176,6 +179,7 @@ class Shell extends Object {
* allows configuration of tasks prior to shell execution
*
* @return void
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize
*/
public function initialize() {
$this->_loadModels();
@@ -189,6 +193,7 @@ class Shell extends Object {
* or otherwise modify the pre-command flow.
*
* @return void
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup
*/
public function startup() {
$this->_welcome();
@@ -261,6 +266,7 @@ class Shell extends Object {
*
* @param string $task The task name to check.
* @return boolean Success
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask
*/
public function hasTask($task) {
return isset($this->_taskMap[Inflector::camelize($task)]);
@@ -271,6 +277,7 @@ class Shell extends Object {
*
* @param string $name The method name to check.
* @return boolean
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod
*/
public function hasMethod($name) {
try {
@@ -306,6 +313,7 @@ class Shell extends Object {
* `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');`
*
* @return mixed The return of the other shell.
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell
*/
public function dispatchShell() {
$args = func_get_args();
@@ -334,6 +342,7 @@ class Shell extends Object {
* and the shell has a `main()` method, that will be called instead.
* @param array $argv Array of arguments to run the shell with. This array should be missing the shell name.
* @return void
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand
*/
public function runCommand($command, $argv) {
$isTask = $this->hasTask($command);
@@ -357,7 +366,7 @@ class Shell extends Object {
return $this->_displayHelp($command);
}
- if (($isTask || $isMethod || $isMain) && $command !== 'execute' ) {
+ if (($isTask || $isMethod || $isMain) && $command !== 'execute') {
$this->startup();
}
@@ -397,6 +406,7 @@ class Shell extends Object {
* By overriding this method you can configure the ConsoleOptionParser before returning it.
*
* @return ConsoleOptionParser
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser
*/
public function getOptionParser() {
$parser = new ConsoleOptionParser($this->name);
@@ -428,6 +438,7 @@ class Shell extends Object {
* @param mixed $options Array or string of options.
* @param string $default Default input value.
* @return mixed Either the default value, or the user-provided input.
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in
*/
public function in($prompt, $options = null, $default = null) {
if (!$this->interactive) {
@@ -499,6 +510,7 @@ class Shell extends Object {
* @param mixed $options Array of options to use, or an integer to wrap the text to.
* @return string Wrapped / indented text
* @see String::wrap()
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText
*/
public function wrapText($text, $options = array()) {
return String::wrap($text, $options);
@@ -519,6 +531,7 @@ class Shell extends Object {
* @param integer $newlines Number of newlines to append
* @param integer $level The message's output level, see above.
* @return integer|boolean Returns the number of bytes returned from writing to stdout.
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out
*/
public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
$currentLevel = Shell::NORMAL;
@@ -541,6 +554,7 @@ class Shell extends Object {
* @param mixed $message A string or a an array of strings to output
* @param integer $newlines Number of newlines to append
* @return void
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err
*/
public function err($message = null, $newlines = 1) {
$this->stderr->write($message, $newlines);
@@ -551,6 +565,7 @@ class Shell extends Object {
*
* @param integer $multiplier Number of times the linefeed sequence should be repeated
* @return string
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl
*/
public function nl($multiplier = 1) {
return str_repeat(ConsoleOutput::LF, $multiplier);
@@ -562,6 +577,7 @@ class Shell extends Object {
* @param integer $newlines Number of newlines to pre- and append
* @param integer $width Width of the line, defaults to 63
* @return void
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr
*/
public function hr($newlines = 0, $width = 63) {
$this->out(null, $newlines);
@@ -576,6 +592,7 @@ class Shell extends Object {
* @param string $title Title of the error
* @param string $message An optional error message
* @return void
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error
*/
public function error($title, $message = null) {
$this->err(__d('cake_console', 'Error: %s', $title));
@@ -590,6 +607,7 @@ class Shell extends Object {
* Clear the console
*
* @return void
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear
*/
public function clear() {
if (empty($this->params['noclear'])) {
@@ -607,6 +625,7 @@ class Shell extends Object {
* @param string $path Where to put the file.
* @param string $contents Content to put in the file.
* @return boolean Success
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile
*/
public function createFile($path, $contents) {
$path = str_replace(DS . DS, DS, $path);
@@ -653,7 +672,7 @@ class Shell extends Object {
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) {
@@ -668,6 +687,7 @@ class Shell extends Object {
*
* @param string $file Absolute file path
* @return string short path
+ * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath
*/
public function shortPath($file) {
$shortPath = str_replace(ROOT, null, $file);
diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php
index e3320fc7b..622cc9764 100644
--- a/lib/Cake/Console/ShellDispatcher.php
+++ b/lib/Cake/Console/ShellDispatcher.php
@@ -210,7 +210,7 @@ class ShellDispatcher {
$class = Inflector::camelize($shell) . 'Shell';
App::uses('Shell', 'Console');
- App::uses('AppShell', 'Console');
+ App::uses('AppShell', 'Console/Command');
App::uses($class, $plugin . 'Console/Command');
if (!class_exists($class)) {
diff --git a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp
index e61424fdb..ab7037f1f 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/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp
index eec49119c..f5bc7d660 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
\n";
echo "\t\n";
foreach ($fields as $field) {
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 7133acb19..176999dfe 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 @@ class DbAclSchema extends CakeSchema {
}
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 377645796..d5b542a9c 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 @@ class i18nSchema extends CakeSchema {
}
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 4e2ba5f55..bd54edcfc 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 @@ class SessionsSchema extends CakeSchema {
}
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 97d26629d..cf69e312b 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 97010d1d8..c20d170e8 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 @@