The rbac is a command available once you are already in the interactive shell. Do no specify this as part of executing the command to start the shell. So, first start the interactive shell (assuming you want to load the main config.php file as your shell context):
yiic shell config/main.php
which should result in something similiar to the following (1.1.4 in your case):
Yii Interactive Tool v1.1 (based on Yii v1.1.2)
Please type ‘help’ for help. Type ‘exit’ to quit.
>>
Then at the >> prompt, type ‘help’
>>help
This will give you a list of all available commands. If rbac is in the list, you can execute it
If you are following along with the book, and are using the CDbAuthManager implementation of auth manger, then it is using the database tables to store the hierarchy:
ok, but how come nothing was saved in the tables after I ran the script and even though the shell said the generation of hierarchy was successful ? ( I copied the exact code and see to it there’s no typo error ).
I didn’t read the book, so sorry, if i’m wrong because things are handled differently. But from the configuration you pasted i’d say you have not configured an authManager component at all, now.
<?php
// This is the configuration for yiic console application.
// Any writable CConsoleApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Console Application',
'preload'=>array('log'),
'components'=>array(
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
),
),
'authManager'=>array(
'class' => 'CDbAuthManager',
'connectionID' => 'db',
),
),
);
am getting this error, what’s it all about this time?, the way I understand it, it’s looking for a connection string,
I checked the main.php file and I saw this as part of the db array, but the console.php file array , has a key of “connectionID”, what’s the ID was it looking for? is the value assigned to it correct ? or do I need to replace that key value something else ?
I just read the book, i manage to run the command shell and sees that the data are written in to the DB but was stuck where I was told to create the new table with: