Skip to content

Commit

Permalink
Fixed some API doc in console.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Jul 29, 2011
1 parent f9373ff commit a0ee8b4
Show file tree
Hide file tree
Showing 30 changed files with 140 additions and 51 deletions.
14 changes: 12 additions & 2 deletions lib/Cake/Console/Command/AclShell.php
Expand Up @@ -58,6 +58,7 @@ class AclShell extends Shell {
/**
* Override startup of the Shell
*
* @return void
*/
public function startup() {
parent::startup();
Expand Down Expand Up @@ -96,6 +97,7 @@ public function startup() {
/**
* Override main() for help message hook
*
* @return voids

This comment has been minimized.

Copy link
@renan

renan Jul 29, 2011

Contributor

One little typo in here.

This comment has been minimized.

Copy link
@jrbasso

jrbasso Jul 29, 2011

Author Member

Thanks! I will fix in my next push.

*/
public function main() {
$this->out($this->OptionParser->help());
Expand All @@ -104,6 +106,7 @@ public function main() {
/**
* Creates an ARO/ACO node
*
* @return void
*/
public function create() {
extract($this->__dataVars());
Expand Down Expand Up @@ -136,6 +139,7 @@ public function create() {
/**
* Delete an ARO/ACO node.
*
* @return void
*/
public function delete() {
extract($this->__dataVars());
Expand All @@ -152,6 +156,7 @@ public function delete() {
/**
* Set parent for an ARO/ACO node.
*
* @return void
*/
public function setParent() {
extract($this->__dataVars());
Expand All @@ -175,6 +180,7 @@ public function setParent() {
/**
* Get path to specified ARO/ACO node.
*
* @return void
*/
public function getPath() {
extract($this->__dataVars());
Expand Down Expand Up @@ -217,6 +223,7 @@ protected function _outputNode($class, $node, $indent) {
/**
* Check permission for a given ARO to a given ACO.
*
* @return void
*/
public function check() {
extract($this->__getParams());
Expand All @@ -231,6 +238,7 @@ public function check() {
/**
* Grant permission for a given ARO to a given ACO.
*
* @return void
*/
public function grant() {
extract($this->__getParams());
Expand All @@ -245,6 +253,7 @@ public function grant() {
/**
* Deny access for an ARO to an ACO.
*
* @return void
*/
public function deny() {
extract($this->__getParams());
Expand All @@ -259,6 +268,7 @@ public function deny() {
/**
* Set an ARO to inherit permission to an ACO.
*
* @return void
*/
public function inherit() {
extract($this->__getParams());
Expand All @@ -273,6 +283,7 @@ public function inherit() {
/**
* Show a specific ARO/ACO node.
*
* @return void
*/
public function view() {
extract($this->__dataVars());
Expand Down Expand Up @@ -332,6 +343,7 @@ public function view() {
/**
* Initialize ACL database.
*
* @return mixed
*/
public function initdb() {
return $this->dispatchShell('schema create DbAcl');
Expand Down Expand Up @@ -493,8 +505,6 @@ public function getOptionParser() {
/**
* Checks that given node exists
*
* @param string $type Node type (ARO/ACO)
* @param integer $id Node id
* @return boolean Success
*/
public function nodeExists() {
Expand Down
5 changes: 4 additions & 1 deletion lib/Cake/Console/Command/ApiShell.php
Expand Up @@ -36,6 +36,7 @@ class ApiShell extends Shell {
/**
* Override initialize of the Shell
*
* @return void
*/
public function initialize() {
$this->paths = array_merge($this->paths, array(
Expand All @@ -53,6 +54,7 @@ public function initialize() {
/**
* Override main() to handle action
*
* @return void
*/
public function main() {
if (empty($this->args)) {
Expand Down Expand Up @@ -150,6 +152,7 @@ public function getOptionParser() {
/**
* Show help for this shell.
*
* @return void
*/
public function help() {
$head = "Usage: cake api [<type>] <className> [-m <method>]\n";
Expand Down Expand Up @@ -187,7 +190,7 @@ public function help() {
* Parse a given class (located on given file) and get public methods and their
* signatures.
*
* @param object $File File object
* @param string $path File path
* @param string $class Class name
* @return array Methods and signatures indexed by method name
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/Console/Command/BakeShell.php
Expand Up @@ -47,6 +47,7 @@ class BakeShell extends Shell {
/**
* Assign $this->connection to the active task if a connection param is set.
*
* @return void
*/
public function startup() {
parent::startup();
Expand All @@ -61,6 +62,7 @@ public function startup() {
/**
* Override main() to handle action
*
* @return mixed
*/
public function main() {
if (!is_dir($this->DbConfig->path)) {
Expand Down Expand Up @@ -124,6 +126,7 @@ public function main() {
/**
* Quickly bake the MVC
*
* @return void
*/
public function all() {
$this->out('Bake All');
Expand Down
6 changes: 6 additions & 0 deletions lib/Cake/Console/Command/CommandListShell.php
Expand Up @@ -98,6 +98,9 @@ protected function _getShellList() {
/**
* Scan the provided paths for shells, and append them into $shellList
*
* @param string $type
* @param array $shells
* @param array $shellList
* @return array
*/
protected function _appendShells($type, $shells, $shellList) {
Expand All @@ -111,6 +114,7 @@ protected function _appendShells($type, $shells, $shellList) {
/**
* Output text.
*
* @param array $shellList
* @return void
*/
protected function _asText($shellList) {
Expand Down Expand Up @@ -146,6 +150,7 @@ protected function _asText($shellList) {
/**
* Generates the shell list sorted by where the shells are found.
*
* @param array $shellList
* @return void
*/
protected function _asSorted($shellList) {
Expand Down Expand Up @@ -184,6 +189,7 @@ protected function _asSorted($shellList) {
/**
* Output as XML
*
* @param array $shellList
* @return void
*/
protected function _asXml($shellList) {
Expand Down
4 changes: 4 additions & 0 deletions lib/Cake/Console/Command/ConsoleShell.php
Expand Up @@ -47,6 +47,7 @@ class ConsoleShell extends Shell {
/**
* Override initialize of the Shell
*
* @return void
*/
public function initialize() {
App::uses('Dispatcher', 'Routing');
Expand All @@ -71,6 +72,7 @@ public function initialize() {
/**
* Prints the help message
*
* @return void
*/
public function help() {
$out = 'Console help:';
Expand Down Expand Up @@ -133,6 +135,8 @@ public function help() {
/**
* Override main() to handle action
*
* @param string $command
* @return void
*/
public function main($command = null) {
while (true) {
Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/Console/Command/I18nShell.php
Expand Up @@ -40,6 +40,7 @@ class I18nShell extends Shell {
/**
* Override startup of the Shell
*
* @return mixed
*/
public function startup() {
$this->_welcome();
Expand All @@ -58,6 +59,7 @@ public function startup() {
/**
* Override main() for help message hook
*
* @return void
*/
public function main() {
$this->out(__d('cake_console', '<info>I18n Shell</info>'));
Expand Down Expand Up @@ -91,6 +93,7 @@ public function main() {
/**
* Initialize I18N database.
*
* @return void
*/
public function initdb() {
$this->dispatchShell('schema create i18n');
Expand Down
15 changes: 15 additions & 0 deletions lib/Cake/Console/Command/SchemaShell.php
Expand Up @@ -47,6 +47,7 @@ class SchemaShell extends Shell {
/**
* Override initialize
*
* @return string
*/
public function initialize() {
$this->_welcome();
Expand All @@ -57,6 +58,7 @@ public function initialize() {
/**
* Override startup
*
* @return void
*/
public function startup() {
$name = $path = $connection = $plugin = null;
Expand Down Expand Up @@ -103,6 +105,7 @@ public function startup() {
* Read and output contents of schema object
* path to read as second arg
*
* @return void
*/
public function view() {
$File = new File($this->Schema->path . DS . $this->params['file']);
Expand All @@ -120,6 +123,7 @@ public function view() {
* Read database and Write schema object
* accepts a connection as first arg or path to save as second arg
*
* @return void
*/
public function generate() {
$this->out(__d('cake_console', 'Generating Schema...'));
Expand Down Expand Up @@ -197,6 +201,7 @@ public function generate() {
* If -write contains a full path name the file will be saved there. If -write only
* contains no DS, that will be used as the file name, in the same dir as the schema file.
*
* @return string
*/
public function dump() {
$write = false;
Expand Down Expand Up @@ -300,6 +305,9 @@ function _loadSchema() {
* Create database from Schema object
* Should be called via the run method
*
* @param CakeSchema $Schema
* @param string $table
* @return void
*/
function __create($Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
Expand Down Expand Up @@ -342,6 +350,9 @@ function __create($Schema, $table = null) {
* Update database with Schema object
* Should be called via the run method
*
* @param CakeSchema $Schema
* @param string $table
* @return void
*/
function __update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
Expand Down Expand Up @@ -383,6 +394,10 @@ function __update(&$Schema, $table = null) {
/**
* Runs sql from __create() or __update()
*
* @param array $contents
* @param string $event
* @param CakeSchema $Schema
* @return void
*/
function __run($contents, $event, &$Schema) {
if (empty($contents)) {
Expand Down
9 changes: 7 additions & 2 deletions lib/Cake/Console/Command/Task/ControllerTask.php
Expand Up @@ -43,6 +43,7 @@ class ControllerTask extends BakeTask {
/**
* Override initialize
*
* @return void
*/
public function initialize() {
$this->path = current(App::path('Controller'));
Expand All @@ -51,6 +52,7 @@ public function initialize() {
/**
* Execution method always used for tasks
*
* @return void
*/
public function execute() {
parent::execute();
Expand Down Expand Up @@ -203,6 +205,10 @@ protected function _interactive() {
/**
* Confirm a to be baked controller with the user
*
* @param string $controllerName
* @param string $useDynamicScaffold
* @param array $helpers
* @param array $components
* @return void
*/
public function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
Expand Down Expand Up @@ -299,7 +305,6 @@ public function bakeActions($controllerName, $admin = null, $wannaUseSession = t
* @param string $actions Actions to add, or set the whole controller to use $scaffold (set $actions to 'scaffold')
* @param array $helpers Helpers to use in controller
* @param array $components Components to use in controller
* @param array $uses Models to use in controller
* @return string Baked controller
*/
public function bake($controllerName, $actions = '', $helpers = null, $components = null) {
Expand Down Expand Up @@ -378,7 +383,6 @@ protected function _doPropertyChoices($prompt, $example) {
* Outputs and gets the list of possible controllers from database
*
* @param string $useDbConfig Database configuration name
* @param boolean $interactive Whether you are using listAll interactively and want options output.
* @return array Set of controllers
*/
public function listAll($useDbConfig = null) {
Expand Down Expand Up @@ -462,6 +466,7 @@ public function getOptionParser() {
/**
* Displays help contents
*
* @return void
*/
public function help() {
$this->hr();
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Console/Command/Task/DbConfigTask.php
Expand Up @@ -60,7 +60,7 @@ class DbConfigTask extends Shell {
/**
* initialization callback
*
* @var string
* @return void
*/
public function initialize() {
$this->path = APP . 'Config' . DS;
Expand All @@ -69,6 +69,7 @@ public function initialize() {
/**
* Execution method always used for tasks
*
* @return void
*/
public function execute() {
if (empty($this->args)) {
Expand Down Expand Up @@ -197,6 +198,7 @@ protected function _interactive() {
/**
* Output verification message and bake if it looks good
*
* @param array $config
* @return boolean True if user says it looks good, false otherwise
*/
protected function _verify($config) {
Expand Down

0 comments on commit a0ee8b4

Please sign in to comment.