diff --git a/cake/basics.php b/cake/basics.php
index 1c1dd61d1..b6b07c761 100644
--- a/cake/basics.php
+++ b/cake/basics.php
@@ -1,5 +1,6 @@
tags around
* the output of given array. Similar to debug().
@@ -314,6 +331,7 @@ if (!function_exists('array_combine')) {
echo '';
}
}
+
/**
* Display parameters.
*
@@ -329,6 +347,7 @@ if (!function_exists('array_combine')) {
}
return $p;
}
+
/**
* Merge a group of arrays
*
@@ -350,6 +369,7 @@ if (!function_exists('array_combine')) {
}
return $r;
}
+
/**
* Gets an environment variable from available sources, and provides emulation
* for unsupported or inconsistent environment variables (i.e. DOCUMENT_ROOT on
@@ -426,6 +446,7 @@ if (!function_exists('array_combine')) {
return null;
}
if (!function_exists('file_put_contents')) {
+
/**
* Writes data into file.
*
@@ -453,6 +474,7 @@ if (!function_exists('file_put_contents')) {
return false;
}
}
+
/**
* Reads/writes temporary data to cache files or session.
*
@@ -504,6 +526,7 @@ if (!function_exists('file_put_contents')) {
}
return $data;
}
+
/**
* Used to delete files in the cache directories, or clear contents of cache directories
*
@@ -566,6 +589,7 @@ if (!function_exists('file_put_contents')) {
}
return false;
}
+
/**
* Recursively strips slashes from all values in an array
*
@@ -583,6 +607,7 @@ if (!function_exists('file_put_contents')) {
}
return $values;
}
+
/**
* Returns a translated string if one is found; Otherwise, the submitted message.
*
@@ -605,6 +630,7 @@ if (!function_exists('file_put_contents')) {
return I18n::translate($singular);
}
}
+
/**
* Returns correct plural form of message identified by $singular and $plural for count $count.
* Some languages have more than one form for plural messages dependent on the count.
@@ -629,6 +655,7 @@ if (!function_exists('file_put_contents')) {
return I18n::translate($singular, $plural, null, 6, $count);
}
}
+
/**
* Allows you to override the current domain for a single message lookup.
*
@@ -651,6 +678,7 @@ if (!function_exists('file_put_contents')) {
return I18n::translate($msg, null, $domain);
}
}
+
/**
* Allows you to override the current domain for a single plural message lookup.
* Returns correct plural form of message identified by $singular and $plural for count $count
@@ -677,6 +705,7 @@ if (!function_exists('file_put_contents')) {
return I18n::translate($singular, $plural, $domain, 6, $count);
}
}
+
/**
* Allows you to override the current domain for a single message lookup.
* It also allows you to specify a category.
@@ -713,6 +742,7 @@ if (!function_exists('file_put_contents')) {
return I18n::translate($msg, null, $domain, $category);
}
}
+
/**
* Allows you to override the current domain for a single plural message lookup.
* It also allows you to specify a category.
@@ -753,6 +783,7 @@ if (!function_exists('file_put_contents')) {
return I18n::translate($singular, $plural, $domain, $category, $count);
}
}
+
/**
* The category argument allows a specific category of the locale settings to be used for fetching a message.
* Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL.
@@ -785,6 +816,7 @@ if (!function_exists('file_put_contents')) {
return I18n::translate($msg, null, null, $category);
}
}
+
/**
* Computes the difference of arrays using keys for comparison.
*
@@ -819,6 +851,7 @@ if (!function_exists('file_put_contents')) {
return $valuesDiff;
}
}
+
/**
* Computes the intersection of arrays using keys for comparison
*
@@ -837,6 +870,7 @@ if (!function_exists('file_put_contents')) {
return $res;
}
}
+
/**
* Shortcut to Log::write.
*
@@ -850,6 +884,7 @@ if (!function_exists('file_put_contents')) {
$good = ' ';
CakeLog::write('error', str_replace($bad, $good, $message));
}
+
/**
* Searches include path for files.
*
@@ -870,6 +905,7 @@ if (!function_exists('file_put_contents')) {
}
return false;
}
+
/**
* Convert forward slashes to underscores and removes first and last underscores in a string
*
@@ -883,6 +919,7 @@ if (!function_exists('file_put_contents')) {
$string = str_replace('/', '_', $string);
return $string;
}
+
/**
* Implements http_build_query for PHP4.
*
@@ -922,6 +959,7 @@ if (!function_exists('file_put_contents')) {
return implode($argSep, $out);
}
}
+
/**
* Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2.
* Don't use for isset() conditions, or wrap your variable with @ operator:
diff --git a/cake/config/paths.php b/cake/config/paths.php
index 6a6449f0e..4a29fadab 100644
--- a/cake/config/paths.php
+++ b/cake/config/paths.php
@@ -1,5 +1,6 @@
__construct($args);
}
+
/**
* Constructor
*
@@ -130,6 +145,7 @@ class ShellDispatcher {
$this->__buildPaths();
$this->_stop($this->dispatch());
}
+
/**
* Defines core configuration.
*
@@ -154,6 +170,7 @@ class ShellDispatcher {
}
require_once(CORE_PATH . 'cake' . DS . 'basics.php');
}
+
/**
* Defines current working environment.
*
@@ -190,6 +207,7 @@ class ShellDispatcher {
$this->shiftArgs();
}
+
/**
* Builds the shell paths.
*
@@ -224,6 +242,7 @@ class ShellDispatcher {
$this->shellPaths = array_values(array_unique(array_merge($paths, App::path('shells'))));
}
+
/**
* Initializes the environment and loads the Cake core.
*
@@ -266,6 +285,7 @@ class ShellDispatcher {
Configure::write('debug', 1);
return true;
}
+
/**
* Dispatches a CLI request
*
@@ -382,6 +402,7 @@ class ShellDispatcher {
$this->help();
}
}
+
/**
* Prompts the user for input, and returns it.
*
@@ -415,6 +436,7 @@ class ShellDispatcher {
}
return $result;
}
+
/**
* Outputs to the stdout filehandle.
*
@@ -429,6 +451,7 @@ class ShellDispatcher {
fwrite($this->stdout, $string);
}
}
+
/**
* Outputs to the stderr filehandle.
*
@@ -438,6 +461,7 @@ class ShellDispatcher {
function stderr($string) {
fwrite($this->stderr, 'Error: '. $string);
}
+
/**
* Parses command line options
*
@@ -479,6 +503,7 @@ class ShellDispatcher {
$this->params = array_merge($this->params, $params);
}
+
/**
* Helper for recursively paraing params
*
@@ -510,6 +535,7 @@ class ShellDispatcher {
}
}
}
+
/**
* Removes first argument and shifts other arguments up
*
@@ -524,6 +550,7 @@ class ShellDispatcher {
$this->args = array_values($this->args);
return true;
}
+
/**
* Shows console help
*
@@ -570,6 +597,7 @@ class ShellDispatcher {
$this->stdout("To get help on a specific command, type 'cake shell_name help'");
$this->_stop();
}
+
/**
* Stop execution of the current script
*
diff --git a/cake/console/error.php b/cake/console/error.php
index 9c88a40b8..4d9a9f7a5 100644
--- a/cake/console/error.php
+++ b/cake/console/error.php
@@ -1,5 +1,6 @@
stderr($code . $name . $message."\n");
$this->_stop();
}
+
/**
* Convenience method to display a 404 page.
*
@@ -84,6 +91,7 @@ class ErrorHandler extends Object {
'message' => sprintf(__("The requested address %s was not found on this server.", true), $url, $message)));
$this->_stop();
}
+
/**
* Renders the Missing Controller web page.
*
@@ -96,6 +104,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing Controller '%s'", true), $controllerName));
$this->_stop();
}
+
/**
* Renders the Missing Action web page.
*
@@ -107,6 +116,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing Method '%s' in '%s'", true), $action, $className));
$this->_stop();
}
+
/**
* Renders the Private Action web page.
*
@@ -118,6 +128,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Trying to access private method '%s' in '%s'", true), $action, $className));
$this->_stop();
}
+
/**
* Renders the Missing Table web page.
*
@@ -129,6 +140,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing database table '%s' for model '%s'", true), $table, $className));
$this->_stop();
}
+
/**
* Renders the Missing Database web page.
*
@@ -139,6 +151,7 @@ class ErrorHandler extends Object {
$this->stderr(__("Missing Database", true));
$this->_stop();
}
+
/**
* Renders the Missing View web page.
*
@@ -150,6 +163,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing View '%s' for '%s' in '%s'", true), $file, $action, $className));
$this->_stop();
}
+
/**
* Renders the Missing Layout web page.
*
@@ -161,6 +175,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing Layout '%s'", true), $file));
$this->_stop();
}
+
/**
* Renders the Database Connection web page.
*
@@ -172,6 +187,7 @@ class ErrorHandler extends Object {
$this->stderr(__("Missing Database Connection. Try 'cake bake'", true));
$this->_stop();
}
+
/**
* Renders the Missing Helper file web page.
*
@@ -183,6 +199,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing Helper file '%s' for '%s'", true), $file, Inflector::camelize($helper)));
$this->_stop();
}
+
/**
* Renders the Missing Helper class web page.
*
@@ -194,6 +211,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing Helper class '%s' in '%s'", true), Inflector::camelize($helper), $file));
$this->_stop();
}
+
/**
* Renders the Missing Component file web page.
*
@@ -205,6 +223,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing Component file '%s' for '%s'", true), $file, Inflector::camelize($component)));
$this->_stop();
}
+
/**
* Renders the Missing Component class web page.
*
@@ -216,6 +235,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing Component class '%s' in '%s'", true), Inflector::camelize($component), $file));
$this->_stop();
}
+
/**
* Renders the Missing Model class web page.
*
@@ -227,6 +247,7 @@ class ErrorHandler extends Object {
$this->stderr(sprintf(__("Missing model '%s'", true), $className));
$this->_stop();
}
+
/**
* Outputs to the stdout filehandle.
*
@@ -241,6 +262,7 @@ class ErrorHandler extends Object {
fwrite($this->stdout, $string);
}
}
+
/**
* Outputs to the stderr filehandle.
*
diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php
index 5a7873da8..c62f91ba3 100644
--- a/cake/console/libs/acl.php
+++ b/cake/console/libs/acl.php
@@ -1,5 +1,6 @@
'", true);
$this->out($out);
}
+
/**
* Creates an ARO/ACO node
*
@@ -179,6 +188,7 @@ class AclShell extends Shell {
$this->err(sprintf(__("There was a problem creating a new %s '%s'.", true), $class, $this->args[2]));
}
}
+
/**
* Delete an ARO/ACO node.
*
@@ -216,6 +226,7 @@ class AclShell extends Shell {
$this->out(sprintf(__("Node parent set to %s", true), $this->args[2]) . "\n", true);
}
}
+
/**
* Get path to specified ARO/ACO node.
*
@@ -234,6 +245,7 @@ class AclShell extends Shell {
$this->out(str_repeat(' ', $i) . "[" . $nodes[$i][$class]['id'] . "]" . $nodes[$i][$class]['alias'] . "\n");
}
}
+
/**
* Check permission for a given ARO to a given ACO.
*
@@ -249,6 +261,7 @@ class AclShell extends Shell {
$this->out(sprintf(__("%s is not allowed.", true), $aro), true);
}
}
+
/**
* Grant permission for a given ARO to a given ACO.
*
@@ -264,6 +277,7 @@ class AclShell extends Shell {
$this->out(__("Permission was not granted.", true), true);
}
}
+
/**
* Deny access for an ARO to an ACO.
*
@@ -279,6 +293,7 @@ class AclShell extends Shell {
$this->out(__("Permission was not denied.", true), true);
}
}
+
/**
* Set an ARO to inhermit permission to an ACO.
*
@@ -294,6 +309,7 @@ class AclShell extends Shell {
$this->out(__("Permission was not inherited.", true), true);
}
}
+
/**
* Show a specific ARO/ACO node.
*
@@ -345,6 +361,7 @@ class AclShell extends Shell {
}
$this->hr();
}
+
/**
* Initialize ACL database.
*
@@ -354,6 +371,7 @@ class AclShell extends Shell {
$this->Dispatch->args = array('schema', 'run', 'create', 'DbAcl');
$this->Dispatch->dispatch();
}
+
/**
* Show help screen.
*
@@ -431,6 +449,7 @@ class AclShell extends Shell {
$this->out(sprintf(__("Command '%s' not found", true), $this->args[0]));
}
}
+
/**
* Check that first argument specifies a valid Node type (ARO/ACO)
*
@@ -444,6 +463,7 @@ class AclShell extends Shell {
$this->error(sprintf(__("Missing/Unknown node type: '%s'", true), $this->args[1]), __('Please specify which ACL object type you wish to create.', true));
}
}
+
/**
* Checks that given node exists
*
@@ -465,6 +485,7 @@ class AclShell extends Shell {
}
return $possibility;
}
+
/**
* get params for standard Acl methods
*
diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php
index 7ff0d73e0..e0ceba164 100644
--- a/cake/console/libs/api.php
+++ b/cake/console/libs/api.php
@@ -1,5 +1,6 @@
LIBS
));
}
+
/**
* Override main() to handle action
*
diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php
index fc81eec16..af35877b6 100644
--- a/cake/console/libs/bake.php
+++ b/cake/console/libs/bake.php
@@ -22,6 +22,7 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Bake is a command-line code generation utility for automating programmer chores.
*
@@ -30,6 +31,7 @@
* @link http://book.cakephp.org/view/113/Code-Generation-with-Bake
*/
class BakeShell extends Shell {
+
/**
* Contains tasks to load and instantiate
*
@@ -37,6 +39,7 @@ class BakeShell extends Shell {
* @access public
*/
var $tasks = array('Project', 'DbConfig', 'Model', 'Controller', 'View', 'Plugin', 'Fixture', 'Test');
+
/**
* Override loadTasks() to handle paths
*
@@ -62,6 +65,7 @@ class BakeShell extends Shell {
}
}
}
+
/**
* Override main() to handle action
*
@@ -118,6 +122,7 @@ class BakeShell extends Shell {
$this->hr();
$this->main();
}
+
/**
* Quickly bake the MVC
*
diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php
index 89b2a26a2..82427d9b4 100644
--- a/cake/console/libs/console.php
+++ b/cake/console/libs/console.php
@@ -1,5 +1,6 @@
_loadRoutes();
}
+
/**
* Prints the help message
*
@@ -136,6 +143,7 @@ class ConsoleShell extends Shell {
$out .= "\tRoutes show";
$this->out($out);
}
+
/**
* Override main() to handle action
*
@@ -320,6 +328,7 @@ class ConsoleShell extends Shell {
$command = '';
}
}
+
/**
* Tells if the specified model is included in the list of available models
*
@@ -330,6 +339,7 @@ class ConsoleShell extends Shell {
function _isValidModel($modelToCheck) {
return in_array($modelToCheck, $this->models);
}
+
/**
* Reloads the routes configuration from config/routes.php, and compiles
* all routes found
@@ -357,4 +367,4 @@ class ConsoleShell extends Shell {
return true;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php
index aa5fe8b8a..5e8d547ed 100644
--- a/cake/console/libs/i18n.php
+++ b/cake/console/libs/i18n.php
@@ -1,5 +1,6 @@
hr();
$this->main();
}
+
/**
* Initialize I18N database.
*
@@ -105,6 +112,7 @@ class I18nShell extends Shell {
$this->Dispatch->args = array('schema', 'run', 'create', 'i18n');
$this->Dispatch->dispatch();
}
+
/**
* Show help screen.
*
diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php
index e9fdfb193..d5bfb3ff7 100644
--- a/cake/console/libs/schema.php
+++ b/cake/console/libs/schema.php
@@ -1,5 +1,6 @@
out('Cake Schema Shell');
$this->hr();
}
+
/**
* Override startup
*
@@ -85,6 +90,7 @@ class SchemaShell extends Shell {
$this->Schema =& new CakeSchema(compact('name', 'path', 'file', 'connection'));
}
+
/**
* Override main
*
@@ -93,6 +99,7 @@ class SchemaShell extends Shell {
function main() {
$this->help();
}
+
/**
* Read and output contents of schema object
* path to read as second arg
@@ -109,6 +116,7 @@ class SchemaShell extends Shell {
$this->_stop();
}
}
+
/**
* Read database and Write schema object
* accepts a connection as first arg or path to save as second arg
@@ -177,6 +185,7 @@ class SchemaShell extends Shell {
$this->_stop();
}
}
+
/**
* Dump Schema object to sql file
* if first arg == write, file will be written to sql file
@@ -217,6 +226,7 @@ class SchemaShell extends Shell {
$this->out($contents);
return $contents;
}
+
/**
* Run database commands: create, update
*
@@ -275,6 +285,7 @@ class SchemaShell extends Shell {
$this->_stop();
}
}
+
/**
* Create database from Schema object
* Should be called via the run method
@@ -318,6 +329,7 @@ class SchemaShell extends Shell {
$this->out(__('End create.', true));
}
+
/**
* Update database with Schema object
* Should be called via the run method
@@ -356,6 +368,7 @@ class SchemaShell extends Shell {
$this->out(__('End update.', true));
}
+
/**
* Runs sql from __create() or __update()
*
@@ -397,6 +410,7 @@ class SchemaShell extends Shell {
}
}
}
+
/**
* Displays help contents
*
@@ -426,4 +440,4 @@ class SchemaShell extends Shell {
$this->_stop();
}
}
-?>
+?>
\ No newline at end of file
diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php
index 9c22a8468..c5e322012 100644
--- a/cake/console/libs/shell.php
+++ b/cake/console/libs/shell.php
@@ -1,5 +1,6 @@
Dispatch =& $dispatch;
}
+
/**
* Initializes the Shell
* acts as constructor for subclasses
@@ -169,6 +186,7 @@ class Shell extends Object {
function initialize() {
$this->_loadModels();
}
+
/**
* Starts up the the Shell
* allows for checking and configuring prior to command or main execution
@@ -179,6 +197,7 @@ class Shell extends Object {
function startup() {
$this->_welcome();
}
+
/**
* Displays a header for the shell
*
@@ -191,6 +210,7 @@ class Shell extends Object {
$this->out('Path: '. $this->params['working']);
$this->hr();
}
+
/**
* Loads database file and constructs DATABASE_CONFIG class
* makes $this->DbConfig available to subclasses
@@ -207,6 +227,7 @@ class Shell extends Object {
$this->out('Run \'bake\' to create the database configuration');
return false;
}
+
/**
* if var $uses = true
* Loads AppModel file and constructs AppModel class
@@ -251,6 +272,7 @@ class Shell extends Object {
}
return false;
}
+
/**
* Loads tasks defined in var $tasks
*
@@ -304,6 +326,7 @@ class Shell extends Object {
return true;
}
+
/**
* Prompts the user for input, and returns it.
*
@@ -337,6 +360,7 @@ class Shell extends Object {
return $in;
}
}
+
/**
* Outputs to the stdout filehandle.
*
@@ -354,6 +378,7 @@ class Shell extends Object {
}
return $this->Dispatch->stdout($string, $newline);
}
+
/**
* Outputs to the stderr filehandle.
*
@@ -370,6 +395,7 @@ class Shell extends Object {
}
return $this->Dispatch->stderr($string."\n");
}
+
/**
* Outputs a series of minus characters to the standard output, acts as a visual separator.
*
@@ -385,6 +411,7 @@ class Shell extends Object {
$this->out("\n");
}
}
+
/**
* Displays a formatted error message and exits the application
*
@@ -399,6 +426,7 @@ class Shell extends Object {
$this->err($out);
$this->_stop();
}
+
/**
* Will check the number args matches otherwise throw an error
*
@@ -414,6 +442,7 @@ class Shell extends Object {
$this->error("Wrong number of parameters: ".count($this->args), "Expected: {$expectedNum}\nPlease type 'cake {$this->shell} help' for help on usage of the {$this->name} {$command}");
}
}
+
/**
* Creates a file at given path
*
@@ -449,6 +478,7 @@ class Shell extends Object {
return false;
}
}
+
/**
* Outputs usage text on the standard output. Implement it in subclasses.
*
@@ -461,6 +491,7 @@ class Shell extends Object {
$this->Dispatch->help();
}
}
+
/**
* Action to create a Unit Test
*
@@ -479,6 +510,7 @@ class Shell extends Object {
}
return $result;
}
+
/**
* Makes absolute file path easier to read
*
@@ -491,6 +523,7 @@ class Shell extends Object {
$shortPath = str_replace('..'.DS, '', $shortPath);
return r(DS.DS, DS, $shortPath);
}
+
/**
* Creates the proper controller path for the specified controller class name
*
@@ -501,6 +534,7 @@ class Shell extends Object {
function _controllerPath($name) {
return low(Inflector::underscore($name));
}
+
/**
* Creates the proper controller plural name for the specified controller class name
*
@@ -511,6 +545,7 @@ class Shell extends Object {
function _controllerName($name) {
return Inflector::pluralize(Inflector::camelize($name));
}
+
/**
* Creates the proper controller camelized name (singularized) for the specified name
*
@@ -521,6 +556,7 @@ class Shell extends Object {
function _modelName($name) {
return Inflector::camelize(Inflector::singularize($name));
}
+
/**
* Creates the proper singular model key for associations
*
@@ -531,6 +567,7 @@ class Shell extends Object {
function _modelKey($name) {
return Inflector::underscore(Inflector::singularize($name)).'_id';
}
+
/**
* Creates the proper model name from a foreign key
*
@@ -542,6 +579,7 @@ class Shell extends Object {
$name = str_replace('_id', '',$key);
return Inflector::camelize($name);
}
+
/**
* creates the singular name for use in views.
*
@@ -552,6 +590,7 @@ class Shell extends Object {
function _singularName($name) {
return Inflector::variable(Inflector::singularize($name));
}
+
/**
* Creates the plural name for views
*
@@ -562,6 +601,7 @@ class Shell extends Object {
function _pluralName($name) {
return Inflector::variable(Inflector::pluralize($name));
}
+
/**
* Creates the singular human name used in views
*
@@ -572,6 +612,7 @@ class Shell extends Object {
function _singularHumanName($name) {
return Inflector::humanize(Inflector::underscore(Inflector::singularize($name)));
}
+
/**
* Creates the plural human name used in views
*
@@ -582,6 +623,7 @@ class Shell extends Object {
function _pluralHumanName($name) {
return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name)));
}
+
/**
* Find the correct path for a plugin. Scans $pluginPaths for the plugin you want.
*
diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php
index 46828a750..25e63e404 100644
--- a/cake/console/libs/tasks/controller.php
+++ b/cake/console/libs/tasks/controller.php
@@ -20,6 +20,7 @@
* @since CakePHP(tm) v 1.2
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Task class for creating and updating controller files.
*
@@ -27,6 +28,7 @@
* @subpackage cake.cake.console.libs.tasks
*/
class ControllerTask extends Shell {
+
/**
* Name of plugin
*
@@ -34,6 +36,7 @@ class ControllerTask extends Shell {
* @access public
*/
var $plugin = null;
+
/**
* Tasks to be loaded by this Task
*
@@ -41,6 +44,7 @@ class ControllerTask extends Shell {
* @access public
*/
var $tasks = array('Model', 'Test', 'Template', 'DbConfig', 'Project');
+
/**
* path to CONTROLLERS directory
*
@@ -48,6 +52,7 @@ class ControllerTask extends Shell {
* @access public
*/
var $path = CONTROLLERS;
+
/**
* Override initialize
*
@@ -55,6 +60,7 @@ class ControllerTask extends Shell {
*/
function initialize() {
}
+
/**
* Execution method always used for tasks
*
@@ -97,6 +103,7 @@ class ControllerTask extends Shell {
}
}
}
+
/**
* Bake All the controllers at once. Will only bake controllers for models that exist.
*
@@ -119,6 +126,7 @@ class ControllerTask extends Shell {
}
}
}
+
/**
* Interactive
*
@@ -202,6 +210,7 @@ class ControllerTask extends Shell {
}
}
}
+
/**
* Confirm a to be baked controller with the user
*
@@ -239,6 +248,7 @@ class ControllerTask extends Shell {
}
$this->hr();
}
+
/**
* Interact with the user and ask about which methods (admin or regular they want to bake)
*
@@ -255,6 +265,7 @@ class ControllerTask extends Shell {
);
return array($wannaBakeCrud, $wannaBakeAdminCrud);
}
+
/**
* Bake scaffold actions
*
@@ -286,6 +297,7 @@ class ControllerTask extends Shell {
$actions = $this->Template->generate('actions', 'controller_actions');
return $actions;
}
+
/**
* Assembles and writes a Controller file
*
@@ -314,6 +326,7 @@ class ControllerTask extends Shell {
}
return false;
}
+
/**
* Assembles and writes a unit test file
*
@@ -326,6 +339,7 @@ class ControllerTask extends Shell {
$this->Test->connection = $this->connection;
return $this->Test->bake('Controller', $className);
}
+
/**
* Interact with the user and get a list of additional helpers
*
@@ -349,6 +363,7 @@ class ControllerTask extends Shell {
__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)
);
}
+
/**
* Common code for property choice handling.
*
@@ -366,6 +381,7 @@ class ControllerTask extends Shell {
}
return array_filter($property);
}
+
/**
* Outputs and gets the list of possible controllers from database
*
@@ -392,6 +408,7 @@ class ControllerTask extends Shell {
}
return $this->__tables;
}
+
/**
* Forces the user to specify the controller he wants to bake, and returns the selected controller name.
*
@@ -424,6 +441,7 @@ class ControllerTask extends Shell {
}
return $controllerName;
}
+
/**
* Displays help contents
*
diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php
index 42c0a42af..befedb4c1 100644
--- a/cake/console/libs/tasks/db_config.php
+++ b/cake/console/libs/tasks/db_config.php
@@ -20,6 +20,7 @@
* @since CakePHP(tm) v 1.2
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Task class for creating and updating the database configuration file.
*
@@ -27,6 +28,7 @@
* @subpackage cake.cake.console.libs.tasks
*/
class DbConfigTask extends Shell {
+
/**
* path to CONFIG directory
*
@@ -34,6 +36,7 @@ class DbConfigTask extends Shell {
* @access public
*/
var $path = null;
+
/**
* Default configuration settings to use
*
@@ -45,6 +48,7 @@ class DbConfigTask extends Shell {
'login'=> 'root', 'password'=> 'password', 'database'=> 'project_name',
'schema'=> null, 'prefix'=> null, 'encoding' => null, 'port' => null
);
+
/**
* String name of the database config class name.
* Used for testing.
@@ -52,6 +56,7 @@ class DbConfigTask extends Shell {
* @var string
**/
var $databaseClassName = 'DATABASE_CONFIG';
+
/**
* initialization callback
*
@@ -61,6 +66,7 @@ class DbConfigTask extends Shell {
function initialize() {
$this->path = $this->params['working'] . DS . 'config' . DS;
}
+
/**
* Execution method always used for tasks
*
@@ -72,6 +78,7 @@ class DbConfigTask extends Shell {
$this->_stop();
}
}
+
/**
* Interactive interface
*
@@ -187,6 +194,7 @@ class DbConfigTask extends Shell {
config('database');
return true;
}
+
/**
* Output verification message and bake if it looks good
*
@@ -233,6 +241,7 @@ class DbConfigTask extends Shell {
}
return false;
}
+
/**
* Assembles and writes database.php
*
@@ -337,6 +346,7 @@ class DbConfigTask extends Shell {
$filename = $this->path . 'database.php';
return $this->createFile($filename, $out);
}
+
/**
* Get a user specified Connection name
*
diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php
index 552eb8497..eda49614b 100644
--- a/cake/console/libs/tasks/extract.php
+++ b/cake/console/libs/tasks/extract.php
@@ -20,6 +20,7 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Only used when -debug option
*/
@@ -47,6 +48,7 @@
$categoryEcho = __c('Category string lookup line echo __c()', 5);
ob_end_clean();
+
/**
* Language string extractor
*
@@ -54,6 +56,7 @@
* @subpackage cake.cake.console.libs
*/
class ExtractTask extends Shell{
+
/**
* Path to use when looking for strings
*
@@ -61,6 +64,7 @@ class ExtractTask extends Shell{
* @access public
*/
var $path = null;
+
/**
* Files from where to extract
*
@@ -68,6 +72,7 @@ class ExtractTask extends Shell{
* @access public
*/
var $files = array();
+
/**
* Filename where to deposit translations
*
@@ -75,6 +80,7 @@ class ExtractTask extends Shell{
* @access private
*/
var $__filename = 'default';
+
/**
* True if all strings should be merged into one file
*
@@ -82,6 +88,7 @@ class ExtractTask extends Shell{
* @access private
*/
var $__oneFile = true;
+
/**
* Current file being processed
*
@@ -89,6 +96,7 @@ class ExtractTask extends Shell{
* @access private
*/
var $__file = null;
+
/**
* Extracted tokens
*
@@ -96,6 +104,7 @@ class ExtractTask extends Shell{
* @access private
*/
var $__tokens = array();
+
/**
* Extracted strings
*
@@ -103,6 +112,7 @@ class ExtractTask extends Shell{
* @access private
*/
var $__strings = array();
+
/**
* History of file versions
*
@@ -110,6 +120,7 @@ class ExtractTask extends Shell{
* @access private
*/
var $__fileVersions = array();
+
/**
* Destination path
*
@@ -117,6 +128,7 @@ class ExtractTask extends Shell{
* @access private
*/
var $__output = null;
+
/**
* Execution method always used for tasks
*
@@ -176,6 +188,7 @@ class ExtractTask extends Shell{
}
$this->__extract();
}
+
/**
* Extract text
*
@@ -208,6 +221,7 @@ class ExtractTask extends Shell{
}
$this->__extractTokens();
}
+
/**
* Show help options
*
@@ -233,6 +247,7 @@ class ExtractTask extends Shell{
$this->out(__(' -debug: Perform self test.', true));
$this->out('');
}
+
/**
* Extract tokens out of all files to be processed
*
@@ -277,6 +292,7 @@ class ExtractTask extends Shell{
$this->__writeFiles();
$this->out('Done.');
}
+
/**
* Will parse __(), __c() functions
*
@@ -312,6 +328,7 @@ class ExtractTask extends Shell{
$count++;
}
}
+
/**
* Will parse __d(), __dc(), __n(), __dn(), __dcn()
*
@@ -398,6 +415,7 @@ class ExtractTask extends Shell{
$count++;
}
}
+
/**
* Build the translate template file contents out of obtained strings
*
@@ -460,6 +478,7 @@ class ExtractTask extends Shell{
$this->__store($filename, $output, $fileList);
}
}
+
/**
* Prepare a file to be stored
*
@@ -487,6 +506,7 @@ class ExtractTask extends Shell{
return $storage;
}
}
+
/**
* Write the files that need to be stored
*
@@ -535,6 +555,7 @@ class ExtractTask extends Shell{
fclose($fp);
}
}
+
/**
* Merge output files
*
@@ -561,6 +582,7 @@ class ExtractTask extends Shell{
}
return $output;
}
+
/**
* Build the translation template header
*
@@ -586,6 +608,7 @@ class ExtractTask extends Shell{
$output .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n\n";
return $output;
}
+
/**
* Find the version number of a file looking for SVN commands
*
@@ -600,6 +623,7 @@ class ExtractTask extends Shell{
$this->__fileVersions[$file] = $version;
}
}
+
/**
* Format a string to be added as a translateable string
*
@@ -618,6 +642,7 @@ class ExtractTask extends Shell{
$string = str_replace("\r\n", "\n", $string);
return addcslashes($string, "\0..\37\\\"");
}
+
/**
* Indicate an invalid marker on a processed file
*
@@ -650,6 +675,7 @@ class ExtractTask extends Shell{
}
$this->out("\n", true);
}
+
/**
* Search the specified path for files that may contain translateable strings
*
diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php
index f145ee73c..eca3b9da6 100644
--- a/cake/console/libs/tasks/fixture.php
+++ b/cake/console/libs/tasks/fixture.php
@@ -18,6 +18,7 @@
* @since CakePHP(tm) v 1.3
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Task class for creating and updating fixtures files.
*
@@ -25,6 +26,7 @@
* @subpackage cake.cake.console.libs.tasks
*/
class FixtureTask extends Shell {
+
/**
* Name of plugin
*
@@ -32,6 +34,7 @@ class FixtureTask extends Shell {
* @access public
*/
var $plugin = null;
+
/**
* Tasks to be loaded by this Task
*
@@ -39,6 +42,7 @@ class FixtureTask extends Shell {
* @access public
*/
var $tasks = array('DbConfig', 'Model', 'Template');
+
/**
* path to fixtures directory
*
@@ -46,18 +50,21 @@ class FixtureTask extends Shell {
* @access public
*/
var $path = null;
+
/**
* The db connection being used for baking
*
* @var string
**/
var $connection = null;
+
/**
* Schema instance
*
* @var object
**/
var $_Schema = null;
+
/**
* Override initialize
*
@@ -70,6 +77,7 @@ class FixtureTask extends Shell {
App::import('Model', 'CakeSchema');
}
}
+
/**
* Execution method always used for tasks
* Handles dispatching to interactive, named, or all processess.
@@ -92,6 +100,7 @@ class FixtureTask extends Shell {
$this->bake($model);
}
}
+
/**
* Bake All the Fixtures at once. Will only bake fixtures for models that exist.
*
@@ -106,6 +115,7 @@ class FixtureTask extends Shell {
$this->bake($model);
}
}
+
/**
* Interactive baking function
*
@@ -126,6 +136,7 @@ class FixtureTask extends Shell {
$importOptions = $this->importOptions($modelName);
$this->bake($modelName, $useTable, $importOptions);
}
+
/**
* Interacts with the User to setup an array of import options. For a fixture.
*
@@ -151,6 +162,7 @@ class FixtureTask extends Shell {
}
return $options;
}
+
/**
* Assembles and writes a Fixture file
*
@@ -209,6 +221,7 @@ class FixtureTask extends Shell {
$out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields'));
return $out;
}
+
/**
* Generate the fixture file, and write to disk
*
@@ -235,6 +248,7 @@ class FixtureTask extends Shell {
$this->createFile($path . $filename, $content);
return $content;
}
+
/**
* Generates a string representation of a schema.
*
@@ -265,6 +279,7 @@ class FixtureTask extends Shell {
$out .= "\n\t)";
return $out;
}
+
/**
* Generate String representation of Records
*
@@ -333,6 +348,7 @@ class FixtureTask extends Shell {
}
return $records;
}
+
/**
* Convert a $records array into a a string.
*
@@ -353,10 +369,11 @@ class FixtureTask extends Shell {
$out .= "\t)";
return $out;
}
+
/**
* Interact with the user to get a custom SQL condition and use that to extract data
* to build a fixture.
- *
+ *
* @param string $modelName name of the model to take records from.
* @param string $useTable Name of table to use.
* @return array Array of records.
@@ -385,6 +402,7 @@ class FixtureTask extends Shell {
}
return $out;
}
+
/**
* Displays help contents
*
diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php
index d436748d9..8d3840158 100644
--- a/cake/console/libs/tasks/model.php
+++ b/cake/console/libs/tasks/model.php
@@ -21,6 +21,7 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Model', 'ConnectionManager');
+
/**
* Task class for creating and updating model files.
*
@@ -28,6 +29,7 @@ App::import('Model', 'ConnectionManager');
* @subpackage cake.cake.console.libs.tasks
*/
class ModelTask extends Shell {
+
/**
* Name of plugin
*
@@ -35,6 +37,7 @@ class ModelTask extends Shell {
* @access public
*/
var $plugin = null;
+
/**
* Name of the db connection used.
*
@@ -42,6 +45,7 @@ class ModelTask extends Shell {
* @access public
*/
var $connection = null;
+
/**
* path to MODELS directory
*
@@ -49,6 +53,7 @@ class ModelTask extends Shell {
* @access public
*/
var $path = MODELS;
+
/**
* tasks
*
@@ -56,18 +61,21 @@ class ModelTask extends Shell {
* @access public
*/
var $tasks = array('DbConfig', 'Fixture', 'Test', 'Template');
+
/**
* Holds tables found on connection.
*
* @var array
**/
var $__tables = array();
+
/**
* Holds validation method map.
*
* @var array
**/
var $__validations = array();
+
/**
* startup method
*
@@ -77,6 +85,7 @@ class ModelTask extends Shell {
App::import('Core', 'Model');
parent::startup();
}
+
/**
* Execution method always used for tasks
*
@@ -105,6 +114,7 @@ class ModelTask extends Shell {
}
}
}
+
/**
* Bake all models at once.
*
@@ -123,6 +133,7 @@ class ModelTask extends Shell {
}
}
}
+
/**
* Get a model object for a class name.
*
@@ -133,9 +144,10 @@ class ModelTask extends Shell {
$object = new Model(array('name' => $className, 'ds' => $this->connection));
return $object;
}
+
/**
* Generate a key value list of options and a prompt.
- *
+ *
* @param array $options Array of options to use for the selections. indexes must start at 0
* @param string $prompt Prompt to use for options list.
* @param integer $default The default option for the given prompt.
@@ -158,6 +170,7 @@ class ModelTask extends Shell {
}
return $choice - 1;
}
+
/**
* Handles interactive baking
*
@@ -250,6 +263,7 @@ class ModelTask extends Shell {
return false;
}
}
+
/**
* Print out all the associations of a particular type
*
@@ -267,6 +281,7 @@ class ModelTask extends Shell {
}
}
}
+
/**
* Finds a primary Key in a list of fields.
*
@@ -282,6 +297,7 @@ class ModelTask extends Shell {
}
return $this->in(__('What is the primaryKey?', true), null, $name);
}
+
/**
* interact with the user to find the displayField value for a model.
*
@@ -299,6 +315,7 @@ class ModelTask extends Shell {
$choice = $this->inOptions($fieldNames, $prompt);
return $fieldNames[$choice];
}
+
/**
* Handles Generation and user interaction for creating validation.
*
@@ -325,8 +342,9 @@ class ModelTask extends Shell {
}
return $validate;
}
+
/**
- * Populate the __validations array
+ * Populate the __validations array
*
* @return void
**/
@@ -347,6 +365,7 @@ class ModelTask extends Shell {
$this->__validations = $choices;
return $choices;
}
+
/**
* Does individual field validation handling.
*
@@ -357,7 +376,7 @@ class ModelTask extends Shell {
function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
$defaultChoice = count($this->__validations);
$validate = $alreadyChosen = array();
-
+
$anotherValidator = 'y';
while ($anotherValidator == 'y') {
if ($this->interactive) {
@@ -368,7 +387,7 @@ class ModelTask extends Shell {
$this->out(__('Please select one of the following validation options:', true));
$this->hr();
}
-
+
$prompt = '';
for ($i = 1; $i < $defaultChoice; $i++) {
$prompt .= $i . ' - ' . $this->__validations[$i] . "\n";
@@ -420,6 +439,7 @@ class ModelTask extends Shell {
}
return $validate;
}
+
/**
* Handles associations
*
@@ -466,6 +486,7 @@ class ModelTask extends Shell {
}
return $associations;
}
+
/**
* Find belongsTo relations and add them to the associations list.
*
@@ -494,10 +515,11 @@ class ModelTask extends Shell {
}
return $associations;
}
+
/**
* Find the hasOne and HasMany relations and add them to associations list
*
- * @param object $model Model instance being generated
+ * @param object $model Model instance being generated
* @param array $associations Array of inprogress associations
* @return array $associations with hasOne and hasMany added in.
**/
@@ -531,15 +553,16 @@ class ModelTask extends Shell {
$associations['hasOne'][] = $assoc;
$associations['hasMany'][] = $assoc;
}
-
+
}
}
return $associations;
}
+
/**
* Find the hasAndBelongsToMany relations and add them to associations list
*
- * @param object $model Model instance being generated
+ * @param object $model Model instance being generated
* @param array $associations Array of inprogress associations
* @return array $associations with hasAndBelongsToMany added in.
**/
@@ -575,6 +598,7 @@ class ModelTask extends Shell {
}
return $associations;
}
+
/**
* Interact with the user and confirm associations.
*
@@ -602,6 +626,7 @@ class ModelTask extends Shell {
}
return $associations;
}
+
/**
* Interact with the user and generate additional non-conventional associations
*
@@ -668,6 +693,7 @@ class ModelTask extends Shell {
}
return $associations;
}
+
/**
* Finds all possible keys to use on custom associations.
*
@@ -686,6 +712,7 @@ class ModelTask extends Shell {
}
return $possible;
}
+
/**
* Assembles and writes a Model file.
*
@@ -707,7 +734,7 @@ class ModelTask extends Shell {
} else {
$data['name'] = $name;
}
- $defaults = array('associations' => array(), 'validate' => array(), 'primaryKey' => 'id',
+ $defaults = array('associations' => array(), 'validate' => array(), 'primaryKey' => 'id',
'useTable' => null, 'useDbConfig' => 'default', 'displayField' => null);
$data = array_merge($defaults, $data);
@@ -724,6 +751,7 @@ class ModelTask extends Shell {
$this->createFile($filename, $out);
return $out;
}
+
/**
* Assembles and writes a unit test file
*
@@ -735,6 +763,7 @@ class ModelTask extends Shell {
$this->Test->connection = $this->connection;
return $this->Test->bake('Model', $className);
}
+
/**
* outputs the a list of possible models or controllers from database
*
@@ -755,9 +784,10 @@ class ModelTask extends Shell {
}
return $this->__tables;
}
+
/**
* Interact with the user to determine the table name of a particular model
- *
+ *
* @param string $modelName Name of the model you want a table for.
* @param string $useDbConfig Name of the database config you want to get tables from.
* @return void
@@ -781,10 +811,11 @@ class ModelTask extends Shell {
}
return $useTable;
}
+
/**
* Get an Array of all the tables in the supplied connection
* will halt the script if no tables are found.
- *
+ *
* @param string $useDbConfig Connection name to scan.
* @return array Array of tables in the database.
**/
@@ -810,6 +841,7 @@ class ModelTask extends Shell {
}
return $tables;
}
+
/**
* Forces the user to specify the model he wants to bake, and returns the selected model name.
*
@@ -841,6 +873,7 @@ class ModelTask extends Shell {
}
return $currentModelName;
}
+
/**
* Displays help contents
*
@@ -863,6 +896,7 @@ class ModelTask extends Shell {
$this->out("");
$this->_stop();
}
+
/**
* Interact with FixtureTask to automatically bake fixtures when baking models.
*
diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php
index 2049d8c80..833f67be6 100644
--- a/cake/console/libs/tasks/plugin.php
+++ b/cake/console/libs/tasks/plugin.php
@@ -28,11 +28,13 @@
* @subpackage cake.cake.console.libs.tasks
*/
class PluginTask extends Shell {
+
/**
* Tasks
*
*/
var $tasks = array('Model', 'Controller', 'View');
+
/**
* path to CONTROLLERS directory
*
@@ -40,6 +42,7 @@ class PluginTask extends Shell {
* @access public
*/
var $path = null;
+
/**
* initialize
*
@@ -48,6 +51,7 @@ class PluginTask extends Shell {
function initialize() {
$this->path = APP . 'plugins' . DS;
}
+
/**
* Execution method always used for tasks
*
@@ -94,6 +98,7 @@ class PluginTask extends Shell {
}
}
}
+
/**
* Interactive interface
*
@@ -109,6 +114,7 @@ class PluginTask extends Shell {
$this->err(sprintf(__("An error occured trying to bake: %s in %s", true), $plugin, $this->path . $pluginPath));
}
}
+
/**
* Bake the plugin, create directories and files
*
@@ -137,18 +143,18 @@ class PluginTask extends Shell {
$Folder =& new Folder($this->path . $pluginPath);
$directories = array(
'config' . DS . 'sql',
- 'models' . DS . 'behaviors',
- 'controllers' . DS . 'components',
- 'views' . DS . 'helpers',
- 'tests' . DS . 'cases' . DS . 'components',
- 'tests' . DS . 'cases' . DS . 'helpers',
- 'tests' . DS . 'cases' . DS . 'behaviors',
- 'tests' . DS . 'cases' . DS . 'controllers',
- 'tests' . DS . 'cases' . DS . 'models',
- 'tests' . DS . 'groups',
- 'tests' . DS . 'fixtures',
- 'vendors' . DS . 'img',
- 'vendors' . DS . 'js',
+ 'models' . DS . 'behaviors',
+ 'controllers' . DS . 'components',
+ 'views' . DS . 'helpers',
+ 'tests' . DS . 'cases' . DS . 'components',
+ 'tests' . DS . 'cases' . DS . 'helpers',
+ 'tests' . DS . 'cases' . DS . 'behaviors',
+ 'tests' . DS . 'cases' . DS . 'controllers',
+ 'tests' . DS . 'cases' . DS . 'models',
+ 'tests' . DS . 'groups',
+ 'tests' . DS . 'fixtures',
+ 'vendors' . DS . 'img',
+ 'vendors' . DS . 'js',
'vendors' . DS . 'css',
'vendors' . DS . 'shells'
);
@@ -193,6 +199,7 @@ class PluginTask extends Shell {
return true;
}
+
/**
* find and change $this->path to the user selection
*
@@ -213,6 +220,7 @@ class PluginTask extends Shell {
}
$this->path = $pathOptions[$choice - 1];
}
+
/**
* Help
*
diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php
index fda6a7cf7..be7963b43 100644
--- a/cake/console/libs/tasks/project.php
+++ b/cake/console/libs/tasks/project.php
@@ -19,6 +19,7 @@
* @since CakePHP(tm) v 1.2
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Task class for creating new project apps and plugins
*
@@ -26,12 +27,14 @@
* @subpackage cake.cake.console.libs.tasks
*/
class ProjectTask extends Shell {
+
/**
* configs path (used in testing).
*
* @var string
**/
var $configPath = null;
+
/**
* Checks that given project path does not already exist, and
* finds the app directory in it. Then it calls bake() with that information.
@@ -106,6 +109,7 @@ class ProjectTask extends Shell {
return true;
}
}
+
/**
* Looks for a skeleton template of a Cake application,
* and if not found asks the user for a path. When there is a path
@@ -169,6 +173,7 @@ class ProjectTask extends Shell {
return false;
}
}
+
/**
* Writes a file with a default home page to the project.
*
@@ -182,6 +187,7 @@ class ProjectTask extends Shell {
include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'default'.DS.'views'.DS.'home.ctp');
return $this->createFile($path.'home.ctp', $output);
}
+
/**
* Generates and writes 'Security.salt'
*
@@ -205,6 +211,7 @@ class ProjectTask extends Shell {
}
return false;
}
+
/**
* Generates and writes CAKE_CORE_INCLUDE_PATH
*
@@ -238,6 +245,7 @@ class ProjectTask extends Shell {
return true;
}
}
+
/**
* Enables Configure::read('Routing.admin') in /app/config/core.php
*
@@ -261,6 +269,7 @@ class ProjectTask extends Shell {
return false;
}
}
+
/**
* Checks for Configure::read('Routing.admin') and forces user to input it if not enabled
*
@@ -287,6 +296,7 @@ class ProjectTask extends Shell {
}
return $admin . '_';
}
+
/**
* Help
*
diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php
index fd01e90d5..2fa426ddb 100644
--- a/cake/console/libs/tasks/template.php
+++ b/cake/console/libs/tasks/template.php
@@ -18,12 +18,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
class TemplateTask extends Shell {
+
/**
* variables to add to template scope
*
* @var array
**/
var $templateVars = array();
+
/**
* Paths to look for templates on.
* Contains a list of $theme => $path
@@ -31,6 +33,7 @@ class TemplateTask extends Shell {
* @var array
**/
var $templatePaths = array();
+
/**
* Initialize callback. Setup paths for the template task.
*
@@ -40,6 +43,7 @@ class TemplateTask extends Shell {
function initialize() {
$this->templatePaths = $this->_findThemes();
}
+
/**
* Find the paths to all the installed shell themes in the app.
*
@@ -64,6 +68,7 @@ class TemplateTask extends Shell {
}
return $themes;
}
+
/**
* Set variable values to the template scope
*
@@ -92,6 +97,7 @@ class TemplateTask extends Shell {
$this->templateVars[$name] = $value;
}
}
+
/**
* Runs the template
*
@@ -120,6 +126,7 @@ class TemplateTask extends Shell {
}
return '';
}
+
/**
* Find the theme name for the current operation.
* If there is only one theme in $templatePaths it will be used.
@@ -136,7 +143,7 @@ class TemplateTask extends Shell {
if (!empty($this->params['theme']) && isset($this->templatePaths[$this->params['theme']])) {
return $this->templatePaths[$this->params['theme']];
}
-
+
$this->hr();
$this->out(__('You have more than one set of templates installed.', true));
$this->out(__('Please choose the template set you wish to use:', true));
@@ -154,6 +161,7 @@ class TemplateTask extends Shell {
$this->Dispatch->params['theme'] = $themeNames[$index - 1];
return $indexedPaths[$index];
}
+
/**
* Find a template inside a directory inside a path.
* Will scan all other theme dirs if the template is not found in the first directory.
diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php
index 54668a843..9978c66e4 100644
--- a/cake/console/libs/tasks/test.php
+++ b/cake/console/libs/tasks/test.php
@@ -18,6 +18,7 @@
* @since CakePHP(tm) v 1.3
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Task class for creating and updating test files.
*
@@ -25,6 +26,7 @@
* @subpackage cake.cake.console.libs.tasks
*/
class TestTask extends Shell {
+
/**
* Name of plugin
*
@@ -32,6 +34,7 @@ class TestTask extends Shell {
* @access public
*/
var $plugin = null;
+
/**
* path to TESTS directory
*
@@ -46,24 +49,28 @@ class TestTask extends Shell {
* @var array
**/
var $tasks = array('Template');
+
/**
* class types that methods can be generated for
*
* @var array
**/
var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper');
+
/**
* Internal list of fixtures that have been added so far.
*
* @var string
**/
var $_fixtures = array();
+
/**
* Flag for interactive mode
*
* @var boolean
**/
var $interactive = false;
+
/**
* Execution method always used for tasks
*
@@ -85,6 +92,7 @@ class TestTask extends Shell {
}
}
}
+
/**
* Handles interactive baking
*
@@ -110,11 +118,12 @@ class TestTask extends Shell {
$className = $this->getClassName($type);
return $this->bake($type, $className);
}
+
/**
* Completes final steps for generating data to create test case.
*
* @param string $type Type of object to bake test case for ie. Model, Controller
- * @param string $className the 'cake name' for the class ie. Posts for the PostsController
+ * @param string $className the 'cake name' for the class ie. Posts for the PostsController
* @access public
*/
function bake($type, $className) {
@@ -151,6 +160,7 @@ class TestTask extends Shell {
}
return false;
}
+
/**
* Interact with the user and get their chosen type. Can exit the script.
*
@@ -173,6 +183,7 @@ class TestTask extends Shell {
}
return $this->classTypes[$selection - 1];
}
+
/**
* Get the user chosen Class name for the chosen type
*
@@ -193,6 +204,7 @@ class TestTask extends Shell {
}
return $selection;
}
+
/**
* Checks whether the chosen type can find its own fixtures.
* Currently only model, and controller are supported
@@ -203,6 +215,7 @@ class TestTask extends Shell {
$type = strtolower($type);
return ($type == 'controller' || $type == 'model');
}
+
/**
* Check if a class with the given type is loaded or can be loaded.
*
@@ -211,6 +224,7 @@ class TestTask extends Shell {
function isLoadableClass($type, $class) {
return App::import($type, $class);
}
+
/**
* Construct an instance of the class to be tested.
* So that fixtures can be detected
@@ -228,6 +242,7 @@ class TestTask extends Shell {
}
return $instance;
}
+
/**
* Gets the real class name from the cake short form.
*
@@ -239,6 +254,7 @@ class TestTask extends Shell {
}
return $class . $type;
}
+
/**
* Get methods declared in the class given.
* No parent methods will be returned
@@ -258,6 +274,7 @@ class TestTask extends Shell {
}
return $out;
}
+
/**
* Generate the list of fixtures that will be required to run this test based on
* loaded models.
@@ -274,6 +291,7 @@ class TestTask extends Shell {
}
return array_values($this->_fixtures);
}
+
/**
* Process a model recursively and pull out all the
* model names converting them to fixture names.
@@ -297,6 +315,7 @@ class TestTask extends Shell {
}
}
}
+
/**
* Process all the models attached to a controller
* and generate a fixture list.
@@ -314,6 +333,7 @@ class TestTask extends Shell {
$this->_processModel($subject->{$model});
}
}
+
/**
* Add classname to the fixture list.
* Sets the app. or plugin.plugin_name. prefix.
@@ -331,6 +351,7 @@ class TestTask extends Shell {
$fixture = $prefix . Inflector::underscore($name);
$this->_fixtures[$name] = $fixture;
}
+
/**
* Interact with the user to get additional fixtures they want to use.
*
@@ -347,6 +368,7 @@ class TestTask extends Shell {
$this->_fixtures = array_merge($this->_fixtures, $fixtures);
return $fixtures;
}
+
/**
* Is a mock class required for this type of test?
* Controllers require a mock class.
@@ -357,6 +379,7 @@ class TestTask extends Shell {
$type = strtolower($type);
return $type == 'controller';
}
+
/**
* Generate a constructor code snippet for the type and classname
*
@@ -372,6 +395,7 @@ class TestTask extends Shell {
}
return "new $fullClassName()\n";
}
+
/**
* make the filename for the test case. resolve the suffixes for controllers
* and get the plugin path if needed.
diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php
index ba5f1c37e..515d0e7a8 100644
--- a/cake/console/libs/tasks/view.php
+++ b/cake/console/libs/tasks/view.php
@@ -21,6 +21,7 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', 'Controller');
+
/**
* Task class for creating and updating view files.
*
@@ -28,6 +29,7 @@ App::import('Core', 'Controller');
* @subpackage cake.cake.console.libs.tasks
*/
class ViewTask extends Shell {
+
/**
* Name of plugin
*
@@ -35,6 +37,7 @@ class ViewTask extends Shell {
* @access public
*/
var $plugin = null;
+
/**
* Tasks to be loaded by this Task
*
@@ -42,6 +45,7 @@ class ViewTask extends Shell {
* @access public
*/
var $tasks = array('Project', 'Controller', 'DbConfig', 'Template');
+
/**
* path to VIEWS directory
*
@@ -49,6 +53,7 @@ class ViewTask extends Shell {
* @access public
*/
var $path = VIEWS;
+
/**
* Name of the controller being used
*
@@ -56,6 +61,7 @@ class ViewTask extends Shell {
* @access public
*/
var $controllerName = null;
+
/**
* Path to controller to put views
*
@@ -63,6 +69,7 @@ class ViewTask extends Shell {
* @access public
*/
var $controllerPath = null;
+
/**
* The template file to use
*
@@ -70,6 +77,7 @@ class ViewTask extends Shell {
* @access public
*/
var $template = null;
+
/**
* Actions to use for scaffolding
*
@@ -77,6 +85,7 @@ class ViewTask extends Shell {
* @access public
*/
var $scaffoldActions = array('index', 'view', 'add', 'edit');
+
/**
* Override initialize
*
@@ -84,6 +93,7 @@ class ViewTask extends Shell {
*/
function initialize() {
}
+
/**
* Execution method always used for tasks
*
@@ -153,6 +163,7 @@ class ViewTask extends Shell {
}
}
}
+
/**
* Get a list of actions that can / should have views baked for them.
*
@@ -177,6 +188,7 @@ class ViewTask extends Shell {
}
return $methods;
}
+
/**
* Bake All views for All controllers.
*
@@ -197,6 +209,7 @@ class ViewTask extends Shell {
}
}
}
+
/**
* Handles interactive baking
*
@@ -250,6 +263,7 @@ class ViewTask extends Shell {
$this->customAction();
}
}
+
/**
* Loads Controller and sets variables for the template
* Available template variables
@@ -306,6 +320,7 @@ class ViewTask extends Shell {
return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
'singularHumanName', 'pluralHumanName', 'fields','associations');
}
+
/**
* Bake a view file for each of the supplied actions
*
@@ -318,6 +333,7 @@ class ViewTask extends Shell {
$this->bake($action, $content);
}
}
+
/**
* handle creation of baking a custom action view file
*
@@ -347,6 +363,7 @@ class ViewTask extends Shell {
$this->out(__('Bake Aborted.', true));
}
}
+
/**
* Assembles and writes bakes the view file.
*
@@ -366,6 +383,7 @@ class ViewTask extends Shell {
$filename = $path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp';
return $this->createFile($filename, $content);
}
+
/**
* Builds content from template and variables
*
@@ -404,6 +422,7 @@ class ViewTask extends Shell {
$this->err(sprintf(__('Template for %s could not be found', true), $template));
return false;
}
+
/**
* Displays help contents
*
@@ -435,6 +454,7 @@ class ViewTask extends Shell {
$this->out("\tRequires that models and controllers exist.");
$this->_stop();
}
+
/**
* Returns associations for controllers models.
*
diff --git a/cake/console/libs/templates/default/actions/controller_actions.ctp b/cake/console/libs/templates/default/actions/controller_actions.ctp
index 99b18bd33..30b1e1459 100644
--- a/cake/console/libs/templates/default/actions/controller_actions.ctp
+++ b/cake/console/libs/templates/default/actions/controller_actions.ctp
@@ -139,4 +139,4 @@
$this->flash(__(' was not deleted', true), array('action' => 'index'));
$this->redirect(array('action' => 'index'));
- }
+ }
\ No newline at end of file
diff --git a/cake/console/libs/templates/default/classes/model.ctp b/cake/console/libs/templates/default/classes/model.ctp
index 2e131b809..7ca0c8c80 100644
--- a/cake/console/libs/templates/default/classes/model.ctp
+++ b/cake/console/libs/templates/default/classes/model.ctp
@@ -127,4 +127,4 @@ if (!empty($associations['hasAndBelongsToMany'])):
endif;
?>
}
-'; ?>
+'; ?>
\ No newline at end of file
diff --git a/cake/console/libs/templates/default/classes/test.ctp b/cake/console/libs/templates/default/classes/test.ctp
index b19b89793..f84220c30 100644
--- a/cake/console/libs/templates/default/classes/test.ctp
+++ b/cake/console/libs/templates/default/classes/test.ctp
@@ -49,7 +49,7 @@ class TestCase extends CakeTestCase {
function test() {
-
+
}
diff --git a/cake/console/libs/templates/default/views/form.ctp b/cake/console/libs/templates/default/views/form.ctp
index 78ebdda7b..6a451dc91 100644
--- a/cake/console/libs/templates/default/views/form.ctp
+++ b/cake/console/libs/templates/default/views/form.ctp
@@ -1,5 +1,6 @@
-
+
\ No newline at end of file
diff --git a/cake/console/libs/templates/default/views/home.ctp b/cake/console/libs/templates/default/views/home.ctp
index 39020d488..82eb03b87 100644
--- a/cake/console/libs/templates/default/views/home.ctp
+++ b/cake/console/libs/templates/default/views/home.ctp
@@ -79,4 +79,4 @@ $output .= "\t\tYou can also add some CSS styles for your pages at: %s', true),\
$output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.
', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.
', APP . 'webroot' . DS . 'css');\n";
$output .= "?>\n";
$output .= "