I want to use Yii document generator, i have extracted the source in protected/commands.
When I try to run the command:
yiic docs check
it says:
Yii command runner (based on Yii v1.1.8)
Usage: c:\wamp\www\FRAMEW~1\yiic <command-name> [parameters...]
The following commands are available:
- message
- migrate
- shell
- webapp
To see individual command help, use the following:
c:\wamp\www\FRAMEW~1\yiic help <command-name>
Do I need to edit any config to run docs command ?
You can add a Command to your CConsoleApplication by adding it to the commandMap.
add this to your
protected/config/console.php:after that
yiic docswill run DocsCommand and it also should appear in the list of available commands.You have to do this in your console application config since CWebapplication and CConsoleApplication have many different properties you can set via config.
commandMapin this example is a property of CConsoleApplication but not of CWebApplication so you can only define it in console app. Read more about configuration in Yii’s Definitive GuideAlso if you have a look at the yiic.php in your applications protected path you will see it includes the
console.phpfile:If you have configuration that should be the same for web and console, for example a database connection, you can put that into an own config file e.g.
config/db.phpand include it in bothconfig/main.phpandconfig/console.phplike this: